summaryrefslogtreecommitdiff
path: root/gtk/genmarshal.pl
diff options
context:
space:
mode:
authorElliot Lee <sopwith@src.gnome.org>1998-07-21 04:13:42 +0000
committerElliot Lee <sopwith@src.gnome.org>1998-07-21 04:13:42 +0000
commit7c30f2a15fbfa5f50d4859d635ab15ad1d6e1d37 (patch)
treefd630d133421ca0ea39f55a4130ced3e34c029ff /gtk/genmarshal.pl
parentcebb7bfc9f6cff18b06716fb8e536998f1a3df9a (diff)
downloadgtk+-7c30f2a15fbfa5f50d4859d635ab15ad1d6e1d37.tar.gz
Use common marshalling routines instead of having widget-private ones. It
Use common marshalling routines instead of having widget-private ones. It compiles & links. testgtk segfaults. I'm convinced that is Somebody Else's Problem (marshalling routine gets func_data=0x0 and blithely passes it on) but the fact that it happens now & not before makes me wrong :-)
Diffstat (limited to 'gtk/genmarshal.pl')
-rwxr-xr-xgtk/genmarshal.pl59
1 files changed, 45 insertions, 14 deletions
diff --git a/gtk/genmarshal.pl b/gtk/genmarshal.pl
index dc4ce54d64..43652b3f6c 100755
--- a/gtk/genmarshal.pl
+++ b/gtk/genmarshal.pl
@@ -11,18 +11,28 @@
"BOXED"=>"gpointer", "FOREIGN"=>"gpointer",
"CALLBACK"=>"gpointer", "POINTER"=>"gpointer",
"ARGS"=>"gpointer", "SIGNAL"=>"gpointer",
- "C_CALLBACK"=>"gpointer", "OBJECT"=>"gpointer");
+ "C_CALLBACK"=>"gpointer", "OBJECT"=>"gpointer",
+ "STYLE"=>"gpointer", "GDK_EVENT"=>"gpointer");
-open(IL, "<".$ENV{'srcdir'}."/gtkmarshal.list") || die("Open failed: $!");
-open(OH, "|indent >".$ENV{'srcdir'}."/gtkmarshal.h") || die("Open failed: $!");
-open(OS, "|indent >".$ENV{'srcdir'}."/gtkmarshal.c") || die("Open failed: $!");
+$srcdir = $ENV{'srcdir'} || '.';
+
+open(IL, "<$srcdir/gtkmarshal.list") || die("Open failed: $!");
+open(OH, "|indent > $srcdir/gtkmarshal.h") || die("Open failed: $!");
+open(OS, "|indent > $srcdir/gtkmarshal.c") || die("Open failed: $!");
print OH <<EOT;
#ifndef __GTKMARSHAL_H__
#define __GTKMARSHAL_H__ 1
-#include "gtktypeutils.h"
-#include "gtkobject.h"
+#include <gtk/gtktypeutils.h>
+#include <gtk/gtkobject.h>
+
+#ifdef __cplusplus
+extern "C" {
+#pragma }
+#endif /* __cplusplus */
+
+#define gtk_signal_default_marshaller gtk_marshal_NONE__NONE
EOT
@@ -33,32 +43,46 @@ while(chomp($aline = <IL>)) {
@params = split(/\s*,\s*/, $paramlist);
my $funcname = $retval."__".join("_",@params);
+ my $defname;
next if (exists $defs{$funcname});
$doequiv = 0;
for (@params, $retval) {
- if ($trans{$_} eq "gpointer") {
+ if ($trans{$_} eq "gpointer" && $_ ne "POINTER") {
$doequiv = 1;
last;
- }
+ }
+ if($_ eq "ENUM" || $_ eq "UINT" || $_ eq "ULONG") {
+ $doequiv = 1;
+ last;
+ }
}
# Translate all function pointers to gpointer
- $defname = "";
+ $defname = $funcname;
if($doequiv) {
print OH "#define gtk_marshal_$funcname ";
$defs{$defname} = 1;
for (@params, $retval) {
- if ($trans{$_} eq "gpointer") {
- $_ = "POINTER";
- }
+ if ($trans{$_} eq "gpointer") {
+ $_ = "POINTER";
+ }
+ if($_ eq "ENUM") {
+ $_ = "UINT";
+ }
+ if($_ eq "UINT") {
+ $_ = "INT"; # Unvalidated assumption - please check
+ }
+ if($_ eq "ULONG") {
+ $_ = "LONG";
+ }
}
$funcname = $retval."__".join("_",@params);
- print OH "gtk_marshal_$funcname\n";
+ print OH "gtk_marshal_$funcname\n\n";
next if (exists $defs{$funcname});
}
$defs{$funcname} = 1;
@@ -103,6 +127,13 @@ EOT
print OS " func_data);\n}\n\n";
}
-print OH "#endif\n";
+print OH <<EOT;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GTKMARSHAL_H__ */
+EOT
close(IL); close(OH); close(OS);