struct ug_data *ad = (struct ug_data*) data;
- LOGD("Path returned by file selector: %s", event_info);
+ LOGD("Path returned by file selector: %s", (char *) event_info);
// event_info contains (char*) full path to the selected file or NULL if Cancel button was pushed
const char *path = _fix_file_path((const char* const) event_info);
LOGD("Fixed path : %s", path);
{
LOGD("Enter function: %s", __func__);
(void)it;
+ (void)data;
- struct ug_data *ad = (struct ug_data*) data;
-
- if (ad->ug) {
- ug_destroy_me(ad->ug);
- ad->ug = NULL;
- }
+// struct ug_data *ad = (struct ug_data*) data;
+//
+// if (ad->ug) {
+// ug_destroy_me(ad->ug);
+// ad->ug = NULL;
+// }
+ elm_exit();
return EINA_TRUE;
}
elm_naviframe_item_pop_cb_set(nf_it, NULL, NULL);
elm_naviframe_prev_btn_auto_pushed_set(ad->navi_bar, EINA_FALSE);
- ea_object_event_callback_add(ad->navi_bar, EA_CALLBACK_BACK, ea_naviframe_back_cb, NULL);
- ea_object_event_callback_add(ad->navi_bar, EA_CALLBACK_MORE, ea_naviframe_more_cb, NULL);
+ //ea_object_event_callback_add(ad->navi_bar, EA_CALLBACK_BACK, ea_naviframe_back_cb, NULL);
+ //ea_object_event_callback_add(ad->navi_bar, EA_CALLBACK_MORE, ea_naviframe_more_cb, NULL);
}
void create_ok_popup(struct ug_data *ad)
elm_object_part_content_set(ad->popup, "button1", btn_ok);
- ea_object_event_callback_add(ad->popup, EA_CALLBACK_BACK, _pop_response_ok_cb, ad);
+ //ea_object_event_callback_add(ad->popup, EA_CALLBACK_BACK, _pop_response_ok_cb, ad);
evas_object_show(ad->popup);
#include "im-uigadget.h"
#include "im-main-menu.h"
-static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
+static void _win_del(void *data, Evas_Object * obj, void *event_info)
{
- (void) mode;
- (void) service;
+ printf("Enter function: %s\n", __func__);
+ (void)data;
+ (void)obj;
+ (void)event_info;
+ elm_exit();
+}
+
+
+static Evas_Object *_create_win(const char *name)
+{
+ printf("Enter function: %s\n", __func__);
+ Evas_Object *eo;
+ //int w, h;
+ eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+ if (eo) {
+ elm_win_title_set(eo, name);
+ evas_object_smart_callback_add(eo, "delete,request", _win_del, NULL );
+ // elm_win_screen_size_get(eo, NULL, NULL, &w, &h);
+ {
+ // h /= 2;
+ // w /= 2;
+ //int t = h * 3. / 4.;
+ //w = (t < w) ? t : w;
+ }
+ evas_object_resize(eo, 600, 400);
+ }
+ return eo;
+}
- int theme = 0;
- if (NULL == ug)
- return NULL ;
- if (NULL == priv)
- return NULL ;
+
+static bool on_create(void *data)
+{
+ printf("Enter function: %s\n", __func__);
+// int theme = 0;
+ if (NULL == data)
+ return EINA_FALSE;
bindtextdomain(PACKAGE, LOCALEDIR);
- struct ug_data *ugd = priv;
- ugd->ug = ug;
+ struct ug_data *ugd = data;
- ugd->win_main = ug_get_parent_layout(ug);
- if (NULL == ugd->win_main) {
- return NULL ;
+ ugd->win_main = _create_win(PACKAGE);
+ if (ugd->win_main == NULL) {
+ return EINA_FALSE;
}
+ evas_object_show(ugd->win_main);
+ elm_win_indicator_mode_set(ugd->win_main, ELM_WIN_INDICATOR_SHOW);
- if (strncmp(elm_theme_get(NULL ), "tizen-HD-dark", strlen("tizen-HD-dark")) == 0) {
- theme = 0;
- } else if (strncmp(elm_theme_get(NULL ), "tizen-HD-light", strlen("tizen-HD-light")) == 0) {
- theme = 1;
- }
+// if (strncmp(elm_theme_get(NULL ), "tizen-HD-dark", strlen("tizen-HD-dark")) == 0) {
+// theme = 0;
+// } else if (strncmp(elm_theme_get(NULL ), "tizen-HD-light", strlen("tizen-HD-light")) == 0) {
+// theme = 1;
+// }
ugd->bg = elm_bg_add(ugd->win_main);
if (!ugd->bg) {
LOGD("ugd->bg is null");
free(ugd->win_main);
- return NULL ;
+ return EINA_FALSE;
}
+ elm_win_resize_object_add(ugd->win_main, ugd->bg);
evas_object_size_hint_weight_set(ugd->bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_resize(ugd->bg, 600, 400);
evas_object_show(ugd->bg);
ugd->layout_main = elm_layout_add(ugd->win_main);
LOGD("ugd->layout_main is null");
free(ugd->win_main);
free(ugd->bg);
- return NULL;
+ return EINA_FALSE;
}
ugd->theme = elm_theme_new();
-
- if (theme == 1) {
- elm_theme_set(ugd->theme, "tizen-HD-light");
- } else {
- elm_theme_set(ugd->theme, "tizen-HD-dark");
- }
+//
+// if (theme == 1) {
+// elm_theme_set(ugd->theme, "tizen-HD-light");
+// } else {
+// elm_theme_set(ugd->theme, "tizen-HD-dark");
+ elm_theme_set(ugd->theme, "default");
+// }
elm_object_theme_set(ugd->layout_main, ugd->theme);
elm_layout_theme_set(ugd->layout_main, "layout", "application", "default");
evas_object_size_hint_weight_set(ugd->layout_main, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_min_set(ugd->layout_main, 600, 400);
+ evas_object_resize(ugd->layout_main, 600, 400);
evas_object_show(ugd->layout_main);
elm_object_part_content_set(ugd->layout_main, "elm.swallow.bg", ugd->bg);
free(ugd->win_main);
free(ugd->bg);
free(ugd->layout_main);
- return NULL;
+ return EINA_FALSE;
}
elm_object_part_content_set(ugd->layout_main, "elm.swallow.content", ugd->navi_bar);
evas_object_show(ugd->navi_bar);
im_main_menu_cb((void*) ugd, NULL, NULL);
- return ugd->layout_main;
+ return EINA_TRUE;
}
-
+/*
static void on_start(ui_gadget_h ug, service_h service, void *priv)
{
(void)ug;
(void)service;
(void)priv;
}
+*/
+
-static void on_pause(ui_gadget_h ug, service_h service, void *priv)
+static void on_pause(void *priv)
{
- (void)ug;
- (void)service;
+ printf("Enter function: %s\n", __func__);
(void)priv;
}
-static void on_resume(ui_gadget_h ug, service_h service, void *priv)
+static void on_resume(void *priv)
{
- (void)ug;
- (void)service;
+ printf("Enter function: %s\n", __func__);
(void)priv;
}
-static void on_destroy(ui_gadget_h ug, service_h service, void *priv)
+static void on_destroy(void *priv)
{
- (void)service;
-
- if (NULL == ug) {
- LOGD("NULL == ug; return");
- return;
- }
+ printf("Enter function: %s\n", __func__);
if (NULL == priv) {
LOGD("NULL == priv; return");
return;
ugd->layout_main = NULL;
}
+static void _tmp(void *priv)
+{
+ (void)priv;
+ printf("Enter function: %s\n", __func__);
+}
+
+static void _tmp2(app_device_orientation_e mode, void *priv)
+{
+ (void)priv;
+ (void)mode;
+ printf("Enter function: %s\n", __func__);
+}
+
+/*
static void on_message(ui_gadget_h ug, service_h msg, service_h service, void *priv)
{
(void)ug;
(void)service;
(void)priv;
}
+*/
+/*
static void on_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv)
{
(void)ug;
break;
}
}
+*/
+/*
static void on_key_event(ui_gadget_h ug, enum ug_key_event event, service_h service, void *priv)
{
(void)service;
break;
}
}
+*/
-UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
+int main(int argc, char *argv[])
{
- if (NULL == ops) {
- LOGD("NULL == ops; return");
- return -1;
+ printf("Enter function: %s\n", __func__);
+ struct ug_data ugd; // = calloc(1, sizeof(struct ug_data));
+ memset(&ugd, 0x0, sizeof(struct ug_data));
+
+ app_event_callback_s event_callback;
+
+ event_callback.create = on_create;
+ //event_callback.start = on_start;
+ event_callback.pause = on_pause;
+ event_callback.resume = on_resume;
+ event_callback.terminate = on_destroy;
+
+// event_callback.service = NULL;
+// event_callback.low_memory = NULL;
+// event_callback.low_battery = NULL;
+// event_callback.device_orientation = NULL;
+// event_callback.language_changed = NULL;
+// event_callback.region_format_changed = NULL;
+ event_callback.service = NULL;
+ event_callback.low_memory = _tmp;
+ event_callback.low_battery = _tmp;
+ event_callback.device_orientation = _tmp2;
+ event_callback.language_changed = _tmp;
+ event_callback.region_format_changed = _tmp;
+ // event_callback.message = on_message;
+ //event_callback.event = on_event;
+ //event_callback.key_event = on_key_event;
+
+ //on_create(&ugd);
+
+ int ret = app_efl_main(&argc, &argv, &event_callback, &ugd);
+ switch (ret) {
+ case APP_ERROR_NONE:
+ printf("APP_ERROR_NONE\n");
+ break;
+ case APP_ERROR_INVALID_PARAMETER:
+ printf("APP_ERROR_INVALID_PARAMETER\n");
+ break;
+ case APP_ERROR_INVALID_CONTEXT:
+ printf("APP_ERROR_INVALID_CONTEXT\n");
+ break;
+ case APP_ERROR_ALREADY_RUNNING:
+ printf("APP_ERROR_ALREADY_RUNNING\n");
+ break;
+ default:
+ printf("Unknown error\n");
+ break;
}
- struct ug_data *ugd = calloc(1, sizeof(struct ug_data));
-
- ops->create = on_create;
- ops->start = on_start;
- ops->pause = on_pause;
- ops->resume = on_resume;
- ops->destroy = on_destroy;
- ops->message = on_message;
- ops->event = on_event;
- ops->key_event = on_key_event;
- ops->priv = ugd;
- ops->opt = UG_OPT_INDICATOR_ENABLE;
-
- return 0;
+ printf("return function: %s (%d)\n", __func__, ret);
+ return ret;
}
+/*
UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
{
if (NULL == ops) {
{
(void)service;
(void)priv;
- /* nothing to do for Setting>Reset */
return 0;
}
+*/
+