*/
#define RESOURCE_IMAGE( FILE_NAME ) \
- group { \
- name : FILE_NAME; \
- images.image: FILE_NAME COMP; \
- parts { \
- part { name: "image"; \
- description { \
- state : "default" 0.0; \
- image.normal : FILE_NAME; \
- aspect : 1 1; \
- aspect_preference : BOTH; \
- } \
- } \
- } \
- }
+ group { \
+ name : FILE_NAME; \
+ images.image: FILE_NAME COMP; \
+ parts { \
+ part { name: "image"; \
+ description { \
+ state : "default" 0.0; \
+ image.normal : FILE_NAME; \
+ aspect : 1 1; \
+ aspect_preference : BOTH; \
+ } \
+ } \
+ } \
+ }
collections {
RESOURCE_IMAGE("00_volume_icon_headphone.png");
RESOURCE_IMAGE("00_volume_icon_media.png");
- #define SLIDER_INDICATOR_TEXT_COLOR_INC 42 109 140 255
- #define SLIDER_UNITS_TEXT_COLOR_INC 100 100 100 255
+ #define SLIDER_INDICATOR_TEXT_COLOR_INC 42 137 194 255
+ #define SLIDER_UNITS_TEXT_COLOR_INC 0 0 0 255
#define SLIDER_UNITS_TEXT_SIZE_INC 30
#define SLIDER_INDICATOR_TEXT_SIZE_INC 40
- #define SLIDER_BASE_HEIGHT_INC 16
+ #define SLIDER_BASE_HEIGHT_INC 34
#define SLIDER_BASE_MIN_WIDTH_INC 375
- #define SLIDER_BASE_HEIGHT_INC 16
- #define SLIDER_SWALLOW_BAR_MIN_WIDTH_INC 58
- #define SLIDER_SWALLOW_BAR_HEIGHT_INC 58
+ #define SLIDER_SWALLOW_BAR_MIN_WIDTH_INC 72
+ #define SLIDER_SWALLOW_BAR_HEIGHT_INC 74
#define SLIDER_INDICATOR_MAX_WIDTH_INC 90
- #define SLIDER_INDICATOR_WIDTH_INC 58
- #define SLIDER_INDICATOR_HEIGHT_INC 58
- #define SLIDER_DISABLER_PART_COLOR_INC 185 185 185 100
+ #define SLIDER_INDICATOR_WIDTH_INC 72
+ #define SLIDER_INDICATOR_HEIGHT_INC 72
group { name: "elm/slider/horizontal/indicator/default";
alias: "elm/slider/horizontal/indicator/disabled";
images {
image: "00_slider_handle.png" COMP;
image: "00_slider_handle_dim.png" COMP;
+ image: "00_slider_handle_press.png" COMP;
}
parts {
border_scale: 1;
}
}
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "00_slider_handle_press.png";
+ }
+ }
description { state: "disabled" 0.0;
inherit: "default" 0.0;
image {
target: "button0";
target: "button_events";
}
+ program { name: "mouse_down";
+ signal: "mouse,down,*";
+ source: "button_events";
+ action: STATE_SET "pressed" 0.0;
+ target: "button0";
+ }
+ program { name: "mouse_up";
+ signal: "mouse,up,*";
+ source: "button_events";
+ action: STATE_SET "default" 0.0;
+ target: "button0";
+ }
}
}
/* END group "elm/slider/horizontal/indicator/default" */
group { name: "elm/slider/horizontal/volumeHorizontalSlider";
images {
- image: "00_winset_list_progress_bg.png" COMP;
- image: "00_winset_list_progress_bar.png" COMP;
- image: "00_winset_divider_line.png" COMP;
+ image: "00_progress_bg.png" COMP;
+ image: "00_progress_bar.png" COMP;
+ image: "00_divider_line.png" COMP;
}
script {
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
- min: 402 16;
- max: 99999 16;
+ min: 488 34;
+ max: 99999 34;
rel1.to: "bg";
rel2.to: "bg";
- image.normal: "00_winset_list_progress_bg.png";
- image.border: 0 0 4 4;
+ image.normal: "00_progress_bg.png";
+ image.border: 16 16 0 0;
image.border_scale: 1;
}
} /* "base" end */
to_x: "elm.dragable.slider";
relative: 0.5 1.0;
}
- image.normal: "00_winset_list_progress_bar.png";
- image.border: 0 0 4 4;
+ image.normal: "00_progress_bar.png";
+ image.border: 16 16 0 0;
image.border_scale: 1;
}
description { state: "inverted" 0.0;
}
description { state: "pressed" 0.0;
inherit: "default" 0.0;
- image.normal: "00_winset_list_progress_bar.png";
+ image.normal: "00_progress_bar.png";
}
} /* "level" end */
relative: 0.5 0.0;
}
rel2.to: "base";
- image.normal: "00_winset_list_progress_bar.png";
+ image.normal: "00_progress_bar.png";
image.border: 0 0 4 4;
image.border_scale: 1;
}
description { state: "pressed" 0.0;
inherit: "default" 0.0;
visible: 1;
- image.normal: "00_winset_list_progress_bar.png";
+ image.normal: "00_progress_bar.png";
}
} /* "level" end */
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
- min: 58 58;
- max: 402 58;
+ min: 72 70;
+ max: 488 72;
align: 1.0 0.5;
rel1 {
to_x: "bar_left_padding";
description {
state: "default" 0.0;
visible: 1;
- min: 28 0;
+ min: 16 0;
fixed: 1 1;
color : 255 0 0 255;
rel1 {
description {
state: "default" 0.0;
visible: 1;
- min: 28 0;
+ min: 16 0;
fixed: 1 1;
color : 0 255 0 255;
rel1 {
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
- min: 2 64;
- max: 2 64;
+ min: 4 94;
+ max: 4 94;
align: 1.0 0.5;
rel1 {
relative: 0.0 0.5;
to_x: "bar_right_right_padding";
}
image {
- normal: "00_winset_divider_line.png";
- border: 0 0 18 0;
+ normal: "00_divider_line.png";
+ border: 0 0 0 2;
border_scale: 1;
}
}
part {
name: "bar_right_right_padding";
- type: SWALLOW;
+ type: RECT;
scale: 1;
description {
state: "default" 0.0;
- visible: 0;
- min: 28 0;
+ visible: 1;
+ color : 255 0 0 200;
+ min: 16 0;
fixed: 1 1;
rel1 {
relative: 0.0 0.5;
description { state: "default" 0.0;
image {
normal: "00_popup_bg.png";
- border: 15 15 15 15;
+ border: 18 18 32 52;
border_scale: 1;
}
- min: 700 146;
- max: 700 1120;
+ min: 720 182;
+ max: 720 1120;
align: 0.5 0.5;
}
}
type: SWALLOW;
scale : 1;
description { state: "default" 0.0;
- min: 700 0;
+ min: 720 0;
fixed: 1 0;
rel1 {
relative: 0.5 0.0;
mouse_events : 0;
description { state: "default" 0.0;
align: 0.5 0.0;
- min: 0 31;
+ min: 0 49;
fixed: 0 1;
visible: 0;
rel1 {
type: RECT;
scale: 1;
description { state: "default" 0.0;
- min : 32 0;
+ min : 26 0;
fixed: 1 0;
rel2.relative: 0.0 1.0;
visible: 0;
type: RECT;
scale: 1;
description { state: "default" 0.0;
- min : 32 0;
+ min : 26 0;
fixed: 1 0;
rel1.relative: 1.0 0.0;
visible: 0;
type: SWALLOW;
scale : 1;
description { state: "default" 0.0;
- min: 616 0;
+ min: 568 0;
fixed: 1 0;
rel1 {
relative: 0.5 1.0;
mouse_events: 0;
description { state: "default" 0.0;
align: 0.5 1.0;
- min: 0 31;
+ min: 0 69;
fixed: 0 1;
visible: 0;
rel1 {
+++ /dev/null
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
- *
- * 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 <ui-gadget.h>
-#include <vconf.h>
-
-#include "_util_log.h"
-#include "volume.h"
-#include "_sound.h"
-#include "_logic.h"
-
-enum {
- IDLELOCK_OFF = 0x0,
- IDLELOCK_ON,
- IDLELOCK_MAX,
-};
-
-static void button_ug_layout_cb(ui_gadget_h ug,
- enum ug_mode mode, void *priv)
-{
- Evas_Object *base = NULL;
- Evas_Object *win = NULL;
-
- base = ug_get_layout(ug);
- win = ug_get_window();
-
- retm_if(ug == NULL, "ug_get_layout API is failed\n");
- retm_if(ug == NULL, "ug_get_window API is failed\n");
-
- switch (mode) {
- case UG_MODE_FULLVIEW:
- evas_object_size_hint_weight_set(base,
- EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(win, base);
- evas_object_show(base);
- break;
- default:
- break;
- }
-}
-
-static void button_ug_destroy_cb(ui_gadget_h ug, void *priv)
-{
- _D("%s\n", __func__);
- struct appdata *ad = (struct appdata *)priv;
- retm_if(ug == NULL, "Invalid argument: ug is NULL\n");
-
- /* ug_destroy 0 : success, -1 : fail */
- _D("%d\n", ug_destroy(ug));
- ad->ug = NULL;
-
- ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NOTIFICATION);
- utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_OFF);
- elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_HIDE);
-
- _close_volume(ad);
-}
-
-ui_gadget_h create_button_ug(void *data)
-{
- ui_gadget_h ug = NULL;
- struct ug_cbs cbs = {0};
- struct appdata *ad = (struct appdata *)data;
- int vconf_status = -1;
- int lock = -1, type = -1;
- retvm_if(ad == NULL, 0, "Invalid argument:appdata is NULL\n");
-
- cbs.layout_cb = button_ug_layout_cb;
- cbs.destroy_cb = button_ug_destroy_cb;
- cbs.priv = (void *)data;
-
- vconf_get_int(VCONFKEY_PWLOCK_STATE, &vconf_status);
-
- lock = _get_vconf_idlelock();
- type = _get_volume_type();
-
- if(vconf_status == VCONFKEY_PWLOCK_BOOTING_LOCK || (lock == IDLELOCK_ON && type == VOLUME_TYPE_MEDIA)){
- ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NOTIFICATION);
- }
- else{
- ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NORMAL);
- }
- utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_ON);
- ug = ug_create(NULL, "setting-profile-efl", UG_MODE_FULLVIEW, NULL, &cbs);
-
- return ug;
-}
-
-int _open_ug(void *data)
-{
- struct appdata *ad = (struct appdata *)data;
- ui_gadget_h ug= NULL;
-
- retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
- retvm_if(ad->win == NULL, -1, "Invalid argument: window is NULL\n");
-
- elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
- UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_ENABLE);
- ug = create_button_ug(ad);
- if(ug!=NULL){
- ecore_x_e_illume_quickpanel_state_send(ecore_x_e_illume_zone_get(elm_win_xwindow_get(ad->win)),
- ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
- _ungrab_key(ad);
- }
- else{
- ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NOTIFICATION);
- utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_OFF);
- elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_HIDE);
- return -1;
- }
-
- ad->ug = ug;
- return 0;
-}
#include "_util_log.h"
#include "_util_efl.h"
#include "_sound.h"
-#include "_button.h"
#define STRBUF_SIZE 128
#define PATHBUF_SIZE 256
IDLELOCK_MAX,
};
+/* _check_status() return value */
+enum{
+ LOCK_AND_NOT_MEDIA = -0x1,
+ UNLOCK_STATUS,
+ LOCK_AND_MEIDA,
+};
+
int _close_volume(void *data)
{
struct appdata *ad = (struct appdata *)data;
_D("start closing volume\n");
ad->flag_deleting = EINA_TRUE;
- _ungrab_key(ad);
+ _ungrab_key_new(ad);
+ _grab_key_new(ad, ad->input_win, SHARED_GRAB);
DEL_TIMER(ad->sutimer)
DEL_TIMER(ad->lutimer)
DEL_TIMER(ad->ldtimer)
DEL_TIMER(ad->ptimer)
- if (ad->win)
+ if (ad->win){
evas_object_hide(ad->win);
+ }
appcore_flush_memory();
ad->flag_deleting = EINA_FALSE;
+ ad->flag_launching = EINA_FALSE;
_D("end closing volume\n");
return 0;
}
return ECORE_CALLBACK_CANCEL;
}
+Eina_Bool _volume_show(void *data)
+{
+ _D("%s\n", __func__);
+ int status = -1;
+ int type = MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY;
+ int lock = IDLELOCK_ON;
+ struct appdata *ad = (struct appdata *)data;
+ retvm_if(ad == NULL, EINA_FALSE, "Invalid argument: appdata is NULL\n");
+
+ status = _check_status(&lock, &type);
+ if(status != LOCK_AND_NOT_MEDIA && ad->win)
+ {
+ _init_mm_sound(ad);
+ /* ungrab SHARED_GRAB */
+ _ungrab_key_new(ad);
+
+ if(status == UNLOCK_STATUS)
+ {
+ _grab_key_new(ad, -1, TOP_POSITION_GRAB);
+
+ _rotate_func(ad);
+ elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_HIDE);
+ evas_object_show(ad->win);
+ if(syspopup_has_popup(ad->volume_bundle))
+ syspopup_reset(ad->volume_bundle);
+ }
+ else if(status == LOCK_AND_MEIDA)
+ {
+ _grab_key_new(ad, ad->input_win, EXCLUSIVE_GRAB);
+ }
+ ad->flag_launching = EINA_TRUE;
+ _mm_func(ad);
+ return EINA_TRUE;
+ }
+ else if(!ad->win)
+ {
+ /* recreate window */
+ }
+
+ _D("status == LOCK_AND_NOT_MEDIA\n");
+ return EINA_FALSE;
+}
+
static Eina_Bool _key_press_cb(void *data, int type, void *event)
{
_D("%s\n", __func__);
int val=0, snd=0, vib=0;
Ecore_Event_Key *ev = event;
+ int status = -1;
+ int mtype = MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY;
+ int lock = IDLELOCK_ON;
struct appdata *ad = (struct appdata *)data;
+ status = _check_status(&lock, &mtype);
+
retvm_if(ev == NULL, ECORE_CALLBACK_CANCEL, "Invalid arguemnt: event is NULL\n");
retvm_if(ad == NULL, ECORE_CALLBACK_CANCEL, "Invalid argument: appdata is NULL\n");
retvm_if(ad->win == NULL, ECORE_CALLBACK_CANCEL, "Invalid argument: window is NULL\n");
- if (ad->flag_touching == EINA_TRUE) {
+ if(!ad->flag_launching)
+ {
+ if(_volume_show(data) != EINA_TRUE)
+ {
+ return ECORE_CALLBACK_CANCEL;
+ }
+ }
+
+ if(ad->flag_touching == EINA_TRUE) {
return ECORE_CALLBACK_CANCEL;
}
DEL_TIMER(ad->ptimer)
- /* In UG, This Callback should not be called. */
- if ( ad->ug == NULL )
- ADD_TIMER(ad->ptimer, 3.0, popup_timer_cb, ad)
+ ADD_TIMER(ad->ptimer, 3.0, popup_timer_cb, ad)
return ECORE_CALLBACK_CANCEL;
}
-int _grab_key(struct appdata *ad)
+int _grab_key_new(struct appdata *ad, Ecore_X_Window _xwin, int grab_mode)
{
- Ecore_X_Window xwin = 0;
+ _D("%s\n", __func__);
Ecore_X_Display *disp = NULL;
+ Ecore_X_Window xwin = 0;
int ret = -1;
- retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
+ /* ALREADY GRAB check */
+ switch(grab_mode)
+ {
+ case SHARED_GRAB : if(ad->flag_shared_grabed)return -1;
+ break;
+ case EXCLUSIVE_GRAB : if(ad->flag_exclusive_grabed)return -1;
+ break;
+ case TOP_POSITION_GRAB : if(ad->flag_top_positioni_grabed)return -1;
+ break;
+ }
disp = ecore_x_display_get();
retvm_if(disp == NULL, -1, "Failed to get display\n");
- retvm_if(ad->win == NULL, -1, "Invalid argument: ad->win is NULL\n");
- xwin = elm_win_xwindow_get(ad->win);
- retvm_if(xwin == 0, -1, "Failed to get xwindow\n");
+ if(_xwin == -1)
+ {
+ /* TOP_POSITION_GRAB */
+ xwin = elm_win_xwindow_get(ad->win);
+ retvm_if(xwin == 0, -1, "elm_win_xwindow_get() failed\n");
+ }
+ else
+ xwin = _xwin;
- ret = utilx_grab_key(disp, xwin, KEY_VOLUMEDOWN, TOP_POSITION_GRAB);
+ ret = utilx_grab_key(disp, xwin, KEY_VOLUMEDOWN, grab_mode);
retvm_if(ret < 0, -1, "Failed to grab key down\n");
retvm_if(ret == 1, -1, "Already grab\n");
- ret = utilx_grab_key(disp, xwin, KEY_VOLUMEUP, TOP_POSITION_GRAB);
+ ret = utilx_grab_key(disp, xwin, KEY_VOLUMEUP, grab_mode);
retvm_if(ret < 0, -1, "Failed to grab key up\n");
retvm_if(ret == 1, -1, "Already grab\n");
- ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_press_cb, ad);
- ecore_event_handler_add(ECORE_EVENT_KEY_UP, _key_release_cb, ad);
- _D("key grabed\n");
+ switch(grab_mode)
+ {
+ case SHARED_GRAB :
+ ad->flag_shared_grabed = EINA_TRUE;
+ break;
+ case EXCLUSIVE_GRAB :
+ ad->flag_exclusive_grabed = EINA_TRUE;
+ break;
+ case TOP_POSITION_GRAB :
+ ad->flag_top_positioni_grabed = EINA_TRUE;
+ break;
+ }
+
return 0;
}
-void _ungrab_key(struct appdata *ad)
+int _ungrab_key_new(struct appdata *ad)
{
Ecore_X_Window xwin = 0;
Ecore_X_Display *disp = NULL;
- retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
- retm_if(ad->win == NULL, "Invalid argument: ad->win is NULL\n");
+ retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
+ retvm_if(ad->input_win == 0, -1, "Invalid argument: ad->win is NULL\n");
xwin = elm_win_xwindow_get(ad->win);
- retm_if(xwin == 0, "Failed to get xwindow\n");
+ retvm_if(xwin == 0, -1, "Failed to get xwindow\n");
disp = ecore_x_display_get();
- retm_if(disp == NULL, "Failed to get display\n");
+ retvm_if(disp == NULL, -1, "Failed to get display\n");
- if (disp && xwin) {
- utilx_ungrab_key(disp, xwin, KEY_VOLUMEUP);
- utilx_ungrab_key(disp, xwin, KEY_VOLUMEDOWN);
- }
+ utilx_ungrab_key(disp, ad->input_win, KEY_VOLUMEUP);
+ utilx_ungrab_key(disp, ad->input_win, KEY_VOLUMEDOWN);
+ _D("key ungrabed\n");
+
+ if(ad->flag_exclusive_grabed)
+ ad->flag_exclusive_grabed = EINA_FALSE;
+ else if(ad->flag_top_positioni_grabed)
+ ad->flag_top_positioni_grabed = EINA_FALSE;
+ else if(ad->flag_shared_grabed)
+ ad->flag_shared_grabed = EINA_FALSE;
+
+ return 0;
}
int _get_vconf_idlelock(void)
_D("Failed to get sound type(errno:%x)\n", ret);
return -1;
}
+ if(type == VOLUME_TYPE_NOTIFICATION || type == VOLUME_TYPE_SYSTEM)
+ type = VOLUME_TYPE_RINGTONE;
return type;
}
_D("lock is set, not in media\n");
return -1;
}
+
+ if (*lock == IDLELOCK_ON && *type == VOLUME_TYPE_MEDIA) {
+ _D("lock is set, in media\n");
+ return 1;
+ }
+ _D("unlock status, normal case\n");
return 0;
}
+void _starter_user_volume_key_vconf_changed_cb(keynode_t *key, void *data){
+ _D("%s\n", __func__);
+ int ret = EINA_FALSE;
+ vconf_get_int(VCONFKEY_STARTER_USE_VOLUME_KEY, &ret);
+ if(ret != 0)
+ {
+ _D("any other App grab volume hard key\n", __func__);
+ _close_volume(data);
+ vconf_set_int(VCONFKEY_STARTER_USE_VOLUME_KEY, 0);
+ }
+}
+
+void _idle_lock_state_vconf_chnaged_cb(keynode_t *key, void *data){
+ _close_volume(data);
+}
+
int _app_create(struct appdata *ad)
{
+ _D("%s\n", __func__);
+ int ret = 0;
_init_svi(ad);
- return 0;
+ /* create input_window */
+ ad->input_win = _add_input_window();
+ retvm_if(ad->input_win == 0, -1, "Failed to create input window\n");
+
+ /* vconf changed callback */
+ vconf_notify_key_changed(VCONFKEY_STARTER_USE_VOLUME_KEY,
+ _starter_user_volume_key_vconf_changed_cb, ad);
+
+ /* Lock screen status vconf changed callback */
+ vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_STATE,
+ _idle_lock_state_vconf_chnaged_cb, ad);
+
+ /* grab volume shared grab */
+ ret = _grab_key_new(ad, ad->input_win, SHARED_GRAB);
+
+ /* ecore event handler add once */
+ if(ad->event_volume_down == NULL)
+ ad->event_volume_down = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_press_cb, ad);
+ if(ad->event_volume_up == NULL)
+ ad->event_volume_up = ecore_event_handler_add(ECORE_EVENT_KEY_UP, _key_release_cb, ad);
+
+ _init_mm_sound(ad);
+
+ return ret;
}
int __utilx_ss_get_window_property(Display *dpy, Window win, Atom atom,
if (ad->flag_pressing == EINA_TRUE) {
return;
}
- ad->flag_touching = EINA_FALSE;
+ ad->flag_touching = EINA_TRUE;
DEL_TIMER(ad->ptimer)
elm_icon_file_set(obj, buf, NULL);
if(evas_object_visible_get(ad->win)){
DEL_TIMER(ad->ptimer)
- _open_ug(ad);
+ if(ecore_x_e_illume_quickpanel_state_get(
+ ecore_x_e_illume_zone_get(elm_win_xwindow_get(ad->win))) != ECORE_X_ILLUME_QUICKPANEL_STATE_OFF)
+ {
+ _D("Quickpanel is hide\n");
+ ecore_x_e_illume_quickpanel_state_send(
+ ecore_x_e_illume_zone_get(elm_win_xwindow_get(ad->win)), ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
+ }
+ service_h svc;
+ service_create(&svc);
+ service_add_extra_data(svc, "view_to_jump", "IDS_COM_BODY_SOUNDS");
+ service_set_package(svc, "org.tizen.setting");
+ service_send_launch_request(svc, NULL, NULL);
+ _app_pause(ad);
}
}
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
- ad->flag_touching = EINA_FALSE;
ad->noti_seen = EINA_FALSE;
+ ad->flag_launching = EINA_FALSE;
+ ad->flag_pressing = EINA_FALSE;
+ ad->flag_touching = EINA_FALSE;
- _init_mm_sound(ad);
status = _check_status(&lock, &type);
ad->type = type;
mm_sound_volume_get_value(type, (unsigned int*)(&val));
- if (status == 0) {
- if(ad->win){
- _D("window exists", __func__);
- if(_grab_key(ad)==-1)return -1;
- _handle_bundle(b, ad);
- _rotate_func(ad);
- elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_HIDE);
- evas_object_show(ad->win);
- _mm_func(ad);
- if (syspopup_has_popup(b))
- syspopup_reset(b);
- ad->flag_launching = EINA_FALSE;
- return 0;
- }
- ad->step = _get_step(type);
-
- _set_level(type);
-
- win = _add_window(PACKAGE);
- retvm_if(win == NULL, -1, "Failed add window\n");
- ad->win = win;
-
- _grab_key(ad);
- mm_sound_route_get_playing_device(&(ad->device));
-
- th = elm_theme_new();
- 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, GRP_VOLUME_CONTENT);
- 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);
- elm_object_style_set(sl, GRP_VOLUME_SLIDER_HORIZONTAL);
- 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_icon_resizable_set(ic_settings, EINA_FALSE, EINA_FALSE);
- snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS);
- _D("%s\n", buf);
- elm_icon_file_set(ic_settings, buf, NULL);
- elm_object_part_content_set(sl, "end", 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_icon_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");
-
- _handle_bundle(b, ad);
-
- _rotate_func(ad);
- evas_object_show(ad->win);
- }
- ad->flag_launching = EINA_FALSE;
+ win = _add_window(PACKAGE);
+ retvm_if(win == NULL, -1, "Failed add window\n");
+ ad->win = win;
+
+ th = elm_theme_new();
+ 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, GRP_VOLUME_CONTENT);
+ 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);
+ elm_object_style_set(sl, GRP_VOLUME_SLIDER_HORIZONTAL);
+ 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_icon_resizable_set(ic_settings, EINA_FALSE, EINA_FALSE);
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS);
+ _D("%s\n", buf);
+ elm_icon_file_set(ic_settings, buf, NULL);
+ elm_object_part_content_set(sl, "end", 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_icon_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");
+ ad->volume_bundle = bundle_dup(b);
+
return 0;
}
int _app_pause(struct appdata *ad)
{
_D("%s\n", __func__);
- if(ad->ug){
- _D("%d\n", ug_destroy(ad->ug));
- ad->ug = NULL;
- ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NOTIFICATION);
- utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_OFF);
- elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_HIDE);
- }
_close_volume(ad);
return 0;
}