From 412fe3d9d1af9b8be07641f9e7c69abab8f81be9 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Fri, 6 Apr 2012 18:31:57 +0200 Subject: [PATCH] atk: Move all .custom files to partial classes --- atk/{Global.custom => Global.cs} | 11 +++++++++-- atk/{Hyperlink.custom => Hyperlink.cs} | 8 ++++++-- atk/Makefile.am | 18 ++++++++---------- atk/{Misc.custom => Misc.cs} | 12 ++++++++++-- atk/{Object.custom => Object.cs} | 10 ++++++++-- ...ctionAdapter.custom => SelectionAdapter.cs} | 9 +++++++-- atk/{TextAdapter.custom => TextAdapter.cs} | 9 +++++++-- atk/{Util.custom => Util.cs} | 10 +++++++++- 8 files changed, 64 insertions(+), 23 deletions(-) rename atk/{Global.custom => Global.cs} (89%) rename atk/{Hyperlink.custom => Hyperlink.cs} (89%) rename atk/{Misc.custom => Misc.cs} (87%) rename atk/{Object.custom => Object.cs} (93%) rename atk/{SelectionAdapter.custom => SelectionAdapter.cs} (88%) rename atk/{TextAdapter.custom => TextAdapter.cs} (90%) rename atk/{Util.custom => Util.cs} (96%) diff --git a/atk/Global.custom b/atk/Global.cs similarity index 89% rename from atk/Global.custom rename to atk/Global.cs index 9bed47cf2..0424c87d7 100644 --- a/atk/Global.custom +++ b/atk/Global.cs @@ -1,4 +1,4 @@ -// Global.custom - Atk Global class customizations +// Global.cs - Atk Global class customizations // // Author: Mike Kestner // @@ -21,6 +21,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Atk { + + using System; + using System.Runtime.InteropServices; + + public partial class Global { [DllImport ("libatk-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern uint atk_add_global_event_listener (GLib.Signal.EmissionHookNative hook, IntPtr event_type); @@ -32,4 +38,5 @@ GLib.Marshaller.Free (native_event_type); return id; } - + } +} diff --git a/atk/Hyperlink.custom b/atk/Hyperlink.cs similarity index 89% rename from atk/Hyperlink.custom rename to atk/Hyperlink.cs index 011987d02..f7c0b1fde 100644 --- a/atk/Hyperlink.custom +++ b/atk/Hyperlink.cs @@ -1,4 +1,4 @@ -// Hyperlink.custom - Atk Hyperlink class customizations +// Hyperlink.cs - Atk Hyperlink class customizations // // Author: Mike Gorse // @@ -21,8 +21,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Atk { + public partial class Hyperlink { + protected void EmitLinkActivated () { GLib.Signal.Emit (this, "link_activated"); } - + } +} diff --git a/atk/Makefile.am b/atk/Makefile.am index ce5d0b36e..4ddccdcf2 100644 --- a/atk/Makefile.am +++ b/atk/Makefile.am @@ -8,16 +8,14 @@ references = ../glib/glib-sharp.dll glue_includes = atk/atk.h sources = \ - TextChangedDetail.cs - -customs = \ - Global.custom \ - Hyperlink.custom \ - Misc.custom \ - Object.custom \ - SelectionAdapter.custom \ - TextAdapter.custom \ - Util.custom + Global.cs \ + Hyperlink.cs \ + Misc.cs \ + Object.cs \ + SelectionAdapter.cs \ + TextAdapter.cs \ + TextChangedDetail.cs \ + Util.cs add_dist = diff --git a/atk/Misc.custom b/atk/Misc.cs similarity index 87% rename from atk/Misc.custom rename to atk/Misc.cs index de4dc0c60..ffec16bf3 100644 --- a/atk/Misc.custom +++ b/atk/Misc.cs @@ -1,4 +1,4 @@ -// Misc.custom - Atk Misc class customizations +// Misc.cs - Atk Misc class customizations // // Author: Mike Kestner // @@ -21,6 +21,13 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Atk { + + using System; + using System.Runtime.InteropServices; + + public partial class Misc { + [DllImport("atksharpglue-3")] static extern void atksharp_misc_set_singleton_instance (IntPtr misc); @@ -28,4 +35,5 @@ { atksharp_misc_set_singleton_instance (misc.Handle); } - + } +} diff --git a/atk/Object.custom b/atk/Object.cs similarity index 93% rename from atk/Object.custom rename to atk/Object.cs index 0c5b5c820..0c53df16b 100644 --- a/atk/Object.custom +++ b/atk/Object.cs @@ -1,4 +1,4 @@ -// Object.custom - Atk Object class customizations +// Object.cs - Atk Object class customizations // // Author: Andres G. Aragoneses // @@ -20,7 +20,11 @@ // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. - + +namespace Atk { + + public partial class Object { + protected void EmitChildrenChanged (ChildrenChangedDetail detail, uint child_index, Atk.Object child) { GLib.Signal.Emit (this, @@ -47,3 +51,5 @@ { GLib.Signal.Emit (this, "focus-event", gained); } + } +} diff --git a/atk/SelectionAdapter.custom b/atk/SelectionAdapter.cs similarity index 88% rename from atk/SelectionAdapter.custom rename to atk/SelectionAdapter.cs index 8e47f9683..b5dfebd6a 100644 --- a/atk/SelectionAdapter.custom +++ b/atk/SelectionAdapter.cs @@ -1,4 +1,4 @@ -// SelectionAdapter.custom - Atk SelectionAdapter class customizations +// SelectionAdapter.cs - Atk SelectionAdapter class customizations // // Author: Andrés G. Aragoneses // @@ -20,8 +20,13 @@ // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. - + +namespace Atk { + public partial class SelectionAdapter { + public void EmitSelectionChanged () { GLib.Signal.Emit (GLib.Object.GetObject (Handle), "selection_changed"); } + } +} diff --git a/atk/TextAdapter.custom b/atk/TextAdapter.cs similarity index 90% rename from atk/TextAdapter.custom rename to atk/TextAdapter.cs index a39ca5a12..5a1ae79aa 100644 --- a/atk/TextAdapter.custom +++ b/atk/TextAdapter.cs @@ -1,4 +1,4 @@ -// TextAdapter.custom - Atk TextAdapter class customizations +// TextAdapter.cs - Atk TextAdapter class customizations // // Author: Brad Taylor // @@ -20,10 +20,15 @@ // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. - + +namespace Atk { + public partial class TextAdapter { + public void EmitTextChanged (TextChangedDetail detail, int position, int length) { GLib.Signal.Emit (GLib.Object.GetObject (Handle), "text_changed::" + detail.ToString ().ToLower (), position, length); } + } +} diff --git a/atk/Util.custom b/atk/Util.cs similarity index 96% rename from atk/Util.custom rename to atk/Util.cs index c0f2cad9d..e8d8ba169 100644 --- a/atk/Util.custom +++ b/atk/Util.cs @@ -1,4 +1,4 @@ -// Util.custom - Atk Util class customizations +// Util.cs - Atk Util class customizations // // Author: Mike Kestner // @@ -21,6 +21,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Atk { + + using System; + using System.Runtime.InteropServices; + + public partial class Util { [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate uint AddGlobalEventListenerNativeDelegate (GLib.Signal.EmissionHookNative hook, IntPtr event_type); @@ -103,3 +109,5 @@ atksharp_util_override_remove_key_event_listener (remove_key_event_listener_callback); } } + } +}