Make AddMouseRegion's index unsigned
[dockapps.git] / wmtunlo / docklib.h
blob250e1c346b9f27ae651f0f112b4e2448938fc206
1 /*--------------------------------*/
2 /* a simple dockapp library */
3 /* made from scratch */
4 /*--------------------------------*/
6 /*
7 functions were written by following People:
9 --- linked list
10 Kresten Krab Thorup
11 Alfredo K. Kojima
13 --- built-in Dock module for WindowMaker
14 Alfredo K. Kojima
16 --- wmgeneral (taken from wmppp)
17 Martijn Pieterse (pieterse@xs4all.nl)
19 --- prefs routines
20 Tomasz M±ka
24 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
25 # define INLINE inline
26 #else
27 # define INLINE
28 #endif
30 typedef struct LinkedList {
31 void *head;
32 struct LinkedList *tail;
33 } LinkedList;
35 INLINE LinkedList* list_cons(void* head, LinkedList* tail);
37 INLINE int list_length(LinkedList* list);
39 INLINE void* list_nth(int index, LinkedList* list);
41 INLINE void list_remove_head(LinkedList** list);
43 INLINE LinkedList *list_remove_elem(LinkedList* list, void* elem);
45 INLINE void list_mapcar(LinkedList* list, void(*function)(void*));
47 INLINE LinkedList*list_find(LinkedList* list, void* elem);
49 INLINE void list_free(LinkedList* list);
52 extern void parse_command(char *, char ***, int *);
54 extern pid_t execCommand(char *);
57 /***********/
58 /* Defines */
59 /***********/
61 #define MAX_MOUSE_REGION (8)
63 /************/
64 /* Typedefs */
65 /************/
67 typedef struct _rckeys rckeys;
69 struct _rckeys {
70 const char *label;
71 char **var;
74 typedef struct {
75 Pixmap pixmap;
76 Pixmap mask;
77 XpmAttributes attributes;
78 } XpmIcon;
80 /*******************/
81 /* Global variable */
82 /*******************/
84 Display *display;
85 Window Root;
86 int d_depth;
87 GC NormalGC;
88 XpmIcon wmgen;
89 Window iconwin, win;
91 /***********************/
92 /* Function Prototypes */
93 /***********************/
95 void AddMouseRegion(unsigned index, int left, int top, int right, int bottom);
96 int CheckMouseRegion(int x, int y);
98 void openXwindow(int argc, char *argv[], char **, char *, int, int);
99 void RedrawWindow(void);
100 void RedrawWindowXY(int x, int y);
102 void copyXPMArea(int, int, int, int, int, int);
103 void copyXBMArea(int, int, int, int, int, int);
104 void setMaskXY(int, int);
106 void parse_rcfile(const char *, rckeys *);
109 #define P_READ 1
110 #define P_WRITE 2
112 #define null_char '\0'
113 #define crlf_char '\n'
114 #define slash "/"
116 #define MAX_LINE_LEN 512
117 #define MAX_VALUE_LEN 256
119 #define MAX_PATH 1024
121 char* p_getfilename_config (char *config_dir, char *config_filename);
122 void* p_prefs_openfile (char *filename, int openmode);
123 void p_prefs_closefile (void);
124 void p_prefs_put_int (char *tagname, int value);
125 void p_prefs_put_float (char *tagname, float value);
126 void p_prefs_put_string (char *tagname, char *value);
127 void p_prefs_put_lf (void);
128 void p_prefs_put_comment (char *comment);
129 int p_prefs_get_int (char *tagname);
130 float p_prefs_get_float (char *tagname);
131 char* p_prefs_get_string (char *tagname);