/* * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved * * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ group { name: "elm/check/base/default"; images { set { name: "core_check_bg"; image { image: SMALL"images/Controls/core_check_bg.png" COMP; } image { image: MEDIUM"images/Controls/core_check_bg.png" COMP; } } set { name: "core_check_bg_stroke"; image { image: SMALL"images/Controls/core_check_bg_stroke.png" COMP; } image { image: MEDIUM"images/Controls/core_check_bg_stroke.png" COMP; } } set { name: "core_check_icon"; image { image: SMALL"images/Controls/core_check_icon.png" COMP; } image { image: MEDIUM"images/Controls/core_check_icon.png" COMP; } } } script { public check_state; public check_disabled; public check_visible; } parts { part { name: "bg"; scale: 1; description { state: "default" 0.0; min: CHECK_BG_SIZE; align: 0.0 0.5; aspect: 1 1; aspect_preference: BOTH; image.normal: "core_check_bg"; color: 0 0 0 102; /*(Changeable UI) color_class: "W013L1E1";*/ } description { state: "on" 0.0; inherit: "default" 0.0; color: 2 61 132 255; /*(Changeable UI) color_class: "W013L1";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 0 0 0 51; /*(Changeable UI) color_class: "W013L1D";*/ } } part { name: "bg_stroke"; scale: 1; description { state: "default" 0.0; min: CHECK_BG_STROKE_SIZE; align: 0.0 0.5; aspect: 1 1; aspect_preference: BOTH; image.normal: "core_check_bg_stroke"; color: 191 191 191 153; /*(Changeable UI) color_class: "W013L2E1";*/ } description { state: "on" 0.0; inherit: "default" 0.0; color: 191 191 191 153; /*(Changeable UI) color_class: "W013L2";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 191 191 191 76; /*(Changeable UI) color_class: "W013L2D";*/ } } part { name: "check"; scale: 1; description { state: "default" 0.0; min: CHECK_ICON_SIZE; rel1.to: "bg"; rel1.relative: 0.125 0.125; rel2.to: "bg"; rel2.relative: 0.875 0.875; aspect: 1 1; aspect_preference: BOTH; image.normal: "core_check_icon"; color: 244 244 244 255; /*(Changeable UI) color_class:"W013L1i";*/ visible:0; } description { state: "on" 0.0; inherit: "default" 0.0; visible: 1; } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 244 244 244 153; /*(Changeable UI) color_class:"W013L1iD";*/ } } part { name: "event"; scale: 1; type: RECT; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; color: 0 0 0 0; } } } programs { program { name: "show"; signal: "show"; script { set_int(check_visible, 1); } } program { name: "hide"; signal: "hide"; script { set_int(check_visible, 0); } } program { name: "click"; signal: "mouse,clicked,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; emit("elm,action,check,toggle", ""); run_program(PROGRAM:"touch_sound"); } } program { name: "touch_sound"; action: RUN_PLUGIN "touch_sound"; } program { name: "unpressed"; signal: "mouse,up,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) { set_state(PART:"check", "on", 0.0); set_state(PART:"bg", "on", 0.0); set_state(PART:"bg_stroke", "on", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"bg_stroke", "default", 0.0); } } } program { name: "unpressed2"; signal: "elm,state,mouse,up"; source: "elm"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) { set_state(PART:"check", "on", 0.0); set_state(PART:"bg", "on", 0.0); set_state(PART:"bg_stroke", "on", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"bg_stroke", "default", 0.0); } } } program { name: "check_on"; signal: "elm,state,check,on"; source: "elm"; script { if (get_int(check_disabled) == 1) { set_state(PART:"bg", "disabled", 0.0); set_state(PART:"bg_stroke", "disabled", 0.0); } else { set_state(PART:"bg", "on", 0.0); set_state(PART:"bg_stroke", "on", 0.0); } set_state(PART:"check", "on", 0.0); set_int(check_state, 1); } } program { name: "check_off"; signal: "elm,state,check,off"; source: "elm"; script { if (get_int(check_disabled) == 1) { set_state(PART:"bg", "disabled", 0.0); set_state(PART:"bg_stroke", "disabled", 0.0); } else { set_state(PART:"bg", "default", 0.0); set_state(PART:"bg_stroke", "on", 0.0); } set_state(PART:"check", "default", 0.0); set_int(check_state, 0); } } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; script { set_int(check_disabled, 1); set_state(PART:"bg", "disabled", 0.0); set_state(PART:"bg_stroke", "disabled", 0.0); set_state(PART:"check", "disabled", 0.0); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; script { set_int(check_disabled, 0); if (get_int(check_state) == 1) { set_state(PART:"bg", "on", 0.0); set_state(PART:"bg_stroke", "on", 0.0); set_state(PART:"check", "on", 0.0); } else { set_state(PART:"bg", "default", 0.0); set_state(PART:"bg_stroke", "default", 0.0); set_state(PART:"check", "default", 0.0); } } } } } group { name: "elm/check/base/list"; images { image: "core_check_bg.png" COMP; image: "core_check_bg_stroke.png" COMP; image: "core_check_icon.png" COMP; } script { public check_state; public check_disabled; public check_visible; } parts { part { name: "bg"; scale: 1; description { state: "default" 0.0; min: CHECK_BG_SIZE; align: 0.0 0.5; aspect: 1 1; aspect_preference: BOTH; image.normal: "core_check_bg.png"; color: 0 0 0 102; /*(Changeable UI) color_class: "W013L1E1";*/ } description { state: "on" 0.0; inherit: "default" 0.0; color: 2 61 132 255; /*(Changeable UI) color_class: "W013L1";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 0 0 0 51; /*(Changeable UI) color_class: "W013L1D";*/ } } part { name: "bg_stroke"; scale: 1; description { state: "default" 0.0; min: CHECK_BG_STROKE_SIZE; align: 0.0 0.5; aspect: 1 1; aspect_preference: BOTH; image.normal: "core_check_bg_stroke.png"; color: 191 191 191 153; /*(Changeable UI) color_class: "W013L2E1";*/ } description { state: "on" 0.0; inherit: "default" 0.0; color: 191 191 191 153; /*(Changeable UI) color_class: "W013L2";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 191 191 191 76; /*(Changeable UI) color_class: "W013L2D";*/ } } part { name: "check"; scale: 1; description { state: "default" 0.0; min: CHECK_ICON_SIZE; rel1.to: "bg"; rel1.relative: 0.125 0.125; rel2.to: "bg"; rel2.relative: 0.875 0.875; aspect: 1 1; aspect_preference: BOTH; image.normal: "core_check_icon.png"; color: 244 244 244 255; /*(Changeable UI) color_class:"W013L1i";*/ visible:0; } description { state: "on" 0.0; inherit: "default" 0.0; visible: 1; } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 244 244 244 153; /*(Changeable UI) color_class:"W013L1iD";*/ } } part { name: "event"; scale: 1; type: RECT; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; color: 0 0 0 0; } } } programs { program { name: "show"; signal: "show"; script { set_int(check_visible, 1); } } program { name: "hide"; signal: "hide"; script { set_int(check_visible, 0); } } program { name: "unpressed"; signal: "mouse,up,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) { set_state(PART:"check", "on", 0.0); set_state(PART:"bg", "on", 0.0); set_state(PART:"bg_stroke", "on", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"bg_stroke", "default", 0.0); } } } program { name: "unpressed2"; signal: "elm,state,mouse,up"; source: "elm"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) { set_state(PART:"check", "on", 0.0); set_state(PART:"bg", "on", 0.0); set_state(PART:"bg_stroke", "on", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"bg_stroke", "default", 0.0); } } } program { name: "check_on"; signal: "elm,state,check,on"; source: "elm"; script { if (get_int(check_disabled) == 1) { set_state(PART:"bg", "disabled", 0.0); set_state(PART:"bg_stroke", "disabled", 0.0); } else { set_state(PART:"bg", "on", 0.0); set_state(PART:"bg_stroke", "on", 0.0); } set_state(PART:"check", "on", 0.0); set_int(check_state, 1); } } program { name: "check_off"; signal: "elm,state,check,off"; source: "elm"; script { if (get_int(check_disabled) == 1) { set_state(PART:"bg", "disabled", 0.0); set_state(PART:"bg_stroke", "disabled", 0.0); } else { set_state(PART:"bg", "default", 0.0); set_state(PART:"bg_stroke", "on", 0.0); } set_state(PART:"check", "default", 0.0); set_int(check_state, 0); } } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; script { set_int(check_disabled, 1); set_state(PART:"bg", "disabled", 0.0); set_state(PART:"bg_stroke", "disabled", 0.0); set_state(PART:"check", "disabled", 0.0); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; script { set_int(check_disabled, 0); if (get_int(check_state) == 1) { set_state(PART:"bg", "on", 0.0); set_state(PART:"bg_stroke", "on", 0.0); set_state(PART:"check", "on", 0.0); } else { set_state(PART:"bg", "default", 0.0); set_state(PART:"bg_stroke", "default", 0.0); set_state(PART:"check", "default", 0.0); } } } } } group { name: "elm/check/base/favorite"; images { set { name: "core_icon_favorite"; image { image: SMALL"images/Controls/core_icon_favorite.png" COMP; } image { image: MEDIUM"images/Controls/core_icon_favorite.png" COMP; } } } script { public check_state; public check_disabled; public check_visible; } parts { part { name: "bg"; scale: 1; description { state: "default" 0.0; min: CHECK_BG_SIZE ; max: CHECK_BG_SIZE ; image.normal: "core_icon_favorite"; color: 7 7 7 76; /*(Changeable UI) color_class: "W016L1iE1";*/ } description { state: "on" 0.0; inherit: "default" 0.0; color: 255 178 0 255; /*(Changeable UI) color_class: "W016L1i";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 7 7 7 38; /*(Changeable UI) color_class: "W016L1iD";*/ } } part { name: "event"; scale: 1; type: RECT; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; color: 0 0 0 0; } } } programs { program { name: "show"; signal: "show"; script { set_int(check_visible, 1); } } program { name: "hide"; signal: "hide"; script { set_int(check_visible, 0); } } program { name: "click"; signal: "mouse,clicked,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; emit("elm,action,check,toggle", ""); run_program(PROGRAM:"touch_sound"); } } program { name: "touch_sound"; action: RUN_PLUGIN "touch_sound"; } program { name: "unpressed"; signal: "mouse,up,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) set_state(PART:"bg", "on", 0.0); else set_state(PART:"bg", "default", 0.0); } } program { name: "unpressed2"; signal: "elm,state,mouse,up"; source: "elm"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) set_state(PART:"bg", "on", 0.0); else set_state(PART:"bg", "default", 0.0); } } program { name: "check_on"; signal: "elm,state,check,on"; source: "elm"; script { set_state(PART:"bg", "on", 0.0); set_int(check_state, 1); } } program { name: "check_off"; signal: "elm,state,check,off"; source: "elm"; script { if (get_int(check_disabled) == 1) set_state(PART:"bg", "disabled", 0.0); else set_state(PART:"bg", "default", 0.0); set_int(check_state, 0); } } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; script { set_int(check_disabled, 1); if (get_int(check_state) == 1) set_state(PART:"bg", "on", 0.0); else set_state(PART:"bg", "disabled", 0.0); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; script { set_int(check_disabled, 0); if (get_int(check_state) == 1) set_state(PART:"bg", "on", 0.0); else set_state(PART:"bg", "default", 0.0); } } } } group { name: "elm/check/base/on&off"; images { set { name: "core_toggle_bg"; image { image: SMALL"images/Controls/core_toggle_bg.png" COMP; } image { image: MEDIUM"images/Controls/core_toggle_bg.png" COMP; } } set { name: "core_toggle_icon_off"; image { image: SMALL"images/Controls/core_toggle_icon_off.png" COMP; } image { image: MEDIUM"images/Controls/core_toggle_icon_off.png" COMP; } } set { name: "core_toggle_icon_on"; image { image: SMALL"images/Controls/core_toggle_icon_on.png" COMP; } image { image: MEDIUM"images/Controls/core_toggle_icon_on.png" COMP; } } } script { public check_state; public check_disabled; public check_visible; } parts { part { name: "bg"; type: SPACER; mouse_events: 0; scale: 1; description { state: "default" 0.0; min: CHECK_GEN_SIZE; max: CHECK_GEN_SIZE; } } part { name: "bg_image"; mouse_events: 0; scale: 1; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; image.normal: "core_toggle_bg"; color: 7 7 7 76; /*(Changeable UI) color_class: "W015L1E1";*/ } description { state: "on" 0.0; inherit: "default" 0.0; color: 52 158 91 255; /*(Changeable UI) color_class: "W015L1";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 7 7 7 38; /*(Changeable UI) color_class: "W015L1D";*/ } } part { name: "button"; mouse_events: 0; scale: 1; description { state: "default" 0.0; min: CHECK_SIZE ; max: CHECK_SIZE ; rel1.to: "bg_image"; rel2.to: "bg_image"; image.normal: "core_toggle_icon_off"; color: 244 244 244 255; /*(Changeable UI) color_class: "W015L1i";*/ } description { state: "on" 0.0; inherit: "default" 0.0; image.normal: "core_toggle_icon_on"; color: 244 244 244 255; /*(Changeable UI) color_class: "W015L1i";*/ } } part { name: "event"; scale: 1; type: RECT; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; color: 0 0 0 0; } } } programs { program { name: "show"; signal: "show"; script { set_int(check_visible, 1); } } program { name: "hide"; signal: "hide"; script { set_int(check_visible, 0); } } program { name: "click"; signal: "mouse,clicked,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; emit("elm,action,check,toggle", ""); run_program(PROGRAM:"touch_sound"); } } program { name: "touch_sound"; action: RUN_PLUGIN "touch_sound"; } program { name: "unpressed"; signal: "mouse,up,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) { set_state(PART:"bg_image", "on", 0.0); set_state(PART:"button", "on", 0.0); } else { set_state(PART:"bg_image", "default", 0.0); set_state(PART:"button", "default", 0.0); } } } program { name: "unpressed2"; signal: "elm,state,mouse,up"; source: "elm"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) { set_state(PART:"bg_image", "on", 0.0); set_state(PART:"button", "on", 0.0) } else { set_state(PART:"bg_image", "default", 0.0); set_state(PART:"button", "default", 0.0); } } } program { name: "check_on"; signal: "elm,state,check,on"; source: "elm"; script { if (get_int(check_disabled) == 1) set_state(PART:"bg_image", "disabled", 0.0); else set_state(PART:"bg_image", "on", 0.0); set_state(PART:"button", "on", 0.0) set_int(check_state, 1); } } program { name: "check_off"; signal: "elm,state,check,off"; source: "elm"; script { if (get_int(check_disabled) == 1) set_state(PART:"bg_image", "disabled", 0.0); else set_state(PART:"bg_image", "default", 0.0); set_state(PART:"button", "default", 0.0); set_int(check_state, 0); } } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; script { set_int(check_disabled, 1); set_state(PART:"bg_image", "disabled", 0.0); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; script { set_int(check_disabled, 0); if (get_int(check_state) == 1) set_state(PART:"bg_image", "on", 0.0); else set_state(PART:"bg_image", "default", 0.0); } } } } group { name: "elm/check/base/popup"; inherit: "elm/check/base/default"; parts { part { name: "padding_before_text"; type: SPACER; scale: 1; description { state: "default" 0.0; align: 0.0 0.5; min: 0 0; rel1 { to_x: "bg"; relative: 1.0 0.0; } rel2 { to_x: "bg"; relative: 1.0 1.0; } } description { state: "visible" 0.0; inherit: "default" 0.0; min: CHECK_PAD_BEFORE_TEXT_INC; max: CHECK_PAD_BEFORE_TEXT_INC; fixed: 1 0; } } part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; description { state: "default" 0.0; visible: 0; fixed: 0 1; rel1 { relative: 1.0 0.5; to_x: "padding_before_text"; } rel2 { relative: 1.0 0.5; } align: 0.0 0.5; text { style: "check_popup"; min: 0 0; } } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; text.min: 1 1; } description { state: "disabled" 0.0; inherit: "default" 0.0; } description { state: "disabled_visible" 0.0; inherit: "default" 0.0; visible: 1; text { style: "check_popup_dim"; min: 1 1; } } } part { name: "event"; scale: 1; type: RECT; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "elm.text"; color: 0 0 0 0; } } } programs { program { name: "text_show"; signal: "elm,state,text,visible"; source: "elm"; action: STATE_SET "visible" 0.0; target: "padding_before_text"; target: "elm.text"; } program { name: "text_hide"; signal: "elm,state,text,hidden"; source: "elm"; action: STATE_SET "default" 0.0; target: "padding_before_text"; target: "elm.text"; } } }