forked from speedie/spmenu
add more descriptive comments
This commit is contained in:
parent
c1a7afe1f4
commit
06fe388033
42
spmenu.c
42
spmenu.c
|
@ -22,6 +22,11 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
// set version
|
||||||
|
#ifndef VERSION
|
||||||
|
#define VERSION "unknown"
|
||||||
|
#endif
|
||||||
|
|
||||||
// check if we should enable right to left language support
|
// check if we should enable right to left language support
|
||||||
#ifndef RTL
|
#ifndef RTL
|
||||||
#define USERTL 0
|
#define USERTL 0
|
||||||
|
@ -64,10 +69,6 @@
|
||||||
#define USEXRESOURCES 1
|
#define USEXRESOURCES 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef VERSION
|
|
||||||
#define VERSION "unknown"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// include fribidi used for right to left language support
|
// include fribidi used for right to left language support
|
||||||
#if USERTL
|
#if USERTL
|
||||||
#include <fribidi.h>
|
#include <fribidi.h>
|
||||||
|
@ -111,9 +112,9 @@
|
||||||
#include "libs/define.c"
|
#include "libs/define.c"
|
||||||
|
|
||||||
// mode
|
// mode
|
||||||
static char modetext[16] = "Insert"; // default mode text
|
static char modetext[16]; // default mode text
|
||||||
static int curMode = 1; // 0 is command mode
|
static int curMode; // 0 is command mode
|
||||||
static int allowkeys = 1; // whether or not to interpret a keypress as an insertion
|
static int allowkeys; // whether or not to interpret a keypress as an insertion
|
||||||
|
|
||||||
// various headers
|
// various headers
|
||||||
#include "libs/libdrw/drw.h"
|
#include "libs/libdrw/drw.h"
|
||||||
|
@ -133,24 +134,17 @@ static int allowkeys = 1; // whether or not to interpret a keypress as an insert
|
||||||
// text
|
// text
|
||||||
static char text[BUFSIZ] = "";
|
static char text[BUFSIZ] = "";
|
||||||
static char numbers[NUMBERSBUFSIZE] = "";
|
static char numbers[NUMBERSBUFSIZE] = "";
|
||||||
|
static char *embed; // x11 embed
|
||||||
// high priority
|
|
||||||
static int hplength = 0;
|
|
||||||
static char **hpitems = NULL;
|
|
||||||
|
|
||||||
// embed
|
|
||||||
static char *embed;
|
|
||||||
|
|
||||||
// keybinds
|
// keybinds
|
||||||
static int numlockmask = 0;
|
static int numlockmask = 0;
|
||||||
static int capslockstate = 0;
|
static int capslockstate = 0;
|
||||||
|
|
||||||
// height of each item, menu width, menu height
|
static int bh, mw, mh; // height of each item, menu width, menu height
|
||||||
static int bh, mw, mh;
|
static int reallines = 0; // temporary integer which holds lines
|
||||||
static int reallines = 0;
|
static int inputw = 0; // input width
|
||||||
static int inputw = 0;
|
static int promptw; // prompt width
|
||||||
static int promptw;
|
static int plw = 0; // powerline width
|
||||||
static int plw = 0;
|
|
||||||
static int lrpad; // sum of left and right padding
|
static int lrpad; // sum of left and right padding
|
||||||
static int vp; // vertical padding for bar
|
static int vp; // vertical padding for bar
|
||||||
static int sp; // side padding for bar
|
static int sp; // side padding for bar
|
||||||
|
@ -158,12 +152,14 @@ static int cursorstate = 1; // cursor state
|
||||||
static int itemnumber = 0; // item number
|
static int itemnumber = 0; // item number
|
||||||
static size_t cursor;
|
static size_t cursor;
|
||||||
static struct item *items = NULL, *backup_items, *list_items;
|
static struct item *items = NULL, *backup_items, *list_items;
|
||||||
static struct item *matches, *matchend;
|
static struct item *matches, *matchend; // matches, final match
|
||||||
static struct item *prev, *curr, *next, *sel;
|
static struct item *prev, *curr, *next, *sel; // previous, current, next, selected
|
||||||
|
static int hplength = 0; // high priority
|
||||||
|
static char **hpitems = NULL; // high priority
|
||||||
static int *sel_index = NULL;
|
static int *sel_index = NULL;
|
||||||
static unsigned int sel_size = 0;
|
static unsigned int sel_size = 0;
|
||||||
static int screen;
|
static int screen;
|
||||||
static int itemn = 0;
|
static int itemn = 0; // item number
|
||||||
|
|
||||||
// item struct
|
// item struct
|
||||||
struct item {
|
struct item {
|
||||||
|
|
Loading…
Reference in a new issue