Initial + Loading
authorJin Yoon <jinny.yoon@samsung.com>
Mon, 13 Jul 2015 17:31:22 +0000 (02:31 +0900)
committerJin Yoon <jinny.yoon@samsung.com>
Mon, 13 Jul 2015 17:31:22 +0000 (02:31 +0900)
40 files changed:
inc/adventure.h
inc/loading.h
inc/log.h
res/edje/adventure.edc
res/edje/images/1.png [changed mode: 0755->0644]
res/edje/images/10.png [changed mode: 0755->0644]
res/edje/images/11.png [changed mode: 0755->0644]
res/edje/images/12.png [changed mode: 0755->0644]
res/edje/images/13.png [changed mode: 0755->0644]
res/edje/images/14.png [changed mode: 0755->0644]
res/edje/images/15.png [changed mode: 0755->0644]
res/edje/images/16.png [changed mode: 0755->0644]
res/edje/images/17.png [changed mode: 0755->0644]
res/edje/images/18.png [changed mode: 0755->0644]
res/edje/images/19.png [changed mode: 0755->0644]
res/edje/images/2.png [changed mode: 0755->0644]
res/edje/images/20.png [changed mode: 0755->0644]
res/edje/images/21.png [changed mode: 0755->0644]
res/edje/images/22.png [changed mode: 0755->0644]
res/edje/images/23.png [changed mode: 0755->0644]
res/edje/images/24.png [changed mode: 0755->0644]
res/edje/images/25.png [changed mode: 0755->0644]
res/edje/images/26.png [changed mode: 0755->0644]
res/edje/images/27.png [changed mode: 0755->0644]
res/edje/images/3.png [changed mode: 0755->0644]
res/edje/images/4.png [changed mode: 0755->0644]
res/edje/images/5.png [changed mode: 0755->0644]
res/edje/images/6.png [changed mode: 0755->0644]
res/edje/images/7.png [changed mode: 0755->0644]
res/edje/images/8.png [changed mode: 0755->0644]
res/edje/images/9.png [changed mode: 0755->0644]
res/edje/images/Aventure01.1.png [changed mode: 0755->0644]
res/edje/images/Aventure01.png [changed mode: 0755->0644]
res/edje/images/Aventure01_background.png [changed mode: 0755->0644]
res/edje/images/Location.gif [changed mode: 0755->0644]
res/edje/images/initial.jpg [deleted file]
res/edje/initial.edc
src/adventure.c
src/initial.c
src/loading.c

index 9f2301f..fcb4d0d 100644 (file)
 struct _adventure_info_s {
        Evas_Object *win;
        Evas_Object *conform;
+       Evas_Object *adventure;
        Evas_Object *initial;
+       Evas_Object *loading;
+
+       Ecore_Timer *initial_timer;
+
        Eina_List *view;
 
        int width;
index 6a016b5..b5c8dd4 100644 (file)
@@ -1,2 +1,4 @@
-extern Evas_Object *loading_create(Evas_Object *parent);
+#include <Elementary.h>
+
+extern Evas_Object *loading_create(Evas_Object *parent, int width, int height);
 extern void loading_destroy(Evas_Object *loading);
index f06293f..ed2f504 100644 (file)
--- a/inc/log.h
+++ b/inc/log.h
 #define COLOR_MAGENTA       "\033[1;35m"
 
 #if !defined(_D)
-#define _D(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, COLOR_YELLOW fmt COLOR_END"\n", ##arg)
+#define _D(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, COLOR_YELLOW "[%s:%d]" fmt COLOR_END"\n", __func__, __LINE__, ##arg)
 #endif
 
 #if !defined(_W)
-#define _W(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, COLOR_GRAY fmt COLOR_END"\n", ##arg)
+#define _W(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, COLOR_GRAY "[%s:%d]" fmt COLOR_END"\n", __func__, __LINE__, ##arg)
 #endif
 
 #if !defined(_E)
-#define _E(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, COLOR_RED fmt COLOR_END"\n", ##arg)
+#define _E(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, COLOR_RED "[%s:%d]" fmt COLOR_END"\n", __func__, __LINE__, ##arg)
 #endif
 
 #define retv_if(expr, val) do { \
index cbf3ec7..b11d677 100644 (file)
@@ -8,9 +8,9 @@ collections {
                align: 0.0 0.0;
                rel1 { relative: 0.0 0.0; }
                rel2 { relative: 1.0 1.0; }
-               color: 0 0 0 255;
+               color: 255 255 255 255;
             }
-               part {
+       part {
                        name: "loading";
                        type: SWALLOW;
                        mouse_events: 0;
@@ -22,6 +22,18 @@ collections {
                                visible: 1;
                        }
                }
+               part {
+                       name: "initial";
+                       type: SWALLOW;
+                       mouse_events: 0;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: 0.5 0.5; to: "bg"; }
+                               rel2 { relative: 0.5 0.5; to: "bg"; }
+                               align: 0.5 0.5;
+                               visible: 1;
+                       }
+               }
       }
    }
 }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/res/edje/images/initial.jpg b/res/edje/images/initial.jpg
