From 09fbfbe7cbbf934398ed2f83aebf3896038e7e76 Mon Sep 17 00:00:00 2001 From: "hhh.kwon" Date: Mon, 21 Jan 2013 21:25:41 +0900 Subject: [PATCH] Fix N_SE-22163 : Display error --- data/volume_app.edc | 83 ++++++++++++++++++++++++++++++++++++ src/_logic.c | 119 +++++++++++++++++++++++++++++++++++++--------------- src/volume.h | 1 + 3 files changed, 169 insertions(+), 34 deletions(-) diff --git a/data/volume_app.edc b/data/volume_app.edc index e89fe77..a3fb27d 100755 --- a/data/volume_app.edc +++ b/data/volume_app.edc @@ -247,4 +247,87 @@ group { name: "popup_volumebar"; } /* END group "volumeLayout" */ + group { name : "volumeLayoutContent"; + parts{ + part { name : "pad_t"; + type : RECT; + scale : 1; + mouse_events : 0; + description { state: "default" 0.0; + align: 0.5 0.0; + min: 0 49; + fixed: 0 1; + visible: 0; + rel1 { + relative: 1.0 0.0; + to_x: "pad_l"; + } + rel2 { + relative: 0.0 0.0; + to_x: "pad_r"; + } + } + } /* "pad_t" end */ + + part { name : "pad_l"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min : 26 0; + fixed: 1 0; + rel2.relative: 0.0 1.0; + visible: 0; + align: 0.0 0.0; + } + } /* "pad_l" end */ + + part { name: "pad_r"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min : 26 0; + fixed: 1 0; + rel1.relative: 1.0 0.0; + visible: 0; + align: 1.0 0.0; + } + } /* "pad_r" end */ + + part{ name:"elm.swallow.content"; + type: SWALLOW; + scale : 1; + description { state: "default" 0.0; + min: 668 0; + fixed: 1 0; + rel1 { + relative: 0.5 1.0; + to: "pad_t"; + } + rel2 { + relative: 0.5 0.0; + to: "pad_b"; + } + } + } /* "elm.swallow.content" end */ + + part { name: "pad_b"; + type: RECT; + scale : 1; + mouse_events: 0; + description { state: "default" 0.0; + align: 0.5 1.0; + min: 0 69; + fixed: 0 1; + visible: 0; + rel1 { + relative: 0.0 1.0; + to_x: "pad_l"; + } + rel2.to_x: "pad_r"; + } + } + } + } + /* END group "volumeLayoutContent" */ + } diff --git a/src/_logic.c b/src/_logic.c index a0f9fc7..d630a2f 100755 --- a/src/_logic.c +++ b/src/_logic.c @@ -35,6 +35,7 @@ #define STRBUF_SIZE 128 #define PATHBUF_SIZE 256 +#define EMUL_STR "Emulator" enum { IDLELOCK_OFF = 0x0, @@ -158,7 +159,7 @@ Eina_Bool _volume_show(void *data) if(status == UNLOCK_STATUS) { - _grab_key_new(ad, -1, EXCLUSIVE_GRAB); + _grab_key_new(ad, -1, TOP_POSITION_GRAB); _rotate_func(ad); elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_HIDE); @@ -839,6 +840,23 @@ static void _button_cb(void *data, Evas_Object *obj, void *event_info) } } +static int _check_emul(void) +{ + int is_emul = 0; + char *info = NULL; + + if (system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &info) == 0) { + if (info == NULL) return 0; + if (!strncmp(EMUL_STR, info, strlen(info))) { + is_emul = 1; + } + } + + if (info != NULL) free(info); + + return is_emul; +} + int _app_reset(bundle *b, void *data) { _D("%s\n", __func__); @@ -870,42 +888,75 @@ int _app_reset(bundle *b, void *data) elm_theme_ref_set(th, NULL); elm_theme_extension_add(th, EDJ_APP); - block = _add_layout(win, EDJ_APP, GRP_VOLUME_BLOCKEVENTS); - edje_object_signal_callback_add(elm_layout_edje_get(block), "clicked", "*", _block_clicked_cb, ad); - outer = _add_layout(win, EDJ_APP, GRP_VOLUME_LAYOUT); - inner = _add_layout(win, EDJ_APP, "popup_volumebar"); - ad->block_events = block; - ad->ly = outer; + ad->flag_emul = _check_emul(); - elm_object_part_content_set(outer, "elm.swallow.content", inner); + if(!ad->flag_emul) + { + block = _add_layout(win, EDJ_APP, GRP_VOLUME_BLOCKEVENTS); + edje_object_signal_callback_add(elm_layout_edje_get(block), "clicked", "*", _block_clicked_cb, ad); + outer = _add_layout(win, EDJ_APP, GRP_VOLUME_LAYOUT); + inner = _add_layout(win, EDJ_APP, "popup_volumebar"); + ad->block_events = block; + ad->ly = outer; + + elm_object_part_content_set(outer, "elm.swallow.content", inner); + + sl = _add_slider(win, 0, ad->step, val); + elm_object_theme_set(sl, th); + evas_object_smart_callback_add(sl, "slider,drag,start", _slider_start_cb, ad); + evas_object_smart_callback_add(sl, "changed", _slider_changed_cb, ad); + evas_object_smart_callback_add(sl, "slider,drag,stop", _slider_stop_cb, ad); + + ic_settings = elm_icon_add(win); + evas_object_size_hint_aspect_set(ic_settings, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_image_resizable_set(ic_settings, EINA_FALSE, EINA_FALSE); + snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS); + _D("%s\n", buf); + elm_image_file_set(ic_settings, buf, NULL); + elm_object_part_content_set(inner, "elm.swallow.icon", ic_settings); + evas_object_event_callback_add(ic_settings, EVAS_CALLBACK_MOUSE_DOWN, _button_mouse_down_cb, ad); + evas_object_smart_callback_add(ic_settings, "clicked", _button_cb, ad); + evas_object_show(ic_settings); + ad->ic_settings = ic_settings; + + ad->sl = sl; + elm_object_part_content_set(inner, "elm.swallow.content", sl); + + ic = elm_icon_add(win); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE); + elm_object_part_content_set(ad->sl, "icon", ic); + ad->ic = ic; + _set_icon(ad, val); + } + else + { + block = _add_layout(win, EDJ_APP, GRP_VOLUME_BLOCKEVENTS); + edje_object_signal_callback_add(elm_layout_edje_get(block), "clicked", "*", _block_clicked_cb, ad); + outer = _add_layout(win, EDJ_APP, GRP_VOLUME_LAYOUT); + inner = _add_layout(win, EDJ_APP, GRP_VOLUME_CONTENT); + ad->block_events = block; + ad->ly = outer; - sl = _add_slider(win, 0, ad->step, val); - elm_object_theme_set(sl, th); - evas_object_smart_callback_add(sl, "slider,drag,start", _slider_start_cb, ad); - evas_object_smart_callback_add(sl, "changed", _slider_changed_cb, ad); - evas_object_smart_callback_add(sl, "slider,drag,stop", _slider_stop_cb, ad); + elm_object_part_content_set(outer, "elm.swallow.content", inner); + + sl = _add_slider(win, 0, ad->step, val); + evas_object_smart_callback_add(sl, "slider,drag,start", _slider_start_cb, ad); + evas_object_smart_callback_add(sl, "changed", _slider_changed_cb, ad); + evas_object_smart_callback_add(sl, "slider,drag,stop", _slider_stop_cb, ad); + + ad->sl = sl; + elm_object_part_content_set(inner, "elm.swallow.content", sl); + evas_object_show(sl); + + ic = elm_icon_add(win); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE); + elm_object_part_content_set(ad->sl, "icon", ic); + ad->ic = ic; + _set_icon(ad, val); + } - ic_settings = elm_icon_add(win); - evas_object_size_hint_aspect_set(ic_settings, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - elm_image_resizable_set(ic_settings, EINA_FALSE, EINA_FALSE); - snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS); - _D("%s\n", buf); - elm_image_file_set(ic_settings, buf, NULL); - elm_object_part_content_set(inner, "elm.swallow.icon", ic_settings); - evas_object_event_callback_add(ic_settings, EVAS_CALLBACK_MOUSE_DOWN, _button_mouse_down_cb, ad); - evas_object_smart_callback_add(ic_settings, "clicked", _button_cb, ad); - evas_object_show(ic_settings); - ad->ic_settings = ic_settings; - - ad->sl = sl; - elm_object_part_content_set(inner, "elm.swallow.content", sl); - - ic = elm_icon_add(win); - evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE); - elm_object_part_content_set(ad->sl, "icon", ic); - ad->ic = ic; - _set_icon(ad, val); ret = syspopup_create(b, &handler, ad->win, ad); retvm_if(ret < 0, -1, "Failed to create syspopup\n"); diff --git a/src/volume.h b/src/volume.h index afc5f47..265f8dd 100755 --- a/src/volume.h +++ b/src/volume.h @@ -109,6 +109,7 @@ struct appdata int flag_shared_grabed; int flag_top_positioni_grabed; int flag_exclusive_grabed; + int flag_emul; /* EINA_TRUE : emulator, EINA_FALSE : target */ /* Ecore event handler */ Ecore_Event_Handler *event_volume_up; -- 2.7.4