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;
-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);
#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 { \
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;
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;
+ }
+ }
}
}
}
images {
- image: "initial.jpg" COMP;
+ image: "Aventure01.1.png" COMP;
+ image: "Location.gif" COMP;
}
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";
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;
}
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;
}
}
#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)
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);
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;
}
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
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
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, };
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;
}
#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;
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);