2017-11-06 10:28:15 -08:00
|
|
|
#ifdef EFL_BETA_API_SUPPORT
|
|
|
|
|
2017-11-09 14:33:46 -08:00
|
|
|
// This file is designed to be included again and again
|
|
|
|
// so cleanup last inclusion before generating this one.
|
|
|
|
#undef _EFL_VERSION_MICRO
|
|
|
|
#undef _EFL_VERSION_REVISION
|
|
|
|
#undef _EFL_VERSION_FLAVOR
|
|
|
|
#undef _EFL_BUILD_ID
|
|
|
|
#undef _EFL_APP_VERSION_SET
|
|
|
|
#undef __EFL_MAIN_CONSTRUCTOR
|
|
|
|
#undef __EFL_MAIN_DESTRUCTOR
|
|
|
|
#undef __EFL_UI
|
2017-11-09 15:25:51 -08:00
|
|
|
#undef __EFL_NET
|
2017-11-09 14:33:46 -08:00
|
|
|
#undef EFL_MAIN
|
|
|
|
#undef EFL_MAIN_EX
|
|
|
|
|
2017-11-06 10:28:15 -08:00
|
|
|
#ifdef EFL_VERSION_MICRO
|
|
|
|
# define _EFL_VERSION_MICRO EFL_VERSION_MICRO
|
|
|
|
#else
|
|
|
|
# define _EFL_VERSION_MICRO 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef EFL_VERSION_REVISION
|
|
|
|
# define _EFL_VERSION_REVISION EFL_VERSION_REVISION
|
|
|
|
#else
|
|
|
|
# define _EFL_VERSION_REVISION 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef EFL_VERSION_FLAVOR
|
|
|
|
# define _EFL_VERSION_FLAVOR EFL_VERSION_FLAVOR
|
|
|
|
#else
|
|
|
|
# define _EFL_VERSION_FLAVOR NULL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef EFL_BUILD_ID
|
|
|
|
# define _EFL_BUILD_ID EFL_BUILD_ID
|
|
|
|
#else
|
|
|
|
# define _EFL_BUILD_ID NULL
|
|
|
|
#endif
|
|
|
|
|
2017-11-09 14:33:15 -08:00
|
|
|
#define __EFL_MAIN_CONSTRUCTOR \
|
2017-11-09 15:25:51 -08:00
|
|
|
__EFL_NET(ecore_con_init();) \
|
|
|
|
__EFL_NET(ecore_con_url_init();) \
|
2017-11-09 14:33:15 -08:00
|
|
|
__EFL_UI(elm_init(argc, argv);)
|
|
|
|
|
|
|
|
#define __EFL_MAIN_DESTRUCTOR \
|
2017-11-09 15:25:51 -08:00
|
|
|
__EFL_UI(elm_shutdown();) \
|
|
|
|
__EFL_NET(ecore_con_url_shutdown();) \
|
|
|
|
__EFL_NET(ecore_con_shutdown();)
|
2017-11-09 14:33:15 -08:00
|
|
|
|
|
|
|
#ifdef __EFL_UI_IS_REQUIRED
|
|
|
|
# define __EFL_UI(...) __VA_ARGS__
|
|
|
|
#else
|
|
|
|
# define __EFL_UI(...)
|
|
|
|
#endif
|
|
|
|
|
2017-11-09 15:25:51 -08:00
|
|
|
#ifdef __EFL_NET_IS_REQUIRED
|
|
|
|
# define __EFL_NET(...) __VA_ARGS__
|
|
|
|
#else
|
|
|
|
# define __EFL_NET(...)
|
|
|
|
#endif
|
|
|
|
|
2017-11-06 10:28:15 -08:00
|
|
|
#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)
|
|
|
|
|
|
|
|
#define EFL_MAIN() int main(int argc, char **argv) \
|
|
|
|
{ \
|
|
|
|
Eina_Value *ret__; \
|
|
|
|
int real__; \
|
2017-11-06 10:52:36 -08:00
|
|
|
_efl_startup_time = ecore_time_unix_get(); \
|
2017-11-06 10:28:15 -08:00
|
|
|
_EFL_APP_VERSION_SET(); \
|
2017-11-06 13:49:18 -08:00
|
|
|
ecore_init(); \
|
2017-11-06 10:28:15 -08:00
|
|
|
efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \
|
2017-11-06 13:49:18 -08:00
|
|
|
ecore_init_ex(argc, argv); \
|
2017-11-09 14:33:15 -08:00
|
|
|
__EFL_MAIN_CONSTRUCTOR; \
|
2017-11-06 10:28:15 -08:00
|
|
|
ret__ = efl_loop_begin(ecore_main_loop_get()); \
|
|
|
|
real__ = efl_loop_exit_code_process(ret__); \
|
2017-11-09 14:33:15 -08:00
|
|
|
__EFL_MAIN_DESTRUCTOR; \
|
2017-11-06 13:49:18 -08:00
|
|
|
ecore_shutdown_ex(); \
|
|
|
|
ecore_shutdown(); \
|
2017-11-06 10:28:15 -08:00
|
|
|
return real__; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define EFL_MAIN_EX() \
|
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(_efl_main_ex, \
|
|
|
|
{ EFL_LOOP_EVENT_ARGUMENTS, efl_main }, \
|
|
|
|
{ EFL_LOOP_EVENT_PAUSE, efl_pause }, \
|
|
|
|
{ EFL_LOOP_EVENT_RESUME, efl_resume }, \
|
|
|
|
{ EFL_LOOP_EVENT_TERMINATE, efl_terminate }); \
|
|
|
|
int main(int argc, char **argv) \
|
|
|
|
{ \
|
|
|
|
Eina_Value *ret__; \
|
|
|
|
int real__; \
|
2017-11-06 10:52:36 -08:00
|
|
|
_efl_startup_time = ecore_time_unix_get(); \
|
2017-11-06 10:28:15 -08:00
|
|
|
_EFL_APP_VERSION_SET(); \
|
2017-11-06 13:49:18 -08:00
|
|
|
ecore_init(); \
|
2017-11-06 10:28:15 -08:00
|
|
|
efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \
|
2017-11-06 13:49:18 -08:00
|
|
|
ecore_init_ex(argc, argv); \
|
2017-11-09 14:33:15 -08:00
|
|
|
__EFL_MAIN_CONSTRUCTOR; \
|
2017-11-06 10:28:15 -08:00
|
|
|
ret__ = efl_loop_begin(ecore_main_loop_get()); \
|
|
|
|
real__ = efl_loop_exit_code_process(ret__); \
|
2017-11-09 14:33:15 -08:00
|
|
|
__EFL_MAIN_DESTRUCTOR; \
|
2017-11-06 13:49:18 -08:00
|
|
|
ecore_shutdown_ex(); \
|
|
|
|
ecore_shutdown(); \
|
2017-11-06 10:28:15 -08:00
|
|
|
return real__; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* EFL_BETA_API_SUPPORT */
|