sync magnolia to RSA
authorhhh.kwon <hhh.kwon@samsung.com>
Mon, 10 Dec 2012 00:38:56 +0000 (09:38 +0900)
committerhhh.kwon <hhh.kwon@samsung.com>
Mon, 10 Dec 2012 00:38:56 +0000 (09:38 +0900)
34 files changed:
CMakeLists.txt
data/CMakeLists.txt
data/images/private/00_divider_line.png [moved from data/images/private/00_winset_list_progress_bg.png with 95% similarity]
data/images/private/00_popup_bg.png
data/images/private/00_popup_bottom_bg.png [deleted file]
data/images/private/00_popup_title_bg.png [deleted file]
data/images/private/00_progress_bar.png [new file with mode: 0755]
data/images/private/00_progress_bg.png [new file with mode: 0755]
data/images/private/00_slider_handle.png
data/images/private/00_slider_handle_dim.png
data/images/private/00_slider_handle_press.png [new file with mode: 0755]
data/images/private/00_volume_icon.png
data/images/private/00_volume_icon_Call.png
data/images/private/00_volume_icon_Mute.png
data/images/private/00_volume_icon_Vibrat.png
data/images/private/00_volume_icon_headphone.png
data/images/private/00_volume_icon_media.png
data/images/private/00_winset_divider_line.png [deleted file]
data/images/private/00_winset_list_progress_bar.png [deleted file]
data/images/private/00_winset_list_progress_bar_h.png [deleted file]
data/images/private/00_winset_list_progress_bg_h.png [deleted file]
data/images/public/00_volume_icon_settings.png
data/images/public/00_volume_icon_settings_pressed.png
data/volume_app.edc
data/volume_popup.edc [deleted file]
src/_button.c [deleted file]
src/_button.h [deleted file]
src/_logic.c
src/_logic.h
src/_sound.c
src/_util_efl.c
src/_util_efl.h
src/volume.c
src/volume.h

index 0fcf918..b450b2b 100644 (file)
@@ -6,7 +6,6 @@ SET(SRCS
        src/_util_efl.c
        src/_logic.c
        src/_sound.c
-       src/_button.c
 )
 
 SET(VENDOR "tizen")
index 53d40e6..33e0974 100755 (executable)
@@ -1,20 +1,14 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 # install edj
-ADD_CUSTOM_COMMAND(OUTPUT volume_popup.edj
-                COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/images/private
-                ${CMAKE_CURRENT_SOURCE_DIR}/volume_popup.edc ${CMAKE_BINARY_DIR}/volume_popup.edj
-                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/volume_popup.edc
-)
 ADD_CUSTOM_COMMAND(OUTPUT volume_app.edj
                COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/images/private
                ${CMAKE_CURRENT_SOURCE_DIR}/volume_app.edc ${CMAKE_BINARY_DIR}/volume_app.edj
                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/volume_app.edc
 )
 
-ADD_CUSTOM_TARGET(edj_build DEPENDS volume_popup.edj volume_app.edj)
+ADD_CUSTOM_TARGET(edj_build DEPENDS volume_app.edj)
 ADD_DEPENDENCIES(${PROJECT_NAME} edj_build)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/volume_popup.edj DESTINATION ${EDJDIR})
 INSTALL(FILES ${CMAKE_BINARY_DIR}/volume_app.edj DESTINATION ${EDJDIR})
 
 # install images
