summaryrefslogtreecommitdiff
path: root/src/tests/edje/data/test_signals.edc
blob: 185b9d4443cc97575545e29d39f22441bea70879 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// compile: edje_cc edje_signal_test.edc
collections {
   group {
      name: "level1";

      parts {
         part {
            name: "group";
            type: GROUP;
            source: "level2";
            description {
               state: "default" 0.0;
               rel1 {
                  relative: 0.0 0.0;
                  offset: 0 0;
               }
               rel2 {
                  relative: 1.0 1.0;
                  offset: -1 -1;
               }
            }
         }
      }
   }
   group {
      name: "level2";

      parts {
         part {
            name: "group";
            type: GROUP;
            source: "level3";
            description {
               state: "default" 0.0;
               rel1 {
                  relative: 0.0 0.0;
                  offset: 0 0;
               }
               rel2 {
                  relative: 1.0 1.0;
                  offset: -1 -1;
               }
            }
         }
      }
   }
   group {
      name: "level3"; // must be the same as in edje_example.c

      parts {
         part {
            name: "background";
            type: RECT; // plain boring rectangle
            mouse_events: 0; // we don't need any mouse event on the background

            // just one state "default"
            description {
               state: "default" 0.0; // must always exist
               color: 255 255 255 255; // white

               // define part coordinates:

               rel1 { // top-left point at (0, 0) [WIDTH * 0 + 0, HEIGHT * 0 + 0]
                  relative: 0.0 0.0;
                  offset: 0 0;
               }
               rel2 { // bottom-right point at (WIDTH * 1.0 - 1, HEIGHT * 1.0 - 1)
                  relative: 1.0 1.0;
                  offset: -1 -1;
               }
            }
         }

         part {
            name: "text";
            type: TEXT;
            mouse_events: 1; // we want to change the color on mouse-over

            // 2 states, one "default" and another "over" to be used
            // on mouse over effect

            description {
               state: "default" 0.0;
               color: 255 0 0 255; // red

               // define part coordinates:

               rel1 { // top-left at (WIDTH * 0.1 + 5, HEIGHT * 0.2 + 10)
                  relative: 0.1 0.2;
                  offset: 5 10;
               }
               rel2 { // bottom-right at (WIDTH * 0.9 - 6, HEIGHT * 0.8 - 11)
                  relative: 0.9 0.8;
                  offset: -6 -11;
               }

               // define text specific state details
               text {
                  font: "Sans"; // using fontconfig name!
                  size: 10;
                  text: "hello world";
               }
            }

            description {
               state: "over" 0.0;
               inherit: "default" 0.0; // copy everything from "default" at this point

               color: 0 255 0 255; // override color, now it is green
            }
         }

         programs {
            program {
               signal: "mouse,in";
               source: "text";

               action: STATE_SET "over" 0.0;
               target: "text";
            }
         }
      }
   }
}