From 6bf7376094c02af8208d2ac38a12ac77fb2e4ee5 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 22 Jul 2005 19:10:04 +0000 Subject: [PATCH] * parser/gapi2xml.pl (addParamsElem): change the handling of anonymous function pointer types in method signatures. Before, we added a child to the 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 node referencing it to the 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 --- ChangeLog | 42 ++++++++++++ art/art-api.raw | 21 +++--- doc/en/Art/RenderAaCallback.xml | 29 ++++++++ doc/en/Art/SVP.xml | 6 +- .../Gdk/InvalidateMaybeRecurseChildFunc.xml | 22 +++++++ doc/en/Gdk/Window.xml | 55 ++++++++-------- doc/en/Gnome/App.xml | 59 +++++++++++++++++ doc/en/Gnome/Client.xml | 19 ++++++ doc/en/Gnome/Popup.xml | 66 ++++++++++++++++--- doc/en/Gtk/Container.xml | 22 ------- doc/en/Gtk/Menu.xml | 33 ++++++++-- doc/en/Gtk/TextIter.xml | 50 ++++++++++++-- doc/en/index.xml | 2 + gdk/gdk-api-2.4.raw | 15 +++-- gdk/gdk-api-2.6.raw | 15 +++-- generator/Method.cs | 24 ------- generator/MethodBody.cs | 3 +- generator/Parameters.cs | 6 +- gnome/App.custom | 18 +++++ gnome/Client.custom | 21 ++++++ gnome/Makefile.am | 2 + gnome/Popup.custom | 27 ++++++++ gtk/Gtk.metadata | 5 +- gtk/Menu.custom | 7 +- gtk/TextIter.custom | 10 +++ parser/gapi2xml.pl | 11 +++- 26 files changed, 459 insertions(+), 131 deletions(-) create mode 100644 doc/en/Art/RenderAaCallback.xml create mode 100644 doc/en/Gdk/InvalidateMaybeRecurseChildFunc.xml create mode 100644 gnome/Client.custom create mode 100644 gnome/Popup.custom diff --git a/ChangeLog b/ChangeLog index 47332b145..1f8e098f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,6 +49,48 @@ * doc/en/Gtk/TreeSelection.xml: Add documentation for the new overload. +2005-07-19 Dan Winship + + * parser/gapi2xml.pl (addParamsElem): change the handling of + anonymous function pointer types in method signatures. Before, we + added a child to the 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 node + referencing it to the 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 * generator/Parameters.cs: Remove the AllowComplexRefs flag. diff --git a/art/art-api.raw b/art/art-api.raw index 6a38d1960..a89570dc6 100644 --- a/art/art-api.raw +++ b/art/art-api.raw @@ -507,16 +507,7 @@ - - - - - - - - - - + @@ -752,6 +743,16 @@ + + + + + + + + + + diff --git a/doc/en/Art/RenderAaCallback.xml b/doc/en/Art/RenderAaCallback.xml new file mode 100644 index 000000000..dfc6f60d0 --- /dev/null +++ b/doc/en/Art/RenderAaCallback.xml @@ -0,0 +1,29 @@ + + + + art-sharp + 2.6.0.0 + + + System.Delegate + + + + + + + + + + System.Void + + + To be added. + To be added. + To be added. + To be added. + To be added. + To be added. + To be added. + + diff --git a/doc/en/Art/SVP.xml b/doc/en/Art/SVP.xml index 56d0f401b..e5e1ddfc7 100644 --- a/doc/en/Art/SVP.xml +++ b/doc/en/Art/SVP.xml @@ -292,7 +292,7 @@ - + Method System.Void @@ -302,7 +302,7 @@ - + To be added @@ -310,7 +310,7 @@ a a a - a + a To be added diff --git a/doc/en/Gdk/InvalidateMaybeRecurseChildFunc.xml b/doc/en/Gdk/InvalidateMaybeRecurseChildFunc.xml new file mode 100644 index 000000000..b8f952472 --- /dev/null +++ b/doc/en/Gdk/InvalidateMaybeRecurseChildFunc.xml @@ -0,0 +1,22 @@ + + + + gdk-sharp + 2.6.0.0 + + + System.Delegate + + + + + + System.Boolean + + + The window to consider. + Callback function for . + Whether or not the part of intersecting the region-to-be-invalidated should be invalidated. + + + diff --git a/doc/en/Gdk/Window.xml b/doc/en/Gdk/Window.xml index 042a74d0f..a80e6e830 100644 --- a/doc/en/Gdk/Window.xml +++ b/doc/en/Gdk/Window.xml @@ -350,43 +350,44 @@ - + Method System.Void - + - Adds to the update area for the - window. The update area is the region that needs to be - redrawn, or "dirty region." - A - A + Function to use to decide if to recurse to a child. means never recurse. + Adds a region to the update area for a window and some of its children -

