/* * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved * * PROPRIETARY/CONFIDENTIAL * * This software is the confidential and proprietary information of SAMSUNG * ELECTRONICS ("Confidential Information"). You agree and acknowledge that this * software is owned by Samsung and you shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the license * agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no * representations or warranties about the suitability of the software, either * express or implied, including but not limited to the implied warranties of * merchantability, fitness for a particular purpose, or non-infringement. * SAMSUNG shall not be liable for any damages suffered by licensee arising out * of or releated to this software. * */ #define RADIO_STATE_DEFAULT 0 #define RADIO_STATE_VISIBLE 1 #define RADIO_STATE_DISABLED_VISIBLE 2 #define RADIO_STATE_DISABLED 3 styles { style { name: "radio_label_textblock_style"; base: "font=SLP:style=Medium font_size="RADIO_STYLE_DEFAULT_FONT_SIZE_INC" color=#ffffff wrap=char text_class=slp_medium"; tag: "br" "\n"; tag: "ps" "ps"; tag: "hilight" "+ font=SLP:style=Bold"; tag: "b" "+ font=SLP:style=Bold"; tag: "whitecolor" "+ color=#ffffff"; tag: "tab" "\t"; } } //////////////////////////////////////////////////////////////////////////////////////// #define RADIO_STYLE_DEFAULT(style_name, min_width, min_height) \ group { name: "elm/radio/base/"style_name; \ images { \ image: "00_button_radio_normal1.png" COMP; \ image: "00_button_radio_normal2.png" COMP; \ } \ parts { \ part { name: "back_bg"; \ type: RECT; \ scale: 1; \ description { state: "default" 0.0; \ rel2.relative: 0.0 1.0; \ align: 0 0.5; \ min: min_width min_height; \ fixed: 1 0; \ color: 0 0 0 0; \ } \ } \ part { name: "bg"; \ scale: 1; \ type: RECT; \ description { state: "default" 0.0; \ rel1.to: "back_bg"; \ rel2.to: "back_bg"; \ fixed: 1 1; \ min: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \ max: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \ color: 0 0 0 0; \ } \ } \ part { name: "radio"; \ mouse_events: 0; \ scale: 1; \ description { state: "default" 0.0; \ rel1 { \ to: "bg"; \ offset: 0 0; \ } \ rel2 { \ to: "bg"; \ offset: 0 0; \ } \ color: 255 255 255 255; \ image.normal: "00_button_radio_normal2.png"; \ } \ description { state: "visible" 0.0; \ inherit: "default" 0.0; \ image.normal: "00_button_radio_normal1.png"; \ color: 255 255 255 255; \ } \ description { state: "disabled" 0.0; \ inherit: "default" 0.0; \ color: 255 255 255 128; \ } \ description { state: "disabled_visible" 0.0; \ inherit: "visible" 0.0; \ color: 255 255 255 128; \ } \ } \ part { name: "elm.swallow.content"; \ type: SWALLOW; \ description { state: "default" 0.0; \ fixed: 1 0; \ visible: 0; \ color: 255 255 255 255; \ align: 0.0 0.5; \ rel1 { \ to_x: "bg"; \ relative: 1.0 0.0; \ offset: 1 1; \ } \ rel2 { \ to_x: "bg"; \ offset: 2 -2; \ } \ } \ description { state: "visible" 0.0; \ inherit: "default" 0.0; \ fixed: 1 1; \ visible: 1; \ aspect: 1.0 1.0; \ aspect_preference: VERTICAL; \ } \ description { state: "disabled" 0.0; \ inherit: "default" 0.0; \ color: 128 128 128 128; \ } \ description { state: "disabled_visible" 0.0; \ inherit: "default" 0.0; \ color: 128 128 128 128; \ fixed: 1 1; \ visible: 1; \ aspect: 1.0 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; \ offset: 1 1; \ to_x: "elm.swallow.content"; \ } \ rel2 { \ relative: 1.0 0.5; \ offset: -2 -2; \ } \ color: 255 255 255 255; \ align: 0.0 0.5; \ text { \ style: "radio_label_textblock_style"; \ min: 0 0; \ } \ color: RADIO_DEFAULT_TEXT_NORMAL_COLOR_INC; \ } \ 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.min: 1 1; \ color: RADIO_DEFAULT_TEXT_DISABLED_COLOR_INC; \ } \ } \ part { name: "over1"; \ type: RECT; \ ignore_flags: ON_HOLD; \ description { state: "default" 0.0; \ color: 0 0 0 0; \ } \ } \ part { name: "over2"; \ type: RECT; \ repeat_events:1; \ description { state: "default" 0.0; \ color: 0 0 0 0; \ } \ } \ part { name: "disabler"; \ type: RECT; \ description { state: "default" 0.0; \ visible: 0; \ } \ description { state: "disabled" 0.0; \ inherit: "default" 0.0; \ visible: 1; \ color: 0 0 0 0; \ } \ } \ } \ programs { \ program { name: "click"; \ signal: "mouse,clicked,1"; \ source: "over1"; \ action: SIGNAL_EMIT "elm,action,radio,toggle" ""; \ } \ program { name: "radio_on"; \ signal: "elm,state,radio,on"; \ source: "elm"; \ script { \ set_state(PART:"radio", "visible", 0.0); \ } \ } \ program { name: "radio_off"; \ signal: "elm,state,radio,off"; \ source: "elm"; \ script { \ set_state(PART:"radio", "default", 0.0); \ } \ } \ 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.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"; \ action: STATE_SET "disabled" 0.0; \ target: "disabler"; \ after: "disable_text"; \ } \ program { name: "disable_text"; \ script { \ new st[31]; \ new Float:vl; \ get_state(PART:"elm.text", st, 30, vl); \ if (!strcmp(st, "visible")) \ set_state(PART:"elm.text", "disabled_visible", 0.0); \ else \ set_state(PART:"elm.text", "disabled", 0.0); \ get_state(PART:"elm.swallow.content", st, 30, vl); \ if (!strcmp(st, "visible")) \ set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \ else \ set_state(PART:"elm.swallow.content", "disabled", 0.0); \ get_state(PART:"radio", st, 30, vl); \ if (!strcmp(st, "visible")) \ set_state(PART:"radio", "disabled_visible", 0.0); \ else \ set_state(PART:"radio", "disabled", 0.0); \ } \ } \ program { name: "enable"; \ signal: "elm,state,enabled"; \ source: "elm"; \ action: STATE_SET "default" 0.0; \ target: "disabler"; \ after: "enable_text"; \ } \ program { name: "enable_text"; \ script { \ new st[31]; \ new Float:vl; \ get_state(PART:"elm.text", st, 30, vl); \ if (!strcmp(st, "disabled_visible")) \ set_state(PART:"elm.text", "visible", 0.0); \ else \ set_state(PART:"elm.text", "default", 0.0); \ get_state(PART:"elm.swallow.content", st, 30, vl); \ if (!strcmp(st, "disabled_visible")) \ set_state(PART:"elm.swallow.content", "visible", 0.0); \ else \ set_state(PART:"elm.swallow.content", "default", 0.0); \ get_state(PART:"radio", st, 30, vl); \ if (!strcmp(st, "disabled_visible")) \ set_state(PART:"radio", "visible", 0.0); \ else \ set_state(PART:"radio", "default", 0.0); \ } \ } \ } \ } /////////////////////////////////////////////////////////////////////////////////////// RADIO_STYLE_DEFAULT("default", RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC) /////////////////////////////////////////////////////////////////////////////////////// RADIO_STYLE_DEFAULT("default/extended", RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC) /////////////////////////////////////////////////////////////////////////////////////// #undef RADIO_STATE_DEFAULT #undef RADIO_STATE_VISIBLE #undef RADIO_STATE_DISABLED_VISIBLE #undef RADIO_STATE_DISABLED