summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2017-11-09 14:33:15 -0800
committerCedric Bail <cedric@osg.samsung.com>2017-11-09 15:13:37 -0800
commit4d41f95106bc00e9e59eadca6ecac516a576bd2a (patch)
tree9ffe087003584d8c8ab134999a6d23d94eb0fb14
parentba2abb2eb9e395b049515f70416559982f503b74 (diff)
elementary: make elm_init and elm_shutdown optional in EFL_MAIN.
-rw-r--r--src/lib/elementary/efl_general.h20
-rw-r--r--src/lib/elementary/elm_general.h2
2 files changed, 18 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_general.h b/src/lib/elementary/efl_general.h
index 9d7171b05f..4fd4a26ad7 100644
--- a/src/lib/elementary/efl_general.h
+++ b/src/lib/elementary/efl_general.h
@@ -24,6 +24,18 @@
24# define _EFL_BUILD_ID NULL 24# define _EFL_BUILD_ID NULL
25#endif 25#endif
26 26
27#define __EFL_MAIN_CONSTRUCTOR \
28 __EFL_UI(elm_init(argc, argv);)
29
30#define __EFL_MAIN_DESTRUCTOR \
31 __EFL_UI(elm_shutdown();)
32
33#ifdef __EFL_UI_IS_REQUIRED
34# define __EFL_UI(...) __VA_ARGS__
35#else
36# define __EFL_UI(...)
37#endif
38
27#define _EFL_APP_VERSION_SET() \ 39#define _EFL_APP_VERSION_SET() \
28 do { \ 40 do { \
29 if (efl_build_version_set) \ 41 if (efl_build_version_set) \
@@ -40,10 +52,10 @@
40 ecore_init(); \ 52 ecore_init(); \
41 efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \ 53 efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \
42 ecore_init_ex(argc, argv); \ 54 ecore_init_ex(argc, argv); \
43 elm_init(argc, argv); \ 55 __EFL_MAIN_CONSTRUCTOR; \
44 ret__ = efl_loop_begin(ecore_main_loop_get()); \ 56 ret__ = efl_loop_begin(ecore_main_loop_get()); \
45 real__ = efl_loop_exit_code_process(ret__); \ 57 real__ = efl_loop_exit_code_process(ret__); \
46 elm_shutdown(); \ 58 __EFL_MAIN_DESTRUCTOR; \
47 ecore_shutdown_ex(); \ 59 ecore_shutdown_ex(); \
48 ecore_shutdown(); \ 60 ecore_shutdown(); \
49 return real__; \ 61 return real__; \
@@ -64,10 +76,10 @@
64 ecore_init(); \ 76 ecore_init(); \
65 efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \ 77 efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \
66 ecore_init_ex(argc, argv); \ 78 ecore_init_ex(argc, argv); \
67 elm_init(argc, argv); \ 79 __EFL_MAIN_CONSTRUCTOR; \
68 ret__ = efl_loop_begin(ecore_main_loop_get()); \ 80 ret__ = efl_loop_begin(ecore_main_loop_get()); \
69 real__ = efl_loop_exit_code_process(ret__); \ 81 real__ = efl_loop_exit_code_process(ret__); \
70 elm_shutdown(); \ 82 __EFL_MAIN_DESTRUCTOR; \
71 ecore_shutdown_ex(); \ 83 ecore_shutdown_ex(); \
72 ecore_shutdown(); \ 84 ecore_shutdown(); \
73 return real__; \ 85 return real__; \
diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h
index 5645bf471f..be657e1660 100644
--- a/src/lib/elementary/elm_general.h
+++ b/src/lib/elementary/elm_general.h
@@ -96,6 +96,8 @@ extern EAPI double _elm_startup_time;
96#define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; } 96#define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; }
97#endif 97#endif
98 98
99#define __EFL_UI_IS_REQUIRED
100
99#include "Efl_Core.h" 101#include "Efl_Core.h"
100#include "efl_general.h" 102#include "efl_general.h"
101 103