summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-11-06 10:28:15 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-11-07 16:08:39 -0800
commit25b6a280c087d39f66e30c9c4d07f86b97c989d6 (patch)
tree2e661ffe931571e61b90b72127aa74737eac7b6e /src/lib/elementary
parentede0587887704fc166e1631304f660e703e3489b (diff)
elementary: move Efl new general purpose API to efl_general.h
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_general.h68
-rw-r--r--src/lib/elementary/elm_general.h71
2 files changed, 69 insertions, 70 deletions
diff --git a/src/lib/elementary/efl_general.h b/src/lib/elementary/efl_general.h
new file mode 100644
index 0000000000..e10261cd63
--- /dev/null
+++ b/src/lib/elementary/efl_general.h
@@ -0,0 +1,68 @@
1#ifdef EFL_BETA_API_SUPPORT
2
3#ifdef EFL_VERSION_MICRO
4# define _EFL_VERSION_MICRO EFL_VERSION_MICRO
5#else
6# define _EFL_VERSION_MICRO 0
7#endif
8
9#ifdef EFL_VERSION_REVISION
10# define _EFL_VERSION_REVISION EFL_VERSION_REVISION
11#else
12# define _EFL_VERSION_REVISION 0
13#endif
14
15#ifdef EFL_VERSION_FLAVOR
16# define _EFL_VERSION_FLAVOR EFL_VERSION_FLAVOR
17#else
18# define _EFL_VERSION_FLAVOR NULL
19#endif
20
21#ifdef EFL_BUILD_ID
22# define _EFL_BUILD_ID EFL_BUILD_ID
23#else
24# define _EFL_BUILD_ID NULL
25#endif
26
27#define _EFL_APP_VERSION_SET() \
28 do { \
29 if (efl_build_version_set) \
30 efl_build_version_set(EFL_VERSION_MAJOR, EFL_VERSION_MINOR, _EFL_VERSION_MICRO, \
31 _EFL_VERSION_REVISION, _EFL_VERSION_FLAVOR, _EFL_BUILD_ID); \
32 } while (0)
33
34#define EFL_MAIN() int main(int argc, char **argv) \
35 { \
36 Eina_Value *ret__; \
37 int real__; \
38 _EFL_APP_VERSION_SET(); \
39 _elm_startup_time = ecore_time_unix_get(); \
40 elm_init(argc, argv); \
41 efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \
42 ret__ = efl_loop_begin(ecore_main_loop_get()); \
43 real__ = efl_loop_exit_code_process(ret__); \
44 elm_shutdown(); \
45 return real__; \
46 }
47
48#define EFL_MAIN_EX() \
49 EFL_CALLBACKS_ARRAY_DEFINE(_efl_main_ex, \
50 { EFL_LOOP_EVENT_ARGUMENTS, efl_main }, \
51 { EFL_LOOP_EVENT_PAUSE, efl_pause }, \
52 { EFL_LOOP_EVENT_RESUME, efl_resume }, \
53 { EFL_LOOP_EVENT_TERMINATE, efl_terminate }); \
54 int main(int argc, char **argv) \
55 { \
56 Eina_Value *ret__; \
57 int real__; \
58 _EFL_APP_VERSION_SET(); \
59 _elm_startup_time = ecore_time_unix_get(); \
60 elm_init(argc, argv); \
61 efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \
62 ret__ = efl_loop_begin(ecore_main_loop_get()); \
63 real__ = efl_loop_exit_code_process(ret__); \
64 elm_shutdown(); \
65 return real__; \
66 }
67
68#endif /* EFL_BETA_API_SUPPORT */
diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h
index 4e3097eac1..7c2a28236a 100644
--- a/src/lib/elementary/elm_general.h
+++ b/src/lib/elementary/elm_general.h
@@ -96,76 +96,7 @@ 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 99#include "efl_general.h"
100#ifdef EFL_BETA_API_SUPPORT
101
102#ifdef EFL_VERSION_MICRO
103# define _EFL_VERSION_MICRO EFL_VERSION_MICRO
104#else
105# define _EFL_VERSION_MICRO 0
106#endif
107
108#ifdef EFL_VERSION_REVISION
109# define _EFL_VERSION_REVISION EFL_VERSION_REVISION
110#else
111# define _EFL_VERSION_REVISION 0
112#endif
113
114#ifdef EFL_VERSION_FLAVOR
115# define _EFL_VERSION_FLAVOR EFL_VERSION_FLAVOR
116#else
117# define _EFL_VERSION_FLAVOR NULL
118#endif
119
120#ifdef EFL_BUILD_ID
121# define _EFL_BUILD_ID EFL_BUILD_ID
122#else
123# define _EFL_BUILD_ID NULL
124#endif
125
126#define _EFL_APP_VERSION_SET() \
127 do { \
128 if (efl_build_version_set) \
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 }
146
147#define EFL_MAIN_EX() \
148 EFL_CALLBACKS_ARRAY_DEFINE(_efl_main_ex, \
149 { EFL_LOOP_EVENT_ARGUMENTS, efl_main }, \
150 { EFL_LOOP_EVENT_PAUSE, efl_pause }, \
151 { EFL_LOOP_EVENT_RESUME, efl_resume }, \
152 { EFL_LOOP_EVENT_TERMINATE, efl_terminate }); \
153 int main(int argc, char **argv) \
154 { \
155 Eina_Value *ret__; \
156 int real__; \
157 _EFL_APP_VERSION_SET(); \
158 _elm_startup_time = ecore_time_unix_get(); \
159 elm_init(argc, argv); \
160 efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \
161 ret__ = efl_loop_begin(ecore_main_loop_get()); \
162 real__ = efl_loop_exit_code_process(ret__); \
163 elm_shutdown(); \
164 return real__; \
165 }
166
167#endif /* EFL_BETA_API_SUPPORT */
168
169 100
170/**************************************************************************/ 101/**************************************************************************/
171/* General calls */ 102/* General calls */