${CMAKE_CURRENT_SOURCE_DIR}/volume_popup.edc ${CMAKE_BINARY_DIR}/volume_popup.edj
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/volume_popup.edc
)
-ADD_CUSTOM_TARGET(edj_build DEPENDS volume_popup.edj)
+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_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
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/images/public/ DESTINATION ${IMAGEDIR} FILES_MATCHING PATTERN "*.png")
--- /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.
+ */
+collections {
+
+ #define SLIDER_INDICATOR_TEXT_COLOR_INC 42 109 140 255
+ #define SLIDER_UNITS_TEXT_COLOR_INC 100 100 100 255
+ #define SLIDER_UNITS_TEXT_SIZE_INC 30
+ #define SLIDER_INDICATOR_TEXT_SIZE_INC 40
+ #define SLIDER_BASE_HEIGHT_INC 16
+ #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_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
+
+ group { name: "elm/slider/horizontal/indicator/default";
+ alias: "elm/slider/horizontal/indicator/disabled";
+ alias: "elm/slider/vertical/indicator/default";
+ alias: "elm/slider/vertical/indicator/disabled";
+ alias: "elm/slider/horizontal/indicator/tap_to_drag";
+ images {
+ image: "00_slider_handle.png" COMP;
+ image: "00_slider_handle_dim.png" COMP;
+ }
+
+ parts {
+ part { name: "button_events";
+ type: RECT;
+ mouse_events: 1;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 2*SLIDER_INDICATOR_WIDTH_INC 1.5*SLIDER_INDICATOR_HEIGHT_INC;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ color: 0 0 0 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+
+ part { name: "button0";
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: SLIDER_INDICATOR_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
+ max: SLIDER_INDICATOR_MAX_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
+ rel1 {
+ to: "elm.indicator";
+ offset: -2 -2;
+ }
+ rel2 {
+ to: "elm.indicator";
+ offset: 2 2;
+ }
+ image {
+ normal: "00_slider_handle.png";
+ border: 3 3 3 3;
+ border_scale: 1;
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "00_slider_handle_dim.png";
+ }
+ }
+ } /* "button0" end */
+
+ part { name: "elm.indicator";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 1;
+ color: SLIDER_INDICATOR_TEXT_COLOR_INC;
+ text {
+ font: "SLP:style=Medium";
+ size: SLIDER_INDICATOR_TEXT_SIZE_INC;
+ min: 1 1;
+ align: 0.5 0.5;
+ text_class: "slp_medium";
+ }
+ }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ } /* "elm.indicator" end */
+ } /* parts of "elm/slider/horizontal/indicator/default" end */
+
+ programs {
+ program { name: "set_val_show";
+ signal: "elm,state,val,show";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.indicator";
+ }
+ program { name: "set_val_hide";
+ signal: "elm,state,val,hide";
+ source: "elm";
+ action: STATE_SET "hide" 0.0;
+ target: "elm.indicator";
+ }
+ program { name: "slider_disable";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+ target: "button0";
+ target: "button_events";
+ }
+ program { name: "slider_enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "button0";
+ target: "button_events";
+ }
+ }
+ }
+ /* 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;
+ }
+
+ script {
+ public invert_on = 0;
+ public set_invert_on() {
+ set_state(PART:"level", "inverted", 0.0);
+ set_state(PART:"level2", "inverted", 0.0);
+ set_int(invert_on, 1);
+ }
+ public set_invert_off() {
+ set_state(PART:"level", "default", 0.0);
+ set_state(PART:"level2", "default", 0.0);
+ set_int(invert_on, 0);
+ }
+ public thumb_down() {
+ if(get_int(invert_on) == 0)
+ set_state(PART:"level", "pressed", 0.0);
+ else if(get_int(invert_on) == 1)
+ set_state(PART:"level2", "pressed", 0.0);
+ }
+ public thumb_up() {
+ if(get_int(invert_on) == 0)
+ set_state(PART:"level", "default", 0.0);
+ else if(get_int(invert_on) == 1)
+ set_state(PART:"level2", "inverted", 0.0);
+ }
+ }
+
+ parts {
+ part { name: "base";
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 402 16;
+ max: 99999 16;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ image.normal: "00_winset_list_progress_bg.png";
+ image.border: 0 0 4 4;
+ image.border_scale: 1;
+ }
+ } /* "base" end */
+
+ part { name: "level";
+ mouse_events: 0;
+ scale: 1;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "base";
+ rel2 {
+ to_y: "base";
+ 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.border_scale: 1;
+ }
+ description { state: "inverted" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "00_winset_list_progress_bar.png";
+ }
+ } /* "level" end */
+
+ part { name: "level2";
+ mouse_events: 0;
+ scale: 1;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ visible: 0;
+ rel1 {
+ to_y: "base";
+ to_x: "elm.dragable.slider";
+ relative: 0.5 0.0;
+ }
+ rel2.to: "base";
+ image.normal: "00_winset_list_progress_bar.png";
+ image.border: 0 0 4 4;
+ image.border_scale: 1;
+ }
+ description { state: "inverted" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ image.normal: "00_winset_list_progress_bar.png";
+ }
+ } /* "level" end */
+
+ part { name: "bg";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ rel1.to: "elm.swallow.bar";
+ rel2.to: "elm.swallow.bar";
+ }
+ } /* "bg" end */
+
+ part { name: "elm.swallow.bar";
+ type: SWALLOW;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 58 58;
+ max: 402 58;
+ align: 1.0 0.5;
+ rel1 {
+ to_x: "bar_left_padding";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to_x: "bar_right_padding";
+ relative: 0.0 1.0;
+ }
+ }
+ } /* "elm.swallow.bar" end */
+
+ part { name: "bar_left_padding";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 28 0;
+ fixed: 1 1;
+ color : 255 0 0 255;
+ rel1 {
+ relative: 1.0 0.5;
+ to_x: "elm.text";
+ }
+ rel2 {
+ relative: 1.0 0.5;
+ to_x: "elm.text";
+ }
+ align: 0.0 0.5;
+ }
+ } /* "bar_left_padding" end */
+
+ part {
+ name: "bar_right_padding";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ min: 28 0;
+ fixed: 1 1;
+ color : 0 255 0 255;
+ rel1 {
+ relative: 0.0 0.5;
+ to_x: "divider";
+ }
+ rel2 {
+ relative: 0.0 0.5;
+ to_x: "divider";
+ }
+ align: 1.0 0.5;
+ }
+ } /* "bar_right_padding" end */
+
+ part { name: "divider";
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 2 64;
+ max: 2 64;
+ align: 1.0 0.5;
+ rel1 {
+ relative: 0.0 0.5;
+ to_x: "bar_right_right_padding";
+ }
+ rel2 {
+ relative: 0.0 0.5;
+ to_x: "bar_right_right_padding";
+ }
+ image {
+ normal: "00_winset_divider_line.png";
+ border: 0 0 18 0;
+ border_scale: 1;
+ }
+ }
+ } /* "divider" end */
+
+ part {
+ name: "bar_right_right_padding";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ min: 28 0;
+ fixed: 1 1;
+ rel1 {
+ relative: 0.0 0.5;
+ to_x: "elm.swallow.end";
+ }
+ rel2 {
+ relative: 0.0 0.5;
+ to_x: "elm.swallow.end";
+ }
+ align: 1.0 0.5;
+ }
+ } /* "bar_right_right_padding" end */
+
+ part { name: "elm.swallow.icon";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ align: 0.0 0.5;
+ rel1 {
+ to_y: "elm.swallow.bar";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ to_y: "elm.swallow.bar";
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ }
+ } /* "elm.swallow.icon" end */
+
+ part { name: "elm.text";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ fixed: 1 1;
+ align: 0.0 0.5;
+ rel1.to_x: "elm.swallow.icon";
+ rel1.relative: 1.0 0.0;
+ rel2.to_x: "elm.swallow.icon";
+ color: SLIDER_UNITS_TEXT_COLOR_INC;
+ text {
+ font: "SLP:style=Medium";
+ size: SLIDER_UNITS_TEXT_SIZE_INC;
+ min: 0 0;
+ align: 0.0 0.5;
+ text_class: "slp_medium";
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ text.min: 1 1;
+ }
+ } /* "elm.text" end */
+
+ part { name: "elm.swallow.end";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ align: 1.0 0.5;
+ rel1 {
+ relative: 1.0 0.0;
+ to_y: "elm.swallow.bar";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to_y: "elm.swallow.bar";
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ }
+ } /* "elm.swallow.end" end */
+
+ part { name: "elm.dragable.slider";
+ type: GROUP;
+ source: "elm/slider/horizontal/indicator/default";
+ mouse_events: 1;
+ scale: 1;
+ dragable {
+ x: 1 1 0;
+ y: 0 0 0;
+ confine: "bg";
+ }
+ description { state: "default" 0.0;
+ min: SLIDER_INDICATOR_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
+ fixed: 1 1;
+ align: 0.5 0.5;
+ color: 0 0 0 0;
+ }
+ } /* "elm.dragable.slider" end */
+
+ part { name: "disabler";
+ type: RECT;
+ mouse_events: 1;
+ repeat_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ color: 0 0 0 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ } /* "disabler" end */
+
+ part { name: "clipper";
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description { state: "disabled" 0.0;
+ color: 255 255 255 102;
+ }
+ }
+ } /* "clipper" end */
+
+ programs {
+ program { name: "text_show";
+ signal: "elm,state,text,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.text";
+ }
+ program { name: "text_hide";
+ signal: "elm,state,text,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.text";
+ }
+ program { name: "icon_show";
+ signal: "elm,state,icon,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.swallow.icon";
+ }
+ program { name: "icon_hide";
+ signal: "elm,state,icon,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.icon";
+ }
+ program { name: "end_show";
+ signal: "elm,state,end,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.swallow.end";
+ }
+ program { name: "end_hide";
+ signal: "elm,state,end,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.end";
+ }
+ program { name: "invert_on";
+ signal: "elm,state,inverted,on";
+ source: "elm";
+ script {
+ set_invert_on();
+ }
+ }
+ program { name: "invert_off";
+ signal: "elm,state,inverted,off";
+ source: "elm";
+ script {
+ set_invert_off();
+ }
+ }
+ program { name: "val_show";
+ signal: "mouse,down,*";
+ source: "elm.dragable.slider";
+ script {
+ thumb_down();
+ }
+ }
+ program { name: "val_hide";
+ signal: "mouse,up,*";
+ source: "elm.dragable.slider";
+ script {
+ thumb_up();
+ }
+ }
+ program { name: "slider_disable";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+ target: "disabler";
+ target: "clipper";
+ }
+ program { name: "slider_enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "disabler";
+ target: "clipper";
+ }
+ }
+ }
+ /* END group "elm/slider/horizontal/volumeHorizontalSlider" */
+
+ group { name : "block_events";
+ parts{
+ part { name : "blockevent";
+ type : RECT;
+ description {
+ color : 0 0 0 0;
+ }
+ }
+ }
+ programs{
+ program{
+ name : "clicked";
+ source : "blockevent";
+ signal : "mouse,clicked,1";
+ action : SIGNAL_EMIT "clicked" "*";
+ }
+ }
+ }
+ /* END group "block_events" */
+
+ group { name : "volumeLayout";
+ images {
+ image: "00_popup_bg.png" COMP;
+ }
+ parts{
+ part { name : "base";
+ type : IMAGE;
+ scale : 1;
+ description { state: "default" 0.0;
+ image {
+ normal: "00_popup_bg.png";
+ border: 15 15 15 15;
+ border_scale: 1;
+ }
+ min: 700 146;
+ max: 700 1120;
+ align: 0.5 0.5;
+ }
+ }
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: 700 0;
+ fixed: 1 0;
+ rel1 {
+ relative: 0.5 0.0;
+ to: "base";
+ }
+ rel2 {
+ relative: 0.5 1.0;
+ to: "base";
+ }
+ }
+ }
+ }
+ }
+ /* END group "volumeLayout" */
+
+ group { name : "volumeLayoutContent";
+ parts{
+ part { name : "pad_t";
+ type : RECT;
+ scale : 1;
+ mouse_events : 0;
+ description { state: "default" 0.0;
+ align: 0.5 0.0;
+ min: 0 31;
+ fixed: 0 1;
+ visible: 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "pad_l";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to_x: "pad_r";
+ }
+ }
+ } /* "pad_t" end */
+
+ part { name : "pad_l";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min : 32 0;
+ fixed: 1 0;
+ rel2.relative: 0.0 1.0;
+ visible: 0;
+ align: 0.0 0.0;
+ }
+ } /* "pad_l" end */
+
+ part { name: "pad_r";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min : 32 0;
+ fixed: 1 0;
+ rel1.relative: 1.0 0.0;
+ visible: 0;
+ align: 1.0 0.0;
+ }
+ } /* "pad_r" end */
+
+ part{ name:"elm.swallow.content";
+ type: SWALLOW;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: 616 0;
+ fixed: 1 0;
+ rel1 {
+ relative: 0.5 1.0;
+ to: "pad_t";
+ }
+ rel2 {
+ relative: 0.5 0.0;
+ to: "pad_b";
+ }
+ }
+ } /* "elm.swallow.content" end */
+
+ part { name: "pad_b";
+ type: RECT;
+ scale : 1;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ align: 0.5 1.0;
+ min: 0 31;
+ fixed: 0 1;
+ visible: 0;
+ rel1 {
+ relative: 0.0 1.0;
+ to_x: "pad_l";
+ }
+ rel2.to_x: "pad_r";
+ }
+ }
+ }
+ }
+ /* END group "volumeLayoutContent" */
+
+}
/*
* 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 { \r
- group { name: "popup_slider_text_style_with_warn_label";\r
- parts{\r
- part { name: "pad_t";\r
- scale : 1;\r
- mouse_events: 0;\r
- repeat_events: 1;\r
- description { state: "default" 0.0;\r
- align: 0.0 0.0;\r
- min: 0 0;\r
- fixed: 0 1;\r
- rel1 {\r
- relative: 1.0 0.0;\r
- to_x: "pad_l";\r
- }\r
- rel2 {\r
- relative: 0.0 0.0;\r
- to_x: "pad_r";\r
- }\r
- }\r
- }\r
- part { name: "pad_l";\r
- scale: 1;\r
- description { state: "default" 0.0;\r
- min : 38 0;\r
- fixed: 1 0;\r
- rel1 {\r
- relative: 0.0 0.0;\r
- }\r
- rel2 {\r
- relative: 0.0 1.0;\r
- }\r
- align: 0.0 0.0;\r
- }\r
- }\r
- part { name: "pad_r";\r
- scale: 1;\r
- description { state: "default" 0.0;\r
- min : 38 0;\r
- fixed: 1 0;\r
- rel1 {\r
- relative: 1.0 0.0;\r
- }\r
- rel2 {\r
- relative: 1.0 1.0;\r
- }\r
- align: 1.0 0.0;\r
- }\r
- }\r
- part{ name:"elm.swallow.slider1";\r
- type: SWALLOW;\r
- scale : 1;\r
- description { state: "default" 0.0;\r
- min: 0 0;\r
- align: 0.0 0.5;\r
- fixed: 1 0;\r
- rel1 {\r
- relative: 0.0 1.0;\r
- to: "pad_t";\r
- }\r
- rel2 {\r
- relative: 1.0 0.0;\r
- to: "pad_b";\r
- }\r
- }\r
- }\r
- part { name: "pad_b";\r
- scale : 1;\r
- mouse_events: 0;\r
- repeat_events: 1;\r
- description { state: "default" 0.0;\r
- align: 0.0 1.0;\r
- min: 0 101;\r
- fixed: 0 1;\r
- rel1 {\r
- relative: 1.0 1.0;\r
- to_x: "pad_l";\r
- }\r
- rel2 {\r
- relative: 0.0 1.0;\r
- to_x: "pad_r";\r
- }\r
- }\r
- }\r
-\r
- part { name : "elm.swallow.warn_label";\r
- type: SWALLOW;\r
- scale : 1;\r
- mouse_events: 1;\r
- repeat_events: 1;\r
- description { state: "default" 0.0;\r
- align : 0.0 0.5;\r
- fixed : 0 1;\r
- rel1{\r
- relative: 0.0 0.5;\r
- to: "pad_b";\r
- }\r
- rel2{\r
- relative: 1.0 0.5;\r
- to : "pad_b";\r
- } \r
- }\r
- \r
- } \r
- }\r
- } \r
-}\r
-\r
+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";
+ }
+ }
+
+ }
+ }
+ }
+}
+
static void button_ug_layout_cb(ui_gadget_h ug,
enum ug_mode mode, void *priv)
{
- Evas_Object *base;
- Evas_Object *win;
+ 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,
{
_D("%s\n", __func__);
struct appdata *ad = (struct appdata *)priv;
-
retm_if(ug == NULL, "Invalid argument: ug is NULL\n");
ug_destroy(ug);
return 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.
#include <utilX.h>
#include <vconf.h>
#include <ui-gadget.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
#include "volume.h"
#include "_util_log.h"
#include "_button.h"
#define STRBUF_SIZE 128
+#define PATHBUF_SIZE 256
enum {
IDLELOCK_OFF = 0x0,
void _ungrab_key(struct appdata *ad);
-static void _sound_cb(keynode_t *node, void *data)
-{
-}
-
-static void _vibration_cb(keynode_t *node, void *data)
-{
-}
-
-int _init_vconf(struct appdata *ad)
-{
- int ret;
- ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, _sound_cb, ad);
- retvm_if(ret < 0, -1, "Failed to notify sound status\n");
- ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, _vibration_cb, ad);
- retvm_if(ret < 0, -1, "Failed to notifi vibration status\n");
- return 0;
-}
-
int _close_volume(void *data)
{
struct appdata *ad = (struct appdata *)data;
DEL_TIMER(ad->ldtimer)
DEL_TIMER(ad->ptimer)
- if (ad->pu)
- evas_object_hide(ad->pu);
if (ad->win)
evas_object_hide(ad->win);
appcore_flush_memory();
Eina_Bool _lu_timer_cb(void *data)
{
- int val;
+ int val = -1;
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, 0, "Invalid argument: appdata is NULL\n");
if (ad->win == NULL || evas_object_visible_get(ad->win) == EINA_FALSE){
Eina_Bool _ld_timer_cb(void *data)
{
- int val;
+ int val = 0;
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, 0, "Invalid argument: appdata is NULL\n");
if (ad->win == NULL || evas_object_visible_get(ad->win) == EINA_FALSE){
_D("up key released and del timer\n");
DEL_TIMER(ad->sutimer)
DEL_TIMER(ad->lutimer)
-
+ DEL_TIMER(ad->luwarmtimer)
} else if (!strcmp(ev->keyname, KEY_VOLUMEDOWN)) {
_D("down key released and del timer\n");
DEL_TIMER(ad->sdtimer)
DEL_TIMER(ad->ldtimer)
+ DEL_TIMER(ad->ldwarmtimer)
}
ad->flag_pressing = EINA_FALSE;
int _grab_key(struct appdata *ad)
{
- Ecore_X_Window xwin;
- Ecore_X_Display *disp;
- int ret;
+ Ecore_X_Window xwin = 0;
+ Ecore_X_Display *disp = NULL;
+ int ret = -1;
retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
void _ungrab_key(struct appdata *ad)
{
- Ecore_X_Window xwin;
- Ecore_X_Display *disp;
+ 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");
int _get_vconf_idlelock(void)
{
- int ret, lock;
+ int ret = -1;
+ int lock = IDLELOCK_OFF;
- lock = IDLELOCK_OFF;
ret = vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &lock);
retvm_if(ret < 0, -1, "Failed to get vconf %s\n",
VCONFKEY_IDLE_LOCK_STATE);
volume_type_t _get_volume_type(void)
{
- int ret;
+ int ret = MM_ERROR_NONE;
volume_type_t type = -1;
ret = mm_sound_volume_get_current_playing_type(&type);
fprintf(stderr, "Failed to get sound type(errno:%x)\n", ret);
return -1;
}
- if(type == VOLUME_TYPE_SYSTEM)
- type = VOLUME_TYPE_RINGTONE;
return type;
}
int _app_create(struct appdata *ad)
{
- _init_vconf(ad);
_init_svi(ad);
return 0;
}
+int __utilx_ss_get_window_property(Display *dpy, Window win, Atom atom,
+ Atom type, unsigned int *val,
+ unsigned int len)
+{
+ unsigned char *prop_ret = NULL;
+ Atom type_ret = -1;
+ unsigned long bytes_after = 0;
+ unsigned long num_ret = -1;
+ int format_ret = -1;
+ unsigned int i = 0;
+ int num = 0;
+
+ prop_ret = NULL;
+ if (XGetWindowProperty(dpy, win, atom, 0, 0x7fffffff, False,
+ type, &type_ret, &format_ret, &num_ret,
+ &bytes_after, &prop_ret) != Success)
+ return -1;
+
+ if (type_ret != type || format_ret != 32)
+ num = -1;
+ else if (num_ret == 0 || !prop_ret)
+ num = 0;
+ else {
+ if (num_ret < len)
+ len = num_ret;
+ for (i = 0; i < len; i++) {
+ val[i] = ((unsigned long *)prop_ret)[i];
+ }
+ num = len;
+ }
+
+ if (prop_ret)
+ XFree(prop_ret);
+
+ return num;
+}
+
+int _x_rotation_get(Display *dpy, void *data)
+{
+ Window active_win = 0;
+ Window root_win = 0;
+ int rotation = -1;
+ int ret = -1;
+
+ Atom atom_active_win;
+ Atom atom_win_rotate_angle;
+
+ root_win = XDefaultRootWindow(dpy);
+
+ atom_active_win = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
+ ret = __utilx_ss_get_window_property(dpy, root_win, atom_active_win,
+ XA_WINDOW,
+ (unsigned int *)&active_win, 1);
+
+ if(ret < 0)
+ return ret;
+
+ atom_win_rotate_angle = XInternAtom(dpy, "_E_ILLUME_ROTATE_ROOT_ANGLE", False);
+ ret = __utilx_ss_get_window_property(dpy, root_win,
+ atom_win_rotate_angle, XA_CARDINAL,
+ (unsigned int *)&rotation, 1);
+
+ if(ret != -1)
+ return rotation;
+
+ return -1;
+}
+
+int _volume_popup_resize(void *data, int angle)
+{
+ int rotation = 0;
+ int offx=0, offy=0;
+ Evas_Coord minw = -1, minh = -1;
+ Evas_Coord w = 0, h = 0;
+ struct appdata *ad = (struct appdata *)data;
+ retvm_if(ad->win == NULL, -1, "Invalid argument: window is NULL\n");
+ retvm_if(ad->block_events == NULL, -1, "Invalid argument: notify is NULL\n");
+
+ if(angle == -1)
+ rotation = ad->angle;
+ else
+ rotation = angle;
+
+ ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+
+ switch(rotation){
+ case 90 :
+ case 270 :
+ evas_object_resize(ad->block_events, h, w);
+ edje_object_size_min_get(ad->block_events, &minw, &minh);
+ edje_object_size_min_restricted_calc(ad->block_events, &minw, &minh, minw, minh);
+ offx = (h - minw) / 2;
+ offy = (w - minh) / 5;
+ break;
+ case 0 :
+ case 180 :
+ default :
+ evas_object_resize(ad->block_events, w, h);
+ edje_object_size_min_get(ad->block_events, &minw, &minh);
+ edje_object_size_min_restricted_calc(ad->block_events, &minw, &minh, minw, minh);
+ offx = (w - minw) / 2;
+ offy = (h - minh) / 5;
+ break;
+ }
+ _D("w(%d) h(%d) offx(%d) offy(%d)\n", w, h, offx, offy);
+ evas_object_move(ad->ly, offx, offy);
+ return 1;
+}
+
+int _efl_rotate(Display *dpy, void *data)
+{
+ int rotation = -1;
+ struct appdata *ad = (struct appdata *)data;
+
+ rotation = _x_rotation_get(dpy, ad);
+
+ if(rotation == -1)
+ rotation = 0;
+
+ if(rotation >= 0){
+ elm_win_rotation_set(ad->win, rotation);
+ ad->angle = rotation;
+ return _volume_popup_resize(data, rotation);
+ }
+
+ return 0;
+}
+
+int _rotate_func(void *data)
+{
+ struct appdata *ad = (struct appdata *)data;
+ Display *d = NULL;
+ int ret = 0;
+
+ retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
+
+ d = XOpenDisplay(NULL);
+ ret = _efl_rotate(d, ad);
+ XCloseDisplay(d);
+
+ return ret;
+}
+
int myterm(bundle *b, void *data)
{
return 0;
void _set_level(int type)
{
- int val;
+ int val = 0;
_get_sound_level(type, &val);
_set_sound_level(type, val);
_D("type(%d) val(%d)\n", type, val);
}
-static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+static void _block_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source)
{
+ _D("%s\n", __func__);
_close_volume(data);
}
Eina_Bool _slider_timer_cb(void *data)
{
- double val;
+ double val = 0;
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, 0, "Invalid argument: appdata is NULL\n");
if (ad->sl) {
static void _slider_start_cb(void *data, Evas_Object *obj, void *event_info)
{
_D("%s\n", __func__);
- int snd=0;
+ int snd= 0 ;
struct appdata *ad = (struct appdata *)data;
retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
static void _slider_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
- double val;
+ double val = 0;
struct appdata *ad = (struct appdata *)data;
retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
static void _slider_stop_cb(void *data, Evas_Object *obj, void *event_info)
{
_D("func\n");
- double val;
+ double val = 0;
struct appdata *ad = (struct appdata *)data;
retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
{
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, ECORE_CALLBACK_CANCEL, "Invalid argument: appdata is NULL\n");
- _D("add long down timer\n");
ADD_TIMER(ad->ldtimer, 0.0, _ld_timer_cb, ad)
return ECORE_CALLBACK_CANCEL;
}
-int _handle_bundle(bundle *b, struct appdata *ad)
+void _init_press_timers(void *data)
{
- const char *bval;
+ struct appdata *ad = (struct appdata *)data;
+ retvm_if(ad == NULL, ECORE_CALLBACK_CANCEL, "Invalid argument: appdata is NULL\n");
+ DEL_TIMER(ad->sdtimer)
+ DEL_TIMER(ad->ldtimer)
+ DEL_TIMER(ad->ldwarmtimer)
+ DEL_TIMER(ad->sutimer)
+ DEL_TIMER(ad->lutimer)
+ DEL_TIMER(ad->luwarmtimer)
+}
+int _handle_bundle(bundle *b, struct appdata *ad)
+{
+ const char *bval = NULL;
retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
bval = bundle_get_val(b, "LONG_PRESS");
if (bval) {
_D("val(%s)\n", bval);
Ecore_X_Display* disp = ecore_x_display_get();
- Utilx_Key_Status upstat, downstat;
if (!strncmp(bval, "VOLUME_UP", strlen("LONG_PRESS"))) {
- upstat = utilx_get_key_status(disp, KEY_VOLUMEUP);
- if (upstat == UTILX_KEY_STATUS_PRESSED ) {
- _D("volume up long press\n");
- DEL_TIMER(ad->ptimer)
- ecore_timer_add(0.5, _lu_warmup_timer_cb, ad);
- }
+ _D("volume up long press\n");
+ DEL_TIMER(ad->ptimer)
+ ADD_TIMER(ad->luwarmtimer, 0.5, _lu_warmup_timer_cb, ad);
} else if (!strncmp(bval, "VOLUME_DOWN", strlen("LONG_PRESS"))) {
- downstat = utilx_get_key_status(disp, KEY_VOLUMEDOWN);
- if (downstat == UTILX_KEY_STATUS_PRESSED ) {
- _D("volume down long press\n");
- DEL_TIMER(ad->ptimer)
- ecore_timer_add(0.5, _ld_warmup_timer_cb, ad);
- }
+ _D("volume down long press\n");
+ DEL_TIMER(ad->ptimer)
+ ADD_TIMER(ad->ldwarmtimer, 0.5, _ld_warmup_timer_cb, ad);
} else {
ADD_TIMER(ad->ptimer, 3.0, popup_timer_cb, ad)
}
} else {
ADD_TIMER(ad->ptimer, 3.0, popup_timer_cb, ad)
+ _init_press_timers(ad);
}
return 0;
}
-static void _button_cb(void *data, Evas_Object *obj, void *event_info)
+static void _button_mouse_down_cb(void *data, Evas_Object *obj, void *event_info)
{
_D("%s\n", __func__);
struct appdata *ad = (struct appdata *)data;
retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
-
- DEL_TIMER(ad->ptimer)
- _open_ug(ad);
+ char buf[PATHBUF_SIZE] = {0, };
+ snprintf(buf, sizeof(buf), "%s%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS_PRESSED);
+ elm_icon_file_set(ad->ic_settings, buf, NULL);
}
+static void _button_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ _D("%s\n", __func__);
+ struct appdata *ad = (struct appdata *)data;
+ retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
+ char buf[PATHBUF_SIZE] = {0, };
+ snprintf(buf, sizeof(buf), "%s%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS);
+ elm_icon_file_set(ad->ic_settings, buf, NULL);
+ if(evas_object_visible_get(ad->win)){
+ DEL_TIMER(ad->ptimer)
+ _open_ug(ad);
+ }
+}
+/*
Eina_Bool _unset_layout(void *data)
{
struct appdata *ad = (struct appdata *)data;
}
return ECORE_CALLBACK_CANCEL;
}
-
+*/
int _lang_changed(void *data){
_D("%s\n", __func__);
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
retvm_if(ad->win == NULL, -1, "Invalid argument: window is NULL\n");
- elm_object_text_set(ad->bt, S_("IDS_COM_BODY_SETTINGS"));
- snprintf(buf, sizeof(buf), "<font_size=32><b>%s</b></font_size>",
+ snprintf(buf, sizeof(buf), "<font_size=32><b>%s</b></font_size>",
T_("IDS_COM_BODY_HIGH_VOLUMES_MAY_HARM_YOUR_HEARING_IF_YOU_LISTEN_FOR_A_LONG_TIME"));
elm_object_text_set(ad->warn_lb, buf);
return 0;
int _app_reset(bundle *b, void *data)
{
- int ret, status;
- int lock, type, val;
- Evas_Object *win, *pu, *ic, *sl, *bt;
- Evas_Object *label, *warn_ly;
- char buf[STRBUF_SIZE] = {0, };
+ int ret = -1, status = -1, val = 0;
+ int type = MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY;
+ int lock = IDLELOCK_ON;
+ int w, h;
+ Evas_Object *win, *sl, *ic, *ic_settings;
+ /* volume-app layout */
+ Elm_Theme *th;
+ Evas_Object *outer, *inner, *block;
+ /* warn message layout */
+ //Evas_Object *label, *warn_ly;
+ char buf[PATHBUF_SIZE] = {0, };
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
_init_mm_sound(ad);
status = _check_status(&lock, &type);
- mm_sound_volume_get_value(type, (unsigned int*)(&val));
ad->type = type;
+ mm_sound_volume_get_value(type, (unsigned int*)(&val));
if (status == 0) {
if(ad->win){
_grab_key(ad);
_handle_bundle(b, ad);
- _unset_layout(data);
- evas_object_show(ad->pu);
+ _rotate_func(data);
evas_object_show(ad->win);
_mm_func(data);
- if(syspopup_has_popup(b))
+ if (syspopup_has_popup(b))
syspopup_reset(b);
+ ad->flag_launching = EINA_FALSE;
return 0;
}
ad->step = _get_step(type);
_grab_key(ad);
- pu = _add_popup(win, "volumebarstyle");
- retvm_if(pu == NULL, -1, "Failed to add popup\n");
- evas_object_smart_callback_add(pu, "block,clicked", _block_clicked_cb, ad);
- _get_title(type, buf, sizeof(buf));
- elm_object_part_text_set(pu, "title,text", buf);
- ad->pu = pu;
-
- /* Make a Slider bar */
- sl = _add_slider(ad->pu, 0, ad->step, val);
+ 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);
+ ecore_x_window_size_get(
+ ecore_x_window_root_first_get(),
+ &w, &h);
+ evas_object_resize(block, w, h);
+ evas_object_show(block);
+ 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);
+ 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(ad->pu);
+ 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);
- elm_object_content_set(ad->pu, ad->sl);
-
/* Make a Layout for volume slider with warning text. */
- snprintf(buf, sizeof(buf), "<font_size=32><b>%s</b></font_size>",
+ /*
+ snprintf(buf, sizeof(buf), "<font_size=32><b>%s</b></font_size>",
T_("IDS_COM_BODY_HIGH_VOLUMES_MAY_HARM_YOUR_HEARING_IF_YOU_LISTEN_FOR_A_LONG_TIME"));
- label = _add_label(ad->pu, "popup/default", buf);
+ label = _add_label(inner, "popup/default", buf);
+ //elm_object_part_content_set(inner, "elm.swallow.warn_label", label);
+ elm_object_part_content_set(outer, "elm.swallow.warn_label", label);
+ evas_object_show(label);
ad->warn_lb = label;
- evas_object_hide(ad->warn_lb);
+ _D("%s\n", buf);*/
- warn_ly = _add_layout(ad->pu, EDJ_THEME, GRP_VOLUME_SLIDER_WITH_WARNING);
+ /*warn_ly = _add_layout(ad->pu, EDJ_THEME, GRP_VOLUME_SLIDER_WITH_WARNING);
elm_object_part_content_set(warn_ly, "elm.swallow.warn_label", ad->warn_lb);
ad->warn_ly = warn_ly;
- evas_object_hide(ad->warn_ly);
-
- /* Make a setting button */
- bt = _add_button(ad->pu, "popup_button/default", S_("IDS_COM_BODY_SETTINGS"));
- evas_object_smart_callback_add(bt, "clicked", _button_cb, ad);
- elm_object_part_content_set(ad->pu, "button1", bt);
- ad->bt = bt;
+ evas_object_hide(ad->warn_ly);*/
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);
- }
+ if(evas_object_visible_get(ad->win))
+ _D("window is visible\n");
+ else{
+ _D("window is invisible, close volume\n");
+ _close_volume(ad);
+ }
+ }
+ ad->flag_launching = EINA_FALSE;
return 0;
}
int _close_volume(void *data);
int _app_create(struct appdata *ad);
int _app_pause(struct appdata *ad);
+int _rotate_func(void *data);
int _app_reset(bundle *b, void *data);
Eina_Bool popup_timer_cb(void *data);
Eina_Bool _unset_layout(void *data);
int _lang_changed(void *data);
+void _init_press_timers(void *data);
#endif
+
/* __VOLUME_LOGIC_H__ */
int _init_svi(void *data)
{
- int ret, handle;
+ int ret = -1, handle = -1;
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, -1, "Invaild argument: appdata is NULL\n");
{
int snd=0, vib=0;
char buf[PATHBUF_SIZE] = {0, };
- char *img;
+ char *img = NULL;
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
+ system_audio_route_device_t device = 0;
+ mm_sound_route_get_playing_device(&device);
+
vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &snd);
vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vib);
- if (val == 0) {
- if (vib) {
- if (ad->type == VOLUME_TYPE_MEDIA) {
- _D("media and mute\n");
- img = "00_volume_icon_Mute.png";
- } else {
- _D("Not media and vib\n");
- img = "00_volume_icon_Vibrat.png";
- _play_vib(ad->sh);
+ 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;
}
- } else {
- _D("vib\n");
- img = "00_volume_icon_Mute.png";
- }
- } else {
- _D("default volume\n");
- img = "00_volume_icon.png";
- }
-
- if(!snd){
- if(ad->type != VOLUME_TYPE_MEDIA){
- _D("Not media and mute\n");
- img = "00_volume_icon_Mute.png";
- }
+ 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)
+ img = IMG_VOLUME_ICON_HEADPHONE;
+ else
+ img = IMG_VOLUME_ICON_MEDIA;
+ 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;
}
-
-
- snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, img);
+ snprintf(buf, sizeof(buf), "%s%s", IMAGEDIR, img);
if (ad->ic ) {
elm_icon_file_set(ad->ic, buf, NULL);
}
return 1;
}
-
+/*
void _set_device_warning(void *data, int val, int device)
{
struct appdata *ad = (struct appdata *)data;
break;
}
}
-
+*/
int _get_title(volume_type_t type, char *label, int size)
{
char *text = NULL;
return 0;
}
-void _set_popup_title(void *data, int type, int device)
-{
- char buf[STRBUF_SIZE] = {0, };
- char name[STRBUF_SIZE] = {0, };
- struct appdata *ad = (struct appdata *)data;
- retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
-
- _get_title(type, buf, sizeof(buf));
-
- switch (device) {
- case SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_EARPHONE:
- snprintf(name, sizeof(name), "%s (%s)", buf, T_("IDS_COM_OPT_HEADPHONES_ABB"));
- elm_object_part_text_set(ad->pu, "title,text", name);
- break;
- default:
- elm_object_part_text_set(ad->pu, "title,text", buf);
- break;
- }
-}
-
int _get_step(int type)
{
- int ret, step;
+ int ret = -1, step = 0;
ret = mm_sound_volume_get_step(type, &step);
retvm_if(ret < 0, -1, "Failed to get step\n");
step -= 1;
void _mm_func(void *data)
{
_D("%s\n", __func__);
- int val;
+ 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");
mm_sound_route_get_playing_device(&device);
_set_slider_value(ad, val);
- _set_popup_title(ad, ad->type, device);
- _set_device_warning(ad, val, device);
_set_icon(ad, val);
_D("type(%d) val(%d)\n", ad->type, val);
}
mm_sound_volume_set_value(type, val);
return 0;
}
+
Evas_Object *_add_window(const char *name)
{
- Evas_Object *eo;
- int w, h;
+ Evas_Object *eo = NULL;
+ int w = -1, h = -1;
eo = elm_win_add(NULL, name, ELM_WIN_NOTIFICATION);
if (eo) {
elm_win_title_set(eo, name);
ecore_x_window_size_get(
ecore_x_window_root_first_get(),
&w, &h);
+ if(w == -1 || h == -1){
+ _E("ecore_x_window_seiz_get() is failed\n");
+ return NULL;
+ }
evas_object_resize(eo, w, h);
}
return eo;
Evas_Object *_add_slider(Evas_Object *parent, int min, int max, int val)
{
- Evas_Object *sl;
+ Evas_Object *sl = NULL;
sl = elm_slider_add(parent);
retvm_if(sl == NULL, NULL, "Failed to add slider\n");
elm_slider_horizontal_set(sl, EINA_TRUE);
Evas_Object *_add_layout(Evas_Object *parent, const char *file,
const char *group)
{
- Evas_Object *eo;
- int r;
+ Evas_Object *eo = NULL;
+ int r = -1;
retvm_if(parent == NULL, NULL, "Invalid argument: parent is NULL\n");
retvm_if(file == NULL, NULL, "Invalid argument: file is NULL\n");
Evas_Object *_add_button(Evas_Object *parent, const char *style, const char *text)
{
- Evas_Object *bt;
+ Evas_Object *bt = NULL;
bt = elm_button_add(parent);
retvm_if(bt == NULL, NULL, "Failed to add button\n");
if (style) elm_object_style_set(bt, style);
Evas_Object *_add_popup(Evas_Object *parent, const char *style)
{
- Evas_Object *pu;
+ Evas_Object *pu = NULL;
pu = elm_popup_add(parent);
retvm_if(pu == NULL, NULL, "[Error] Failed to add popup\n");
evas_object_size_hint_weight_set(pu, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
}
Evas_Object *_add_label(Evas_Object *parent, const char *style, const char *text)
{
- Evas_Object *lb;
+ Evas_Object *lb = NULL;
lb = elm_label_add(parent);
retvm_if(lb == NULL, NULL, "Failed to add label\n");
elm_object_style_set(lb, style);
return _lang_changed(data);
}
+static Eina_Bool rotate_cb(void *data, int type, void *event)
+{
+ struct appdata *ad = data;
+ Ecore_X_Event_Client_Message *ev = event;
+
+ retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
+ if (!event){
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (ev->message_type == ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE && ad->ug == NULL){
+ _rotate_func(data);
+ }
+ return ECORE_CALLBACK_RENEW;
+}
+
static int app_create(void *data)
{
struct appdata *ad = data;
appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE,
lang_changed, ad);
+ /* 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"));
static int app_reset(bundle *b, void *data)
{
+ _D("%s\n", __func__);
struct appdata *ad = data;
+ retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
- if (ad->flag_launching == EINA_TRUE) {
+ if(ad->flag_launching == EINA_TRUE || evas_object_visible_get(ad->win))
+ {
+ _init_press_timers(ad);
return 0;
}
ad->flag_launching = EINA_TRUE;
_app_reset(b, data);
-
/* appcore measure time example */
printf("from AUL to %s(): %d msec\n", __func__,
appcore_measure_time_from("APP_START_TIME"));
if (ad->win)
elm_win_activate(ad->win);
- ad->flag_launching = EINA_FALSE;
-
return 0;
}
.reset = app_reset,
};
- /* appcore measure time example */
- printf("from AUL to %s(): %d msec\n", __func__,
- appcore_measure_time_from("APP_START_TIME"));
+ /*elm_init(argc, argv);
+ elm_config_preferred_engine_set("opengl_x11");*/
memset(&ad, 0x0, sizeof(struct appdata));
ops.data = &ad;
return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
}
+
#endif
#if !defined(RESDIR)
-# define RESDIR "/opt/apps/org.tizen.volume/res"
+# define RESDIR "/opt/apps/com.samsung.volume/res"
#endif
#if !defined(LOCALEDIR)
# define EDJDIR RESDIR"/edje"
#endif
-#define EDJ_FILE EDJDIR"/"PACKAGE".edj"
-#define GRP_MAIN "main"
#define EDJ_THEME EDJDIR"/volume_popup.edj"
#define GRP_VOLUME_SLIDER "popup_slider_style"
#define GRP_VOLUME_SLIDER_WITH_WARNING "popup_slider_text_style_with_warn_label"
+#define EDJ_APP EDJDIR"/volume_app.edj"
+#define GRP_VOLUME_BLOCKEVENTS "block_events"
+#define GRP_VOLUME_LAYOUT "volumeLayout"
+#define GRP_VOLUME_CONTENT "volumeLayoutContent"
+#define GRP_VOLUME_SLIDER_HORIZONTAL "volumeHorizontalSlider"
+
+#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"
+#define IMG_VOLUME_ICON_VIB "/00_volume_icon_Vibrat.png"
+#define IMG_VOLUME_ICON_HEADPHONE "/00_volume_icon_headphone.png"
+#define IMG_VOLUME_ICON_MEDIA "/00_volume_icon_media.png"
+#define IMG_VOLUME_ICON_SETTINGS "/00_volume_icon_settings.png"
+#define IMG_VOLUME_ICON_SETTINGS_PRESSED "/00_volume_icon_settings_pressed.png"
+#define IMG_VOLUME_WINSET_DIVIDER_LINE "/00_winset_divider_line.png"
#define S_(str) dgettext("sys_string", str)
#define T_(str) dgettext(PACKAGE, str)
struct appdata
{
- Evas_Object *win, *pu, *bt, *sl, *ic, *warn_lb, *warn_ly;
+ Evas_Object *win, *block_events, *ly, *sl, *ic, *ic_settings, *warn_lb;
Ecore_Timer *ptimer;
Ecore_Timer *stimer; /* slider timer */
Ecore_Timer *sutimer, *sdtimer, *lutimer, *ldtimer; /* long press */
Ecore_Timer *warntimer; /* warning message timer */
+ Ecore_Timer *luwarmtimer, *ldwarmtimer;
volume_type_t type;
int step;
- int before_mute[32];
+ int angle;
/* ug handler */
ui_gadget_h ug;
int sh; /* svi handle */
int flag_pressing; /* to set hard key press */
int flag_touching;
- int flag_launching; /* to block double launching by double click */
+ int flag_launching;
int flag_deleting;
int flag_warning; /* set device warning flag */
};
--- /dev/null
+<manifest>
+ <define>
+ <domain name="volume"/>
+ </define>
+ <request>
+ <domain name="volume"/>
+ </request>
+ <assign>
+ <filesystem path="/opt/apps/org.tizen.volume/bin/volume" exec_label="volume"/>
+ </assign>
+</manifest>