Merge pull request #25 from Forage/master
GAPI: Additonal types support + class const fields support
This commit is contained in:
commit
61a213c7b8
2 changed files with 10 additions and 2 deletions
|
@ -84,12 +84,16 @@ namespace GtkSharp.Generation {
|
||||||
AddType (new SimpleGen ("ulong", "uint", "0"));
|
AddType (new SimpleGen ("ulong", "uint", "0"));
|
||||||
AddType (new SimpleGen ("gulong", "uint", "0"));
|
AddType (new SimpleGen ("gulong", "uint", "0"));
|
||||||
AddType (new SimpleGen ("unsigned long", "uint", "0"));
|
AddType (new SimpleGen ("unsigned long", "uint", "0"));
|
||||||
|
AddType (new SimpleGen ("gintptr", "int", "0"));
|
||||||
|
AddType (new SimpleGen ("guintptr", "uint", "0"));
|
||||||
#else
|
#else
|
||||||
AddType (new LPGen ("long"));
|
AddType (new LPGen ("long"));
|
||||||
AddType (new LPGen ("glong"));
|
AddType (new LPGen ("glong"));
|
||||||
|
AddType (new LPGen ("gintptr"));
|
||||||
AddType (new LPUGen ("ulong"));
|
AddType (new LPUGen ("ulong"));
|
||||||
AddType (new LPUGen ("gulong"));
|
AddType (new LPUGen ("gulong"));
|
||||||
AddType (new LPUGen ("unsigned long"));
|
AddType (new LPUGen ("unsigned long"));
|
||||||
|
AddType (new LPUGen ("guintptr"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AddType (new LPGen ("ssize_t"));
|
AddType (new LPGen ("ssize_t"));
|
||||||
|
@ -121,6 +125,7 @@ namespace GtkSharp.Generation {
|
||||||
AddType (new ManualGen ("GSList", "GLib.SList"));
|
AddType (new ManualGen ("GSList", "GLib.SList"));
|
||||||
AddType (new ManualGen ("GVariant", "GLib.Variant"));
|
AddType (new ManualGen ("GVariant", "GLib.Variant"));
|
||||||
AddType (new ManualGen ("GVariantType", "GLib.VariantType"));
|
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 ("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 ("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})"));
|
AddType (new MarshalGen ("GString", "string", "IntPtr", "new GLib.GString ({0}).Handle", "GLib.GString.PtrToString ({0})"));
|
||||||
|
|
|
@ -574,8 +574,11 @@ sub addClassElem
|
||||||
$vm_elem->setAttribute('padding', 'true');
|
$vm_elem->setAttribute('padding', 'true');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elsif ($field =~ /(unsigned\s+)?(\S+)\s+(.+)/) {
|
} elsif ($field =~ /(unsigned\s+)?(const\s+)?(\S+)\s+(.+)/) {
|
||||||
my $type = $1 . $2; $symb = $3;
|
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;
|
foreach $tok (split (/,\s*/, $symb)) { # multiple field defs may occur in one line; like int xrange, yrange;
|
||||||
$tok =~ /(\*)?(\w+)\s*(.*)/;
|
$tok =~ /(\*)?(\w+)\s*(.*)/;
|
||||||
my $field_type = $type . $1; my $cname = $2; my $modifiers = $3;
|
my $field_type = $type . $1; my $cname = $2; my $modifiers = $3;
|
||||||
|
|
Loading…
Reference in a new issue