Fix #8076 - gtknotebookpage fake wrapper
[roobuilder] / src / JsRender / NodeToValaWrapped.vala
index 5ddf32f..b5b2e39 100644 (file)
@@ -27,8 +27,7 @@
 public class JsRender.NodeToValaWrapped : NodeToVala {
 
 
-       
-
+        
        public NodeToValaWrapped( JsRender file,  Node node,  int depth, NodeToVala? parent) 
        {
                base (file, node, depth, parent);
@@ -56,8 +55,14 @@ public class JsRender.NodeToValaWrapped : NodeToVala {
        public override string munge ( )
        {
                //return this.mungeToString(this.node);
-               
-       
+               if (this.node.as_source_version > 0 && 
+                       this.node.as_source_version == this.node.updated_count &&
+                       this.node.as_source_start_line == cur_line &&
+                       this.node.as_source != ""
+               ) {
+                       return this.node.as_source;
+               }
+               this.node.as_source_start_line = cur_line;
                
                this.namespaceHeader();
                this.globalVars();
@@ -82,6 +87,9 @@ public class JsRender.NodeToValaWrapped : NodeToVala {
                this.iterChildren();
                this.namespaceFooter();
                
+               this.node.as_source_version = this.node.updated_count;
+               this.node.as_source == this.ret;
                return this.ret;
                 
                         
@@ -166,7 +174,8 @@ public class JsRender.NodeToValaWrapped : NodeToVala {
                        //for (var ari =0; ari < ar.length; ari++) {
                                //      cargs +=  (ar[ari].trim().split(" ").pop();
                                  // }
-                       }
+               }
+               
        
                if (this.depth < 1) {
                 
@@ -180,6 +189,10 @@ public class JsRender.NodeToValaWrapped : NodeToVala {
                        var top = this.top as NodeToVala;
                        var tcls = top == null ? "???" : top.xcls;
                        // for sub classes = we passs the top level as _owner
+                       if (this.node.fqn() == "Gtk.NotebookPage") {
+                               cargs_str += ", " + this.node.parent.xvala_xcls + " notebook";
+                       }
+                       
                        this.addLine(this.pad + "public " + this.xcls + "(" +  tcls + " _owner " + cargs_str + ")");
                        this.addLine(this.pad + "{");
                }
@@ -216,8 +229,11 @@ public class JsRender.NodeToValaWrapped : NodeToVala {
                
                this.node.setLine(this.cur_line, "p", "* xtype");;
                
-               // is the wrapped element a struct?
-               
+
+               // Notebookpage is a fake element 
+               // used to hold label and child...
+                
+               // is the wrapped element a struct?             
                var ncls = Palete.Gir.factoryFqn((Project.Gtk) this.file.project, this.node.fqn());
                if (ncls != null && ncls.nodetype == "Struct") {
                        // we can use regular setters to apply the values.
@@ -231,6 +247,14 @@ public class JsRender.NodeToValaWrapped : NodeToVala {
                var args_str = "";
                switch(this.node.fqn()) {
                
+               
+                       // GTK4
+                       case "Gtk.NotebookPage":
+                               return;
+                               
+               
+               
+               
                // FIXME -- these are all GTK3 - can be removed when I get rid of them..
                        case "Gtk.ComboBox":
                                var is_entry = this.node.has("has_entry") && this.node.get_prop("has_entry").val.down() == "true";