/* * 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 { image: "tw_btn_checkbox_holo_dark.png" COMP; image: "tw_btn_check_holo_dark.png" COMP; image: "tw_btn_checkbox_line_holo_dark.png" COMP; } script { public check_state; public check_disabled; public check_visible; } parts { part { name: "bg"; scale: 1; description { state: "default" 0.0; align: 0.0 0.5; min: CHECK_SIZE; max: CHECK_SIZE; image.normal: "tw_btn_checkbox_holo_dark.png"; color: 0 13 25 255; /*(Changeable UI) color_class: "W012L1";*/ } description { state: "pressed" 0.0; inherit: "default" 0.0; color: 0 72 132 102; /*(Changeable UI) color_class: "W012L1P";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 35 35 35 255; /*(Changeable UI) color_class: "W012L1D";*/ } } part { name: "check"; clip_to: "sequence_clip"; scale: 1; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; image.normal: "tw_btn_check_holo_dark.png"; visible: 0; } description { state: "on" 0.0; inherit: "default" 0.0; visible: 1; color: 115 191 15 255; /*(Changeable UI) color_class: "W012L2";*/ } description { state: "pressed" 0.0; inherit: "on" 0.0; color: 249 249 249 255; /*(Changeable UI) color_class: "W012L2P";*/ } description { state: "disabled" 0.0; inherit: "on" 0.0; color: 58 58 58 255; /*(Changeable UI) color_class: "W012L2D";*/ } } part { name: "outline"; scale: 1; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; image.normal: "tw_btn_checkbox_line_holo_dark.png"; color: 249 249 249 76; /*(Changeable UI) color_class: "W231";*/ } description { state: "pressed" 0.0; inherit: "default" 0.0; color: 249 249 249 76; /*(Changeable UI) color_class: "W231P";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 249 249 249 76; /*(Changeable UI) color_class: "W231D";*/ } description { state: "focused" 0.0; inherit: "default" 0.0; color: 0 110 255 255; /*(Changeable UI) color_class: "W201";*/ } } part { name: "sequence_clip"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1.to: "bg"; rel2 { relative: 0.0 1.0; to: "bg"; } color: 255 255 255 255; } description { state: "visible" 0.0; inherit: "default" 0.0; rel2 { relative: 1.0 1.0; to: "bg"; } } } part { name: "event"; scale: 1; type: RECT; description { state: "default" 0.0; 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:"play_sample"); } } program { name: "play_sample"; 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); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "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); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); } } program { name: "pressed"; signal: "mouse,down,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) set_state(PART:"check", "pressed", 0.0); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "pressed", 0.0); set_state(PART:"outline", "pressed", 0.0); } } program { name: "pressed2"; signal: "elm,state,mouse,down"; source: "elm"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) set_state(PART:"check", "pressed", 0.0); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "pressed", 0.0); set_state(PART:"outline", "pressed", 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:"outline", "disabled", 0.0); set_state(PART:"check", "disabled", 0.0); set_state(PART:"sequence_clip", "visible", 0.0); } else if (get_int(check_visible) == 1) { set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); run_program(PROGRAM:"check_show_effect"); run_program(PROGRAM:"check_draw_effect"); } else if (get_int(check_visible) == 0) { set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); set_state(PART:"check", "on", 0.0); set_state(PART:"sequence_clip", "visible", 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:"outline", "disabled", 0.0); } else { set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); } set_state(PART:"check", "default", 0.0); set_state(PART:"sequence_clip", "default", 0.0); set_int(check_state, 0); } } program { name: "check_show_effect"; action: STATE_SET "on" 0.0; transition: LINEAR 0.233; target: "check"; } program { name: "check_draw_effect"; action: STATE_SET "visible" 0.0; transition: LINEAR 0.267; target: "sequence_clip"; } program { name: "focus"; signal: "elm,action,focus_highlight,show"; source: "elm"; action: STATE_SET "focused" 0.0; target: "outline"; } program { name: "unfocus"; signal: "elm,action,focus_highlight,hide"; source: "elm"; action: STATE_SET "default" 0.0; target: "outline"; } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; script { if (get_int(check_state) == 1) set_state(PART:"check", "disabled", 0.0); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "disabled", 0.0); set_state(PART:"outline", "disabled", 0.0); set_int(check_disabled, 1); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; script { if (get_int(check_state) == 1) set_state(PART:"check", "on", 0.0); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); set_int(check_disabled, 0); } } } } // List Check Style group { name: "elm/check/base/list"; images { image: "tw_btn_checkbox_holo_dark.png" COMP; image: "tw_btn_check_holo_dark.png" COMP; image: "tw_btn_checkbox_line_holo_dark.png" COMP; } script { public check_state; public check_disabled; public check_visible; } parts { part { name: "bg"; scale: 1; description { state: "default" 0.0; align: 0.0 0.5; min: CHECK_SIZE; max: CHECK_SIZE; image.normal: "tw_btn_checkbox_holo_dark.png"; color: 0 13 25 255; /*(Changeable UI) color_class: "W012L1";*/ } description { state: "pressed" 0.0; inherit: "default" 0.0; color: 0 72 132 102; /*(Changeable UI) color_class: "W012L1P";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 35 35 35 255; /*(Changeable UI) color_class: "W012L1D";*/ } } part { name: "check"; clip_to: "sequence_clip"; scale: 1; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; image.normal: "tw_btn_check_holo_dark.png"; visible: 0; } description { state: "on" 0.0; inherit: "default" 0.0; visible: 1; color: 115 191 15 255; /*(Changeable UI) color_class: "W012L2";*/ } description { state: "pressed" 0.0; inherit: "on" 0.0; color: 249 249 249 255; /*(Changeable UI) color_class: "W012L2P";*/ } description { state: "disabled" 0.0; inherit: "on" 0.0; color: 58 58 58 255; /*(Changeable UI) color_class: "W012L2D";*/ } } part { name: "outline"; scale: 1; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; image.normal: "tw_btn_checkbox_line_holo_dark.png"; color: 249 249 249 76; /*(Changeable UI) color_class: "W231";*/ } description { state: "pressed" 0.0; inherit: "default" 0.0; color: 249 249 249 76; /*(Changeable UI) color_class: "W231P";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 249 249 249 76; /*(Changeable UI) color_class: "W231D";*/ } description { state: "focused" 0.0; inherit: "default" 0.0; color: 0 110 255 255; /*(Changeable UI) color_class: "W201";*/ } } part { name: "sequence_clip"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1.to: "bg"; rel2 { relative: 0.0 1.0; to: "bg"; } color: 255 255 255 255; } description { state: "visible" 0.0; inherit: "default" 0.0; rel2 { relative: 1.0 1.0; to: "bg"; } } } part { name: "event"; scale: 1; type: RECT; description { state: "default" 0.0; 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); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "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); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); } } program { name: "pressed"; signal: "mouse,down,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) set_state(PART:"check", "pressed", 0.0); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "pressed", 0.0); set_state(PART:"outline", "pressed", 0.0); } } program { name: "pressed2"; signal: "elm,state,mouse,down"; source: "elm"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) set_state(PART:"check", "pressed", 0.0); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "pressed", 0.0); set_state(PART:"outline", "pressed", 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:"outline", "disabled", 0.0); set_state(PART:"check", "disabled", 0.0); set_state(PART:"sequence_clip", "visible", 0.0); } else if (get_int(check_visible) == 1) { set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); run_program(PROGRAM:"check_show_effect"); run_program(PROGRAM:"check_draw_effect"); } else if (get_int(check_visible) == 0) { set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); set_state(PART:"check", "on", 0.0); set_state(PART:"sequence_clip", "visible", 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:"outline", "disabled", 0.0); } else { set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); } set_state(PART:"check", "default", 0.0); set_state(PART:"sequence_clip", "default", 0.0); set_int(check_state, 0); } } program { name: "check_show_effect"; action: STATE_SET "on" 0.0; transition: LINEAR 0.233; target: "check"; } program { name: "check_draw_effect"; action: STATE_SET "visible" 0.0; transition: LINEAR 0.267; target: "sequence_clip"; } program { name: "focus"; signal: "elm,action,focus_highlight,show"; source: "elm"; action: STATE_SET "focused" 0.0; target: "outline"; } program { name: "unfocus"; signal: "elm,action,focus_highlight,hide"; source: "elm"; action: STATE_SET "default" 0.0; target: "outline"; } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; script { if (get_int(check_state) == 1) set_state(PART:"check", "disabled", 0.0); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "disabled", 0.0); set_state(PART:"outline", "disabled", 0.0); set_int(check_disabled, 1); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; script { if (get_int(check_state) == 1) set_state(PART:"check", "on", 0.0); else set_state(PART:"check", "default", 0.0); set_state(PART:"bg", "default", 0.0); set_state(PART:"outline", "default", 0.0); set_int(check_disabled, 0); } } } } group { name: "elm/check/base/list_divider"; inherit: "elm/check/base/default"; parts{ part { name: "elm.padding.left"; type: SPACER; scale: 1; description { state: "default" 0.0; fixed: 1 0; align: 0.0 0.5; min: BUTTON_DIVIDER_BTN_PADDING_LEFT_SIZE 0; max: BUTTON_DIVIDER_BTN_PADDING_LEFT_SIZE -1; rel2.relative: 0.0 1.0; } } part { name: "elm.padding.right"; type: SPACER; scale: 1; description { state: "default" 0.0; fixed: 0 1; align: 1.0 0.5; min: BUTTON_DIVIDER_BTN_PADDING_RIGHT_SIZE 0; max: BUTTON_DIVIDER_BTN_PADDING_RIGHT_SIZE -1; rel1.relative: 1.0 0.0; } } part { name: "bg"; scale: 1; description { state: "default" 0.0; align: 0.0 0.5; min: CHECK_SIZE; max: CHECK_SIZE; image.normal: "tw_btn_checkbox_holo_dark.png"; color: 0 13 25 255; /*(Changeable UI) color_class: "W012L1";*/ rel1.to: "elm.padding.left"; rel1.relative: 1.0 0.0; rel2.to: "elm.padding.right"; rel2.relative: 0.0 1.0; } description { state: "pressed" 0.0; inherit: "default" 0.0; color: 0 72 132 102; /*(Changeable UI) color_class: "W012L1P";*/ } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 35 35 35 255; /*(Changeable UI) color_class: "W012L1D";*/ } } } } group { name: "elm/check/base/on&off"; images { image: "tw_btn_toggle_bg_holo.png" COMP; image: "tw_btn_toggle_on_holo_dark.png" COMP; image: "tw_btn_toggle_off_holo_dark.png" COMP; image: "tw_btn_toggle_handle_holo.png" COMP; } script { public is_rtl = 0; public is_drag = 0; public was_drag = 0; public check_on = 0; public check_disabled = 0; } parts { part { name: "bg"; type: SPACER; mouse_events: 0; scale: 1; description { state: "default" 0.0; min: CHECK_TOGGLE_SIZE; max: CHECK_TOGGLE_SIZE; } } part { name: "bg_image"; mouse_events: 0; scale: 1; description { state: "default" 0.0; min: CHECK_TOGGLE_SIZE; max: CHECK_TOGGLE_SIZE; rel1.to: "bg"; rel2.to: "bg"; image.normal: "tw_btn_toggle_bg_holo.png"; color: 132 132 132 255; /*(Changeable UI) color_class: "W014L2";*/ } description { state: "on_pressed" 0.0; inherit: "default" 0.0; color: 74 102 38 255; /*(Changeable UI) color_class: "W014L1P";*/ } description { state: "on_disabled" 0.0; inherit: "default" 0.0; color: 30 38 21 255; /*(Changeable UI) color_class: "W014L1D";*/ } description { state: "off_pressed" 0.0; inherit: "default" 0.0; color: 102 100 100 255; /*(Changeable UI) color_class: "W014L2P";*/ } description { state: "off_disabled" 0.0; inherit: "default" 0.0; color: 63 63 63 255; /*(Changeable UI) color_class: "W014L2D";*/ } description { state: "on" 0.0; inherit: "default" 0.0; color: 115 191 15 255; /*(Changeable UI) color_class: "W014L1";*/ } } part { name: "drag_container"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; color: 0 0 0 0; rel1.to: "bg"; rel2.to: "bg"; } } part { name: "clipper"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; color: 255 255 255 255; } } part { name: "button_handler"; scale: 1; description { state: "default" 0.0; min: CHECK_TOGGLE_THUMB_SIZE; max: CHECK_TOGGLE_THUMB_SIZE; rel1.to: "button"; rel2.to: "button"; image.normal: "tw_btn_toggle_handle_holo.png"; color: 249 249 249 255; /*(Changeable UI) color_class: "W014L4";*/ } description { state: "on" 0.0; inherit: "default" 0.0; color: 249 249 249 255; /*(Changeable UI) color_class: "W014L3";*/ } description { state: "on_pressed" 0.0; inherit: "default" 0.0; color: 178 178 178 255; /*(Changeable UI) color_class: "W014L3P";*/ } description { state: "on_disabled" 0.0; inherit: "default" 0.0; color: 76 76 76 255; /*(Changeable UI) color_class: "W014L3D";*/ } description { state: "off_pressed" 0.0; inherit: "default" 0.0; color: 178 178 178 255; /*(Changeable UI) color_class: "W014L4P";*/ } description { state: "off_disabled" 0.0; inherit: "default" 0.0; color: 76 76 76 255; /*(Changeable UI) color_class: "W014L4D";*/ } } part { name: "opacity_clip_button"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1.to: "button"; rel2.to: "button"; color: 255 255 255 255; } description { state: "on" 0.0; inherit: "default" 0.0; color: 255 255 255 0; } } part { name: "button"; scale: 1; clip_to: "clipper"; clip_to: "opacity_clip_button"; mouse_events: 1; dragable { x: 1 1 0; y: 0 0 0; confine: "drag_container"; } description { state: "default" 0.0; min: CHECK_TOGGLE_THUMB_SIZE; max: CHECK_TOGGLE_THUMB_SIZE; rel1.to: "bg"; rel2.to: "bg"; align: 0.0 0.5; image.normal: "tw_btn_toggle_off_holo_dark.png"; color: 132 132 132 255; /*(Changeable UI) color_class: "W014L6";*/ } description { state: "on" 0.0; inherit: "default" 0.0; image.normal: "tw_btn_toggle_on_holo_dark.png"; color: 115 191 15 255; /*(Changeable UI) color_class: "W014L5";*/ } description { state: "on_pressed" 0.0; inherit: "on" 0.0; color: 74 102 38 255; /*(Changeable UI) color_class: "W014L5P";*/ } description { state: "on_disabled" 0.0; inherit: "on" 0.0; color: 30 38 21 255; /*(Changeable UI) color_class: "W014L5D";*/ } description { state: "off_pressed" 0.0; inherit: "default" 0.0; color: 102 100 100 255; /*(Changeable UI) color_class: "W014L6P";*/ } description { state: "off_disabled" 0.0; inherit: "default" 0.0; color: 63 63 63 255; /*(Changeable UI) color_class: "W014L6D";*/ } } part { name: "button_events"; type: RECT; dragable { events: "button"; } description { state: "default" 0.0; rel1.to_x: "bg"; rel2.to_x: "bg"; color: 0 0 0 0; } } part { name: "onrect"; type: RECT; scale: 1; clip_to: "clipper"; mouse_events: 0; description { state: "default" 0.0; rel1 { relative: -1.0 0.0; to: "button"; } rel2 { relative: 0.0 1.0; to: "button"; } align: 1.0 0.5; color: 0 0 0 0; } } part { name: "offrect"; type: RECT; scale: 1; clip_to: "clipper"; mouse_events: 0; description { state: "default" 0.0; rel1 { relative: 1.0 0.0; to: "button"; } rel2 { relative: 2.0 1.0; to: "button"; } color: 0 0 0 0; } } part { name: "elm.swallow.content"; type: SWALLOW; clip_to: "disclip"; description { state: "default" 0.0; fixed: 1 0; visible: 0; align: 0.0 0.5; 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; visible: 1; aspect: 1.0 1.0; aspect_preference: VERTICAL; } description { state: "disabled" 0.0; inherit: "default" 0.0; } description { state: "disabled_visible" 0.0; inherit: "default" 0.0; visible: 1; aspect: 1.0 1.0; } } part { name: "disclip"; type: RECT; mouse_events: 0; description { state: "default" 0.0; color: 0 0 0 0; } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 0 0 0 0; } } part { name: "disabler"; type: RECT; description { state: "default" 0.0; color: 0 0 0 0; visible: 0; rel1.to: "bg"; rel2.to: "bg"; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 1; } } } programs { program { signal: "mouse,clicked,1"; source: "button"; script { new Float:dx, Float:dy; get_drag(PART:"button", dx, dy); if (!get_int(was_drag)) { if (dx > 0.5) { set_drag(PART:"button", 0.0, 0.0); } else { set_drag(PART:"button", 1.0, 0.0); } if (((get_int(is_rtl) == 1) && (dx <= 0.5)) || (get_int(is_rtl) == 0) && (dx > 0.5)) { if (get_int(check_on)) { emit("elm,action,check,off", ""); emit("elm,action,touch,sound", ""); } } else { if (!get_int(check_on)) { emit("elm,action,check,on", ""); emit("elm,action,touch,sound", ""); } } } } } program { name: "press"; signal: "mouse,down,1"; source: "button"; script { if (get_int(check_on)) { set_state(PART:"button", "on_pressed", 0.0); set_state(PART:"button_handler", "on_pressed", 0.0); set_state(PART:"bg_image", "on_pressed", 0.0); } else { set_state(PART:"button", "off_pressed", 0.0); set_state(PART:"button_handler", "off_pressed", 0.0); set_state(PART:"bg_image", "off_pressed", 0.0); } } } program { name: "unpress"; signal: "mouse,up,1"; source: "button"; script { if (get_int(check_on)) { set_state(PART:"button", "on", 0.0); set_state(PART:"button_handler", "on", 0.0); set_state(PART:"bg_image", "on", 0.0); } else { set_state(PART:"button", "default", 0.0); set_state(PART:"button_handler", "default", 0.0); set_state(PART:"bg_image", "default", 0.0); } } } program { name: "touch_sound"; signal: "elm,action,touch,sound"; source: ""; action: RUN_PLUGIN "touch_sound"; } program { signal: "drag"; source: "button"; script { if (get_int(check_disabled) == 1) return; if (!get_int(is_drag)) emit("elm,action,check,drag,start", ""); set_int(is_drag, 1); } } program { signal: "mouse,down,1"; source: "button"; script { set_int(was_drag, 0); set_int(is_drag, 0); } } program { name: "drag_end"; signal: "mouse,up,1"; source: "button"; script { new Float:dx, Float:dy; get_drag(PART:"button", dx, dy); if (get_int(is_drag)) { if (dx > 0.5) { set_drag(PART:"button", 1.0, 0.0); } else { set_drag(PART:"button", 0.0, 0.0); } if (((get_int(is_rtl) == 1) && (dx <= 0.5)) || (get_int(is_rtl) == 0) && (dx > 0.5)) { if (!get_int(check_on)) { emit("elm,action,check,on", ""); emit("elm,action,touch,sound", ""); } } else { if (get_int(check_on)) { emit("elm,action,check,off", ""); emit("elm,action,touch,sound", ""); } } set_int(was_drag, get_int(is_drag)); set_int(is_drag, 0); emit("elm,action,check,drag,stop", ""); } } } program { name: "check_on"; signal: "elm,state,check,on"; source: "elm"; script { new Float:drag; if (get_int(is_rtl) == 0) { drag = 100.0; } else { drag = 0.0; } set_drag(PART:"button", drag, 0.0); if (get_int(check_disabled) == 0) { set_state(PART:"bg_image", "on_pressed", 0.0); run_program(PROGRAM:"check_show_on_effect"); set_state(PART:"opacity_clip_button", "on", 0.0); run_program(PROGRAM:"check_draw_on_effect"); set_state(PART:"button", "on", 0.0); set_state(PART:"button_handler", "on", 0.0); } else { set_state(PART:"bg_image", "on_disabled", 0.0); set_state(PART:"button", "on_disabled", 0.0); set_state(PART:"button_handler", "on_disabled", 0.0); } set_int(check_on, 1); } } program { name: "check_show_on_effect"; action: STATE_SET "on" 0.0; transition: SIN_FAC 0.25 1.7; target: "bg_image"; } program { name: "check_draw_on_effect"; action: STATE_SET "default" 0.0; transition: LINEAR 0.25; target: "opacity_clip_button"; } program { name: "check_off"; signal: "elm,state,check,off"; source: "elm"; script { new Float:drag; if (get_int(is_rtl) == 0) { drag = 0.0; } else { drag = 100.0; } set_drag(PART:"button", drag, 0.0); if (get_int(check_disabled) == 0) { set_state(PART:"bg_image", "off_pressed", 0.0); run_program(PROGRAM:"check_show_off_effect"); set_state(PART:"opacity_clip_button", "on", 0.0); run_program(PROGRAM:"check_draw_off_effect"); set_state(PART:"button", "default", 0.0); set_state(PART:"button_handler", "default", 0.0); } else { set_state(PART:"bg_image", "off_disabled", 0.0); set_state(PART:"button", "off_disbaled", 0.0); set_state(PART:"button_handler", "off_disbaled", 0.0); } set_int(check_on, 0); } } program { name: "check_show_off_effect"; action: STATE_SET "default" 0.0; transition: SIN_FAC 0.25 1.7; target: "bg_image"; } program { name: "check_draw_off_effect"; action: STATE_SET "default" 0.0; transition: LINEAR 0.25; target: "opacity_clip_button"; } program { name: "icon_show"; signal: "elm,state,icon,visible"; source: "elm"; action: STATE_SET "visible" 0.0; target: "elm.swallow.content"; } program { name: "icon_hide"; signal: "elm,state,icon,hidden"; source: "elm"; action: STATE_SET "default" 0.0; target: "elm.swallow.content"; } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; script { if (get_int(check_on) == 1) { set_state(PART:"button", "on_disabled", 0.0); set_state(PART:"button_handler", "on_disabled", 0.0); set_state(PART:"bg_image", "on_disabled", 0.0); } else { set_state(PART:"button", "off_disabled", 0.0); set_state(PART:"button_handler", "off_disabled", 0.0); set_state(PART:"bg_image", "off_disabled", 0.0); } set_state(PART:"onrect", "disabled", 0.0); set_state(PART:"offrect", "disabled", 0.0); set_state(PART:"disabler", "disabled", 0.0); set_int(check_disabled, 1); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; script { if (get_int(check_on) == 1) { set_state(PART:"button", "on", 0.0); set_state(PART:"button_handler", "on", 0.0); set_state(PART:"bg_image", "on", 0.0); } else { set_state(PART:"button", "default", 0.0); set_state(PART:"button_handler", "default", 0.0); set_state(PART:"bg_image", "default", 0.0); } set_state(PART:"onrect", "default", 0.0); set_state(PART:"offrect", "default", 0.0); set_state(PART:"disabler", "default", 0.0); set_int(check_disabled, 0); } } program { name: "to_rtl"; signal: "edje,state,rtl"; source: "edje"; script { set_int(is_rtl, 1); } } program { name: "to_ltr"; signal: "edje,state,ltr"; source: "edje"; script { set_int(is_rtl, 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; fixed: 1 0; rel1 { to_x: "check"; relative: 1.0 0.0; } rel2 { to_x: "check"; relative: 1.0 1.0; } } description { state: "visible" 0.0; inherit: "default" 0.0; min: CHECK_PADDING_SIZE; max: CHECK_PADDING_SIZE; } } part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; description { state: "default" 0.0; fixed: 1 0; rel1 { relative: 1.0 0.0; to_x: "padding_before_text"; } rel2 { relative: 1.0 1.0; } align: 0.0 0.5; rel2.offset: -7 0; text { style: "check_text_normal"; align: 0.0 0.5; min: 0 1; } } } } programs { program { name: "text_show"; signal: "elm,state,text,visible"; source: "elm"; action: STATE_SET "visible" 0.0; target: "padding_before_text"; } program { name: "text_hide"; signal: "elm,state,text,hidden"; source: "elm"; action: STATE_SET "default" 0.0; target: "padding_before_text"; } } } group { name: "elm/check/base/genlist/select_mode"; images { image: "tw_list_check_ic.png" COMP; image: "tw_list_check_line.png" COMP; } script { public check_state; public check_disabled; public check_visible; } parts { part { name: "check"; clip_to: "sequence_clip"; scale: 1; description { state: "default" 0.0; min: CHECK_SIZE; max: CHECK_SIZE; image.normal: "tw_list_check_ic.png"; visible: 0; } description { state: "on" 0.0; inherit: "default" 0.0; visible: 1; color: 115 191 15 255; /*(Changeable UI) color_class: "B0261";*/ } description { state: "pressed" 0.0; inherit: "on" 0.0; } description { state: "disabled" 0.0; inherit: "on" 0.0; } } part { name: "check_line"; clip_to: "sequence_clip"; scale: 1; description { state: "default" 0.0; min: CHECK_SIZE; max: CHECK_SIZE; image.normal: "tw_list_check_line.png"; visible: 0; } description { state: "on" 0.0; inherit: "default" 0.0; visible: 1; color: 229 229 229 255; /*(Changeable UI) color_class: "B0262";*/ } description { state: "pressed" 0.0; inherit: "on" 0.0; } description { state: "disabled" 0.0; inherit: "on" 0.0; } } part { name: "sequence_clip"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1.to: "check"; rel2 { relative: 0.0 1.0; to: "check"; } color: 255 255 255 255; } description { state: "visible" 0.0; inherit: "default" 0.0; rel2 { relative: 1.0 1.0; to: "check"; } } } part { name: "event"; scale: 1; type: RECT; description { state: "default" 0.0; 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:"play_sample"); } } program { name: "play_sample"; 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:"check_line", "on", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"check_line", "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:"check_line", "on", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"check_line", "default", 0.0); } } } program { name: "pressed"; signal: "mouse,down,1"; source: "event"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) { set_state(PART:"check", "pressed", 0.0); set_state(PART:"check_line", "pressed", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"check_line", "default", 0.0); } } } program { name: "pressed2"; signal: "elm,state,mouse,down"; source: "elm"; script { if (get_int(check_disabled) == 1) return; if (get_int(check_state) == 1) { set_state(PART:"check", "pressed", 0.0); set_state(PART:"check_line", "pressed", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"check_line", "default", 0.0); } } } program { name: "check_on"; signal: "elm,state,check,on"; source: "elm"; script { if (get_int(check_disabled) == 1) { set_state(PART:"check", "disabled", 0.0); set_state(PART:"check_line", "disabled", 0.0); set_state(PART:"sequence_clip", "visible", 0.0); } else if (get_int(check_visible) == 1) { run_program(PROGRAM:"check_show_effect"); run_program(PROGRAM:"check_draw_effect"); } else if (get_int(check_visible) == 0) { set_state(PART:"check", "on", 0.0); set_state(PART:"check_line", "on", 0.0); set_state(PART:"sequence_clip", "visible", 0.0); } set_int(check_state, 1); } } program { name: "check_off"; signal: "elm,state,check,off"; source: "elm"; script { set_state(PART:"check", "default", 0.0); set_state(PART:"check_line", "default", 0.0); set_state(PART:"sequence_clip", "default", 0.0); set_int(check_state, 0); } } program { name: "check_show_effect"; action: STATE_SET "on" 0.0; transition: CUBIC_BEZIER 0.3 0 0 0.1 1; target: "check"; target: "check_line"; } program { name: "check_draw_effect"; action: STATE_SET "visible" 0.0; transition: CUBIC_BEZIER 0.3 0 0 0.1 1; target: "sequence_clip"; } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; script { if (get_int(check_state) == 1) { set_state(PART:"check", "disabled", 0.0); set_state(PART:"check_line", "disabled", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"check_line", "default", 0.0); } set_int(check_disabled, 1); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; script { if (get_int(check_state) == 1) { set_state(PART:"check", "on", 0.0); set_state(PART:"check_line", "on", 0.0); } else { set_state(PART:"check", "default", 0.0); set_state(PART:"check_line", "default", 0.0); } set_int(check_disabled, 0); } } } }