*/
#include <tizen.h>
+#include <Elementary.h>
#include "adventure.h"
#include "log.h"
- #include "webview.h"
- #include "loading.h"
-
- typedef struct appdata{
- Evas_Object* win;
- Evas_Object* layout;
- Evas_Object* conform;
- } appdata_s;
+ #include "initial.h"
static void
win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
ui_app_exit();
}
+static Evas_Object *_create_adventure(Evas_Object *parent)
+{
+ Evas_Object *adventure = NULL;
+ char *path = NULL;
+ char full_path[PATH_LEN] = {0, };
+
+ adventure = elm_layout_add(parent);
+ retv_if(!adventure, NULL);
+
+ path = app_get_resource_path();
+ retv_if(!path, NULL);
+
+ snprintf(full_path, sizeof(full_path), "%s/edje/adventure.edj", path);
+
+ elm_layout_file_set(adventure, full_path, "main");
+ evas_object_size_hint_weight_set(adventure, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(adventure, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(adventure);
+
+ return adventure;
+}
+
+static void _destroy_adventure(Evas_Object *adventure)
+{
+ ret_if(!adventure);
+ evas_object_del(adventure);
+}
+
static void
- create_base_gui(appdata_s *ad)
+ create_base_gui(adventure_info_s *adventure_info)
{
- Evas_Object *loading = NULL;
+ Evas_Object *adventure = NULL;
- /* Window */
- ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
- elm_win_conformant_set(ad->win, EINA_TRUE);
- elm_win_autodel_set(ad->win, EINA_TRUE);
+
+ 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(ad->win)) {
- int rots[4] = { 0, 90, 180, 270 };
- elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
+ 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_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
-
- /* Conformant */
- ad->conform = elm_conformant_add(ad->win);
- elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
- elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
- evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(ad->win, ad->conform);
- evas_object_show(ad->conform);
+ adventure_info->conform = elm_conformant_add(adventure_info->win);
+ elm_win_indicator_mode_set(adventure_info->win, ELM_WIN_INDICATOR_HIDE);
+ evas_object_size_hint_weight_set(adventure_info->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(adventure_info->win, adventure_info->conform);
+ evas_object_show(adventure_info->conform);
- loading = loading_create(adventure);
- if (!loading)
- _E("cannot load the loading image");
- else
- elm_object_part_content_set(adventure, "loading", loading);
-
+ adventure = _create_adventure(ad->conform);
+ if (!adventure)
+ _E("cannot create the adventure ui");
+ else
+ elm_object_content_set(ad->conform, adventure);
+
/* Show window after base gui is set up */
- evas_object_show(ad->win);
+ evas_object_show(adventure_info->win);
}