From 9bf15d6a4d69c2a09928604a8924439234e0f236 Mon Sep 17 00:00:00 2001 From: junkyu Han Date: Sat, 22 Aug 2015 17:28:35 +0900 Subject: [PATCH] Make volume can grab key & add elm_lower*raise to show volume view Change-Id: I415154fe8521c3e656794f68f41e567414256e21 --- CMakeLists.txt | 4 -- data/volume_app.edc | 9 ++- include/x_event.h | 24 ------- src/bt.c | 31 +------- src/control.c | 142 +----------------------------------- src/key_event.c | 110 +--------------------------- src/main.c | 2 +- src/sound.c | 5 +- src/view.c | 45 ++++++++---- src/x_event.c | 203 ---------------------------------------------------- 10 files changed, 44 insertions(+), 531 deletions(-) delete mode 100755 include/x_event.h delete mode 100755 src/x_event.c diff --git a/CMakeLists.txt b/CMakeLists.txt index cc759af..ac99d3e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ SET(SRCS src/main.c src/view.c src/control.c - src/x_event.c src/key_event.c src/timer.c src/sound.c @@ -36,20 +35,17 @@ pkg_check_modules(pkgs REQUIRED capi-appfw-application capi-appfw-app-manager appcore-efl -# ecore-x ecore evas edje capi-media-sound-manager capi-network-bluetooth vconf -# utilX syspopup syspopup-caller bundle feedback notification -# x11 xcomposite xext xi ) FOREACH(flag ${pkgs_CFLAGS}) diff --git a/data/volume_app.edc b/data/volume_app.edc index ad39a1e..1923963 100755 --- a/data/volume_app.edc +++ b/data/volume_app.edc @@ -151,6 +151,9 @@ #define WARRNING_TEXT_Y_MIN_L (TOP_PADDING+WARRNING_TEXT_TOP_PADDING+CONTENT_TOP_PADDING+CONTENT_HEIGHT)/SCREEN_HEIGHT_L #define WARRNING_TEXT_Y_MAX_L (TOP_PADDING+WARRNING_TEXT_TOP_PADDING+CONTENT_TOP_PADDING+WARRNING_TEXT_HEIGHT)/SCREEN_HEIGHT_L +/*color_class: "W0661"; \ +color_class: "W0661D"; \ +color_class: "B0563L1P"; \*/ #define RESOURCE_IMAGE( FILE_NAME ) \ group { \ @@ -163,7 +166,7 @@ image.normal : FILE_NAME; \ aspect : 1 1; \ aspect_preference : BOTH; \ - color_class: "W0661"; \ + color: 100 0 0 200; \ } \ } \ } \ @@ -180,7 +183,7 @@ image.normal : FILE_NAME; \ aspect : 1 1; \ aspect_preference : BOTH; \ - color_class: "W0661D"; \ + color: 0 100 0 200; \ } \ } \ } \ @@ -197,7 +200,7 @@ image.normal : FILE_NAME; \ aspect : 1 1; \ aspect_preference : BOTH; \ - color_class: "B0563L1P"; \ + color: 153 56 0 200; \ } \ } \ } \ diff --git a/include/x_event.h b/include/x_event.h deleted file mode 100755 index 0e9fa1b..0000000 --- a/include/x_event.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __UTIL_EVENT_H__ -#define __UTIL_EVENT_H__ - -void volume_x_input_event_shape(Evas_Object *win, Eina_Bool is_warning_visible); -volume_error_e volume_x_input_event_register(void); -volume_error_e volume_x_input_event_unregister(void); - -#endif diff --git a/src/bt.c b/src/bt.c index 72c7a4d..56bf225 100644 --- a/src/bt.c +++ b/src/bt.c @@ -21,14 +21,13 @@ #include #include #include -//#include +#include #include "main.h" #include "_util_log.h" #include "view.h" #include "control.h" #include "sound.h" -#include "x_event.h" #include "timer.h" static void _bt_display_bt_volume_view(sound_type_e sound_type, int sound, int vibration, bool bt_opened); @@ -77,17 +76,7 @@ static void _bt_display_bt_volume_view(sound_type_e sound_type, int sound, int v if (VOLUME_ERROR_OK != volume_view_window_show()) _E("Failed to show volume window"); - /*if (VOLUME_ERROR_OK != volume_x_input_event_register()) - _E("Failed to add x input event handler");*/ - - volume_control_check_syspopup(); - - volume_control_check_once(); - volume_view_volume_icon_set(sound_type, sound, vibration, bt_opened); - - if (VOLUME_ERROR_OK != volume_register_shape_timer()) - _E("Failed to register shape timer"); } static void _bt_volume_changed_cb(int volume, void *user_data) @@ -124,25 +113,7 @@ static void _bt_volume_changed_cb(int volume, void *user_data) static void _bt_state_changed_cb(int result, bool opened, void *user_data) { - int status = 0; - int sound = 0; - sound_type_e sound_type = 0; - int lock = 0; - _D("SCO opened [%s]", opened ? "YES" : "NO"); - - status = volume_control_check_status(&lock, &sound_type); - _D("status: %d, lock: %d, sound type : %d", status, lock, sound_type); - - sound = volume_sound_vconf_status_get(TYPE_VCONF_SOUND_STATUS); - _D("sound status : %d", sound); - - if (sound_type == SOUND_TYPE_CALL) - { - volume_control_show_view(status, sound_type, sound, opened); - volume_timer_add(3.0, TYPE_TIMER_BT); - } - } static int _bt_register_changed_cb(void) diff --git a/src/control.c b/src/control.c index 4978f40..acbdb10 100755 --- a/src/control.c +++ b/src/control.c @@ -20,7 +20,7 @@ #include #include #include -//#include +#include #include "main.h" #include "_util_efl.h" @@ -29,7 +29,6 @@ #include "control.h" #include "sound.h" #include "timer.h" -#include "x_event.h" #include "key_event.h" #include "bt.h" @@ -37,8 +36,6 @@ struct _control_s_info{ bundle *volume_bundle; - Ecore_Event_Handler *handler_qp_state; - Ecore_Timer *shape_timer; Eina_Bool is_deleting; Eina_Bool is_launching; @@ -55,8 +52,6 @@ struct _control_s_info{ }; static struct _control_s_info control_info = { .volume_bundle = NULL, - .handler_qp_state = NULL, - .shape_timer = NULL, .is_deleting = EINA_FALSE, .is_launching = EINA_FALSE, @@ -72,13 +67,9 @@ static struct _control_s_info control_info = { .sound_type_at_show = SOUND_TYPE_RINGTONE, }; -static int _myterm(bundle *b, void *data); -static int _mytimeout(bundle *b, void *data); static void _notify_pm_lcdoff_cb(keynode_t * node, void *data); static void _idle_lock_state_vconf_changed_cb(keynode_t *key, void *data); static void _starter_user_volume_key_vconf_changed_cb(keynode_t *key, void *data); -static Eina_Bool _shape_cb(void *data); -static Eina_Bool _idler_top_position_grab(void *data); static void _control_set_window_rotation(Evas_Object *win); static void _rotate_changed_cb(void *data, Evas_Object *obj, void *event_info); @@ -251,13 +242,6 @@ int volume_control_check_status(int *lock, sound_type_e *sound_type) return UNLOCK_STATUS; } -void volume_control_shape_event_area(Eina_Bool is_warning_visible) -{ - _D("shape event area"); - Evas_Object *win = volume_view_win_get(); - //volume_x_input_event_shape(win, is_warning_visible); -} - void volume_control_show_hide_worning() { Evas_Object *ly_outer = volume_view_outer_layout_get(); @@ -279,8 +263,6 @@ void volume_control_show_hide_worning() { elm_object_signal_emit(ly_outer, "show_warning", "clipper"); //landscape } - - volume_control_shape_event_area(EINA_TRUE); } } else if(control_info.is_warning_visible) @@ -295,38 +277,6 @@ void volume_control_show_hide_worning() { elm_object_signal_emit(ly_outer, "hide_warning", "clipper"); //landscape } - - volume_control_shape_event_area(EINA_FALSE); - } -} - -int volume_register_shape_timer() -{ - if (control_info.shape_timer) { - ecore_timer_del(control_info.shape_timer); - control_info.shape_timer = NULL; - } - - control_info.shape_timer = ecore_timer_add(0.1, _shape_cb, NULL); - - if (control_info.shape_timer) - return VOLUME_ERROR_OK; - else - return VOLUME_ERROR_FAIL; -} - -void volume_control_check_syspopup() -{ - if(syspopup_has_popup(control_info.volume_bundle)) { - syspopup_reset(control_info.volume_bundle); - } -} - -void volume_control_check_once(void) -{ - if(control_info.show_once) { - ecore_idler_add(_idler_top_position_grab, NULL); - control_info.show_once = EINA_FALSE; } } @@ -368,14 +318,6 @@ Eina_Bool volume_control_show_view(int status, sound_type_e sound_type, int soun if(VOLUME_ERROR_OK != volume_view_window_show()) { _E("Failed to show volume window"); } - - /*if(VOLUME_ERROR_OK != volume_x_input_event_register()) { - _E("Failed to add x input event handler"); - }*/ - - volume_control_check_syspopup(); - - volume_control_check_once(); } control_info.is_launching = EINA_TRUE; @@ -413,11 +355,6 @@ Eina_Bool volume_control_show_view(int status, sound_type_e sound_type, int soun //@TODO: need to check volume_view_volume_icon_set(sound_type, sound, vibration, bt_opened); - if(VOLUME_ERROR_OK != volume_register_shape_timer()) - { - _E("Failed to register shape_timer"); - } - return EINA_TRUE; } } @@ -428,17 +365,8 @@ volume_error_e volume_control_close_bt_display(void) _D("Start closing bt display"); - Ecore_X_Window input_win = volume_key_event_input_window_get(); - retv_if(!input_win, VOLUME_ERROR_FAIL); - control_info.is_deleting = EINA_TRUE; - /* unregister outer event handler */ - /*if(VOLUME_ERROR_OK != volume_x_input_event_unregister()) - { - _E("Failed to unregister x input event handler"); - }*/ - /* hide window */ if(VOLUME_ERROR_OK != volume_view_window_hide()) { @@ -459,19 +387,8 @@ volume_error_e volume_control_hide_view(void) _D("Start closing volume view"); - int ret = 0; - int ret1 = 0; - int i = 0; - int count_grabed = volume_key_event_count_grabed_get(); - control_info.is_deleting = EINA_TRUE; - elm_win_keygrab_unset(volume_view_win_get(), KEY_VOLUMEUP, 0, 0); - elm_win_keygrab_unset(volume_view_win_get(), KEY_VOLUMEDOWN, 0, 0); - volume_key_event_count_grabed_set(0); - ret = elm_win_keygrab_set(volume_view_win_get(), KEY_VOLUMEUP, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED); - ret1 = elm_win_keygrab_set(volume_view_win_get(), KEY_VOLUMEDOWN, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED); - volume_timer_del(TYPE_TIMER_SU); volume_timer_del(TYPE_TIMER_SD); volume_timer_del(TYPE_TIMER_SLIDER); @@ -555,7 +472,6 @@ volume_error_e volume_control_reset(bundle *b) Evas_Object *win = volume_view_win_get(); retv_if(!win, VOLUME_ERROR_FAIL); - int ret = -1; int lock = IDLELOCK_ON; int status = 0; int volume = 0; @@ -564,18 +480,6 @@ volume_error_e volume_control_reset(bundle *b) bool bt_opened = false; sound_type_e sound_type = 0; const char *show_volume = NULL; -/* - if(control_info.reset_once) { - static syspopup_handler handler = { - .def_term_fn = _myterm, - .def_timeout_fn = _mytimeout - }; - - ret = syspopup_create(b, &handler, win, NULL); - retvm_if(ret < 0, VOLUME_ERROR_FAIL, "Failed to create syspopup"); - control_info.volume_bundle = bundle_dup(b); - control_info.reset_once = EINA_FALSE; - }*/ status = volume_control_check_status(&lock, &sound_type); _D("status: %d, lock: %d, sound type : %d", status, lock, sound_type); @@ -699,8 +603,6 @@ static void _rotate_changed_cb(void *data, Evas_Object *obj, void *event_info) } break; } - - //volume_x_input_eddddent_shape(obj, control_info.is_warning_visible); } } @@ -721,28 +623,6 @@ static void _control_set_window_rotation(Evas_Object *win) _rotate_changed_cb(NULL, win, NULL); } -static Eina_Bool _idler_top_position_grab(void *data) -{ - Evas_Object *win = NULL; - _D("Unset shared keygrab"); - - win = volume_view_win_get(); - elm_win_keygrab_unset(win, KEY_VOLUMEUP, 0, 0); - elm_win_keygrab_unset(win, KEY_VOLUMEDOWN, 0, 0); - elm_win_keygrab_set(win, KEY_VOLUMEUP, 0, 0, 0, ELM_WIN_KEYGRAB_TOPMOST); - elm_win_keygrab_set(win, KEY_VOLUMEDOWN, 0, 0, 0, ELM_WIN_KEYGRAB_TOPMOST); - - return ECORE_CALLBACK_CANCEL; -} - -static Eina_Bool _shape_cb(void *data) -{ - LOGD("shape callback"); - volume_control_shape_event_area(control_info.is_warning_visible); - control_info.shape_timer = NULL; - return ECORE_CALLBACK_CANCEL; -} - static void _starter_user_volume_key_vconf_changed_cb(keynode_t *key, void *data) { int ret = EINA_FALSE; @@ -808,23 +688,3 @@ static void _notify_pm_lcdoff_cb(keynode_t * node, void *data) _E("Failed to flush cache"); } } - -static int _mytimeout(bundle *b, void *data) -{ - return 0; -} - -static int _myterm(bundle *b, void *data) -{ - if (VOLUME_ERROR_OK != volume_control_hide_view()) - { - _E("Failed to close volume"); - } - if (VOLUME_ERROR_OK != volume_control_cache_flush()) - { - _E("Failed to flush cache"); - } - - return 0; -} - diff --git a/src/key_event.c b/src/key_event.c index 3538ca0..c57dd26 100755 --- a/src/key_event.c +++ b/src/key_event.c @@ -15,13 +15,12 @@ */ #include -//#include #include #include #include #include #include -//#include +#include #include #include "main.h" @@ -74,26 +73,6 @@ static volume_error_e _volume_down_key_press(sound_type_e sound_type, int sound, static volume_error_e _volume_up_key_press(sound_type_e sound_type, int sound, bool bt_opened); static volume_error_e _mute_key_press(); -/* -Ecore_X_Window _add_input_window(void) -{ - Ecore_X_Window win = 0; - win = ecore_x_window_input_new(0, -10000, -10000, 1, 1); - retv_if(!win, 0); - - ecore_x_icccm_title_set(win, VOLUME_INPUT_WIN_NAME); - ecore_x_netwm_name_set(win, VOLUME_INPUT_WIN_NAME); - ecore_x_netwm_pid_set(win, getpid()); - ecore_x_flush(); - - return win; -}*/ - -Ecore_X_Window volume_key_event_input_window_get(void) -{ - return key_event_info.input_win; -} - Ecore_Event_Handler* volume_key_event_handler_volume_up_get(void) { return key_event_info.handler_volume_up; @@ -104,11 +83,6 @@ Ecore_Event_Handler* volume_key_event_handler_volume_down_get(void) return key_event_info.handler_volume_down; } -Ecore_Event_Handler* volume_key_event_handler_qp_state_check(void) -{ - return key_event_info.handler_qp_state_check; -} - Eina_Bool volume_key_event_is_pressing_get(void) { return key_event_info.is_pressing; @@ -119,76 +93,6 @@ int volume_key_event_count_grabed_get(void) return key_event_info.count_grabed; } -void volume_key_event_count_grabed_set(int val) -{ - key_event_info.count_grabed = val; -} - -/* -volume_error_e volume_key_event_key_grab(Ecore_X_Window _xwin, int grab_mode) -{ - Evas_Object *win = volume_view_win_get(); - retv_if(win == NULL, VOLUME_ERROR_FAIL); - - Ecore_X_Display *disp = NULL; - Ecore_X_Window xwin = 0; - int ret = -1; - - key_event_info.count_grabed++; - _D("count_grabed : %d", key_event_info.count_grabed); - - disp = ecore_x_display_get(); - retvm_if(disp == NULL, VOLUME_ERROR_FAIL, "Failed to get display"); - - if (_xwin == -1) { - _D("Top position grab"); - xwin = elm_win_xwindow_get(win); - retvm_if(xwin == 0, VOLUME_ERROR_FAIL, "Failed to get xwindow"); - } else - xwin = _xwin; - - ret = utilx_grab_key(disp, xwin, KEY_VOLUMEDOWN, grab_mode); - retvm_if(ret < 0, VOLUME_ERROR_FAIL, "Failed to grab key down"); - retvm_if(ret == 1, VOLUME_ERROR_FAIL, "Already grab"); - - ret = utilx_grab_key(disp, xwin, KEY_VOLUMEUP, grab_mode); - retvm_if(ret < 0, VOLUME_ERROR_FAIL, "Failed to grab key up"); - retvm_if(ret == 1, VOLUME_ERROR_FAIL, "Already grab"); - - ret = utilx_grab_key(disp, xwin, KEY_MUTE, grab_mode); - retvm_if(ret < 0, VOLUME_ERROR_FAIL, "Failed to grab key mute"); - retvm_if(ret == 1, VOLUME_ERROR_FAIL, "Already grab"); - - return VOLUME_ERROR_OK; -} - -volume_error_e volume_key_event_key_ungrab(void) -{ - Ecore_X_Window xwin = 0; - Ecore_X_Display *disp = NULL; - - Evas_Object *win = volume_view_win_get(); - retv_if(win == NULL, VOLUME_ERROR_FAIL); - - Ecore_X_Window input_win = volume_key_event_input_window_get(); - retv_if(input_win == 0, VOLUME_ERROR_FAIL); - - xwin = elm_win_xwindow_get(win); - retv_if(xwin == 0, VOLUME_ERROR_FAIL); - - disp = ecore_x_display_get(); - retv_if(disp == NULL, VOLUME_ERROR_FAIL); - - //@TODO : need to check - utilx_ungrab_key(disp, input_win, KEY_VOLUMEUP); - utilx_ungrab_key(disp, input_win, KEY_VOLUMEDOWN); - utilx_ungrab_key(disp, input_win, KEY_MUTE); - - _D("key ungrabed"); - - return VOLUME_ERROR_OK; -}*/ - void volume_key_event_handler_add(void) { if(!key_event_info.handler_volume_up) @@ -208,16 +112,6 @@ void volume_key_event_handler_del(void) ecore_event_handler_del(key_event_info.handler_volume_down); key_event_info.handler_volume_down = NULL; } -/* -volume_error_e volume_key_event_input_window_create(void) -{ - Ecore_X_Window input_win = _add_input_window(); - retv_if(!input_win, VOLUME_ERROR_FAIL); - - key_event_info.input_win = input_win; - - return volume_key_event_key_grab(input_win, SHARED_GRAB); -}*/ static volume_error_e _mute_key_press() { @@ -359,7 +253,7 @@ static volume_error_e _volume_up_key_press(sound_type_e sound_type, int sound, b } } else { - if (sound_level != sound_step) { + if (sound_level != sound_step ) { volume_sound_level_set(sound_type, sound_level+1); volume_view_slider_value_set(sound_level+1); _D("new sound value: %d", sound_level+1); diff --git a/src/main.c b/src/main.c index 31515d8..588e3cf 100755 --- a/src/main.c +++ b/src/main.c @@ -66,7 +66,7 @@ static bool _create_app(void *user_data) { elm_app_base_scale_set(1.8); /* Initialize feedback */ - //feedback_initialize(); + feedback_initialize(); /* Initialize volume */ if (VOLUME_ERROR_OK != volume_control_initialize()) { diff --git a/src/sound.c b/src/sound.c index d1efaca..2dd4860 100755 --- a/src/sound.c +++ b/src/sound.c @@ -83,8 +83,9 @@ void volume_sound_vib_play(void) _D("Play Feedback : vibration"); - //if (FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_VIBRATION_ON)) - // _E("Failed to play feedback"); + if (FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_VIBRATION_ON)) { + _E("Failed to play feedback"); + } sound_info.is_vibration = EINA_TRUE; } diff --git a/src/view.c b/src/view.c index ead8ced..df279d3 100755 --- a/src/view.c +++ b/src/view.c @@ -15,7 +15,6 @@ */ #include -//#include #include #include #include @@ -27,7 +26,6 @@ #include "view.h" #include "control.h" #include "timer.h" -#include "x_event.h" #include "key_event.h" #include "sound.h" @@ -185,6 +183,7 @@ volume_error_e volume_view_slider_value_set(int val) void volume_view_volume_icon_set(sound_type_e sound_type, int sound, int vibration, bool bt_opened) { + _D("Volume icon set"); char *img = NULL; if (sound == -1 || vibration == -1) { @@ -237,12 +236,15 @@ void volume_view_volume_icon_set(sound_type_e sound_type, int sound, int vibrati void volume_view_setting_icon_set(const char *file) { + _D("Setting icon image set"); ret_if(!file); Evas_Object *icon_setting = view_info.icon_setting; ret_if(!icon_setting); - elm_image_file_set(icon_setting, EDJ_APP, file); + if (EINA_TRUE != elm_image_file_set(icon_setting, EDJ_APP, file)) { + _E("Failed to set image file : %s, Group", EDJ_APP, file); + }; } void volume_view_setting_icon_callback_add(void) @@ -292,8 +294,7 @@ Evas_Object *add_slider(Evas_Object *parent, int min, int max, int val) volume_error_e volume_view_window_show(void) { - _D("Volume view window SHOW"); - evas_object_show(view_info.win); + _D("Volume view window SHOW is [%p]", view_info.win); elm_win_iconified_set(view_info.win, EINA_FALSE); volume_view_setting_icon_callback_add(); @@ -389,18 +390,32 @@ Evas_Object *add_volume_window(const char *name) return eo; } -Evas_Object *volume_view_window_create(void) +static Eina_Bool _key_grab_cb(void *data) { int ret = 0; - int ret1 = 0; + Evas_Object *win = data; + + _D("keygrab window is [%p]", win); + ret = elm_win_keygrab_set(win, KEY_VOLUMEUP, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED); + _D("Result of volume up keygrab set : %d", ret); + ret = elm_win_keygrab_set(win, KEY_VOLUMEDOWN, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED); + _D("Result of volume down keygrab set : %d", ret); + elm_win_iconified_set(win, EINA_TRUE); + + return EINA_FALSE; +} + +Evas_Object *volume_view_window_create(void) +{ Evas_Object *win = add_volume_window(PACKAGE); retv_if(!win, NULL); + _D("window is [%p]", win); view_info.win = win; - ret = elm_win_keygrab_set(win, KEY_VOLUMEUP, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED); - ret1 = elm_win_keygrab_set(win, KEY_VOLUMEDOWN, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED); - _D("keygrab ret: %d, ret1: %d", ret, ret1); - elm_win_iconified_set(win, EINA_TRUE); + _D("view_info.win is [%p]", view_info.win); + + ecore_timer_add(1.0f, _key_grab_cb, win); + evas_object_show(win); return win; } @@ -435,11 +450,11 @@ void _lock_sound_check(void) } _D("lock type : %d", lock_type); - /*if (lock_type == SETTING_SCREEN_LOCK_TYPE_SWIPE) + if (lock_type == SETTING_SCREEN_LOCK_TYPE_SWIPE) feedback_play_type(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_LOCK_SWIPE); else - feedback_play_type(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_LOCK);*/ + feedback_play_type(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_LOCK); } } @@ -625,6 +640,7 @@ static void _button_cb(void *data, Evas_Object *obj, void *event_info) static Evas_Object* _setting_icon_make() { + _D("Setting ICON make"); Evas_Object *icon_setting = elm_icon_add(view_info.ly_outer); retv_if(!icon_setting, NULL); @@ -657,8 +673,7 @@ static Evas_Object* _slider_make() sound_type_e sound_type = volume_control_get_sound_type_at_show(); _D("sound type at show : %d", sound_type); - //int sound_step = volume_sound_sound_manager_step_get(sound_type); - int sound_step = 7; + int sound_step = volume_sound_sound_manager_step_get(sound_type); _D("sound step : %d", sound_step); int sound_val = volume_sound_level_get(sound_type); diff --git a/src/x_event.c b/src/x_event.c deleted file mode 100755 index 658a8cd..0000000 --- a/src/x_event.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -//#include -//#include -//#include -//#include - -#include "main.h" -#include "view.h" -#include "control.h" -#include "_util_log.h" - -/*struct _x_event_s_info { - Ecore_Event_Handler *event_outer_touch_handler; - Eina_Bool is_first_touch; -}; -static struct _x_event_s_info x_event_info = { - .event_outer_touch_handler = NULL, - .is_first_touch = EINA_TRUE, -}; - -static Eina_Bool _event_handler_cb(void *data, int type, void *event_info); -static void _x_touch_check(int cur_x, int cur_y); - -void volume_x_input_event_shape(Evas_Object *win, Eina_Bool is_warning_visible) -{ - _D("X input event shape"); - Evas_Object *ly = NULL; - XRectangle rect; - - int x, y, w ,h; - int tmp_x; - int tmp_y; - int tmp_w; - int tmp_h; - - int current_angle = volume_control_get_current_angle(); - _D("Current angle : %d", current_angle); - - ly = volume_view_outer_layout_get(); - if (!ly) { - _E("Failed to load edje"); - return; - } - - edje_object_part_geometry_get(_EDJ(ly), "bg", &x, &y, &w, &h); - _D("The position of bg x: %d, y: %d, w: %d, h: %d", x, y, w, h); - - if (current_angle == 90) { - tmp_x = x; - tmp_y = y; - tmp_w = w; - tmp_h = h; - - x = tmp_y; - y = tmp_x; - w = tmp_h; - h = tmp_w; - } - else if (current_angle == 270) { - tmp_x = x; - tmp_y = y; - tmp_w = w; - tmp_h = h; - - x = volume_control_get_viewport_width()-tmp_y-tmp_h; - y = tmp_x; - w = tmp_h; - h = tmp_w; - } - - rect.x = x; - rect.y = y; - rect.height = h; - rect.width = w; - _D("shape x: %d, y: %d, w: %d, h: %d", x, y, w, h); - XShapeCombineRectangles(ecore_x_display_get(), elm_win_xwindow_get(win), ShapeInput, 0, 0, &rect, 1, ShapeSet, Unsorted); -} - -volume_error_e volume_x_input_event_register(void) -{ - if (x_event_info.event_outer_touch_handler == NULL) { - XIEventMask event_mask; - - event_mask.deviceid = XIAllMasterDevices; - event_mask.mask_len = XIMaskLen(XI_RawMotion); - event_mask.mask = calloc(event_mask.mask_len, sizeof(char)); - retvm_if(!event_mask.mask, VOLUME_ERROR_FAIL, "Failed to allocate memory"); - - XISetMask(event_mask.mask, XI_RawMotion); - XISelectEvents(ecore_x_display_get(), ecore_x_window_root_first_get(), &event_mask, 1); - - x_event_info.event_outer_touch_handler = ecore_event_handler_add(ECORE_X_EVENT_GENERIC, (Ecore_Event_Handler_Cb)_event_handler_cb, NULL); - - x_event_info.is_first_touch = EINA_TRUE; - free(event_mask.mask); - } - - return VOLUME_ERROR_OK; -} - -volume_error_e volume_x_input_event_unregister(void) -{ - retv_if(x_event_info.event_outer_touch_handler == NULL, VOLUME_ERROR_FAIL); - - ecore_event_handler_del(x_event_info.event_outer_touch_handler); - x_event_info.event_outer_touch_handler = NULL; - - return VOLUME_ERROR_OK; -} - -static void _x_touch_check(int cur_x, int cur_y) -{ - int current_angle = volume_control_get_current_angle(); - - int x = 0, y = 0; - int w = 0, h = 0; - - Evas_Object *ly = volume_view_outer_layout_get(); - - if (!ly) { - _E("Failed to load edje"); - return; - } - - edje_object_part_geometry_get(_EDJ(ly), "bg", &x, &y, &w, &h); - _D("control view x: %d, y: %d, w: %d, h: %d", x, y, w, h); - - w = x + w; //WIDTH - h = y + h; //HEIGHT - - if (current_angle == 90) { - if (cur_x > y && cur_x < h && cur_y > x && cur_y < w) - _D("touched inside"); - else { - _D("current angle : %d / touched outside ", current_angle); - if (VOLUME_ERROR_OK != volume_control_hide_view()) - _E("Failed to close volume"); - - if (VOLUME_ERROR_OK != volume_control_cache_flush()) - _E("Failed to flush cache"); - } - } else if (current_angle == 270) { - if (cur_x > h && cur_x < (volume_control_get_viewport_width() - y) && cur_y > x && cur_y < w) - _D("touched inside"); - else { - _D("current angle : %d / touched outside ", current_angle); - if (VOLUME_ERROR_OK != volume_control_hide_view()) - _E("Failed to close volume"); - - if (VOLUME_ERROR_OK != volume_control_cache_flush()) - _E("Failed to flush cache"); - } - } else { - if (x < cur_x && cur_x < w && y < cur_y && cur_y < h) - _D("current angle : %d / touched inside", current_angle); - else { - _D("current angle : %d / touched outside ", current_angle); - if (VOLUME_ERROR_OK != volume_control_hide_view()) - _E("Failed to close volume"); - - if (VOLUME_ERROR_OK != volume_control_cache_flush()) - _E("Failed to flush cache"); - } - } -} - -static Eina_Bool _event_handler_cb(void *data, int type, void *event_info) -{ - _D("%s", __func__); - - Ecore_X_Event_Generic *e = (Ecore_X_Event_Generic *)event_info; - retv_if(e->evtype != XI_RawMotion, ECORE_CALLBACK_DONE); - - if (x_event_info.is_first_touch == EINA_TRUE) { - x_event_info.is_first_touch = EINA_FALSE; - return ECORE_CALLBACK_DONE; - } - x_event_info.is_first_touch = EINA_TRUE; - - int cur_x = 0, cur_y = 0; - ecore_x_pointer_xy_get(ecore_x_window_root_first_get(), &cur_x, &cur_y); - _D("cur_x : %d / cur_y : %d", cur_x, cur_y); - - _x_touch_check(cur_x, cur_y); - - return ECORE_CALLBACK_DONE; -} -*/ -- 2.7.4