Add new api for customizing main loop 36/49636/1
authorSemun Lee <sm79.lee@samsung.com>
Fri, 16 Oct 2015 06:29:37 +0000 (15:29 +0900)
committerSemun Lee <sm79.lee@samsung.com>
Fri, 16 Oct 2015 06:29:37 +0000 (15:29 +0900)
- appcore_efl_init, appcore_efl_fini are added
- appcore_efl_init doesn't call elm_run()

Change-Id: Ie0d9916ac7851148e81976b3709695e7bb9c5678
Signed-off-by: Semun Lee <sm79.lee@samsung.com>
include/appcore-efl.h
src/appcore-efl.c

index 794734a..e79b863 100644 (file)
 extern "C" {
 #endif
 
+int appcore_efl_init(const char *name, int *argc, char ***argv,
+                    struct appcore_ops *ops);
+
+void appcore_efl_fini(void);
+
+
 /**
  * @par Description:
  * This is a main function for EFL application on SLP platform. \n
index 071dc8f..939e2cc 100644 (file)
@@ -977,8 +977,8 @@ static struct ui_wm_rotate wm_rotate = {
        __wm_resume_rotation_cb
 };
 
-EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv,
-                               struct appcore_ops *ops)
+EXPORT_API int appcore_efl_init(const char *name, int *argc, char ***argv,
+                    struct appcore_ops *ops)
 {
        int r;
 
@@ -993,13 +993,29 @@ EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv,
                return -1;
        }
 
-       elm_run();
+       return 0;
+}
 
+EXPORT_API void appcore_efl_fini(void)
+{
        aul_status_update(STATUS_DYING);
 
        __after_loop(&priv);
 
        __unset_data(&priv);
+}
+
+EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv,
+                               struct appcore_ops *ops)
+{
+       int r;
+
+       r = appcore_efl_init(name, argc, argv, ops);
+       _retv_if(r == -1, -1);
+
+       elm_run();
+
+       appcore_efl_fini();
 
        return 0;
 }