Imported Upstream version 1.7.1
[platform/upstream/edje.git] / src / examples / edje_example.edc
1 // compile: edje_cc edje_example.edc
2 collections {
3    group {
4       name: "my_group"; // must be the same as in edje_example.c
5
6       parts {
7          part {
8             name: "background";
9             type: RECT; // plain boring rectangle
10             mouse_events: 0; // we don't need any mouse event on the background
11
12             // just one state "default"
13             description {
14                state: "default" 0.0; // must always exist
15                color: 255 255 255 255; // white
16
17                // define part coordinates:
18
19                rel1 { // top-left point at (0, 0) [WIDTH * 0 + 0, HEIGHT * 0 + 0]
20                   relative: 0.0 0.0;
21                   offset: 0 0;
22                }
23                rel2 { // bottom-right point at (WIDTH * 1.0 - 1, HEIGHT * 1.0 - 1)
24                   relative: 1.0 1.0;
25                   offset: -1 -1;
26                }
27             }
28          }
29
30          part {
31             name: "text";
32             type: TEXT;
33             mouse_events: 1; // we want to change the color on mouse-over
34
35             // 2 states, one "default" and another "over" to be used
36             // on mouse over effect
37
38             description {
39                state: "default" 0.0;
40                color: 255 0 0 255; // red
41
42                // define part coordinates:
43
44                rel1 { // top-left at (WIDTH * 0.1 + 5, HEIGHT * 0.2 + 10)
45                   relative: 0.1 0.2;
46                   offset: 5 10;
47                }
48                rel2 { // bottom-right at (WIDTH * 0.9 - 6, HEIGHT * 0.8 - 11)
49                   relative: 0.9 0.8;
50                   offset: -6 -11;
51                }
52
53                // define text specific state details
54                text {
55                   font: "Sans"; // using fontconfig name!
56                   size: 10;
57                   text: "hello world";
58                }
59             }
60
61             description {
62                state: "over" 0.0;
63                inherit: "default" 0.0; // copy everything from "default" at this point
64
65                color: 0 255 0 255; // override color, now it is green
66             }
67          }
68
69          // do programs to change color on text mouse in/out (over)
70          programs {
71             program {
72                // what triggers this program:
73                signal: "mouse,in";
74                source: "text";
75
76                // what this program does:
77                action: STATE_SET "over" 0.0;
78                target: "text";
79
80                // do the state-set in a nice interpolation animation
81                // using linear time in 0.1 second
82                transition: LINEAR 0.1;
83             }
84
85             program {
86                // what triggers this program:
87                signal: "mouse,out";
88                source: "text";
89
90                // what this program does:
91                action: STATE_SET "default" 0.0;
92                target: "text";
93
94                // do the state-set in a nice interpolation animation
95                // using linear time in 0.1 second
96                transition: LINEAR 0.1;
97             }
98          }
99       }
100    }
101 }