2002-09-07 Rachel Hestilow <hestilow@ximian.com>

* parser/gapi2xml.pl: Add support for "fake struct" opaque types.
	* generator/StructBase.cs: Generate wrapper fields for opaque
	fields as well as pointer fields.
	* api/gdk-symbols.xml: Remove GdkAtom as it is now wrapped.

svn path=/trunk/gtk-sharp/; revision=7311
This commit is contained in:
Rachel Hestilow 2002-09-08 01:29:07 +00:00
parent e233ca8d49
commit 1f68bc999b
5 changed files with 29 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2002-09-07 Rachel Hestilow <hestilow@ximian.com>
* parser/gapi2xml.pl: Add support for "fake struct" opaque types.
* generator/StructBase.cs: Generate wrapper fields for opaque
fields as well as pointer fields.
* api/gdk-symbols.xml: Remove GdkAtom as it is now wrapped.
2002-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* sample/DbClient/client.cs: updated to make it compile.

View file

@ -2343,6 +2343,18 @@
<field cname="override_redirect" type="gboolean"/>
</struct>
<alias name="XEvent" cname="GdkXEvent" type="void "/>
<struct name="Atom" cname="GdkAtom" opaque="true">
<method name="Intern" cname="gdk_atom_intern" shared="true">
<return-type type="GdkAtom"/>
<parameters>
<parameter type="const-gchar*" name="atom_name"/>
<parameter type="gboolean" name="only_if_exists"/>
</parameters>
</method>
<method name="Name" cname="gdk_atom_name">
<return-type type="gchar*"/>
</method>
</struct>
</namespace>
<namespace name="Gdk" library="gdk_pixbuf-2.0">
<enum name="Colorspace" cname="GdkColorspace" type="enum">

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<api>
<symbol type="simple" cname="GdkAtom" name="IntPtr"/>
<symbol type="manual" cname="GdkEvent" name="Gdk.Event"/>
</api>

View file

@ -115,7 +115,7 @@ namespace GtkSharp.Generation {
type = SymbolTable.GetCSType (c_type);
if (IsBit (field)) {
type = "uint";
} else if (IsPointer (field) && type != "string") {
} else if ((IsPointer (field) || SymbolTable.IsOpaque (c_type)) && type != "string") {
type = "IntPtr";
name = "_";
} else if (SymbolTable.IsCallback (c_type)) {

View file

@ -348,6 +348,15 @@ foreach $key (sort (keys (%types))) {
}
}
# really, _really_ opaque structs that aren't even defined in sources. Lovely.
foreach $key (sort (keys (%ptrs))) {
next if $ptrs{$key} !~ /struct\s+(\w+)/;
$type = $1;
$struct_el = addNameElem ($ns_elem, 'struct', $key, $ns);
$struct_el->setAttribute('opaque', 'true');
$elem_table{lc($key)} = $struct_el;
}
addFuncElems();
# This should probably be done in a more generic way