[gtk+] gtk-demo: Add a name property to the demos



commit 3d98275961e072839dbe5e021509d730e22339ce
Author: Benjamin Otte <otte redhat com>
Date:   Sun May 13 19:51:15 2012 +0200

    gtk-demo: Add a name property to the demos

 demos/gtk-demo/geninclude.pl.in |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/demos/gtk-demo/geninclude.pl.in b/demos/gtk-demo/geninclude.pl.in
index 9b98663..0848416 100755
--- a/demos/gtk-demo/geninclude.pl.in
+++ b/demos/gtk-demo/geninclude.pl.in
@@ -7,6 +7,7 @@ typedef struct _Demo Demo;
 
 struct _Demo 
 {
+  gchar *name;
   gchar *title;
   gchar *filename;
   GDoDemoFunc func;
@@ -36,7 +37,7 @@ for $file (@ARGV) {
 
     print "GtkWidget *do_$basename (GtkWidget *do_widget);\n";
 
-    push @demos, {"title" => $title, "file" => "$file $extra",
+    push @demos, {"name" => $basename, "title" => $title, "file" => "$file $extra",
 		  "func"  => "do_$basename"};
 }
 
@@ -64,7 +65,7 @@ foreach $href (@demos) {
 	$tmp = (defined @child_arrays)?($#child_arrays + 1):0;
 	push @child_arrays, "child$tmp";
 
-	push @demos, {"title" => $parent_name, "file" => "NULL",
+	push @demos, {"name" => "NULL", "title" => $parent_name, "file" => "NULL",
 		      "func" => "NULL"};
     }
 }
@@ -91,7 +92,7 @@ if (defined @parents) {
 		    print ",\n";
 		}
 		
-		print qq (  { "$1", "$demos[$j]{file}", $demos[$j]{func}, NULL });
+		print qq (  { "$demos[$j]{name}", "$1", "$demos[$j]{file}", $demos[$j]{func}, NULL });
 
 		# hack ... ugly
 		$demos[$j]{"title"} = "foo";
@@ -145,9 +146,9 @@ foreach $href (@demos) {
 	    if ($parents[$i] eq $href->{title}) {
 
 		if ($href->{file} eq 'NULL') {
-		    print qq (  { "$href->{title}", NULL, $href->{func}, $child_arrays[$i] });
+		    print qq (  { NULL, "$href->{title}", NULL, $href->{func}, $child_arrays[$i] });
 		} else {
-		    print qq (  { "$href->{title}", "$href->{file}", $href->{func}, $child_arrays[$i] });
+		    print qq (  { "$href->{name}", "$href->{title}", "$href->{file}", $href->{func}, $child_arrays[$i] });
 		}
 		
 		$handled = 1;
@@ -160,7 +161,7 @@ foreach $href (@demos) {
 	next;
     }
     
-    print qq (  { "$href->{title}", "$href->{file}", $href->{func}, NULL });
+    print qq (  { "$href->{name}", "$href->{title}", "$href->{file}", $href->{func}, NULL });
 }
 
 print ",\n";



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