summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/Efl_Core.h4
-rw-r--r--src/lib/ecore/efl_general.h101
2 files changed, 105 insertions, 0 deletions
diff --git a/src/lib/ecore/Efl_Core.h b/src/lib/ecore/Efl_Core.h
index a88e5412ed..585f847b55 100644
--- a/src/lib/ecore/Efl_Core.h
+++ b/src/lib/ecore/Efl_Core.h
@@ -76,3 +76,7 @@ extern EAPI double _efl_startup_time;
76#define EAPI 76#define EAPI
77 77
78#endif 78#endif
79
80// We are including efl_general.h again, just in case Efl_Core.h was already included before this
81// and the __EFL_*_IS_REQUIRED changed since then.
82#include "efl_general.h"
diff --git a/src/lib/ecore/efl_general.h b/src/lib/ecore/efl_general.h
new file mode 100644
index 0000000000..b4ffdfe97a
--- /dev/null
+++ b/src/lib/ecore/efl_general.h
@@ -0,0 +1,101 @@
1#ifdef EFL_BETA_API_SUPPORT
2
3// This file is designed to be included again and again
4// so cleanup last inclusion before generating this one.
5#undef _EFL_VERSION_MICRO
6#undef _EFL_VERSION_REVISION
7#undef _EFL_VERSION_FLAVOR
8#undef _EFL_BUILD_ID
9#undef _EFL_APP_VERSION_SET
10#undef __EFL_MAIN_CONSTRUCTOR
11#undef __EFL_MAIN_DESTRUCTOR
12#undef __EFL_UI
13#undef EFL_MAIN
14#undef EFL_MAIN_EX
15
16#ifdef EFL_VERSION_MICRO
17# define _EFL_VERSION_MICRO EFL_VERSION_MICRO
18#else
19# define _EFL_VERSION_MICRO 0
20#endif
21
22#ifdef EFL_VERSION_REVISION
23# define _EFL_VERSION_REVISION EFL_VERSION_REVISION
24#else
25# define _EFL_VERSION_REVISION 0
26#endif
27
28#ifdef EFL_VERSION_FLAVOR
29# define _EFL_VERSION_FLAVOR EFL_VERSION_FLAVOR
30#else
31# define _EFL_VERSION_FLAVOR NULL
32#endif
33
34#ifdef EFL_BUILD_ID
35# define _EFL_BUILD_ID EFL_BUILD_ID
36#else
37# define _EFL_BUILD_ID NULL
38#endif
39
40#define __EFL_MAIN_CONSTRUCTOR \
41 __EFL_UI(elm_init(argc, argv);)
42
43#define __EFL_MAIN_DESTRUCTOR \
44 __EFL_UI(elm_shutdown();)
45
46#ifdef __EFL_UI_IS_REQUIRED
47# define __EFL_UI(...) __VA_ARGS__
48#else
49# define __EFL_UI(...)
50#endif
51
52#define _EFL_APP_VERSION_SET() \
53 do { \
54 if (efl_build_version_set) \
55 efl_build_version_set(EFL_VERSION_MAJOR, EFL_VERSION_MINOR, _EFL_VERSION_MICRO, \
56 _EFL_VERSION_REVISION, _EFL_VERSION_FLAVOR, _EFL_BUILD_ID); \
57 } while (0)
58
59#define EFL_MAIN() int main(int argc, char **argv) \
60 { \
61 Eina_Value *ret__; \
62 int real__; \
63 _efl_startup_time = ecore_time_unix_get(); \
64 _EFL_APP_VERSION_SET(); \
65 ecore_init(); \
66 efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \
67 ecore_init_ex(argc, argv); \
68 __EFL_MAIN_CONSTRUCTOR; \
69 ret__ = efl_loop_begin(ecore_main_loop_get()); \
70 real__ = efl_loop_exit_code_process(ret__); \
71 __EFL_MAIN_DESTRUCTOR; \
72 ecore_shutdown_ex(); \
73 ecore_shutdown(); \
74 return real__; \
75 }
76
77#define EFL_MAIN_EX() \
78 EFL_CALLBACKS_ARRAY_DEFINE(_efl_main_ex, \
79 { EFL_LOOP_EVENT_ARGUMENTS, efl_main }, \
80 { EFL_LOOP_EVENT_PAUSE, efl_pause }, \
81 { EFL_LOOP_EVENT_RESUME, efl_resume }, \
82 { EFL_LOOP_EVENT_TERMINATE, efl_terminate }); \
83 int main(int argc, char **argv) \
84 { \
85 Eina_Value *ret__; \
86 int real__; \
87 _efl_startup_time = ecore_time_unix_get(); \
88 _EFL_APP_VERSION_SET(); \
89 ecore_init(); \
90 efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \
91 ecore_init_ex(argc, argv); \
92 __EFL_MAIN_CONSTRUCTOR; \
93 ret__ = efl_loop_begin(ecore_main_loop_get()); \
94 real__ = efl_loop_exit_code_process(ret__); \
95 __EFL_MAIN_DESTRUCTOR; \
96 ecore_shutdown_ex(); \
97 ecore_shutdown(); \
98 return real__; \
99 }
100
101#endif /* EFL_BETA_API_SUPPORT */