similarity index 95%
rename from data/images/private/00_winset_list_progress_bg.png
rename to data/images/private/00_divider_line.png
index 3cece50..fa2f19e 100755 (executable)
Binary files a/data/images/private/00_winset_list_progress_bg.png and b/data/images/private/00_divider_line.png differ
index e4bffb2..3a5ede1 100755 (executable)
Binary files a/data/images/private/00_popup_bg.png and b/data/images/private/00_popup_bg.png differ
diff --git a/data/images/private/00_popup_bottom_bg.png b/data/images/private/00_popup_bottom_bg.png
deleted file mode 100755 (executable)
index c595eec..0000000
Binary files a/data/images/private/00_popup_bottom_bg.png and /dev/null differ
diff --git a/data/images/private/00_popup_title_bg.png b/data/images/private/00_popup_title_bg.png
deleted file mode 100755 (executable)
index ac60214..0000000
Binary files a/data/images/private/00_popup_title_bg.png and /dev/null differ
diff --git a/data/images/private/00_progress_bar.png b/data/images/private/00_progress_bar.png
new file mode 100755 (executable)
index 0000000..5ca3aa2
Binary files /dev/null and b/data/images/private/00_progress_bar.png differ
diff --git a/data/images/private/00_progress_bg.png b/data/images/private/00_progress_bg.png
new file mode 100755 (executable)
index 0000000..1f4a0f4
Binary files /dev/null and b/data/images/private/00_progress_bg.png differ
index b58aac1..6611247 100755 (executable)
Binary files a/data/images/private/00_slider_handle.png and b/data/images/private/00_slider_handle.png differ
index 0356aa4..4d8ebb6 100755 (executable)
Binary files a/data/images/private/00_slider_handle_dim.png and b/data/images/private/00_slider_handle_dim.png differ
diff --git a/data/images/private/00_slider_handle_press.png b/data/images/private/00_slider_handle_press.png
new file mode 100755 (executable)
index 0000000..5b466a0
Binary files /dev/null and b/data/images/private/00_slider_handle_press.png differ
index d9bdd9b..ee6b133 100755 (executable)
Binary files a/data/images/private/00_volume_icon.png and b/data/images/private/00_volume_icon.png differ
index 922b246..26246b4 100755 (executable)
Binary files a/data/images/private/00_volume_icon_Call.png and b/data/images/private/00_volume_icon_Call.png differ
index bb970b9..e044860 100755 (executable)
Binary files a/data/images/private/00_volume_icon_Mute.png and b/data/images/private/00_volume_icon_Mute.png differ
index 2528fff..4c8fb04 100755 (executable)
Binary files a/data/images/private/00_volume_icon_Vibrat.png and b/data/images/private/00_volume_icon_Vibrat.png differ
index 0819ca0..76e8098 100755 (executable)
Binary files a/data/images/private/00_volume_icon_headphone.png and b/data/images/private/00_volume_icon_headphone.png differ
index 39b0abe..758e3c1 100755 (executable)
Binary files a/data/images/private/00_volume_icon_media.png and b/data/images/private/00_volume_icon_media.png differ
diff --git a/data/images/private/00_winset_divider_line.png b/data/images/private/00_winset_divider_line.png
deleted file mode 100755 (executable)
index e287978..0000000
Binary files a/data/images/private/00_winset_divider_line.png and /dev/null differ
diff --git a/data/images/private/00_winset_list_progress_bar.png b/data/images/private/00_winset_list_progress_bar.png
deleted file mode 100755 (executable)
index 9d979e2..0000000
Binary files a/data/images/private/00_winset_list_progress_bar.png and /dev/null differ
diff --git a/data/images/private/00_winset_list_progress_bar_h.png b/data/images/private/00_winset_list_progress_bar_h.png
deleted file mode 100755 (executable)
index 365878f..0000000
Binary files a/data/images/private/00_winset_list_progress_bar_h.png and /dev/null differ
diff --git a/data/images/private/00_winset_list_progress_bg_h.png b/data/images/private/00_winset_list_progress_bg_h.png
deleted file mode 100755 (executable)
index c3555ac..0000000
Binary files a/data/images/private/00_winset_list_progress_bg_h.png and /dev/null differ
index 645d51b..a3ec381 100755 (executable)
Binary files a/data/images/public/00_volume_icon_settings.png and b/data/images/public/00_volume_icon_settings.png differ
index 71cdb7b..1808e65 100755 (executable)
Binary files a/data/images/public/00_volume_icon_settings_pressed.png and b/data/images/public/00_volume_icon_settings_pressed.png differ
index 78d4f06..b7b0a8f 100755 (executable)
  */
 
 #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 {
@@ -40,19 +40,17 @@ RESOURCE_IMAGE("00_volume_icon_Vibrat.png");
 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";
