updated xobject , clutter base objects started
[app.Builder.js] / ClutterTest / Window.js
1 Gtk = imports.gi.Gtk;
2 Gdk = imports.gi.Gdk;
3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
5 Gio = imports.gi.Gio;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
9 Vte = imports.gi.Vte;
10 GtkClutter = imports.gi.GtkClutter;
11 console = imports.console;
12 XObject = imports.XObject.XObject;
13 Window=new XObject({
14     xtype: Gtk.Window,
15     default_height : 900,
16     default_width : 900,
17     init : function() {
18         XObject.prototype.init.call(this);
19         this.el.show_all();
20     },
21     items : [
22         {
23             xtype: GtkClutter.Embed,
24             pack : "add",
25             items : [
26                 {
27                     xtype: GtkClutter.Actor,
28                     pack : false,
29                     x : 10,
30                     y : 10,
31                     items : [
32                         {
33                             xtype: Gtk.Button,
34                             listeners : {
35                                 clicked : function (self) {
36                                    Clutter = imports.gi.Clutter;
37                                         var animate = this.parent.el.animate(
38                                                 Clutter.AnimationMode.EASE_OUT_ELASTIC, 2000,
39                                                 {
40                                                            scale_x : 5,
41                                                           scale_y: 5,
42                                 
43                                                 }
44                                                 );
45                                                 animate.timeline.start();
46                                 
47                                 }
48                             },
49                             height_request : 100,
50                             label : "project list",
51                             pack : false,
52                             width_request : 100
53                         }
54                     ]
55                 },
56                 {
57                     xtype: GtkClutter.Actor,
58                     pack : false,
59                     x : 10,
60                     y : 150,
61                     items : [
62                         {
63                             xtype: Gtk.Button,
64                             listeners : {
65                                 clicked : function (self) {
66                                    Clutter = imports.gi.Clutter;
67                                         var animate = this.parent.el.animate(
68                                                 Clutter.AnimationMode.EASE_OUT_ELASTIC, 2000,
69                                                 {
70                                                            scale_x : 5,
71                                                           scale_y: 5,
72                                 
73                                                 }
74                                                 );
75                                                 animate.timeline.start();
76                                 
77                                 }
78                             },
79                             height_request : 100,
80                             label : "file list",
81                             pack : false,
82                             width_request : 100
83                         }
84                     ]
85                 },
86                 {
87                     xtype: GtkClutter.Actor,
88                     pack : false,
89                     x : 10,
90                     y : 300,
91                     items : [
92                         {
93                             xtype: Gtk.Button,
94                             listeners : {
95                                 clicked : function (self) {
96                                    Clutter = imports.gi.Clutter;
97                                         var animate = this.parent.el.animate(
98                                                 Clutter.AnimationMode.EASE_OUT_ELASTIC, 2000,
99                                                 {
100                                                            scale_x : 5,
101                                                           scale_y: 5,
102                                 
103                                                 }
104                                                 );
105                                                 animate.timeline.start();
106                                 
107                                 }
108                             },
109                             height_request : 100,
110                             label : "tree of parts",
111                             pack : false,
112                             width_request : 100
113                         }
114                     ]
115                 },
116                 {
117                     xtype: GtkClutter.Actor,
118                     pack : false,
119                     x : 10,
120                     y : 450,
121                     items : [
122                         {
123                             xtype: Gtk.Button,
124                             listeners : {
125                                 clicked : function (self) {
126                                    Clutter = imports.gi.Clutter;
127                                         var animate = this.parent.el.animate(
128                                                 Clutter.AnimationMode.EASE_OUT_ELASTIC, 2000,
129                                                 {
130                                                            scale_x : 5,
131                                                           scale_y: 5,
132                                 
133                                                 }
134                                                 );
135                                                 animate.timeline.start();
136                                 
137                                 }
138                             },
139                             height_request : 100,
140                             label : "property editor",
141                             pack : false,
142                             width_request : 100
143                         }
144                     ]
145                 },
146                 {
147                     xtype: GtkClutter.Actor,
148                     pack : false,
149                     x : 150,
150                     y : 450,
151                     items : [
152                         {
153                             xtype: Gtk.Button,
154                             listeners : {
155                                 clicked : function (self) {
156                                    Clutter = imports.gi.Clutter;
157                                         var animate = this.parent.el.animate(
158                                                 Clutter.AnimationMode.EASE_OUT_ELASTIC, 2000,
159                                                 {
160                                                            scale_x : 5,
161                                                           scale_y: 5,
162                                 
163                                                 }
164                                                 );
165                                                 animate.timeline.start();
166                                 
167                                 }
168                             },
169                             height_request : 100,
170                             label : "text editor",
171                             pack : false,
172                             width_request : 100
173                         }
174                     ]
175                 },
176                 {
177                     xtype: GtkClutter.Actor,
178                     pack : false,
179                     x : 150,
180                     y : 10,
181                     items : [
182                         {
183                             xtype: Gtk.Button,
184                             listeners : {
185                                 clicked : function (self) {
186                                    Clutter = imports.gi.Clutter;
187                                         var animate = this.parent.el.animate(
188                                                 Clutter.AnimationMode.EASE_OUT_ELASTIC, 2000,
189                                                 {
190                                                            scale_x : 5,
191                                                           scale_y: 5,
192                                 
193                                                 }
194                                                 );
195                                                 animate.timeline.start();
196                                 
197                                 }
198                             },
199                             height_request : 100,
200                             label : "preview app",
201                             pack : false,
202                             width_request : 100
203                         }
204                     ]
205                 },
206                 {
207                     xtype: GtkClutter.Actor,
208                     pack : false,
209                     x : 100,
210                     y : 300,
211                     items : [
212                         {
213                             xtype: Gtk.Button,
214                             listeners : {
215                                 clicked : function (self) {
216                                    Clutter = imports.gi.Clutter;
217                                         var animate = this.parent.el.animate(
218                                                 Clutter.AnimationMode.EASE_OUT_ELASTIC, 2000,
219                                                 {
220                                                            scale_x : 5,
221                                                           scale_y: 5,
222                                 
223                                                 }
224                                                 );
225                                                 animate.timeline.start();
226                                 
227                                 }
228                             },
229                             height_request : 100,
230                             label : "palete",
231                             pack : false,
232                             width_request : 100
233                         }
234                     ]
235                 }
236             ]
237         }
238     ]
239 });
240 Window.init();
241 XObject.cache['/Window'] = Window;