/* * * Copyright 2012 Samsung Electronics Co., Ltd * * Licensed under the Flora License, Version 1.1 (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. */ //base 690x850 //HD size 720x1280 #ifndef _RATIO_ #define _RATIO_ #define R_X (480.0/720.0) #define R_Y (800.0/1280.0) #endif #define HEIGHT_OF_WDAY (47.0*R_Y) #define HEIGHT_OF_WDAY_LINE (3.0*R_Y) #define HEIGHT_OF_DAY_BLOCK (107.0*R_Y) #define WIDTH_OF_DAY_BLOCK (103.0*R_X) #define HEIGHT_OF_DAY_CHECK (32.0*R_Y) #define WIDTH_OF_DAY_CHECK (32.0*R_X) #define WIDTH_OF_DAY (102*R_X) #define WDAY_LEFT_OFFSET (8*R_X) #define DAY_LEFT_OFFSET (10*R_X) #define WIDTH_OF_BG (100) #define HEIGHT_OF_BG (100) #define WIDTH_OF_BG_L (58) #define HEIGHT_OF_BG_L (58) #define WIDTH_OF_WNUMBER (48) #define WIDTH_OF_WNUMBER_L (38) #define WD(_pos) \ part { name, "wday/"#_pos"/base"; \ type, RECT; \ description { \ state, "default" 0.0; \ rel1 { \ relative: (_pos % 7 / 7) 0; \ to, "wday/base"; \ } \ rel2 { \ relative: (_pos % 7 / 7 + 1 / 7) 1; \ to, "wday/base"; \ } \ color, 0 0 0 0; \ } \ } \ part { name, "wday/"#_pos"/text"; \ type, TEXT; \ mouse_events, 0; \ scale, 1; \ description { \ state, "default" 0.0; \ rel1.to, "wday/"#_pos"/base"; \ rel2.to, "wday/"#_pos"/base"; \ color, COLOR_OF_WEEK_DAY_TEXT_FOR_MONTH_CAL; \ text { \ font, "SLP:style=Medium"; \ size, 26; \ align, 0.5 0.5; \ } \ } \ description { \ state, "sunday" 0.0; \ inherit, "default" 0.0; \ color, COLOR_OF_SUNDAY_TEXT_FOR_MONTH_CAL; \ } \ description { \ state, "satday" 0.0; \ inherit, "default" 0.0; \ color, COLOR_OF_SATDAY_TEXT_FOR_MONTH_CAL; \ } \ } \ programs { \ program { name, "wday/"#_pos"/weekday"; \ signal, "weekday,"#_pos; \ source, "prog"; \ action, STATE_SET "default" 0.0; \ target, "wday/"#_pos"/text"; \ } \ program { name, "wday/"#_pos"/sunday"; \ signal, "sunday,"#_pos; \ source, "prog"; \ action, STATE_SET "sunday" 0.0; \ target, "wday/"#_pos"/text"; \ } \ program { name, "wday/"#_pos"/satday"; \ signal, "satday,"#_pos; \ source, "prog"; \ action, STATE_SET "satday" 0.0; \ target, "wday/"#_pos"/text"; \ } \ } // day block #define DB(_line, _pos, _vert) \ part { name, "db/"#_pos"/base"; \ type, RECT; \ ignore_flags, ON_HOLD; \ description { \ state, "default" 0.0; \ rel1 { \ relative, (_pos % 7 / 7) \ (_line / 6); \ to_x, "day/base"; \ to_y, "day/base"; \ } \ rel2 { \ relative, 0 \ (_line / 6 + 1 / 6); \ to_x, "vl/"#_vert; \ to_y, "day/base"; \ } \ color, 0 0 0 0; \ } \ } \ part { name, "db/"#_pos"/img_bg"; \ type, RECT; \ mouse_events, 0; \ description { \ state, "default" 0.0; \ min: WIDTH_OF_BG HEIGHT_OF_BG; \ max: WIDTH_OF_BG HEIGHT_OF_BG; \ fixed: 1 1; \ align: 0.5 0.5; \ rel1 { \ relative, 0.0 0.0;\ to_x, "db/"#_pos"/base"; \ to_y, "db/"#_pos"/base"; \ } \ rel2 { \ relative, 1.0 1.0;\ to_x, "db/"#_pos"/base"; \ to_y, "db/"#_pos"/base"; \ } \ color, 0 0 0 0; \ } \ } \ part { name, "db/"#_pos"/dim_bg"; \ mouse_events, 0; \ scale, 1; \ description { \ state, "default" 0.0; \ rel1.to, "db/"#_pos"/img_bg"; \ rel2.to, "db/"#_pos"/img_bg"; \ image { \ normal, CALENDAR_MONTH_VIEW_DIM; \ border, 3 3 3 3; \ border_scale,1 ; \ } \ visible, 1; \ } \ description { \ state, "hide" 0.0; \ inherit, "default" 0.0; \ visible, 0; \ } \ } \ part { name, "db/"#_pos"/today"; \ mouse_events, 0; \ scale, 1; \ description { \ state, "default" 0.0; \ rel1.to, "db/"#_pos"/img_bg"; \ rel2.to, "db/"#_pos"/img_bg"; \ image { \ normal, CALENDAR_TODAY_ICON; \ border, 3 3 3 3; \ border_scale,1 ; \ } \ visible, 0; \ } \ description { \ state, "today" 0.0; \ inherit, "default" 0.0; \ visible, 1; \ } \ } \ part { name, "db/"#_pos"/sel"; \ mouse_events, 0; \ scale, 1; \ description { \ state, "default" 0.0; \ rel1.to, "db/"#_pos"/img_bg"; \ rel2.to, "db/"#_pos"/img_bg"; \ image { \ normal, CALENDAR_SELSECTED; \ border, 3 3 3 3; \ border_scale,1 ; \ } \ visible, 0; \ } \ description { \ state, "today" 0.0; \ rel1.to, "db/"#_pos"/img_bg"; \ rel2.to, "db/"#_pos"/img_bg"; \ image { \ normal, CALENDAR_SELSECTED_TODAY; \ border, 3 3 3 3; \ border_scale,1 ; \ } \ visible, 1; \ } \ description { \ state, "selected" 0.0; \ inherit, "default" 0.0; \ visible, 1; \ } \ } \ part { name, "db/"#_pos"/bg"; \ mouse_events, 0; \ scale, 1; \ description { \ state, "default" 0.0; \ rel1.to, "db/"#_pos"/base"; \ rel2 { \ offset, 0 0; \ to, "db/"#_pos"/base"; \ } \ image.normal, CALENDAR_WEEK_VIEW_PRESS; \ visible, 0; \ } \ description { \ state, "selected" 0.0; \ inherit, "default" 0.0; \ visible, 1; \ } \ } \ part { name, "db/"#_pos"/text"; \ type, TEXT; \ mouse_events, 0; \ scale, 1; \ description { \ state, "default" 0.0; \ rel1.to, "db/"#_pos"/base"; \ rel2.to, "db/"#_pos"/base"; \ text { \ font, "SLP:style=Regular"; \ size, 52; \ align, 0.5 0.5; \ } \ color, COLOR_OF_BLOCK_DEFAULT_TEXT_FOR_MONTH_CAL; \ } \ description { \ state, "sunday" 0.0; \ inherit, "default" 0.0; \ color, COLOR_OF_BLOCK_SUNDAY_TEXT_FOR_MONTH_CAL; \ } \ description { \ state, "satday" 0.0; \ inherit, "default" 0.0; \ color, COLOR_OF_BLOCK_SATDAY_TEXT_FOR_MONTH_CAL; \ } \ description { \ state, "disabled" 0.0; \ inherit, "default" 0.0; \ color, COLOR_OF_BLOCK_DISABLEDAY_TEXT_FOR_MONTH_CAL; \ } \ description { \ state, "selected" 0.0; \ inherit, "default" 0.0; \ color, COLOR_OF_BLOCK_SELECTED_TEXT_FOR_MONTH_CAL; \ } \ description { \ state, "today" 0.0; \ inherit, "default" 0.0; \ color, COLOR_OF_BLOCK_SELECTED_TEXT_FOR_MONTH_CAL; \ } \ } \ part { name, "db/"#_pos"/block"; \ description { \ state, "default" 0.0; \ rel1.to, "db/"#_pos"/base"; \ rel2.to, "db/"#_pos"/base"; \ color, 0 0 0 0; \ visible, 0; \ } \ description { \ state, "disabled" 0.0; \ inherit, "default" 0.0; \ visible, 1; \ } \ } \ programs { \ program { name, "db/"#_pos"/go_up"; \ signal, "up,"_pos; \ source, "prog"; \ action, STATE_SET "default" 0.0; \ target, "db/"#_pos"/bg"; \ } \ program { name, "db/"#_pos"/down"; \ signal, "mouse,down,1"; \ source, "db/"#_pos"/base"; \ action, SIGNAL_EMIT "dn,"_pos "cal"; \ } \ program { name, "db/"#_pos"/up"; \ signal, "mouse,up,1"; \ source, "db/"#_pos"/base"; \ action, SIGNAL_EMIT "up,"_pos "cal"; \ } \ program { name, "db/"#_pos"/select"; \ signal, "select,"#_pos; \ source, "prog"; \ action, STATE_SET "selected" 0.0; \ target, "db/"#_pos"/sel"; \ target, "db/"#_pos"/text"; \ } \ program { name, "db/"#_pos"/unselect"; \ signal, "unselect,"#_pos; \ source, "prog"; \ action, STATE_SET "default" 0.0; \ target, "db/"#_pos"/sel"; \ } \ program { name, "db/"#_pos"/select_today"; \ signal, "select,today,"#_pos; \ source, "prog"; \ action, STATE_SET "today" 0.0; \ target, "db/"#_pos"/sel"; \ target, "db/"#_pos"/text"; \ } \ program { name, "db/"#_pos"/set_today"; \ signal, "today,"#_pos; \ source, "prog"; \ action, STATE_SET "today" 0.0; \ target, "db/"#_pos"/today"; \ } \ program { name, "db/"#_pos"/unset_today"; \ signal, "notoday,"#_pos; \ source, "prog"; \ action, STATE_SET "default" 0.0; \ target, "db/"#_pos"/today"; \ } \ program { name, "db/"#_pos"/weekday"; \ signal, "weekday,"#_pos; \ source, "prog"; \ action, STATE_SET "default" 0.0; \ target, "db/"#_pos"/text"; \ } \ program { name, "db/"#_pos"/sunday"; \ signal, "sunday,"#_pos; \ source, "prog"; \ action, STATE_SET "sunday" 0.0; \ target, "db/"#_pos"/text"; \ } \ program { name, "db/"#_pos"/satday"; \ signal, "satday,"#_pos; \ source, "prog"; \ action, STATE_SET "satday" 0.0; \ target, "db/"#_pos"/text"; \ } \ program { name, "db/"#_pos"/disable"; \ signal, "disable,"#_pos; \ source, "prog"; \ action, STATE_SET "disabled" 0.0; \ target, "db/"#_pos"/text"; \ target, "db/"#_pos"/block"; \ } \ program { name, "db/"#_pos"/enable"; \ signal, "enable,"#_pos; \ source, "prog"; \ action, STATE_SET "default" 0.0; \ target, "db/"#_pos"/block"; \ } \ program { name, "db/"#_pos"/show_count"; \ signal, "show_count,"#_pos; \ source, "prog"; \ action, STATE_SET "default" 0.0; \ target, "db/"#_pos"/dim_bg"; \ } \ program { name, "db/"#_pos"/hide_count"; \ signal, "hide_count,"#_pos; \ source, "prog"; \ action, STATE_SET "hide" 0.0; \ target, "db/"#_pos"/dim_bg"; \ } \ } // vertical line #define VL(_pos) \ part { name, "vl/"#_pos; \ type, RECT; \ description { \ state, "default" 0.0; \ rel1 { \ relative, (_pos / 7) 0; \ offset, 0 -1; \ to, "day/base"; \ } \ rel2 { \ relative, (_pos / 7) 1; \ offset, 0 -1; \ to, "day/base"; \ } \ color, 0 0 0 0; \ } \ } #define VL_W(_pos) \ part { name, "vl_w/"#_pos; \ type, RECT; \ description { \ state, "default" 0.0; \ rel1 { \ relative, (_pos / 7) 0; \ offset, 0 -1; \ to, "wday/base"; \ } \ rel2 { \ relative, (_pos / 7) 1; \ offset, 0 -1; \ to, "wday/base"; \ } \ color, 0 0 0 0; \ } \ } // horizontal line #define HL(_pos) \ part { name, "hl/"#_pos; \ type, RECT; \ description { \ state, "default" 0.0; \ rel1 { \ relative, 0 (_pos / 6); \ to, "day/base"; \ } \ rel2 { \ relative, 1 (_pos / 6); \ offset, -1 0; \ to, "day/base"; \ } \ color, 0 0 0 0; \ } \ } #define WNHL(_pos) \ part { name, "weeknumber/hl/"#_pos; \ type, RECT; \ description { \ state, "default" 0.0; \ rel1 { \ relative, 0 (_pos / 6); \ to, "weeknumber/day/base"; \ } \ rel2 { \ relative, 1 (_pos / 6); \ offset, -1 0; \ to, "weeknumber/day/base"; \ } \ color, 0 0 0 0; \ } \ } #define WNUMBER(_line) \ part { name, "wn/"#_line"/base"; \ type, RECT; \ ignore_flags, ON_HOLD; \ description { \ state, "default" 0.0; \ rel1 { \ relative, 0 \ (_line / 6); \ to_x, "weeknumber/day/base"; \ to_y, "weeknumber/day/base"; \ } \ rel2 { \ relative, 1 \ (_line / 6 + 1 / 6); \ to_x, "weeknumber/day/base"; \ to_y, "weeknumber/day/base"; \ } \ color, 0 0 0 0; \ } \ } \ part { name, "wn/"#_line"/text_rect"; \ type, RECT; \ mouse_events, 0; \ description { \ state, "default" 0.0; \ rel1.to, "wn/"#_line"/base"; \ rel2 { \ relative, 1 1; \ to, "wn/"#_line"/base"; \ } \ visible, 0; \ } \ } \ part { name, "wn/"#_line"/text"; \ type, TEXT; \ mouse_events, 0; \ scale, 1; \ description { \ state, "default" 0.0; \ rel1.to, "wn/"#_line"/text_rect"; \ rel2.to, "wn/"#_line"/text_rect"; \ text { \ font, "SLP:style=Regular"; \ size, 32; \ align, 0.5 0.5; \ } \ color, COLOR_OF_WEEK_NUMBER_TEXT_FOR_MONTH_CAL; \ } \ } group { name, "main/month/cal"; script { public edge_timer; public timer2(val) { emit("do-hide-vshadow", ""); set_int(edge_timer, 0); return 0; } } images { image, CALENDAR_SELSECTED COMP; image, CALENDAR_WEEK_VIEW_PRESS COMP; image, CALENDAR_MONTH_VIEW_BG_1 COMP; image, CALENDAR_TODAY_ICON COMP; image, CALENDAR_MONTH_VIEW_DIM COMP; image, CALENDAR_SELSECTED_TODAY COMP; image: "00_overscrolling_left.png" COMP; image: "00_overscrolling_right.png" COMP; } parts { part { name, "base"; type, RECT; description { state, "default" 0.0; color, 0 0 0 0; } } part { name, "weeknumber/wday/base"; type, RECT; description { state, "default" 0.0; rel1 { relative, 0.0 0.0; to, "base"; } rel2 { relative, 0.0 0.0; to, "base"; } color, 0 0 0 0; } description { state, "default" 0.1; min, WIDTH_OF_WNUMBER 0; fixed, 1 0; align, 0 0; rel1 { relative, 0.0 (0/HEIGHT_OF_CALENDAR_SW); to, "base"; } rel2 { relative, 0.0 (HEIGHT_OF_WDAY+HEIGHT_OF_WDAY_LINE)/HEIGHT_OF_CALENDAR_SW; to, "base"; } color, 0 0 0 0; } } part { name, "weeknumber/day/base"; type, RECT; description { state, "default" 0.0; rel1 { relative, 0.0 0.0; to, "base"; } rel2 { relative, 0.0 0.0; to, "base"; } color, 0 0 0 0; } description { state, "default" 0.1; min, WIDTH_OF_WNUMBER 0; fixed, 1 0; align, 0 0; rel1 { relative, 0.0 (HEIGHT_OF_WDAY+HEIGHT_OF_WDAY_LINE)/HEIGHT_OF_CALENDAR_SW; to, "base"; } rel2 { relative, 0.0 HEIGHT_OF_CALENDAR_SW/HEIGHT_OF_CALENDAR_SW; to, "base"; } color, 0 0 0 0; } } part { name, "weeknumber/wday/line"; type, RECT; description { state, "default" 0.0; rel1 { relative, 0.0 1.0; offset, 0 (-1.0*HEIGHT_OF_WDAY_LINE); to, "weeknumber/wday/base"; } rel2 { relative, 1.0 1.0; to, "weeknumber/wday/base"; } color, COLOR_OF_LINE_FOR_MONTH_CAL; } } part { name, "wday/weeknumber/base"; type, RECT; description { state, "default" 0.0; rel1 { relative: 0 0; to, "weeknumber/wday/base"; } rel2 { relative: 1 1; to, "weeknumber/wday/base"; } color, 0 0 0 0; } } part { name, "wday/weeknumber/text"; type, TEXT; mouse_events, 0; scale, 1; description { state, "default" 0.0; rel1.to, "wday/weeknumber/base"; rel2.to, "wday/weeknumber/base"; color, COLOR_OF_WEEK_NUMBER_TEXT_FOR_MONTH_CAL; text { font, "SLP:style=Regular"; size, 24; align, 0.5 0.5; } } } WNUMBER(0) WNUMBER(1) WNUMBER(2) WNUMBER(3) WNUMBER(4) WNUMBER(5) WNHL(0) WNHL(1) WNHL(2) WNHL(3) WNHL(4) WNHL(5) WNHL(6) programs { program { name, "display_week_number"; signal, "display_week_number"; source, "prog"; action, STATE_SET "default" 0.1; target, "weeknumber/wday/base"; target, "weeknumber/day/base"; } } part { name, "wday/base"; type, RECT; description { state, "default" 0.0; rel1 { relative, 1.0 (0/HEIGHT_OF_CALENDAR_SW); to_x, "weeknumber/wday/base"; to_y, "base"; } rel2 { relative, 1.0 (HEIGHT_OF_WDAY+HEIGHT_OF_WDAY_LINE)/HEIGHT_OF_CALENDAR_SW; to, "base"; } color, 0 0 0 0; } } part { name, "day/base"; type, RECT; description { state, "default" 0.0; rel1 { relative, 1.0 (HEIGHT_OF_WDAY+HEIGHT_OF_WDAY_LINE)/HEIGHT_OF_CALENDAR_SW; to_x, "weeknumber/day/base"; to_y, "base";} rel2 { relative, 1.0 HEIGHT_OF_CALENDAR_SW/HEIGHT_OF_CALENDAR_SW; to, "base"; } color, 0 0 0 0; } } part { name, "wday/line"; type, RECT; description { state, "default" 0.0; rel1 { relative, 0.0 1.0; offset, 0 (-1.0*HEIGHT_OF_WDAY_LINE); to, "wday/base"; } rel2 { relative, 1.0 1.0; to, "wday/base"; } color, COLOR_OF_LINE_FOR_MONTH_CAL; } } WD(0) WD(1) WD(2) WD(3) WD(4) WD(5) WD(6) VL_W( 1) VL_W( 2) VL_W( 3) VL_W( 4) VL_W( 5) VL_W( 6) VL_W(7) DB(0, 0, 1) DB(0, 1, 2) DB(0, 2, 3) DB(0, 3, 4) DB(0, 4, 5) DB(0, 5, 6) DB(0, 6, 7) DB(1, 7, 1) DB(1, 8, 2) DB(1, 9, 3) DB(1, 10, 4) DB(1, 11, 5) DB(1, 12, 6) DB(1, 13, 7) DB(2, 14, 1) DB(2, 15, 2) DB(2, 16, 3) DB(2, 17, 4) DB(2, 18, 5) DB(2, 19, 6) DB(2, 20, 7) DB(3, 21, 1) DB(3, 22, 2) DB(3, 23, 3) DB(3, 24, 4) DB(3, 25, 5) DB(3, 26, 6) DB(3, 27, 7) DB(4, 28, 1) DB(4, 29, 2) DB(4, 30, 3) DB(4, 31, 4) DB(4, 32, 5) DB(4, 33, 6) DB(4, 34, 7) DB(5, 35, 1) DB(5, 36, 2) DB(5, 37, 3) DB(5, 38, 4) DB(5, 39, 5) DB(5, 40, 6) DB(5, 41, 7) VL( 1) VL( 2) VL( 3) VL( 4) VL( 5) VL( 6) VL(7) HL( 0) HL( 1) HL( 2) HL( 3) HL( 4) HL( 5) HL(6) part { name: "vshadow_clip"; type: RECT; mouse_events: 0; repeat_events: 1; scale: 1; description { state: "default" 0.0; } description { state: "hidden" 0.0; visible: 0; color: 255 255 255 0; } } part { name: "shadow_right"; insert_after: "vshadow_clip"; repeat_events: 1; clip_to: "vshadow_clip"; type: IMAGE; scale: 1; description { state: "default" 0.0; min: 10 0; fixed: 1 1; align: 1.0 0.5; color: 255 255 255 150; rel1.relative: 1.0 0.0; rel2.relative: 1.0 1.0; rel1.to: "base"; rel2.to: "base"; image.normal: "00_overscrolling_right.png"; visible: 1; } description { state: "edge_right" 0.0; inherit: "default" 0.0; color: 255 255 255 255; visible: 1; } description { state: "edge_left" 0.0; inherit: "default" 0.0; color: 255 255 255 50; visible: 1; } } part { name: "shadow_left"; insert_after: "shadow_right"; repeat_events: 1; clip_to: "vshadow_clip"; type: IMAGE; scale: 1; description { state: "default" 0.0; min: 10 0; fixed: 1 1; align: 0.0 0.5; color: 255 255 255 150; rel1.relative: 0.0 0.0; rel2.relative: 0.0 1.0; rel1.to: "base"; rel2.to: "base"; image.normal: "00_overscrolling_left.png"; visible: 1; } description { state: "edge_right" 0.0; inherit: "default" 0.0; color: 255 255 255 50; visible: 1; } description { state: "edge_left" 0.0; inherit: "default" 0.0; color: 255 255 255 255; visible: 1; } } } programs { program { name: "load"; signal: "load"; script { set_state(PART:"vshadow_clip", "hidden", 0.0); set_int(edge_timer, 0); } } program { name: "vshadow_show"; signal: "do-show-vshadow"; source: ""; action: STATE_SET "default" 0.0; transition: LINEAR 0.5; target: "vshadow_clip"; } program { name: "vshadow_hide"; signal: "do-hide-vshadow"; source: ""; action: STATE_SET "hidden" 0.0; transition: LINEAR 0.5; target: "vshadow_clip"; } program { name: "edge_right"; signal: "elm,edge,right"; source: "elm"; script { new v; set_state(PART:"shadow_right", "edge_right", 0.0); set_state(PART:"shadow_left", "edge_right", 0.0); v = get_int(edge_timer); if (!v) { emit("do-show-vshadow", ""); } if (v > 0) cancel_timer(v); v = timer(0.2, "timer2", 0); set_int(edge_timer, v); } } program { name: "edge_left"; signal: "elm,edge,left"; source: "elm"; script { new v; set_state(PART:"shadow_right", "edge_left", 0.0); set_state(PART:"shadow_left", "edge_left", 0.0); v = get_int(edge_timer); if (!v) { emit("do-show-vshadow", ""); } if (v > 0) cancel_timer(v); v = timer(0.2, "timer2", 0); set_int(edge_timer, v); } } } }