@@ -62,6 +60,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                images {
                        image: "00_slider_handle.png" COMP;
                        image: "00_slider_handle_dim.png" COMP;
+                       image: "00_slider_handle_press.png" COMP;
                }
 
                parts {
@@ -103,6 +102,12 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                                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 {
@@ -160,15 +165,27 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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 {
@@ -202,12 +219,12 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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 */
@@ -224,8 +241,8 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                                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;
@@ -234,7 +251,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                }
                                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 */
 
@@ -251,7 +268,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                                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;
                                }
@@ -262,7 +279,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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 */
 
@@ -282,8 +299,8 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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";
@@ -302,7 +319,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                description {
                                        state: "default" 0.0;
                                        visible: 1;
-                                       min: 28 0;
+                                       min: 16 0;
                                        fixed: 1 1;
                                        color : 255 0 0 255;
                                        rel1 {
@@ -324,7 +341,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                description {
                                        state: "default" 0.0;
                                        visible: 1;
-                                       min: 28 0;
+                                       min: 16 0;
                                        fixed: 1 1;
                                        color : 0 255 0 255;
                                        rel1 {
@@ -344,8 +361,8 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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;
@@ -356,8 +373,8 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                                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;
                                        }
                                }
@@ -365,12 +382,13 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
 
                        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;
@@ -614,11 +632,11 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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;
                                }
                        }
@@ -626,7 +644,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                type: SWALLOW;
                                scale : 1;
                                description { state: "default" 0.0;
-                                       min: 700 0;
+                                       min: 720 0;
                                        fixed: 1 0;
                                        rel1 {
                                                relative: 0.5 0.0;
@@ -650,7 +668,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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 {
@@ -668,7 +686,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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;
@@ -680,7 +698,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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;
@@ -692,7 +710,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                type: SWALLOW;
                                scale : 1;
                                description { state: "default" 0.0;
-                                       min: 616 0;
+                                       min: 568 0;
                                        fixed: 1 0;
                                        rel1 {
                                                relative: 0.5 1.0;
@@ -711,7 +729,7 @@ RESOURCE_IMAGE("00_volume_icon_media.png");
                                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 {
diff --git a/data/volume_popup.edc b/data/volume_popup.edc
deleted file mode 100755 (executable)
index b2009a4..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.
- */
-collections {
-       group { name: "popup_slider_text_style_with_warn_label";
-               parts{
-                       part { name: "pad_t";
-                        scale : 1;
-                        mouse_events: 0;
-                        repeat_events: 1;
-                        description { state: "default" 0.0;
-                           align: 0.0 0.0;
-                           min: 0 0;
-                           fixed: 0 1;
-                           rel1 {
-                              relative: 1.0 0.0;
-                              to_x: "pad_l";
-                           }
-                           rel2 {
-                              relative: 0.0 0.0;
-                              to_x: "pad_r";
-                           }
-                        }
-                     }
-                     part { name: "pad_l";
-                        scale: 1;
-                        description { state: "default" 0.0;
-                           min : 38 0;
-                           fixed: 1 0;
-                           rel1 {
-                              relative: 0.0 0.0;
-                           }
-                           rel2 {
-                              relative: 0.0 1.0;
-                           }
-                           align: 0.0 0.0;
-                        }
-                     }
-                     part { name: "pad_r";
-                        scale: 1;
-                        description { state: "default" 0.0;
-                           min : 38 0;
-                           fixed: 1 0;
-                           rel1 {
-                              relative: 1.0 0.0;
-                           }
-                           rel2 {
-                              relative: 1.0 1.0;
-                           }
-                           align: 1.0 0.0;
-                        }
-                     }
-                     part{ name:"elm.swallow.slider1";
-                        type: SWALLOW;
-                        scale : 1;
-                        description { state: "default" 0.0;
-                           min: 0 0;
-                           align: 0.0 0.5;
-                           fixed: 1 0;
-                           rel1 {
-                              relative: 0.0 1.0;
-                              to: "pad_t";
-                           }
-                           rel2 {
-                              relative: 1.0 0.0;
-                              to: "pad_b";
-                           }
-                        }
-                     }
-                     part { name: "pad_b";
-                        scale : 1;
-                        mouse_events: 0;
-                        repeat_events: 1;
-                        description { state: "default" 0.0;
-                           align: 0.0 1.0;
-                           min: 0 101;
-                           fixed: 0 1;
-                           rel1 {
-                              relative: 1.0 1.0;
-                              to_x: "pad_l";
-                           }
-                           rel2 {
-                              relative: 0.0 1.0;
-                              to_x: "pad_r";
-                           }
-                        }
-                        }
-
-                       part { name : "elm.swallow.warn_label";
-                               type: SWALLOW;
-                               scale : 1;
-                               mouse_events: 1;
-                               repeat_events: 1;
-                               description { state: "default" 0.0;
-                                       align : 0.0 0.5;
-                                       fixed : 0 1;
-                                       rel1{
-                                               relative: 0.0 0.5;
-                                               to: "pad_b";
-                                       }
-                                       rel2{
-                                               relative: 1.0 0.5;
-                                               to : "pad_b";
-                                       }
-                               }
-
-                       }
-                }
-       }
-}
-
diff --git a/src/_button.c b/src/_button.c
deleted file mode 100755 (executable)
index 0dd3924..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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;
-}
diff --git a/src/_button.h b/src/_button.h
deleted file mode 100755 (executable)
index 61fb368..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
-
-
-int _open_ug(void *data);
index 62a6168..097cefd 100755 (executable)
@@ -31,7 +31,6 @@
 #include "_util_log.h"
 #include "_util_efl.h"
 #include "_sound.h"
-#include "_button.h"
 
 #define STRBUF_SIZE 128
 #define PATHBUF_SIZE 256
@@ -42,6 +41,13 @@ enum {
        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;
@@ -51,7 +57,8 @@ int _close_volume(void *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)
@@ -59,11 +66,13 @@ int _close_volume(void *data)
        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;
 }
@@ -126,18 +135,74 @@ Eina_Bool _sd_timer_cb(void *data)
        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;
        }
 
@@ -213,60 +278,91 @@ static Eina_Bool _key_release_cb(void *data, int type, void *event)
 
        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)
@@ -299,6 +395,8 @@ volume_type_t _get_volume_type(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;
 }
 
@@ -318,14 +416,61 @@ int _check_status(int *lock, int *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,
@@ -527,7 +672,7 @@ static void _slider_start_cb(void *data, Evas_Object *obj, void *event_info)
        if (ad->flag_pressing == EINA_TRUE) {
                return;
        }
-       ad->flag_touching = EINA_FALSE;
+       ad->flag_touching = EINA_TRUE;
 
        DEL_TIMER(ad->ptimer)
 
@@ -665,7 +810,19 @@ static void _button_cb(void *data, Evas_Object *obj, void *event_info)
        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);
        }
 }
 
@@ -683,103 +840,71 @@ int _app_reset(bundle *b, void *data)
        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;
 }
index 0faa99d..8bf79bf 100755 (executable)
@@ -30,7 +30,9 @@ int _rotate_func(void *data);
 int _app_reset(bundle *b, void *data);
 Eina_Bool popup_timer_cb(void *data);
 void _init_press_timers(void *data);
-void _ungrab_key(struct appdata *ad);
+int _check_status(int *lock, int *type);
+int _ungrab_key_new(struct appdata *ad);
+int _grab_key_new(struct appdata *ad, Ecore_X_Window _xwin, int grab_mode);
 
 #endif
 /* __VOLUME_LOGIC_H__ */
index 305bd45..67d3116 100755 (executable)
@@ -28,6 +28,7 @@
 #define PATHBUF_SIZE 256
 
 int _set_sound_level(volume_type_t type, int val);
+int _get_sound_level(volume_type_t type, int * val);
 
 void _play_vib(int handle)
 {
@@ -36,10 +37,16 @@ void _play_vib(int handle)
 
 void _play_sound(int type, int handle)
 {
-       if (type == VOLUME_TYPE_MEDIA || type == VOLUME_TYPE_RINGTONE) {
+       int ringtone_val = -1;
+       int system_val = -1;
+       if (type == VOLUME_TYPE_MEDIA) {
 
        } else {
+               _get_sound_level(type, &ringtone_val);
+               _get_sound_level(VOLUME_TYPE_SYSTEM, &system_val);
+               _set_sound_level(VOLUME_TYPE_SYSTEM, ringtone_val);
                svi_play_sound(handle, SVI_SND_TOUCH_TOUCH1);
+               _set_sound_level(VOLUME_TYPE_SYSTEM, system_val);
        }
 }
 
@@ -92,16 +99,6 @@ int _set_icon(void *data, int val)
        switch(ad->type){
                case VOLUME_TYPE_RINGTONE:
                        img = IMG_VOLUME_ICON_CALL;
-                       if(val == 0){
-                               if(vib)
-                                       img = IMG_VOLUME_ICON_VIB;
-                               else
-                                       img = IMG_VOLUME_ICON_MUTE;
-                       }
-                       if(!snd){
-                               img = IMG_VOLUME_ICON_MUTE;
-                               if(vib)img = IMG_VOLUME_ICON_VIB;
-                       }
                        break;
                case VOLUME_TYPE_MEDIA:
                        if(device == SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_EARPHONE)
@@ -111,16 +108,6 @@ int _set_icon(void *data, int val)
                        break;
                default:
                        img = IMG_VOLUME_ICON;
-                       if(val == 0){
-                               if(vib)
-                                       img = IMG_VOLUME_ICON_VIB;
-                               else
-                                       img = IMG_VOLUME_ICON_MUTE;
-                       }
-                       if(!snd){
-                               img = IMG_VOLUME_ICON_MUTE;
-                               if(vib)img = IMG_VOLUME_ICON_VIB;
-                       }
                        break;
        }
        if (ad->ic ) {
@@ -258,11 +245,13 @@ int _get_step(int type)
 void _mm_func(void *data)
 {
        _D("%s\n", __func__);
-       int val = 0, snd = 0;
+       int val = 0;
        system_audio_route_device_t device = 0;
        struct appdata *ad = (struct appdata *)data;
        retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
 
+       _set_device_warning(ad, val, device);
+
        retm_if(ad->win == NULL, "Failed to get window\n");
 
        /* function could be activated when window exists */
@@ -278,20 +267,9 @@ void _mm_func(void *data)
                        _set_sound_level(ad->type, val);
                ad->device = device;
        }
-       if(ad->type == VOLUME_TYPE_RINGTONE){
-               if(val == 0)
-                       vconf_set_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, EINA_FALSE);
-               else{
-                       vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &snd);
-                       if(snd == EINA_FALSE){
-                               vconf_set_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, EINA_TRUE);
-                       }
-               }
-       }
 
        _set_slider_value(ad, val);
        _set_icon(ad, val);
-       _set_device_warning(ad, val, device);
        _D("type(%d) val(%d)\n", ad->type, val);
 }
 
