summaryrefslogtreecommitdiff
path: root/ug-efl-engine/ug-efl-engine.c
diff options
context:
space:
mode:
authorJiwoong Im <jiwoong.im@samsung.com>2016-11-29 16:08:49 +0900
committerJiwoong Im <jiwoong.im@samsung.com>2016-11-30 15:02:32 +0900
commit9e8f7391751a563617e68aa24990cf45981c051c (patch)
treea8d98021ea5bafae4d4032926d568c0c81b959e0 /ug-efl-engine/ug-efl-engine.c
parent7c1c51c1f4134973bf6c7545399c621eb92a2416 (diff)
downloadui-gadget-1-9e8f7391751a563617e68aa24990cf45981c051c.tar.gz
ui-gadget-1-9e8f7391751a563617e68aa24990cf45981c051c.tar.bz2
ui-gadget-1-9e8f7391751a563617e68aa24990cf45981c051c.zip
- add execption handling codes remove unnecessary codes modify codes related with "transition,finished" in ug-efl-engine add indicator update codes Change-Id: I9e1baacc7fb962cf0b4bd0488163c10777bc4394 Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
Diffstat (limited to 'ug-efl-engine/ug-efl-engine.c')
-rwxr-xr-xug-efl-engine/ug-efl-engine.c82
1 files changed, 66 insertions, 16 deletions
diff --git a/ug-efl-engine/ug-efl-engine.c b/ug-efl-engine/ug-efl-engine.c
index c60e48e..5088a4c 100755
--- a/ug-efl-engine/ug-efl-engine.c
+++ b/ug-efl-engine/ug-efl-engine.c
@@ -66,8 +66,6 @@ static void _layout_del_cb(void *data, Evas_Object *obj, void *event_info)
evas_object_event_callback_del(ug->layout, EVAS_CALLBACK_DEL,
(Evas_Object_Event_Cb)_layout_del_cb);
-
- ug->layout_state = UG_LAYOUT_DESTROY;
ug->layout = NULL;
}
@@ -95,14 +93,25 @@ static void __del_effect_end(ui_gadget_h ug)
static void __del_finished(void *data, Evas_Object *obj, void *event_info)
{
- ui_gadget_h ug = (ui_gadget_h)data;
- if (!ug)
+ if (!event_info) {
+ _ERR("invalid event_info param");
return;
+ }
+ Elm_Object_Item *item = event_info;
+ if (!item) {
+ _ERR("item is null");
+ return;
+ }
- _DBG("\t obj=%p ug=%p", obj, ug);
+ ui_gadget_h ug = (ui_gadget_h) elm_object_item_data_get(item);
+ if (!ug) {
+ _ERR("ug is null");
+ return;
+ }
- evas_object_smart_callback_del(obj, "transition,finished",
- __del_finished);
+ _WRN("\t obj=%p ug=%p", obj, ug);
+
+ elm_object_item_del_cb_set(obj, NULL);
if (ug->layout_state == UG_LAYOUT_HIDEEFFECT)
__del_effect_end(ug);
@@ -112,9 +121,9 @@ static void __del_finished(void *data, Evas_Object *obj, void *event_info)
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);
+ _WRN("\t cb transition add ug=%p", ug);
+
+ elm_object_item_del_cb_set(ug->effect_layout, __del_finished);
elm_naviframe_item_pop(navi);
ug->effect_layout = NULL;
ug->layout_state = UG_LAYOUT_HIDEEFFECT;
@@ -184,6 +193,18 @@ static void __on_hideonly_cb(void *data, Evas_Object *obj)
_DBG("\t obj=%p ug=%p layout_state=%d state=%d", obj, ug, ug->layout_state, ug->state);
evas_object_intercept_hide_callback_del(ug->layout, __on_hideonly_cb);
+
+ switch (ug->state) {
+ case UG_STATE_READY:
+ case UG_STATE_DESTROYING:
+ case UG_STATE_PENDING_DESTROY:
+ case UG_STATE_DESTROYED:
+ _DBG("wrong ug state");
+ return;
+ default:
+ break;
+ }
+
evas_object_event_callback_add(ug->layout, EVAS_CALLBACK_SHOW, on_show_cb, ug);
if (ug->layout_state == UG_LAYOUT_SHOW) {
@@ -202,6 +223,7 @@ static void __on_hideonly_cb(void *data, Evas_Object *obj)
__hide_finished, ug);
elm_naviframe_item_pop(navi);
ug->layout_state = UG_LAYOUT_HIDEEFFECT;
+ ug->effect_layout = NULL;
} else {
elm_object_item_del(ug->effect_layout);
__hide_end(ug);
@@ -246,7 +268,9 @@ static void on_destroy(ui_gadget_h ug, ui_gadget_h t_ug,
|| ug->layout_state == UG_LAYOUT_NOEFFECT) {
__del_effect_layout(ug, t_ug);
} else if (ug->layout_state == UG_LAYOUT_HIDEEFFECT) {
- ;
+ evas_object_smart_callback_del(navi, "transition,finished",
+ __hide_finished);
+ elm_object_item_del_cb_set(ug->effect_layout, __del_finished);
} else {
_WRN("[UG Effect Plug-in] : layout state(%p) error!!", ug->layout_state);
__del_effect_end(ug);
@@ -277,6 +301,14 @@ static void __show_finished(void *data, Evas_Object *obj, void *event_info)
return;
}
+static int __show_end_cb_by_job_add(void *data)
+{
+ if (show_end_cb)
+ show_end_cb(data);
+
+ return 0;
+}
+
static void on_show_cb(void *data, Evas *e, Evas_Object *obj,
void *event_info)
{
@@ -293,6 +325,7 @@ static void on_show_cb(void *data, Evas *e, Evas_Object *obj,
/*
* if 'elm.swallow.ug' string is changed, msg team have to apply this changes.
*/
+ evas_object_show(navi);
elm_object_part_content_set(conform, "elm.swallow.ug", navi);
if (ug->layout_state == UG_LAYOUT_HIDEEFFECT
@@ -305,14 +338,13 @@ static void on_show_cb(void *data, Evas *e, Evas_Object *obj,
__show_finished, ug);
ug->effect_layout = elm_naviframe_item_push(navi, NULL, NULL, NULL,
ug->layout, NULL);
+ elm_object_item_data_set(ug->effect_layout, (void *)ug);
} else if (ug->layout_state == UG_LAYOUT_NOEFFECT) {
_DBG("\t UG_LAYOUT_NOEFFECT obj=%p", obj);
Elm_Object_Item *navi_top = elm_naviframe_top_item_get(navi);
ug->effect_layout = elm_naviframe_item_insert_after(navi,
navi_top, NULL, NULL, NULL, ug->layout, NULL);
-
- if (show_end_cb)
- show_end_cb(ug);
+ ecore_job_add((Ecore_Cb)__show_end_cb_by_job_add, (void *)data);
} else {
_ERR("\tlayout state error!! state=%d\n", ug->layout_state);
}
@@ -341,7 +373,6 @@ static void *on_create(void *win, ui_gadget_h ug,
if (!navi) {
navi = elm_naviframe_add(conform);
- elm_object_focus_allow_set(navi, EINA_FALSE);
elm_object_style_set(navi, "uglib");
elm_naviframe_content_preserve_on_pop_set(navi, EINA_TRUE);
_DBG("\t new navi first navi=%p", navi);
@@ -369,7 +400,9 @@ static void *on_create(void *win, ui_gadget_h ug,
static void *on_request(void *data, ui_gadget_h ug, int req)
{
- void *ret;
+ void *ret = NULL;
+ Elm_Object_Item *navi_bottom_item = NULL;
+ Elm_Object_Item *navi_top_item = NULL;
_DBG("on_request ug(%p) req(%d)", ug, req);
@@ -377,6 +410,23 @@ static void *on_request(void *data, ui_gadget_h ug, int req)
case UG_UI_REQ_GET_CONFORMANT:
ret = (void *)_get_win_conformant((Evas_Object *)data);
break;
+ case UG_UI_REQ_UNSET_CONTENT:
+ _DBG("unset swallow ug content");
+ if (navi) {
+ navi_bottom_item = elm_naviframe_bottom_item_get(navi);
+ navi_top_item = elm_naviframe_top_item_get(navi);
+
+ while (navi_bottom_item != navi_top_item) {
+ _DBG("navi item : %p", navi_top_item);
+ elm_object_item_del(navi_top_item);
+ navi_top_item = elm_naviframe_top_item_get(navi);
+ }
+
+ _DBG("\t unset navi");
+ elm_object_part_content_unset(conform, "elm.swallow.ug");
+ evas_object_hide(navi);
+ }
+ break;
default:
_WRN("wrong req id(%d)", req);
return NULL;