this.el.default_width = 1000;
this.el.modal = true;
var child_1 = new Xcls_Box1( _this );
+ child_1.ref();
this.el.child = child_1.el;
- var child_2 = new Xcls_HeaderBar43( _this );
+ var child_2 = new Xcls_HeaderBar44( _this );
+ child_2.ref();
this.el.titlebar = child_2.el;
// init method
this.el.start_child = _this.projectscroll.el;
new Xcls_filepane( _this );
this.el.end_child = _this.filepane.el;
- var child_3 = new Xcls_EventControllerKey411( _this );
+ var child_3 = new Xcls_EventControllerKey43( _this );
child_3.ref();
this.el.add_controller( child_3.el );
}
this.el.position = 200;
this.el.visible = false;
var child_1 = new Xcls_Box14( _this );
+ child_1.ref();
this.el.end_child = child_1.el;
new Xcls_treescroll( _this );
this.el.start_child = _this.treescroll.el;
- public class Xcls_EventControllerKey411 : Object
+ public class Xcls_EventControllerKey43 : Object
{
public Gtk.EventControllerKey el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_EventControllerKey411(DialogFiles _owner )
+ public Xcls_EventControllerKey43(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.EventControllerKey();
- public class Xcls_HeaderBar43 : Object
+ public class Xcls_HeaderBar44 : Object
{
public Gtk.HeaderBar el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_HeaderBar43(DialogFiles _owner )
+ public Xcls_HeaderBar44(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.HeaderBar();
// set gobject values
this.el.show_title_buttons = false;
- var child_1 = new Xcls_Button44( _this );
+ var child_1 = new Xcls_Button45( _this );
child_1.ref();
this.el.pack_end ( child_1.el );
new Xcls_btn_newproj( _this );
// user defined functions
}
- public class Xcls_Button44 : Object
+ public class Xcls_Button45 : Object
{
public Gtk.Button el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Button44(DialogFiles _owner )
+ public Xcls_Button45(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Button();
// my vars (dec)
// set gobject values
- var child_1 = new Xcls_Box46( _this );
+ var child_1 = new Xcls_Box47( _this );
+ child_1.ref();
this.el.child = child_1.el;
//listeners
_this.show( pe.result , _this.new_window);
}
}
- public class Xcls_Box46 : Object
+ public class Xcls_Box47 : Object
{
public Gtk.Box el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Box46(DialogFiles _owner )
+ public Xcls_Box47(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
// my vars (dec)
// set gobject values
- var child_1 = new Xcls_Image47( _this );
+ var child_1 = new Xcls_Image48( _this );
child_1.ref();
this.el.append( child_1.el );
- var child_2 = new Xcls_Label48( _this );
+ var child_2 = new Xcls_Label49( _this );
child_2.ref();
this.el.append( child_2.el );
}
// user defined functions
}
- public class Xcls_Image47 : Object
+ public class Xcls_Image48 : Object
{
public Gtk.Image el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Image47(DialogFiles _owner )
+ public Xcls_Image48(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Image();
// user defined functions
}
- public class Xcls_Label48 : Object
+ public class Xcls_Label49 : Object
{
public Gtk.Label el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Label48(DialogFiles _owner )
+ public Xcls_Label49(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Label( "New Project" );
// my vars (dec)
// set gobject values
- var child_1 = new Xcls_Box50( _this );
+ var child_1 = new Xcls_Box51( _this );
+ child_1.ref();
this.el.child = child_1.el;
//listeners
// user defined functions
}
- public class Xcls_Box50 : Object
+ public class Xcls_Box51 : Object
{
public Gtk.Box el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Box50(DialogFiles _owner )
+ public Xcls_Box51(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
// my vars (dec)
// set gobject values
- var child_1 = new Xcls_Image51( _this );
+ var child_1 = new Xcls_Image52( _this );
child_1.ref();
this.el.append( child_1.el );
- var child_2 = new Xcls_Label52( _this );
+ var child_2 = new Xcls_Label53( _this );
child_2.ref();
this.el.append( child_2.el );
}
// user defined functions
}
- public class Xcls_Image51 : Object
+ public class Xcls_Image52 : Object
{
public Gtk.Image el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Image51(DialogFiles _owner )
+ public Xcls_Image52(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Image();
// user defined functions
}
- public class Xcls_Label52 : Object
+ public class Xcls_Label53 : Object
{
public Gtk.Label el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Label52(DialogFiles _owner )
+ public Xcls_Label53(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Label( "Project Properties" );
this.confirm = null;
// set gobject values
- var child_1 = new Xcls_Box54( _this );
+ var child_1 = new Xcls_Box55( _this );
+ child_1.ref();
this.el.child = child_1.el;
//listeners
// user defined functions
}
- public class Xcls_Box54 : Object
+ public class Xcls_Box55 : Object
{
public Gtk.Box el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Box54(DialogFiles _owner )
+ public Xcls_Box55(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
// my vars (dec)
// set gobject values
- var child_1 = new Xcls_Image55( _this );
+ var child_1 = new Xcls_Image56( _this );
child_1.ref();
this.el.append( child_1.el );
- var child_2 = new Xcls_Label56( _this );
+ var child_2 = new Xcls_Label57( _this );
child_2.ref();
this.el.append( child_2.el );
}
// user defined functions
}
- public class Xcls_Image55 : Object
+ public class Xcls_Image56 : Object
{
public Gtk.Image el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Image55(DialogFiles _owner )
+ public Xcls_Image56(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Image();
// user defined functions
}
- public class Xcls_Label56 : Object
+ public class Xcls_Label57 : Object
{
public Gtk.Label el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Label56(DialogFiles _owner )
+ public Xcls_Label57(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Label( "Delete Project" );
// my vars (dec)
// set gobject values
- var child_1 = new Xcls_Box58( _this );
+ var child_1 = new Xcls_Box59( _this );
+ child_1.ref();
this.el.child = child_1.el;
//listeners
// user defined functions
}
- public class Xcls_Box58 : Object
+ public class Xcls_Box59 : Object
{
public Gtk.Box el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Box58(DialogFiles _owner )
+ public Xcls_Box59(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
// my vars (dec)
// set gobject values
- var child_1 = new Xcls_Image59( _this );
+ var child_1 = new Xcls_Image60( _this );
child_1.ref();
this.el.append( child_1.el );
- var child_2 = new Xcls_Label60( _this );
+ var child_2 = new Xcls_Label61( _this );
child_2.ref();
this.el.append( child_2.el );
}
// user defined functions
}
- public class Xcls_Image59 : Object
+ public class Xcls_Image60 : Object
{
public Gtk.Image el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Image59(DialogFiles _owner )
+ public Xcls_Image60(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Image();
// user defined functions
}
- public class Xcls_Label60 : Object
+ public class Xcls_Label61 : Object
{
public Gtk.Label el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Label60(DialogFiles _owner )
+ public Xcls_Label61(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Label( "New File" );
this.confirm = null;
// set gobject values
- var child_1 = new Xcls_Box62( _this );
+ var child_1 = new Xcls_Box63( _this );
+ child_1.ref();
this.el.child = child_1.el;
//listeners
// user defined functions
}
- public class Xcls_Box62 : Object
+ public class Xcls_Box63 : Object
{
public Gtk.Box el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Box62(DialogFiles _owner )
+ public Xcls_Box63(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
// my vars (dec)
// set gobject values
- var child_1 = new Xcls_Image63( _this );
+ var child_1 = new Xcls_Image64( _this );
child_1.ref();
this.el.append( child_1.el );
- var child_2 = new Xcls_Label64( _this );
+ var child_2 = new Xcls_Label65( _this );
child_2.ref();
this.el.append( child_2.el );
}
// user defined functions
}
- public class Xcls_Image63 : Object
+ public class Xcls_Image64 : Object
{
public Gtk.Image el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Image63(DialogFiles _owner )
+ public Xcls_Image64(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Image();
// user defined functions
}
- public class Xcls_Label64 : Object
+ public class Xcls_Label65 : Object
{
public Gtk.Label el;
private DialogFiles _this;
// my vars (def)
// ctor
- public Xcls_Label64(DialogFiles _owner )
+ public Xcls_Label65(DialogFiles _owner )
{
_this = _owner;
this.el = new Gtk.Label( "Delete File" );
Node node;
Project.Gtk project;
Xml.Node* parent;
+ Xml.Doc* doc;
public NodeToGlade( Project.Gtk project, Node node, Xml.Node* parent)
{
{
- var doc = this.mungeNode ();
+ this.mungeNode ();
string ret;
int len;
- doc->dump_memory_format (out ret, out len, true);
+ this.doc->dump_memory_format (out ret, out len, true);
return ret;
}
- public Xml.Doc* mungeChild( Node cnode , Xml.Node* cdom)
+ public Xml.Node* mungeChild( Node cnode , Xml.Node* cdom)
{
var x = new NodeToGlade(this.project, cnode, cdom);
return x.mungeNode();
}
- public Xml.Doc* mungeNode()
+ public Xml.Node* mungeNode()
{
- Xml.Doc* doc;
+
var is_top = false;
if (this.parent == null) {
is_top = true;
- doc = new Xml.Doc("1.0");
+ this.doc = new Xml.Doc("1.0");
var inf = this.create_element("interface");
- doc->set_root_element(inf);
+ this.doc->set_root_element(inf);
var req = this.create_element("requires");
req->set_prop("lib", "gtk+");
req->set_prop("version", "4.1");
inf->add_child(req);
this.parent = inf;
- } else {
- doc = this.parent->doc;
- }
+ }
+
var cls = this.node.fqn().replace(".", "");
var gdata = Palete.Gir.factoryFqn(this.project, this.node.fqn());
if (gdata == null || !gdata.inherits.contains("Gtk.Buildable")) {
- return doc;
+ switch(cls) {
+ case "GtkColumnViewColumn": //exception to the rule..
+ break;
+ default:
+ return null;
+ }
}
if (gdata.inherits.contains("Gtk.Native")&& !is_top) {
- return doc;
+ return null;
}
// what namespaces are supported
switch(this.node.NS) {
case "Adw": // works if you call adw.init() in main!
break;
default:
- return doc;
+ return null;
}
// other problems!!!
if (gdata.fqn() == ("Gtk.ListStore")) {
- return doc;
+ return null;
}
-
+
+ // <object class="GtkNotebookPage">
+ // <property name="tab-expand">1</property>
+ // <property name="child">
+ // <property name="label">
// should really use GXml...
var obj = this.create_element("object");
//var id = this.node.uid();
obj->set_prop("class", "GtkFrame");
skip_props = true;
} else {
-
- obj->set_prop("class", cls);
+ switch(cls) {
+ case "GtkHeaderBar":
+ obj->set_prop("class", "GtkBox");
+ this.addProperty(obj, "orientation", "horizontal");
+ skip_props = true;
+ break;
+
+ default:
+ obj->set_prop("class", cls);
+ break;
+ }
}
+
obj->set_prop("id", "w" + this.node.oid.to_string());
this.parent->add_child(obj);
// properties..
if (k == "model") {
continue;
}
+ this.addProperty(obj, k, val);
-
- var domprop = this.create_element("property");
- domprop->set_prop("name", k);
-
-
- domprop->add_child(new Xml.Node.text(val));
- obj->add_child(domprop);
}
// packing???
/*
} */
// children..
-
+ var left = 0, top = 0, cols = 1;
+ if (cls == "GtkGrid") {
+ var colval = this.node.get_prop("* columns");
+ GLib.debug("Columns %s", colval == null ? "no columns" : colval.val);
+ if (colval != null) {
+ cols = int.parse(colval.val);
+ }
+ }
var items = this.node.readItems();
for (var i = 0; i < items.size; i++ ) {
var cn = items.get(i);
var child = this.create_element("child");
- if (cls == "GtkWindow" && cn.fqn() == "Gtk.HeaderBar") {
- child->set_prop("type", "titlebar");
+ if ((cls == "GtkWindow" || cls == "GtkApplicationWindow") && cn.fqn() == "Gtk.HeaderBar") {
+ child->set_prop("type", "label");
}
- this.mungeChild(cn, child);
+ var sub_obj = this.mungeChild(cn, child);
+ if (sub_obj == null) {
+ continue;
+ }
+ if (cls == "GtkGrid") {
+ this.addGridAttach(sub_obj, left, top);
+ left++;
+ if (left == cols) {
+ left = 0;
+ top++;
+ }
+
+
+ }
+
+
+
+
if (child->child_element_count() < 1) {
continue;
}
obj->add_child(child);
}
- return doc;
+ return obj;
}
-
-
+ void addProperty(Xml.Node* obj, string k, string val)
+ {
+ var domprop = this.create_element("property");
+ domprop->set_prop("name", k);
+ domprop->add_child(new Xml.Node.text(val));
+ obj->add_child(domprop);
+ }
+ void addGridAttach(Xml.Node* obj, int left, int top)
+ {
+ var layout = this.create_element("layout");
+ this.addProperty(layout, "column", left.to_string());
+ this.addProperty(layout, "row", top.to_string());
+ obj->add_child(layout);
+
+ }