index 323b30b..d640b8f 100755 (executable)
 #include "volume.h"
 #include "_util_log.h"
 
+Ecore_X_Window _add_input_window(void)
+{
+       Ecore_X_Window win = 0;
+       win = ecore_x_window_input_new(0, 0, 0, 1, 1);
+       if(win){
+               ecore_x_event_mask_unset(win, ECORE_X_EVENT_MASK_NONE);
+               ecore_x_icccm_title_set(win, "volumekey-input-window");
+               ecore_x_netwm_name_set(win, "volumekey-input-window");
+               ecore_x_netwm_pid_set(win, getpid());
+               return win;
+       }
+       else{
+               _E("%s() is failed\n", __func__);
+               return 0;
+       }
+}
+
 Evas_Object *_add_window(const char *name)
 {
        Evas_Object *eo = NULL;
index e89b3d8..bfb898c 100755 (executable)
@@ -20,6 +20,7 @@
 
 #include <Elementary.h>
 
+Ecore_X_Window *_add_input_window(void);
 Evas_Object *_add_window(const char *name);
 Evas_Object *_add_slider(Evas_Object *parent, int min, int max, int val);
 Evas_Object *_add_layout(Evas_Object *parent, const char *file, const char *group);
index 7dbdb63..7d8251d 100755 (executable)
@@ -37,7 +37,7 @@ static Eina_Bool rotate_cb(void *data, int type, void *event)
                return ECORE_CALLBACK_RENEW;
        }
 
