* gnome/Gnome.metadata: mark GnomeTriggerActionFunction's char**

param const

        * glib/Marshaller.cs (Utf8PtrToString): Add an IntPtr[]->string[]
        overload, since that's what we actually need in the case where
        it's used (above). Leave the IntPtr[]->string[] overload of
        PtrToStringGFree in case anyone is using it manually.

        * gtk/Gtk.metadata: hide GtkModuleInitFunc and
        GtkModuleDisplayInitFunc; they are the signatures of user-defined
        methods that gtk only ever resolves via g_module_symbol(), so
        they're not useful from C#. (And the marshalling was all wrong
        anyway...)

svn path=/trunk/gtk-sharp/; revision=43461
This commit is contained in:
Dan Winship 2005-04-22 19:43:46 +00:00
parent 7ebae92199
commit faa783fba7
8 changed files with 48 additions and 71 deletions

View file

@ -1,5 +1,19 @@
2005-04-22 Dan Winship <danw@novell.com> 2005-04-22 Dan Winship <danw@novell.com>
* gnome/Gnome.metadata: mark GnomeTriggerActionFunction's char**
param const
* glib/Marshaller.cs (Utf8PtrToString): Add an IntPtr[]->string[]
overload, since that's what we actually need in the case where
it's used (above). Leave the IntPtr[]->string[] overload of
PtrToStringGFree in case anyone is using it manually.
* gtk/Gtk.metadata: hide GtkModuleInitFunc and
GtkModuleDisplayInitFunc; they are the signatures of user-defined
methods that gtk only ever resolves via g_module_symbol(), so
they're not useful from C#. (And the marshalling was all wrong
anyway...)
* glib/Type.cs: * glib/Type.cs:
* glib/TypeConverter.cs: * glib/TypeConverter.cs:
* glib/Value.cs: sort lists of GTypes into TypeFundamental order * glib/Value.cs: sort lists of GTypes into TypeFundamental order

View file

@ -1,3 +1,10 @@
2005-04-21 Dan Winship <danw@novell.com>
* en/GLib/Marshaller.xml: update
* en/Gtk/ModuleDisplayInitFunc.xml:
* en/Gtk/ModuleInitFunc.xml: gone
2005-04-22 John Luke <john.luke@gmail.com> 2005-04-22 John Luke <john.luke@gmail.com>
* en/*/*.xml: run gen*.exe to fill in some docs * en/*/*.xml: run gen*.exe to fill in some docs

View file

@ -201,6 +201,22 @@
<remarks /> <remarks />
</Docs> </Docs>
</Member> </Member>
<Member MemberName="Utf8PtrToString">
<MemberSignature Language="C#" Value="public static string [] Utf8PtrToString (IntPtr [] ptrs);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ptrs" Type="System.IntPtr[]" />
</Parameters>
<Docs>
<summary>Marshals an array of native Utf8 strings to an array of managed strings.</summary>
<param name="ptrs">a <see cref="T:System.IntPtr" /></param>
<returns>a <see cref="T:System.String[]" /></returns>
<remarks />
</Docs>
</Member>
<Member MemberName="PtrToStructureAlloc"> <Member MemberName="PtrToStructureAlloc">
<MemberSignature Language="C#" Value="public static IntPtr PtrToStructureAlloc (object o);" /> <MemberSignature Language="C#" Value="public static IntPtr PtrToStructureAlloc (object o);" />
<MemberType>Method</MemberType> <MemberType>Method</MemberType>

View file

@ -1,34 +0,0 @@
<Type Name="ModuleDisplayInitFunc" FullName="Gtk.ModuleDisplayInitFunc">
<TypeSignature Language="C#" Value="public sealed delegate void ModuleDisplayInitFunc (Gdk.Display display);" Maintainer="auto" />
<AssemblyInfo>
<AssemblyName>gtk-sharp</AssemblyName>
<AssemblyPublicKey />
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyCulture>neutral</AssemblyCulture>
<Attributes />
</AssemblyInfo>
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
<Docs>
<summary>Do not use.</summary>
<remarks />
</Docs>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.ICloneable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
</Interface>
</Interfaces>
<Attributes />
<Members />
<Parameters>
<Parameter Name="display" Type="Gdk.Display" />
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
</Type>

View file

@ -1,33 +0,0 @@
<Type Name="ModuleInitFunc" FullName="Gtk.ModuleInitFunc">
<TypeSignature Language="C#" Maintainer="auto" Value="public sealed delegate void ModuleInitFunc (out int argc, string [] argv);" />
<AssemblyInfo>
<AssemblyName>gtk-sharp</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<Attributes />
</AssemblyInfo>
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
<Docs>
<summary>Do not use.</summary>
<remarks />
</Docs>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.ICloneable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
</Interface>
</Interfaces>
<Attributes />
<Members />
<Parameters>
<Parameter Name="argc" Type="System.Int32" />
<Parameter Name="argv" Type="System.String" />
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
</Type>

