EXTRA_DIST=mainwnd.desc inpdialog.desc pref.desc reslist.desc dolcon.desktop
-BUILT_SOURCES=mainwnd.gtk inpdialog.gtk pref.gtk reslist.gtk
+BUILT_SOURCES= mainwnd.gtk inpdialog.gtk pref.gtk reslist.gtk
main.c: mainwnd.gtk inpdialog.gtk pref.gtk reslist.gtk
-DLOCALEDIR=\"$(localedir)\"
.desc.gtk: $(top_srcdir)/common/makegdesc
- cpp $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $< | $(top_srcdir)/common/makegdesc >$@
+ target="$@"; \
+ basename="$${target%.gtk}"; \
+ cpp $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $< \
+ | $(top_srcdir)/common/makegdesc -h "$${basename}.gtkh" >$@
mainwnd.desc: ../../config.h
#!/usr/bin/perl
+use Getopt::Long;
+use IO::File;
+
+GetOptions(\%args, "h=s") || exit 1;
+
$tempvar = 0;
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);
}
}
+if($args{"h"})
+{
+ $hfile = IO::File->new($args{"h"}, "w") || die;
+ printheader $rootwidgets, $hfile;
+ $hfile->close();
+}
+
printvars $rootwidgets;
print "\n";
print "GtkWidget *create_" . $options{"prefix"} . "wnd(void)\n";