-       if (ev->message_type == ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE && ad->ug == NULL){
+       if (ev->message_type == ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE){
                _rotate_func(data);
        }
        return ECORE_CALLBACK_RENEW;
@@ -49,17 +49,15 @@ static int app_create(void *data)
 
        retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
 
-       _app_create(ad);
+       if(_app_create(ad)!=0){
+               _E("_app_create() if failed\n");
+               return -1;
+       }
 
        /* add rotation event callback */
        ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
                                        rotate_cb, (void *)data);
 
-       /* appcore measure time example */
-       printf("from AUL to %s(): %d msec\n", __func__,
-                       appcore_measure_time_from("APP_START_TIME"));
-
-       appcore_measure_start();
        return 0;
 }
 
@@ -90,24 +88,10 @@ static int app_reset(bundle *b, void *data)
        struct appdata *ad = data;
        retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
 
-       if(ad->flag_launching == EINA_TRUE || evas_object_visible_get(ad->win))
-       {
-               _init_press_timers(ad);
-               return 0;
-       }
-       ad->flag_launching = EINA_TRUE;
-
        if(_app_reset(b, data) == -1){
                _D("_app_reset() if failed\n");
-               ad->flag_launching = EINA_FALSE;
                return -1;
        }
-       /* appcore measure time example */
-       printf("from AUL to %s(): %d msec\n", __func__,
-                       appcore_measure_time_from("APP_START_TIME"));
-       printf("from create to %s(): %d msec\n", __func__,
-                       appcore_measure_time());
-
        if (ad->win)
                elm_win_activate(ad->win);
 