function to use to decide if to recurse to a child, - %NULL means never recurse. -

-

The call - 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.

-

GDK will call 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.

-

(TODO: See bugzilla.ximian.com bug # 66241, to which the following - text pertains.) - The parameter controls whether the region of - each child window that intersects will also be invalidated. - Only children for which returns TRUE will have the area - invalidated.

-
+

+ Adds to the update area for + the window. The update area is the region that needs + to be redrawn, or "dirty region." The call 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. +

+

+ GDK will call 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. +

+

+ The parameter controls + whether the region of each child window that + intersects will also be + invalidated. Only children for which returns + will have the area invalidated. +

+
diff --git a/doc/en/Gnome/App.xml b/doc/en/Gnome/App.xml index 02c383504..3e0fe7db8 100644 --- a/doc/en/Gnome/App.xml +++ b/doc/en/Gnome/App.xml @@ -754,5 +754,64 @@ + + + Method + + System.Void + + + + + + + + To be added. + To be added. + To be added. + To be added. + To be added. + + + + + Method + + System.Void + + + + + + + + + To be added. + To be added. + To be added. + To be added. + To be added. + To be added. + + + + + Method + + System.Void + + + + + + + + To be added. + To be added. + To be added. + To be added. + To be added. + + diff --git a/doc/en/Gnome/Client.xml b/doc/en/Gnome/Client.xml index 2f7660744..4224f8532 100644 --- a/doc/en/Gnome/Client.xml +++ b/doc/en/Gnome/Client.xml @@ -688,5 +688,24 @@ To be added. + + + Method + + System.Void + + + + + + + + To be added. + To be added. + To be added. + To be added. + To be added. + + diff --git a/doc/en/Gnome/Popup.xml b/doc/en/Gnome/Popup.xml index b02821c21..e90981adb 100644 --- a/doc/en/Gnome/Popup.xml +++ b/doc/en/Gnome/Popup.xml @@ -88,7 +88,7 @@ class PopupSample - + Method System.Void @@ -96,26 +96,49 @@ class PopupSample - - You can use this function to pop up a menu. a a - a a a a + You can use this function to pop up a menu. When a menu item callback is invoked, the specified user_data will be passed to it. - The and parameters are the same as for , 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 for these parameters. + The parameter is the same as for , 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 . 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 , then no button and the current time will be used as defaults. + + + Method + + System.Void + + + + + + + + + + + a + a + a + a + a + a + Obsolete. Replaced by overload with no argument. + + + Method @@ -193,7 +216,7 @@ class PopupSample - + Method System.Int32 @@ -201,19 +224,17 @@ class PopupSample - - You can use this function to pop up a menu modally. a a - a a a a + You can use this function to pop up a menu modally. a Same as , but modal. @@ -228,5 +249,32 @@ class PopupSample The default constructor for . + + + Method + + System.Int32 + + + + + + + + + + + a + a + To be added. + a + a + a + Obsolete. Replaced by overload with no argument. + a + + + + diff --git a/doc/en/Gtk/Container.xml b/doc/en/Gtk/Container.xml index 9952b2334..94555619d 100644 --- a/doc/en/Gtk/Container.xml +++ b/doc/en/Gtk/Container.xml @@ -702,28 +702,6 @@ foreach (Widget w in myContainer) { - - - Method - - System.Void - - - - - - - - - Runs over every item in this container. - a - a - a , the data to pass to the callback method. - a - FIXME: this should be clarified. - - - Property diff --git a/doc/en/Gtk/Menu.xml b/doc/en/Gtk/Menu.xml index 2c900a3c5..1e669e3f9 100644 --- a/doc/en/Gtk/Menu.xml +++ b/doc/en/Gtk/Menu.xml @@ -139,7 +139,7 @@ public class MenuApp - + Method System.Void @@ -148,7 +148,6 @@ public class MenuApp -
@@ -157,12 +156,11 @@ public class MenuApp The menu shell containing the triggering menu item, or . The menu item whose activation triggered the popup, or . A user supplied function used to position the menu, or . - A user supplied data to be passed to func. The mouse button which was pressed to initiate the event. The time at which the activation event occurred. - Applications can use this function to display context-sensitive menus, and will typically supply for the , , and parameters, and for 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 for the , , and parameters. The default menu positioning function will position the menu at the current mouse cursor position. The 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 + + + Method + + System.Void + + + + + + + + + + + Obsolete. Replaced by . + The menu shell containing the triggering menu item, or . + The menu item whose activation triggered the popup, or . + A user supplied function used to position the menu, or . + Ignored. + The mouse button which was pressed to initiate the event. + The time at which the activation event occurred. + + + Method diff --git a/doc/en/Gtk/TextIter.xml b/doc/en/Gtk/TextIter.xml index 521ef9ae1..f93b3ed6f 100644 --- a/doc/en/Gtk/TextIter.xml +++ b/doc/en/Gtk/TextIter.xml @@ -192,6 +192,24 @@ (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). + + + Method + + System.Boolean + + + + + + + Advances the iterator, calling on each character. + A to call on each character. + search limit, or for none + whether a match was found + If pred returns , returns and stops scanning. If pred never returns , iter is set to limit if limit is non-, otherwise to the end iterator. + + Method @@ -204,12 +222,12 @@
- Advances the iterator, calling on each character. + Obsolete. Replaced by . A to call on each character. - user data for + Ignored search limit, or for none - whether a match was found - If pred returns , returns and stops scanning. If pred never returns , iter is set to limit if limit is non-, otherwise to the end iterator. + whether a match was found + @@ -333,6 +351,24 @@ You do not want to use this function to decide whether text can be inserted at i + + + Method + + System.Boolean + + + + + + + Same as , but goes backward from iter. + A to call on each character. + search limit, or for none + whether a match was found + + + Method @@ -345,11 +381,11 @@ You do not want to use this function to decide whether text can be inserted at i - Same as , but goes backward from iter. + Obsolete. Replaced by . A to call on each character. - user data for + Ignored search limit, or for none - whether a match was found + whether a match was found diff --git a/doc/en/index.xml b/doc/en/index.xml index fd1d47f15..610b27f2a 100644 --- a/doc/en/index.xml +++ b/doc/en/index.xml @@ -386,6 +386,7 @@ + @@ -1253,6 +1254,7 @@ + diff --git a/gdk/gdk-api-2.4.raw b/gdk/gdk-api-2.4.raw index e5c3c8ed6..a7abf2bf1 100644 --- a/gdk/gdk-api-2.4.raw +++ b/gdk/gdk-api-2.4.raw @@ -2289,13 +2289,7 @@ - - - - - - - + @@ -3314,6 +3308,13 @@ + + + + + + + diff --git a/gdk/gdk-api-2.6.raw b/gdk/gdk-api-2.6.raw index 47672aae1..9246ac80b 100644 --- a/gdk/gdk-api-2.6.raw +++ b/gdk/gdk-api-2.6.raw @@ -2417,13 +2417,7 @@ - - - - - - - + @@ -3467,6 +3461,13 @@ + + + + + + + diff --git a/generator/Method.cs b/generator/Method.cs index 1953d12dd..a0679ea47 100644 --- a/generator/Method.cs +++ b/generator/Method.cs @@ -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) diff --git a/generator/MethodBody.cs b/generator/MethodBody.cs index a72b86021..d00ed1ce4 100644 --- a/generator/MethodBody.cs +++ b/generator/MethodBody.cs @@ -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"; } diff --git a/generator/Parameters.cs b/generator/Parameters.cs index 6c6d4db99..a63b1332e 100644 --- a/generator/Parameters.cs +++ b/generator/Parameters.cs @@ -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) diff --git a/gnome/App.custom b/gnome/App.custom index ec6e76be5..aa01fee52 100644 --- a/gnome/App.custom +++ b/gnome/App.custom @@ -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); + } diff --git a/gnome/Client.custom b/gnome/Client.custom new file mode 100644 index 000000000..ee80bf785 --- /dev/null +++ b/gnome/Client.custom @@ -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); + } diff --git a/gnome/Makefile.am b/gnome/Makefile.am index 6dd9f2d12..fd733345c 100644 --- a/gnome/Makefile.am +++ b/gnome/Makefile.am @@ -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 \ diff --git a/gnome/Popup.custom b/gnome/Popup.custom new file mode 100644 index 000000000..7f742fed0 --- /dev/null +++ b/gnome/Popup.custom @@ -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); + } diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index 240c41d89..30cf6f5b3 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -211,10 +211,7 @@ 1 call call - call - call - call - GtkDestroyNotify + 1 1 1 1 diff --git a/gtk/Menu.custom b/gtk/Menu.custom index e84566d50..eddc6a183 100644 --- a/gtk/Menu.custom +++ b/gtk/Menu.custom @@ -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")] diff --git a/gtk/TextIter.custom b/gtk/TextIter.custom index fbd2f9774..b57d03ad7 100755 --- a/gtk/TextIter.custom +++ b/gtk/TextIter.custom @@ -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); + } diff --git a/parser/gapi2xml.pl b/parser/gapi2xml.pl index 061208095..d63167c7c 100755 --- a/parser/gapi2xml.pl +++ b/parser/gapi2xml.pl @@ -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');