--- /dev/null
+images {
+ image: "initial.jpg" COMP;
+}
+
+
+collections {
+ group { name: "main";
+ parts {
+ part { name: "bg";
+ type: SPACER;
+ description { state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ }
+ }
+ part { name: "bg_img";
+ type: IMAGE;
+ scale: 1;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; to: "bg"; }
+ rel2 { relative: 1.0 1.0; to: "bg"; }
+ image {
+ normal: "initial.jpg";
+ }
+ visible: 1;
+ }
+ }
+ part { name: "point_bg";
+ type: SPACER;
+ description { state: "default" 0.0;
+ align: 0.5 0.5;
+ rel1 { relative: 0.0 0.1; }
+ rel2 { relative: 1.0 0.3; }
+ }
+ description { state: "down" 0.0;
+ inherit: "default" 0.0;
+ rel1 { relative: 0.0 0.4; }
+ rel2 { relative: 1.0 0.6; }
+ }
+ }
+ part { name: "point";
+ type: TEXT;
+ 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;
+ }
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "go_down";
+ signal: "load";
+ action: STATE_SET "down" 0.0;
+ target: "point";
+ transition: ACCELERATE 2.0;
+ after: "go_up";
+ }
+ program {
+ name: "go_up";
+ signal: "load";
+ action: STATE_SET "default" 0.0;
+ target: "point";
+ transition: DECELERATE 2.0;
+ after: "go_down";
+ }
+
+ }
+ }
+}
#include <tizen.h>
#include "adventure.h"
#include "log.h"
-#include "webview.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)
}
static void
-create_base_gui(appdata_s *ad)
+create_base_gui(adventure_info_s *adventure_info)
{
- /* 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);
-
- 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);
- }
+ 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);
- evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
+ 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);
- /* 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);
/* Show window after base gui is set up */
- evas_object_show(ad->win);
+ evas_object_show(adventure_info->win);
}
static bool
app_create(void *data)
{
- appdata_s *ad = data;
+ adventure_info_s *adventure_info = data;
- create_base_gui(ad);
+ create_base_gui(adventure_info);
return true;
}
static void
app_control(app_control_h app_control, void *data)
{
- appdata_s *ad = data;
- Evas_Object *webview = NULL;
-
- webview = webview_create(ad->conform);
- ret_if(!webview);
- elm_object_content_set(ad->conform, webview);
+ adventure_info_s *adventure_info = data;
+ Evas_Object *initial = NULL;
- webview_set_url(webview, "http://www.naver.com");
+ initial = initial_create(adventure_info->conform, adventure_info->width, adventure_info->height);
+ ret_if(!initial);
}
static void
int
main(int argc, char *argv[])
{
- appdata_s ad = {0,};
+ adventure_info_s adventure_info = {0,};
int ret = 0;
ui_app_lifecycle_callback_s event_callback = {0,};
event_callback.resume = app_resume;
event_callback.app_control = app_control;
- ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
- ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
- ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
- ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
- ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &adventure_info);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &adventure_info);
+ ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &adventure_info);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &adventure_info);
+ ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &adventure_info);
ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
- ret = ui_app_main(argc, argv, &event_callback, &ad);
+ ret = ui_app_main(argc, argv, &event_callback, &adventure_info);
if (ret != APP_ERROR_NONE) {
dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
}
--- /dev/null
+#include <Elementary.h>
+#include <app.h>
+#include "log.h"
+#include "util.h"
+
+const char *const INITIAL_EDC = "initial.edj";
+
+
+
+Evas_Object *initial_create(Evas_Object *parent, int width, int height)
+{
+ Evas_Object *initial = NULL;
+ char *path = NULL;
+ char full_path[PATH_LEN] = {0, };
+
+ retv_if(!parent, NULL);
+
+ path = app_get_resource_path();
+ 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);
+
+ return initial;
+}
+
+void initial_destroy(Evas_Object *initial)
+{
+ ret_if(!initial);
+ evas_object_del(initial);
+}