+ private string last_ptype_check = "";
+ public bool is_invalid_ptype {
+ get;
+ private set ;
+ default = false;
+ }
+
+ public bool update_is_valid_ptype(Project.Project project)
+ {
+
+ if (this.parent == null) {
+ return false;
+ }
+ // what types are we interested in checking?
+ // raw/ prop / user
+ if (this.ptype != NodePropType.PROP && this.ptype != NodePropType.USER) {
+ return false;
+ }
+ if (this.name == "xtype" || this.name == "xns" || this.name == "id" ) { // flaky..
+ return false;
+ }
+ if (this.name == this.last_ptype_check) {
+ return this.is_invalid_ptype;
+ }
+ if (project.xtype != "Gtk") { // js not handled?
+ return false;
+ }
+ this.last_ptype_check = this.name;
+
+ var cls = Palete.Gir.factoryFqn(project, this.parent.fqn());
+ if (cls == null) {
+ this.is_invalid_ptype = false;
+ return false;
+ }
+ var is_native = cls.props.has_key(this.name);
+ if ( is_native && this.ptype == NodePropType.PROP ) {
+ this.is_invalid_ptype = false;
+ return false;
+ }
+ if ( !is_native && this.ptype == NodePropType.USER ) {
+ this.is_invalid_ptype = false;
+ return false;
+ }
+
+ this.is_invalid_ptype = true;
+ return true;
+
+
+
+ }