Home | History | Annotate | Download | only in file
      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       name: "webkit/widget/file";
     24 
     25       images {
     26          image: "widget/file/file_normal.png" COMP;
     27          image: "widget/file/file_hover.png" COMP;
     28          image: "widget/file/file_focus.png" COMP;
     29          image: "widget/file/file_press.png" COMP;
     30       }
     31 
     32       script {
     33           public isEnabled;
     34           public isPressed;
     35           public isChecked;
     36           public isFocused;
     37           public isHovered;
     38 
     39           public show() {
     40                if (get_int(isEnabled) == 1) {
     41                    set_state(PART:"file", "default", 0.0);
     42                    if (get_int(isFocused) == 1) {
     43                        set_state(PART:"file", "focused", 0.0);
     44                        if (get_int(isPressed) == 1)
     45                            set_state(PART:"file", "pressed", 0.0);
     46                       }
     47                else if (get_int(isHovered) == 1) {
     48                    set_state(PART:"file", "hovered", 0.0);
     49                    if (get_int(isPressed) == 1)
     50                        set_state(PART:"file", "pressed", 0.0);
     51 
     52                   }
     53               }
     54               else
     55                   set_state(PART:"file", "disabled", 0.0);
     56           }
     57       }
     58 
     59       parts {
     60          part {
     61             name: "file";
     62             type: IMAGE;
     63             description {
     64                state: "default" 0.0;
     65                image {
     66                   normal: "widget/file/file_normal.png";
     67                   border: 8 8 8 8;
     68                }
     69             }
     70             description {
     71                state: "disabled" 0.0;
     72                inherit: "default" 0.0;
     73                color: 255 255 255 150;
     74             }
     75             description {
     76                state: "hovered" 0.0;
     77                inherit: "default" 0.0;
     78                image {
     79                   normal: "widget/file/file_hover.png";
     80                   border: 8 8 8 8;
     81                }
     82             }
     83             description {
     84                state: "focused" 0.0;
     85                inherit: "default" 0.0;
     86                image {
     87                   normal: "widget/file/file_focus.png";
     88                   border: 8 8 8 8;
     89                }
     90             }
     91             description {
     92                state: "pressed" 0.0;
     93                inherit: "default" 0.0;
     94                image {
     95                   normal: "widget/file/file_press.png";
     96                   border: 8 8 8 8;
     97                }
     98             }
     99          }
    100       }
    101 
    102       programs {
    103          program {
    104             name: "enabled";
    105             signal: "enabled";
    106             script {
    107                set_int(isEnabled, 1);
    108                show();
    109             }
    110          }
    111          program {
    112             name: "pressed";
    113             signal: "pressed";
    114             script {
    115                set_int(isPressed, 1);
    116                show();
    117             }
    118          }
    119          program {
    120             name: "focused";
    121             signal: "focused";
    122             script {
    123                set_int(isFocused, 1);
    124                show();
    125             }
    126          }
    127           program {
    128             name: "hovered";
    129             signal: "hovered";
    130             script {
    131                set_int(isHovered, 1);
    132                show();
    133             }
    134          }
    135         program {
    136             name: "reset";
    137             signal: "reset";
    138             script {
    139                set_int(isEnabled, 0);
    140                set_int(isPressed, 0);
    141                set_int(isChecked, 0);
    142                set_int(isFocused, 0);
    143                set_int(isHovered, 0);
    144                show();
    145             }
    146          }
    147       }
    148    }
    149