[glibmm] Add debug output to hint that you *_docs.xmls needs a define-object.



commit 048e9c4c694d78c6c58ac60a46e693564a0af67a
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jun 18 18:30:46 2009 +0200

    Add debug output to hint that you *_docs.xmls needs a define-object.
    
    * tools/pm/DocsParser.pm: lookup_object_of_method(),
    * tools/pm/GtkDefs.pm: lookup_object(): Add debug output to hint that you
    need a define-object for each C GType in the *_docs.xml file, though I
    do not yet know why these are sometimes missing.

 ChangeLog              |    9 +++++++++
 tools/pm/DocsParser.pm |   17 ++++++++++++++---
 tools/pm/GtkDefs.pm    |   17 ++++++++++++++++-
 3 files changed, 39 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f6cc9da..fc3b3a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-06-18  Murray Cumming  <murrayc murrayc com>
 
+  Add debug output to hint that you *_docs.xmls needs a define-object.
+	
+	* tools/pm/DocsParser.pm: lookup_object_of_method(),
+	* tools/pm/GtkDefs.pm: lookup_object(): Add debug output to hint that you 
+	need a define-object for each C GType in the *_docs.xml file, though I 
+	do not yet know why these are sometimes missing.
+
+2009-06-18  Murray Cumming  <murrayc murrayc com>
+
 	* configure.ac: Require glib 2.21, because g_cancellable_connect/disconnect() 
 	are not in glib 2.20.
 
diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm
index ca4ef95..f56f30e 100644
--- a/tools/pm/DocsParser.pm
+++ b/tools/pm/DocsParser.pm
@@ -440,9 +440,9 @@ sub substitute_function($$)
     }
     else
     {
-      print "Documentation: Translated $name into ";  
+      print "Documentation: Transformed C name $name into ";  
       non_object_method_name($doc_func, \$name);
-      print "$name\n";
+      print "C++ name $name\n";
     }
   }
   else
@@ -481,6 +481,7 @@ sub non_object_method_name($$)
       }
     }
   }
+  
   print STDERR "Documentation: Class/Namespace for $$name not found\n";
 }   
 
@@ -490,8 +491,18 @@ sub lookup_object_of_method($$)
 
   if($object ne "")
   {
+    my $result = GtkDefs::lookup_object($object);
+
     # We already know the C object name, because $name is a non-static method.
-    return GtkDefs::lookup_object($object);
+    if(defined($result) and ($result ne ""))
+    {
+      return $result;
+    }
+    else
+    {
+      print "DocsParser.pm:lookup_object_of_method(): Warning: GtkDefs::lookup_object() failed for function name=" . $name . "\n";
+      print "  This may be a missing define-object in a *_docs.xml file."
+    }
   }
 
   my @parts = split(/_/, $name);
diff --git a/tools/pm/GtkDefs.pm b/tools/pm/GtkDefs.pm
index fbe1d1c..7c791b8 100644
--- a/tools/pm/GtkDefs.pm
+++ b/tools/pm/GtkDefs.pm
@@ -298,7 +298,22 @@ sub lookup_enum($)
 sub lookup_object($)
 {
   no warnings;
-  return $GtkDefs::objects{$_[0]};
+  
+  my $c_name = $_[0];
+  my $result = $GtkDefs::objects{$c_name};
+  
+  if (not defined($result))
+  {
+    print "GtkDefs:lookup_object(): can't find object with name=" . $c_name . "\n";
+    
+    # debug output:
+    # foreach my $key (keys %GtkDefs::objects)
+    # {
+    #  print "  possible name=" . $key . "\n";
+    # }
+  }
+
+  return $result;
 }
 
 # $objProperty lookup_property($name, $parent_object_name)



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