/* * 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://floralicense.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. */ #define TEXT_SLIDE_DURATION 10 styles { style { name: "textblock_style"; base: "font=SLP:style=Medium font_size="LABEL_FONT_SIZE_INC" color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC" text_class=slp_medium"; tag: "br" "\n"; tag: "ps" "ps"; tag: "hilight" "+ font=SLP:style=Bold"; tag: "b" "+ font=SLP:style=Bold"; tag: "tab" "\t"; } } /* label doesn't use it */ styles { style { name: "textblock_charwrap_style"; base: "font=SLP:style=Medium font_size="LABEL_FONT_SIZE_INC" color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC" text_class=slp_medium"; tag: "br" "\n"; tag: "ps" "ps"; tag: "hilight" "+ font=SLP:style=Bold"; tag: "b" "+ font=SLP:style=Bold"; tag: "tab" "\t"; } } collections { group { name: "elm/label/base/default"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; parts { part { name: "label.text.clip"; type: RECT; description { state: "default" 0.0; } } part { name: "elm.text"; type: TEXTBLOCK; scale: 1; clip_to: "label.text.clip"; description { state: "default" 0.0; text { style: "textblock_style"; min: 0 1; align: 0.0 0.0; } } } } } /* default label doesn't use it */ group { name: "elm/label/base_wrap/default"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; parts { part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 1; scale: 1; multiline: 1; description { state: "default" 0.0; text { style: "textblock_style"; min: 0 1; align: 0.0 0.0; } } description { state: "charwrap_mode" 0.0; text { style: "textblock_charwrap_style"; min: 0 1; align: 0.0 0.0; } } } } programs { program { name: "default_on"; signal: "elm,state,default"; source: "elm"; action: STATE_SET "default" 0.0; target: "elm.text"; } program { name: "charwrap_on"; signal: "elm,state,charwrap"; source: "elm"; action: STATE_SET "charwrap_mode" 0.0; target: "elm.text"; } } // end programs } // end group /* default label doesn't use it */ group { name: "elm/label/base_wrap_ellipsis/default"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; parts { part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; multiline: 1; description { state: "default" 0.0; // FIXME : fixed for multiline ellipsis. // does it need to make another ellipsis style? fixed: 0 1; text { style: "textblock_style"; min: 0 1; align: 0.0 0.0; } } description { state: "charwrap_mode" 0.0; // FIXME : fixed for multiline ellipsis. // does it need to make another ellipsis style? fixed: 0 1; text { style: "textblock_charwrap_style"; min: 0 1; align: 0.0 0.0; } } } } programs { program { name: "default_on"; signal: "elm,state,default"; source: "elm"; action: STATE_SET "default" 0.0; target: "elm.text"; } program { name: "charwrap_on"; signal: "elm,state,charwrap"; source: "elm"; action: STATE_SET "charwrap_mode" 0.0; target: "elm.text"; } } // end programs } // end group group { name: "elm/label/base/marker"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; styles { style { name: "textblock_style2"; base: "font=SLP:style=Bold font_size=14 align=center color=#fff wrap=word text_class=slp_bold"; tag: "br" "\n"; tag: "ps" "ps"; tag: "hilight" "+ color=#ffff"; tag: "b" "+ color=#ffff"; tag: "tab" "\t"; } } parts { part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; description { state: "default" 0.0; text { style: "textblock_style2"; min: 1 1; align: 0.0 0.0; } } } } } /* default label doesn't use it */ group { name: "elm/label/base_wrap/marker"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; parts { part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; multiline: 1; description { state: "default" 0.0; text { style: "textblock_style2"; min: 1 1; align: 0.0 0.0; } } } } } group { name: "elm/label/base/titlebar/default"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; parts { part { name: "elm.text"; type: TEXT; effect: SHADOW; mouse_events: 0; scale: 1; description { state: "default" 0.0; text { font: "SLP:style=Bold"; size: 28; min: 0 0; align: 0.0 0.5; text: "slp"; } color2: 0 0 0 255; } } } } group { name: "elm/label/base/titlebar/header"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; styles { style { name: "header_textblock_style"; base: "font=SLP:style=Medium font_size=34 color=#ffffff wrap=mixed"; tag: "br" "\n"; tag: "ps" "ps"; tag: "tab" "\t"; tag: "em" "+ font=SLP:style=Oblique"; tag: "b" "+ font=SLP:style=Bold"; tag: "link" "+ color=#800 underline=on underline_color=#8008"; tag: "hilight" "+ font=SLP:style=Bold"; } } parts { part { name: "elm.text"; type: TEXT; effect: SHADOW; mouse_events: 0; scale: 1; description { state: "default" 0.0; text { font: "SLP:style=Medium"; size: 34; min: 0 0; align: 0.0 0.5; text: "slp"; } color2: 0 0 0 255; } } } } group { name: "elm/label/base/slide_long"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; script { public g_duration, g_stopslide, g_timer_id, g_anim_id; public message(Msg_Type:type, id, ...) { if ((type == MSG_FLOAT_SET) && (id == 0)) { new Float:duration; duration = getfarg(2); set_float(g_duration, duration); } } public slide_to_end_anim(val, Float:pos) { new stopflag; new id; stopflag = get_int(g_stopslide); if (stopflag == 1) return; set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0); if (pos >= 1.0) { id = timer(0.5, "slide_to_begin", 1); set_int(g_timer_id, id); } } public slide_to_end() { new stopflag; new id; new Float:duration; stopflag = get_int(g_stopslide); if (stopflag == 1) return; duration = get_float(g_duration); id = anim(duration, "slide_to_end_anim", 1); set_int(g_anim_id, id); } public slide_to_begin() { new stopflag; new id; stopflag = get_int(g_stopslide); if (stopflag == 1) return; set_state(PART:"elm.text", "slide_begin", 0.0); id = timer(0.5, "slide_to_end", 1); set_int(g_timer_id, id); } public start_slide() { set_int(g_stopslide, 0); set_state(PART:"elm.text", "slide_begin", 0.0); slide_to_end(); } public stop_slide() { new id; set_int(g_stopslide, 1); id = get_int(g_anim_id); cancel_anim(id); id = get_int(g_timer_id); cancel_timer(id); set_state(PART:"elm.text", "default", 0.0); } } parts { part { name: "label.text.clip"; type: RECT; description { state: "default" 0.0; } } part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; clip_to: "label.text.clip"; description { state: "default" 0.0; rel1.relative: 0.0 0.0; rel2.relative: 1.0 1.0; align: 0.0 0.0; text { style: "textblock_style"; min: 1 1; align: 0.0 0.0; } } description { state: "slide_end" 0.0; inherit: "default" 0.0; rel1.relative: 0.0 0.0; rel2.relative: 0.0 1.0; align: 1.0 0.0; } description { state: "slide_begin" 0.0; inherit: "default" 0.0; rel1.relative: 1.0 0.0; rel2.relative: 1.0 1.0; align: 0.0 0.0; } } } programs { program { name: "start_slide"; source: "elm"; signal: "elm,state,slide,start"; script { start_slide(); } } program { name: "stop_slide"; source: "elm"; signal: "elm,state,slide,stop"; script { stop_slide(); } } } } group { name: "elm/label/base/slide_short"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; script { public g_duration, g_stopslide, g_timer_id, g_anim_id; public message(Msg_Type:type, id, ...) { if ((type == MSG_FLOAT_SET) && (id == 0)) { new Float:duration; duration = getfarg(2); set_float(g_duration, duration); } } public slide_to_end_anim(val, Float:pos) { new stopflag; new id; stopflag = get_int(g_stopslide); if (stopflag == 1) return; set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0); if (pos >= 1.0) { id = timer(0.5, "slide_to_begin", 1); set_int(g_timer_id, id); } } public slide_to_end() { new stopflag; new id; new Float:duration; stopflag = get_int(g_stopslide); if (stopflag == 1) return; duration = get_float(g_duration); id = anim(duration, "slide_to_end_anim", 1); set_int(g_anim_id, id); } public slide_to_begin() { new stopflag; new id; stopflag = get_int(g_stopslide); if (stopflag == 1) return; set_state(PART:"elm.text", "slide_begin", 0.0); id = timer(0.5, "slide_to_end", 1); set_int(g_timer_id, id); } public start_slide() { set_int(g_stopslide, 0); set_state(PART:"elm.text", "slide_begin", 0.0); slide_to_end(); } public stop_slide() { new id; set_int(g_stopslide, 1); id = get_int(g_anim_id); cancel_anim(id); id = get_int(g_timer_id); cancel_timer(id); set_state(PART:"elm.text", "default", 0.0); } } parts { part { name: "label.text.clip"; type: RECT; description { state: "default" 0.0; } } part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; clip_to: "label.text.clip"; description { state: "default" 0.0; rel1.relative: 0.0 0.0; rel2.relative: 1.0 1.0; align: 0.0 0.0; text { style: "textblock_style"; min: 1 1; align: 0.0 0.0; } } description { state: "slide_end" 0.0; inherit: "default" 0.0; rel1.relative: 1.0 0.0; rel2.relative: 1.0 1.0; align: 1.0 0.0; } description { state: "slide_begin" 0.0; inherit: "default" 0.0; rel1.relative: 0.0 0.0; rel2.relative: 0.0 1.0; align: 0.0 0.0; } } } programs { program { name: "start_slide"; source: "elm"; signal: "elm,state,slide,start"; script { start_slide(); } } program { name: "stop_slide"; source: "elm"; signal: "elm,state,slide,stop"; script { stop_slide(); } } } } group { name: "elm/label/base/slide_bounce"; data.item: "default_font_size" LABEL_FONT_SIZE_INC; data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC; data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC; script { public g_duration, g_stopslide, g_timer_id, g_anim_id; public message(Msg_Type:type, id, ...) { if ((type == MSG_FLOAT_SET) && (id == 0)) { new Float:duration; duration = getfarg(2); set_float(g_duration, duration); } } public slide_to_end_anim(val, Float:pos) { new stopflag; new id; stopflag = get_int(g_stopslide); if (stopflag == 1) return; set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0); if (pos >= 1.0) { id = timer(0.5, "slide_to_begin", 1); set_int(g_timer_id, id); } } public slide_to_end() { new stopflag; new id; new Float:duration; stopflag = get_int(g_stopslide); if (stopflag == 1) return; duration = get_float(g_duration); id = anim(duration, "slide_to_end_anim", 1); set_int(g_anim_id, id); } public slide_to_begin_anim(val, Float:pos) { new stopflag; new id; stopflag = get_int(g_stopslide); if (stopflag == 1) return; set_tween_state(PART:"elm.text", pos, "slide_end", 0.0, "slide_begin", 0.0); if (pos >= 1.0) { id = timer(0.5, "slide_to_end", 1); set_int(g_timer_id, id); } } public slide_to_begin() { new stopflag; new id; new Float:duration; stopflag = get_int(g_stopslide); if (stopflag == 1) return; duration = get_float(g_duration); id = anim(duration, "slide_to_begin_anim", 1); set_int(g_anim_id, id); } public start_slide() { set_int(g_stopslide, 0); set_state(PART:"elm.text", "slide_begin", 0.0); slide_to_end(); } public stop_slide() { new id; set_int(g_stopslide, 1); id = get_int(g_anim_id); cancel_anim(id); id = get_int(g_timer_id); cancel_timer(id); set_state(PART:"elm.text", "default", 0.0); } } parts { part { name: "label.text.clip"; type: RECT; description { state: "default" 0.0; } } part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; clip_to: "label.text.clip"; description { state: "default" 0.0; rel1.relative: 0.0 0.0; rel2.relative: 1.0 1.0; align: 0.0 0.0; text { style: "textblock_style"; min: 1 1; align: 0.0 0.0; } } description { state: "slide_end" 0.0; inherit: "default" 0.0; rel1.relative: 1.0 0.0; rel2.relative: 1.0 1.0; align: 1.0 0.0; } description { state: "slide_begin" 0.0; inherit: "default" 0.0; rel1.relative: 0.0 0.0; rel2.relative: 0.0 1.0; align: 0.0 0.0; } } } programs { program { name: "start_slide"; source: "elm"; signal: "elm,state,slide,start"; script { start_slide(); } } program { name: "stop_slide"; source: "elm"; signal: "elm,state,slide,stop"; script { stop_slide(); } } } } /*note:button*/ } //end file