@@ -125,7 +109,6 @@ int main(int argc, char *argv[])
                .reset = app_reset,
        };
 
-
        /* appcore measure time example */
        printf("from AUL to %s(): %d msec\n", __func__,
                        appcore_measure_time_from("APP_START_TIME"));
index 0b1f82e..94a09f4 100755 (executable)
@@ -43,7 +43,7 @@
 #endif
 
 #if !defined(PKGNAME)
-#  define PKGNAME "com.samsung.volume"
+#  define PKGNAME "org.tizen.volume"
 #endif
 
 #define EDJ_APP EDJDIR"/volume_app.edj"
@@ -52,7 +52,7 @@
 #define GRP_VOLUME_CONTENT "volumeLayoutContent"
 #define GRP_VOLUME_SLIDER_HORIZONTAL "volumeHorizontalSlider"
 
-#define IMG_VOLUME_PACKAGE_ICON "/usr/share/icons/default/small/com.samsung.volume.png"
+#define IMG_VOLUME_PACKAGE_ICON "/usr/share/icons/default/small/org.tizen.volume.png"
 #define IMG_VOLUME_ICON "00_volume_icon.png"
 #define IMG_VOLUME_ICON_CALL "00_volume_icon_Call.png"
 #define IMG_VOLUME_ICON_MUTE "00_volume_icon_Mute.png"
@@ -82,6 +82,7 @@
 
 struct appdata
 {
+       Ecore_X_Window input_win;
        Evas_Object *win, *block_events, *ly, *sl, *ic, *ic_settings, *warn_lb;
 
        Ecore_Timer *ptimer;
@@ -94,19 +95,27 @@ struct appdata
        int step;
        int angle;
 
+       /* bundle */
+       bundle *volume_bundle;
+
        /* ticker notification handler */
        int noti_id;
        bool noti_seen;
 
-       /* ug handler */
-       ui_gadget_h ug;
-
        /* add more variables here */
        int sh; /* svi handle */
-       int flag_pressing;      /* to set hard key press */
-       int flag_touching;
-       int flag_launching;
-       int flag_deleting;
+       int flag_pressing;      /* EINA_TRUE : hw key pressing, block slider cb */
+       int flag_touching;      /* EINA_TRUE : slider indicator pressing, block hw key cb */
+       int flag_launching;     /* EINA_TRUE : volume is launcing block double lauch*/
+       int flag_deleting;      /* EINA_TRUE : closing volume, block double close_volume() */
+       int flag_media;
+       int flag_shared_grabed;
+       int flag_top_positioni_grabed;
+       int flag_exclusive_grabed;
+
+       /* Ecore event handler */
+       Ecore_Event_Handler *event_volume_up;
+       Ecore_Event_Handler *event_volume_down;
 };
 
 #endif /* __VOLUME_H__ */