Author: mkestner
Date: 2008-01-02 15:57:28 -0500 (Wed, 02 Jan 2008)
New Revision: 92127
Added:
trunk/gtk-sharp/gtk/MoveFocusHandler.cs
Modified:
trunk/gtk-sharp/ChangeLog
trunk/gtk-sharp/gtk/Makefile.am
trunk/gtk-sharp/gtk/TextView.custom
trunk/gtk-sharp/gtk/Window.custom
Log:
2008-01-02 Mike Kestner <[EMAIL PROTECTED]>
* gtk/MoveFocusHandler.cs: obsolete event types.
* gtk/TextView.custom: obsolete move-focus signal.
* gtk/Window.custom: obsolete move-focus signal.
Compat fixes for removal of signals from gtk+ API. [Fixes #350770]
Modified: trunk/gtk-sharp/ChangeLog
===================================================================
--- trunk/gtk-sharp/ChangeLog 2008-01-02 20:56:16 UTC (rev 92126)
+++ trunk/gtk-sharp/ChangeLog 2008-01-02 20:57:28 UTC (rev 92127)
@@ -1,3 +1,10 @@
+2008-01-02 Mike Kestner <[EMAIL PROTECTED]>
+
+ * gtk/MoveFocusHandler.cs: obsolete event types.
+ * gtk/TextView.custom: obsolete move-focus signal.
+ * gtk/Window.custom: obsolete move-focus signal.
+ Compat fixes for removal of signals from gtk+ API. [Fixes #350770]
+
2007-12-17 Mike Kestner <[EMAIL PROTECTED]>
* parser/gapi_pp.pl: parse 'typedef struct\n{' properly.
Modified: trunk/gtk-sharp/gtk/Makefile.am
===================================================================
--- trunk/gtk-sharp/gtk/Makefile.am 2008-01-02 20:56:16 UTC (rev 92126)
+++ trunk/gtk-sharp/gtk/Makefile.am 2008-01-02 20:57:28 UTC (rev 92127)
@@ -16,6 +16,7 @@
BindingAttribute.cs \
ChildPropertyAttribute.cs \
ITreeNode.cs \
+ MoveFocusHandler.cs \
NodeCellDataFunc.cs \
NodeSelection.cs \
NodeStore.cs \
Added: trunk/gtk-sharp/gtk/MoveFocusHandler.cs
===================================================================
--- trunk/gtk-sharp/gtk/MoveFocusHandler.cs 2008-01-02 20:56:16 UTC (rev
92126)
+++ trunk/gtk-sharp/gtk/MoveFocusHandler.cs 2008-01-02 20:57:28 UTC (rev
92127)
@@ -0,0 +1,20 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace Gtk {
+
+ using System;
+
+ [Obsolete ("Events using this type were replaced by Gtk.Widget
keybinding signal")]
+ public delegate void MoveFocusHandler(object o, MoveFocusArgs args);
+
+ [Obsolete ("Events using this type were replaced by Gtk.Widget
keybinding signal")]
+ public class MoveFocusArgs : GLib.SignalArgs {
+ public Gtk.DirectionType Direction{
+ get {
+ return (Gtk.DirectionType) Args[0];
+ }
+ }
+
+ }
+}
Modified: trunk/gtk-sharp/gtk/TextView.custom
===================================================================
--- trunk/gtk-sharp/gtk/TextView.custom 2008-01-02 20:56:16 UTC (rev 92126)
+++ trunk/gtk-sharp/gtk/TextView.custom 2008-01-02 20:57:28 UTC (rev 92127)
@@ -35,3 +35,74 @@
Raw = gtk_text_view_new_with_buffer (buffer.Handle);
}
+ [GLib.CDeclCallback]
+ delegate void MoveFocusSignalDelegate (IntPtr arg0, int arg1,
IntPtr gch);
+
+ static void MoveFocusSignalCallback (IntPtr arg0, int arg1,
IntPtr gch)
+ {
+ Gtk.MoveFocusArgs args = new Gtk.MoveFocusArgs ();
+ try {
+ GLib.Signal sig = ((GCHandle) gch).Target as
GLib.Signal;
+ if (sig == null)
+ throw new Exception("Unknown signal GC
handle received " + gch);
+
+ args.Args = new object[1];
+ args.Args[0] = (Gtk.DirectionType) arg1;
+ Gtk.MoveFocusHandler handler =
(Gtk.MoveFocusHandler) sig.Handler;
+ handler (GLib.Object.GetObject (arg0), args);
+ } catch (Exception e) {
+ GLib.ExceptionManager.RaiseUnhandledException
(e, false);
+ }
+ }
+
+ [GLib.CDeclCallback]
+ delegate void MoveFocusVMDelegate (IntPtr text_view, int
direction);
+
+ static MoveFocusVMDelegate MoveFocusVMCallback;
+
+ static void movefocus_cb (IntPtr text_view, int direction)
+ {
+ try {
+ TextView text_view_managed =
GLib.Object.GetObject (text_view, false) as TextView;
+ text_view_managed.OnMoveFocus
((Gtk.DirectionType) direction);
+ } catch (Exception e) {
+ GLib.ExceptionManager.RaiseUnhandledException
(e, false);
+ }
+ }
+
+ private static void OverrideMoveFocus (GLib.GType gtype)
+ {
+ if (MoveFocusVMCallback == null)
+ MoveFocusVMCallback = new MoveFocusVMDelegate
(movefocus_cb);
+ OverrideVirtualMethod (gtype, "move_focus",
MoveFocusVMCallback);
+ }
+
+ [Obsolete ("Replaced by keybinding signal on Gtk.Widget")]
+ [GLib.DefaultSignalHandler(Type=typeof(Gtk.TextView),
ConnectionMethod="OverrideMoveFocus")]
+ protected virtual void OnMoveFocus (Gtk.DirectionType direction)
+ {
+ GLib.Value ret = GLib.Value.Empty;
+ GLib.ValueArray inst_and_params = new GLib.ValueArray
(2);
+ GLib.Value[] vals = new GLib.Value [2];
+ vals [0] = new GLib.Value (this);
+ inst_and_params.Append (vals [0]);
+ vals [1] = new GLib.Value (direction);
+ inst_and_params.Append (vals [1]);
+ g_signal_chain_from_overridden
(inst_and_params.ArrayPtr, ref ret);
+ foreach (GLib.Value v in vals)
+ v.Dispose ();
+ }
+
+ [Obsolete ("Replaced by keybinding signal on Gtk.Widget")]
+ [GLib.Signal("move_focus")]
+ public event Gtk.MoveFocusHandler MoveFocus {
+ add {
+ GLib.Signal sig = GLib.Signal.Lookup (this,
"move_focus", new MoveFocusSignalDelegate(MoveFocusSignalCallback));
+ sig.AddDelegate (value);
+ }
+ remove {
+ GLib.Signal sig = GLib.Signal.Lookup (this,
"move_focus", new MoveFocusSignalDelegate(MoveFocusSignalCallback));
+ sig.RemoveDelegate (value);
+ }
+ }
+
Modified: trunk/gtk-sharp/gtk/Window.custom
===================================================================
--- trunk/gtk-sharp/gtk/Window.custom 2008-01-02 20:56:16 UTC (rev 92126)
+++ trunk/gtk-sharp/gtk/Window.custom 2008-01-02 20:57:28 UTC (rev 92127)
@@ -86,3 +86,74 @@
}
}
+ [GLib.CDeclCallback]
+ delegate void MoveFocusSignalDelegate (IntPtr arg0, int arg1,
IntPtr gch);
+
+ static void MoveFocusSignalCallback (IntPtr arg0, int arg1,
IntPtr gch)
+ {
+ Gtk.MoveFocusArgs args = new Gtk.MoveFocusArgs ();
+ try {
+ GLib.Signal sig = ((GCHandle) gch).Target as
GLib.Signal;
+ if (sig == null)
+ throw new Exception("Unknown signal GC
handle received " + gch);
+
+ args.Args = new object[1];
+ args.Args[0] = (Gtk.DirectionType) arg1;
+ Gtk.MoveFocusHandler handler =
(Gtk.MoveFocusHandler) sig.Handler;
+ handler (GLib.Object.GetObject (arg0), args);
+ } catch (Exception e) {
+ GLib.ExceptionManager.RaiseUnhandledException
(e, false);
+ }
+ }
+
+ [GLib.CDeclCallback]
+ delegate void MoveFocusVMDelegate (IntPtr window, int
direction);
+
+ static MoveFocusVMDelegate MoveFocusVMCallback;
+
+ static void movefocus_cb (IntPtr window, int direction)
+ {
+ try {
+ Window window_managed = GLib.Object.GetObject
(window, false) as Window;
+ window_managed.OnMoveFocus ((Gtk.DirectionType)
direction);
+ } catch (Exception e) {
+ GLib.ExceptionManager.RaiseUnhandledException
(e, false);
+ }
+ }
+
+ private static void OverrideMoveFocus (GLib.GType gtype)
+ {
+ if (MoveFocusVMCallback == null)
+ MoveFocusVMCallback = new MoveFocusVMDelegate
(movefocus_cb);
+ OverrideVirtualMethod (gtype, "move_focus",
MoveFocusVMCallback);
+ }
+
+ [Obsolete ("Replaced by Keybinding signal on Gtk.Widget")]
+ [GLib.DefaultSignalHandler(Type=typeof(Gtk.Window),
ConnectionMethod="OverrideMoveFocus")]
+ protected virtual void OnMoveFocus (Gtk.DirectionType direction)
+ {
+ GLib.Value ret = GLib.Value.Empty;
+ GLib.ValueArray inst_and_params = new GLib.ValueArray
(2);
+ GLib.Value[] vals = new GLib.Value [2];
+ vals [0] = new GLib.Value (this);
+ inst_and_params.Append (vals [0]);
+ vals [1] = new GLib.Value (direction);
+ inst_and_params.Append (vals [1]);
+ g_signal_chain_from_overridden
(inst_and_params.ArrayPtr, ref ret);
+ foreach (GLib.Value v in vals)
+ v.Dispose ();
+ }
+
+ [Obsolete ("Replaced by Keybinding signal on Gtk.Widget")]
+ [GLib.Signal("move_focus")]
+ public event Gtk.MoveFocusHandler MoveFocus {
+ add {
+ GLib.Signal sig = GLib.Signal.Lookup (this,
"move_focus", new MoveFocusSignalDelegate(MoveFocusSignalCallback));
+ sig.AddDelegate (value);
+ }
+ remove {
+ GLib.Signal sig = GLib.Signal.Lookup (this,
"move_focus", new MoveFocusSignalDelegate(MoveFocusSignalCallback));
+ sig.RemoveDelegate (value);
+ }
+ }
+
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches