2 valac --pkg gio-2.0 --pkg posix --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0 --pkg libwnck-3.0 \
3 /tmp/ClutterFiles.vala -o /tmp/ClutterFiles
8 static int main (string[] args) {
10 new Xcls_ClutterFiles();
11 ClutterFiles.show_all();
18 public static Xcls_ClutterFiles ClutterFiles;
20 public class Xcls_ClutterFiles : Object
22 public Clutter.ScrollActor el;
23 private Xcls_ClutterFiles _this;
25 public Xcls_filelayout filelayout;
26 public Xcls_filelayout_manager filelayout_manager;
31 public Xcls_ClutterFiles()
35 this.el = new Clutter.ScrollActor();
40 this.el.reactive = true;
41 var child_0 = new Xcls_filelayout( _this );
43 this.el.add_child ( child_0.el );
46 this.el.scroll_event.connect( ( event) => {
48 print("scroll event");
49 var y = this.filelayout.el.y;
50 var dir = event.direction;
52 case Clutter.ScrollDirection.UP:
55 case Clutter.ScrollDirection.DOWN:
61 // range of scroll -- can go up -- eg.. -ve value.
65 // to work out the max -ve number
66 // height of filelayout
67 // height of scrollactor..
69 print("scroll event of %f - new y = %f ".printf(event.y, y));
70 // y = float.min(0, y); //??
71 print("scroll event of %f - new y = %f ".printf(event.y, y));
72 this.filelayout.el.y = y;
78 // userdefined functions
79 public void set_size(float w, float h) {
80 _this.filelayout_manager.el.max_column_width = w - 150;
81 this.el.set_size(this.el.get_stage().width-150,
82 this.el.get_stage().height);
83 this.el.set_position(100,50);
85 public void show(Project.Project pr) {
86 // list all the files, and create new Xcls_fileitem for each one.
88 var fiter = pr.files.map_iterator();
89 while (fiter.next()) {
90 var a = new Xcls_fileitem(this,fiter.get_value());
92 print("add " + fiter.get_value().name + "\n");
93 this.filelayout.el.add_child(a.el);
98 // skip |xns - no return type
99 public class Xcls_filelayout : Object
101 public Clutter.Actor el;
102 private Xcls_ClutterFiles _this;
108 public Xcls_filelayout(Xcls_ClutterFiles _owner )
111 _this.filelayout = this;
112 this.el = new Clutter.Actor();
116 // set gobject values
117 this.el.reactive = true;
118 var child_0 = new Xcls_filelayout_manager( _this );
120 this.el.layout_manager = child_0.el;
123 this.el.add_constraint(
124 new Clutter.BindConstraint(_this.el,Clutter.BindCoordinate.SIZE, 0.0f)
128 // userdefined functions
130 // skip |xns - no return type
132 public class Xcls_filelayout_manager : Object
134 public Clutter.FlowLayout el;
135 private Xcls_ClutterFiles _this;
141 public Xcls_filelayout_manager(Xcls_ClutterFiles _owner )
144 _this.filelayout_manager = this;
145 this.el = new Clutter.FlowLayout( Clutter.FlowOrientation.HORIZONTAL );
149 // set gobject values
150 this.el.column_spacing = 20;
151 this.el.homogeneous = true;
152 this.el.row_spacing = 20;
155 // userdefined functions
157 // skip |xns - no return type
159 public class Xcls_fileitem : Object
161 public Clutter.Actor el;
162 private Xcls_ClutterFiles _this;
166 public Xcls_image image;
167 public Xcls_title title;
170 public Xcls_fileitem(Xcls_ClutterFiles _owner , JsRender.JsRender file)
173 this.el = new Clutter.Actor();
177 // set gobject values
178 var child_0 = new Xcls_BoxLayout5( _this );
180 this.el.layout_manager = child_0.el;
181 var child_1 = new Xcls_image( _this ,file);
183 this.el.add_child ( child_1.el );
184 this.image = child_1;
185 var child_2 = new Xcls_title( _this ,file);
187 this.el.add_child ( child_2.el );
188 this.title = child_2;
191 this.el.set_size(100,100);
194 // userdefined functions
196 // skip |xns - no return type
198 public class Xcls_BoxLayout5 : Object
200 public Clutter.BoxLayout el;
201 private Xcls_ClutterFiles _this;
207 public Xcls_BoxLayout5(Xcls_ClutterFiles _owner )
210 this.el = new Clutter.BoxLayout();
214 // set gobject values
215 this.el.orientation = Clutter.Orientation.VERTICAL;
219 // userdefined functions
221 // skip |xns - no return type
223 public class Xcls_image : Object
225 public Clutter.Texture el;
226 private Xcls_ClutterFiles _this;
232 public Xcls_image(Xcls_ClutterFiles _owner , JsRender.JsRender file)
235 this.el = new Clutter.Texture.from_file(file.getIconFile());
239 // set gobject values
240 this.el.x_align = Clutter.ActorAlign.START;
241 this.el.x_expand = true;
242 this.el.y_align = Clutter.ActorAlign.START;
243 this.el.y_expand = false;
246 // userdefined functions
248 // skip |xns - no return type
250 public class Xcls_title : Object
252 public Clutter.Text el;
253 private Xcls_ClutterFiles _this;
259 public Xcls_title(Xcls_ClutterFiles _owner , JsRender.JsRender file)
262 this.el = new Clutter.Text.full("Sans 10px", file.nickName(),new Clutter.Color.from_string("#fff"));
266 // set gobject values
267 this.el.x_align = Clutter.ActorAlign.START;
268 this.el.x_expand = true;
269 this.el.y_align = Clutter.ActorAlign.START;
270 this.el.y_expand = false;
273 // userdefined functions
275 // skip |xns - no return type