/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifndef E_H #define E_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef EAPI #undef EAPI #endif #ifdef WIN32 # ifdef BUILDING_DLL # define EAPI __declspec(dllexport) # else # define EAPI __declspec(dllimport) # endif #else # ifdef GCC_HASCLASSVISIBILITY # define EAPI __attribute__ ((visibility("default"))) # else # define EAPI # endif #endif typedef struct _E_Before_Idler E_Before_Idler; typedef struct _E_Rect E_Rect; /* convenience macro to compress code and avoid typos */ #define E_FN_DEL(_fn, _h) if (_h) { _fn(_h); _h = NULL; } #define E_INTERSECTS(x, y, w, h, xx, yy, ww, hh) (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy))) #define E_SPANS_COMMON(x1, w1, x2, w2) (!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1))))) #define E_REALLOC(p, s, n) p = realloc(p, sizeof(s) * n) #define E_NEW(s, n) calloc(n, sizeof(s)) #define E_NEW_BIG(s, n) malloc(n * sizeof(s)) #define E_FREE(p) { if (p) {free(p); p = NULL;} } #define E_TYPEDEFS 1 #include "e_includes.h" #undef E_TYPEDEFS #include "e_includes.h" EAPI E_Before_Idler *e_main_idler_before_add(int (*func) (void *data), void *data, int once); EAPI void e_main_idler_before_del(E_Before_Idler *eb); struct _E_Before_Idler { int (*func) (void *data); void *data; unsigned char once : 1; unsigned char delete_me : 1; }; struct _E_Rect { int x, y, w, h; }; extern EAPI E_Path *path_data; extern EAPI E_Path *path_images; extern EAPI E_Path *path_fonts; extern EAPI E_Path *path_themes; extern EAPI E_Path *path_icons; extern EAPI E_Path *path_init; extern EAPI int restart; #endif