Evas_Object *adventure;
Evas_Object *initial;
Evas_Object *loading;
+ Evas_Object *ui_manager;
Ecore_Timer *initial_timer;
};
typedef struct _adventure_info_s adventure_info_s;
-struct _view_info_s {
- char *name;
- Evas_Object *view;
+struct _path_info_s {
+ int path_id;
+ int created_time;
+ int duration;
+ int rate;
+
+ char *title;
+ char *title_image;
+ char *content;
+ char *author;
};
-typedef struct _view_info_s view_info_s;
+typedef struct _path_info_s path_info_s;
+
+struct _point_info_s {
+ int point_id;
+ int path_id;
+ char *title;
+ char *nation;
+ char *district;
+ char *title_image;
+ char *content;
+ char *map_image;
+ char *duration;
+};
+typedef struct _point_info_s point_info_s;
+
+struct _user_info_s {
+ char *user_id;
+ char *password;
+};
+typedef struct _user_info_s user_info_s;
#endif /* __ADVENTURE_H__ */
+++ /dev/null
-#ifndef __ITEM_H__
-#define __ITEM_H__
-
-#include <Elementary.h>
-#include "item_info.h"
-
-extern Evas_Object *item_create(Evas_Object *parent, item_info_s *item_info);
-extern void item_destroy(Evas_Object *item);
-
-#endif /* __ITEM_H__ */
+++ /dev/null
-#ifndef __ITEM_INFO_H__
-#define __ITEM_INFO_H__
-
-struct _item_info_s {
- /* Innate features */
- char *id;
- char *name;
- char *icon_path;
-
- /* Acquire features */
- Evas_Object *icon;
- int width;
- int height;
-};
-typedef struct _item_info_s item_info_s;
-
-extern item_info_s *item_info_create(const char *id);
-extern void item_info_destroy(item_info_s *item_info);
-
-#endif /* __ITEM_INFO_H__ */
+#ifndef __PATH_H__
+#define __PATH_H__
+
+#include <Elementary.h>
+#include "adventure.h"
+
+extern Evas_Object *path_create(Evas_Object *parent, path_info_s *path_info);
+extern void *path_destroy(Evas_Object *path);
+
+#endif /* __PATH_H__ */
+#ifndef __PATH_GROUP_H__
+#define __PATH_GROUP_H__
+
+#include <Elementary.h>
+
+enum {
+ PATH_GROUP_TYPE_PLACE = 0,
+ PATH_GROUP_TYPE_BUY_LIST,
+ PATH_GROUP_TYEP_MY_LIST,
+ PATH_GROUP_TYPE_ALL,
+};
+
+extern Evas_Object *path_group_create(Evas_Object *parent, int type, void *data);
+extern void *path_group_destroy(Evas_Object *path_group);
+
+#endif /* __PATH_GROUP_H__ */
+#ifndef __POINT_H__
+#define __POINT_H__
+
+#include <Elementary.h>
+#include "adventure.h"
+
+extern Evas_Object *point_create(Evas_Object *parent, point_info_s *point_info);
+extern void *point_destroy(Evas_Object *point);
+
+#endif /* __POINT_H__ */
-#ifndef __SCROLLER_INFO_H__
-#define __SCROLLER_INFO_H__
+#ifndef __SCROLLER_H__
+#define __SCROLLER_H__
#include <Elementary.h>
extern int scroller_register_event_cb(Evas_Object *scroller, int event_type, void (*event_cb)(Evas_Object *scroller, int event_type, void *event_info, void *user_data), void *user_data);
extern int scroller_unregister_event_cb(Evas_Object *scroller, int event_type, void (*event_cb)(Evas_Object *scroller, int event_type, void *event_info, void *user_data));
-#endif /* __SCROLLER_INFO_H__ */
+#endif /* __SCROLLER_H__ */
+#ifndef __UI_MANAGER_H__
+#define __UI_MANAGER_H__
+
#include <Elementary.h>
+#include "adventure.h"
-extern Evas_Object *ui_manager_create(Evas_Object *parent);
+extern Evas_Object *ui_manager_create(Evas_Object *parent, adventure_info_s *adventure_info);
extern void ui_manager_destroy(Evas_Object *ui_manager);
-
+#endif /* __UI_MANAGER_H__ */
--- /dev/null
+#ifndef __WRITE_PATH_H__
+#define __WRITE_PATH_H__
+
+#include <Elementary.h>
+#include "adventure.h"
+
+extern Evas_Object *write_path_create(Evas_Object *parent);
+extern void *write_path_destroy(Evas_Object *write_path);
+
+#endif /* __WRITE_PATH_H__ */
--- /dev/null
+images {
+ image: "Aventure01_background.png" COMP;
+}
+
+
+collections {
+ group { name: "main";
+ parts {
+ part {
+ name: "bg";
+ 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";
+ 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: "Aventure01_background.png";
+ }
+ visible: 1;
+ }
+ }
+ part {
+ name: "scroller";
+ type: SWALLOW;
+ description {
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ }
+ }
+}
initial_destroy(adventure_info->initial);
adventure_info->initial_timer = NULL;
+ adventure_info->ui_manager = ui_manager_create(adventure_info->conformant, adventure_info);
+ retv_if(!adventure_info->ui_manager, ECORE_CALLBACK_CANCEL);
+
+#if 0
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);
+#endif
return ECORE_CALLBACK_CANCEL;
}
{
adventure_info_s *adventure_info = data;
+ if (adventure_info->ui_manager)
+ ui_manager_destroy(adventure_info->ui_manager);
+
if (adventure_info->adventure)
_destroy_adventure(adventure_info->adventure);
+++ /dev/null
-#include <Elementary.h>
-#include <app.h>
-
-#include "util.h"
-#include "log.h"
-#include "item.h"
-#include "item_info.h"
-
-
-
-#define DEFAULT_ICON "/usr/share/icons/A01-1_icon_Menu.png"
-#define ITEM_ICON_WIDTH 112
-#define ITEM_ICON_HEIGHT 112
-
-
-
-const char *const ITEM_EDJE = "item.edj";
-
-
-
-static Evas_Object *__add_icon(Evas_Object *parent, const char *file)
-{
- Evas_Object *icon = NULL;
-
- retv_if(!parent, NULL);
-
- icon = elm_icon_add(parent);
- retv_if(!icon, NULL);
-
- if (elm_image_file_set(icon, file, NULL) == EINA_FALSE) {
- _E("Icon file is not accessible (%s)", file);
- evas_object_del(icon);
- return NULL;
- }
-
- evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(ITEM_ICON_WIDTH), ELM_SCALE_SIZE(ITEM_ICON_HEIGHT));
-
- elm_image_preload_disabled_set(icon, EINA_TRUE);
- elm_image_smooth_set(icon, EINA_TRUE);
- elm_image_no_scale_set(icon, EINA_FALSE);
- evas_object_show(icon);
-
- return icon;
-}
-
-
-
-static void __item_clicked_cb(void *data, Evas_Object *obj, void *event_info)
-{
- item_info_s *item_info = data;
-
- ret_if(!item_info);
-}
-
-
-
-Evas_Object *item_create(Evas_Object *parent, item_info_s *item_info)
-{
- Evas_Object *item = NULL;
- Evas_Object *item_bg = NULL;
- Evas_Object *icon = NULL;
- Evas_Object *button = NULL;
- Evas *e = NULL;
-
- char *path = NULL;
- char *name = 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, ITEM_EDJE);
- free(path);
-
- item = elm_layout_add(parent);
- retv_if(!item, NULL);
- elm_layout_file_set(item, full_path, "item");
-
- e = evas_object_evas_get(parent);
- goto_if(!e, ERROR);
-
- item_bg = evas_object_rectangle_add(e);
- goto_if(!item_bg, ERROR);
- evas_object_size_hint_weight_set(item_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_min_set(item_bg, ELM_SCALE_SIZE(item_info->width), ELM_SCALE_SIZE(item_info->height));
- evas_object_color_set(item_bg, 0, 0, 0, 0);
- evas_object_repeat_events_set(item_bg, EINA_TRUE);
- evas_object_show(item_bg);
- elm_object_part_content_set(item, "bg", item_bg);
- evas_object_show(item);
-
- icon = __add_icon(item, item_info->icon_path);
- goto_if(!icon, ERROR);
- elm_object_part_content_set(item, "icon", icon);
-
- name = item_info->name;
- goto_if(!name, ERROR);
- elm_object_part_text_set(item, "name", name);
-
- button = elm_button_add(item);
- goto_if(!button, ERROR);
-
- elm_object_style_set(button, "focus");
- elm_object_part_content_set(item, "button", button);
- evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show(button);
- evas_object_smart_callback_add(button, "clicked", __item_clicked_cb, item_info);
-
- return item;
-
-ERROR:
- item_destroy(item);
- return NULL;
-
-}
-
-
-
-void item_destroy(Evas_Object *item)
-{
- Evas_Object *bg = NULL;
- Evas_Object *button = NULL;
- Evas_Object *icon = NULL;
-
- ret_if(!item);
-
- button = elm_object_part_content_unset(item, "button");
- if (button) {
- evas_object_smart_callback_del(button, "clicked", __item_clicked_cb);
- }
-
- icon = elm_object_part_content_unset(item, "icon");
- if (icon) {
- evas_object_del(icon);
- }
- bg = elm_object_part_content_unset(item, "bg");
- if (bg) {
- evas_object_del(bg);
- }
- evas_object_del(item);
-}
+++ /dev/null
-#include <Evas.h>
-#include <Elementary.h>
-
-#include "util.h"
-#include "log.h"
-#include "item_info.h"
-
-
-
-item_info_s *item_info_create(const char *id)
-{
- item_info_s *item_info = NULL;
-
- retv_if(!id, NULL);
-
- item_info = calloc(1, sizeof(item_info_s));
- retv_if(!item_info, NULL);
-
- return item_info;
-}
-
-
-
-void item_info_destroy(item_info_s *item_info)
-{
- ret_if(!item_info);
- free(item_info);
-}
+#include <Elementary.h>
+#include "adventure.h"
+#include "log.h"
+
+const char *const UI_MANAGER_EDJE = "ui_manager.edj";
+
+Evas_Object *ui_manager_create(Evas_Object *parent, adventure_info_s *adventure_info)
+{
+ Evas_Object *ui_manager = NULL;
+ Evas_Object *rect = 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, UI_MANAGER_EDJE);
+ free(path);
+
+ ui_manager = elm_layout_add(parent);
+ retv_if(!ui_manager, NULL);
+ elm_layout_file_set(ui_manager, full_path, "main");
+ evas_object_size_hint_weight_set(ui_manager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(ui_manager);
+
+ 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(ui_manager, "bg", rect);
+ }
+
+ return ui_manager;
+}
+
+
+
+extern void ui_manager_destroy(Evas_Object *ui_manager)
+{
+ Evas_Object *rect = NULL;
+
+ ret_if(!ui_manager);
+
+ rect = elm_object_part_content_unset(ui_manager, "bg");
+ if (rect)
+ evas_object_del(rect);
+
+ evas_object_del(ui_manager);
+}