[glibmm] Gmmproc: Try harder to limit false unwrapped properties.



commit bce75b11fc4ea4957cec245fd9eb6fc5252576bc
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Thu Jan 6 11:26:32 2011 +0100

    Gmmproc: Try harder to limit false unwrapped properties.
    
    * tools/pm/GtkDefs.pm: When taking list of properties that are
    unwrapped, try to filter out the properties defined in base class.

 ChangeLog           |    7 +++++++
 tools/pm/GtkDefs.pm |   30 +++++++++++++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5609912..edf0590 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-06  Krzesimir Nowak  <qdlacz gmail com>
+
+	Gmmproc: Try harder to limit false unwrapped properties.
+
+        * tools/pm/GtkDefs.pm: When taking list of properties that are
+        unwrapped, try to filter out the properties defined in base class.
+
 2011-01-05  José Alburquerque  <jaalburqu svn gnome org>
 
 	DBusServer: Correct the "active" property.
diff --git a/tools/pm/GtkDefs.pm b/tools/pm/GtkDefs.pm
index 694b423..978a848 100644
--- a/tools/pm/GtkDefs.pm
+++ b/tools/pm/GtkDefs.pm
@@ -378,8 +378,36 @@ sub get_unwrapped
   my $class;
   foreach $class (@classes)
   {
+    # if this class's parent is defined then don't put its properties as unwrapped.
+    # this may not work if parent is from other library (GtkApplication's parent
+    # is GApplication, so all its properties will be marked as unwrapped)
+    my $detailed = 0;
+    my $object = $GtkDefs::objects{$class};
+    if (exists $GtkDefs::objects{$class})
+    {
+      my $object = $GtkDefs::objects{$class};
+
+      if (defined $object)
+      {
+        my $parent = $object->{parent};
+
+        # may be empty for some classes deriving a GInterface?
+        if ($parent)
+        {
+          $detailed = 1;
+        }
+      }
+    }
+    if ($detailed)
+    {
+      push @unwrapped, grep {$$_{class} eq $class && $$_{mark}==0 && not exists $GtkDefs::properties{$object->{parent} . '::' . $_->{name}}} values %GtkDefs::properties;
+    }
+    else
+    {
+      push @unwrapped, grep {$$_{class} eq $class && $$_{mark}==0} values %GtkDefs::properties;
+    }
+
     push @unwrapped, grep {$$_{class} eq $class && $$_{mark}==0} values %GtkDefs::methods;
-    push @unwrapped, grep {$$_{class} eq $class && $$_{mark}==0} values %GtkDefs::properties;
     push @unwrapped, grep {$$_{class} eq $class && $$_{mark}==0} values %GtkDefs::signals;
   }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]