{ "name" : "MainWindow", "parent" : "", "title" : "", "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/MainWindow.bjs", "permname" : "", "modOrder" : "", "items" : [ { "listeners" : { "delete_event" : " ( event) => {\n return false;\n}", "destroy" : "() => {\n Xcls_MainWindow.singleton().no_windows--;\n \n if (Xcls_MainWindow.singleton().no_windows < 1) {\n\n Gtk.main_quit();\n }\n}", "show" : " ( ) => {\n // hide the file editing..\n \n //this.hideViewEditing();\n _this.statusbar.el.hide();\n Resources.singleton().checkResources();\n \n}" }, "id" : "MainWindow", "default_width" : 800, "* init" : " \n\t \n //this.el.show_all();\n \n ", "# Project.Project project" : "null", "# string title" : "\"Application Builder\"", "xtype" : "Window", "# int no_windows" : 1, "default_height" : 500, "| void initChildren" : " () {\n // this needs putting in a better place..\n this.windowstate = new WindowState(this);\n \n\n //w.el.show_all();\n var tl = new Clutter.Timeline(6000);\n tl.set_repeat_count(-1);\n tl.start();\n tl.ref();\n\n \n\n\n\n}\n", "$ xns" : "Gtk", "| void show" : "() {\n \n this.el.show_all();\n\n}", "# WindowState windowstate" : "null", "border_width" : 0, "$ type" : "Gtk.WindowType.TOPLEVEL", "| void setTitle" : " (string str) {\n this.el.set_title(this.title + \" - \" + str);\n}\n", "items" : [ { "id" : "vbox", "xtype" : "VBox", "* pack" : "add", "$ xns" : "Gtk", "$ homogeneous" : false, "items" : [ { "id" : "mainpane", "position" : 400, "* pack" : "pack_start,true,true,0", "# int lastWidth" : 0, "xtype" : "HPaned", "$ xns" : "Gtk", "items" : [ { "id" : "leftpane", "* pack" : "add1", "xtype" : "VBox", "$ xns" : "Gtk", "items" : [ { "id" : "editpane", "* pack" : "pack_start,false,true,0", "xtype" : "VPaned", "$ xns" : "Gtk", "items" : [ { "id" : "tree", "* pack" : "add1", "xtype" : "VBox", "$ xns" : "Gtk" }, { "id" : "props", "* pack" : "add2", "xtype" : "VBox", "$ xns" : "Gtk" } ] } ] }, { "* pack" : "add2", "xtype" : "VBox", "$ xns" : "Gtk", "items" : [ { "listeners" : { "size_allocate" : " ( alloc) => {\n if (_this.windowstate == null) {\n return;\n }\n _this.windowstate.resizeCanvas(); \n \n}" }, "id" : "clutterembed", "* init" : " var stage = this.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n \n", "xtype" : "Embed", "* pack" : "pack_start,true,true,0", "$ xns" : "GtkClutter", "items" : [ { "id" : "rooview", "* init" : "{\n \n \n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 1.0f\n )\n );\n \n //this.el.set_position(100,100);\n this.el.set_pivot_point(1.0f,1.0f);\n \n this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n _this.clutterembed.el.get_stage().height);\n \n}", "xtype" : "Actor", "* pack" : "get_stage().add_child", "$ xns" : "GtkClutter" }, { "id" : "objectview", "* init" : "{\n \n /*\n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n */\n this.el.fixed_x = 50.0f;\n this.el.fixed_y = 0.0f;\n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(0.0f,1.0f);\n this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n _this.clutterembed.el.get_stage().height);\n \n}", "xtype" : "Actor", "* pack" : "get_stage().add_child", "$ xns" : "GtkClutter" }, { "id" : "codeeditview", "* init" : "{\n \n /*\n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n */\n this.el.fixed_x = 50.0f;\n this.el.fixed_y = 0.0f;\n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(0.0f,1.0f);\n this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n _this.clutterembed.el.get_stage().height);\n \n}", "xtype" : "Actor", "* pack" : "get_stage().add_child", "$ xns" : "GtkClutter" }, { "id" : "addpropsview", "* init" : "{\n \n /*\n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n */\n this.el.fixed_x = 50.0f;\n this.el.fixed_y = 0.0f;\n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(0.0f,1.0f);\n this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n _this.clutterembed.el.get_stage().height);\n \n}", "xtype" : "Actor", "* pack" : "get_stage().add_child", "$ xns" : "GtkClutter" }, { "id" : "projecteditview", "* init" : "{\n \n \n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 1.0f\n )\n );\n \n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(1.0f,0.0f);\n this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n _this.clutterembed.el.get_stage().height /2);\n \n}", "xtype" : "Actor", "* pack" : "get_stage().add_child", "$ xns" : "GtkClutter" }, { "id" : "buttonlayout", "* init" : "{\n \n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n \n \n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.5f,0.5f);\n this.el.set_size(50,\n _this.clutterembed.el.get_stage().height);\n \n}", "xtype" : "Actor", "* pack" : "get_stage().add_child", "$ xns" : "Clutter", "items" : [ { "$ orientation" : "Clutter.Orientation.VERTICAL", "xtype" : "BoxLayout", "$ xns" : "Clutter", "* prop" : "layout_manager" }, { "id" : "backbutton", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "* pack" : "add_child", "xtype" : "Actor", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n \n _this.windowstate.switchState(WindowState.State.PREVIEW);\n \n\n}" }, "utf8 tooltip_text" : "Back", "xtype" : "Button", "* pack" : false, "width_request" : 50, "$ xns" : "Gtk", "height_request" : 50, "items" : [ { "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "go-previous", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "projectbutton", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n _this.windowstate.switchState(WindowState.State.FILES);\n \n\n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "height_request" : 50, "$ tooltop_text" : "\"Open File\"", "items" : [ { "utf8 icon_name" : "document-open", "* pack" : "set_image", "xtype" : "Image", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "editfilebutton", "* init" : "this.el.set_size(50.0f,50.0f);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n \n // create a new file in project..\n if (_this.project == null || _this.windowstate.left_tree.model.file == null) {\n return ;\n }\n _this.windowstate.new_file_dialog.show(_this.windowstate.left_tree.model.file);\n \n return ; \n\n\n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "$ tooltip_text" : "\"File Details\"", "height_request" : 50, "items" : [ { "xtype" : "Image", "utf8 icon_name" : "document-properties", "* pack" : "set_image", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "projecteditbutton", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n _this.windowstate.switchState(WindowState.State.PROJECT);\n \n\n\n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "$ tooltip_text" : "\"Project Details\"", "height_request" : 50, "items" : [ { "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "emblem-system", "$ xns" : "Gtk" } ] } ] } ] }, { "listeners" : { "enter_event" : "( event) => {\n this.el.background_color = new Clutter.Color.from_string(\"#333\");\n return false;\n}", "leave_event" : "( event) => {\n this.el.background_color = new Clutter.Color.from_string(\"#000\");\n return false;\n}" }, "id" : "objectshowbutton", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n \n _this.windowstate.switchState(WindowState.State.OBJECT);\n \n \n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "$ tooltip_text" : "\"Add Child Element\"", "height_request" : 50, "items" : [ { "utf8 icon_name" : "list-add", "* pack" : "set_image", "xtype" : "Image", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "addpropbutton", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n \n _this.windowstate.switchState(WindowState.State.PROP);\n \n\n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "$ tooltip_text" : "\"Add Property\"", "height_request" : 50, "items" : [ { "xtype" : "Image", "utf8 icon_name" : "format-justify-left", "* pack" : "set_image", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "addlistenerbutton", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n \n _this.windowstate.switchState(WindowState.State.LISTENER);\n \n\n\n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "$ tooltip_text" : "\"Add Event Code\"", "height_request" : 50, "items" : [ { "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "appointment-new", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "addprojectbutton", "* init" : "this.el.set_size(50.0f,50.0f);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n \n // create a new file in project..\n //Xcls_DialogNewComponent.singleton().show(\n var pe = Xcls_EditProject.singleton();\n pe.el.set_transient_for(_this.el);\n pe.el.set_modal(true); \n \n var p = pe.show();\n\n if (p == null) {\n return;\n }\n \n \n _this.windowstate.left_projects.is_loaded = false; \n _this.windowstate.left_projects.load();\n _this.windowstate.left_projects.selectProject(p);\n return ; \n\n\n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "$ tooltip_text" : "\"New\\nProj.\"", "height_request" : 50, "items" : [ { "xtype" : "Image", "utf8 icon_name" : "folder-new", "* pack" : "set_image", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "addfilebutton", "* init" : "this.el.set_size(50.0f,50.0f);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " () => {\n // create a new file in project..\n \n // what's the currently selected project...\n var proj = _this.windowstate.left_projects.getSelectedProject();\n \n if (proj == null) {\n return ;\n }\n \n \n \n var f = JsRender.JsRender.factory(proj.xtype, proj, \"\");\n _this.project = proj;\n _this.windowstate.new_file_dialog.show(f);\n \n return ; \n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "$ tooltip_text" : "\"Add File\"", "height_request" : 50, "items" : [ { "utf8 icon_name" : "document-new", "* pack" : "set_image", "xtype" : "Image", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "delprojectbutton", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n \n var cd = DialogConfirm.singleton();\n cd.el.set_transient_for(_this.el);\n cd.el.set_modal(true);\n\n var project = _this.windowstate.left_projects.getSelectedProject();\n if (project == null) {\n print(\"SKIP - no project\\n\");\n return;\n }\n \n \n if (Gtk.ResponseType.YES != cd.show(\"Confirm\", \n \"Are you sure you want to delete project %s\".printf(project.name))) {\n return;\n }\n \n\n // confirm?\n Project.Project.remove(project);\n _this.project = null;\n \n _this.windowstate.left_projects.is_loaded = false;\n _this.windowstate.left_projects.load();\n _this.windowstate.clutterfiles.clearFiles();\n\n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "$ tooltip_text" : "\"Delete Project\"", "height_request" : 50, "items" : [ { "xtype" : "Image", "utf8 icon_name" : "user-trash", "* pack" : "set_image", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "reload_resources", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "* pack" : "add_child", "xtype" : "Actor", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n Resources.singleton().fetchStart();\n}" }, "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "$ utf8 tooltip_text" : "\"Download latest resourse files\\nlike the object tree and object properties\"", "height_request" : 50, "items" : [ { "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "go-bottom", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "new_window", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n Xcls_MainWindow.singleton().no_windows++;\n var w = new Xcls_MainWindow();\n w.ref();\n\n w.el.show_all();\n w.initChildren();\n w.windowstate.switchState(WindowState.State.FILES);\n}" }, "utf8 tooltip_text" : "Open New Window", "xtype" : "Button", "* pack" : false, "width_request" : 50, "$ xns" : "Gtk", "height_request" : 50, "items" : [ { "xtype" : "Image", "utf8 icon_name" : "window-new", "* pack" : "set_image", "$ xns" : "Gtk" } ] } ] } ] }, { "id" : "about", "* init" : "this.el.set_size(50,50);", "xtype" : "Actor", "* pack" : "add_child", "$ xns" : "Clutter", "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", "* pack" : "add_child", "xtype" : "Actor", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { "clicked" : " ( ) => {\n About.singleton().el.show();\n}" }, "utf8 tooltip_text" : "About the builder", "* pack" : false, "xtype" : "Button", "width_request" : 50, "$ xns" : "Gtk", "height_request" : 50, "items" : [ { "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "help-about", "$ xns" : "Gtk" } ] } ] } ] } ] } ] } ] } ] }, { "id" : "statusbar", "* init" : "{\n Resources.singleton().updateProgress.connect((pos) => {\n if (pos < 1) {\n this.el.hide();\n _this.mainpane.el.set_sensitive(true);\n \n return;\n }\n _this.mainpane.el.set_sensitive(false);\n \n this.el.show();\n var cid = this.el.get_context_id(\"resources\");\n this.el.remove_all(cid);\n this.el.push(cid,\"Fetching Resource : %s/7\".printf(pos.to_string()));\n });\n}\n", "xtype" : "Statusbar", "* pack" : "pack_end,false,true,0", "$ xns" : "Gtk" } ] } ] } ] }