[gtk-doc] mkdb: generate a short desc for index entries. Partialy fixes #115531



commit 4f253d2e300e5e5a64ed4c5d99448f432062c879
Author: Stefan Kost <ensonic users sf net>
Date:   Sun Dec 20 00:10:25 2009 +0200

    mkdb: generate a short desc for index entries. Partialy fixes #115531

 gtkdoc-mkdb.in |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 4a3283c..d888cf3 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -881,12 +881,42 @@ sub OutputIndex {
         keys %apiindex) {
 
         $symbol = $$hash{original};
-        if(defined($$hash{short})) {
+        if (defined($$hash{short})) {
             $short_symbol = $$hash{short};
         } else {
             $short_symbol = $symbol;
         }
 
+        # generate a short symbol description
+        my $symbol_desc = "";
+        my $symbol_type = lc($DeclarationTypes{$symbol});
+        if ($symbol_type eq "") {
+            if ($symbol =~ m/(.*?)::(.*)/) {
+                my $object = $1;
+                my $osym = $2;
+                my $i;
+                for ($i = 0; $i <= $#ArgNames; $i++) {
+                    if ($ArgNames[$i] eq $osym) {
+                        $symbol_type = "object property";
+                        last;
+                    }
+                }
+            } elsif ($symbol =~ m/(.*?):(.*)/) {
+                my $object = $1;
+                my $osym = $2;
+                my $i;
+                for ($i = 0; $i <= $#SignalNames; $i++) {
+                    if ($SignalNames[$i] eq $osym) {
+                        $symbol_type = "object signal";
+                        last;
+                    }
+                }
+            }
+        }
+        if ($symbol_type ne "") {
+           $symbol_desc=", $symbol_type";
+        }
+
         my $curletter = uc(substr($short_symbol,0,1));
         my $id = $apiindex{$symbol};
 
@@ -903,7 +933,7 @@ sub OutputIndex {
         }
 
         print (OUTPUT <<EOF);
-<indexentry><primaryie linkends="$id"><link linkend="$id">$symbol</link></primaryie></indexentry>
+<indexentry><primaryie linkends="$id"><link linkend="$id">$symbol</link>$symbol_desc</primaryie></indexentry>
 EOF
     }
 
@@ -1113,7 +1143,6 @@ sub OutputDeclaration {
 	return &OutputUnion ($symbol, $declaration);
     } elsif ($type eq 'VARIABLE') {
 	return &OutputVariable ($symbol, $declaration);
-
     } elsif ($type eq 'FUNCTION') {
 	return &OutputFunction ($symbol, $declaration, $type);
     } elsif ($type eq 'USER_FUNCTION') {



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