Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

GAPI: Additonal types support + class const fields support #25

Merged
merged 3 commits into from
Sep 26, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions generator/SymbolTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,16 @@ public SymbolTable ()
AddType (new SimpleGen ("ulong", "uint", "0"));
AddType (new SimpleGen ("gulong", "uint", "0"));
AddType (new SimpleGen ("unsigned long", "uint", "0"));
AddType (new SimpleGen ("gintptr", "int", "0"));
AddType (new SimpleGen ("guintptr", "uint", "0"));
#else
AddType (new LPGen ("long"));
AddType (new LPGen ("glong"));
AddType (new LPGen ("gintptr"));
AddType (new LPUGen ("ulong"));
AddType (new LPUGen ("gulong"));
AddType (new LPUGen ("unsigned long"));
AddType (new LPUGen ("guintptr"));
#endif

AddType (new LPGen ("ssize_t"));
Expand Down Expand Up @@ -121,6 +125,7 @@ public SymbolTable ()
AddType (new ManualGen ("GSList", "GLib.SList"));
AddType (new ManualGen ("GVariant", "GLib.Variant"));
AddType (new ManualGen ("GVariantType", "GLib.VariantType"));
AddType (new ManualGen ("GValueArray", "GLib.ValueArray"));
AddType (new MarshalGen ("gunichar", "char", "uint", "GLib.Marshaller.CharToGUnichar ({0})", "GLib.Marshaller.GUnicharToChar ({0})"));
AddType (new MarshalGen ("time_t", "System.DateTime", "IntPtr", "GLib.Marshaller.DateTimeTotime_t ({0})", "GLib.Marshaller.time_tToDateTime ({0})"));
AddType (new MarshalGen ("GString", "string", "IntPtr", "new GLib.GString ({0}).Handle", "GLib.GString.PtrToString ({0})"));
Expand Down
7 changes: 5 additions & 2 deletions parser/gapi2xml.pl
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,11 @@ sub addClassElem
$vm_elem->setAttribute('padding', 'true');
}
}
} elsif ($field =~ /(unsigned\s+)?(\S+)\s+(.+)/) {
my $type = $1 . $2; $symb = $3;
} elsif ($field =~ /(unsigned\s+)?(const\s+)?(\S+)\s+(.+)/) {
my $unsigned = $1; $const = $2; $name = $3; $symb = $4;
$const =~ s/const\s+/const\-/g;
my $type = $unsigned . $const . $name;

foreach $tok (split (/,\s*/, $symb)) { # multiple field defs may occur in one line; like int xrange, yrange;
$tok =~ /(\*)?(\w+)\s*(.*)/;
my $field_type = $type . $1; my $cname = $2; my $modifiers = $3;
Expand Down