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.
64 // y = float.min(0, y); //??
65 print("scroll event of %f - new y = %f ".printf(event.y, y));
66 this.filelayout.el.y = y;
72 // userdefined functions
73 public void set_size(float w, float h) {
74 _this.filelayout_manager.el.max_column_width = w - 150;
75 this.el.set_size(this.el.get_stage().width-150,
76 this.el.get_stage().height);
77 this.el.set_position(100,50);
79 public void show(Project.Project pr) {
80 // list all the files, and create new Xcls_fileitem for each one.
82 var fiter = pr.files.map_iterator();
83 while (fiter.next()) {
84 var a = new Xcls_fileitem(this,fiter.get_value());
86 print("add " + fiter.get_value().name + "\n");
87 this.filelayout.el.add_child(a.el);
92 // skip |xns - no return type
93 public class Xcls_filelayout : Object
95 public Clutter.Actor el;
96 private Xcls_ClutterFiles _this;
102 public Xcls_filelayout(Xcls_ClutterFiles _owner )
105 _this.filelayout = this;
106 this.el = new Clutter.Actor();
110 // set gobject values
111 this.el.reactive = true;
112 var child_0 = new Xcls_filelayout_manager( _this );
114 this.el.layout_manager = child_0.el;
117 this.el.add_constraint(
118 new Clutter.BindConstraint(_this.el,Clutter.BindCoordinate.SIZE, 0.0f)
122 // userdefined functions
124 // skip |xns - no return type
126 public class Xcls_filelayout_manager : Object
128 public Clutter.FlowLayout el;
129 private Xcls_ClutterFiles _this;
135 public Xcls_filelayout_manager(Xcls_ClutterFiles _owner )
138 _this.filelayout_manager = this;
139 this.el = new Clutter.FlowLayout( Clutter.FlowOrientation.HORIZONTAL );
143 // set gobject values
144 this.el.column_spacing = 20;
145 this.el.homogeneous = true;
146 this.el.row_spacing = 20;
149 // userdefined functions
151 // skip |xns - no return type
153 public class Xcls_fileitem : Object
155 public Clutter.Actor el;
156 private Xcls_ClutterFiles _this;
160 public Xcls_image image;
161 public Xcls_title title;
164 public Xcls_fileitem(Xcls_ClutterFiles _owner , JsRender.JsRender file)
167 this.el = new Clutter.Actor();
171 // set gobject values
172 var child_0 = new Xcls_BoxLayout5( _this );
174 this.el.layout_manager = child_0.el;
175 var child_1 = new Xcls_image( _this ,file);
177 this.el.add_child ( child_1.el );
178 this.image = child_1;
179 var child_2 = new Xcls_title( _this ,file);
181 this.el.add_child ( child_2.el );
182 this.title = child_2;
185 this.el.set_size(100,100);
188 // userdefined functions
190 // skip |xns - no return type
192 public class Xcls_BoxLayout5 : Object
194 public Clutter.BoxLayout el;
195 private Xcls_ClutterFiles _this;
201 public Xcls_BoxLayout5(Xcls_ClutterFiles _owner )
204 this.el = new Clutter.BoxLayout();
208 // set gobject values
209 this.el.orientation = Clutter.Orientation.VERTICAL;
213 // userdefined functions
215 // skip |xns - no return type
217 public class Xcls_image : Object
219 public Clutter.Texture el;
220 private Xcls_ClutterFiles _this;
226 public Xcls_image(Xcls_ClutterFiles _owner , JsRender.JsRender file)
229 this.el = new Clutter.Texture.from_file(file.getIconFile());
233 // set gobject values
234 this.el.x_align = Clutter.ActorAlign.START;
235 this.el.x_expand = true;
236 this.el.y_align = Clutter.ActorAlign.START;
237 this.el.y_expand = false;
240 // userdefined functions
242 // skip |xns - no return type
244 public class Xcls_title : Object
246 public Clutter.Text el;
247 private Xcls_ClutterFiles _this;
253 public Xcls_title(Xcls_ClutterFiles _owner , JsRender.JsRender file)
256 this.el = new Clutter.Text.full("Sans 10px", file.nickName(),new Clutter.Color.from_string("#fff"));
260 // set gobject values
261 this.el.x_align = Clutter.ActorAlign.START;
262 this.el.x_expand = true;
263 this.el.y_align = Clutter.ActorAlign.START;
264 this.el.y_expand = false;
267 // userdefined functions
269 // skip |xns - no return type