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