* gnome/Gnome.metadata: opaquify ModuleInfo and hide the types

that are only used inside ModuleInfo, so we don't marshal the
	function pointers into (incorrect) delegates.

	* gnome/Modules.cs: 
	* gnome/Program.custom: update for ModuleInfo being a class rather
	than a struct now

svn path=/trunk/gtk-sharp/; revision=47045
This commit is contained in:
Dan Winship 2005-07-07 16:11:24 +00:00
parent 0863f8703f
commit 9236a9045f
10 changed files with 54 additions and 312 deletions

View file

@ -1,3 +1,13 @@
2005-07-07 Dan Winship <danw@novell.com>
* gnome/Gnome.metadata: opaquify ModuleInfo and hide the types
that are only used inside ModuleInfo, so we don't marshal the
function pointers into (incorrect) delegates.
* gnome/Modules.cs:
* gnome/Program.custom: update for ModuleInfo being a class rather
than a struct now
2005-07-02 Mike Kestner <mkestner@novell.com>
* generator/StructField.cs : fix name exception throw conditional.

View file

@ -1,21 +0,0 @@
<Type Name="ModuleClassInitHook" FullName="Gnome.ModuleClassInitHook">
<TypeSignature Language="C#" Maintainer="auto" Value="public delegate void ModuleClassInitHook();" />
<AssemblyInfo>
<AssemblyName>gnome-sharp</AssemblyName>
<AssemblyVersion>2.6.0.0</AssemblyVersion>
</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>Called to perform any class specific setup that is required by each module.</summary>
<remarks>To be added.</remarks>
</Docs>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Members />
<Parameters>
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
</Type>

View file

@ -1,28 +0,0 @@
<Type Name="ModuleHook" FullName="Gnome.ModuleHook">
<TypeSignature Language="C#" Maintainer="auto" Value="public delegate void ModuleHook(Gnome.Program program, Gnome.ModuleInfo mod_info);" />
<AssemblyInfo>
<AssemblyName>gnome-sharp</AssemblyName>
<AssemblyVersion>2.6.0.0</AssemblyVersion>
</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>
Called to perform some initialization in a module
(which could be either the main init function or the pre or post argument parsing phase).
</summary>
<param name="program">The <see cref="T:Gnome.Program" /> instance which is being initialized.</param>
<param name="mod_info">The current module's <see cref="T:Gnome.ModuleInfo" /> structure.</param>
<remarks>To be added.</remarks>
</Docs>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Members />
<Parameters>
<Parameter Name="program" Type="Gnome.Program" />
<Parameter Name="mod_info" Type="Gnome.ModuleInfo" />
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
</Type>

View file

@ -1,5 +1,5 @@
<Type Name="ModuleInfo" FullName="Gnome.ModuleInfo">
<TypeSignature Language="C#" Maintainer="auto" Value="public struct ModuleInfo" />
<TypeSignature Language="C#" Maintainer="auto" Value="public class ModuleInfo : GLib.Opaque" />
<AssemblyInfo>
<AssemblyName>gnome-sharp</AssemblyName>
<AssemblyPublicKey>
@ -12,50 +12,13 @@
<remarks>To be added</remarks>
</Docs>
<Base>
<BaseTypeName>System.ValueType</BaseTypeName>
<BaseTypeName>GLib.Opaque</BaseTypeName>
</Base>
<Interfaces />
<Members>
<Member MemberName="Zero">
<MemberSignature Language="C#" Value="public static Gnome.ModuleInfo Zero;" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleInfo</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="New">
<MemberSignature Language="C#" Value="public static Gnome.ModuleInfo New (IntPtr raw);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleInfo</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="raw" Type="System.IntPtr" />
</Parameters>
<Docs>
<summary>To be added</summary>
<param name="raw">To be added: an object of type 'IntPtr'</param>
<returns>To be added: an object of type 'Gnome.ModuleInfo'</returns>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="requirements">
<MemberSignature Language="C#" Value="public Gnome.ModuleRequirement requirements { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleRequirement</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added</summary>
<value>To be added: an object of type 'Gnome.ModuleRequirement'</value>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="GType">
<MemberSignature Language="C#" Value="public static GLib.GType GType { get; };" />
<MemberType>Property</MemberType>
@ -69,95 +32,34 @@
<remarks>Returns the native <see cref="T:GLib.GType" /> value for <see cref="T:Gnome.ModuleInfo" />.</remarks>
</Docs>
</Member>
<Member MemberName="Name">
<MemberSignature Language="C#" Value="public string Name;" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ModuleInfo (IntPtr raw);" />
<MemberType>Constructor</MemberType>
<Parameters>
<Parameter Name="raw" Type="System.IntPtr" />
</Parameters>
<Docs>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="Version">
<MemberSignature Language="C#" Value="public string Version;" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="Description">
<MemberSignature Language="C#" Value="public string Description;" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="OptPrefix">
<MemberSignature Language="C#" Value="public string OptPrefix;" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static GLib.Value op_Explicit (Gnome.ModuleInfo boxed);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>GLib.Value</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="boxed" Type="Gnome.ModuleInfo" />
</Parameters>
<Docs>
<param name="boxed">To be added.</param>
<param name="raw">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static Gnome.ModuleInfo op_Explicit (GLib.Value val);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleInfo</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="val" Type="GLib.Value" />
</Parameters>
<Docs>
<param name="val">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="InstanceInit">
<MemberSignature Language="C#" Value="public Gnome.ModuleHook InstanceInit { get; };" />
<Member MemberName="Name">
<MemberSignature Language="C#" Value="public string Name { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleHook</ReturnType>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
@ -165,11 +67,11 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="PreArgsParse">
<MemberSignature Language="C#" Value="public Gnome.ModuleHook PreArgsParse { get; };" />
<Member MemberName="Description">
<MemberSignature Language="C#" Value="public string Description { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleHook</ReturnType>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
@ -177,35 +79,11 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="PostArgsParse">
<MemberSignature Language="C#" Value="public Gnome.ModuleHook PostArgsParse { get; };" />
<Member MemberName="Version">
<MemberSignature Language="C#" Value="public string Version { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleHook</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="InitPass">
<MemberSignature Language="C#" Value="public Gnome.ModuleInitHook InitPass { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleInitHook</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ClassInit">
<MemberSignature Language="C#" Value="public Gnome.ModuleClassInitHook ClassInit { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleClassInitHook</ReturnType>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>

