Dolda2000 GitWeb
/
doldaconnect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ChangeLog update.
[doldaconnect.git]
/
common
/
makegdesc
diff --git
a/common/makegdesc
b/common/makegdesc
index
37c6a53
..
cfcb6f1
100755
(executable)
--- a/
common/makegdesc
+++ b/
common/makegdesc
@@
-1,5
+1,10
@@
#!/usr/bin/perl
#!/usr/bin/perl
+use Getopt::Long;
+use IO::File;
+
+GetOptions(\%args, "h=s") || exit 1;
+
$tempvar = 0;
sub printwidgets
$tempvar = 0;
sub printwidgets
@@
-198,7
+203,7
@@
sub printwidgets
} elsif($widget->{"type"} eq "notebook") {
print "${p}stack[$sl] = gtk_notebook_new();\n";
if(defined($widget->{"pos"})) {
} elsif($widget->{"type"} eq "notebook") {
print "${p}stack[$sl] = gtk_notebook_new();\n";
if(defined($widget->{"pos"})) {
- print "${p}gtk_notebook_set_tab_pos(GTK_NOTEBOOK(stack[$sl]), GTK_POS_" . $widget->{"pos"} . ")\n";
+ print "${p}gtk_notebook_set_tab_pos(GTK_NOTEBOOK(stack[$sl]), GTK_POS_" . $widget->{"pos"} . ")
;
\n";
}
$pf = sub
{
}
$pf = sub
{
@@
-400,7
+405,7
@@
sub printwidgets
$cb = $widget->{$attr};
$data = "NULL";
}
$cb = $widget->{$attr};
$data = "NULL";
}
- print "${p}g_signal_connect(G_OBJECT(stack[$sl]), \"$
1
\", G_CALLBACK($cb), (gpointer)$data);\n";
+ print "${p}g_signal_connect(G_OBJECT(stack[$sl]), \"$
sig
\", G_CALLBACK($cb), (gpointer)$data);\n";
}
}
if($widget->{"subwidgets"})
}
}
if($widget->{"subwidgets"})
@@
-423,6
+428,20
@@
sub printwidgets
}
}
}
}
+sub printheader
+{
+ my($widget, $handle);
+ $handle = $_[1];
+ foreach $widget (@{$_[0]})
+ {
+ if($widget->{"var"})
+ {
+ $handle->print("extern GtkWidget *" . $options{"prefix"} . $widget->{"name"} .";\n");
+ }
+ printheader($widget->{"subwidgets"}, $handle) if($widget->{"subwidgets"});
+ }
+}
+
sub printvars
{
my($widget);
sub printvars
{
my($widget);
@@
-488,6
+507,14
@@
while(<>)
}
}
}
}
+if($args{"h"})
+{
+ $hfile = IO::File->new($args{"h"}, "w") || die;
+ $hfile->print("GtkWidget *create_" . $options{"prefix"} . "wnd(void);\n");
+ printheader $rootwidgets, $hfile;
+ $hfile->close();
+}
+
printvars $rootwidgets;
print "\n";
print "GtkWidget *create_" . $options{"prefix"} . "wnd(void)\n";
printvars $rootwidgets;
print "\n";
print "GtkWidget *create_" . $options{"prefix"} . "wnd(void)\n";