src/main.c
src/view.c
src/control.c
- src/x_event.c
src/key_event.c
src/timer.c
src/sound.c
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})
#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 { \
image.normal : FILE_NAME; \
aspect : 1 1; \
aspect_preference : BOTH; \
- color_class: "W0661"; \
+ color: 100 0 0 200; \
} \
} \
} \
image.normal : FILE_NAME; \
aspect : 1 1; \
aspect_preference : BOTH; \
- color_class: "W0661D"; \
+ color: 0 100 0 200; \
} \
} \
} \
image.normal : FILE_NAME; \
aspect : 1 1; \
aspect_preference : BOTH; \
- color_class: "B0563L1P"; \
+ color: 153 56 0 200; \
} \
} \
} \
+++ /dev/null
-/*
- * 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
#include <feedback.h>
#include <bluetooth.h>
#include <bluetooth_internal.h>
-//#include <bluetooth_extention.h>
+#include <bluetooth_extention.h>
#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);
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)
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)
#include <bluetooth.h>
#include <bluetooth_internal.h>
#include <app.h>
-//#include <bluetooth_extention.h>
+#include <bluetooth_extention.h>
#include "main.h"
#include "_util_efl.h"
#include "control.h"
#include "sound.h"
#include "timer.h"
-#include "x_event.h"
#include "key_event.h"
#include "bt.h"
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;
};
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,
.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);
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();
{
elm_object_signal_emit(ly_outer, "show_warning", "clipper"); //landscape
}
-
- volume_control_shape_event_area(EINA_TRUE);
}
}
else if(control_info.is_warning_visible)
{
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;
}
}
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;
//@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;
}
}
_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())
{
_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);
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;
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);
}
break;
}
-
- //volume_x_input_eddddent_shape(obj, control_info.is_warning_visible);
}
}
_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;
_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;
-}
-
*/
#include <Ecore.h>
-//#include <Ecore_X.h>
#include <vconf.h>
#include <vconf-keys.h>
#include <feedback.h>
#include <bluetooth.h>
#include <bluetooth_internal.h>
-//#include <bluetooth_extention.h>
+#include <bluetooth_extention.h>
#include <app.h>
#include "main.h"
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;
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;
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)
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()
{
}
}
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);
{
elm_app_base_scale_set(1.8);
/* Initialize feedback */
- //feedback_initialize();
+ feedback_initialize();
/* Initialize volume */
if (VOLUME_ERROR_OK != volume_control_initialize()) {
_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;
}
*/
#include <Ecore.h>
-//#include <Ecore_X.h>
#include <feedback.h>
#include <vconf.h>
#include <vconf-keys.h>
#include "view.h"
#include "control.h"
#include "timer.h"
-#include "x_event.h"
#include "key_event.h"
#include "sound.h"
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) {
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)
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();
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;
}
}
_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);
}
}
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);
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);
+++ /dev/null
-/*
- * 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 <X11/Xlib.h>
-//#include <X11/extensions/XInput.h>
-//#include <X11/extensions/XInput2.h>
-//#include <X11/extensions/shape.h>
-
-#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;
-}
-*/