deleted file mode 100644 (file)
index b984d4c..0000000
Binary files a/res/edje/images/initial.jpg and /dev/null differ
index f79faeb..56e8b59 100644 (file)
@@ -1,5 +1,6 @@
 images {
-   image: "initial.jpg" COMP;
+   image: "Aventure01.1.png" COMP;
+   image: "Location.gif" COMP;
 }
 
 
@@ -7,11 +8,12 @@ collections {
    group { name: "main";
       parts {
          part { name: "bg";
-            type: SPACER;
+            type: SWALLOW;
             description { state: "default" 0.0;
                align: 0.0 0.0;
                rel1 { relative: 0.0 0.0; }
                rel2 { relative: 1.0 1.0; }
+               visible: 0;
             }
          }
          part { name: "bg_img";
@@ -22,7 +24,7 @@ collections {
                rel1 { relative: 0.0 0.0; to: "bg"; }
                rel2 { relative: 1.0 1.0; to: "bg"; }
                image {
-                  normal: "initial.jpg";
+                  normal: "Aventure01.1.png";
                }
                visible: 1;
             }
@@ -31,28 +33,25 @@ collections {
             type: SPACER;
             description { state: "default" 0.0;
                align: 0.5 0.5;
-               rel1 { relative: 0.0 0.1; }
-               rel2 { relative: 1.0 0.3; }
+               rel1 { relative: 0.35 0.5; }
+               rel2 { relative: 0.35 0.5; }
             }
             description { state: "down" 0.0;
                inherit: "default" 0.0;
-               rel1 { relative: 0.0 0.4; }
-               rel2 { relative: 1.0 0.6; }
+               rel1 { relative: 0.35 0.535; }
+               rel2 { relative: 0.35 0.535; }
             }
          }
          part { name: "point";
-            type: TEXT;
+            type: IMAGE;
             mouse_events: 0;
             description { state: "default" 0.0;
-               rel1 { relative: 0.0 0.0; to: "point_bg"; }
-               rel2 { relative: 1.0 1.0; to: "point_bg"; }
-               color: 255 255 255 255;
-               text {
-                  font: "TIZEN:style=medium";
-                  size: 80;
-                  text: "@";
-                  align: 0.5 0.5;
+               rel1 { relative: 0.5 0.5; to: "point_bg"; }
+               rel2 { relative: 0.5 0.5; to: "point_bg"; }
+               image {
+                  normal: "Location.gif";
                }
+               min: 82 113;
                visible: 1;
             }
          }
index b136039..1dfe21b 100644 (file)
@@ -20,6 +20,8 @@
 #include "adventure.h"
 #include "log.h"
 #include "initial.h"
+#include "loading.h"
+#include "util.h"
 
 static void
 win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
@@ -55,21 +57,37 @@ static void _destroy_adventure(Evas_Object *adventure)
        evas_object_del(adventure);
 }
 
-static void
-create_base_gui(adventure_info_s *adventure_info)
+Eina_Bool _destroy_initial_cb(void *data)
 {
-       Evas_Object *adventure = NULL;
+       adventure_info_s *adventure_info = data;
+
+       retv_if(!adventure_info, ECORE_CALLBACK_CANCEL);
+
+       elm_object_part_content_unset(adventure_info->adventure, "initial");
+       initial_destroy(adventure_info->initial);
+       adventure_info->initial_timer = NULL;
 
+       adventure_info->loading = loading_create(adventure_info->adventure, adventure_info->width, adventure_info->height);
+       retv_if(!adventure_info->loading, ECORE_CALLBACK_CANCEL);
+       elm_object_part_content_set(adventure_info->adventure, "loading", adventure_info->loading);
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static bool
+app_create(void *data)
+{
+       adventure_info_s *adventure_info = data;
        adventure_info->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
        elm_win_conformant_set(adventure_info->win, EINA_TRUE);
        elm_win_autodel_set(adventure_info->win, EINA_TRUE);
-
        if (elm_win_wm_rotation_supported_get(adventure_info->win)) {
                int rots[1] = {0};
                elm_win_wm_rotation_available_rotations_set(adventure_info->win, (const int *)(&rots), 1);
        }
        evas_object_smart_callback_add(adventure_info->win, "delete,request", win_delete_request_cb, NULL);
        elm_win_screen_size_get(adventure_info->win, NULL, NULL, &adventure_info->width, &adventure_info->height);
+       evas_object_show(adventure_info->win);
 
        adventure_info->conform = elm_conformant_add(adventure_info->win);
        elm_win_indicator_mode_set(adventure_info->win, ELM_WIN_INDICATOR_HIDE);
@@ -77,23 +95,22 @@ create_base_gui(adventure_info_s *adventure_info)
        elm_win_resize_object_add(adventure_info->win, adventure_info->conform);
        evas_object_show(adventure_info->conform);
 
-       adventure = _create_adventure(ad->conform);
-       if (!adventure)
-               _E("cannot create the adventure ui");
-       else
-               elm_object_content_set(ad->conform, adventure);
+       _D("Window size (%d:%d)", adventure_info->width, adventure_info->height);
 
-       /* Show window after base gui is set up */
-       evas_object_show(adventure_info->win);
-
-}
+       adventure_info->adventure = _create_adventure(adventure_info->conform);
+       if (adventure_info->adventure)
+               elm_object_content_set(adventure_info->conform, adventure_info->adventure);
+       else
+               _E("cannot create the adventure ui");
 
-static bool
-app_create(void *data)
-{
-       adventure_info_s *adventure_info = data;
+       adventure_info->initial = initial_create(adventure_info->conform, adventure_info->width, adventure_info->height);
+       if (adventure_info->initial)
+               elm_object_part_content_set(adventure_info->adventure, "initial", adventure_info->initial);
+       else
+               _E("cannot create the initial ui");
 
-       create_base_gui(adventure_info);
+       adventure_info->initial_timer = ecore_timer_add(3.0f, _destroy_initial_cb, adventure_info);
+       retv_if(!adventure_info->initial_timer, false);
 
        return true;
 }
@@ -102,10 +119,7 @@ static void
 app_control(app_control_h app_control, void *data)
 {
        adventure_info_s *adventure_info = data;
-       Evas_Object *initial = NULL;
-
-       initial = initial_create(adventure_info->conform, adventure_info->width, adventure_info->height);
-       ret_if(!initial);
+       ret_if(!adventure_info);
 }
 
 static void
@@ -123,7 +137,21 @@ app_resume(void *data)
 static void
 app_terminate(void *data)
 {
-       /* Release all resources. */
+       adventure_info_s *adventure_info = data;
+
+       if (adventure_info->adventure)
+               _destroy_adventure(adventure_info->adventure);
+
+       if (adventure_info->initial_timer) {
+               ecore_timer_del(adventure_info->initial_timer);
+               initial_destroy(adventure_info->initial);
+       }
+
+       if (adventure_info->conform)
+               evas_object_del(adventure_info->conform);
+
+       if (adventure_info->win)
+               evas_object_del(adventure_info->win);
 }
 
 static void
index 924ee8f..4ed8d23 100644 (file)
@@ -10,6 +10,7 @@ const char *const INITIAL_EDC = "initial.edj";
 Evas_Object *initial_create(Evas_Object *parent, int width, int height)
 {
        Evas_Object *initial = NULL;
+       Evas_Object *rect = NULL;
        char *path = NULL;
        char full_path[PATH_LEN] = {0, };
 
@@ -19,17 +20,20 @@ Evas_Object *initial_create(Evas_Object *parent, int width, int height)
        retv_if(!path, NULL);
 
        snprintf(full_path, sizeof(full_path), "%s/edje/%s", path, INITIAL_EDC);
-       _D("HELLO, full_path:%s", full_path);
 
        initial = elm_layout_add(parent);
        retv_if(!initial, NULL);
        elm_layout_file_set(initial, full_path, "main");
        evas_object_size_hint_weight_set(initial, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_min_set(initial, width, height);
-       evas_object_size_hint_max_set(initial, width, height);
-       evas_object_resize(initial, width, height);
        evas_object_show(initial);
 
+       rect = evas_object_rectangle_add(evas_object_evas_get(parent));
+       if (rect) {
+               evas_object_size_hint_min_set(rect, width, height);
+               evas_object_show(rect);
+               elm_object_part_content_set(initial, "bg", rect);
+       }
+
        return initial;
 }
 
index 2111f07..cbd2fce 100644 (file)
@@ -2,8 +2,9 @@
 #include <app.h>
 #include "log.h"
 #include "adventure.h"
+#include "util.h"
 
-Evas_Object *loading_create(Evas_Object *parent)
+Evas_Object *loading_create(Evas_Object *parent, int width, int height)
 {
        Evas_Object *loading = NULL;
        char *path = NULL;
@@ -22,6 +23,7 @@ Evas_Object *loading_create(Evas_Object *parent)
        elm_layout_file_set(loading, full_path, "loading");
        evas_object_size_hint_weight_set(loading, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(loading, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_size_hint_min_set(loading, width, height);
        evas_object_show(loading);
 
        free(path);