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             ".Gee.ArrayList:fileitems": "",
10             ".signal:void:open": "(JsRender.JsRender file)",
11             "id": "ClutterFiles",
12             "scroll_mode": "Clutter.ScrollMode.VERTICAL",
13             "xtype": "ScrollActor",
14             "|reactive": "true",
15             "|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",
16             "|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    var fiter = pr.files.map_iterator();\n    while (fiter.next()) {\n        var a = new Xcls_fileitem(this,fiter.get_value());\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",
17             "|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",
18             "|xns": "Clutter",
19             "items": [
20                 {
21                     "id": "filelayout",
22                     "pack": "add_child",
23                     "xtype": "Actor",
24                     "|init": "\nthis.el.add_constraint(\n    new Clutter.BindConstraint(_this.el,Clutter.BindCoordinate.SIZE, 0.0f)\n);\n\n",
25                     "|reactive": "true",
26                     "|xns": "Clutter",
27                     "items": [
28                         {
29                             "*prop": "layout_manager",
30                             "column_spacing": 20,
31                             "id": "filelayout_manager",
32                             "row_spacing": 20,
33                             "xtype": "FlowLayout",
34                             "|homogeneous": "true",
35                             "|orientation": "Clutter.FlowOrientation.HORIZONTAL",
36                             "|xns": "Clutter"
37                         },
38                         {
39                             "listeners": {
40                                 "enter_event": "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#333\");\n        return false;\n}",
41                                 "leave_event": "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#000\");\n    return false;\n}",
42                                 "button_press_event": "  (  event) => {\n    _this.open(this.file);\n    return false;\n}"
43                             },
44                             "*args": "JsRender.JsRender file",
45                             ".JsRender.JsRender:file": "",
46                             "id": "*fileitem",
47                             "pack": false,
48                             "xtype": "Actor",
49                             "|init": "this.file = file;\nthis.el.set_size(100,100);",
50                             "|reactive": "true",
51                             "|xns": "Clutter",
52                             "items": [
53                                 {
54                                     "*prop": "layout_manager",
55                                     "spacing": 4,
56                                     "xtype": "BoxLayout",
57                                     "|orientation": "Clutter.Orientation.VERTICAL",
58                                     "|xns": "Clutter"
59                                 },
60                                 {
61                                     "*args": "JsRender.JsRender file",
62                                     ".ctor": "new Clutter.Texture.from_file(file.getIconFileName(true))",
63                                     "id": "+image",
64                                     "pack": "add_child",
65                                     "xtype": "Texture",
66                                     "|margin_left": 5,
67                                     "|margin_right": 5,
68                                     "|margin_top": 5,
69                                     "|x_align": "Clutter.ActorAlign.START",
70                                     "|x_expand": "true",
71                                     "|xns": "Clutter",
72                                     "|y_align": "Clutter.ActorAlign.START",
73                                     "|y_expand": "false"
74                                 },
75                                 {
76                                     "*args": "JsRender.JsRender file",
77                                     ".ctor": "new Clutter.Text.full(\"Sans 10px\", file.nickType(),new Clutter.Color.from_string(\"#fff\"))",
78                                     "id": "+typetitle",
79                                     "pack": "add_child",
80                                     "xtype": "Text",
81                                     "|x_align": "Clutter.ActorAlign.START",
82                                     "|x_expand": "true",
83                                     "|xns": "Clutter",
84                                     "|y_align": "Clutter.ActorAlign.START",
85                                     "|y_expand": "false"
86                                 },
87                                 {
88                                     "*args": "JsRender.JsRender file",
89                                     ".ctor": "new Clutter.Text.full(\"Sans 10px\", file.nickName(),new Clutter.Color.from_string(\"#fff\"))",
90                                     "id": "+title",
91                                     "pack": "add_child",
92                                     "xtype": "Text",
93                                     "|x_align": "Clutter.ActorAlign.START",
94                                     "|x_expand": "true",
95                                     "|xns": "Clutter",
96                                     "|y_align": "Clutter.ActorAlign.START",
97                                     "|y_expand": "false"
98                                 }
99                             ]
100                         }
101                     ]
102                 }
103             ]
104         }
105     ],
106     "permname": "",
107     "modOrder": ""
108 }