Clean out a bunch of cruft from the tree.

svn path=/trunk/gtk-sharp/; revision=6988
This commit is contained in:
Mike Kestner 2002-08-24 05:32:26 +00:00
parent 5cb683f3ba
commit 98cf0e893e
22 changed files with 0 additions and 24150 deletions

View file

@ -6,10 +6,3 @@ Prior to checking anything into CVS, please send a patch to the mailing list
for approval. Any patches should be submitted in diff -u format. Also, it is
assumed that the submitter has verified that the patch does not break the
build, and hopefully that it doesn't break runtime.
Patches without Documentation comments will be seriously frowned upon,
if not outright rejected. All classes, methods, properties, events, etc...
that are non-private should be documented with XML comment tags. At a minimum,
the summary and remarks tags, plus returns and params, if applicable. Doing
this as we go is the only feasible way to make sure that our docs won't end
up sucking bigtime.

View file

@ -1,675 +0,0 @@
#!/usr/bin/perl
#
# defs-parse.pl : Gtk+ defs format parser and code generator.
#
# Author: Mike Kestner <mkestner@speakeasy.net>
#
# <c> 2001 Mike Kestner
%maptypes = (
'none', "void", 'gboolean', "bool", 'gint', "int", 'guint', "uint",
'guint32', "uint", 'const-gchar', "String", 'GObject', "GLib.Object",
'gchar', "String", 'gfloat', "float", 'gdouble', "double",
'GList', "IntPtr", 'GSList', "IntPtr", 'gpointer', "IntPtr",
'long', "long", 'gint8', "byte", 'guint8', "byte", 'gint16', "short",
'guint16', "ushort", 'char', "String", 'GPtrArray', "IntPtr[]",
'const-char', "String", 'gushort', "ushort", 'gshort', "short",
'guint1', "bool", 'guchar', "byte", 'GValue', "GLib.Value",
'GtkType', "int", 'glong', "long", 'gulong', "ulong", 'GQuark', "int",
'va_list', "IntPtr", 'GParamSpec', "IntPtr", 'int', "int",
'double', "double", 'gunichar', "String", 'uint1', "bool",
'GtkSignalFunc', "IntPtr");
%marshaltypes = (
'none', "void", 'gboolean', "bool", 'gint', "int", 'guint', "uint",
'guint32', "uint", 'const-gchar', "IntPtr", 'GObject', "IntPtr",
'gchar', "IntPtr", 'gfloat', "float", 'gdouble', "double",
'GList', "IntPtr", 'GSList', "IntPtr", 'gpointer', "IntPtr",
'long', "long", 'gint8', "byte", 'guint8', "byte", 'gint16', "short",
'guint16', "ushort", 'char', "IntPtr", 'GPtrArray', "IntPtr[]",
'const-char', "IntPtr", 'gushort', "ushort", 'gshort', "short",
'guint1', "bool", 'guchar', "byte", 'GValue', "GLib.Value",
'GtkType', "int", 'glong', "long", 'gulong', "ulong", 'GQuark', "int",
'va_list', "IntPtr", 'GParamSpec', "IntPtr", 'int', "int",
'double', "double", 'gunichar', "Unicode", 'uint1', "bool",
'GtkSignalFunc', "IntPtr");
%usings = (
'GLib', "System,System.Collections,System.Runtime.InteropServices,GLib",
'Pango', "System,System.Collections,System.Runtime.InteropServices,GLib,Pango",
'Gdk', "System,System.Collections,System.Runtime.InteropServices,GLib,Pango,Gdk",
'Gtk', "System,System.Collections,System.Runtime.InteropServices,GLib,Pango,Gdk,Gtk,GtkSharp",
'GtkSharp', "System,System.Collections,System.Runtime.InteropServices,GLib,Pango,Gdk,Gtk");
`mkdir -p ../glib/generated`;
`mkdir -p ../pango/generated`;
`mkdir -p ../gdk/generated`;
`mkdir -p ../gtk/generated`;
while ($def = get_def()) {
if ($def =~ /^\(define-(enum|flags)/) {
gen_enum (split (/\n/, $def));
} elsif ($def =~ /^\(define-struct (\w+)/) {
$name = $1;
$def =~ /c-name "(\w+)"/;
$cname=$1;
$def =~ s/\r?\n\s*//g;
$structs{$cname} = $def;
$maptypes{$cname} = $name;
$marshaltypes{$cname} = $name;
} elsif ($def =~ /^\(define-object (\w+)/) {
$name = $1;
$def =~ /c-name "(\w+)"/;
$cname=$1;
$def =~ s/\r?\n\s*//g;
$objects{$cname} = $def;
$maptypes{$cname} = $name;
$marshaltypes{$cname} = "IntPtr";
} elsif ($def =~ /^\(define-(prop|signal|method)/) {
$def =~ /of-object "(\w+)"/;
$cname=$1;
if (exists($objects{$cname})) {
$def =~ s/\r?\n\s*//g;
$objects{$cname} .= "\n$def";
}
} elsif ($def =~ /^\(define-function/) {
if (($def =~ /is-constructor-of (\w+)\)/) &&
(exists($objects{$1}))) {
$cname=$1;
$def =~ s/\r?\n\s*//g;
$objects{$cname} .= "\n$def";
}
} elsif ($def =~ /^\(define-(interface)/) {
# Nothing much to do here, I think.
} elsif ($def =~ /^\(define-boxed/) {
# Probably need to handle these though...
} else {
die "Unexpected definition $def\n";
}
}
foreach $key (keys (%structs)) {
next if ($key =~ /GtkTree|GtkText/);
gen_struct ($key, $structs{$key});
}
foreach $key (keys (%objects)) {
next if ($key =~ /GtkTree|GtkText/);
gen_object (split (/\n/, $objects{$key}));
}
###############
# subroutines
###############
# Gets a single definition from the input stream.
sub get_def
{
while ($line = <STDIN>) {
next if ($line !~ /^\(define/);
$expr = $line;
do {
$line = <STDIN>;
$expr .= $line;
} until ($line =~ /^\)/);
return $expr;
}
return;
}
# Converts a dash or underscore separated name to StudlyCaps.
sub StudCaps
{
my ($symb) = @_;
$symb =~ s/^([a-z])/\u\1/;
$symb =~ s/[-_]([a-z])/\u\1/g;
$symb =~ s/[-_](\d)/\1/g;
return $symb;
}
# Code generation for the enum and flags definitions.
sub gen_enum
{
my (@lines) = @_;
$line = $lines[$pos=0];
$line =~ /^\(define-(enum|flags) (\w+)/;
$type = $1;
$typename = $2;
$line = $lines[++$pos];
$line =~ /\(in-module "(\w+)"/;
$namespace = $1;
$maptypes{"$namespace$typename"} = $typename;
$marshaltypes{"$namespace$typename"} = "int";
do { $line = $lines[++$pos]; } until ($line =~ /\(values/);
@enums = ();
while ($line = $lines[++$pos]) {
last if ($line =~ /^\s*\)/);
if ($line =~ /\((.+)\)/) {
($name, $dontcare, $val) = split (/ /, $1);
$name =~ s/\"//g;
$name = StudCaps ($name);
@enums = (@enums, "$name:$val");
}
}
$dir = "../" . lc ($namespace) . "/generated";
open (OUTFILE, ">$dir/$typename.cs") || die "can't open file";
print OUTFILE "// Generated file: Do not modify\n\n";
print OUTFILE "namespace $namespace {\n\n";
print OUTFILE "\t/// <summary> $typename Enumeration </summary>\n";
print OUTFILE "\t/// <remarks> Valid values:\n";
print OUTFILE "\t///\t<list type = \"bullet\">\n";
foreach $enum (@enums) {
($name) = split (/:/, $enum);
print OUTFILE "\t///\t\t<item> $name </item>\n"
}
print OUTFILE "\t///\t</list>\n\t/// </remarks>\n\n";
if ($type eq "flags") {
print OUTFILE "\tusing System;\n\n\t[Flags]\n";
}
print OUTFILE "\tpublic enum $typename {\n";
$flag = 1;
foreach $enum (@enums) {
($name, $val) = split (/:/, $enum);
if ($val) {
print OUTFILE "\t\t$name = $val,\n";
} elsif ($type eq "enum") {
print OUTFILE "\t\t$name,\n";
} else {
print OUTFILE "\t\t$name = $flag,\n";
$flag *= 2;
}
}
print OUTFILE "\t}\n\n}\n";
close (OUTFILE);
}
# Code generation for the structure definitions.
sub gen_struct
{
my ($cname, $def) = @_;
$def =~ /define-struct (\w+)/;
$name = $1;
$def =~ /in-module "(\w+)"/;
$namespace = $1;
$dir = "../" . lc ($namespace) . "/generated";
open (OUTFILE, ">$dir/$name.cs") || die "can't open file";
print OUTFILE "// Generated file: Do not modify\n\n";
print OUTFILE "namespace $namespace {\n\n";
foreach $ns (split (/,/, $usings{$namespace})) {
print OUTFILE "\tusing $ns;\n";
}
print OUTFILE "\n\t/// <summary> $name Structure </summary>\n";
print OUTFILE "\t/// <remarks>\n\t///\tFIXME: Add docs.\n";
print OUTFILE "\t/// </remarks>\n\n";
print OUTFILE "\t[StructLayout(LayoutKind.Sequential)]\n";
print OUTFILE "\tpublic class $name {\n";
if ($def =~ /fields'\((.*)\)\)\)/) {
foreach $parm (split(/\)'\(/, $1)) {
$parm =~ s/\*//g;
$parm =~ /"(.*)" "(.*)"/;
$ptype = $maptypes{$1};
$pname = $2;
if ($pname =~ /(\w+)\s*\(.*\)/) {
$pname = $1;
$ptype = "IntPtr"; # FIXME: delegate?
}
$pname =~ s/object/objekt/;
$pname =~ s/string/str1ng/;
$pname =~ s/\bin\b/in_/;
if ($pname =~ /(\w+)\s*\[\d+\]/) {
$ptype .= "[]";
$pname = $1;
} elsif ($pname =~ /(\w+)\s*\:\s*(\d+)/) {
$pname = $1;
if ($2 == 1) {
$ptype = "bool";
}
}
print OUTFILE "\t\tpublic $ptype $pname;\n";
}
}
print OUTFILE "\t}\n\n}\n";
close (OUTFILE);
}
# Code generation for objects.
sub gen_object
{
my ($objdef, @defs) = @_;
my ($key, $typename, $parent, $dir, $namespace, $abstract, $def);
$objdef =~ /define-object (\w+)/;
$typename = $1;
$objdef =~ /parent "(\w+)"/;
$parent = $maptypes{$1};
$objdef =~ /in-module "(\w+)"/;
$namespace = $1;
$dir = "../" . lc ($namespace) . "/generated";
open (OUTFILE, ">$dir/$typename.cs") || die "can't open file $dir/$typename.cs";
%props = ();
%signals = ();
%methods = ();
@ctors = ();
foreach $def (@defs) {
if ($def =~ /define-property (\w+)/) {
$props{StudCaps($1)} = $def;
} elsif ($def =~ /define-signal (\w+)/) {
$signals{StudCaps($1)} = $def;
} elsif ($def =~ /define-method (\w+)/) {
$methods{StudCaps($1)} = $def;
} elsif ($def =~ /is-constructor-of/) {
@ctors = (@ctors, $def);
}
}
print OUTFILE "// Generated file: Do not modify\n\n";
print OUTFILE "namespace $namespace {\n\n";
foreach $ns (split (/,/, $usings{$namespace})) {
print OUTFILE "\tusing $ns;\n";
}
print OUTFILE "\n\t/// <summary> $typename Class </summary>\n";
print OUTFILE "\t/// <remarks>\n\t///\t FIXME: Generate docs\n";
print OUTFILE "\t/// </remarks>\n\n";
print OUTFILE "\tpublic ";
if (@ctors == 0) {
print OUTFILE "abstract ";
}
print OUTFILE "class $typename : $parent {\n\n";
# Only generate the wrapper ctor if other ctors exist
if (@ctors) {
print OUTFILE "\t\t/// <summary>\n";
print OUTFILE "\t\t///\t$typename Constructor\n";
print OUTFILE "\t\t/// </summary>\n";
print OUTFILE "\t\t/// <remarks>\n";
print OUTFILE "\t\t///\tWraps a raw GObject reference.\n";
print OUTFILE "\t\t/// </remarks>\n\n";
print OUTFILE "\t\tpublic $typename (IntPtr o)\n\t\t{\n";
print OUTFILE "\t\t\tRawObject = o;\n\t\t}\n\n";
}
foreach $ctor (@ctors) {
print OUTFILE gen_ctor ($ctor, "gtk-1.3.dll");
}
foreach $key (sort (keys (%props))) {
print OUTFILE gen_prop ($key, $props{$key}, "gtk-1.3.dll");
}
if (%signals) {
print OUTFILE "\t\tprivate Hashtable Signals = new Hashtable ();\n\n";
}
foreach $key (sort (keys (%signals))) {
print OUTFILE gen_signal ($key, $signals{$key}, "gtk-1.3.dll");
}
foreach $key (sort (keys (%methods))) {
next if (($key =~ /^(Get|Set)(\w+)/) && exists($props{$2}));
my $mod = "";
if (exists($signals{$key})) {
$mod = "Emit";
}
print OUTFILE gen_method ("$mod$key", $methods{$key}, "gtk-1.3.dll");
}
$custom = "../" . lc ($namespace) . "/$typename.custom";
print OUTFILE `cat $custom` if -e $custom;
print OUTFILE "\t}\n}\n";
close (OUTFILE);
}
# Code generation for signal definitions.
sub gen_signal
{
my ($name, $def, $dll) = @_;
my ($marsh, $cname, @plist, $ret, $sret, $mret, $code);
$def =~ /define-signal (\w+)/;
$cname = "\"$1\"";
$def =~ /return-type \"(\w+)\"/;
$ret = $1;
$def =~ /parameters\s*'\((.*)\)\)\)/;
@plist = split(/\)'\(/, $1);
$marsh = get_sighandler ($def);
$code = "\t\t/// <summary> $name Event </summary>\n";
$code .= "\t\t/// <remarks>\n\t\t///\tFIXME: Get some docs.\n";
$code .= "\t\t/// </remarks>\n\n";
$code .= "\t\tpublic event EventHandler $name {\n";
$code .= "\t\t\tadd {\n";
$code .= "\t\t\t\tif (Events [$cname] == null)\n";
$code .= "\t\t\t\t\tSignals [$cname] = new $marsh (this, RawObject, ";
$code .= "$cname, value);\n";
$code .= "\t\t\t\tEvents.AddHandler ($cname, value);\n\t\t\t}\n";
$code .= "\t\t\tremove {\n";
$code .= "\t\t\t\tEvents.RemoveHandler ($cname, value);\n";
$code .= "\t\t\t\tif (Events [$cname] == null)\n";
$code .= "\t\t\t\t\tSignals.Remove ($cname);\n\t\t\t}\n\t\t}\n\n";
return $code;
}
# Code generation for property definitions.
sub gen_prop
{
my ($name, $def, $dll) = @_;
my ($cname, $mode, $sret, $mret, $docs, $code);
$def =~ /define-property (\w+)/;
$cname = $1;
$def =~ /prop-type "(\w+)/;
if (exists ($objects{$1}) || ($1 =~ /GObject/)) {
$sret = $maptypes{$1};
$mret = "GLib.Object";
} elsif ($maptypes{$1} eq "String") {
$sret = $mret = "String";
} elsif (exists ($maptypes{$1})) {
$sret = $maptypes{$1};
$mret = $marshaltypes{$1};
} else {
$sret = $mret = $1;
}
$def =~ /doc-string "(.+)"\)/;
$docs = $1;
$mode = 0;
if ($def =~ /\(readable #t\)/) {
$mode = 1;
}
if (($def =~ /\(writeable #t\)/) && ($def !~ /\(construct-only #t\)/)) {
$mode += 2;
}
$code = "\t\t/// <summary> $name Property </summary>\n";
$code .= "\t\t/// <remarks>\n\t\t///\t$docs\n";
$code .= "\t\t/// </remarks>\n\n";
$code .= "\t\tpublic $sret $name {\n";
if ($mode & 1) {
$code .= "\t\t\tget {\n\t\t\t\t$mret val;\n";
$code .= "\t\t\t\tGetProperty (\"$cname\", out val);\n";
$code .= "\t\t\t\treturn ";
if ($sret ne $mret) {
$code .= "($sret)";
}
$code .= "val;\n\t\t\t}\n";
}
if ($mode & 2) {
$code .= "\t\t\tset {\n";
$code .= "\t\t\t\tSetProperty (\"$cname\", ($mret) value);\n";
$code .= "\t\t\t}\n";
}
$code .= "\t\t}\n\n";
return $code;
}
# Generate the code for a constructor definition.
sub gen_ctor
{
my ($def, $dll) = @_;
my ($cname, $sret, $ret, $mret, $sig, $call, $pinv, $code);
$def =~ /\(c-name "(\w+)"/;
$cname = $1;
$def =~ /is-constructor-of (\w+)\)/;
if (exists ($maptypes{$1})) {
$sret = $maptypes{$1};
$mret = $marshaltypes{$1};
$ret = $1;
} else {
die "Unexpected return type in constructor: $1\n";
}
($call, $pinv, $sig) = gen_param_strings($def);
$code = "\t\t/// <summary> $sret Constructor </summary>\n";
$code .= "\t\t/// <remarks>\n\t\t///\t FIXME: Generate docs\n";
$code .= "\t\t/// </remarks>\n\n";
$code .= "\t\t[DllImport(\"$dll\", CharSet=CharSet.Ansi,\n";
$code .= "\t\t\t CallingConvention=CallingConvention.Cdecl)]\n";
$code .= "\t\tstatic extern $mret $cname ($pinv);\n\n";
$code .= "\t\tpublic $sret ($sig)\n";
$code .= "\t\t{\n\t\t\t";
$code .= "RawObject = $cname ($call);\n\t\t}\n\n";
}
# Generate the code for a method definition.
sub gen_method
{
my ($name, $def, $dll) = @_;
my ($cname, $sret, $ret, $mret, $sig, $call, $pinv, $code);
$def =~ /\(c-name "(\w+)"/;
$cname = $1;
$def =~ /return-type "(const-)*(\w+)/;
if (exists ($maptypes{$2})) {
$sret = $maptypes{$2};
$mret = $marshaltypes{$2};
$ret = $2;
} else {
$sret = $mret = $ret = $2;
}
($call, $pinv, $sig) = gen_param_strings($def);
$code = "\t\t/// <summary> $name Method </summary>\n";
$code .= "\t\t/// <remarks>\n\t\t///\t FIXME: Generate docs\n";
$code .= "\t\t/// </remarks>\n\n";
$code .= "\t\t[DllImport(\"$dll\", CharSet=CharSet.Ansi,\n";
$code .= "\t\t\t CallingConvention=CallingConvention.Cdecl)]\n";
$code .= "\t\tstatic extern $mret $cname (IntPtr obj";
if ($pinv) {
$code .= ", $pinv";
}
$code .= ");\n\n";
$code .= "\t\tpublic $sret $name ($sig)\n";
$code .= "\t\t{\n\t\t\t";
if ($sret ne "void") { $code .= "return "; }
if ($call) {
$call = "$cname (RawObject, $call)";
} else {
$call = "$cname (RawObject)";
}
if ($sret eq $mret) {
$code .= "$call";
} elsif ($sret eq "String") {
$code .= "Marshal.PtrToStringAnsi($call)";
} elsif ($mret eq "int") {
$code .= "($sret) $call";
} elsif (exists ($objects{$ret}) || ($ret =~ /GObject/)) {
$code .= "($sret) GLib.Object.GetObject($call)";
} else {
die "Unexpected return type match $sret:$mret\n";
}
$code .= ";\n\t\t}\n\n";
return $code;
}
# Generate the DllImport, signature, and call parameter strings.
sub gen_param_strings
{
my ($def) = @_;
my ($call, $parm, $pinv, $pname, $ptype, $sig);
$call = $pinv = $sig = "";
if ($def =~ /parameters'\((.*)\)\)\)/) {
foreach $parm (split(/\)'\(/, $1)) {
$parm =~ s/\*//g;
$parm =~ /"(\S*)"\s+"(\S*)"/;
$ptype = $1;
$pname = $2;
$ptype =~ s/const-//;
$pname =~ s/object/objekt/;
$pname =~ s/event/ev3nt/;
if ($sig) {
$sig .= ', ';
$call .= ', ';
$pinv .= ', ';
}
if ($marshaltypes{$ptype} eq "Unicode") {
$pinv .= "IntPtr $pname";
} else {
$pinv .= "$marshaltypes{$ptype} $pname";
}
$sig .= "$maptypes{$ptype} $pname";
if ($maptypes{$ptype} eq $marshaltypes{$ptype}) {
$call .= "$pname";
} elsif (exists ($objects{$ptype}) ||
($ptype =~ /GObject/)) {
$call .= "$pname.Handle";
} elsif ($maptypes{$ptype} eq "String") {
if ($marshaltypes{$ptype} eq "IntPtr") {
$call .= "Marshal.StringToHGlobalAnsi($pname)";
} else {
$call .= "Marshal.StringToHGlobalUni($pname)";
}
} elsif ($marshaltypes{$ptype} eq "int") {
$call .= "(int) $pname";
} else {
die "Unexpected type encountered $ptype\n";
}
}
}
return ($call, $pinv, $sig);
}
# Code generation for signal handlers.
sub get_sighandler
{
my ($def) = @_;
my ($key, $name, $dir, $ns, $nspace, $tok);
$def =~ /return-type \"(\w+)/;
my $ret = $1;
$def =~ /parameters'\((.*)\)\)\)/;
my @parms = split(/\)'\(/, $1);
$key = "";
for ($i = 1; $i < @parms; $i++) {
$parms[$i] =~ /^\"(\w+)/;
$key .= ":$1";
}
$key = $ret . $key;
if (exists($sighandlers{$key})) {
return $sighandlers{$key};
}
my ($call, $pinv, $sig) = gen_param_strings($def);
if ($key =~ /Gtk/) {
$dir = "../gtk/generated";
$nspace = "Gtk";
} elsif ($key =~ /Gdk/) {
$dir = "../gdk/generated";
$nspace = "Gdk";
} else {
$dir = "../glib/generated";
$nspace = "GLib";
}
$name = "";
foreach $tok (split(/:/, $key)) {
if (exists($objects{$tok})) {
$name .= "Object";
} elsif (exists($maptypes{$tok})) {
$name .= "$maptypes{$tok}";
} else {
die "Whassup with $tok?";
}
}
my $sname = $name . "Signal";
my $dname = $name . "Delegate";
my $cbname = $name . "Callback";
$sighandlers{$key} = $sname;
open (SIGFILE, ">$dir/$sname.cs") || die "can't open file";
print SIGFILE "// Generated file: Do not modify\n\n";
print SIGFILE "namespace GtkSharp {\n\n";
foreach $ns (split (/,/, $usings{$nspace})) {
print SIGFILE "\tusing $ns;\n";
}
print SIGFILE "\n\tpublic delegate $marshaltypes{$ret} ";
print SIGFILE "$dname($pinv, int key);\n\n";
print SIGFILE "\tpublic class $sname : SignalCallback {\n\n";
print SIGFILE "\t\tprivate static $dname _Delegate;\n\n";
print SIGFILE "\t\tprivate static $maptypes{$ret} ";
print SIGFILE "$cbname($pinv, int key)\n\t\t{\n";
print SIGFILE "\t\t\tif (!_Instances.Contains(key))\n";
print SIGFILE "\t\t\t\tthrow new Exception(\"Unexpected signal key\");";
print SIGFILE "\n\n\t\t\t$sname inst = ($sname) _Instances[key];\n";
print SIGFILE "\t\t\tSignalArgs args = new SignalArgs ();\n";
if ($def =~ /parameters'\((.*)\)\)\)/) {
my (@parms) = split(/\)'\(/, $1);
for ($idx=0; $idx < $#parms; $idx++) {
$parms[$idx+1] =~ s/\*//g;
$parms[$idx+1] =~ /"(\S*)"\s+"(\S*)"/;
$ptype = $1;
$pname = $2;
$pname =~ s/object/objekt/;
$pname =~ s/event/ev3nt/;
if (exists($objects{$ptype})) {
print SIGFILE "\t\t\targs.Args[$idx] = GLib.Object.GetObject($pname);\n";
} elsif (exists($maptypes{$ptype})) {
print SIGFILE "\t\t\targs.Args[$idx] = $pname;\n";
} else { warn "Whassup wit $ptype?"; }
}
}
print SIGFILE "\t\t\tinst._handler (inst._obj, args);\n";
if ($ret ne "none") {
print SIGFILE "\t\t\treturn ($maptypes{$ret}) args.RetVal;\n";
}
print SIGFILE "\t\t}\n\n";
print SIGFILE "\t\t[DllImport(\"gobject-1.3.dll\", ";
print SIGFILE "CharSet=CharSet.Ansi, ";
print SIGFILE "CallingConvention=CallingConvention.Cdecl)]\n";
print SIGFILE "\t\tstatic extern void g_signal_connect_data(";
print SIGFILE "IntPtr obj, IntPtr name, $dname cb, int key, IntPtr p,";
print SIGFILE " int flags);\n\n";
print SIGFILE "\t\tpublic $sname(GLib.Object obj, IntPtr raw, ";
print SIGFILE "String name, EventHandler eh) : base(obj, eh)";
print SIGFILE "\n\t\t{\n\t\t\tif (_Delegate == null) {\n";
print SIGFILE "\t\t\t\t_Delegate = new $dname($cbname);\n\t\t\t}\n";
print SIGFILE "\t\t\tg_signal_connect_data(raw, ";
print SIGFILE "Marshal.StringToHGlobalAnsi(name), _Delegate, _key, ";
print SIGFILE "new IntPtr(0), 0);\n\t\t}\n\n";
print SIGFILE "\t\t~$sname()\n{\t\t\t_Instances.Remove(_key);\n";
print SIGFILE "\t\t\tif(_Instances.Count == 0) {\n";
print SIGFILE "\t\t\t\t_Delegate = null;\n\t\t\t}\n\t\t}\n";
print SIGFILE "\t}\n}\n";
close (SIGFILE);
return $sighandlers{$key};
}

View file

@ -1,570 +0,0 @@
(define-struct Atom
(in-module "Gdk")
(c-name "GdkAtom")
(fields
)
)
(define-struct Bitmap
(in-module "Gdk")
(c-name "GdkBitmap")
(fields
'("GObject" "parent_instance")
)
)
(define-struct Color
(in-module "Gdk")
(c-name "GdkColor")
(fields
'("guint32" "pixel")
'("guint16" "red")
'("guint16" "green")
'("guint16" "blue")
)
)
(define-struct Cursor
(in-module "Gdk")
(c-name "GdkCursor")
(fields
'("GdkCursorType" "type")
'("guint" "ref_count")
)
)
(define-struct DeviceAxis
(in-module "Gdk")
(c-name "GdkDeviceAxis")
(fields
'("GdkAxisUse" "use")
'("gdouble" "min")
'("gdouble" "max")
)
)
(define-struct DeviceKey
(in-module "Gdk")
(c-name "GdkDeviceKey")
(fields
'("guint" "keyval")
'("GdkModifierType" "modifiers")
)
)
(define-struct EventAny
(in-module "Gdk")
(c-name "GdkEventAny")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
)
)
(define-struct EventButton
(in-module "Gdk")
(c-name "GdkEventButton")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("guint32" "time")
'("gdouble" "x")
'("gdouble" "y")
'("gdouble*" "axes")
'("guint" "state")
'("guint" "button")
'("GdkDevice*" "device")
'("gdouble" "x_root")
'("gdouble" "y_root")
)
)
(define-struct EventClient
(in-module "Gdk")
(c-name "GdkEventClient")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("GdkAtom" "message_type")
'("gushort" "data_format")
'("gint8" "data_b[20]")
)
)
(define-struct EventConfigure
(in-module "Gdk")
(c-name "GdkEventConfigure")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("gint" "x")
'("gint" "y")
'("gint" "width")
'("gint" "height")
)
)
(define-struct EventCrossing
(in-module "Gdk")
(c-name "GdkEventCrossing")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("GdkWindow*" "subwindow")
'("guint32" "time")
'("gdouble" "x")
'("gdouble" "y")
'("gdouble" "x_root")
'("gdouble" "y_root")
'("GdkCrossingMode" "mode")
'("GdkNotifyType" "detail")
'("gboolean" "focus")
'("guint" "state")
)
)
(define-struct EventDND
(in-module "Gdk")
(c-name "GdkEventDND")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("GdkDragContext*" "context")
'("guint32" "time")
'("gshort" "x_root")
'("gshort" "y_root")
)
)
(define-struct EventExpose
(in-module "Gdk")
(c-name "GdkEventExpose")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("GdkRectangle" "area")
'("GdkRegion*" "region")
'("gint" "count")
)
)
(define-struct EventFocus
(in-module "Gdk")
(c-name "GdkEventFocus")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("gint16" "in")
)
)
(define-struct EventKey
(in-module "Gdk")
(c-name "GdkEventKey")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("guint32" "time")
'("guint" "state")
'("guint" "keyval")
'("gint" "length")
'("gchar*" "string")
'("guint16" "hardware_keycode")
'("guint8" "group")
)
)
(define-struct EventMotion
(in-module "Gdk")
(c-name "GdkEventMotion")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("guint32" "time")
'("gdouble" "x")
'("gdouble" "y")
'("gdouble*" "axes")
'("guint" "state")
'("gint16" "is_hint")
'("GdkDevice*" "device")
'("gdouble" "x_root")
'("gdouble" "y_root")
)
)
(define-struct EventNoExpose
(in-module "Gdk")
(c-name "GdkEventNoExpose")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
)
)
(define-struct EventProperty
(in-module "Gdk")
(c-name "GdkEventProperty")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("GdkAtom" "atom")
'("guint32" "time")
'("guint" "state")
)
)
(define-struct EventProximity
(in-module "Gdk")
(c-name "GdkEventProximity")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("guint32" "time")
'("GdkDevice*" "device")
)
)
(define-struct EventScroll
(in-module "Gdk")
(c-name "GdkEventScroll")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("guint32" "time")
'("gdouble" "x")
'("gdouble" "y")
'("guint" "state")
'("GdkScrollDirection" "direction")
'("GdkDevice*" "device")
'("gdouble" "x_root")
'("gdouble" "y_root")
)
)
(define-struct EventSelection
(in-module "Gdk")
(c-name "GdkEventSelection")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("GdkAtom" "selection")
'("GdkAtom" "target")
'("GdkAtom" "property")
'("guint32" "time")
'("GdkNativeWindow" "requestor")
)
)
(define-struct EventSetting
(in-module "Gdk")
(c-name "GdkEventSetting")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("GdkSettingAction" "action")
'("char*" "name")
)
)
(define-struct EventVisibility
(in-module "Gdk")
(c-name "GdkEventVisibility")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("GdkVisibilityState" "state")
)
)
(define-struct EventWindowState
(in-module "Gdk")
(c-name "GdkEventWindowState")
(fields
'("GdkEventType" "type")
'("GdkWindow*" "window")
'("gint8" "send_event")
'("GdkWindowState" "changed_mask")
'("GdkWindowState" "new_window_state")
)
)
(define-struct Font
(in-module "Gdk")
(c-name "GdkFont")
(fields
'("GdkFontType" "type")
'("gint" "ascent")
'("gint" "descent")
)
)
(define-struct GCValues
(in-module "Gdk")
(c-name "GdkGCValues")
(fields
'("GdkColor" "foreground")
'("GdkColor" "background")
'("GdkFont*" "font")
'("GdkFunction" "function")
'("GdkFill" "fill")
'("GdkPixmap*" "tile")
'("GdkPixmap*" "stipple")
'("GdkPixmap*" "clip_mask")
'("GdkSubwindowMode" "subwindow_mode")
'("gint" "ts_x_origin")
'("gint" "ts_y_origin")
'("gint" "clip_x_origin")
'("gint" "clip_y_origin")
'("gint" "graphics_exposures")
'("gint" "line_width")
'("GdkLineStyle" "line_style")
'("GdkCapStyle" "cap_style")
'("GdkJoinStyle" "join_style")
)
)
(define-struct Geometry
(in-module "Gdk")
(c-name "GdkGeometry")
(fields
'("gint" "min_width")
'("gint" "min_height")
'("gint" "max_width")
'("gint" "max_height")
'("gint" "base_width")
'("gint" "base_height")
'("gint" "width_inc")
'("gint" "height_inc")
'("gdouble" "min_aspect")
'("gdouble" "max_aspect")
'("GdkGravity" "win_gravity")
)
)
(define-struct KeymapKey
(in-module "Gdk")
(c-name "GdkKeymapKey")
(fields
'("guint" "keycode")
'("gint" "group")
'("gint" "level")
)
)
(define-struct NativeWindow
(in-module "Gdk")
(c-name "GdkNativeWindow")
(fields
)
)
(define-struct PangoAttrEmbossed
(in-module "Gdk")
(c-name "GdkPangoAttrEmbossed")
(fields
'("PangoAttribute" "attr")
'("gboolean" "embossed")
)
)
(define-struct PangoAttrStipple
(in-module "Gdk")
(c-name "GdkPangoAttrStipple")
(fields
'("PangoAttribute" "attr")
'("GdkBitmap*" "stipple")
)
)
(define-struct Pixmap
(in-module "Gdk")
(c-name "GdkPixmap")
(fields
'("GObject" "parent_instance")
)
)
(define-struct Point
(in-module "Gdk")
(c-name "GdkPoint")
(fields
'("gint" "x")
'("gint" "y")
)
)
#(define-struct PointerHooks
# (in-module "Gdk")
# (c-name "GdkPointerHooks")
# (fields
# '("GdkWindow*" "(*get_pointer) (GdkWindow* window")
# '("GdkWindow*" "gint *x")
# '("GdkWindow*" "gint *y")
# '("GdkWindow*" "GdkModifierType *mask)")
# '("GdkWindow*" "(*window_at_pointer) (GdkScreen* screen")
# '("GdkWindow*" "gint *win_x")
# '("GdkWindow*" "gint *win_y)")
# )
#)
(define-struct Rectangle
(in-module "Gdk")
(c-name "GdkRectangle")
(fields
'("gint" "x")
'("gint" "y")
'("gint" "width")
'("gint" "height")
)
)
(define-struct Region
(in-module "Gdk")
(c-name "GdkRegion")
(fields
'("long" "size")
'("long" "numRects")
'("GdkRegionBox*" "rects")
'("GdkRegionBox" "extents")
)
)
(define-struct RegionBox
(in-module "Gdk")
(c-name "GdkRegionBox")
(fields
'("gint" "x1")
'("gint" "y1")
'("gint" "x2")
'("gint" "y2")
)
)
(define-struct RgbCmap
(in-module "Gdk")
(c-name "GdkRgbCmap")
(fields
'("guint32" "colors[256]")
'("gint" "n_colors")
'("GSList*" "info_list")
)
)
(define-struct Screen
(in-module "Gdk")
(c-name "GdkScreen")
(fields
)
)
(define-struct Segment
(in-module "Gdk")
(c-name "GdkSegment")
(fields
'("gint" "x1")
'("gint" "y1")
'("gint" "x2")
'("gint" "y2")
)
)
(define-struct Selection
(in-module "Gdk")
(c-name "GdkSelection")
(fields
)
)
(define-struct SelectionType
(in-module "Gdk")
(c-name "GdkSelectionType")
(fields
)
)
(define-struct Span
(in-module "Gdk")
(c-name "GdkSpan")
(fields
'("gint" "x")
'("gint" "y")
'("gint" "width")
)
)
(define-struct Target
(in-module "Gdk")
(c-name "GdkTarget")
(fields
)
)
(define-struct TimeCoord
(in-module "Gdk")
(c-name "GdkTimeCoord")
(fields
'("guint32" "time")
'("gdouble" "axes[128]")
)
)
(define-struct WChar
(in-module "Gdk")
(c-name "GdkWChar")
(fields
)
)
(define-struct Window
(in-module "Gdk")
(c-name "GdkWindow")
(fields
'("GObject" "parent_instance")
)
)
(define-struct WindowAttr
(in-module "Gdk")
(c-name "GdkWindowAttr")
(fields
'("gchar*" "title")
'("gint" "event_mask")
'("gint" "x")
'("gint" "y")
'("gint" "width")
'("gint" "height")
'("GdkWindowClass" "wclass")
'("GdkVisual*" "visual")
'("GdkColormap*" "colormap")
'("GdkWindowType" "window_type")
'("GdkCursor*" "cursor")
'("gchar*" "wmclass_name")
'("gchar*" "wmclass_class")
'("gboolean" "override_redirect")
)
)
(define-struct XEvent
(in-module "Gdk")
(c-name "GdkXEvent")
(fields
)
)

