* parser/gapi2xml.pl (addParamsElem): change the handling of

anonymous function pointer types in method signatures. Before, we
	added a <callback> child to the <parameters> node, but the
	generator just ignored it. Now we add the callback (with a made-up
	name) to the toplevel node, and add an ordinary <param> node
	referencing it to the <parameters> node. Also, if the last param
	of the callback is a gpointer, rename it from "arg#" to "data" so
	it will be treated correctly (as the user data passed from the
	calling method). [Fixes #66241]

	* art/art-api.raw: 
	* gdk/gdk-api-2.4.raw: 
	* gdk/gdk-api-2.6.raw: Regen

	* generator/Parameters.cs (IsHidden): loosen the definition of
	hideable user_data; it doesn't have to occur at the end of the
	parameter list, as long as there's a callback arg before it.

	* generator/MethodBody.cs (GetCallString): Use Parameters.IsHidden
	to decide whether or not to squash user_data params, rather than
	trying to duplicate its logic. As a side effect, this also causes
	a handful of methods that take non-hidden IntPtr arguments to
	start actually passing those arguments to C rather than always
	passing IntPtr.Zero.

	* generator/Method.cs (Equals, GetHashCode): Remove unnecessary
	and possibly erroneous hashing overrides.

	* gtk/Gtk.metadata: Hide Gtk.Container.ForeachFull, since it's
	useless and wasn't in gtk# 1.0

	* gtk/Menu.custom (Popup):
	* gtk/TextIter.custom (ForwardFindChar, BackwardFindChar):
	* gnome/App.custom (CreateMenusInterp, InsertMenusInterp,
	CreateToolbarInterp):
	* gnome/Client.custom (RequestInteractionInterp):
	* gnome/Popup.custom (MenuDoPopupModal, MenuDoPopup): Add
	[Obsolete] compat overloads for methods that have now lost a
	useless IntPtr.

svn path=/trunk/gtk-sharp/; revision=47566
This commit is contained in:
Dan Winship 2005-07-22 19:10:04 +00:00
parent 105622f7a0
commit 6bf7376094
26 changed files with 459 additions and 131 deletions

View file

@ -49,6 +49,48 @@
* doc/en/Gtk/TreeSelection.xml: Add documentation for the new
overload.
2005-07-19 Dan Winship <danw@novell.com>
* parser/gapi2xml.pl (addParamsElem): change the handling of
anonymous function pointer types in method signatures. Before, we
added a <callback> child to the <parameters> node, but the
generator just ignored it. Now we add the callback (with a made-up
name) to the toplevel node, and add an ordinary <param> node
referencing it to the <parameters> node. Also, if the last param
of the callback is a gpointer, rename it from "arg#" to "data" so
it will be treated correctly (as the user data passed from the
calling method). [Fixes #66241]
* art/art-api.raw:
* gdk/gdk-api-2.4.raw:
* gdk/gdk-api-2.6.raw: Regen
* generator/Parameters.cs (IsHidden): loosen the definition of
hideable user_data; it doesn't have to occur at the end of the
parameter list, as long as there's a callback arg before it.
* generator/MethodBody.cs (GetCallString): Use Parameters.IsHidden
to decide whether or not to squash user_data params, rather than
trying to duplicate its logic. As a side effect, this also causes
a handful of methods that take non-hidden IntPtr arguments to
start actually passing those arguments to C rather than always
passing IntPtr.Zero.
* generator/Method.cs (Equals, GetHashCode): Remove unnecessary
and possibly erroneous hashing overrides.
* gtk/Gtk.metadata: Hide Gtk.Container.ForeachFull, since it's
useless and wasn't in gtk# 1.0
* gtk/Menu.custom (Popup):
* gtk/TextIter.custom (ForwardFindChar, BackwardFindChar):
* gnome/App.custom (CreateMenusInterp, InsertMenusInterp,
CreateToolbarInterp):
* gnome/Client.custom (RequestInteractionInterp):
* gnome/Popup.custom (MenuDoPopupModal, MenuDoPopup): Add
[Obsolete] compat overloads for methods that have now lost a
useless IntPtr.
2005-07-19 Dan Winship <danw@novell.com>
* generator/Parameters.cs: Remove the AllowComplexRefs flag.

View file

@ -507,16 +507,7 @@
<parameter type="int" name="y0" />
<parameter type="int" name="x1" />
<parameter type="int" name="y1" />
<callback cname="callback">
<return-type type="void" />
<parameters>
<parameter type="void*" name="callback_data" />
<parameter type="int" name="y" />
<parameter type="int" name="start" />
<parameter type="ArtSVPRenderAAStep*" name="steps" />
<parameter type="int" name="n_steps" />
</parameters>
</callback>
<parameter type="RenderAaCallback" name="callback" />
<parameter type="void*" name="callback_data" />
</parameters>
</method>
@ -752,6 +743,16 @@
<alias name="ArtU16" cname="art_u16" type="unsigned short" />
<alias name="ArtU32" cname="art_u32" type="unsigned int" />
<alias name="ArtU8" cname="art_u8" type="unsigned char" />
<callback name="RenderAaCallback" cname="RenderAaCallback">
<return-type type="void" />
<parameters>
<parameter type="void*" name="callback_data" />
<parameter type="int" name="y" />
<parameter type="int" name="start" />
<parameter type="ArtSVPRenderAAStep*" name="steps" />
<parameter type="int" name="n_steps" />
</parameters>
</callback>
<class name="Affine" cname="ArtAffine_">
<method name="Equal" cname="art_affine_equal" shared="true">
<return-type type="int" />

View file

@ -0,0 +1,29 @@
<Type Name="RenderAaCallback" FullName="Art.RenderAaCallback">
<TypeSignature Language="C#" Value="public delegate void RenderAaCallback(IntPtr callback_data, int y, int start, Art.SVPRenderAAStep steps, int n_steps);" />
<AssemblyInfo>
<AssemblyName>art-sharp</AssemblyName>
<AssemblyVersion>2.6.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Parameters>
<Parameter Name="callback_data" Type="System.IntPtr" />
<Parameter Name="y" Type="System.Int32" />
<Parameter Name="start" Type="System.Int32" />
<Parameter Name="steps" Type="Art.SVPRenderAAStep" />
<Parameter Name="n_steps" Type="System.Int32" />
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Docs>
<param name="callback_data">To be added.</param>
<param name="y">To be added.</param>
<param name="start">To be added.</param>
<param name="steps">To be added.</param>
<param name="n_steps">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Type>

View file

@ -292,7 +292,7 @@
</Docs>
</Member>
<Member MemberName="RenderAa">
<MemberSignature Language="C#" Value="public void RenderAa (int x0, int y0, int x1, int y1, IntPtr callback_data);" />
<MemberSignature Language="C#" Value="public void RenderAa (int x0, int y0, int x1, int y1, Art.RenderAaCallback cb);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
@ -302,7 +302,7 @@
<Parameter Name="y0" Type="System.Int32" />
<Parameter Name="x1" Type="System.Int32" />
<Parameter Name="y1" Type="System.Int32" />
<Parameter Name="callback_data" Type="System.IntPtr" />
<Parameter Name="cb" Type="Art.RenderAaCallback" />
</Parameters>
<Docs>
<summary>To be added</summary>
@ -310,7 +310,7 @@
<param name="y0">a <see cref="T:System.Int32" /></param>
<param name="x1">a <see cref="T:System.Int32" /></param>
<param name="y1">a <see cref="T:System.Int32" /></param>
<param name="callback_data">a <see cref="T:System.IntPtr" /></param>
<param name="cb">a <see cref="T:Art.RenderAaCallback" /></param>
<remarks>To be added</remarks>
</Docs>
</Member>

View file

@ -0,0 +1,22 @@
<Type Name="InvalidateMaybeRecurseChildFunc" FullName="Gdk.InvalidateMaybeRecurseChildFunc">
<TypeSignature Language="C#" Value="public delegate bool InvalidateMaybeRecurseChildFunc(Gdk.Window arg1);" />
<AssemblyInfo>
<AssemblyName>gdk-sharp</AssemblyName>
<AssemblyVersion>2.6.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Parameters>
<Parameter Name="arg1" Type="Gdk.Window" />
</Parameters>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<param name="arg1">The window to consider.</param>
<summary>Callback function for <see cref="M:Gdk.Window.InvalidateMaybeRecurse" />.</summary>
<returns>Whether or not the part of <paramref name="arg1" /> intersecting the region-to-be-invalidated should be invalidated.</returns>
<remarks />
</Docs>
</Type>

View file

@ -350,43 +350,44 @@
</Docs>
</Member>
<Member MemberName="InvalidateMaybeRecurse">
<MemberSignature Language="C#" Value="public void InvalidateMaybeRecurse (Gdk.Region region, IntPtr user_data);" />
<MemberSignature Language="C#" Value="public void InvalidateMaybeRecurse (Gdk.Region region, Gdk.InvalidateMaybeRecurseChildFunc child_func);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="region" Type="Gdk.Region" />
<Parameter Name="user_data" Type="System.IntPtr" />
<Parameter Name="child_func" Type="Gdk.InvalidateMaybeRecurseChildFunc" />
</Parameters>
<Docs>
<summary>Adds <paramref name="region" /> to the update area for the
window. The update area is the region that needs to be
redrawn, or "dirty region."
</summary>
<param name="region">A <see cref="T:Gdk.Region" /></param>
<param name="user_data">A <see cref="T:IntPtr" /></param>
<param name="child_func">Function to use to decide if to recurse to a child. <see langword="null" /> means never recurse.</param>
<summary>Adds a region to the update area for a window and some of its children</summary>
<remarks>
<p>function to use to decide if to recurse to a child,
%NULL means never recurse.
</p>
<p>The call<see cref="M:Gdk.Window.ProcessUpdates" />
sends one or more expose events to the
window, which together cover the entire update area. An
application would normally redraw the contents of the whole window
in response to those expose events.</p>
<p>GDK will call <see cref="M:Gdk.Window.ProcessAllUpdates" /> on
your behalf whenever your program returns to the main loop
and becomes idle, so normally there's no need to do that
manually, you just need to invalidate regions that you know
should be redrawn.</p>
<p>(TODO: See bugzilla.ximian.com bug # 66241, to which the following
text pertains.)
<i>The <paramref name="child_func" /> parameter controls whether the region of
each child window that intersects <paramref name="region" /> will also be invalidated.
Only children for which <paramref name="child_func" /> returns TRUE will have the area
invalidated.</i></p>
</remarks>
<p>
Adds <paramref name="region" /> to the update area for
the window. The update area is the region that needs
to be redrawn, or "dirty region." The call <see cref="M:Gdk.Window.ProcessUpdates" /> sends one or
more expose events to the window, which together cover
the entire update area. An application would normally
redraw the contents of the whole window in response to
those expose events.
</p>
<p>
GDK will call <see cref="M:Gdk.Window.ProcessAllUpdates" /> on your
behalf whenever your program returns to the main loop
and becomes idle, so normally there's no need to do
that manually, you just need to invalidate regions
that you know should be redrawn.
</p>
<p>
The <paramref name="child_func" /> parameter controls
whether the region of each child window that
intersects <paramref name="region" /> will also be
invalidated. Only children for which <paramref name="child_func" /> returns <see langword="true" />
will have the area invalidated.
</p>
</remarks>
</Docs>
</Member>
<Member MemberName="BeginMoveDrag">

View file

@ -754,5 +754,64 @@
<since version="Gtk# 2.4" />
</Docs>
</Member>
<Member MemberName="CreateMenusInterp">
<MemberSignature Language="C#" Value="public void CreateMenusInterp (Gnome.UIInfo uiinfo, Gtk.CallbackMarshal relay_func, Gtk.DestroyNotify destroy_func);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="uiinfo" Type="Gnome.UIInfo" />
<Parameter Name="relay_func" Type="Gtk.CallbackMarshal" />
<Parameter Name="destroy_func" Type="Gtk.DestroyNotify" />
</Parameters>
<Docs>
<param name="uiinfo">To be added.</param>
<param name="relay_func">To be added.</param>
<param name="destroy_func">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="InsertMenusInterp">
<MemberSignature Language="C#" Value="public void InsertMenusInterp (string path, Gnome.UIInfo menuinfo, Gtk.CallbackMarshal relay_func, Gtk.DestroyNotify destroy_func);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="path" Type="System.String" />
<Parameter Name="menuinfo" Type="Gnome.UIInfo" />
<Parameter Name="relay_func" Type="Gtk.CallbackMarshal" />
<Parameter Name="destroy_func" Type="Gtk.DestroyNotify" />
</Parameters>
<Docs>
<param name="path">To be added.</param>
<param name="menuinfo">To be added.</param>
<param name="relay_func">To be added.</param>
<param name="destroy_func">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateToolbarInterp">
<MemberSignature Language="C#" Value="public void CreateToolbarInterp (Gnome.UIInfo uiinfo, Gtk.CallbackMarshal relay_func, Gtk.DestroyNotify destroy_func);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="uiinfo" Type="Gnome.UIInfo" />
<Parameter Name="relay_func" Type="Gtk.CallbackMarshal" />
<Parameter Name="destroy_func" Type="Gtk.DestroyNotify" />
</Parameters>
<Docs>
<param name="uiinfo">To be added.</param>
<param name="relay_func">To be added.</param>
<param name="destroy_func">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>

View file

@ -688,5 +688,24 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="RequestInteractionInterp">
<MemberSignature Language="C#" Value="public void RequestInteractionInterp (Gnome.DialogType dialog_type, Gtk.CallbackMarshal function, Gtk.DestroyNotify destroy);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dialog_type" Type="Gnome.DialogType" />
<Parameter Name="function" Type="Gtk.CallbackMarshal" />
<Parameter Name="destroy" Type="Gtk.DestroyNotify" />
</Parameters>
<Docs>
<param name="dialog_type">To be added.</param>
<param name="function">To be added.</param>
<param name="destroy">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>

View file

@ -88,7 +88,7 @@ class PopupSample
</Docs>
</Member>
<Member MemberName="MenuDoPopup">
<MemberSignature Language="C#" Value="public static void MenuDoPopup (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, IntPtr pos_data, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
<MemberSignature Language="C#" Value="public static void MenuDoPopup (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
@ -96,26 +96,49 @@ class PopupSample
<Parameters>
<Parameter Name="popup" Type="Gtk.Widget" />
<Parameter Name="pos_func" Type="Gtk.MenuPositionFunc" />
<Parameter Name="pos_data" Type="System.IntPtr" />
<Parameter Name="evnt" Type="Gdk.EventButton" />
<Parameter Name="user_data" Type="System.IntPtr" />
<Parameter Name="for_widget" Type="Gtk.Widget" />
</Parameters>
<Docs>
<summary>You can use this function to pop up a menu.</summary>
<param name="popup">a <see cref="T:Gtk.Widget" /></param>
<param name="pos_func">a <see cref="T:Gtk.MenuPositionFunc" /></param>
<param name="pos_data">a <see cref="T:System.IntPtr" /></param>
<param name="evnt">a <see cref="T:Gdk.EventButton" /></param>
<param name="user_data">a <see cref="T:System.IntPtr" /></param>
<param name="for_widget">a <see cref="T:Gtk.Widget" /></param>
<summary>You can use this function to pop up a menu.</summary>
<remarks>
<para>When a menu item callback is invoked, the specified user_data will be passed to it.</para>
<para>The <paramref name="pos_func" /> and <paramref name="pos_data" /> parameters are the same as for <see cref="M:Gtk.Menu.Popup(Gtk.Widget,Gtk.MenuPositionFunc,System.IntPtr,Gdk.EventButton,System.IntPtr,Gtk.Widget)" />, i.e. you can use them to specify a function to position the menu explicitly. If you want the default position (near the mouse), pass <see langword="null" /> for these parameters.</para>
<para>The <paramref name="pos_func" /> parameter is the same as for <see cref="M:Gtk.Menu.Popup(Gtk.Widget,Gtk.MenuPositionFunc,System.IntPtr,Gdk.EventButton,System.IntPtr,Gtk.Widget)" />, i.e. you can use it to specify a function to position the menu explicitly. If you want the default position (near the mouse), pass <see langword="null" />.</para>
<para>The event parameter is needed to figure out the mouse button that activated the menu and the time at which this happened. If you pass in <see langword="null" />, then no button and the current time will be used as defaults.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="MenuDoPopup">
<MemberSignature Language="C#" Value="public static void MenuDoPopup (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, IntPtr data, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="popup" Type="Gtk.Widget" />
<Parameter Name="pos_func" Type="Gtk.MenuPositionFunc" />
<Parameter Name="data" Type="System.IntPtr" />
<Parameter Name="evnt" Type="Gdk.EventButton" />
<Parameter Name="user_data" Type="System.IntPtr" />
<Parameter Name="for_widget" Type="Gtk.Widget" />
</Parameters>
<Docs>
<param name="popup">a <see cref="T:Gtk.Widget" /></param>
<param name="pos_func">a <see cref="T:Gtk.MenuPositionFunc" /></param>
<param name="data">a <see cref="T:System.IntPtr" /></param>
<param name="evnt">a <see cref="T:Gdk.EventButton" /></param>
<param name="user_data">a <see cref="T:System.IntPtr" /></param>
<param name="for_widget">a <see cref="T:Gtk.Widget" /></param>
<summary>Obsolete. Replaced by overload with no <see cref="T:System.IntPtr" /> argument.</summary>
<remarks />
</Docs>
</Member>
<Member MemberName="MenuNewWithAccelgroup">
<MemberSignature Language="C#" Value="public static Gtk.Widget MenuNewWithAccelgroup (Gnome.UIInfo uiinfo, Gtk.AccelGroup accelgroup);" />
<MemberType>Method</MemberType>
@ -193,7 +216,7 @@ class PopupSample
</Docs>
</Member>
<Member MemberName="MenuDoPopupModal">
<MemberSignature Language="C#" Value="public static int MenuDoPopupModal (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, IntPtr pos_data, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
<MemberSignature Language="C#" Value="public static int MenuDoPopupModal (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
@ -201,19 +224,17 @@ class PopupSample
<Parameters>
<Parameter Name="popup" Type="Gtk.Widget" />
<Parameter Name="pos_func" Type="Gtk.MenuPositionFunc" />
<Parameter Name="pos_data" Type="System.IntPtr" />
<Parameter Name="evnt" Type="Gdk.EventButton" />
<Parameter Name="user_data" Type="System.IntPtr" />
<Parameter Name="for_widget" Type="Gtk.Widget" />
</Parameters>
<Docs>
<summary>You can use this function to pop up a menu modally.</summary>
<param name="popup">a <see cref="T:Gtk.Widget" /></param>
<param name="pos_func">a <see cref="T:Gtk.MenuPositionFunc" /></param>
<param name="pos_data">a <see cref="T:System.IntPtr" /></param>
<param name="evnt">a <see cref="T:Gdk.EventButton" /></param>
<param name="user_data">a <see cref="T:System.IntPtr" /></param>
<param name="for_widget">a <see cref="T:Gtk.Widget" /></param>
<summary>You can use this function to pop up a menu modally.</summary>
<returns>a <see cref="T:System.Int32" /></returns>
<remarks>Same as <see cref="M:Gnome.Popup.MenuDoPopup()" />, but modal.</remarks>
</Docs>
@ -228,5 +249,32 @@ class PopupSample
<remarks>The default constructor for <see cref="T:Gnome.Popup" />.</remarks>
</Docs>
</Member>
<Member MemberName="MenuDoPopupModal">
<MemberSignature Language="C#" Value="public static int MenuDoPopupModal (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, IntPtr data, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="popup" Type="Gtk.Widget" />
<Parameter Name="pos_func" Type="Gtk.MenuPositionFunc" />
<Parameter Name="data" Type="System.IntPtr" />
<Parameter Name="evnt" Type="Gdk.EventButton" />
<Parameter Name="user_data" Type="System.IntPtr" />
<Parameter Name="for_widget" Type="Gtk.Widget" />
</Parameters>
<Docs>
<param name="popup">a <see cref="T:Gtk.Widget" /></param>
<param name="pos_func">a <see cref="T:Gtk.MenuPositionFunc" /></param>
<param name="data">To be added.</param>
<param name="evnt">a <see cref="T:Gdk.EventButton" /></param>
<param name="user_data">a <see cref="T:System.IntPtr" /></param>
<param name="for_widget">a <see cref="T:Gtk.Widget" /></param>
<summary>Obsolete. Replaced by overload with no <see cref="T:System.IntPtr" /> argument.</summary>
<returns>a <see cref="T:System.Int32" /></returns>
<remarks />
</Docs>
</Member>
</Members>
</Type>

View file

@ -702,28 +702,6 @@ foreach (Widget w in myContainer) {
</remarks>
</Docs>
</Member>
<Member MemberName="ForeachFull">
<MemberSignature Language="C#" Value="public void ForeachFull (Gtk.Callback cb, Gtk.CallbackMarshal marshal, IntPtr callback_data, Gtk.DestroyNotify notify);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cb" Type="Gtk.Callback" />
<Parameter Name="marshal" Type="Gtk.CallbackMarshal" />
<Parameter Name="callback_data" Type="System.IntPtr" />
<Parameter Name="notify" Type="Gtk.DestroyNotify" />
</Parameters>
<Docs>
<summary>Runs <paramref name="cb" /> over every item in this container.</summary>
<param name="cb">a <see cref="T:Gtk.Callback" /></param>
<param name="marshal">a <see cref="T:Gtk.CallbackMarshal" /></param>
<param name="callback_data">a <see cref="T:System.IntPtr" />, the data to pass to the callback method.</param>
<param name="notify">a <see cref="T:Gtk.DestroyNotify" /></param>
<remarks>FIXME: this should be clarified.</remarks>
<since version="Gtk# 2.4" />
</Docs>
</Member>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public virtual Gtk.Container+ContainerChild Item[Gtk.Widget w] { get; };" />
<MemberType>Property</MemberType>

View file

@ -139,7 +139,7 @@ public class MenuApp
</Docs>
</Member>
<Member MemberName="Popup">
<MemberSignature Language="C#" Value="public void Popup (Gtk.Widget parent_menu_shell, Gtk.Widget parent_menu_item, Gtk.MenuPositionFunc func, IntPtr data, uint button, uint activate_time);" />
<MemberSignature Language="C#" Value="public void Popup (Gtk.Widget parent_menu_shell, Gtk.Widget parent_menu_item, Gtk.MenuPositionFunc func, uint button, uint activate_time);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
@ -148,7 +148,6 @@ public class MenuApp
<Parameter Name="parent_menu_shell" Type="Gtk.Widget" />
<Parameter Name="parent_menu_item" Type="Gtk.Widget" />
<Parameter Name="func" Type="Gtk.MenuPositionFunc" />
<Parameter Name="data" Type="System.IntPtr" />
<Parameter Name="button" Type="System.UInt32" />
<Parameter Name="activate_time" Type="System.UInt32" />
</Parameters>
@ -157,12 +156,11 @@ public class MenuApp
<param name="parent_menu_shell">The menu shell containing the triggering menu item, or <see langword="null" />.</param>
<param name="parent_menu_item">The menu item whose activation triggered the popup, or <see langword="null" />.</param>
<param name="func">A user supplied function used to position the menu, or <see langword="null" />.</param>
<param name="data">A user supplied data to be passed to func.</param>
<param name="button">The mouse button which was pressed to initiate the event.</param>
<param name="activate_time">The time at which the activation event occurred.</param>
<remarks>
<para>
Applications can use this function to display context-sensitive menus, and will typically supply <see langword="null" /> for the <paramref name="parent_menu_shell" />, <paramref name="parent_menu_item" />, and <paramref name="func" /> parameters, and <see cref="F:System.IntPtr.Zero" /> for <paramref name="data" /> parameter. The default menu positioning function will position the menu at the current mouse cursor position.
Applications can use this function to display context-sensitive menus, and will typically supply <see langword="null" /> for the <paramref name="parent_menu_shell" />, <paramref name="parent_menu_item" />, and <paramref name="func" /> parameters. The default menu positioning function will position the menu at the current mouse cursor position.
</para>
<para>
The <paramref name="button" /> parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, button should be zero(0).
@ -214,7 +212,7 @@ class PopupSample
private void OnEventBoxPressed (object o, ButtonPressEventArgs args)
{
if (args.Event.button == 3)
menu.Popup (null, null, null, IntPtr.Zero, 3, Gtk.Global.CurrentEventTime);
menu.Popup (null, null, null, 3, Gtk.Global.CurrentEventTime);
}
private void OnHelloActivated (object o, EventArgs args)
@ -231,6 +229,31 @@ class PopupSample
</example>
</Docs>
</Member>
<Member MemberName="Popup">
<MemberSignature Language="C#" Value="public void Popup (Gtk.Widget parent_menu_shell, Gtk.Widget parent_menu_item, Gtk.MenuPositionFunc func, IntPtr data, uint button, uint activate_time);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="parent_menu_shell" Type="Gtk.Widget" />
<Parameter Name="parent_menu_item" Type="Gtk.Widget" />
<Parameter Name="func" Type="Gtk.MenuPositionFunc" />
<Parameter Name="data" Type="System.IntPtr" />
<Parameter Name="button" Type="System.UInt32" />
<Parameter Name="activate_time" Type="System.UInt32" />
</Parameters>
<Docs>
<summary>Obsolete. Replaced by <see cref="Gtk.Menu.Popup(Gtk.Widget,Gtk.Widget,Gtk.MenuPositionFunc,System.UInt32,System.UInt32)" />.</summary>
<param name="parent_menu_shell">The menu shell containing the triggering menu item, or <see langword="null" />.</param>
<param name="parent_menu_item">The menu item whose activation triggered the popup, or <see langword="null" />.</param>
<param name="func">A user supplied function used to position the menu, or <see langword="null" />.</param>
<param name="data">Ignored.</param>
<param name="button">The mouse button which was pressed to initiate the event.</param>
<param name="activate_time">The time at which the activation event occurred.</param>
<remarks />
</Docs>
</Member>
<Member MemberName="Reposition">
<MemberSignature Language="C#" Value="public void Reposition ();" />
<MemberType>Method</MemberType>

View file

@ -192,6 +192,24 @@
<remarks>(If iter is currently on a word end, moves forward to the next one after that.) Word breaks are determined by Pango and should be correct for nearly any language (if not, the correct fix would be to the Pango word break algorithms).</remarks>
</Docs>
</Member>
<Member MemberName="ForwardFindChar">
<MemberSignature Language="C#" Value="public bool ForwardFindChar (Gtk.TextCharPredicate pred, Gtk.TextIter limit);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="pred" Type="Gtk.TextCharPredicate" />
<Parameter Name="limit" Type="Gtk.TextIter" />
</Parameters>
<Docs>
<summary>Advances the iterator, calling <paramref name="pred" /> on each character.</summary>
<param name="pred">A <see cref="M:Gtk.TextCharPredicate" /> to call on each character.</param>
<param name="limit"> search limit, or <see langword="null" /> for none</param>
<returns>whether a match was found</returns>
<remarks>If pred returns <see langword="true" />, returns <see langword="true" /> and stops scanning. If pred never returns <see langword="true" />, iter is set to limit if limit is non-<see langword="null" />, otherwise to the end iterator.</remarks>
</Docs>
</Member>
<Member MemberName="ForwardFindChar">
<MemberSignature Language="C#" Value="public bool ForwardFindChar (Gtk.TextCharPredicate pred, IntPtr user_data, Gtk.TextIter limit);" />
<MemberType>Method</MemberType>
@ -204,12 +222,12 @@
<Parameter Name="limit" Type="Gtk.TextIter" />
</Parameters>
<Docs>
<summary>Advances the iterator, calling <paramref name="pred" /> on each character.</summary>
<summary>Obsolete. Replaced by <see cref="M:Gtk.TextIter.ForwardFindChar(Gtk.TextCharPredicate,Gtk.TextIter)" />.</summary>
<param name="pred">A <see cref="M:Gtk.TextCharPredicate" /> to call on each character.</param>
<param name="user_data"> user data for <paramref name="pred" /></param>
<param name="user_data">Ignored</param>
<param name="limit"> search limit, or <see langword="null" /> for none</param>
<returns> whether a match was found</returns>
<remarks>If pred returns <see langword="true" />, returns <see langword="true" /> and stops scanning. If pred never returns <see langword="true" />, iter is set to limit if limit is non-<see langword="null" />, otherwise to the end iterator.</remarks>
<returns>whether a match was found</returns>
<remarks />
</Docs>
</Member>
<Member MemberName="EndsWord">
@ -333,6 +351,24 @@ You do not want to use this function to decide whether text can be inserted at i
<remarks />
</Docs>
</Member>
<Member MemberName="BackwardFindChar">
<MemberSignature Language="C#" Value="public bool BackwardFindChar (Gtk.TextCharPredicate pred, Gtk.TextIter limit);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="pred" Type="Gtk.TextCharPredicate" />
<Parameter Name="limit" Type="Gtk.TextIter" />
</Parameters>
<Docs>
<summary>Same as <see cref="M:Gtk.TextIter.ForwardFindChar()" />, but goes backward from iter.</summary>
<param name="pred">A <see cref="M:Gtk.TextCharPredicate" /> to call on each character.</param>
<param name="limit"> search limit, or <see langword="null" /> for none</param>
<returns>whether a match was found</returns>
<remarks />
</Docs>
</Member>
<Member MemberName="BackwardFindChar">
<MemberSignature Language="C#" Value="public bool BackwardFindChar (Gtk.TextCharPredicate pred, IntPtr user_data, Gtk.TextIter limit);" />
<MemberType>Method</MemberType>
@ -345,11 +381,11 @@ You do not want to use this function to decide whether text can be inserted at i
<Parameter Name="limit" Type="Gtk.TextIter" />
</Parameters>
<Docs>
<summary>Same as <see cref="M:Gtk.TextIter.ForwardFindChar()" />, but goes backward from iter.</summary>
<summary>Obsolete. Replaced by <see cref="M:Gtk.TextIter.BackwardFindChar(Gtk.TextCharPredicate,Gtk.TextIter)" />.</summary>
<param name="pred">A <see cref="M:Gtk.TextCharPredicate" /> to call on each character.</param>
<param name="user_data"> user data for <paramref name="pred" /></param>
<param name="user_data">Ignored</param>
<param name="limit"> search limit, or <see langword="null" /> for none</param>
<returns> whether a match was found</returns>
<returns>whether a match was found</returns>
<remarks />
</Docs>
</Member>

View file

@ -386,6 +386,7 @@
<Type Name="WindowTypeHint" />
<Type Name="WMDecoration" />
<Type Name="WMFunction" />
<Type Name="InvalidateMaybeRecurseChildFunc" />
</Namespace>
<Namespace Name="Gtk">
<Type Name="ITreeNode" />
@ -1253,6 +1254,7 @@
<Type Name="PathStrokeJoinType" />
<Type Name="PixFormat" />
<Type Name="WindRule" />
<Type Name="RenderAaCallback" />
</Namespace>
<Namespace Name="Gnome">
<Type Name="BonoboUIVerb" />

View file

@ -2289,13 +2289,7 @@
<return-type type="void" />
<parameters>
<parameter type="GdkRegion*" name="region" />
<callback cname="child_func">
<return-type type="gboolean" />
<parameters>
<parameter type="GdkWindow*" name="arg1" />
<parameter type="gpointer" name="arg2" />
</parameters>
</callback>
<parameter type="InvalidateMaybeRecurseChildFunc" name="child_func" />
<parameter type="gpointer" name="user_data" />
</parameters>
</method>
@ -3314,6 +3308,13 @@
<return-type type="gchar*" />
</method>
</struct>
<callback name="InvalidateMaybeRecurseChildFunc" cname="InvalidateMaybeRecurseChildFunc">
<return-type type="gboolean" />
<parameters>
<parameter type="GdkWindow*" name="arg1" />
<parameter type="gpointer" name="data" />
</parameters>
</callback>
<class name="Global" cname="GdkGlobal">
<method name="AddClientMessageFilter" cname="gdk_add_client_message_filter" shared="true">
<return-type type="void" />

View file

@ -2417,13 +2417,7 @@
<return-type type="void" />
<parameters>
<parameter type="GdkRegion*" name="region" />
<callback cname="child_func">
<return-type type="gboolean" />
<parameters>
<parameter type="GdkWindow*" name="arg1" />
<parameter type="gpointer" name="arg2" />
</parameters>
</callback>
<parameter type="InvalidateMaybeRecurseChildFunc" name="child_func" />
<parameter type="gpointer" name="user_data" />
</parameters>
</method>
@ -3467,6 +3461,13 @@
<return-type type="gchar*" />
</method>
</struct>
<callback name="InvalidateMaybeRecurseChildFunc" cname="InvalidateMaybeRecurseChildFunc">
<return-type type="gboolean" />
<parameters>
<parameter type="GdkWindow*" name="arg1" />
<parameter type="gpointer" name="data" />
</parameters>
</callback>
<class name="Global" cname="GdkGlobal">
<method name="AddClientMessageFilter" cname="gdk_add_client_message_filter" shared="true">
<return-type type="void" />

View file

@ -90,30 +90,6 @@ namespace GtkSharp.Generation {
}
}
public override bool Equals (object o)
{
if (!(o is Method))
return false;
Method a = this;
Method b = (Method) o;
if (a.Name != b.Name)
return false;
if (a.Signature == null)
return b.Signature == null;
if (b.Signature == null)
return false;
return (a.Signature.Types == b.Signature.Types);
}
public override int GetHashCode ()
{
return Name.GetHashCode () ^ (Signature == null ? 0 : Signature.Types.GetHashCode ());
}
private bool Initialize ()
{
if (initialized)

View file

@ -92,7 +92,8 @@ namespace GtkSharp.Generation {
if (p.CType == "GError**") {
call_parm = call_parm.Replace (p.Name, "error");
} else if (p.IsUserData && !parameters.HideData && (i == parameters.Count - 1)) {
} else if (p.IsUserData && parameters.IsHidden (p) && !parameters.HideData &&
(i == 0 || parameters [i - 1].Scope != "notified")) {
call_parm = "IntPtr.Zero";
}

View file

@ -280,9 +280,9 @@ namespace GtkSharp.Generation {
if (HasCB || HideData) {
if (p.IsUserData && (idx == Count - 1))
return true;
if (p.IsUserData && (idx == Count - 2) &&
this [idx + 1].IsDestroyNotify)
return true;
if (p.IsUserData && idx > 0 &&
this [idx - 1].Generatable is CallbackGen)
return true;
if (p.IsDestroyNotify && (idx == Count - 1) &&
this [idx - 1].IsUserData)

View file

@ -31,3 +31,21 @@
GLib.Marshaller.Free (nappname);
GLib.Marshaller.Free (ntitle);
}
[Obsolete("Replaced by overload with no IntPtr arg")]
public void CreateMenusInterp (Gnome.UIInfo uiinfo, Gtk.CallbackMarshal relay_func, IntPtr data, Gtk.DestroyNotify destroy_func)
{
CreateMenusInterp (uiinfo, relay_func, destroy_func);
}
[Obsolete("Replaced by overload with no IntPtr arg")]
public void InsertMenusInterp (string path, Gnome.UIInfo menuinfo, Gtk.CallbackMarshal relay_func, IntPtr data, Gtk.DestroyNotify destroy_func)
{
InsertMenusInterp (path, menuinfo, relay_func, destroy_func);
}
[Obsolete("Replaced by overload with no IntPtr arg")]
public void CreateToolbarInterp (Gnome.UIInfo uiinfo, Gtk.CallbackMarshal relay_func, IntPtr data, Gtk.DestroyNotify destroy_func)
{
CreateToolbarInterp (uiinfo, relay_func, destroy_func);
}

21
gnome/Client.custom Normal file
View file

@ -0,0 +1,21 @@
// Client.custom - Gnome.Client customizations
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
// Public License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
[Obsolete("Replaced by overload with no IntPtr arg")]
public void RequestInteractionInterp (Gnome.DialogType dialog_type, Gtk.CallbackMarshal function, IntPtr data, Gtk.DestroyNotify destroy)
{
RequestInteractionInterp (dialog_type, function, destroy);
}

View file

@ -41,6 +41,7 @@ customs = \
CanvasShape.custom \
CanvasText.custom \
CanvasWidget.custom \
Client.custom \
Druid.custom \
DruidPageEdge.custom \
Font.custom \
@ -49,6 +50,7 @@ customs = \
IconList.custom \
IconTextItem.custom \
PanelApplet.custom \
Popup.custom \
Print.custom \
PrintContext.custom \
PrintDialog.custom \

27
gnome/Popup.custom Normal file
View file

@ -0,0 +1,27 @@
// Popup.custom - Gnome.Popup customizations
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
// Public License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
[Obsolete]
public static int MenuDoPopupModal (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, IntPtr data, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget)
{
return MenuDoPopupModal (popup, pos_func, evnt, user_data, for_widget);
}
[Obsolete]
public static void MenuDoPopup (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, IntPtr data, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget)
{
MenuDoPopup (popup, pos_func, evnt, user_data, for_widget);
}

View file

@ -211,10 +211,7 @@
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='ChildGetProperty']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='Forall']/*/*[@name='callback']" name="scope">call</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='Foreach']/*/*[@name='callback']" name="scope">call</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='ForeachFull']/*/*[@name='callback']" name="scope">call</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='ForeachFull']/*/*[@name='marshal']" name="scope">call</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='ForeachFull']/*/*[@name='notify']" name="scope">call</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='ForeachFull']/*/*[@name='notify']" name="type">GtkDestroyNotify</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='ForeachFull']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='GetChildren']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='GetFocusChain']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkContainer']/method[@name='SetFocusChain']" name="hidden">1</attr>

