summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinwoo Nam <jwoo.nam@samsung.com>2012-08-27 03:55:26 (GMT)
committerJinwoo Nam <jwoo.nam@samsung.com>2012-08-27 03:55:26 (GMT)
commitff183e82db6fdc68ba65eaa16fac039d28fdb2a6 (patch)
tree18c7ddb449b9474133576ae8d6e85a49f25c9bbe
parentbdfe752ade499d2801a2679ca5eed21baa06a9ca (diff)
downloadui-gadget-1-ff183e82db6fdc68ba65eaa16fac039d28fdb2a6.zip
ui-gadget-1-ff183e82db6fdc68ba65eaa16fac039d28fdb2a6.tar.gz
ui-gadget-1-ff183e82db6fdc68ba65eaa16fac039d28fdb2a6.tar.bz2
fix hide finished callback problem
-rwxr-xr-xclient/ug-client.c7
-rwxr-xr-xpackaging/ui-gadget-1.spec2
-rwxr-xr-xug-efl-engine/ug-efl-engine.c58
3 files changed, 37 insertions, 30 deletions
diff --git a/client/ug-client.c b/client/ug-client.c
index 815b01e..a592f66 100755
--- a/client/ug-client.c
+++ b/client/ug-client.c
@@ -119,13 +119,6 @@ static void show_popup(Evas_Object *win, const char *name)
evas_object_size_hint_weight_set(pu, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
-#if 0
- elm_popup_mode_set(pu, ELM_POPUP_TYPE_ALERT);
- elm_popup_timeout_set(pu, 2);
- snprintf(buf, POPUP_TITLE_MAX, "Received result from %s", name);
- elm_popup_title_label_set(pu, buf);
- evas_object_smart_callback_add(pu, "response", close_popup, NULL);
-#endif
evas_object_show(pu);
}
diff --git a/packaging/ui-gadget-1.spec b/packaging/ui-gadget-1.spec
index 2ac7094..2b7d40c 100755
--- a/packaging/ui-gadget-1.spec
+++ b/packaging/ui-gadget-1.spec
@@ -2,7 +2,7 @@
Name: ui-gadget-1
Summary: UI Gadget Library
Version: 0.1.0
-Release: 8
+Release: 9
Group: TO_BE/FILLED_IN
License: TO BE FILLED IN
Source0: %{name}-%{version}.tar.gz
diff --git a/ug-efl-engine/ug-efl-engine.c b/ug-efl-engine/ug-efl-engine.c
index 2ce5ad2..60f16af 100755
--- a/ug-efl-engine/ug-efl-engine.c
+++ b/ug-efl-engine/ug-efl-engine.c
@@ -33,6 +33,12 @@
#define UG_ENGINE_API __attribute__ ((visibility("default")))
#endif
+struct cb_data {
+ ui_gadget_h ug;
+ void(*hide_end_cb)(ui_gadget_h ug);
+};
+
+
static void _on_hideonly_cb(void *data, Evas_Object *obj)
{
ui_gadget_h ug = (ui_gadget_h)data;
@@ -70,11 +76,9 @@ static void _signal_hideonly_finished(void *data, Evas_Object *obj,
ug->layout_state = UG_LAYOUT_HIDE;
}
-static void _signal_hide_finished(void *data, Evas_Object *obj,
- const char *emission, const char *source)
+static void _del_effect_layout(ui_gadget_h ug)
{
- ui_gadget_h ug = (ui_gadget_h )data;
- if (!ug)
+ if (!ug || !ug->effect_layout)
return;
evas_object_intercept_hide_callback_del(ug->layout, _on_hideonly_cb);
@@ -86,24 +90,34 @@ static void _signal_hide_finished(void *data, Evas_Object *obj,
ug->effect_layout = NULL;
}
-static void _del_effect_layout(ui_gadget_h ug)
+static void _signal_hide_finished(void *data, Evas_Object *obj,
+ const char *emission, const char *source)
{
- if (!ug || !ug->effect_layout)
+ struct cb_data *cb_d = (struct cb_data*)data;
+
+ if (!cb_d)
return;
- evas_object_intercept_hide_callback_del(ug->layout, _on_hideonly_cb);
+ ui_gadget_h ug = cb_d->ug;
- evas_object_hide(ug->layout);
- elm_object_part_content_unset(ug->effect_layout, "elm.swallow.content");
- evas_object_hide(ug->effect_layout);
- evas_object_del(ug->effect_layout);
- ug->effect_layout = NULL;
+ _del_effect_layout(ug);
+ cb_d->hide_end_cb(ug);
+ free(cb_d);
}
static void _signal_hidealready_finished(void *data, Evas_Object *obj,
const char *emission, const char *source)
{
- _del_effect_layout((ui_gadget_h)data);
+ struct cb_data *cb_d = (struct cb_data*)data;
+
+ if (!cb_d)
+ return;
+
+ ui_gadget_h ug = cb_d->ug;
+
+ _del_effect_layout(ug);
+ cb_d->hide_end_cb(ug);
+ free(cb_d);
}
static void _do_destroy(ui_gadget_h ug, ui_gadget_h fv_top)
@@ -208,9 +222,10 @@ static void on_show_cb(void *data, Evas *e, Evas_Object *obj,
}
static void *on_create(void *win, ui_gadget_h ug,
- void (*hide_end_cb) (ui_gadget_h ug))
+ void (*hide_end_cb) (ui_gadget_h ug))
{
static const char *ug_effect_edj_name = "/usr/share/edje/ug_effect.edj";
+ struct cb_data *cb_d;
Evas_Object *ly = elm_layout_add((Evas_Object *) win);
@@ -224,18 +239,17 @@ static void *on_create(void *win, ui_gadget_h ug,
evas_object_show(ly);
evas_object_hide(ug->layout);
+
+ cb_d = calloc(1, sizeof(struct cb_data));
+ cb_d->ug = ug;
+ cb_d->hide_end_cb = hide_end_cb;
+
edje_object_signal_callback_add(elm_layout_edje_get(ly),
"elm,action,hide,finished", "",
- _signal_hide_finished, ug);
- edje_object_signal_callback_add(elm_layout_edje_get(ly),
- "elm,action,hide,finished", "",
- (Edje_Signal_Cb) hide_end_cb, ug);
- edje_object_signal_callback_add(elm_layout_edje_get(ly),
- "elm,action,hidealready,finished", "",
- _signal_hidealready_finished, ug);
+ _signal_hide_finished, cb_d);
edje_object_signal_callback_add(elm_layout_edje_get(ly),
"elm,action,hidealready,finished", "",
- (Edje_Signal_Cb) hide_end_cb, ug);
+ _signal_hidealready_finished, cb_d);
edje_object_signal_callback_add(elm_layout_edje_get(ly),
"elm,action,hideonly,finished", "",
_signal_hideonly_finished, ug);