From 799d227d19ac183c6d6a44f2ec131ae46695c056 Mon Sep 17 00:00:00 2001 From: Hyungdeuk Kim Date: Tue, 9 Apr 2013 15:05:51 +0900 Subject: [PATCH] apply latest changes --- client/ug-client.c | 2 ++ client/ug-client.edc | 2 -- include/ug-module.h | 3 +- include/ui-gadget.h | 36 ++++++++++++++++++++ packaging/ui-gadget-1.spec | 2 +- src/manager.c | 1 + src/module.c | 26 +++++++++++++++ ug-efl-engine/ug-efl-engine.c | 76 +++++++++++++++++++++++++++++++++---------- 8 files changed, 126 insertions(+), 22 deletions(-) diff --git a/client/ug-client.c b/client/ug-client.c index 4ea3865..cb09e10 100755 --- a/client/ug-client.c +++ b/client/ug-client.c @@ -302,6 +302,8 @@ static int app_terminate(void *data) LOGD("app_terminate called"); + evas_object_smart_callback_del(ad->win, "wm,rotation,changed", rotate); + ug_destroy_all(); if (ad->ly_main) { diff --git a/client/ug-client.edc b/client/ug-client.edc index 398bb77..be0b1b8 100644 --- a/client/ug-client.edc +++ b/client/ug-client.edc @@ -22,7 +22,6 @@ collections { group { name: "main"; - parts { part { name: "background"; type: RECT; @@ -34,7 +33,6 @@ collections { color: 0 0 0 255; } } - part { name: "content"; type: SWALLOW; description { diff --git a/include/ug-module.h b/include/ug-module.h index a6fc459..7d7bf5e 100644 --- a/include/ug-module.h +++ b/include/ug-module.h @@ -26,11 +26,12 @@ struct ug_module { void *handle; - const char *module_name; + char *module_name; struct ug_module_ops ops; }; struct ug_module *ug_module_load(const char *name); int ug_module_unload(struct ug_module *module); +int ug_exist(const char* name); #endif /* __UG_MODULE_H__ */ diff --git a/include/ui-gadget.h b/include/ui-gadget.h index 0ebcc38..a570f5a 100755 --- a/include/ui-gadget.h +++ b/include/ui-gadget.h @@ -148,8 +148,11 @@ struct ug_cbs { void (*result_cb) (ui_gadget_h ug, service_h result, void *priv); /** destroy callback */ void (*destroy_cb) (ui_gadget_h ug, void *priv); + /** end callback */ + void (*end_cb) (ui_gadget_h ug, void *priv); /** private data */ void *priv; + void *reserved[3]; }; /** @@ -741,6 +744,39 @@ int ug_send_message(ui_gadget_h ug, service_h msg); */ int ug_disable_effect(ui_gadget_h ug); +/** + * \par Description: + * This function check whether given ug is installed or not + * + * \par Purpose: + * This function is used for checking whether given ug is installed or not + * + * \par Typical use case: + * Anyone who want to know whether given ug is installed or not + * + * \par Method of function operation: + * This function returns value that ug is installed or not. + * + * \par Context of function: + * N/A + * + * @param[in] ug The UI gadget + * @return 1 - installed, 0 - installed, -1 - error + * + * \pre None + * \post None + * \see None + * \remarks None + * + * \par Sample code: + * \code + * #include + * ... + * ret = ug_is_installed(ug); + * ... + */ +int ug_is_installed(const char *name); + #ifdef __cplusplus } #endif diff --git a/packaging/ui-gadget-1.spec b/packaging/ui-gadget-1.spec index 23bac8c..e1074f9 100755 --- a/packaging/ui-gadget-1.spec +++ b/packaging/ui-gadget-1.spec @@ -1,7 +1,7 @@ Name: ui-gadget-1 Summary: UI Gadget Library -Version: 0.1.19 +Version: 0.1.20 Release: 1 Group: System/Libraries License: Apache License, Version 2.0 diff --git a/src/manager.c b/src/manager.c index 7af9fb3..bc3de24 100755 --- a/src/manager.c +++ b/src/manager.c @@ -410,6 +410,7 @@ static int ugman_indicator_update(enum ug_option opt, enum ug_event event) } if(cur_state != enable) { + _DBG("set indicator as %d", enable); utilx_enable_indicator(ug_man.disp, ug_man.win_id, enable); } return 0; diff --git a/src/module.c b/src/module.c index 2f4915e..bd2fedc 100644 --- a/src/module.c +++ b/src/module.c @@ -139,3 +139,29 @@ int ug_module_unload(struct ug_module *module) free(module); return 0; } + +int ug_exist(const char* name) +{ + char ug_file[PATH_MAX] = {0,}; + int ret = 0; + + do { + snprintf(ug_file, PATH_MAX, "/usr/ug/lib/libug-%s.so", name); + if (file_exist(ug_file)) { + ret = 1; + break; + } + snprintf(ug_file, PATH_MAX, "/opt/ug/lib/libug-%s.so", name); + if (file_exist(ug_file)) { + ret = 1; + break; + } + snprintf(ug_file, PATH_MAX, "/opt/usr/ug/lib/libug-%s.so", name); + if (file_exist(ug_file)) { + ret = 1; + break; + } + } while (0); + + return ret; +} diff --git a/ug-efl-engine/ug-efl-engine.c b/ug-efl-engine/ug-efl-engine.c index dcdef36..49c8438 100755 --- a/ug-efl-engine/ug-efl-engine.c +++ b/ug-efl-engine/ug-efl-engine.c @@ -34,7 +34,6 @@ static Evas_Object *navi = NULL; static Evas_Object *conform = NULL; static void on_show_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void __hide_finished(void *data, Evas_Object *obj, void *event_info); static void (*show_end_cb)(void* data) = NULL; static void (*hide_end_cb)(void* data) = NULL; @@ -52,16 +51,6 @@ static void _layout_del_cb(void *data, Evas_Object *obj, void *event_info) ug->layout = NULL; } -static void __del_effect_top_layout(ui_gadget_h ug) -{ - _DBG("\t cb transition add ug=%p", ug); - evas_object_smart_callback_add(navi, "transition,finished", - __hide_finished, ug); - elm_naviframe_item_pop(navi); - ug->effect_layout = NULL; - ug->layout_state = UG_LAYOUT_HIDEEFFECT; -} - static Eina_Bool __destroy_end_cb(void *data) { GSList *child; @@ -92,16 +81,15 @@ static Eina_Bool __destroy_end_cb(void *data) return ECORE_CALLBACK_CANCEL; } - static void __del_effect_end(ui_gadget_h ug) { if (navi) { Elm_Object_Item *t = elm_naviframe_top_item_get(navi); Elm_Object_Item *b = elm_naviframe_bottom_item_get(navi); if (t == b) { - _DBG("\t remove navi"); - evas_object_del(navi); - navi = NULL; + _DBG("\t unset navi"); + elm_object_part_content_unset(conform, "elm.swallow.ug"); + evas_object_hide(navi); } } if (ug->layout) { @@ -114,6 +102,33 @@ static void __del_effect_end(ui_gadget_h ug) ug->layout_state = UG_LAYOUT_DESTROY; } +static void __del_finished(void *data, Evas_Object *obj, void *event_info) +{ + ui_gadget_h ug = (ui_gadget_h)data; + if (!ug) + return; + + _DBG("\t obj=%p ug=%p", obj, ug); + + evas_object_smart_callback_del(obj, "transition,finished", + __del_finished); + + if(ug->layout_state == UG_LAYOUT_HIDEEFFECT) + __del_effect_end(ug); + else + _ERR("wrong ug(%p) state(%d)", ug, ug->layout_state); +} + +static void __del_effect_top_layout(ui_gadget_h ug) +{ + _DBG("\t cb transition add ug=%p", ug); + evas_object_smart_callback_add(navi, "transition,finished", + __del_finished, ug); + elm_naviframe_item_pop(navi); + ug->effect_layout = NULL; + ug->layout_state = UG_LAYOUT_HIDEEFFECT; +} + static void __del_effect_layout(ui_gadget_h ug, ui_gadget_h t_ug) { GSList *child; @@ -148,6 +163,25 @@ static void __del_effect_layout(ui_gadget_h ug, ui_gadget_h t_ug) __del_effect_end(ug); } +static void __hide_effect_end(ui_gadget_h ug) +{ + if (navi) { + Elm_Object_Item *t = elm_naviframe_top_item_get(navi); + Elm_Object_Item *b = elm_naviframe_bottom_item_get(navi); + if (t == b) { + _DBG("\t unset navi"); + elm_object_part_content_unset(conform, "elm.swallow.ug"); + evas_object_hide(navi); + } + } + + if (ug->layout) { + evas_object_hide(ug->layout); + } + + ug->layout_state = UG_LAYOUT_HIDE; +} + static void __hide_finished(void *data, Evas_Object *obj, void *event_info) { ui_gadget_h ug = (ui_gadget_h)data; @@ -160,7 +194,7 @@ static void __hide_finished(void *data, Evas_Object *obj, void *event_info) __hide_finished); if(ug->layout_state == UG_LAYOUT_HIDEEFFECT) - __del_effect_end(ug); + __hide_effect_end(ug); else _ERR("wrong ug(%p) state(%d)", ug, ug->layout_state); } @@ -187,9 +221,14 @@ static void __on_hideonly_cb(void *data, Evas_Object *obj) } if (elm_naviframe_top_item_get(navi) == ug->effect_layout) { + _DBG("\t cb transition add ug=%p", ug); + evas_object_smart_callback_add(navi, "transition,finished", + __hide_finished, ug); elm_naviframe_item_pop(navi); + ug->layout_state = UG_LAYOUT_HIDEEFFECT; } else { elm_object_item_del(ug->effect_layout); + __hide_effect_end(ug); } ug->effect_layout = NULL; @@ -259,7 +298,7 @@ static void __show_finished(void *data, Evas_Object *obj, void *event_info) _DBG("ug(%p) already destroyed", ug); } else if (ug->layout_state == UG_LAYOUT_SHOWEFFECT) { ug->layout_state = UG_LAYOUT_SHOW; - if(show_end_cb) + if((show_end_cb)&&(ug->state == UG_STATE_CREATED)) show_end_cb(ug); } else { _ERR("wrong state(%d)", ug->layout_state); @@ -280,12 +319,12 @@ static void on_show_cb(void *data, Evas *e, Evas_Object *obj, evas_object_intercept_hide_callback_add(ug->layout, __on_hideonly_cb, ug); - evas_object_event_callback_add(ug->layout, EVAS_CALLBACK_DEL, _layout_del_cb, ug); //if 'elm.swallow.ug' string is changed, msg team have to apply this changes. elm_object_part_content_set(conform, "elm.swallow.ug", navi); if (ug->layout_state == UG_LAYOUT_HIDEEFFECT + || ug->layout_state == UG_LAYOUT_HIDE || ug->layout_state == UG_LAYOUT_INIT) { _DBG("\t UG_LAYOUT_Init(%d) obj=%p", ug->layout_state, obj); ug->layout_state = UG_LAYOUT_SHOWEFFECT; @@ -351,6 +390,7 @@ static void *on_create(void *win, ui_gadget_h ug, evas_object_hide(ug->layout); evas_object_event_callback_add(ug->layout, EVAS_CALLBACK_SHOW, on_show_cb, ug); + evas_object_event_callback_add(ug->layout, EVAS_CALLBACK_DEL, _layout_del_cb, ug); ug->layout_state = UG_LAYOUT_INIT; -- 2.7.4