View file

@ -20,9 +20,14 @@
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
[Obsolete("Replaced by overload without IntPtr argument")]
public void Popup (Gtk.Widget parent_menu_shell, Gtk.Widget parent_menu_item, Gtk.MenuPositionFunc func, IntPtr data, uint button, uint activate_time) {
Popup (parent_menu_shell, parent_menu_item, func, button, activate_time);
}
public void Popup ()
{
this.Popup (null, null, null, IntPtr.Zero, 3, Global.CurrentEventTime);
Popup (null, null, null, 3, Global.CurrentEventTime);
}
[DllImport("libgtk-win32-2.0-0.dll")]

View file

@ -79,3 +79,13 @@
result [i] = list [i] as TextTag;
return result;
}
[Obsolete("Replaced by overload without IntPtr argument")]
public bool ForwardFindChar (Gtk.TextCharPredicate pred, IntPtr user_data, Gtk.TextIter limit) {
return ForwardFindChar (pred, limit);
}
[Obsolete("Replaced by overload without IntPtr argument")]
public bool BackwardFindChar (Gtk.TextCharPredicate pred, IntPtr user_data, Gtk.TextIter limit) {
return BackwardFindChar (pred, limit);
}

View file

@ -780,11 +780,20 @@ sub addParamsElem
$parm =~ s/unsigned\s+/unsigned-/g;
if ($parm =~ /(.*)\(\s*\**\s*(\w+)\)\s+\((.*)\)/) {
my $ret = $1; my $cbn = $2; my $params = $3;
$cb_elem = addNameElem($parms_elem, 'callback', $cbn);
my $type = $parent->getAttribute('name') . StudlyCaps($cbn);
$cb_elem = addNameElem($ns_elem, 'callback', $type, $ns);
addReturnElem($cb_elem, $ret);
if ($params && ($params ne "void")) {
addParamsElem($cb_elem, split(/,/, $params));
my $data_parm = $cb_elem->lastChild()->lastChild();
if ($data_parm && $data_parm->getAttribute('type') eq "gpointer") {
$data_parm->setAttribute('name', 'data');
}
}
$parm_elem = $doc->createElement('parameter');
$parm_elem->setAttribute('type', $type);
$parm_elem->setAttribute('name', $cbn);
$parms_elem->appendChild($parm_elem);
next;
} elsif ($parm =~ /\.\.\./) {
$parm_elem = $doc->createElement('parameter');