summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2019-03-12 16:53:14 +0100
committerKim Woelders <kim@woelders.dk>2019-03-13 18:52:38 +0100
commit2e970c84f810ac354962d98eef86fd5cb33d7575 (patch)
tree6dfa4223620df258440c7b5f96a1311ce18eaa20
parent722ca7bb8182fa568c95ccff1d107754ac7e5c1e (diff)
Fix build with -fvisibility=hidden
Just using EAPI from Imlib2.h.
-rw-r--r--api/epplet.c2
-rw-r--r--api/epplet.h.in264
2 files changed, 133 insertions, 133 deletions
diff --git a/api/epplet.c b/api/epplet.c
index c3b58e4..4866bd0 100644
--- a/api/epplet.c
+++ b/api/epplet.c
@@ -32,7 +32,7 @@ typedef struct epplet_window
32EppWindow; 32EppWindow;
33typedef EppWindow *Epplet_window; 33typedef EppWindow *Epplet_window;
34 34
35Display *disp = NULL; 35EAPI Display *disp = NULL;
36 36
37static int window_num = 0; /* For window list */ 37static int window_num = 0; /* For window list */
38static Epplet_window *windows = NULL; /* List of windows to loop though */ 38static Epplet_window *windows = NULL; /* List of windows to loop though */
diff --git a/api/epplet.h.in b/api/epplet.h.in
index a04c010..cef0c5f 100644
--- a/api/epplet.h.in
+++ b/api/epplet.h.in
@@ -44,9 +44,9 @@
44#define Evsnprintf vsnprintf 44#define Evsnprintf vsnprintf
45#define Esnprintf snprintf 45#define Esnprintf snprintf
46#else 46#else
47int Evsnprintf(char *str, size_t count, const char *fmt, 47EAPI int Evsnprintf(char *str, size_t count, const char *fmt,
48 va_list args); 48 va_list args);
49int Esnprintf(char *str, size_t count, const char *fmt, ...); 49EAPI int Esnprintf(char *str, size_t count, const char *fmt, ...);
50#endif /* HAVE_SNPRINTF */ 50#endif /* HAVE_SNPRINTF */
51 51
52/****************************************************************************/ 52/****************************************************************************/
@@ -91,7 +91,7 @@ typedef enum gad_type
91/* sized window. You also need to pass your argc and argv parameters your */ 91/* sized window. You also need to pass your argc and argv parameters your */
92/* main() function gets. vertical is a flag as to if the app is vertical. */ 92/* main() function gets. vertical is a flag as to if the app is vertical. */
93/* Apps that are more horizontal than vertical should set this to 0. */ 93/* Apps that are more horizontal than vertical should set this to 0. */
94void Epplet_Init(const char *name, const char *version, 94EAPI void Epplet_Init(const char *name, const char *version,
95 const char *info, int w, int h, 95 const char *info, int w, int h,
96 int argc, char **argv, char vertical); 96 int argc, char **argv, char vertical);
97 97
@@ -100,100 +100,100 @@ void Epplet_Init(const char *name, const char *version,
100/****************************************************************************/ 100/****************************************************************************/
101/* You HAVE to call this before exiting your epplet! */ 101/* You HAVE to call this before exiting your epplet! */
102 102
103void Epplet_cleanup(void); 103EAPI void Epplet_cleanup(void);
104 104
105/* actualy display the app */ 105/* actualy display the app */
106void Epplet_show(void); 106EAPI void Epplet_show(void);
107 107
108/* ask E to remember stuff about it - you don't need to do this at startup */ 108/* ask E to remember stuff about it - you don't need to do this at startup */
109/* or whenver the Epplet moves etc.- this is done for you, but if you need */ 109/* or whenver the Epplet moves etc.- this is done for you, but if you need */
110/* to for some special reason - call it */ 110/* to for some special reason - call it */
111void Epplet_remember(void); 111EAPI void Epplet_remember(void);
112 112
113/* if you dont want E to remember anything abotu you or start you up anymore */ 113/* if you dont want E to remember anything abotu you or start you up anymore */
114/* call this - this is a good call to make if you want to exit and never */ 114/* call this - this is a good call to make if you want to exit and never */
115/* have yourself started up again by E */ 115/* have yourself started up again by E */
116void Epplet_unremember(void); 116EAPI void Epplet_unremember(void);
117 117
118/* return the window id of the main epplet window */ 118/* return the window id of the main epplet window */
119Window Epplet_get_main_window(void); 119EAPI Window Epplet_get_main_window(void);
120 120
121/* return the X display connection used */ 121/* return the X display connection used */
122Display *Epplet_get_display(void); 122EAPI Display *Epplet_get_display(void);
123 123
124/* Get locations and sizes of gadgets */ 124/* Get locations and sizes of gadgets */
125int Epplet_gadget_get_x(Epplet_gadget gad); 125EAPI int Epplet_gadget_get_x(Epplet_gadget gad);
126int Epplet_gadget_get_y(Epplet_gadget gad); 126EAPI int Epplet_gadget_get_y(Epplet_gadget gad);
127int Epplet_gadget_get_width(Epplet_gadget gad); 127EAPI int Epplet_gadget_get_width(Epplet_gadget gad);
128int Epplet_gadget_get_height(Epplet_gadget gad); 128EAPI int Epplet_gadget_get_height(Epplet_gadget gad);
129int Epplet_gadget_get_type(Epplet_gadget gad); 129EAPI int Epplet_gadget_get_type(Epplet_gadget gad);
130 130
131/****************************************************************************/ 131/****************************************************************************/
132/* IPC calls */ 132/* IPC calls */
133/****************************************************************************/ 133/****************************************************************************/
134/* send the string "s" to Enlightenment */ 134/* send the string "s" to Enlightenment */
135void Epplet_send_ipc(const char *s); 135EAPI void Epplet_send_ipc(const char *s);
136 136
137/* sit and wait for an IPc message - nothing happens whilst waiting no */ 137/* sit and wait for an IPc message - nothing happens whilst waiting no */
138/* timers run, no events or anything else is handled. */ 138/* timers run, no events or anything else is handled. */
139char *Epplet_wait_for_ipc(void); 139EAPI char *Epplet_wait_for_ipc(void);
140 140
141/* take the imageclass called iclass in state state ("normal", "hilited", */ 141/* take the imageclass called iclass in state state ("normal", "hilited", */
142/* "clicked") and set it as the backgorund pixmap to window ww and have */ 142/* "clicked") and set it as the backgorund pixmap to window ww and have */
143/* its shape mask be the shape of the window ww */ 143/* its shape mask be the shape of the window ww */
144void Epplet_imageclass_apply(const char *iclass, 144EAPI void Epplet_imageclass_apply(const char *iclass,
145 const char *state, Window ww); 145 const char *state, Window ww);
146 146
147/* paste the imageclass iclass in state state in window ww at (x,y) at a */ 147/* paste the imageclass iclass in state state in window ww at (x,y) at a */
148/* size of (w x h) */ 148/* size of (w x h) */
149void Epplet_imageclass_paste(const char *iclass, 149EAPI void Epplet_imageclass_paste(const char *iclass,
150 const char *state, Window ww, int x, 150 const char *state, Window ww, int x,
151 int y, int w, int h); 151 int y, int w, int h);
152 152
153/* return pixmaps of imageclass iclass in the state state and place the */ 153/* return pixmaps of imageclass iclass in the state state and place the */
154/* pixmap and mask ID's in the Pixmaps Id's poitned to by p and m, and have */ 154/* pixmap and mask ID's in the Pixmaps Id's poitned to by p and m, and have */
155/* the pximaps be of size (w x h) */ 155/* the pximaps be of size (w x h) */
156void Epplet_imageclass_get_pixmaps(const char *iclass, 156EAPI void Epplet_imageclass_get_pixmaps(const char *iclass,
157 const char *state, Pixmap * p, 157 const char *state, Pixmap * p,
158 Pixmap * m, int w, int h); 158 Pixmap * m, int w, int h);
159 159
160/* draw the text class tclass in state state on window ww at x, y with the */ 160/* draw the text class tclass in state state on window ww at x, y with the */
161/* text "txt" */ 161/* text "txt" */
162void Epplet_textclass_draw(const char *tclass, const char *state, 162EAPI void Epplet_textclass_draw(const char *tclass, const char *state,
163 Window ww, int x, int y, 163 Window ww, int x, int y,
164 const char *txt); 164 const char *txt);
165 165
166/* get the size text for textclass tclass will be using the text "txt" and */ 166/* get the size text for textclass tclass will be using the text "txt" and */
167/* return widht and height to the int's pointed to by e and h */ 167/* return widht and height to the int's pointed to by e and h */
168void Epplet_textclass_get_size(const char *tclass, int *w, 168EAPI void Epplet_textclass_get_size(const char *tclass, int *w,
169 int *h, const char *txt); 169 int *h, const char *txt);
170 170
171/* the epplet main loop - once you've set up and showed your epplet window */ 171/* the epplet main loop - once you've set up and showed your epplet window */
172/* call this */ 172/* call this */
173void Epplet_Loop(void); 173EAPI void Epplet_Loop(void);
174 174
175/* call the function func with data as its data param whenever an expose */ 175/* call the function func with data as its data param whenever an expose */
176/* happens and needs to be handled */ 176/* happens and needs to be handled */
177void Epplet_register_expose_handler(void (*func) 177EAPI void Epplet_register_expose_handler(void (*func)
178 (void *data, Window win, 178 (void *data, Window win,
179 int x, int y, int w, int h), 179 int x, int y, int w, int h),
180 void *data); 180 void *data);
181 181
182/* call func whenever the epplet is moved */ 182/* call func whenever the epplet is moved */
183void Epplet_register_move_resize_handler(void (*func) 183EAPI void Epplet_register_move_resize_handler(void (*func)
184 (void *data, Window win, 184 (void *data, Window win,
185 int x, int y, int w, 185 int x, int y, int w,
186 int h), void *data); 186 int h), void *data);
187 187
188/* call func whenever a button is pressed */ 188/* call func whenever a button is pressed */
189void Epplet_register_button_press_handler(void (*func) 189EAPI void Epplet_register_button_press_handler(void (*func)
190 (void *data, 190 (void *data,
191 Window win, int x, 191 Window win, int x,
192 int y, int b), 192 int y, int b),
193 void *data); 193 void *data);
194 194
195/* call func whenever a button is released */ 195/* call func whenever a button is released */
196void Epplet_register_button_release_handler(void (*func) 196EAPI void Epplet_register_button_release_handler(void (*func)
197 (void *data, 197 (void *data,
198 Window win, int x, 198 Window win, int x,
199 int y, int b), 199 int y, int b),
@@ -201,60 +201,60 @@ void Epplet_register_button_release_handler(void (*func)
201 201
202/* call func whenever a key is pressed (pass a string version of the key */ 202/* call func whenever a key is pressed (pass a string version of the key */
203/* pressed to the regsitsered function) */ 203/* pressed to the regsitsered function) */
204void Epplet_register_key_press_handler(void (*func) 204EAPI void Epplet_register_key_press_handler(void (*func)
205 (void *data, Window win, 205 (void *data, Window win,
206 char *key), void *data); 206 char *key), void *data);
207 207
208/* call func whenever a key is released (pass a string version of the key */ 208/* call func whenever a key is released (pass a string version of the key */
209/* pressed to the regsitsered function) */ 209/* pressed to the regsitsered function) */
210void Epplet_register_key_release_handler(void (*func) 210EAPI void Epplet_register_key_release_handler(void (*func)
211 (void *data, Window win, 211 (void *data, Window win,
212 char *key), 212 char *key),
213 void *data); 213 void *data);
214 214
215/* call func whenever a the mouse is moved in a window */ 215/* call func whenever a the mouse is moved in a window */
216void Epplet_register_mouse_motion_handler(void (*func) 216EAPI void Epplet_register_mouse_motion_handler(void (*func)
217 (void *data, 217 (void *data,
218 Window win, int x, 218 Window win, int x,
219 int y), void *data); 219 int y), void *data);
220 220
221/* call func whenever a the mouse enters a window */ 221/* call func whenever a the mouse enters a window */
222void Epplet_register_mouse_enter_handler(void (*func) 222EAPI void Epplet_register_mouse_enter_handler(void (*func)
223 (void *data, 223 (void *data,
224 Window win), 224 Window win),
225 void *data); 225 void *data);
226 226
227/* call func whenever a the mouse leaves a window */ 227/* call func whenever a the mouse leaves a window */
228void Epplet_register_mouse_leave_handler(void (*func) 228EAPI void Epplet_register_mouse_leave_handler(void (*func)
229 (void *data, 229 (void *data,
230 Window win), 230 Window win),
231 void *data); 231 void *data);
232 232
233/* call func whenever focus is active on your epplet window */ 233/* call func whenever focus is active on your epplet window */
234void Epplet_register_focus_in_handler(void (*func) 234EAPI void Epplet_register_focus_in_handler(void (*func)
235 (void *data, Window win), 235 (void *data, Window win),
236 void *data); 236 void *data);
237 237
238/* call func whenever leaves your epplet window */ 238/* call func whenever leaves your epplet window */
239void Epplet_register_focus_out_handler(void (*func) 239EAPI void Epplet_register_focus_out_handler(void (*func)
240 (void *data, Window win), 240 (void *data, Window win),
241 void *data); 241 void *data);
242 242
243/* call func and pass a pointer to n XEvent on every event that happens */ 243/* call func and pass a pointer to n XEvent on every event that happens */
244void Epplet_register_event_handler(void (*func) 244EAPI void Epplet_register_event_handler(void (*func)
245 (void *data, XEvent * ev), 245 (void *data, XEvent * ev),
246 void *data); 246 void *data);
247 247
248/* call func and pass a string (that you dont have to free) with the IPC */ 248/* call func and pass a string (that you dont have to free) with the IPC */
249/* message whenever e sends you an IPC message */ 249/* message whenever e sends you an IPC message */
250void Epplet_register_comms_handler(void (*func) 250EAPI void Epplet_register_comms_handler(void (*func)
251 (void *data, const char *s), 251 (void *data, const char *s),
252 void *data); 252 void *data);
253 253
254/* call func when a window is closed by the wm. This func must return a 254/* call func when a window is closed by the wm. This func must return a
255 * value. Return 1 and the window will be destroyed for you, return 0 and it 255 * value. Return 1 and the window will be destroyed for you, return 0 and it
256 * will not */ 256 * will not */
257void Epplet_register_delete_event_handler(int (*func) 257EAPI void Epplet_register_delete_event_handler(int (*func)
258 (void *data, 258 (void *data,
259 Window win), 259 Window win),
260 void *data); 260 void *data);
@@ -266,18 +266,18 @@ void Epplet_register_delete_event_handler(int (*func)
266/* run function func and pass data data to it in in seconds (in is double */ 266/* run function func and pass data data to it in in seconds (in is double */
267/* so you can for exmaple use 0.5 to have that function called in 0.5 */ 267/* so you can for exmaple use 0.5 to have that function called in 0.5 */
268/* seconds from now ). You also attach the name to the timeout of name */ 268/* seconds from now ). You also attach the name to the timeout of name */
269void Epplet_timer(void (*func) (void *data), void *data, 269EAPI void Epplet_timer(void (*func) (void *data), void *data,
270 double in, const char *name); 270 double in, const char *name);
271 271
272/* delete any timeout of name name in the queue. you should use unique */ 272/* delete any timeout of name name in the queue. you should use unique */
273/* names for different timeouts in the queue */ 273/* names for different timeouts in the queue */
274void Epplet_remove_timer(const char *name); 274EAPI void Epplet_remove_timer(const char *name);
275 275
276/* get the data passed to a timer */ 276/* get the data passed to a timer */
277void *Epplet_timer_get_data(const char *name); 277EAPI void *Epplet_timer_get_data(const char *name);
278 278
279/* get the current time as a double (time is in seconds since Jan 1, 1970 */ 279/* get the current time as a double (time is in seconds since Jan 1, 1970 */
280double Epplet_get_time(void); 280EAPI double Epplet_get_time(void);
281 281
282/****************************************************************************/ 282/****************************************************************************/
283/* widgets available from the epplet api that use images from E to define */ 283/* widgets available from the epplet api that use images from E to define */
@@ -293,25 +293,25 @@ double Epplet_get_time(void);
293/* unless you want a special parent (only buttons can be speically parented */ 293/* unless you want a special parent (only buttons can be speically parented */
294/* and the function func si called whne the button is clicked and data is */ 294/* and the function func si called whne the button is clicked and data is */
295/* passed to that function */ 295/* passed to that function */
296Epplet_gadget Epplet_create_button(const char *label, const char *image, 296EAPI Epplet_gadget Epplet_create_button(const char *label, const char *image,
297 int x, int y, int w, int h, 297 int x, int y, int w, int h,
298 const char *std, Window parent, 298 const char *std, Window parent,
299 Epplet_gadget pop_parent, 299 Epplet_gadget pop_parent,
300 void (*func) (void *data), void *data); 300 void (*func) (void *data), void *data);
301 301
302/* A cut down version for text-only buttons */ 302/* A cut down version for text-only buttons */
303Epplet_gadget Epplet_create_text_button(const char *label, int x, int y, 303EAPI Epplet_gadget Epplet_create_text_button(const char *label, int x, int y,
304 int w, int h, 304 int w, int h,
305 void (*func) (void *data), 305 void (*func) (void *data),
306 void *data); 306 void *data);
307 307
308/* A cut down version for std-image-only buttons */ 308/* A cut down version for std-image-only buttons */
309Epplet_gadget Epplet_create_std_button(const char *std, int x, int y, 309EAPI Epplet_gadget Epplet_create_std_button(const char *std, int x, int y,
310 void (*func) (void *data), 310 void (*func) (void *data),
311 void *data); 311 void *data);
312 312
313/* A cut down version for image-only buttons */ 313/* A cut down version for image-only buttons */
314Epplet_gadget Epplet_create_image_button(const char *image, int x, int y, 314EAPI Epplet_gadget Epplet_create_image_button(const char *image, int x, int y,
315 int w, int h, 315 int w, int h,
316 void (*func) (void *data), 316 void (*func) (void *data),
317 void *data); 317 void *data);
@@ -320,46 +320,46 @@ Epplet_gadget Epplet_create_image_button(const char *image, int x, int y,
320 * the default contents, w, h, and 'size' as the font size. When ENTER is 320 * the default contents, w, h, and 'size' as the font size. When ENTER is
321 * pressed in the textbox, 'func' is executed. 321 * pressed in the textbox, 'func' is executed.
322 * */ 322 * */
323Epplet_gadget Epplet_create_textbox(const char *image, 323EAPI Epplet_gadget Epplet_create_textbox(const char *image,
324 const char *contents, int x, int y, 324 const char *contents, int x, int y,
325 int w, int h, char size, 325 int w, int h, char size,
326 void (*func) (void *data), 326 void (*func) (void *data),
327 void *data); 327 void *data);
328 328
329/* Retrieve the current contents of the textbox */ 329/* Retrieve the current contents of the textbox */
330const char *Epplet_textbox_contents(Epplet_gadget g); 330EAPI const char *Epplet_textbox_contents(Epplet_gadget g);
331 331
332/* Reset the textbox */ 332/* Reset the textbox */
333void Epplet_reset_textbox(Epplet_gadget eg); 333EAPI void Epplet_reset_textbox(Epplet_gadget eg);
334 334
335/* Change the contents of a textbox */ 335/* Change the contents of a textbox */
336void Epplet_change_textbox(Epplet_gadget eg, 336EAPI void Epplet_change_textbox(Epplet_gadget eg,
337 const char *new_contents); 337 const char *new_contents);
338void Epplet_textbox_insert(Epplet_gadget eg, 338EAPI void Epplet_textbox_insert(Epplet_gadget eg,
339 const char *new_contents); 339 const char *new_contents);
340 340
341/* create drawing area at (x,y) of size (w x h) */ 341/* create drawing area at (x,y) of size (w x h) */
342Epplet_gadget Epplet_create_drawingarea(int x, int y, int w, int h); 342EAPI Epplet_gadget Epplet_create_drawingarea(int x, int y, int w, int h);
343 343
344/* create horizontal slider at x, y of length len. the minimum length is 9 */ 344/* create horizontal slider at x, y of length len. the minimum length is 9 */
345/* pixels, and the width is always 8 pixels. min is the minimum value and */ 345/* pixels, and the width is always 8 pixels. min is the minimum value and */
346/* max is the maximum value. max should always > min. the slider can move */ 346/* max is the maximum value. max should always > min. the slider can move */
347/* by step units as a minimum step, and moves by jump whenever you click */ 347/* by step units as a minimum step, and moves by jump whenever you click */
348/* either side of the slider. whenever the slider changed func is called */ 348/* either side of the slider. whenever the slider changed func is called */
349Epplet_gadget Epplet_create_hslider(int x, int y, int len, int min, 349EAPI Epplet_gadget Epplet_create_hslider(int x, int y, int len, int min,
350 int max, int step, int jump, int *val, 350 int max, int step, int jump, int *val,
351 void (*func) (void *data), 351 void (*func) (void *data),
352 void *data); 352 void *data);
353 353
354/* same as horizontal slider except vertical */ 354/* same as horizontal slider except vertical */
355Epplet_gadget Epplet_create_vslider(int x, int y, int len, int min, 355EAPI Epplet_gadget Epplet_create_vslider(int x, int y, int len, int min,
356 int max, int step, int jump, int *val, 356 int max, int step, int jump, int *val,
357 void (*func) (void *data), 357 void (*func) (void *data),
358 void *data); 358 void *data);
359 359
360/* create a button (like normal buttons) except it toggles the value */ 360/* create a button (like normal buttons) except it toggles the value */
361/* pointed to by val between 1 and 0. func is called whenever it changes */ 361/* pointed to by val between 1 and 0. func is called whenever it changes */
362Epplet_gadget Epplet_create_togglebutton(const char *label, 362EAPI Epplet_gadget Epplet_create_togglebutton(const char *label,
363 const char *image, 363 const char *image,
364 int x, int y, int w, int h, 364 int x, int y, int w, int h,
365 int *val, 365 int *val,
@@ -368,24 +368,24 @@ Epplet_gadget Epplet_create_togglebutton(const char *label,
368 368
369/* creates a button just like normal button except it pops up the popup */ 369/* creates a button just like normal button except it pops up the popup */
370/* when clicked */ 370/* when clicked */
371Epplet_gadget Epplet_create_popupbutton(const char *label, 371EAPI Epplet_gadget Epplet_create_popupbutton(const char *label,
372 const char *image, 372 const char *image,
373 int x, int y, int w, int h, 373 int x, int y, int w, int h,
374 const char *std, 374 const char *std,
375 Epplet_gadget popup); 375 Epplet_gadget popup);
376 376
377/* creates an empty popup */ 377/* creates an empty popup */
378Epplet_gadget Epplet_create_popup(void); 378EAPI Epplet_gadget Epplet_create_popup(void);
379 379
380/* adds an image file pixmaps or label to the popup gadget and calls */ 380/* adds an image file pixmaps or label to the popup gadget and calls */
381/* func when it is selected */ 381/* func when it is selected */
382void Epplet_add_popup_entry(Epplet_gadget gadget, 382EAPI void Epplet_add_popup_entry(Epplet_gadget gadget,
383 const char *label, 383 const char *label,
384 const char *pixmap, 384 const char *pixmap,
385 void (*func) (void *data), 385 void (*func) (void *data),
386 void *data); 386 void *data);
387/* same as above, but specify a size */ 387/* same as above, but specify a size */
388void Epplet_add_sized_popup_entry(Epplet_gadget gadget, 388EAPI void Epplet_add_sized_popup_entry(Epplet_gadget gadget,
389 const char *label, 389 const char *label,
390 const char *pixmap, 390 const char *pixmap,
391 int w, int h, 391 int w, int h,
@@ -398,97 +398,97 @@ void Epplet_add_sized_popup_entry(Epplet_gadget gadget,
398/* added to the list. If entry_num is negative then is is relateive to */ 398/* added to the list. If entry_num is negative then is is relateive to */
399/* elements most recently added, -1 is the elemet most recently */ 399/* elements most recently added, -1 is the elemet most recently */
400/* added to the popup */ 400/* added to the popup */
401void Epplet_remove_popup_entry(Epplet_gadget gadget, 401EAPI void Epplet_remove_popup_entry(Epplet_gadget gadget,
402 int entry_num); 402 int entry_num);
403 403
404/* get the number of entries in a popup */ 404/* get the number of entries in a popup */
405int Epplet_popup_entry_num(Epplet_gadget gadget); 405EAPI int Epplet_popup_entry_num(Epplet_gadget gadget);
406 406
407/* get the data of a callback of a popup entry */ 407/* get the data of a callback of a popup entry */
408void *Epplet_popup_entry_get_data(Epplet_gadget gadget, 408EAPI void *Epplet_popup_entry_get_data(Epplet_gadget gadget,
409 int entry_num); 409 int entry_num);
410 410
411/* creates an image widget of the file image at (x,y) of size (w x h) */ 411/* creates an image widget of the file image at (x,y) of size (w x h) */
412Epplet_gadget Epplet_create_image(int x, int y, int w, int h, 412EAPI Epplet_gadget Epplet_create_image(int x, int y, int w, int h,
413 const char *image); 413 const char *image);
414 414
415/* puts a label widget of text label at (x,y) of size size. sizes are 0, 1 */ 415/* puts a label widget of text label at (x,y) of size size. sizes are 0, 1 */
416/* 2 and 3. 0 is normal , 1 is tiny, 2 is medium and 3 is big. experiment */ 416/* 2 and 3. 0 is normal , 1 is tiny, 2 is medium and 3 is big. experiment */
417Epplet_gadget Epplet_create_label(int x, int y, const char *label, 417EAPI Epplet_gadget Epplet_create_label(int x, int y, const char *label,
418 char size); 418 char size);
419 419
420/* creates a horizontal progress bar at (x,y) of size (w x h) displaying the */ 420/* creates a horizontal progress bar at (x,y) of size (w x h) displaying the */
421/* value val points to that is a value of 0-100. dir is the direction 0 */ 421/* value val points to that is a value of 0-100. dir is the direction 0 */
422/* indicates left to right and 1 indicates right to left */ 422/* indicates left to right and 1 indicates right to left */
423Epplet_gadget Epplet_create_hbar(int x, int y, int w, int h, char dir, 423EAPI Epplet_gadget Epplet_create_hbar(int x, int y, int w, int h, char dir,
424 int *val); 424 int *val);
425 425
426/* creates a vertical progress bar - dir of 0 is top to bottom, 1 is bottom */ 426/* creates a vertical progress bar - dir of 0 is top to bottom, 1 is bottom */
427/* to top */ 427/* to top */
428Epplet_gadget Epplet_create_vbar(int x, int y, int w, int h, char dir, 428EAPI Epplet_gadget Epplet_create_vbar(int x, int y, int w, int h, char dir,
429 int *val); 429 int *val);
430 430
431/* get the window id of the windopw to draw in in the drawing area */ 431/* get the window id of the windopw to draw in in the drawing area */
432Window Epplet_get_drawingarea_window(Epplet_gadget gadget); 432EAPI Window Epplet_get_drawingarea_window(Epplet_gadget gadget);
433 433
434/* change the background to either verticla or horizontal for the epplet */ 434/* change the background to either verticla or horizontal for the epplet */
435void Epplet_background_properties(char vertical, Window win); 435EAPI void Epplet_background_properties(char vertical, Window win);
436 436
437/* destroy a gadget */ 437/* destroy a gadget */
438void Epplet_gadget_destroy(Epplet_gadget gadget); 438EAPI void Epplet_gadget_destroy(Epplet_gadget gadget);
439 439
440/* hide a gadget */ 440/* hide a gadget */
441void Epplet_gadget_hide(Epplet_gadget gadget); 441EAPI void Epplet_gadget_hide(Epplet_gadget gadget);
442 442
443/* show a gadget */ 443/* show a gadget */
444void Epplet_gadget_show(Epplet_gadget gadget); 444EAPI void Epplet_gadget_show(Epplet_gadget gadget);
445 445
446/* move a gadget */ 446/* move a gadget */
447void Epplet_gadget_move(Epplet_gadget gadget, int x, int y); 447EAPI void Epplet_gadget_move(Epplet_gadget gadget, int x, int y);
448 448
449/* get the callback data from a gadget */ 449/* get the callback data from a gadget */
450void *Epplet_gadget_get_data(Epplet_gadget gadget); 450EAPI void *Epplet_gadget_get_data(Epplet_gadget gadget);
451 451
452/* if you chaged the value a gadget is pointing to call this on the gadget */ 452/* if you chaged the value a gadget is pointing to call this on the gadget */
453/* so it can update and redraw */ 453/* so it can update and redraw */
454void Epplet_gadget_data_changed(Epplet_gadget gadget); 454EAPI void Epplet_gadget_data_changed(Epplet_gadget gadget);
455 455
456/* Redraw a gadget. un_only should be set to 1 if you only want to "undraw" 456/* Redraw a gadget. un_only should be set to 1 if you only want to "undraw"
457 * the existing gadget. force should be 1 if you want to draw it even if it 457 * the existing gadget. force should be 1 if you want to draw it even if it
458 * is invisible. Beware that this could be a Bad Thing (tm). */ 458 * is invisible. Beware that this could be a Bad Thing (tm). */
459void Epplet_gadget_draw(Epplet_gadget gadget, int un_only, 459EAPI void Epplet_gadget_draw(Epplet_gadget gadget, int un_only,
460 int force); 460 int force);
461 461
462/* Redraw all gadgets. */ 462/* Redraw all gadgets. */
463void Epplet_redraw(void); 463EAPI void Epplet_redraw(void);
464 464
465/* change the popup a popbutton brings up and destroy the popup it currently */ 465/* change the popup a popbutton brings up and destroy the popup it currently */
466/* brings up */ 466/* brings up */
467void Epplet_change_popbutton_popup(Epplet_gadget gadget, 467EAPI void Epplet_change_popbutton_popup(Epplet_gadget gadget,
468 Epplet_gadget popup); 468 Epplet_gadget popup);
469 469
470/* change the label string contents of the gadget popbutton */ 470/* change the label string contents of the gadget popbutton */
471void Epplet_change_popbutton_label(Epplet_gadget gadget, 471EAPI void Epplet_change_popbutton_label(Epplet_gadget gadget,
472 const char *label); 472 const char *label);
473 473
474/* display the popup gadget above or below (dpeending where the window ww */ 474/* display the popup gadget above or below (dpeending where the window ww */
475/* is) the window ww, or if it's 0, deisplay where the pointer is */ 475/* is) the window ww, or if it's 0, deisplay where the pointer is */
476void Epplet_pop_popup(Epplet_gadget gadget, Window ww); 476EAPI void Epplet_pop_popup(Epplet_gadget gadget, Window ww);
477 477
478/* change the image file and widht & height of the image gadget */ 478/* change the image file and widht & height of the image gadget */
479void Epplet_change_image(Epplet_gadget gadget, int w, int h, 479EAPI void Epplet_change_image(Epplet_gadget gadget, int w, int h,
480 const char *image); 480 const char *image);
481 481
482/* change the x and y coordinates of the image gadget and change the image */ 482/* change the x and y coordinates of the image gadget and change the image */
483void Epplet_move_change_image(Epplet_gadget gadget, int x, int y, 483EAPI void Epplet_move_change_image(Epplet_gadget gadget, int x, int y,
484 int w, int h, const char *image); 484 int w, int h, const char *image);
485 485
486/* change the label string contents of the gadget label */ 486/* change the label string contents of the gadget label */
487void Epplet_change_label(Epplet_gadget gadget, 487EAPI void Epplet_change_label(Epplet_gadget gadget,
488 const char *label); 488 const char *label);
489 489
490/* move the label to a new x/y and change the text too */ 490/* move the label to a new x/y and change the text too */
491void Epplet_move_change_label(Epplet_gadget gadget, int x, int y, 491EAPI void Epplet_move_change_label(Epplet_gadget gadget, int x, int y,
492 const char *label); 492 const char *label);
493 493
494/****************************************************************************/ 494/****************************************************************************/
@@ -498,9 +498,9 @@ void Epplet_move_change_label(Epplet_gadget gadget, int x, int y,
498 498
499/* Create a window of width w, height h, with title title, using the themes 499/* Create a window of width w, height h, with title title, using the themes
500 * vertical (1), or horizontal (0) background */ 500 * vertical (1), or horizontal (0) background */
501Window Epplet_create_window(int w, int h, const char *title, 501EAPI Window Epplet_create_window(int w, int h, const char *title,
502 char vertical); 502 char vertical);
503Window Epplet_create_window_borderless(int w, int h, 503EAPI Window Epplet_create_window_borderless(int w, int h,
504 const char *title, 504 const char *title,
505 char vertical); 505 char vertical);
506 506
@@ -508,7 +508,7 @@ Window Epplet_create_window_borderless(int w, int h,
508 * functions listed for ok, apply and cancel. If you specify any of the 508 * functions listed for ok, apply and cancel. If you specify any of the
509 * functions as null, the button won't be displayed. This means you can get 509 * functions as null, the button won't be displayed. This means you can get
510 * just Ok and Cancel by supplying NULL for apply_cb. */ 510 * just Ok and Cancel by supplying NULL for apply_cb. */
511Window Epplet_create_window_config(int w, int h, const char *title, 511EAPI Window Epplet_create_window_config(int w, int h, const char *title,
512 void (*ok_func) (void *data), 512 void (*ok_func) (void *data),
513 void *ok_data, 513 void *ok_data,
514 void (*apply_func) (void *data), 514 void (*apply_func) (void *data),
@@ -523,62 +523,62 @@ Window Epplet_create_window_config(int w, int h, const char *title,
523 * fact, until you either push another window onto the context, or pop this 523 * fact, until you either push another window onto the context, or pop this
524 * one back off, all created gadgets will go on here. A create_window should 524 * one back off, all created gadgets will go on here. A create_window should
525 * always be followed by a pop_context (after gadgets have been added). */ 525 * always be followed by a pop_context (after gadgets have been added). */
526void Epplet_window_push_context(Window newwin); 526EAPI void Epplet_window_push_context(Window newwin);
527Window Epplet_window_pop_context(void); 527EAPI Window Epplet_window_pop_context(void);
528 528
529/* Show and hide an already created Window win. */ 529/* Show and hide an already created Window win. */
530void Epplet_window_show(Window win); 530EAPI void Epplet_window_show(Window win);
531void Epplet_window_hide(Window win); 531EAPI void Epplet_window_hide(Window win);
532 532
533/* Destroy Window win. Any gadgets you have added to the window are 533/* Destroy Window win. Any gadgets you have added to the window are
534 * destroyed also */ 534 * destroyed also */
535void Epplet_window_destroy(Window win); 535EAPI void Epplet_window_destroy(Window win);
536 536
537/****************************************************************************/ 537/****************************************************************************/
538/* basic line, filled rectangle and box outline drawing functions to make */ 538/* basic line, filled rectangle and box outline drawing functions to make */
539/* life easy */ 539/* life easy */
540/****************************************************************************/ 540/****************************************************************************/
541/* draw a line from (x1, y1) to (x2, y2) in window win, in color (r, g, b) */ 541/* draw a line from (x1, y1) to (x2, y2) in window win, in color (r, g, b) */
542void Epplet_draw_line(Window win, int x1, int y1, int x2, int y2, 542EAPI void Epplet_draw_line(Window win, int x1, int y1, int x2, int y2,
543 int r, int g, int b); 543 int r, int g, int b);
544 544
545/* draw a box at (x, y) of size (w x h) in window win, in color (r, g, b) */ 545/* draw a box at (x, y) of size (w x h) in window win, in color (r, g, b) */
546void Epplet_draw_box(Window win, int x, int y, int w, int h, 546EAPI void Epplet_draw_box(Window win, int x, int y, int w, int h,
547 int r, int g, int b); 547 int r, int g, int b);
548 548
549/* draw a box outline at (x, y) of size (w, h) in window win, in color (r, g, b) */ 549/* draw a box outline at (x, y) of size (w, h) in window win, in color (r, g, b) */
550void Epplet_draw_outline(Window win, int x, int y, int w, int h, 550EAPI void Epplet_draw_outline(Window win, int x, int y, int w, int h,
551 int r, int g, int b); 551 int r, int g, int b);
552 552
553/* get the pixel value for the RGB value (r, g, b) and return it */ 553/* get the pixel value for the RGB value (r, g, b) and return it */
554int Epplet_get_color(int r, int g, int b); 554EAPI int Epplet_get_color(int r, int g, int b);
555 555
556/* pasye the image file image onto window ww, at its original size at (x,y) */ 556/* pasye the image file image onto window ww, at its original size at (x,y) */
557void Epplet_paste_image(const char *image, Window ww, 557EAPI void Epplet_paste_image(const char *image, Window ww,
558 int x, int y); 558 int x, int y);
559 559
560/* paste the image file image onto window ww at (x,y), at size (w x h) */ 560/* paste the image file image onto window ww at (x,y), at size (w x h) */
561void Epplet_paste_image_size(const char *image, Window ww, 561EAPI void Epplet_paste_image_size(const char *image, Window ww,
562 int x, int y, int w, int h); 562 int x, int y, int w, int h);
563 563
564/* syncronize all draws (guarantees they are done) */ 564/* syncronize all draws (guarantees they are done) */
565void Esync(void); 565EAPI void Esync(void);
566 566
567/****************************************************************************/ 567/****************************************************************************/
568/* RGB buffer - for people who want to write raw RGB image data to a drawing */ 568/* RGB buffer - for people who want to write raw RGB image data to a drawing */
569/* area and want it rendered/dithered etc. for them */ 569/* area and want it rendered/dithered etc. for them */
570/****************************************************************************/ 570/****************************************************************************/
571/* create an RGB buffer of size (w x h) */ 571/* create an RGB buffer of size (w x h) */
572RGB_buf Epplet_make_rgb_buf(int w, int h); 572EAPI RGB_buf Epplet_make_rgb_buf(int w, int h);
573 573
574/* get a pointer to the RGB data int he RGB buffer */ 574/* get a pointer to the RGB data int he RGB buffer */
575unsigned char *Epplet_get_rgb_pointer(RGB_buf buf); 575EAPI unsigned char *Epplet_get_rgb_pointer(RGB_buf buf);
576 576
577/* render & paste the RGB buffer to a window at x, y */ 577/* render & paste the RGB buffer to a window at x, y */
578void Epplet_paste_buf(RGB_buf buf, Window win, int x, int y); 578EAPI void Epplet_paste_buf(RGB_buf buf, Window win, int x, int y);
579 579
580/* free an RGB buffer */ 580/* free an RGB buffer */
581void Epplet_free_rgb_buf(RGB_buf buf); 581EAPI void Epplet_free_rgb_buf(RGB_buf buf);
582 582
583#ifdef HAVE_GLX 583#ifdef HAVE_GLX
584/****************************************************************************/ 584/****************************************************************************/
@@ -602,7 +602,7 @@ void Epplet_free_rgb_buf(RGB_buf buf);
602 accum_green and accum_blue are the individual accumultion buffers 602 accum_green and accum_blue are the individual accumultion buffers
603 for each color. Defaults to 0. accum_alpha is the accumulation buffer 603 for each color. Defaults to 0. accum_alpha is the accumulation buffer
604 for the alpha channel. defaults to 0. */ 604 for the alpha channel. defaults to 0. */
605GLXContext Epplet_bind_double_GL(Epplet_gadget da, int red, 605EAPI GLXContext Epplet_bind_double_GL(Epplet_gadget da, int red,
606 int blue, int green, int alpha, 606 int blue, int green, int alpha,
607 int aux_buffers, int depth, 607 int aux_buffers, int depth,
608 int stencil, int accum_red, 608 int stencil, int accum_red,
@@ -611,7 +611,7 @@ GLXContext Epplet_bind_double_GL(Epplet_gadget da, int red,
611 611
612/* The same as double buffer, except if this call succedes you are 612/* The same as double buffer, except if this call succedes you are
613 returned a single buffered context. */ 613 returned a single buffered context. */
614GLXContext Epplet_bind_single_GL(Epplet_gadget da, int red, 614EAPI GLXContext Epplet_bind_single_GL(Epplet_gadget da, int red,
615 int blue, int green, int alpha, 615 int blue, int green, int alpha,
616 int aux_buffers, int depth, 616 int aux_buffers, int depth,
617 int stencil, int accum_red, 617 int stencil, int accum_red,
@@ -623,86 +623,86 @@ GLXContext Epplet_bind_single_GL(Epplet_gadget da, int red,
623 double buffer with minimal depth buffer, and NO other buffers. Its very 623 double buffer with minimal depth buffer, and NO other buffers. Its very
624 basic, but its good enough for simple rendering with light sources 624 basic, but its good enough for simple rendering with light sources
625 and basic texture mapping. */ 625 and basic texture mapping. */
626GLXContext Epplet_default_bind_GL(Epplet_gadget da); 626EAPI GLXContext Epplet_default_bind_GL(Epplet_gadget da);
627 627
628/* Destroy (unbind) a glx context. */ 628/* Destroy (unbind) a glx context. */
629void Epplet_unbind_GL(GLXContext cx); 629EAPI void Epplet_unbind_GL(GLXContext cx);
630 630
631#endif 631#endif
632 632
633/* command execution/spawing wrappers to make life easy */ 633/* command execution/spawing wrappers to make life easy */
634 634
635/* This runs the command passed to it and returns its exit code: */ 635/* This runs the command passed to it and returns its exit code: */
636int Epplet_run_command(const char *cmd); 636EAPI int Epplet_run_command(const char *cmd);
637const char *Epplet_read_run_command(const char *cmd); 637EAPI const char *Epplet_read_run_command(const char *cmd);
638int Epplet_spawn_command(const char *cmd); 638EAPI int Epplet_spawn_command(const char *cmd);
639void Epplet_pause_spawned_command(int pid); 639EAPI void Epplet_pause_spawned_command(int pid);
640void Epplet_unpause_spawned_command(int pid); 640EAPI void Epplet_unpause_spawned_command(int pid);
641void Epplet_kill_spawned_command(int pid); 641EAPI void Epplet_kill_spawned_command(int pid);
642void Epplet_destroy_spawned_command(int pid); 642EAPI void Epplet_destroy_spawned_command(int pid);
643void Epplet_register_child_handler(void (*func) 643EAPI void Epplet_register_child_handler(void (*func)
644 (void *data, int pid, 644 (void *data, int pid,
645 int exit_code), void *data); 645 int exit_code), void *data);
646void Epplet_change_button_label(Epplet_gadget gadget, 646EAPI void Epplet_change_button_label(Epplet_gadget gadget,
647 const char *label); 647 const char *label);
648void Epplet_change_button_image(Epplet_gadget gadget, 648EAPI void Epplet_change_button_image(Epplet_gadget gadget,
649 const char *image); 649 const char *image);
650void Epplet_clear_window(Window ww); 650EAPI void Epplet_clear_window(Window ww);
651void Epplet_show_about(const char *name); 651EAPI void Epplet_show_about(const char *name);
652void Epplet_dialog_ok(const char *fmt, ...); 652EAPI void Epplet_dialog_ok(const char *fmt, ...);
653int Epplet_get_hslider_clicked(Epplet_gadget gadget); 653EAPI int Epplet_get_hslider_clicked(Epplet_gadget gadget);
654int Epplet_get_vslider_clicked(Epplet_gadget gadget); 654EAPI int Epplet_get_vslider_clicked(Epplet_gadget gadget);
655 655
656/****************************************************************************/ 656/****************************************************************************/
657/* Config file handling stuff */ 657/* Config file handling stuff */
658/****************************************************************************/ 658/****************************************************************************/
659/* Load the config file (initializes the config data). */ 659/* Load the config file (initializes the config data). */
660void Epplet_load_config(void); 660EAPI void Epplet_load_config(void);
661 661
662/* Load config data from a specific file, overriding any previous data. */ 662/* Load config data from a specific file, overriding any previous data. */
663void Epplet_load_config_file(const char *); 663EAPI void Epplet_load_config_file(const char *);
664 664
665/* This returns the instance of this epplet. */ 665/* This returns the instance of this epplet. */
666int Epplet_get_instance(void); 666EAPI int Epplet_get_instance(void);
667 667
668/* Here you can query a config setting. */ 668/* Here you can query a config setting. */
669const char *Epplet_query_config(const char *key); 669EAPI const char *Epplet_query_config(const char *key);
670 670
671/* Same as above, but returns the value of default instead of NULL if no */ 671/* Same as above, but returns the value of default instead of NULL if no */
672/* match is found. */ 672/* match is found. */
673const char *Epplet_query_config_def(const char *key, const char *def); 673EAPI const char *Epplet_query_config_def(const char *key, const char *def);
674 674
675/* Use this to change or add a config setting. */ 675/* Use this to change or add a config setting. */
676void Epplet_modify_config(const char *key, const char *value); 676EAPI void Epplet_modify_config(const char *key, const char *value);
677 677
678/* If you *know* a key doesn't exist, use this to add it. It takes less */ 678/* If you *know* a key doesn't exist, use this to add it. It takes less */
679/* time than the above function. */ 679/* time than the above function. */
680void Epplet_add_config(const char *key, const char *value); 680EAPI void Epplet_add_config(const char *key, const char *value);
681 681
682/* If you have a set of configurations that belong together and whose */ 682/* If you have a set of configurations that belong together and whose */
683/* number may change at runtime, use these: */ 683/* number may change at runtime, use these: */
684 684
685/* Here you can define multiple settings. 'num' is the number of strings */ 685/* Here you can define multiple settings. 'num' is the number of strings */
686/* in the 'values' array. */ 686/* in the 'values' array. */
687void Epplet_modify_multi_config(const char *key, char **values, 687EAPI void Epplet_modify_multi_config(const char *key, char **values,
688 int num); 688 int num);
689 689
690/* This lets you query for multiple settings. */ 690/* This lets you query for multiple settings. */
691/* Note that you have to free the result that is returned here, in contrast */ 691/* Note that you have to free the result that is returned here, in contrast */
692/* to Epplet_query_config(). The pointer to 'num' returns the number of */ 692/* to Epplet_query_config(). The pointer to 'num' returns the number of */
693/* strings that are returned. */ 693/* strings that are returned. */
694char **Epplet_query_multi_config(const char *key, int *num); 694EAPI char **Epplet_query_multi_config(const char *key, int *num);
695 695
696/* This lets you save your current config settings. This is done automati- */ 696/* This lets you save your current config settings. This is done automati- */
697/* cally when you call Epplet_cleanup(), so you only need to call this when */ 697/* cally when you call Epplet_cleanup(), so you only need to call this when */
698/* you want to force the configs to disk for some reason. */ 698/* you want to force the configs to disk for some reason. */
699void Epplet_save_config(void); 699EAPI void Epplet_save_config(void);
700 700
701/* Delete the config information. */ 701/* Delete the config information. */
702void Epplet_clear_config(void); 702EAPI void Epplet_clear_config(void);
703 703
704/* Return epplet data directory. */ 704/* Return epplet data directory. */
705const char *Epplet_data_dir(void); 705EAPI const char *Epplet_data_dir(void);
706 706
707/* Return e16 user configuration directory. */ 707/* Return e16 user configuration directory. */
708const char *Epplet_e16_user_dir(void); 708EAPI const char *Epplet_e16_user_dir(void);