View file

@ -1,28 +0,0 @@
<Type Name="ModuleInitHook" FullName="Gnome.ModuleInitHook">
<TypeSignature Language="C#" Maintainer="auto" Value="public delegate void ModuleInitHook(Gnome.ModuleInfo mod_info);" />
<AssemblyInfo>
<AssemblyName>gnome-sharp</AssemblyName>
<AssemblyVersion>2.6.0.0</AssemblyVersion>
</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>
Called to allow a module to do any pre-initialization it might need to do
prior to having arguments parsed by the controlling parent module.
</summary>
<param name="mod_info">The current module's <see cref="T:Gnome.ModuleInfo" /> structure.</param>
<remarks>
<para>The parent module will do the argument parsing for all modules in the hierarchy.</para>
</remarks>
</Docs>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Members />
<Parameters>
<Parameter Name="mod_info" Type="Gnome.ModuleInfo" />
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
</Type>

View file

@ -1,73 +0,0 @@
<Type Name="ModuleRequirement" FullName="Gnome.ModuleRequirement">
<TypeSignature Language="C#" Maintainer="auto" Value="public struct ModuleRequirement" />
<AssemblyInfo>
<AssemblyName>gnome-sharp</AssemblyName>
<AssemblyPublicKey>
</AssemblyPublicKey>
<AssemblyVersion>2.6.0.0</AssemblyVersion>
</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>To be added</summary>
<remarks>To be added</remarks>
</Docs>
<Base>
<BaseTypeName>System.ValueType</BaseTypeName>
</Base>
<Interfaces />
<Members>
<Member MemberName="Zero">
<MemberSignature Language="C#" Value="public static Gnome.ModuleRequirement Zero;" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleRequirement</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="New">
<MemberSignature Language="C#" Value="public static Gnome.ModuleRequirement New (IntPtr raw);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleRequirement</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="raw" Type="System.IntPtr" />
</Parameters>
<Docs>
<summary>To be added</summary>
<param name="raw">To be added: an object of type 'IntPtr'</param>
<returns>To be added: an object of type 'Gnome.ModuleRequirement'</returns>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="module_info">
<MemberSignature Language="C#" Value="public Gnome.ModuleInfo module_info { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gnome.ModuleInfo</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added</summary>
<value>To be added: an object of type 'Gnome.ModuleInfo'</value>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="RequiredVersion">
<MemberSignature Language="C#" Value="public string RequiredVersion;" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
</Members>
</Type>

View file

@ -1408,7 +1408,6 @@
<Type Name="IconUnselectedArgs" />
<Type Name="MDIMode" />
<Type Name="ModuleInfo" />
<Type Name="ModuleRequirement" />
<Type Name="MoveCursorArgs" />
<Type Name="MoveFocusOutOfAppletArgs" />
<Type Name="NextClickedArgs" />
@ -1496,9 +1495,6 @@
<Type Name="IconSelectedHandler" />
<Type Name="IconUnselectedHandler" />
<Type Name="InteractFunction" />
<Type Name="ModuleClassInitHook" />
<Type Name="ModuleHook" />
<Type Name="ModuleInitHook" />
<Type Name="MoveCursorHandler" />
<Type Name="MoveFocusOutOfAppletHandler" />
<Type Name="NextClickedHandler" />

