summaryrefslogtreecommitdiff
path: root/src/examples/codegen_example.edc
blob: c40d397cd223d1f84f0c69b516252d8a90f95f5b (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
collections {
   group {
      name: "elm/example/mylayout/default";

      data {
         item: "title" "elm_codegen Example";
      }

      parts {
         part {
            name: "example/title";
            api: "title" "The example title";
            type: TEXT;

               description {
               state: "default" 0.0;
               color: 0 0 0 255;
               rel1 {
                  relative: 0.0 0.0;
                  offset: 0 0;
               }
               rel2 {
                  relative: 1.0 0.2;
                  offset: -1 -1;
               }
               text {
                  text: "Using elementary_codegen";
                  size: 16;
                  font: "sans";
                  min: 1 1;
                  ellipsis: -1;
               }
            }
         }

         part {
            name: "example/custom";
            api: "custom" "The swallow part";
            type: SWALLOW;

            description {
               state: "default" 0.0;
               min: 160 50;
               max: 160 50;
               align: 0.5 0.4;
            }
            description {
               state: "big" 0.0;
               inherit: "default" 0.0;
               min: 320 100;
               max: 320 100;
            }
         } // example/custom

         part {
            name: "example/box";
            api: "box" "The box part";
            type: BOX;

            description {
               state: "default" 0.0;
               box {
                  layout: "horizontal_homogeneous";
               }
               rel1.relative: 0.0 0.5;
               rel2.relative: 1.0 0.6;
            }
         } // box

         part {
            name: "example/table";
            api: "table" "The table part";
            type: TABLE;

            description {
               state: "default" 0.0;
               rel1.relative: 0.0 0.8;
               rel2.relative: 1.0 1.0;
            }
         } // table

         programs {
            program {
               name: "swallow,grow";
               api: "swallow_grow" "Executed when the button enlarges";
               signal: "button,enlarge";
               action: STATE_SET "big" 0.0;
               transition: LINEAR 0.5;
               target: "example/custom";
               after: "emit,changed";
            }
            program {
               name: "swallow,shrink";
               api: "swallow_shrink" "Executed when the button reduces";
               signal: "button,reduce";
               action: STATE_SET "default" 0.0;
               transition: LINEAR 0.5;
               target: "example/custom";
               after: "emit,changed";
            }
            program {
               name: "emit,changed";
               action: SIGNAL_EMIT "size,changed" "";
               api: "size_changed" "Emit the signal size,changed";
            }
         }
      }
   }
}