View file

@ -51,6 +51,14 @@ namespace GLib {
return System.Text.Encoding.UTF8.GetString (bytes); return System.Text.Encoding.UTF8.GetString (bytes);
} }
public static string[] Utf8PtrToString (IntPtr[] ptrs) {
// The last pointer is a null terminator.
string[] ret = new string[ptrs.Length - 1];
for (int i = 0; i < ret.Length; i++)
ret[i] = Utf8PtrToString (ptrs[i]);
return ret;
}
public static string PtrToStringGFree (IntPtr ptr) public static string PtrToStringGFree (IntPtr ptr)
{ {
string ret = Utf8PtrToString (ptr); string ret = Utf8PtrToString (ptr);
@ -58,9 +66,6 @@ namespace GLib {
return ret; return ret;
} }
[DllImport("libglib-2.0-0.dll")]
static extern void g_strfreev (IntPtr mem);
public static string[] PtrToStringGFree (IntPtr[] ptrs) { public static string[] PtrToStringGFree (IntPtr[] ptrs) {
// The last pointer is a null terminator. // The last pointer is a null terminator.
string[] ret = new string[ptrs.Length - 1]; string[] ret = new string[ptrs.Length - 1];

View file

@ -9,6 +9,7 @@
<attr path="/api/namespace/boxed[@cname='GnomeGlyphList']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr> <attr path="/api/namespace/boxed[@cname='GnomeGlyphList']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="/api/namespace/boxed[@cname='GnomePrintUnit']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr> <attr path="/api/namespace/boxed[@cname='GnomePrintUnit']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="/api/namespace/boxed[@cname='GnomePrintUnit']/method[@name='GetIdentity']/*/*[@name='base']" name="name">Base</attr> <attr path="/api/namespace/boxed[@cname='GnomePrintUnit']/method[@name='GetIdentity']/*/*[@name='base']" name="name">Base</attr>
<attr path="/api/namespace/callback[@cname='GnomeTriggerActionFunction']/*/*[@name='supinfo']" name="type">const-char*</attr>
<attr path="/api/namespace[@library='gnomeprintui-2-2']/class[@cname='GnomePrint_']" name="name">PrintWidget</attr> <attr path="/api/namespace[@library='gnomeprintui-2-2']/class[@cname='GnomePrint_']" name="name">PrintWidget</attr>
<attr path="/api/namespace[@library='gnomeprintui-2-2']/class[@cname='GnomePrint_']" name="cname">GnomePrintWidget_</attr> <attr path="/api/namespace[@library='gnomeprintui-2-2']/class[@cname='GnomePrint_']" name="cname">GnomePrintWidget_</attr>
<attr path="/api/namespace/class[@cname='GnomeConfig_']/method[@name='SetSetHandler']" name="hidden">1</attr> <attr path="/api/namespace/class[@cname='GnomeConfig_']/method[@name='SetSetHandler']" name="hidden">1</attr>

View file

@ -27,7 +27,8 @@
<attr path="/api/namespace/boxed[@cname='GtkTreePath']/constructor[@cname='gtk_tree_path_new_from_indices']" name="hidden">1</attr> <attr path="/api/namespace/boxed[@cname='GtkTreePath']/constructor[@cname='gtk_tree_path_new_from_indices']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@cname='GtkTreePath']/method[@name='GetIndices']" name="hidden">1</attr> <attr path="/api/namespace/boxed[@cname='GtkTreePath']/method[@name='GetIndices']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@cname='GtkItemFactoryCallback2']" name="hidden">1</attr> <attr path="/api/namespace/callback[@cname='GtkItemFactoryCallback2']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@cname='GtkModuleInitFunc']/*/*[@name='argv']" name="array">1</attr> <attr path="/api/namespace/callback[@cname='GtkModuleDisplayInitFunc']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@cname='GtkModuleInitFunc']" name="hidden">1</attr>
<attr path="/api/namespace/class[@cname='GtkAccel_']/method[@name='GroupsFromObject']" name="hidden">1</attr> <attr path="/api/namespace/class[@cname='GtkAccel_']/method[@name='GroupsFromObject']" name="hidden">1</attr>
<attr path="/api/namespace/class[@cname='GtkAccelerator_']/method[@name='GetDefaultModMask']/return-type" name="type">GdkModifierType</attr> <attr path="/api/namespace/class[@cname='GtkAccelerator_']/method[@name='GetDefaultModMask']/return-type" name="type">GdkModifierType</attr>
<attr path="/api/namespace/class[@cname='GtkBindings_']/method[@name='Activate']" name="name">BindingsActivate</attr> <attr path="/api/namespace/class[@cname='GtkBindings_']/method[@name='Activate']" name="name">BindingsActivate</attr>