/* * 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. */ #include "../../inc/conf.h" images { image: "app_press_117.png" COMP; image: "btn_delete_nor.png" COMP; image: "btn_delete_press.png" COMP; image: "app_icon_checkbox_bg.png" COMP; image: "app_icon_checkbox_on.png" COMP; image: "app_icon_checkbox_border.png" COMP; image: "icon_badge_container.png" COMP; } styles { style{ name: "icon_label"; base: "font=Samsung Condensed:style=Regular align=center color=#FFFFFFFF font_size=28 wrap=mixed"; } style{ name: "icon_label_edit"; base: "font=Samsung Condensed:style=Regular align=center color=#FFFFFFFF font_size=25 wrap=mixed"; } } collections { group { name: "app_icon_layout"; script { public checkbox_state; public alpha; public message(Msg_Type:type, id, ...) { if(type == MSG_INT_SET) { set_int(alpha, getarg(2)); send_message(type, id, getarg(2)); } } } parts { part { //"icon_bg" name: "icon_bg"; type: SPACER; mouse_events: 1; repeat_events: 1; scale: 0; description { state: "default" 0.0; rel1{relative: 0.0 0.0; } rel2{relative: 1.0 1.0; } } description { state: "moved" 0.0; inherit: "default" 0.0; } description { state: "edit" 0.0; inherit: "default" 0.0; } description { state: "manage_state" 0.0; inherit: "default" 0.0; } } part { //PART_ICON_CONTENT name: PART_ICON_CONTENT; type: SWALLOW; mouse_events: 1; repeat_events: 1; scale: 0; description { state: "default" 0.0; rel1{relative: ICON_X_MIN ICON_Y_MIN; to: "icon_bg";} rel2{relative: ICON_X_MAX ICON_Y_MAX; to: "icon_bg";} } } part { //"icon_content_touch" name: "icon_content_touch"; type: IMAGE; mouse_events: 1; repeat_events: 1; scale: 0; description { state: "default" 0.0; rel1{relative: 0.0 0.0; to: PART_ICON_CONTENT;} rel2{relative: 1.0 1.0; to: PART_ICON_CONTENT;} aspect: 1.0 1.0; aspect_preference: BOTH; color: 0 0 0 0; image { normal: "app_press_117.png"; } } description{ state: "icon_touched" 0.0; inherit: "default" 0.0; color: 0 0 0 150; } } part { //PART_ICON_NAME name: PART_ICON_NAME; type: TEXTBLOCK; mouse_events: 1; repeat_events: 1; scale: 1; description { state: "default" 0.0; rel1{relative: ICON_NAME_X_MIN ICON_NAME_Y_MIN; to: "icon_bg";} rel2{relative: ICON_NAME_X_MAX ICON_NAME_Y_MAX; to: "icon_bg";} color: 255 255 255 255; text { style: "icon_label"; align: 0.5 0.0; } } description { state: "edit" 0.0; inherit: "default" 0.0; rel1{relative: ICON_NAME_X_MIN ICON_NAME_Y_MIN; to: "icon_bg";} rel2{relative: ICON_NAME_X_MAX 1.0; to: "icon_bg";} text { style: "icon_label_edit"; } } description { state: "black_text" 0.0; inherit: "default" 0.0; color: 0 0 0 255; } description { state: "black_edit" 0.0; inherit: "black_text" 0.0; text { style: "icon_label_edit"; } } } /*************************** BADGE *************************************/ part { name: "icon_badge"; type: IMAGE; scale: 0; description { state: "default" 0.0; rel1{relative: 0.0 0.0; offset: -10 -1; to: "icon_badge_text";} rel2{relative: 1.0 1.0; offset: 9 1; to: "icon_badge_text";} visible: 0; image { normal: "icon_badge_container.png"; border: 15 14 0 0; } } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; } } part { name: "icon_badge_text"; type: TEXT; scale: 1; description { state: "default" 0.0; visible: 0; fixed: 1 1; color: 255 255 255 255; rel1{relative: BADGE_REL_X BADGE_REL_Y; to: "icon_bg";} rel2{relative: BADGE_REL_X BADGE_REL_Y; to: "icon_bg";} align: 1.0 0.0; text { font: "arial"; size: 32; text_class: "ATO002"; min: 1 1; max: 1 1; ellipsis: -1; } } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; } } /*************************** END OF BADGE *************************************/ part { //"icon_uninstall_button"; name: "icon_uninstall_button"; type: IMAGE; scale: 0; description { state: "default" 0.0; rel1{relative: 0.0 0.0; to: "icon_bg";} rel2{relative: ICON_UNINSTALL_BTN_X_MAX ICON_UNINSTALL_BTN_Y_MAX; to: "icon_bg";} color: 255 255 255 0; visible: 0; aspect: 1.0 1.0; aspect_preference: BOTH; image { normal: "btn_delete_nor.png"; } } description { state: "show" 0.0; inherit: "default" 0.0; color: 255 255 255 255; visible: 1; } description { state: "press" 0.0; inherit: "default" 0.0; color: 255 255 255 255; image { normal: "btn_delete_press.png"; } visible: 1; } } /*Icons checkboxes in choose state:*/ part { //"icon_checkbox_bg"; name: "icon_checkbox_bg"; type: IMAGE; scale: 0; description { state: "default" 0.0; rel1{relative: ICON_BADGE_CHECKBOX_REL1_X ICON_BADGE_CHECKBOX_REL1_Y; to: "icon_bg";} rel2{relative: ICON_BADGE_CHECKBOX_REL2_X ICON_BADGE_CHECKBOX_REL2_Y; to: "icon_bg";} color: 255 255 255 120; visible: 0; aspect: 1.0 1.0; aspect_preference: BOTH; //TODO: image from home-lite is used... image { normal: "app_icon_checkbox_bg.png"; } } description { state: "blank" 0.0; inherit: "default" 0.0; visible: 1; } description { state: "checked" 0.0; inherit: "default" 0.0; //color_class: "ATO005"; color: 255 255 255 255; visible: 1; } } part { //"icon_checkbox_border"; name: "icon_checkbox_border"; type: IMAGE; scale: 0; description { state: "default" 0.0; rel1{relative: 0.0 0.0; to: "icon_checkbox_bg";} rel2{relative: 1.0 1.0; to: "icon_checkbox_bg";} color: 255 255 255 0; visible: 0; aspect: 1.0 1.0; aspect_preference: BOTH; image { normal: "app_icon_checkbox_border.png"; } } description { state: "blank" 0.0; inherit: "default" 0.0; color: 255 255 255 255; visible: 1; } description { state: "checked" 0.0; inherit: "default" 0.0; color: 255 255 255 120; visible: 1; } } part { //"icon_checkbox" name: "icon_checkbox"; type: IMAGE; scale: 0; description { state: "default" 0.0; rel1{relative: 0.0 0.0; to: "icon_checkbox_bg";} rel2{relative: 1.0 1.0; to: "icon_checkbox_bg";} color: 255 255 255 0; visible: 0; aspect: 1.0 1.0; aspect_preference: BOTH; image { normal: "app_icon_checkbox_on.png"; } } description { state: "blank" 0.0; inherit: "default" 0.0; color: 255 255 255 255; visible: 0; } description { state: "checked" 0.0; inherit: "default" 0.0; color: 255 255 255 255; visible: 1; } } part { //checkbox_click_area name: "checkbox_click_area"; type: RECT; scale: 0; description { state: "default" 0.0; color: 0 0 0 0; rel1 { relative: -0.2 -0.2; to: "icon_checkbox"; } rel2 { relative: 1.2 1.2; to: "icon_checkbox"; } visible: 0; } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; } } } programs { program { name: "group_loaded"; signal: "load"; source: ""; script { set_int(checkbox_state, 0); } } program { name: "icon_clicked_program"; signal :"mouse,clicked,1"; source: "icon_content"; action: SIGNAL_EMIT SIGNAL_ICON_CLICKED SIGNAL_SOURCE; //after: program with change the icon shadow state to clicked! } program { name: "icon_touch_program"; signal: SIGNAL_ICON_PRESS; source: SIGNAL_PRESS_SOURCE; action: STATE_SET "icon_touched" 0.0; target: "icon_content_touch"; transition: LINEAR 0.1; } program { name: "icon_touch_release_program"; signal: "mouse,up,1"; source: "icon_content_touch"; action: STATE_SET "default" 0.0; target: "icon_content_touch"; transition: LINEAR 0.1; } program { name: "edit_mode_on"; signal: SIGNAL_EDIT_MODE_ON; source: SIGNAL_SOURCE; action: STATE_SET "edit" 0.0; target: PART_ICON_NAME; } program { name: "edit_mode_off"; signal: SIGNAL_EDIT_MODE_OFF; source: SIGNAL_SOURCE; action: STATE_SET "default" 0.0; target: PART_ICON_NAME; } program { name: "edit_mode_black_on"; signal: SIGNAL_EDIT_MODE_BLACK_ON; source: SIGNAL_SOURCE; action: STATE_SET "black_edit" 0.0; target: PART_ICON_NAME; } program { name: "edit_mode_black_off"; signal: SIGNAL_EDIT_MODE_BLACK_OFF; source: SIGNAL_SOURCE; action: STATE_SET "black_text" 0.0; target: PART_ICON_NAME; } program { name: "uninstall_button_show"; signal: SIGNAL_UNINSTALL_BUTTON_SHOW; source: SIGNAL_SOURCE; action: STATE_SET "show" 0.0; target: "icon_uninstall_button"; transition: DECELERATE 0.20; } program { name: "uninstall_button_hide"; signal: SIGNAL_UNINSTALL_BUTTON_HIDE; source: SIGNAL_SOURCE; action: STATE_SET "default" 0.0; target: "icon_uninstall_button"; transition: DECELERATE 0.20; } program { name: "uninstall_button_clicked"; signal: "mouse,clicked,1"; source: "icon_uninstall_button"; action: SIGNAL_EMIT SIGNAL_UNINSTALL_BUTTON_CLICKED SIGNAL_SOURCE; } program { name: "uninstall_button_mouse_down"; signal: "mouse,down,1"; source: "icon_uninstall_button"; action: STATE_SET "press" 0.0; target: "icon_uninstall_button"; transition: DECELERATE 0.20; } program { name: "uninstall_button_mouse_up"; signal: "mouse,up,1"; source: "icon_uninstall_button"; action: STATE_SET "show" 0.0; target: "icon_uninstall_button"; transition: DECELERATE 0.20; } //Checkbox program { name: "checkbox_show_unchecked"; signal: SIGNAL_CHECKBOX_SHOW_UNCHECKED; source: SIGNAL_SOURCE; script { set_int(checkbox_state, 0); emit("checkbox,blank,show", SIGNAL_SOURCE); } after: "checkbox_area_visible"; } program { name: "checkbox_show_checked"; signal: SIGNAL_CHECKBOX_SHOW_CHECKED; source: SIGNAL_SOURCE; script { set_int(checkbox_state, 1); emit("checkbox,checked,show", SIGNAL_SOURCE); } after: "checkbox_area_visible"; } program { name: "checkbox_blank_show"; signal: "checkbox,blank,show"; source: SIGNAL_SOURCE; action: STATE_SET "blank" 0.0; target: "icon_checkbox"; target: "icon_checkbox_border"; target: "icon_checkbox_bg"; } program { name: "checkbox_hide"; signal: SIGNAL_CHECKBOX_HIDE; source: SIGNAL_SOURCE; action: STATE_SET "default" 0.0; target: "icon_checkbox"; target: "icon_checkbox_border"; target: "icon_checkbox_bg"; transition: DECELERATE 0.20; after: "checkbox_area_hide"; } program { name: "checkbox_checked_show"; signal: "checkbox,checked,show"; source: SIGNAL_SOURCE; action: STATE_SET "checked" 0.0; target: "icon_checkbox"; target: "icon_checkbox_border"; target: "icon_checkbox_bg"; transition: DECELERATE 0.20; } program { name: "checkbox_clicked"; signal: "mouse,clicked,1"; source: "checkbox_click_area"; script { if (get_int(checkbox_state) == 0) { set_int(checkbox_state, 1); //isnt it deprecated? emit("checkbox,checked,show", SIGNAL_SOURCE); //signal for edje state change emit("checkbox,checked", SIGNAL_SOURCE); //signal for C listener } else { set_int(checkbox_state, 0); emit("checkbox,blank,show", SIGNAL_SOURCE); //signal for edje state change emit("checkbox,unchecked", SIGNAL_SOURCE); //signal for C listener } } } /*This is when ALLs are in management mode:*/ program { name: "set_manage_state_program"; signal: "set_manage_state"; source: SIGNAL_SOURCE; action: STATE_SET "manage_state" 0.0; target: "icon_bg"; transition: DECELERATE 0.2; } /*This is default for ALLs: */ program { name: "unset_manage_state_program"; signal: "unset_manage_state"; source: SIGNAL_SOURCE; action: STATE_SET "default" 0.0; target: "icon_bg"; transition: DECELERATE 0.2; } program { name: "program_no_text"; signal: SIGNAL_LABEL_HIDE; source: SIGNAL_SOURCE; action: STATE_SET "no_text" 0.0; target: PART_ICON_NAME; } program { name: "program_black_text"; signal: "label,text,black"; source: SIGNAL_SOURCE; action: STATE_SET "black_text" 0.0; target: PART_ICON_NAME; } program { name: "program_default"; signal: SIGNAL_LABEL_SHOW; source: SIGNAL_SOURCE; action: STATE_SET "default" 0.0; target: PART_ICON_NAME; transition: DECELERATE 0.20; } program { name: "icon_badge_show"; signal: SIGNAL_BADGE_SHOW; source: SIGNAL_SOURCE; action: STATE_SET "visible" 0.0; target: "icon_badge"; target: "icon_badge_text"; } program { name: "icon_badge_hide"; signal: SIGNAL_BADGE_HIDE; source: SIGNAL_SOURCE; action: STATE_SET "default" 0.0; target: "icon_badge"; target: "icon_badge_text"; } program { name: "checkbox_area_visible"; action: STATE_SET "visible" 0.0; target: "checkbox_click_area"; } program { name: "checkbox_area_hide"; action: STATE_SET "default" 0.0; target: "checkbox_click_area"; } program { name: "area,clicked"; signal: "mouse,clicked,1"; source: "checkbox_click_area"; action: SIGNAL_EMIT "mouse,clicked,1" "icon_checkbox"; } program { name: "checkbox,block"; signal: SIGNAL_CHECKBOX_BLOCK; source: SIGNAL_SOURCE; action: STATE_SET "default" 0.0; target: "checkbox_click_area"; } program { name: "checkbox,unblock"; signal: SIGNAL_CHECKBOX_UNBLOCK; source: SIGNAL_SOURCE; action: STATE_SET "visible" 0.0; target: "checkbox_click_area"; } } } }