Builder4/ClutterFiles.bjs
[app.Builder.js] / Builder4 / ClutterFiles.bjs
1 {
2     "id": "file-gtk-2",
3     "name": "ClutterFiles",
4     "parent": "",
5     "title": false,
6     "path": "/home/alan/gitlive/app.Builder.js/Builder4/ClutterFiles.bjs",
7     "items": [
8         {
9             ".signal:void:open": "(JsRender.JsRender file)",
10             "Gee.ArrayList<Xcls_fileitem>:fileitems": "",
11             "id": "ClutterFiles",
12             "scroll_mode": "Clutter.ScrollMode.VERTICAL",
13             "xtype": "ScrollActor",
14             "|init": "this.fileitems = new Gee.ArrayList<Xcls_fileitem>();\n",
15             "|reactive": "true",
16             "|void:clearFiles": "() {\n    \n    this.filelayout.el.remove_all_children();\n    // we need to unref all the chidren that we loaded though...\n    \n}\n",
17             "|void:loadProject": "(Project.Project pr) {\n    // list all the files, and create new Xcls_fileitem for each one.\n    \n    // LEAK --- we should unref all the chilren...\n    this.clearFiles();\n    \n    print(\"clutter files - load project: \" + pr.name +\"\\n\");\n    // should unref.. them hopefully.\n    this.fileitems = new Gee.ArrayList<Xcls_fileitem>();\n\n    var fiter = pr.files.map_iterator();\n    while (fiter.next()) {\n        var a = new Xcls_fileitem(this,fiter.get_value());\n        this.fileitems.add(a);\n\n//        a.ref();\n        print(\"add to clutter file view: \" + fiter.get_value().name + \"\\n\");\n        this.filelayout.el.add_child(a.el);\n    }\n    this.el.show_all();\n}\n",
18             "|void:set_size": "(float w, float h) \n{\n     if (this.el == null) {\n        print(\"object not ready yet?\");\n        return;\n    }\n   _this.filelayout_manager.el.max_column_width = w - 150;\n   this.el.set_size(this.el.get_stage().width-150,\n                        this.el.get_stage().height);\n            this.el.set_position(100,50);\n}\n",
19             "|xns": "Clutter",
20             "items": [
21                 {
22                     "id": "filelayout",
23                     "pack": "add_child",
24                     "xtype": "Actor",
25                     "|init": "\nthis.el.add_constraint(\n    new Clutter.BindConstraint(_this.el,Clutter.BindCoordinate.SIZE, 0.0f)\n);\n\n",
26                     "|reactive": "true",
27                     "|xns": "Clutter",
28                     "items": [
29                         {
30                             "*prop": "layout_manager",
31                             "column_spacing": 20,
32                             "id": "filelayout_manager",
33                             "row_spacing": 20,
34                             "xtype": "FlowLayout",
35                             "|homogeneous": "true",
36                             "|orientation": "Clutter.FlowOrientation.HORIZONTAL",
37                             "|xns": "Clutter"
38                         },
39                         {
40                             "listeners": {
41                                 "enter_event": "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#333\");\n        return false;\n}",
42                                 "leave_event": "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#000\");\n    return false;\n}",
43                                 "button_press_event": "  (  event) => {\n    _this.open(this.file);\n    return false;\n}"
44                             },
45                             "*args": "JsRender.JsRender file",
46                             ".JsRender.JsRender:file": "",
47                             "id": "*fileitem",
48                             "pack": false,
49                             "xtype": "Actor",
50                             "|init": "this.file = file;\nthis.el.set_size(100,100);",
51                             "|reactive": "true",
52                             "|xns": "Clutter",
53                             "items": [
54                                 {
55                                     "*prop": "layout_manager",
56                                     "spacing": 4,
57                                     "xtype": "BoxLayout",
58                                     "|orientation": "Clutter.Orientation.VERTICAL",
59                                     "|xns": "Clutter"
60                                 },
61                                 {
62                                     "*args": "JsRender.JsRender file",
63                                     ".ctor": "new Clutter.Texture.from_file(file.getIconFileName(true))",
64                                     "id": "+image",
65                                     "pack": "add_child",
66                                     "xtype": "Texture",
67                                     "|margin_left": 5,
68                                     "|margin_right": 5,
69                                     "|margin_top": 5,
70                                     "|x_align": "Clutter.ActorAlign.START",
71                                     "|x_expand": "true",
72                                     "|xns": "Clutter",
73                                     "|y_align": "Clutter.ActorAlign.START",
74                                     "|y_expand": "false"
75                                 },
76                                 {
77                                     "*args": "JsRender.JsRender file",
78                                     ".ctor": "new Clutter.Text.full(\"Sans 10px\", file.nickType(),new Clutter.Color.from_string(\"#fff\"))",
79                                     "id": "+typetitle",
80                                     "pack": "add_child",
81                                     "xtype": "Text",
82                                     "|x_align": "Clutter.ActorAlign.START",
83                                     "|x_expand": "true",
84                                     "|xns": "Clutter",
85                                     "|y_align": "Clutter.ActorAlign.START",
86                                     "|y_expand": "false"
87                                 },
88                                 {
89                                     "*args": "JsRender.JsRender file",
90                                     ".ctor": "new Clutter.Text.full(\"Sans 10px\", file.nickName(),new Clutter.Color.from_string(\"#fff\"))",
91                                     "id": "+title",
92                                     "pack": "add_child",
93                                     "xtype": "Text",
94                                     "|x_align": "Clutter.ActorAlign.START",
95                                     "|x_expand": "true",
96                                     "|xns": "Clutter",
97                                     "|y_align": "Clutter.ActorAlign.START",
98                                     "|y_expand": "false"
99                                 }
100                             ]
101                         }
102                     ]
103                 }
104             ]
105         }
106     ],
107     "permname": "",
108     "modOrder": ""
109 }