elementary: return an exit code at exit with the new EFL_MAIN macro.
This commit is contained in:
parent
f441859bfb
commit
12703b3fe7
|
@ -1036,9 +1036,9 @@ efl_main(void *data EINA_UNUSED,
|
||||||
/* if called with a single argument try to autorun a test with
|
/* if called with a single argument try to autorun a test with
|
||||||
* the same name as the given param
|
* the same name as the given param
|
||||||
* ex: elementary_test "Box Vert 2" */
|
* ex: elementary_test "Box Vert 2" */
|
||||||
if (eina_array_count(arge->argv) == 2)
|
if (eina_array_count(arge->argv) == 1)
|
||||||
{
|
{
|
||||||
if (!strcmp(eina_array_data_get(arge->argv, 1), "--help"))
|
if (!strcmp(eina_array_data_get(arge->argv, 0), "--help"))
|
||||||
{
|
{
|
||||||
printf("Usages:\n"
|
printf("Usages:\n"
|
||||||
"$ elementary_test\n"
|
"$ elementary_test\n"
|
||||||
|
@ -1046,19 +1046,20 @@ efl_main(void *data EINA_UNUSED,
|
||||||
"$ elementary_test -to [TEST_NAME]\n\n"
|
"$ elementary_test -to [TEST_NAME]\n\n"
|
||||||
"Examples:\n"
|
"Examples:\n"
|
||||||
"$ elementary_test -to Button\n\n");
|
"$ elementary_test -to Button\n\n");
|
||||||
return;
|
efl_loop_quit(ev->object, 1);
|
||||||
|
return ;
|
||||||
}
|
}
|
||||||
autorun = eina_array_data_get(arge->argv, 1);
|
autorun = eina_array_data_get(arge->argv, 0);
|
||||||
}
|
}
|
||||||
else if (eina_array_count(arge->argv) == 3)
|
else if (eina_array_count(arge->argv) == 2)
|
||||||
{
|
{
|
||||||
/* Just a workaround to make the shot module more
|
/* Just a workaround to make the shot module more
|
||||||
* useful with elementary test. */
|
* useful with elementary test. */
|
||||||
if ((!strcmp(eina_array_data_get(arge->argv, 1), "--test-win-only")) ||
|
if ((!strcmp(eina_array_data_get(arge->argv, 0), "--test-win-only")) ||
|
||||||
(!strcmp(eina_array_data_get(arge->argv, 1), "-to")))
|
(!strcmp(eina_array_data_get(arge->argv, 0), "-to")))
|
||||||
{
|
{
|
||||||
test_win_only = EINA_TRUE;
|
test_win_only = EINA_TRUE;
|
||||||
autorun = eina_array_data_get(arge->argv, 2);
|
autorun = eina_array_data_get(arge->argv, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,14 +71,14 @@ extern EAPI double _elm_startup_time;
|
||||||
|
|
||||||
#ifndef ELM_LIB_QUICKLAUNCH
|
#ifndef ELM_LIB_QUICKLAUNCH
|
||||||
#define ELM_MAIN() int main(int argc, char **argv) { int ret; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); ret = elm_main(argc, argv); elm_shutdown(); return ret; } /**< macro to be used after the elm_main() function */
|
#define ELM_MAIN() int main(int argc, char **argv) { int ret; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); ret = elm_main(argc, argv); elm_shutdown(); return ret; } /**< macro to be used after the elm_main() function */
|
||||||
#define EFL_MAIN() int main(int argc, char **argv) { int ret = 0; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); eo_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); elm_run(); elm_shutdown(); return ret; }
|
#define EFL_MAIN() int main(int argc, char **argv) { int ret = 0; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); eo_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; }
|
||||||
#else
|
#else
|
||||||
/** @deprecated macro to be used after the elm_main() function.
|
/** @deprecated macro to be used after the elm_main() function.
|
||||||
* Do not define ELM_LIB_QUICKLAUNCH
|
* Do not define ELM_LIB_QUICKLAUNCH
|
||||||
* Compile your programs with -fpie and -pie -rdynamic instead, to generate a single binary (linkable executable).
|
* Compile your programs with -fpie and -pie -rdynamic instead, to generate a single binary (linkable executable).
|
||||||
*/
|
*/
|
||||||
#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; }
|
#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; }
|
||||||
#define EFL_MAIN() int main(int argc, char **argv) { int ret = 0; _elm_startup_time = ecore_time_unix_get(); efl_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret; }
|
#define EFL_MAIN() int main(int argc, char **argv) { int ret = 0; _elm_startup_time = ecore_time_unix_get(); ret = efl_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
@ -234,7 +234,7 @@ EAPI int elm_quicklaunch_fallback(int argc, char **argv);
|
||||||
/**
|
/**
|
||||||
* Exposed symbol used only by macros and should not be used by apps
|
* Exposed symbol used only by macros and should not be used by apps
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool efl_quicklaunch_fallback(int argc, char **argv);
|
EAPI int efl_quicklaunch_fallback(int argc, char **argv);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1124,11 +1124,12 @@ elm_quicklaunch_fork(int argc,
|
||||||
|
|
||||||
if (qre_main)
|
if (qre_main)
|
||||||
{
|
{
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
eo_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, qre_main, NULL);
|
eo_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, qre_main, NULL);
|
||||||
elm_run();
|
ret = efl_loop_begin(ecore_main_loop_get());
|
||||||
elm_shutdown();
|
elm_shutdown();
|
||||||
// FIXME: get value back from the main loop quit ?
|
exit(ret);
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1173,7 +1174,7 @@ elm_quicklaunch_fallback(int argc,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI int
|
||||||
efl_quicklaunch_fallback(int argc,
|
efl_quicklaunch_fallback(int argc,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
|
@ -1184,12 +1185,10 @@ efl_quicklaunch_fallback(int argc,
|
||||||
if (efl_quicklaunch_prepare(argc, argv, getcwd(cwd, sizeof(cwd))))
|
if (efl_quicklaunch_prepare(argc, argv, getcwd(cwd, sizeof(cwd))))
|
||||||
{
|
{
|
||||||
eo_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, qre_main, NULL);
|
eo_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, qre_main, NULL);
|
||||||
elm_run();
|
return efl_loop_begin(ecore_main_loop_get());
|
||||||
// FIXME: get value back from the main loop quit ?
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return EINA_FALSE;
|
return 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI char *
|
EAPI char *
|
||||||
|
|
Loading…
Reference in New Issue