1/*
2    Copyright (C) 2010 Samsung Electronics
3
4    This file is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Library General Public
6    License as published by the Free Software Foundation; either
7    version 2 of the License, or (at your option) any later version.
8
9    This file is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Library General Public License for more details.
13
14    You should have received a copy of the GNU Library General Public License
15    along with this library; see the file COPYING.LIB.  If not, write to
16    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17    Boston, MA 02110-1301, USA.
18*/
19group {
20    name: "webkit/widget/progressbar";
21    min: 0 11; /* if > 0, this is the minimum size that will be allocated.
22                * If wants to draw on top, just overflow usign edje's rel1/rel2
23                */
24    max: 999999 999999;
25
26    images {
27        image: "widget/progressbar/shelf_inset.png" COMP;
28        image: "widget/progressbar/bt_base.png" COMP;
29    }
30
31    script {
32        public message(Msg_Type:type, id, ...) {
33            if ((id == 0) && (type == MSG_FLOAT_SET)) {
34                new Float:x, Float:sx;
35                x = getfarg(2);
36                sx = getfarg(3);
37
38                if (sx >= 0.0) {
39                    set_drag_size(PART:"img.progressbar_fill", sx, 1.0);
40                    set_drag(PART:"img.progressbar_fill", x, 0.0);
41                }
42            }
43        }
44    }
45
46    parts {
47        part {
48           name: "rect.base";
49           type: RECT;
50           description {
51              state: "default" 0.0;
52              min: 29 11;
53              max: 999999 99999;
54              color: 255 255 255 0;
55           }
56        }
57        part {
58           name: "rect.clipper";
59           type: RECT;
60           description {
61              state: "default" 0.0;
62              color: 255 255 255 255;
63           }
64           description {
65              state: "hidden" 0.0;
66              color: 255 255 255 128;
67           }
68        }
69
70        part {
71           name: "img.progressbar";
72           type: IMAGE;
73           mouse_events: 0;
74           clip_to: "rect.clipper";
75           description {
76              state: "default" 0.0;
77              min: 29 5;
78              rel1.to: "rect.base";
79              rel2.to: "rect.base";
80              align: 0.5 0.5;
81              image {
82                 normal: "widget/progressbar/shelf_inset.png";
83                 border: 8 8 8 8;
84              }
85           }
86        }
87        part {
88           name: "img.progressbar_fill";
89           type: IMAGE;
90           mouse_events: 0;
91           clip_to: "rect.clipper";
92           dragable {
93               x: 1 1 0;
94               y: 0 0 0;
95               confine: "rect.base";
96           }
97           description {
98              state: "default" 0.0;
99              min: 0 5;
100              align: 0.5 0.5;
101              image {
102                 normal: "widget/progressbar/bt_base.png";
103                 border: 7 7 0 0;
104              }
105           }
106        }
107    }
108}
109