5 * @defgroup API Enlightenment API
7 * Application programming interface to be used by modules to extend
19 # define OBJECT_PARANOIA_CHECK
23 # ifndef _FILE_OFFSET_BITS
24 # define _FILE_OFFSET_BITS 64
29 # elif defined __GNUC__
30 # define alloca __builtin_alloca
32 # define alloca __alloca
33 # elif defined _MSC_VER
35 # define alloca _alloca
45 # include <features.h>
52 # include <sys/types.h>
53 # include <sys/stat.h>
54 # include <sys/time.h>
55 # include <sys/param.h>
56 # include <sys/resource.h>
72 # include <inttypes.h>
78 # ifndef _POSIX_HOST_NAME_MAX
79 # define _POSIX_HOST_NAME_MAX 255
83 # include <memcheck.h>
87 # include <execinfo.h>
94 # include <Evas_Engine_Buffer.h>
97 # include <Ecore_Evas.h>
98 # include <Ecore_Input.h>
99 # include <Ecore_Input_Evas.h>
100 # include <Ecore_Con.h>
101 # include <Ecore_Ipc.h>
102 # include <Ecore_File.h>
104 # include <Efreet_Mime.h>
118 # define EAPI __declspec(dllexport)
120 # define EAPI __declspec(dllimport)
125 /* BROKEN in gcc 4 on amd64 */
127 # pragma GCC visibility push(hidden)
129 # define EAPI __attribute__ ((visibility("default")))
143 # define EINTERN __attribute__ ((visibility("hidden")))
152 # define strdupa(str) strcpy(alloca(strlen(str) + 1), str)
156 # define strndupa(str, len) strncpy(alloca(len + 1), str, len)
159 typedef struct _E_Before_Idler E_Before_Idler;
160 typedef struct _E_Rect E_Rect;
162 /* convenience macro to compress code and avoid typos */
163 # define E_FN_DEL(_fn, _h) if (_h) { _fn(_h); _h = NULL; }
164 # define E_INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
165 (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy)))
166 # define E_INSIDE(x, y, xx, yy, ww, hh) \
167 (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && ((x) >= (xx)) && ((y) >= (yy)))
168 # define E_CONTAINS(x, y, w, h, xx, yy, ww, hh) \
169 (((xx) >= (x)) && (((x) + (w)) >= ((xx) + (ww))) && ((yy) >= (y)) && (((y) + (h)) >= ((yy) + (hh))))
170 # define E_SPANS_COMMON(x1, w1, x2, w2) \
171 (!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
172 # define E_REALLOC(p, s, n) p = (s *)realloc(p, sizeof(s) * n)
173 # define E_NEW(s, n) (s *)calloc(n, sizeof(s))
174 # define E_NEW_RAW(s, n) (s *)malloc(n * sizeof(s))
175 # define E_FREE(p) do { free(p); p = NULL; } while (0)
176 # define E_FREE_LIST(list, free) \
180 EINA_LIST_FREE(list, _tmp_) \
187 # define E_LIST_HANDLERS_APPEND(list, type, callback, data) \
190 Ecore_Event_Handler *_eh; \
191 _eh = ecore_event_handler_add(type, (Ecore_Event_Handler_Cb)callback, data); \
193 list = eina_list_append(list, _eh); \
195 ERR("E_LIST_HANDLERS_APPEND"); \
199 # define E_CLAMP(x, min, max) (x < min ? min : (x > max ? max : x))
200 # define E_RECTS_CLIP_TO_RECT(_x, _y, _w, _h, _cx, _cy, _cw, _ch) \
202 if (E_INTERSECTS(_x, _y, _w, _h, _cx, _cy, _cw, _ch)) \
204 if ((int)_x < (int)(_cx)) \
208 if ((int)_w < 0) _w = 0; \
210 if ((int)(_x + _w) > (int)((_cx) + (_cw))) \
211 _w = (_cx) + (_cw) - _x; \
212 if ((int)_y < (int)(_cy)) \
216 if ((int)_h < 0) _h = 0; \
218 if ((int)(_y + _h) > (int)((_cy) + (_ch))) \
219 _h = (_cy) + (_ch) - _y; \
227 # define E_REMOTE_OPTIONS 1
228 # define E_REMOTE_OUT 2
230 # define E_REMOTE_IN 4
234 # define E_TYPEDEFS 1
235 # include "e_includes.h"
237 # include "e_includes.h"
239 EAPI E_Before_Idler *e_main_idler_before_add(int (*func)(void *data), void *data, int once);
240 EAPI void e_main_idler_before_del(E_Before_Idler *eb);
241 EAPI double e_main_ts(const char *str);
243 struct _E_Before_Idler
245 int (*func)(void *data);
248 Eina_Bool delete_me : 1;
256 extern EAPI E_Path *path_data;
257 extern EAPI E_Path *path_images;
258 extern EAPI E_Path *path_fonts;
259 extern EAPI E_Path *path_themes;
260 extern EAPI E_Path *path_icons;
261 extern EAPI E_Path *path_modules;
262 extern EAPI E_Path *path_backgrounds;
263 extern EAPI E_Path *path_messages;
264 extern EAPI Eina_Bool good;
265 extern EAPI Eina_Bool evil;
266 extern EAPI Eina_Bool starting;
267 extern EAPI Eina_Bool stopping;
268 extern EAPI Eina_Bool restart;
270 extern EAPI Eina_Bool e_precache_end;
271 extern EAPI Eina_Bool x_fatal;
273 extern EAPI unsigned long e_alert_composite_win;
275 //#define SMARTERR(args...) abort()
276 #define SMARTERRNR() return
277 #define SMARTERR(x) return x
284 * @defgroup Optional_Modules Optional Modules
287 * @defgroup Optional_Conf Configurations
288 * @defgroup Optional_Control Controls
289 * @defgroup Optional_Devices Devices & Hardware
290 * @defgroup Optional_Fileman File Managers
291 * @defgroup Optional_Gadgets Gadgets
292 * @defgroup Optional_Launcher Launchers
293 * @defgroup Optional_Layouts Layout Managers
294 * @defgroup Optional_Look Look & Feel
295 * @defgroup Optional_Monitors Monitors & Notifications
296 * @defgroup Optional_Mobile Mobile Specific Extensions