summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2017-10-27 15:43:57 -0700
committerCedric Bail <cedric@osg.samsung.com>2017-10-27 15:43:57 -0700
commit0764ee81458ce56daf9bc5076044e8799038675a (patch)
tree117adab20ce6d41deef63633edb689f25103c52e /src/lib/elementary
parent03df8483f69d4acae79eb75d1bf0d36a1bdea8d8 (diff)
elementary: update EFL_MAIN and EFL_MAIN_EX to use the new EFL exit API.
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elm_general.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h
index bf7762007e..9324f2a77d 100644
--- a/src/lib/elementary/elm_general.h
+++ b/src/lib/elementary/elm_general.h
@@ -123,10 +123,26 @@ extern EAPI double _elm_startup_time;
123# define _EFL_BUILD_ID NULL 123# define _EFL_BUILD_ID NULL
124#endif 124#endif
125 125
126#define _EFL_APP_VERSION_SET() do { if (efl_build_version_set) efl_build_version_set(EFL_VERSION_MAJOR, EFL_VERSION_MINOR, _EFL_VERSION_MICRO, _EFL_VERSION_REVISION, _EFL_VERSION_FLAVOR, _EFL_BUILD_ID); } while (0) 126#define _EFL_APP_VERSION_SET() \
127 127 do { \
128#ifndef ELM_LIB_QUICKLAUNCH 128 if (efl_build_version_set) \
129#define EFL_MAIN() int main(int argc, char **argv) { int ret__; _EFL_APP_VERSION_SET(); _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); ret__ = efl_loop_begin(ecore_main_loop_get()); elm_shutdown(); return ret__; } 129 efl_build_version_set(EFL_VERSION_MAJOR, EFL_VERSION_MINOR, _EFL_VERSION_MICRO, \
130 _EFL_VERSION_REVISION, _EFL_VERSION_FLAVOR, _EFL_BUILD_ID); \
131 } while (0)
132
133#define EFL_MAIN() int main(int argc, char **argv) \
134 { \
135 Eina_Value *ret__; \
136 int real__; \
137 _EFL_APP_VERSION_SET(); \
138 _elm_startup_time = ecore_time_unix_get(); \
139 elm_init(argc, argv); \
140 efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \
141 ret__ = efl_loop_begin(ecore_main_loop_get()); \
142 real__ = efl_loop_exit_code_process(ret__); \
143 elm_shutdown(); \
144 return real__; \
145 }
130 146
131#define EFL_MAIN_EX() \ 147#define EFL_MAIN_EX() \
132 EFL_CALLBACKS_ARRAY_DEFINE(_efl_main_ex, \ 148 EFL_CALLBACKS_ARRAY_DEFINE(_efl_main_ex, \
@@ -136,14 +152,16 @@ extern EAPI double _elm_startup_time;
136 { EFL_LOOP_EVENT_TERMINATE, efl_terminate }); \ 152 { EFL_LOOP_EVENT_TERMINATE, efl_terminate }); \
137 int main(int argc, char **argv) \ 153 int main(int argc, char **argv) \
138 { \ 154 { \
139 int ret__; \ 155 Eina_Value *ret__; \
156 int real__; \
140 _EFL_APP_VERSION_SET(); \ 157 _EFL_APP_VERSION_SET(); \
141 _elm_startup_time = ecore_time_unix_get(); \ 158 _elm_startup_time = ecore_time_unix_get(); \
142 elm_init(argc, argv); \ 159 elm_init(argc, argv); \
143 efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \ 160 efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \
144 ret__ = efl_loop_begin(ecore_main_loop_get()); \ 161 ret__ = efl_loop_begin(ecore_main_loop_get()); \
162 real__ = efl_loop_exit_code_process(ret__); \
145 elm_shutdown(); \ 163 elm_shutdown(); \
146 return ret__; \ 164 return real__; \
147 } 165 }
148 166
149/** 167/**