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