-
Notifications
You must be signed in to change notification settings - Fork 0
/
klicknmenu.h
52 lines (44 loc) · 1.43 KB
/
klicknmenu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _KLICKNMENU_H_
#define _KLICKNMENU_H_
#define COPY_INTVALUE(v) \
v = atoi(pch);
#define COPY_STRVALUE(v) { \
char *temp = malloc(sizeof(char) * (strlen(pch) + 1)); \
strncpy( temp, pch, strlen(pch) ); \
v = temp; \
continue; \
}
#define ISOPTION(v) ( strncmp(pch, v, strlen(v)) == 0 )
#define ISENDMENU(v) ( strncmp(v, OPTION_ENDMENU, strlen(OPTION_ENDMENU)) == 0 )
/* miscelleneous values for parsing config file */
extern int menu_width;
extern int menu_height;
extern int menu_padding;
extern int border_width;
extern char* border_color;
extern int entry_height;
extern char* bgColor;
extern char* fgColor;
extern char* focus_bgColor;
extern char* focus_fgColor;
extern char* fontname;
/* location values of mouse */
extern int pointer_x;
extern int pointer_y;
extern ALIGN align;
extern ENTRY* lastentry;
extern ENTRY* menu;
void initmenu(void);
void checkValues(void);
int getLevel(char* str);
int numberOfMenu(int level);
ENTRY* makeNewEntry(char* str);
void initConfig(FILE* fp);
char* trimTabspace(char* str);
void tolowerString(char* str);
#ifdef _DEBUG_ON_
void showEntry(ENTRY* target);
void showMenu(ENTRY* ent);
void showValues(void);
#endif
#endif