View file

@ -1,912 +0,0 @@
;; -*- scheme -*-
; object definitions ...
(define-object Colormap
(in-module "Gdk")
(parent "GObject")
(c-name "GdkColormap")
(gtype-id "GDK_TYPE_COLORMAP")
)
(define-object Device
(in-module "Gdk")
(parent "GObject")
(c-name "GdkDevice")
(gtype-id "GDK_TYPE_DEVICE")
(fields
'("gchar*" "name")
'("GdkInputSource" "source")
'("GdkInputMode" "mode")
'("gboolean" "has_cursor")
'("gint" "num_axes")
'("GdkDeviceAxis*" "axes")
'("gint" "num_keys")
'("GdkDeviceKey*" "keys")
)
)
(define-object DragContext
(in-module "Gdk")
(parent "GObject")
(c-name "GdkDragContext")
(gtype-id "GDK_TYPE_DRAG_CONTEXT")
(fields
'("GdkDragProtocol" "protocol")
'("gboolean" "is_source")
'("GdkWindow*" "source_window")
'("GdkWindow*" "dest_window")
'("GList*" "targets")
'("GdkDragAction" "actions")
'("GdkDragAction" "suggested_action")
'("GdkDragAction" "action")
'("guint32" "start_time")
)
)
(define-object Drawable
(in-module "Gdk")
(parent "GObject")
(c-name "GdkDrawable")
(gtype-id "GDK_TYPE_DRAWABLE")
)
(define-object Window
(in-module "Gdk")
(parent "GdkDrawable")
(c-name "GdkWindow")
(gtype-id "GDK_TYPE_WINDOW")
)
(define-object Pixmap
(in-module "Gdk")
(parent "GdkDrawable")
(c-name "GdkPixmap")
(gtype-id "GDK_TYPE_PIXMAP")
)
(define-object GC
(in-module "Gdk")
(parent "GObject")
(c-name "GdkGC")
(gtype-id "GDK_TYPE_GC")
)
(define-object Image
(in-module "Gdk")
(parent "GObject")
(c-name "GdkImage")
(gtype-id "GDK_TYPE_IMAGE")
)
(define-object Pixbuf
(in-module "Gdk")
(parent "GObject")
(c-name "GdkPixbuf")
(gtype-id "GDK_TYPE_PIXBUF")
)
(define-object PixbufAnimation
(in-module "Gdk")
(parent "GObject")
(c-name "GdkPixbufAnimation")
(gtype-id "GDK_TYPE_PIXBUF_ANIMATION")
)
(define-object PixbufAnimationIter
(in-module "Gdk")
(parent "GObject")
(c-name "GdkPixbufAnimationIter")
(gtype-id "GDK_TYPE_PIXBUF_ANIMATION_ITER")
)
(define-object Visual
(in-module "Gdk")
(parent "GObject")
(c-name "GdkVisual")
(gtype-id "GDK_TYPE_VISUAL")
(fields
'("GdkVisualType" "type")
'("gint" "depth")
'("GdkByteOrder" "byte_order")
'("gint" "colormap_size")
'("gint" "bits_per_rgb")
'("guint32" "red_mask")
'("gint" "red_shift")
'("gint" "red_prec")
'("guint32" "green_mask")
'("gint" "green_shift")
'("gint" "green_prec")
'("guint32" "blue_mask")
'("gint" "blue_shift")
'("gint" "blue_prec")
)
)
;; Boxed types ...
(define-boxed Event
(in-module "Gdk")
(c-name "GdkEvent")
(gtype-id "GDK_TYPE_EVENT")
(copy-func "gdk_event_copy")
(release-func "gdk_event_free")
)
(define-boxed Font
(in-module "Gdk")
(c-name "GdkFont")
(gtype-id "GDK_TYPE_FONT")
(copy-func "gdk_font_ref")
(release-func "gdk_font_unref")
(fields
'("GdkFontType" "type")
'("gint" "ascent")
'("gint" "descent")
)
)
(define-boxed Color
(in-module "Gdk")
(c-name "GdkColor")
(gtype-id "GDK_TYPE_COLOR")
(copy-func "gdk_color_copy")
(release-func "gdk_color_free")
(fields
'("guint32" "pixel")
'("guint16" "red")
'("guint16" "green")
'("guint16" "blue")
)
)
(define-boxed Cursor
(in-module "Gdk")
(c-name "GdkCursor")
(gtype-id "GDK_TYPE_CURSOR")
(copy-func "gdk_cursor_ref")
(release-func "gdk_cursor_unref")
(fields
'("GdkCursorType" "type")
)
)
(define-boxed Rectangle
(in-module "Gdk")
(c-name "GdkRectangle")
(gtype-id "GDK_TYPE_RECTANGLE")
(copy-func "gdk_rectangle_copy")
(release-func "g_free")
(fields
'("gint" "x")
'("gint" "y")
'("gint" "width")
'("gint" "height")
)
)
;; Enumerations and flags ...
(define-enum CursorType
(in-module "Gdk")
(c-name "GdkCursorType")
(gtype-id "GDK_TYPE_CURSOR_TYPE")
; (value (name #include) (c-name #include))
(values
'("gdk-cursor-is-pixmap" "GDK_CURSOR_IS_PIXMAP")
)
)
(define-flags DragAction
(in-module "Gdk")
(c-name "GdkDragAction")
(gtype-id "GDK_TYPE_DRAG_ACTION")
(values
'("default" "GDK_ACTION_DEFAULT")
'("copy" "GDK_ACTION_COPY")
'("move" "GDK_ACTION_MOVE")
'("link" "GDK_ACTION_LINK")
'("private" "GDK_ACTION_PRIVATE")
'("ask" "GDK_ACTION_ASK")
)
)
(define-enum DragProtocol
(in-module "Gdk")
(c-name "GdkDragProtocol")
(gtype-id "GDK_TYPE_DRAG_PROTOCOL")
(values
'("motif" "GDK_DRAG_PROTO_MOTIF")
'("xdnd" "GDK_DRAG_PROTO_XDND")
'("rootwin" "GDK_DRAG_PROTO_ROOTWIN")
'("none" "GDK_DRAG_PROTO_NONE")
'("win32-dropfiles" "GDK_DRAG_PROTO_WIN32_DROPFILES")
'("ole2" "GDK_DRAG_PROTO_OLE2")
'("local" "GDK_DRAG_PROTO_LOCAL")
)
)
(define-enum FilterReturn
(in-module "Gdk")
(c-name "GdkFilterReturn")
(gtype-id "GDK_TYPE_FILTER_RETURN")
(values
'("continue" "GDK_FILTER_CONTINUE")
'("translate" "GDK_FILTER_TRANSLATE")
'("remove" "GDK_FILTER_REMOVE")
)
)
(define-enum EventType
(in-module "Gdk")
(c-name "GdkEventType")
(gtype-id "GDK_TYPE_EVENT_TYPE")
(values
'("nothing" "GDK_NOTHING")
'("delete" "GDK_DELETE")
'("destroy" "GDK_DESTROY")
'("expose" "GDK_EXPOSE")
'("motion-notify" "GDK_MOTION_NOTIFY")
'("button-press" "GDK_BUTTON_PRESS")
'("two-button-press" "GDK_2BUTTON_PRESS")
'("three-button-press" "GDK_3BUTTON_PRESS")
'("button-release" "GDK_BUTTON_RELEASE")
'("key-press" "GDK_KEY_PRESS")
'("key-release" "GDK_KEY_RELEASE")
'("enter-notify" "GDK_ENTER_NOTIFY")
'("leave-notify" "GDK_LEAVE_NOTIFY")
'("focus-change" "GDK_FOCUS_CHANGE")
'("configure" "GDK_CONFIGURE")
'("map" "GDK_MAP")
'("unmap" "GDK_UNMAP")
'("property-notify" "GDK_PROPERTY_NOTIFY")
'("selection-clear" "GDK_SELECTION_CLEAR")
'("selection-request" "GDK_SELECTION_REQUEST")
'("selection-notify" "GDK_SELECTION_NOTIFY")
'("proximity-in" "GDK_PROXIMITY_IN")
'("proximity-out" "GDK_PROXIMITY_OUT")
'("drag-enter" "GDK_DRAG_ENTER")
'("drag-leave" "GDK_DRAG_LEAVE")
'("drag-motion" "GDK_DRAG_MOTION")
'("drag-status" "GDK_DRAG_STATUS")
'("drop-start" "GDK_DROP_START")
'("drop-finished" "GDK_DROP_FINISHED")
'("client-event" "GDK_CLIENT_EVENT")
'("visibility-notify" "GDK_VISIBILITY_NOTIFY")
'("no-expose" "GDK_NO_EXPOSE")
'("scroll" "GDK_SCROLL")
'("window-state" "GDK_WINDOW_STATE")
'("setting" "GDK_SETTING")
)
)
(define-flags EventMask
(in-module "Gdk")
(c-name "GdkEventMask")
(gtype-id "GDK_TYPE_EVENT_MASK")
(values
'("exposure-mask" "GDK_EXPOSURE_MASK")
'("pointer-motion-mask" "GDK_POINTER_MOTION_MASK")
'("pointer-motion-hint-mask" "GDK_POINTER_MOTION_HINT_MASK")
'("button-motion-mask" "GDK_BUTTON_MOTION_MASK")
'("button1-motion-mask" "GDK_BUTTON1_MOTION_MASK")
'("button2-motion-mask" "GDK_BUTTON2_MOTION_MASK")
'("button3-motion-mask" "GDK_BUTTON3_MOTION_MASK")
'("button-press-mask" "GDK_BUTTON_PRESS_MASK")
'("button-release-mask" "GDK_BUTTON_RELEASE_MASK")
'("key-press-mask" "GDK_KEY_PRESS_MASK")
'("key-release-mask" "GDK_KEY_RELEASE_MASK")
'("enter-notify-mask" "GDK_ENTER_NOTIFY_MASK")
'("leave-notify-mask" "GDK_LEAVE_NOTIFY_MASK")
'("focus-change-mask" "GDK_FOCUS_CHANGE_MASK")
'("structure-mask" "GDK_STRUCTURE_MASK")
'("property-change-mask" "GDK_PROPERTY_CHANGE_MASK")
'("visibility-notify-mask" "GDK_VISIBILITY_NOTIFY_MASK")
'("proximity-in-mask" "GDK_PROXIMITY_IN_MASK")
'("proximity-out-mask" "GDK_PROXIMITY_OUT_MASK")
'("substructure-mask" "GDK_SUBSTRUCTURE_MASK")
'("scroll-mask" "GDK_SCROLL_MASK")
'("all-events-mask" "GDK_ALL_EVENTS_MASK")
)
)
(define-enum VisibilityState
(in-module "Gdk")
(c-name "GdkVisibilityState")
(gtype-id "GDK_TYPE_VISIBILITY_STATE")
(values
'("unobscured" "GDK_VISIBILITY_UNOBSCURED")
'("partial" "GDK_VISIBILITY_PARTIAL")
'("fully-obscured" "GDK_VISIBILITY_FULLY_OBSCURED")
)
)
(define-enum ScrollDirection
(in-module "Gdk")
(c-name "GdkScrollDirection")
(gtype-id "GDK_TYPE_SCROLL_DIRECTION")
(values
'("up" "GDK_SCROLL_UP")
'("down" "GDK_SCROLL_DOWN")
'("left" "GDK_SCROLL_LEFT")
'("right" "GDK_SCROLL_RIGHT")
)
)
(define-enum NotifyType
(in-module "Gdk")
(c-name "GdkNotifyType")
(gtype-id "GDK_TYPE_NOTIFY_TYPE")
(values
'("ancestor" "GDK_NOTIFY_ANCESTOR")
'("virtual" "GDK_NOTIFY_VIRTUAL")
'("inferior" "GDK_NOTIFY_INFERIOR")
'("nonlinear" "GDK_NOTIFY_NONLINEAR")
'("nonlinear-virtual" "GDK_NOTIFY_NONLINEAR_VIRTUAL")
'("unknown" "GDK_NOTIFY_UNKNOWN")
)
)
(define-enum CrossingMode
(in-module "Gdk")
(c-name "GdkCrossingMode")
(gtype-id "GDK_TYPE_CROSSING_MODE")
(values
'("normal" "GDK_CROSSING_NORMAL")
'("grab" "GDK_CROSSING_GRAB")
'("ungrab" "GDK_CROSSING_UNGRAB")
)
)
(define-enum PropertyState
(in-module "Gdk")
(c-name "GdkPropertyState")
(gtype-id "GDK_TYPE_PROPERTY_STATE")
(values
'("new-value" "GDK_PROPERTY_NEW_VALUE")
'("delete" "GDK_PROPERTY_DELETE")
)
)
(define-flags WindowState
(in-module "Gdk")
(c-name "GdkWindowState")
(gtype-id "GDK_TYPE_WINDOW_STATE")
(values
'("withdrawn" "GDK_WINDOW_STATE_WITHDRAWN")
'("iconified" "GDK_WINDOW_STATE_ICONIFIED")
'("maximized" "GDK_WINDOW_STATE_MAXIMIZED")
'("sticky" "GDK_WINDOW_STATE_STICKY")
)
)
(define-enum SettingAction
(in-module "Gdk")
(c-name "GdkSettingAction")
(gtype-id "GDK_TYPE_SETTING_ACTION")
(values
'("new" "GDK_SETTING_ACTION_NEW")
'("changed" "GDK_SETTING_ACTION_CHANGED")
'("deleted" "GDK_SETTING_ACTION_DELETED")
)
)
(define-enum FontType
(in-module "Gdk")
(c-name "GdkFontType")
(gtype-id "GDK_TYPE_FONT_TYPE")
(values
'("font" "GDK_FONT_FONT")
'("fontset" "GDK_FONT_FONTSET")
)
)
(define-enum CapStyle
(in-module "Gdk")
(c-name "GdkCapStyle")
(gtype-id "GDK_TYPE_CAP_STYLE")
(values
'("not-last" "GDK_CAP_NOT_LAST")
'("butt" "GDK_CAP_BUTT")
'("round" "GDK_CAP_ROUND")
'("projecting" "GDK_CAP_PROJECTING")
)
)
(define-enum Fill
(in-module "Gdk")
(c-name "GdkFill")
(gtype-id "GDK_TYPE_FILL")
(values
'("solid" "GDK_SOLID")
'("tiled" "GDK_TILED")
'("stippled" "GDK_STIPPLED")
'("opaque-stippled" "GDK_OPAQUE_STIPPLED")
)
)
(define-enum Function
(in-module "Gdk")
(c-name "GdkFunction")
(gtype-id "GDK_TYPE_FUNCTION")
(values
'("copy" "GDK_COPY")
'("invert" "GDK_INVERT")
'("xor" "GDK_XOR")
'("clear" "GDK_CLEAR")
'("and" "GDK_AND")
'("and-reverse" "GDK_AND_REVERSE")
'("and-invert" "GDK_AND_INVERT")
'("noop" "GDK_NOOP")
'("or" "GDK_OR")
'("equiv" "GDK_EQUIV")
'("or-reverse" "GDK_OR_REVERSE")
'("copy-invert" "GDK_COPY_INVERT")
'("or-invert" "GDK_OR_INVERT")
'("nand" "GDK_NAND")
'("nor" "GDK_NOR")
'("set" "GDK_SET")
)
)
(define-enum JoinStyle
(in-module "Gdk")
(c-name "GdkJoinStyle")
(gtype-id "GDK_TYPE_JOIN_STYLE")
(values
'("miter" "GDK_JOIN_MITER")
'("round" "GDK_JOIN_ROUND")
'("bevel" "GDK_JOIN_BEVEL")
)
)
(define-enum LineStyle
(in-module "Gdk")
(c-name "GdkLineStyle")
(gtype-id "GDK_TYPE_LINE_STYLE")
(values
'("solid" "GDK_LINE_SOLID")
'("on-off-dash" "GDK_LINE_ON_OFF_DASH")
'("double-dash" "GDK_LINE_DOUBLE_DASH")
)
)
(define-enum SubwindowMode
(in-module "Gdk")
(c-name "GdkSubwindowMode")
(gtype-id "GDK_TYPE_SUBWINDOW_MODE")
(values
'("clip-by-children" "GDK_CLIP_BY_CHILDREN")
'("include-inferiors" "GDK_INCLUDE_INFERIORS")
)
)
(define-flags GCValuesMask
(in-module "Gdk")
(c-name "GdkGCValuesMask")
(gtype-id "GDK_TYPE_GC_VALUES_MASK")
(values
'("foreground" "GDK_GC_FOREGROUND")
'("background" "GDK_GC_BACKGROUND")
'("font" "GDK_GC_FONT")
'("function" "GDK_GC_FUNCTION")
'("fill" "GDK_GC_FILL")
'("tile" "GDK_GC_TILE")
'("stipple" "GDK_GC_STIPPLE")
'("clip-mask" "GDK_GC_CLIP_MASK")
'("subwindow" "GDK_GC_SUBWINDOW")
'("ts-x-origin" "GDK_GC_TS_X_ORIGIN")
'("ts-y-origin" "GDK_GC_TS_Y_ORIGIN")
'("clip-x-origin" "GDK_GC_CLIP_X_ORIGIN")
'("clip-y-origin" "GDK_GC_CLIP_Y_ORIGIN")
'("exposures" "GDK_GC_EXPOSURES")
'("line-width" "GDK_GC_LINE_WIDTH")
'("line-style" "GDK_GC_LINE_STYLE")
'("cap-style" "GDK_GC_CAP_STYLE")
'("join-style" "GDK_GC_JOIN_STYLE")
)
)
(define-enum ImageType
(in-module "Gdk")
(c-name "GdkImageType")
(gtype-id "GDK_TYPE_IMAGE_TYPE")
(values
'("normal" "GDK_IMAGE_NORMAL")
'("shared" "GDK_IMAGE_SHARED")
'("fastest" "GDK_IMAGE_FASTEST")
)
)
(define-enum ExtensionMode
(in-module "Gdk")
(c-name "GdkExtensionMode")
(gtype-id "GDK_TYPE_EXTENSION_MODE")
(values
'("none" "GDK_EXTENSION_EVENTS_NONE")
'("all" "GDK_EXTENSION_EVENTS_ALL")
'("cursor" "GDK_EXTENSION_EVENTS_CURSOR")
)
)
(define-enum InputSource
(in-module "Gdk")
(c-name "GdkInputSource")
(gtype-id "GDK_TYPE_INPUT_SOURCE")
(values
'("mouse" "GDK_SOURCE_MOUSE")
'("pen" "GDK_SOURCE_PEN")
'("eraser" "GDK_SOURCE_ERASER")
'("cursor" "GDK_SOURCE_CURSOR")
)
)
(define-enum InputMode
(in-module "Gdk")
(c-name "GdkInputMode")
(gtype-id "GDK_TYPE_INPUT_MODE")
(values
'("disabled" "GDK_MODE_DISABLED")
'("screen" "GDK_MODE_SCREEN")
'("window" "GDK_MODE_WINDOW")
)
)
(define-enum AxisUse
(in-module "Gdk")
(c-name "GdkAxisUse")
(gtype-id "GDK_TYPE_AXIS_USE")
(values
'("ignore" "GDK_AXIS_IGNORE")
'("x" "GDK_AXIS_X")
'("y" "GDK_AXIS_Y")
'("pressure" "GDK_AXIS_PRESSURE")
'("xtilt" "GDK_AXIS_XTILT")
'("ytilt" "GDK_AXIS_YTILT")
'("wheel" "GDK_AXIS_WHEEL")
'("last" "GDK_AXIS_LAST")
)
)
(define-enum PropMode
(in-module "Gdk")
(c-name "GdkPropMode")
(gtype-id "GDK_TYPE_PROP_MODE")
(values
'("replace" "GDK_PROP_MODE_REPLACE")
'("prepend" "GDK_PROP_MODE_PREPEND")
'("append" "GDK_PROP_MODE_APPEND")
)
)
(define-enum FillRule
(in-module "Gdk")
(c-name "GdkFillRule")
(gtype-id "GDK_TYPE_FILL_RULE")
(values
'("even-odd-rule" "GDK_EVEN_ODD_RULE")
'("winding-rule" "GDK_WINDING_RULE")
)
)
(define-enum OverlapType
(in-module "Gdk")
(c-name "GdkOverlapType")
(gtype-id "GDK_TYPE_OVERLAP_TYPE")
(values
'("in" "GDK_OVERLAP_RECTANGLE_IN")
'("out" "GDK_OVERLAP_RECTANGLE_OUT")
'("part" "GDK_OVERLAP_RECTANGLE_PART")
)
)
(define-enum RgbDither
(in-module "Gdk")
(c-name "GdkRgbDither")
(gtype-id "GDK_TYPE_RGB_DITHER")
(values
'("none" "GDK_RGB_DITHER_NONE")
'("normal" "GDK_RGB_DITHER_NORMAL")
'("max" "GDK_RGB_DITHER_MAX")
)
)
(define-enum Selection
(in-module "Gdk")
(c-name "GdkSelection")
(gtype-id "GDK_TYPE_SELECTION")
(values
'("primary" "GDK_SELECTION_PRIMARY")
'("secondary" "GDK_SELECTION_SECONDARY")
)
)
(define-enum Target
(in-module "Gdk")
(c-name "GdkTarget")
(gtype-id "GDK_TYPE_TARGET")
(values
'("bitmap" "GDK_TARGET_BITMAP")
'("colormap" "GDK_TARGET_COLORMAP")
'("drawable" "GDK_TARGET_DRAWABLE")
'("pixmap" "GDK_TARGET_PIXMAP")
'("string" "GDK_TARGET_STRING")
)
)
(define-enum SelectionType
(in-module "Gdk")
(c-name "GdkSelectionType")
(gtype-id "GDK_TYPE_SELECTION_TYPE")
(values
'("atom" "GDK_SELECTION_TYPE_ATOM")
'("bitmap" "GDK_SELECTION_TYPE_BITMAP")
'("colormap" "GDK_SELECTION_TYPE_COLORMAP")
'("drawable" "GDK_SELECTION_TYPE_DRAWABLE")
'("integer" "GDK_SELECTION_TYPE_INTEGER")
'("pixmap" "GDK_SELECTION_TYPE_PIXMAP")
'("window" "GDK_SELECTION_TYPE_WINDOW")
'("string" "GDK_SELECTION_TYPE_STRING")
)
)
(define-enum ByteOrder
(in-module "Gdk")
(c-name "GdkByteOrder")
(gtype-id "GDK_TYPE_BYTE_ORDER")
(values
'("lsb-first" "GDK_LSB_FIRST")
'("msb-first" "GDK_MSB_FIRST")
)
)
(define-flags ModifierType
(in-module "Gdk")
(c-name "GdkModifierType")
(gtype-id "GDK_TYPE_MODIFIER_TYPE")
(values
'("shift-mask" "GDK_SHIFT_MASK")
'("lock-mask" "GDK_LOCK_MASK")
'("control-mask" "GDK_CONTROL_MASK")
'("mod1-mask" "GDK_MOD1_MASK")
'("mod2-mask" "GDK_MOD2_MASK")
'("mod3-mask" "GDK_MOD3_MASK")
'("mod4-mask" "GDK_MOD4_MASK")
'("mod5-mask" "GDK_MOD5_MASK")
'("button1-mask" "GDK_BUTTON1_MASK")
'("button2-mask" "GDK_BUTTON2_MASK")
'("button3-mask" "GDK_BUTTON3_MASK")
'("button4-mask" "GDK_BUTTON4_MASK")
'("button5-mask" "GDK_BUTTON5_MASK")
'("release-mask" "GDK_RELEASE_MASK")
'("modifier-mask" "GDK_MODIFIER_MASK")
)
)
(define-flags InputCondition
(in-module "Gdk")
(c-name "GdkInputCondition")
(gtype-id "GDK_TYPE_INPUT_CONDITION")
(values
'("read" "GDK_INPUT_READ")
'("write" "GDK_INPUT_WRITE")
'("exception" "GDK_INPUT_EXCEPTION")
)
)
(define-enum Status
(in-module "Gdk")
(c-name "GdkStatus")
(gtype-id "GDK_TYPE_STATUS")
(values
'("ok" "GDK_OK")
'("error" "GDK_ERROR")
'("error-param" "GDK_ERROR_PARAM")
'("error-file" "GDK_ERROR_FILE")
'("error-mem" "GDK_ERROR_MEM")
)
)
(define-enum GrabStatus
(in-module "Gdk")
(c-name "GdkGrabStatus")
(gtype-id "GDK_TYPE_GRAB_STATUS")
(values
'("success" "GDK_GRAB_SUCCESS")
'("already-grabbed" "GDK_GRAB_ALREADY_GRABBED")
'("invalid-time" "GDK_GRAB_INVALID_TIME")
'("not-viewable" "GDK_GRAB_NOT_VIEWABLE")
'("frozen" "GDK_GRAB_FROZEN")
)
)
(define-enum VisualType
(in-module "Gdk")
(c-name "GdkVisualType")
(gtype-id "GDK_TYPE_VISUAL_TYPE")
(values
'("static-gray" "GDK_VISUAL_STATIC_GRAY")
'("grayscale" "GDK_VISUAL_GRAYSCALE")
'("static-color" "GDK_VISUAL_STATIC_COLOR")
'("pseudo-color" "GDK_VISUAL_PSEUDO_COLOR")
'("true-color" "GDK_VISUAL_TRUE_COLOR")
'("direct-color" "GDK_VISUAL_DIRECT_COLOR")
)
)
(define-enum WindowClass
(in-module "Gdk")
(c-name "GdkWindowClass")
(gtype-id "GDK_TYPE_WINDOW_CLASS")
(values
'("utput" "GDK_INPUT_OUTPUT")
'("nly" "GDK_INPUT_ONLY")
)
)
(define-enum WindowType
(in-module "Gdk")
(c-name "GdkWindowType")
(gtype-id "GDK_TYPE_WINDOW_TYPE")
(values
'("root" "GDK_WINDOW_ROOT")
'("toplevel" "GDK_WINDOW_TOPLEVEL")
'("child" "GDK_WINDOW_CHILD")
'("dialog" "GDK_WINDOW_DIALOG")
'("temp" "GDK_WINDOW_TEMP")
'("foreign" "GDK_WINDOW_FOREIGN")
)
)
(define-flags WindowAttributesType
(in-module "Gdk")
(c-name "GdkWindowAttributesType")
(gtype-id "GDK_TYPE_WINDOW_ATTRIBUTES_TYPE")
(values
'("title" "GDK_WA_TITLE")
'("x" "GDK_WA_X")
'("y" "GDK_WA_Y")
'("cursor" "GDK_WA_CURSOR")
'("colormap" "GDK_WA_COLORMAP")
'("visual" "GDK_WA_VISUAL")
'("wmclass" "GDK_WA_WMCLASS")
'("noredir" "GDK_WA_NOREDIR")
)
)
(define-flags WindowHints
(in-module "Gdk")
(c-name "GdkWindowHints")
(gtype-id "GDK_TYPE_WINDOW_HINTS")
(values
'("pos" "GDK_HINT_POS")
'("min-size" "GDK_HINT_MIN_SIZE")
'("max-size" "GDK_HINT_MAX_SIZE")
'("base-size" "GDK_HINT_BASE_SIZE")
'("aspect" "GDK_HINT_ASPECT")
'("resize-inc" "GDK_HINT_RESIZE_INC")
'("win-gravity" "GDK_HINT_WIN_GRAVITY")
)
)
(define-enum WindowTypeHint
(in-module "Gdk")
(c-name "GdkWindowTypeHint")
(gtype-id "GDK_TYPE_WINDOW_TYPE_HINT")
(values
'("normal" "GDK_WINDOW_TYPE_HINT_NORMAL")
'("dialog" "GDK_WINDOW_TYPE_HINT_DIALOG")
'("menu" "GDK_WINDOW_TYPE_HINT_MENU")
'("toolbar" "GDK_WINDOW_TYPE_HINT_TOOLBAR")
)
)
(define-flags WMDecoration
(in-module "Gdk")
(c-name "GdkWMDecoration")
(gtype-id "GDK_TYPE_WM_DECORATION")
(values
'("all" "GDK_DECOR_ALL")
'("border" "GDK_DECOR_BORDER")
'("resizeh" "GDK_DECOR_RESIZEH")
'("title" "GDK_DECOR_TITLE")
'("menu" "GDK_DECOR_MENU")
'("minimize" "GDK_DECOR_MINIMIZE")
'("maximize" "GDK_DECOR_MAXIMIZE")
)
)
(define-flags WMFunction
(in-module "Gdk")
(c-name "GdkWMFunction")
(gtype-id "GDK_TYPE_WM_FUNCTION")
(values
'("all" "GDK_FUNC_ALL")
'("resize" "GDK_FUNC_RESIZE")
'("move" "GDK_FUNC_MOVE")
'("minimize" "GDK_FUNC_MINIMIZE")
'("maximize" "GDK_FUNC_MAXIMIZE")
'("close" "GDK_FUNC_CLOSE")
)
)
(define-enum Gravity
(in-module "Gdk")
(c-name "GdkGravity")
(gtype-id "GDK_TYPE_GRAVITY")
(values
'("north-west" "GDK_GRAVITY_NORTH_WEST")
'("north" "GDK_GRAVITY_NORTH")
'("north-east" "GDK_GRAVITY_NORTH_EAST")
'("west" "GDK_GRAVITY_WEST")
'("center" "GDK_GRAVITY_CENTER")
'("east" "GDK_GRAVITY_EAST")
'("south-west" "GDK_GRAVITY_SOUTH_WEST")
'("south" "GDK_GRAVITY_SOUTH")
'("south-east" "GDK_GRAVITY_SOUTH_EAST")
'("static" "GDK_GRAVITY_STATIC")
)
)
(define-enum WindowEdge
(in-module "Gdk")
(c-name "GdkWindowEdge")
(gtype-id "GDK_TYPE_WINDOW_EDGE")
(values
'("north-west" "GDK_WINDOW_EDGE_NORTH_WEST")
'("north" "GDK_WINDOW_EDGE_NORTH")
'("north-east" "GDK_WINDOW_EDGE_NORTH_EAST")
'("west" "GDK_WINDOW_EDGE_WEST")
'("east" "GDK_WINDOW_EDGE_EAST")
'("south-west" "GDK_WINDOW_EDGE_SOUTH_WEST")
'("south" "GDK_WINDOW_EDGE_SOUTH")
'("south-east" "GDK_WINDOW_EDGE_SOUTH_EAST")
)
)
(define-enum PixbufAlphaMode
(in-module "Gdk")
(c-name "GdkPixbufAlphaMode")
(gtype-id "GDK_TYPE_PIXBUF_ALPHA_MODE")
(values
'("bilevel" "GDK_PIXBUF_ALPHA_BILEVEL")
'("full" "GDK_PIXBUF_ALPHA_FULL")
)
)
(define-enum Colorspace
(in-module "Gdk")
(c-name "GdkColorspace")
(gtype-id "GDK_TYPE_COLORSPACE")
(values
'("b" "GDK_COLORSPACE_RGB")
)
)
(define-enum PixbufError
(in-module "Gdk")
(c-name "GdkPixbufError")
(gtype-id "GDK_TYPE_PIXBUF_ERROR")
(values
'("header-corrupt" "GDK_PIXBUF_ERROR_HEADER_CORRUPT")
'("pixel-corrupt" "GDK_PIXBUF_ERROR_PIXEL_CORRUPT")
'("unknown-format" "GDK_PIXBUF_ERROR_UNKNOWN_FORMAT")
'("corrupt-image" "GDK_PIXBUF_ERROR_CORRUPT_IMAGE")
'("insufficient-memory" "GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY")
'("bad-option-value" "GDK_PIXBUF_ERROR_BAD_OPTION_VALUE")
'("unknown-type" "GDK_PIXBUF_ERROR_UNKNOWN_TYPE")
'("unsupported-operation" "GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION")
'("failed" "GDK_PIXBUF_ERROR_FAILED")
)
)
(define-enum InterpType
(in-module "Gdk")
(c-name "GdkInterpType")
(gtype-id "GDK_TYPE_INTERP_TYPE")
(values
'("nearest" "GDK_INTERP_NEAREST")
'("tiles" "GDK_INTERP_TILES")
'("bilinear" "GDK_INTERP_BILINEAR")
'("hyper" "GDK_INTERP_HYPER")
)
)

View file

@ -1,144 +0,0 @@
#!/usr/bin/perl
open (SRCFILE, $ARGV[0]) || die "Could open $ARGV[0]";
@lines = <SRCFILE>;
$linenum = 0;
while ($linenum < @lines) {
$line = $lines[$linenum];
if ($line =~ /^(\w+)_class_init/) {
$typename = StudCaps($1);
$fstr = "";
do {
$fstr .= $lines[$linenum++];
} until ($lines[$linenum] =~ /^}/);
parse_init_func ($typename, $fstr);
}
$linenum++;
}
sub parse_init_func
{
my ($class, $func) = @_;
my @init_lines = split (/\n/, $func);
my $linenum = 0;
while ($linenum < @init_lines) {
my $line = $init_lines[$linenum];
while ($linenum < @init_lines) {
$line = $init_lines[$linenum];
if ($line =~ /g_object_class_install_prop/) {
my $prop = $line;
do {
$prop .= $init_lines[++$linenum];
} until ($init_lines[$linenum] =~ /;/);
print_prop ($prop, $class);
} elsif ($line =~ /g_signal_new/) {
my $sig = $line;
do {
$sig .= $init_lines[++$linenum];
} until ($init_lines[$linenum] =~ /;/);
print_signal ($sig, $class);
}
$linenum++;
}
$linenum++;
}
}
sub print_signal
{
my ($spec, $class) = @_;
$spec =~ s/\n\s*//g;
$spec =~ /\((.*)\);/;
my @args = split (/,\s*/, $1);
$args[0] =~ /\w+/;
my $name = $&;
my $ret = $args[8];
if ($ret =~ /G_TYPE_(\w+)/) {
$ret = lc ($1);
}
my $param_cnt = $args[9];
my $pstr = "\t<signal name=\"$name\">\n";
$pstr .= "\t\t<return> $ret </return>\n";
if ($param_cnt) {
$pstr .= "\t\t<parameters>\n";
for ($i=0; $i < $param_cnt; $i++) {
if ($args[$i+10] =~ /G_TYPE_(\w+)/) {
$args[$i+10] = lc ($1);
}
$pstr .= "\t\t\t<param> $args[$i+10] </param>\n";
}
$pstr .= "\t\t</parameters>\n";
}
$pstr .= "\t</signal>\n\n";
$signals{$name} = $pstr;
}
sub print_prop
{
my ($spec, $class) = @_;
$spec =~ /g_param_spec_(\w+)\s*\((.*)/;
$type = $1;
$params = $2;
if ($type =~ /boolean|^u*int|pointer/) {
$params =~ /\"(.+)\",.+\".+\".+\"(.+)\".*(,\s*G_PARAM_\w+.*)\)\s*\)/;
$name = $1; $docs = $2; $mode = $3;
$type = "g$type";
} elsif ($type =~ /string/) {
$params =~ /\"(.+)\",.+\".+\".+\"(.+)\".*(,\s*G_PARAM_\w+.*)\)\s*\)/;
$name = $1; $docs = $2; $mode = $3;
$type = "gchar*";
} elsif ($type =~ /enum|flags/) {
$params =~ /\"(.+)\",.+,.+\"(.+)\".*,\s+(\w+),.*,(\s*G_PARAM_\w+.*)\)\s*\)/;
$name = $1; $docs = $2; $type = $3; $mode = $4;
$type =~ s/TYPE_//;
$type = StudCaps(lc($type));
} elsif ($type =~ /object/) {
$params =~ /\"(.+)\",.+,.+\"(.+)\".*,\s+(\w+),(\s*G_PARAM_\w+.*)\)\s*\)/;
$name = $1; $docs = $2; $type = $3; $mode = $4;
$type =~ s/TYPE_//;
$type = StudCaps(lc($type));
}
print "(define-property $name\n";
print " (of-object \"$class\")\n";
print " (prop-type \"$type\")\n";
print " (doc-string \"$docs\")\n";
if ($mode =~ /READ/) { print " (readable #t)\n"; }
if ($mode =~ /WRIT/) { print " (writeable #t)\n"; }
if ($mode =~ /CONS/) { print " (construct-only #t)\n"; }
print ")\n\n";
$props{$name} = $pstr;
}
sub StudCaps
{
my ($str) = @_;
$str =~ s/^(\w)/\u\1/;
$str =~ s/[_-]([a-z])/\u\1/g;
$str =~ s/[_-](\d)/\1/g;
return $str;
}

View file

@ -1,96 +0,0 @@
#!/usr/bin/perl
$hdrfile = $srcfile = $ARGV[0];
$hdrfile =~ s/c$/h/;
open (SRCFILE, $srcfile) || die "Could open $srcfile";
@lines = <SRCFILE>;
open (SRCFILE, $hdrfile) || die "Could open $hdrfile";
@hdrlines = <SRCFILE>;
$linenum = 0;
while ($linenum < @lines) {
$line = $lines[$linenum];
if ($line =~ /^(\w+)_class_init/) {
$typename = StudCaps($1);
} elsif ($line =~ /g_signal_new/) {
$str = $line;
do {
$str .= $lines[++$linenum];
} until ($lines[$linenum] =~ /;/);
print_signal ($str, $typename);
}
$linenum++;
}
sub print_signal
{
my ($spec, $class) = @_;
$spec =~ s/\n\s*//g;
$spec =~ /\(\"(\w+)\",.*G_SIGNAL_RUN_(\w+).*_OFFSET\s*\((.*)\),/;
$signame = $1;
$run = lc($2);
$class_method = $3;
($ret, $params) = lookup_method($class_method);
print "(define-signal $signame\n";
print " (of-object \"$class\")\n";
print " (return-type \"$ret\")\n";
print " (when \"$run\")\n";
print $params;
print ")\n\n";
}
sub lookup_method
{
my ($pstr) = @_;
my $lineno = 0;
($classname, $method) = split(/,\s*/, $pstr);
while ($hdrlines[$lineno] !~ /^struct\s*_$classname/) {$lineno++;}
do {
if ($hdrlines[$lineno] =~ /$method/) {
$sig = "";
while ($hdrlines[$lineno] !~ /;/) {
$sig .= $hdrlines[$lineno++];
}
$sig .= $hdrlines[$lineno];
$sig =~ s/\n\s*//g;
$sig =~ /(\S+)\s*\(\* $method\)\s*\((.*)\);/;
$ret = $1;
$parms = $2;
$ret =~ s/void/none/;
@plist = split(/,/, $parms);
$parms = " (parameters\n";
foreach $parm (@plist) {
$parm =~ s/\s+\*/\* /;
$parm =~ s/(\S+)/"$1"/g;
$parms .= " '($parm)\n";
}
$parms .= " )\n";
return ($ret, $parms);
}
} until ($hdrlines[$lineno++] =~ /^}/);
return ();
}
sub StudCaps
{
my ($str) = @_;
$str =~ s/^(\w)/\u\1/;
$str =~ s/[_-]([a-z])/\u\1/g;
$str =~ s/[_-](\d)/\1/g;
return $str;
}

View file

@ -1,66 +0,0 @@
#!/usr/bin/perl
#
# get-structs-from-source.pl : Extracts define-struct expressions
#
# Author: Mike Kestner (mkestner@speakeasy.net)
#
# <c> 2001 Mike Kestner
while ($line = <STDIN>) {
if ($line =~ /typedef\s+struct\s+(\w+)\s+\**(\w+);/) {
$types{$2} = $1;
} elsif ($line =~ /typedef\s+(\w+)\s+(\w+);/) {
$types{$2} = $1;
} elsif ($line =~ /^struct\s+(\w+)/) {
$sname = $1;
$sdef = $line;
while ($line = <STDIN>) {
$sdef .= $line;
last if ($line =~ /^}/);
}
$sdefs{$sname} = $sdef;
}
}
foreach $key (sort (keys (%types))) {
next if (($key =~ /Class$/) || ($key =~ "Private") ||
exists($types{$key."Class"}));
if (exists($sdefs{$key})) {
$def = $sdefs{$key};
} else {
$newkey = $types{$key};
while ($newkey && !exists($sdefs{$newkey})) {
$newkey = $types{$newkey};
}
warn "$key has no struct def\n" if ($newkey eq "");
$def = $sdefs{$newkey};
}
$key =~ /$ARGV[0](\w+)/;
print "(define-struct $1\n";
print " (in-module \"$ARGV[0]\")\n";
print " (c-name \"$key\")\n";
print " (fields\n";
$def =~ s/\s+/ /g;
$def =~ s/\n\s*//g;
$def =~ s|/\*.*?\*/||g;
$def =~ /\{(.+)\}/;
foreach $mem (split (/;/, $1)) {
$mem =~ s/\s+(\*+)/\1 /g;
$mem =~ s/const /const\-/g;
if ($mem =~ /(\S+\s+\(\*)\s*(.+\))/) {
$type = $1; $fdesc = $2;
$type =~ s/\s+\(\*/\*/;
$fdesc =~ s/^(\w+)\)/\1/;
print " '(\"$type\" \"$fdesc\")\n";
} elsif ($mem =~ /(\S+)\s+(.+)/) {
$type = $1; $symb = $2;
foreach $tok (split (/,\s*/, $symb)) {
print " '(\"$type\" \"$tok\")\n";
}
}
}
print " )\n)\n\n";
}

View file

@ -1,282 +0,0 @@
(define-property name
(of-object "GtkWidget")
(prop-type "gchar*")
(doc-string "The name of the widget")
(readable #t)
(writeable #t)
)
(define-property parent
(of-object "GtkWidget")
(prop-type "GtkContainer")
(doc-string "The parent widget of this widget. Must be a Container widget.")
(readable #t)
(writeable #t)
)
(define-property width_request
(of-object "GtkWidget")
(prop-type "gint")
(doc-string "Override for width request of the widget, or -1 if natural request should be used.")
(readable #t)
(writeable #t)
)
(define-property height_request
(of-object "GtkWidget")
(prop-type "gint")
(doc-string "Override for height request of the widget, or -1 if natural request should be used.")
(readable #t)
(writeable #t)
)
(define-property visible
(of-object "GtkWidget")
(prop-type "gboolean")
(doc-string "Whether the widget is visible")
(readable #t)
(writeable #t)
)
(define-property sensitive
(of-object "GtkWidget")
(prop-type "gboolean")
(doc-string "Whether the widget responds to input")
(readable #t)
(writeable #t)
)
(define-property app_paintable
(of-object "GtkWidget")
(prop-type "gboolean")
(doc-string "Whether the application will paint directly on the widget")
(readable #t)
(writeable #t)
)
(define-property can_focus
(of-object "GtkWidget")
(prop-type "gboolean")
(doc-string "Whether the widget can accept the input focus")
(readable #t)
(writeable #t)
)
(define-property has_focus
(of-object "GtkWidget")
(prop-type "gboolean")
(doc-string "Whether the widget has the input focus")
(readable #t)
(writeable #t)
)
(define-property can_default
(of-object "GtkWidget")
(prop-type "gboolean")
(doc-string "Whether the widget can be the default widget")
(readable #t)
(writeable #t)
)
(define-property has_default
(of-object "GtkWidget")
(prop-type "gboolean")
(doc-string "Whether the widget is the default widget")
(readable #t)
(writeable #t)
)
(define-property receives_default
(of-object "GtkWidget")
(prop-type "gboolean")
(doc-string "If TRUE, the widget will receive the default action when it is focused.")
(readable #t)
(writeable #t)
)
(define-property composite_child
(of-object "GtkWidget")
(prop-type "gboolean")
(doc-string "Whether the widget is composed of other widgets")
(readable #t)
)
(define-property style
(of-object "GtkWidget")
(prop-type "GtkStyle")
(doc-string "The style of the widget, which contains information about how it will look (colors etc).")
(readable #t)
(writeable #t)
)
(define-property events
(of-object "GtkWidget")
(prop-type "GdkEventMask")
(doc-string "The event mask that decides what kind of GdkEvents this widget gets.")
(readable #t)
(writeable #t)
)
(define-property extension_events
(of-object "GtkWidget")
(prop-type "GdkExtensionMode")
(doc-string "The mask that decides what kind of extension events this widget gets.")
(readable #t)
(writeable #t)
)
(define-property user_data
(of-object "GtkObject")
(prop-type "gpointer")
(doc-string "Anonymous User Data Pointer")
(readable #t)
(writeable #t)
)
(define-property resize_mode
(of-object "GtkContainer")
(prop-type "GtkResizeMode")
(doc-string "Specify how resize events are handled")
(readable #t)
(writeable #t)
)
(define-property border_width
(of-object "GtkContainer")
(prop-type "guint")
(doc-string "The width of the empty border outside the containers children.")
(readable #t)
(writeable #t)
)
(define-property child
(of-object "GtkContainer")
(prop-type "GtkWidget")
(doc-string "Can be used to add a new child to the container.")
(writeable #t)
)
(define-property type
(of-object "GtkWindow")
(prop-type "GtkWindowType")
(doc-string "The type of the window")
(readable #t)
(writeable #t)
(construct-only #t)
)
(define-property title
(of-object "GtkWindow")
(prop-type "gchar*")
(doc-string "The title of the window")
(readable #t)
(writeable #t)
)
(define-property allow_shrink
(of-object "GtkWindow")
(prop-type "gboolean")
(doc-string "If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the time a bad idea.")
(readable #t)
(writeable #t)
)
(define-property allow_grow
(of-object "GtkWindow")
(prop-type "gboolean")
(doc-string "If TRUE, users can expand the window beyond its minimum size.")
(readable #t)
(writeable #t)
)
(define-property resizable
(of-object "GtkWindow")
(prop-type "gboolean")
(doc-string "If TRUE, users can resize the window.")
(readable #t)
(writeable #t)
)
(define-property modal
(of-object "GtkWindow")
(prop-type "gboolean")
(doc-string "If TRUE, the window is modal (other windows are not usable while this one is up).")
(readable #t)
(writeable #t)
)
(define-property window_position
(of-object "GtkWindow")
(prop-type "GtkWindowPosition")
(doc-string "The initial position of the window.")
(readable #t)
(writeable #t)
)
(define-property default_width
(of-object "GtkWindow")
(prop-type "gint")
(doc-string "The default width of the window, used when initially showing the window.")
(readable #t)
(writeable #t)
)
(define-property default_height
(of-object "GtkWindow")
(prop-type "gint")
(doc-string "The default height of the window, used when initially showing the window.")
(readable #t)
(writeable #t)
)
(define-property destroy_with_parent
(of-object "GtkWindow")
(prop-type "gboolean")
(doc-string "If this window should be destroyed when the parent is destroyed")
(readable #t)
(writeable #t)
)
(define-property icon
(of-object "GtkWindow")
(prop-type "GdkPixbuf")
(doc-string "Icon for this window")
(readable #t)
(writeable #t)
)
(define-property label
(of-object "GtkButton")
(prop-type "gchar*")
(doc-string "Text of the label widget inside the button, if the button contains a label widget.")
(readable #t)
(writeable #t)
(construct-only #t)
)
(define-property use_underline
(of-object "GtkButton")
(prop-type "gboolean")
(doc-string "If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key")
(readable #t)
(writeable #t)
(construct-only #t)
)
(define-property use_stock
(of-object "GtkButton")
(prop-type "gboolean")
(doc-string "If set, the label is used to pick a stock item instead of being displayed")
(readable #t)
(writeable #t)
(construct-only #t)
)
(define-property relief
(of-object "GtkButton")
(prop-type "GtkReliefStyle")
(doc-string "The border relief style.")
(readable #t)
(writeable #t)
)

View file

@ -1,423 +0,0 @@
(define-signal set_focus
(of-object "GtkWindow")
(return-type "none")
(when "last")
(parameters
'("GtkWindow*" "window")
'("GtkWidget*" "focus")
)
)
(define-signal frame_event
(of-object "GtkWindow")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEvent*" "event")
)
)
(define-signal activate_focus
(of-object "GtkWindow")
(return-type "none")
(when "last")
(parameters
'("GtkWindow*" "window")
)
)
(define-signal activate_default
(of-object "GtkWindow")
(return-type "none")
(when "last")
(parameters
'("GtkWindow*" "window")
)
)
(define-signal move_focus
(of-object "GtkWindow")
(return-type "none")
(when "last")
(parameters
'("GtkWindow*" "window")
'("GtkDirectionType" "direction")
)
)
(define-signal size_request
(of-object "GtkWidget")
(return-type "none")
(when "first")
(parameters
'("GtkWidget*" "widget")
'("GtkRequisition*" "requisition")
)
)
(define-signal child_notify
(of-object "GtkWidget")
(return-type "none")
(when "first")
(parameters
'("GtkWidget*" "widget")
'("GParamSpec*" "pspec")
)
)
(define-signal focus
(of-object "GtkWidget")
(return-type "none")
(when "last")
(parameters
)
)
(define-signal event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEvent*" "event")
)
)
(define-signal button_press_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventButton*" "event")
)
)
(define-signal button_release_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventButton*" "event")
)
)
(define-signal scroll_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventScroll*" "event")
)
)
(define-signal motion_notify_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventMotion*" "event")
)
)
(define-signal delete_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventAny*" "event")
)
)
(define-signal destroy_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventAny*" "event")
)
)
(define-signal expose_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventExpose*" "event")
)
)
(define-signal key_press_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventKey*" "event")
)
)
(define-signal key_release_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventKey*" "event")
)
)
(define-signal enter_notify_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventCrossing*" "event")
)
)
(define-signal leave_notify_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventCrossing*" "event")
)
)
(define-signal configure_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventConfigure*" "event")
)
)
(define-signal focus_in_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventFocus*" "event")
)
)
(define-signal focus_out_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventFocus*" "event")
)
)
(define-signal map_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventAny*" "event")
)
)
(define-signal unmap_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventAny*" "event")
)
)
(define-signal property_notify_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventProperty*" "event")
)
)
(define-signal selection_clear_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventSelection*" "event")
)
)
(define-signal selection_request_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventSelection*" "event")
)
)
(define-signal selection_notify_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventSelection*" "event")
)
)
(define-signal selection_received
(of-object "GtkWidget")
(return-type "none")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GtkSelectionData*" "selection_data")
'("guint" "time")
)
)
(define-signal selection_get
(of-object "GtkWidget")
(return-type "none")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GtkSelectionData*" "selection_data")
'("guint" "info")
'("guint" "time")
)
)
(define-signal proximity_in_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventProximity*" "event")
)
)
(define-signal proximity_out_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventProximity*" "event")
)
)
(define-signal drag_motion
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkDragContext*" "context")
'("gint" "x")
'("gint" "y")
'("guint" "time")
)
)
(define-signal drag_drop
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkDragContext*" "context")
'("gint" "x")
'("gint" "y")
'("guint" "time")
)
)
(define-signal drag_data_get
(of-object "GtkWidget")
(return-type "none")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkDragContext*" "context")
'("GtkSelectionData*" "selection_data")
'("guint" "info")
'("guint" "time")
)
)
(define-signal drag_data_received
(of-object "GtkWidget")
(return-type "none")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkDragContext*" "context")
'("gint" "x")
'("gint" "y")
'("GtkSelectionData*" "selection_data")
'("guint" "info")
'("guint" "time")
)
)
(define-signal visibility_notify_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventVisibility*" "event")
)
)
(define-signal client_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventClient*" "event")
)
)
(define-signal no_expose_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventAny*" "event")
)
)
(define-signal window_state_event
(of-object "GtkWidget")
(return-type "gboolean")
(when "last")
(parameters
'("GtkWidget*" "widget")
'("GdkEventWindowState*" "event")
)
)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,30 +0,0 @@
(define-struct Event
(in-module "Gdk")
(c-name "GdkEvent")
(fields
'("GdkEventType" "type")
)
)
(define-struct AccelEntry
(in-module "Gtk")
(c-name "GtkAccelEntry")
(fields
'("GtkAccelGroup*" "accel_group")
'("guint" "accelerator_key")
'("GdkModifierType" "accelerator_mods")
'("GtkAccelFlags" "accel_flags")
'("GObject*" "object")
'("guint" "signal_id")
)
)
(define-struct TargetList
(in-module "Gtk")
(c-name "GtkTargetList")
(fields
'("GList*" "target_list")
'("guint" "ref_count")
)
)

View file

@ -1,10 +0,0 @@
all:
@echo "You must use 'make windows' or 'make unix'."
@echo "'make unix' is broken for now."
windows:
cat pango-types.defs pango-structs.defs pango.defs gdk-types.defs gdk-structs.defs hardcoded.defs gtk-types.defs gtk-structs.defs gtk-signals.defs gtk-props.defs gtk.defs | ./defs-parse.pl
unix:
@echo "'make unix' is broken for now."

View file

@ -1,412 +0,0 @@
(define-struct Analysis
(in-module "Pango")
(c-name "PangoAnalysis")
(fields
'("PangoEngineShape*" "shape_engine")
'("PangoEngineLang*" "lang_engine")
'("PangoFont*" "font")
'("guint8" "level")
'("PangoLanguage*" "language")
'("GSList*" "extra_attrs")
)
)
(define-struct AttrColor
(in-module "Pango")
(c-name "PangoAttrColor")
(fields
'("PangoAttribute" "attr")
'("PangoColor" "color")
)
)
(define-struct AttrFloat
(in-module "Pango")
(c-name "PangoAttrFloat")
(fields
'("PangoAttribute" "attr")
'("double" "value")
)
)
(define-struct AttrFontDesc
(in-module "Pango")
(c-name "PangoAttrFontDesc")
(fields
'("PangoAttribute" "attr")
'("PangoFontDescription*" "desc")
)
)
(define-struct AttrInt
(in-module "Pango")
(c-name "PangoAttrInt")
(fields
'("PangoAttribute" "attr")
'("int" "value")
)
)
(define-struct AttrIterator
(in-module "Pango")
(c-name "PangoAttrIterator")
(fields
)
)
(define-struct AttrLanguage
(in-module "Pango")
(c-name "PangoAttrLanguage")
(fields
'("PangoAttribute" "attr")
'("PangoLanguage*" "value")
)
)
(define-struct AttrList
(in-module "Pango")
(c-name "PangoAttrList")
(fields
)
)
(define-struct AttrShape
(in-module "Pango")
(c-name "PangoAttrShape")
(fields
'("PangoAttribute" "attr")
'("PangoRectangle" "ink_rect")
'("PangoRectangle" "logical_rect")
)
)
(define-struct AttrString
(in-module "Pango")
(c-name "PangoAttrString")
(fields
'("PangoAttribute" "attr")
'("char*" "value")
)
)
(define-struct Attribute
(in-module "Pango")
(c-name "PangoAttribute")
(fields
'("gpointer" "klass")
'("guint" "start_index")
'("guint" "end_index")
)
)
(define-struct Color
(in-module "Pango")
(c-name "PangoColor")
(fields
'("guint16" "red")
'("guint16" "green")
'("guint16" "blue")
)
)
(define-struct Coverage
(in-module "Pango")
(c-name "PangoCoverage")
(fields
)
)
(define-struct Engine
(in-module "Pango")
(c-name "PangoEngine")
(fields
'("gchar*" "id")
'("gchar*" "type")
'("gint" "length")
)
)
(define-struct EngineInfo
(in-module "Pango")
(c-name "PangoEngineInfo")
(fields
'("gchar*" "id")
'("gchar*" "engine_type")
'("gchar*" "render_type")
'("PangoEngineRange*" "ranges")
'("gint" "n_ranges")
)
)
(define-struct EngineLang
(in-module "Pango")
(c-name "PangoEngineLang")
(fields
'("PangoEngine" "engine")
'("void*" "script_break (const-char* text, int len, PangoAnalysis* analysis, PangoLogAttr* attrs, int attrs_len)")
)
)
(define-struct EngineRange
(in-module "Pango")
(c-name "PangoEngineRange")
(fields
'("guint32" "start")
'("guint32" "end")
'("gchar*" "langs")
)
)
(define-struct EngineShape
(in-module "Pango")
(c-name "PangoEngineShape")
(fields
'("PangoEngine" "engine")
'("void*" "script_shape (PangoFont* font, const-char* text, int length, PangoAnalysis* analysis, PangoGlyphString* glyphs)")
'("PangoCoverage**" "get_coverage (PangoFont* font, PangoLanguage* language)")
)
)
(define-struct FontDescription
(in-module "Pango")
(c-name "PangoFontDescription")
(fields
)
)
(define-struct FontMetrics
(in-module "Pango")
(c-name "PangoFontMetrics")
(fields
'("guint" "ref_count")
'("int" "ascent")
'("int" "descent")
'("int" "approximate_char_width")
'("int" "approximate_digit_width")
)
)
(define-struct Glyph
(in-module "Pango")
(c-name "PangoGlyph")
(fields
)
)
(define-struct GlyphGeometry
(in-module "Pango")
(c-name "PangoGlyphGeometry")
(fields
'("PangoGlyphUnit" "width")
'("PangoGlyphUnit" "x_offset")
'("PangoGlyphUnit" "y_offset")
)
)
(define-struct GlyphInfo
(in-module "Pango")
(c-name "PangoGlyphInfo")
(fields
'("PangoGlyph" "glyph")
'("PangoGlyphGeometry" "geometry")
'("PangoGlyphVisAttr" "attr")
)
)
(define-struct GlyphString
(in-module "Pango")
(c-name "PangoGlyphString")
(fields
'("gint" "num_glyphs")
'("PangoGlyphInfo*" "glyphs")
'("gint*" "log_clusters")
'("gint" "space")
)
)
(define-struct GlyphUnit
(in-module "Pango")
(c-name "PangoGlyphUnit")
(fields
)
)
(define-struct GlyphVisAttr
(in-module "Pango")
(c-name "PangoGlyphVisAttr")
(fields
'("guint" "is_cluster_start : 1")
)
)
(define-struct IncludedModule
(in-module "Pango")
(c-name "PangoIncludedModule")
(fields
'("void*" "list (PangoEngineInfo** engines, int* n_engines)")
'("PangoEngine**" "load (const-char* id)")
'("void*" "unload (PangoEngine* engine)")
)
)
(define-struct IndicScript
(in-module "Pango")
(c-name "PangoIndicScript")
(fields
'("gchar*" "name")
'("gboolean*" "is_prefixing_vowel (gunichar what)")
'("gboolean*" "is_vowel_sign (gunichar what)")
'("gunichar*" "vowel_sign_to_matra (gunichar what)")
'("gboolean*" "is_vowel_half (gunichar what)")
'("gboolean*" "vowel_split (gunichar what, gunichar* prefix, gunichar* suffix)")
)
)
(define-struct IntSet
(in-module "Pango")
(c-name "PangoIntSet")
(fields
'("int" "start")
'("int" "size")
'("guint*" "bits")
)
)
(define-struct Item
(in-module "Pango")
(c-name "PangoItem")
(fields
'("gint" "offset")
'("gint" "length")
'("gint" "num_chars")
'("PangoAnalysis" "analysis")
)
)
(define-struct Language
(in-module "Pango")
(c-name "PangoLanguage")
(fields
)
)
(define-struct LayoutIter
(in-module "Pango")
(c-name "PangoLayoutIter")
(fields
)
)
(define-struct LayoutLine
(in-module "Pango")
(c-name "PangoLayoutLine")
(fields
'("PangoLayout*" "layout")
'("gint" "start_index")
'("gint" "length")
'("GSList*" "runs")
)
)
(define-struct LayoutRun
(in-module "Pango")
(c-name "PangoLayoutRun")
(fields
'("PangoItem*" "item")
'("PangoGlyphString*" "glyphs")
)
)
(define-struct LogAttr
(in-module "Pango")
(c-name "PangoLogAttr")
(fields
'("guint" "is_line_break : 1")
'("guint" "is_mandatory_break : 1")
'("guint" "is_char_break : 1")
'("guint" "is_white : 1")
'("guint" "is_cursor_position : 1")
'("guint" "is_word_start : 1")
'("guint" "is_word_end : 1")
'("guint" "is_sentence_boundary : 1")
'("guint" "is_sentence_start : 1")
'("guint" "is_sentence_end : 1")
)
)
(define-struct Map
(in-module "Pango")
(c-name "PangoMap")
(fields
)
)
(define-struct MapEntry
(in-module "Pango")
(c-name "PangoMapEntry")
(fields
'("PangoEngineInfo*" "info")
'("gboolean" "is_exact")
)
)
(define-struct OTInfo
(in-module "Pango")
(c-name "PangoOTInfo")
(fields
)
)
(define-struct OTRuleset
(in-module "Pango")
(c-name "PangoOTRuleset")
(fields
)
)
(define-struct OTTag
(in-module "Pango")
(c-name "PangoOTTag")
(fields
)
)
(define-struct Rectangle
(in-module "Pango")
(c-name "PangoRectangle")
(fields
'("int" "x")
'("int" "y")
'("int" "width")
'("int" "height")
)
)
(define-struct TabArray
(in-module "Pango")
(c-name "PangoTabArray")
(fields
)
)
(define-struct Win32FontCache
(in-module "Pango")
(c-name "PangoWin32FontCache")
(fields
)
)
(define-struct XFontCache
(in-module "Pango")
(c-name "PangoXFontCache")
(fields
)
)
(define-struct XSubfont
(in-module "Pango")
(c-name "PangoXSubfont")
(fields
)
)

View file

@ -1,271 +0,0 @@
;; -*- scheme -*-
; object definitions ...
(define-object Context
(in-module "Pango")
(parent "GObject")
(c-name "PangoContext")
(gtype-id "PANGO_TYPE_CONTEXT")
)
(define-object Font
(in-module "Pango")
(parent "GObject")
(c-name "PangoFont")
(gtype-id "PANGO_TYPE_FONT")
)
(define-object FontFace
(in-module "Pango")
(parent "GObject")
(c-name "PangoFontFace")
(gtype-id "PANGO_TYPE_FONT_FACE")
)
(define-object FontFamily
(in-module "Pango")
(parent "GObject")
(c-name "PangoFontFamily")
(gtype-id "PANGO_TYPE_FONT_FAMILY")
)
(define-object FontMap
(in-module "Pango")
(parent "GObject")
(c-name "PangoFontMap")
(gtype-id "PANGO_TYPE_FONT_MAP")
)
(define-object Layout
(in-module "Pango")
(parent "GObject")
(c-name "PangoLayout")
(gtype-id "PANGO_TYPE_LAYOUT")
)
;; boxed definitions ...
(define-boxed AttrList
(in-module "Pango")
(c-name "PangoAttrList")
(gtype-id "PANGO_TYPE_ATTR_LIST")
(copy-func "pango_attr_list_ref")
(release-func "pango_attr_list_unref")
)
(define-boxed Color
(in-module "Pango")
(c-name "PangoColor")
(gtype-id "PANGO_TYPE_COLOR")
(copy-func "pango_color_copy")
(release-func "pango_color_free")
(fields
'("guint16" "red")
'("guint16" "green")
'("guint16" "blue")
)
)
(define-boxed FontDescription
(in-module "Pango")
(c-name "PangoFontDescription")
(gtype-id "PANGO_TYPE_FONT_DESCRIPTION")
(copy-func "pango_font_description_copy")
(release-func "pango_font_description_free")
)
(define-boxed FontMetrics
(in-module "Pango")
(c-name "PangoFontMetrics")
(gtype-id "PANGO_TYPE_FONT_METRICS")
(copy-func "pango_font_metrics_ref")
(release-func "pango_font_metrics_unref")
)
(define-boxed GlyphString
(in-module "Pango")
(c-name "PangoGlyphString")
(gtype-id "PANGO_TYPE_GLYPH_STRING")
(copy-func "pango_glyph_string_copy")
(release-func "pango_glyph_string_free")
(fields
'("gint" "num_glyphs")
'("PangoGlyphInfo*" "glyphs")
'("gint*" "log_clusters")
)
)
(define-boxed Language
(in-module "Pango")
(c-name "PangoLanguage")
(gtype-id "PANGO_TYPE_LANGUAGE")
)
(define-boxed TabArray
(in-module "Pango")
(c-name "PangoTabArray")
(gtype-id "PANGO_TYPE_TAB_ARRAY")
(copy-func "pango_tab_array_copy")
(release-func "pango_tab_array_free")
)
;; Enumerations and flags ...
(define-enum AttrType
(in-module "Pango")
(c-name "PangoAttrType")
(gtype-id "PANGO_TYPE_ATTR_TYPE")
(values
'("invalid" "PANGO_ATTR_INVALID")
'("language" "PANGO_ATTR_LANGUAGE")
'("family" "PANGO_ATTR_FAMILY")
'("style" "PANGO_ATTR_STYLE")
'("weight" "PANGO_ATTR_WEIGHT")
'("variant" "PANGO_ATTR_VARIANT")
'("stretch" "PANGO_ATTR_STRETCH")
'("size" "PANGO_ATTR_SIZE")
'("font-desc" "PANGO_ATTR_FONT_DESC")
'("foreground" "PANGO_ATTR_FOREGROUND")
'("background" "PANGO_ATTR_BACKGROUND")
'("underline" "PANGO_ATTR_UNDERLINE")
'("strikethrough" "PANGO_ATTR_STRIKETHROUGH")
'("rise" "PANGO_ATTR_RISE")
'("shape" "PANGO_ATTR_SHAPE")
'("scale" "PANGO_ATTR_SCALE")
)
)
(define-enum Underline
(in-module "Pango")
(c-name "PangoUnderline")
(gtype-id "PANGO_TYPE_UNDERLINE")
(values
'("none" "PANGO_UNDERLINE_NONE")
'("single" "PANGO_UNDERLINE_SINGLE")
'("double" "PANGO_UNDERLINE_DOUBLE")
'("low" "PANGO_UNDERLINE_LOW")
)
)
(define-enum CoverageLevel
(in-module "Pango")
(c-name "PangoCoverageLevel")
(gtype-id "PANGO_TYPE_COVERAGE_LEVEL")
(values
'("none" "PANGO_COVERAGE_NONE")
'("fallback" "PANGO_COVERAGE_FALLBACK")
'("approximate" "PANGO_COVERAGE_APPROXIMATE")
'("exact" "PANGO_COVERAGE_EXACT")
)
)
(define-enum Style
(in-module "Pango")
(c-name "PangoStyle")
(gtype-id "PANGO_TYPE_STYLE")
(values
'("normal" "PANGO_STYLE_NORMAL")
'("oblique" "PANGO_STYLE_OBLIQUE")
'("italic" "PANGO_STYLE_ITALIC")
)
)
(define-enum Variant
(in-module "Pango")
(c-name "PangoVariant")
(gtype-id "PANGO_TYPE_VARIANT")
(values
'("normal" "PANGO_VARIANT_NORMAL")
'("small-caps" "PANGO_VARIANT_SMALL_CAPS")
)
)
(define-enum Weight
(in-module "Pango")
(c-name "PangoWeight")
(gtype-id "PANGO_TYPE_WEIGHT")
(values
'("ultralight" "PANGO_WEIGHT_ULTRALIGHT")
'("light" "PANGO_WEIGHT_LIGHT")
'("normal" "PANGO_WEIGHT_NORMAL")
'("bold" "PANGO_WEIGHT_BOLD")
'("ultrabold" "PANGO_WEIGHT_ULTRABOLD")
'("heavy" "PANGO_WEIGHT_HEAVY")
)
)
(define-enum Stretch
(in-module "Pango")
(c-name "PangoStretch")
(gtype-id "PANGO_TYPE_STRETCH")
(values
'("ultra-condensed" "PANGO_STRETCH_ULTRA_CONDENSED")
'("extra-condensed" "PANGO_STRETCH_EXTRA_CONDENSED")
'("condensed" "PANGO_STRETCH_CONDENSED")
'("semi-condensed" "PANGO_STRETCH_SEMI_CONDENSED")
'("normal" "PANGO_STRETCH_NORMAL")
'("semi-expanded" "PANGO_STRETCH_SEMI_EXPANDED")
'("expanded" "PANGO_STRETCH_EXPANDED")
'("extra-expanded" "PANGO_STRETCH_EXTRA_EXPANDED")
'("ultra-expanded" "PANGO_STRETCH_ULTRA_EXPANDED")
)
)
(define-flags FontMask
(in-module "Pango")
(c-name "PangoFontMask")
(gtype-id "PANGO_TYPE_FONT_MASK")
(values
'("family" "PANGO_FONT_MASK_FAMILY")
'("style" "PANGO_FONT_MASK_STYLE")
'("variant" "PANGO_FONT_MASK_VARIANT")
'("weight" "PANGO_FONT_MASK_WEIGHT")
'("stretch" "PANGO_FONT_MASK_STRETCH")
'("size" "PANGO_FONT_MASK_SIZE")
)
)
(define-enum Alignment
(in-module "Pango")
(c-name "PangoAlignment")
(gtype-id "PANGO_TYPE_ALIGNMENT")
(values
'("left" "PANGO_ALIGN_LEFT")
'("center" "PANGO_ALIGN_CENTER")
'("right" "PANGO_ALIGN_RIGHT")
)
)
(define-enum WrapMode
(in-module "Pango")
(c-name "PangoWrapMode")
(gtype-id "PANGO_TYPE_WRAP_MODE")
(values
'("word" "PANGO_WRAP_WORD")
'("char" "PANGO_WRAP_CHAR")
)
)
(define-enum TabAlign
(in-module "Pango")
(c-name "PangoTabAlign")
(gtype-id "PANGO_TYPE_TAB_ALIGN")
(values
'("t" "PANGO_TAB_LEFT")
)
)
(define-enum Direction
(in-module "Pango")
(c-name "PangoDirection")
(gtype-id "PANGO_TYPE_DIRECTION")
(values
'("ltr" "PANGO_DIRECTION_LTR")
'("rtl" "PANGO_DIRECTION_RTL")
'("ttb-ltr" "PANGO_DIRECTION_TTB_LTR")
'("ttb-rtl" "PANGO_DIRECTION_TTB_RTL")
)
)

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
Put source modules here to parse for the gtkapi.xml file.
Currently supported:
glib-2.0.3
pango-1.0.3
atk-1.0.2
gtk+-2.0.5
* you need gdkpixbuf*.[ch] from gdk/ symlinked into gdk-pixbuf/
libgnome-2.0.1
libgnomecanvas-2.0.1
libgnomeui-2.0.1
gtkhtml: cvs branch gnome-2-port files gtkhtml.[ch], gtkhtml-types.h,
gtkhtml-enums.h, gtkhtml-stream.[ch]
libglade-2.0.0
libart_lgpl-2.3.10

View file

@ -1,3 +0,0 @@
Fix enum bug where symbolic values are used (eg Gdk.ModifierType.ModifierMask).
Fix property names where a variable is used instead of a string literal.
Fix the bool property macro definitions in GtkTextTag and CellRendererText.

View file

@ -1,5 +0,0 @@
all: todo.html
todo.html: todo.xml todo.xsl
xsltproc todo.xsl todo.xml > todo.html

View file

@ -1,21 +0,0 @@
<?xml version="1.0"?>
<todo>
<item name="null">
<brief>Some methods need to accept null arguments.</brief>
<description>gtk.defs has &quot;is-null&quot; metadata tags, this needs to be
translated/added to the XML metadata and implemented in generator.</description>
<notes>Bug <a href="http://bugzilla.ximian.com/show_bug.cgi?id=26405">#26405</a>.</notes>
<status>0</status>
</item>
<item name="docs">
<brief>Gtk+ docs must be merged in.</brief>
<description>The docs generated for Gtk+, et al need to be merged into the doc-string attributes, and then output by generator.</description>
<wrangler>rachel</wrangler>
<status>50</status>
</item>
<item name="drawing">
<brief>Gdk drawing primitives not fully supported.</brief>
<description>Many Gdk drawing functions are named oddly and are not being generated as methods of Drawable. gapi2xml.pl needs to take this into account.</description>
<status>0</status>
</item>
</todo>

View file

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="todo">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Gtk# TODO</title></head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="item">
<table border="0">
<tr><td colspan="2"><b><xsl:apply-templates select="./brief"/></b></td></tr>
<tr><td><i>Description</i></td><td><xsl:apply-templates select="./description"/></td></tr>
<tr><td><i>Status</i></td><td><xsl:apply-templates select="./status"/>%</td></tr>
<tr><td><i>Notes</i></td><td><xsl:apply-templates select="./notes"/></td></tr>
<tr><td><i>Wrangler</i></td><td><xsl:apply-templates select="./wrangler"/></td></tr>
</table>
<br />
</xsl:template>
<xsl:template match="description|status|notes|wrangler">
<xsl:apply-templates/>
</xsl:template>
<!-- Handles copying unrecognized stuff: stolen from clahey.net -->
<xsl:template match="*">
<xsl:copy><xsl:for-each select="attribute::*"><xsl:copy/></xsl:for-each><xsl:apply-templates/></xsl:copy>
</xsl:template>
</xsl:stylesheet>