1/* 2 Copyright (C) 2008,2009 INdT - Instituto Nokia de Tecnologia 3 Copyright (C) 2009,2010 ProFUSION embedded systems 4 Copyright (C) 2009,2010 Samsung Electronics 5 6 This file is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Library General Public 8 License as published by the Free Software Foundation; either 9 version 2 of the License, or (at your option) any later version. 10 11 This file is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Library General Public License for more details. 15 16 You should have received a copy of the GNU Library General Public License 17 along with this library; see the file COPYING.LIB. If not, write to 18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 Boston, MA 02110-1301, USA. 20*/ 21 22 group { 23 24 name: "webkit/widget/checkbox"; 25 min: 12 12; 26 27 images { 28 image: "widget/check/img_check_on.png" COMP; 29 image: "widget/check/img_check_off.png" COMP; 30 image: "widget/check/img_check_off_focus.png" COMP; 31 image: "widget/check/img_check_on_focus.png" COMP; 32 image: "widget/check/img_check_off_hover.png" COMP; 33 image: "widget/check/img_check_on_hover.png" COMP; 34 } 35 36 script { 37 public isEnabled; 38 public isPressed; 39 public isChecked; 40 public isFocused; 41 public isHovered; 42 43 public show() { 44 if (get_int(isEnabled) == 1) { 45 set_state(PART:"check_button", "default", 0.0); 46 if (get_int(isChecked) == 1) { 47 set_state(PART:"check_button", "enabled_checked", 0.0); 48 if (get_int(isFocused) == 1) 49 set_state(PART:"check_button", "focus_checked", 0.0); 50 if (get_int(isHovered) == 1 && get_int(isFocused) == 0) 51 set_state(PART:"check_button", "hovered_checked", 0.0); 52 } 53 else { 54 if (get_int(isFocused) == 1) 55 set_state(PART:"check_button", "focused", 0.0); 56 if (get_int(isHovered) == 1 && get_int(isFocused) == 0) 57 set_state(PART:"check_button", "hovered", 0.0); 58 } 59 } 60 else { 61 set_state(PART:"check_button", "disabled", 0.0); 62 if (get_int(isChecked) == 1) 63 set_state(PART:"check_button", "disabled_checked", 0.0); 64 } 65 } 66 } 67 68 parts { 69 part { 70 name: "check_button"; 71 type: IMAGE; 72 description { 73 state: "default" 0.0; 74 min: 12 12; 75 max: 12 12; 76 image { 77 normal: "widget/check/img_check_off.png"; 78 } 79 } 80 description { 81 state: "enabled_checked" 0.0; 82 inherit: "default" 0.0; 83 image { 84 normal: "widget/check/img_check_on.png"; 85 } 86 } 87 description { 88 state: "disabled_checked" 0.0; 89 inherit: "enabled_checked" 0.0; 90 color: 255 255 255 150; 91 } 92 description { 93 state: "disabled" 0.0; 94 inherit: "default" 0.0; 95 color: 255 255 255 150; 96 } 97 description { 98 state: "hovered_checked" 0.0; 99 inherit: "default" 0.0; 100 image { 101 normal: "widget/check/img_check_on_hover.png"; 102 } 103 } 104 description { 105 state: "hovered" 0.0; 106 inherit: "default" 0.0; 107 image { 108 normal: "widget/check/img_check_off_hover.png"; 109 } 110 } 111 description { 112 state: "focus_checked" 0.0; 113 inherit: "default" 0.0; 114 image { 115 normal: "widget/check/img_check_on_focus.png"; 116 } 117 } 118 description { 119 state: "focused" 0.0; 120 inherit: "default" 0.0; 121 image { 122 normal: "widget/check/img_check_off_focus.png"; 123 } 124 } 125 } 126 } 127 programs { 128 program { 129 name: "enabled"; 130 signal: "enabled"; 131 script { 132 set_int(isEnabled, 1); 133 show(); 134 } 135 } 136 program { 137 name: "pressed"; 138 signal: "pressed"; 139 script { 140 set_int(isPressed, 1); 141 show(); 142 } 143 } 144 program { 145 name: "checked"; 146 signal: "checked"; 147 script { 148 set_int(isChecked, 1); 149 show(); 150 } 151 } 152 program { 153 name: "focused"; 154 signal: "focused"; 155 script { 156 set_int(isFocused, 1); 157 show(); 158 } 159 } 160 program { 161 name: "hovered"; 162 signal: "hovered"; 163 script { 164 set_int(isHovered, 1); 165 show(); 166 } 167 } 168 program { 169 name: "reset"; 170 signal: "reset"; 171 script { 172 set_int(isEnabled, 0); 173 set_int(isPressed, 0); 174 set_int(isChecked, 0); 175 set_int(isFocused, 0); 176 set_int(isHovered, 0); 177 show(); 178 } 179 } 180 } 181 } 182