private Gee.ArrayList<Node> items; // child items..
public GLib.ListStore childstore; // must be kept in sync with items
public GLib.ListStore? propstore; // must be kept in sync with items
- public string xvala_cls;
- public string xvala_xcls; // 'Xcls_' + id;
- public string xvala_id; // item id or ""
+ public string xvala_cls; // set by node to vala
+ public string xvala_xcls; // 'Xcls_' + id; // set by nodetoVala
+ public string xvala_id; // item id or "" // set by nodetovala
// line markers..
public int line_start;
public Gee.ArrayList<int> node_lines;
public Gee.HashMap<int,Node> node_lines_map; // store of l:xxx or p:....
+
+ public string node_pad = "";
+
private int _updated_count = 0;
public int updated_count {
get {
set {
this.nodeTitleProp = ""; // ?? should trigger set?
this.iconFilename = "";
- this. _updated_count = value;
+ this._updated_count = value;
+
+
+ //GLib.debug("Update Node %d p%d - rev %d", this.oid, this.parent != null ? this.parent.oid : -1, value);
+ if (this.parent != null) {
+ this.parent.updated_count++;
+ } else {
+ //GLib.debug("UNDO top node is %d", value);
+ this.version_changed();
+ }
}
} // changes to this trigger updates on the tree..
-
+
+ public string as_source = "";
+ public int as_source_version = -1;
+ public int as_source_start_line = -1;
+
+
+
+ public signal void version_changed();
+
public Node()
{
this.items = new Gee.ArrayList<Node>();
}
+ public bool has_parent(Node n)
+ {
+ if (this.parent == null) {
+ return false;
+ }
+ if (this.parent.oid == n.oid) {
+ return true;
+ }
+
+
+ return this.parent.has_parent(n);
+ }
+
+
public Gee.ArrayList<Node> readItems()
{
return this.items; // note should not modify add/remove from this directly..
+
//GLib.debug("setLine %d, %s", line, type + ":" + prop);
}
public void sortLines() {
owned get { return this.fqn(); }
private set {}
}
-
+ public string NS { // for sorting
+ owned get { return this.props.has_key("xns") ? this.props.get("xns").val : ""; }
+ private set {}
+ }
public string fqn()
{
if (!this.hasXnsType ()) {
if ( this.parent.childstore.find(this, out pos)) {
this.parent.childstore.remove(pos);
}
-
+ this.parent.updated_count++;
this.parent.items = nlist;
this.parent = null;