View file

@ -1,5 +1,8 @@
<?xml version="1.0"?>
<metadata>
<attr path="/api/namespace/callback[@cname='GnomeModuleClassInitHook']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@cname='GnomeModuleHook']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@cname='GnomeModuleInitHook']" name="hidden">1</attr>
<attr path="/api/namespace/enum[@cname='GnomePrintButtons']/member[@name='Cancel']" name="value">(int)Gtk.ResponseType.Cancel</attr>
<attr path="/api/namespace/object[@cname='GnomeApp']/constructor[@cname='gnome_app_new']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GnomeApp']/field[@name='AccelGroup']" name="access">public</attr>
@ -16,6 +19,10 @@
<attr path="/api/namespace/object[@cname='GnomeDateEdit']/method[@name='GetFlags']" name="new_flag">1</attr>
<attr path="/api/namespace/boxed[@cname='GnomeCanvasPoints']" name="opaque">1</attr>
<attr path="/api/namespace/boxed[@cname='GnomeGlyphList']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="/api/namespace/boxed[@cname='GnomeModuleInfo']" name="opaque">1</attr>
<attr path="/api/namespace/boxed[@cname='GnomeModuleInfo']/field[@name='Name']" name="access">public</attr>
<attr path="/api/namespace/boxed[@cname='GnomeModuleInfo']/field[@name='Version']" name="access">public</attr>
<attr path="/api/namespace/boxed[@cname='GnomeModuleInfo']/field[@name='Description']" name="access">public</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/callback[@cname='GnomeTriggerActionFunction']/*/*[@name='supinfo']" name="type">const-char*</attr>
@ -139,6 +146,7 @@
<attr path="/api/namespace/object[@cname='GnomePrintPdf']" name="parent">GObject</attr>
<attr path="/api/namespace/object[@cname='GnomePrintTransport']" name="parent">GObject</attr>
<attr path="/api/namespace/object[@cname='GnomePropertyBox']/method[@name='SetState']" name="new_flag">1</attr>
<attr path="/api/namespace/object[@cname='GnomeScores']/constructor[@cname='gnome_scores_new']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GPAOptionMenu']/constructor/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="/api/namespace/object[@cname='PanelAppletShell']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='PanelApplet']/method[@cname='panel_applet_factory_main']" name="hidden">1</attr>
@ -153,7 +161,7 @@
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='Split']/return-type" name="element_type">GnomeCanvasPathDef*</attr>
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='Split']/return-type" name="owned">true</attr>
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='Split']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/struct[@cname='GPFontEntry']/field[@cname='weight']" name="access">private</attr>
<attr path="/api/namespace/struct[@cname='GnomeModuleRequirement']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='GnomePrintPaper']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="/api/namespace/object[@cname='GnomeScores']/constructor[@cname='gnome_scores_new']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='GPFontEntry']/field[@cname='weight']" name="access">private</attr>
</metadata>

View file

@ -29,13 +29,13 @@ namespace Gnome
public static ModuleInfo LibGnome {
get {
return ModuleInfo.New (libgnome_module_info_get ());
return new ModuleInfo (libgnome_module_info_get ());
}
}
public static ModuleInfo UI {
get {
return ModuleInfo.New (libgnomeui_module_info_get ());
return new ModuleInfo (libgnomeui_module_info_get ());
}
}
}

View file

@ -34,7 +34,7 @@ struct PropertyArg {
[DllImport("gnomesharpglue-2")]
static extern System.IntPtr
gtksharp_gnome_program_init (string app_id, string app_version, ref ModuleInfo module, int argc, string[] argv, int nargs, PropertyArg[] args);
gtksharp_gnome_program_init (string app_id, string app_version, IntPtr module, int argc, string[] argv, int nargs, PropertyArg[] args);
public Program (string app_id, string app_version, ModuleInfo module, string[] argv, params object[] props) : base (IntPtr.Zero)
{
@ -68,7 +68,7 @@ public Program (string app_id, string app_version, ModuleInfo module, string[] a
/* FIXME: Is there a way to access this in .NET? */
new_argv[0] = app_id;
Array.Copy (argv, 0, new_argv, 1, argv.Length);
Raw = gtksharp_gnome_program_init (app_id, app_version, ref module, new_argv.Length, new_argv, nargs, args);
Raw = gtksharp_gnome_program_init (app_id, app_version, module.Handle, new_argv.Length, new_argv, nargs, args);
//
// Dynamically reset the signal handlers, because Gnome overwrites them