diff --git a/ChangeLog b/ChangeLog index 398f5f51e..55e2b61d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-19 Brad Taylor + + * atk/Object.custom: Add method to allow emission of + visible-data-changed signal. + + * atk/TextChangedDetail.cs: + * atk/TextAdapter.custom: Add method to allow emission of text-changed + signal. + 2008-08-13 Mike Kestner * atk/Atk.metadata: switch Value methods to ref params since atk diff --git a/atk/Makefile.am b/atk/Makefile.am index bf94b8035..8b7ea6379 100644 --- a/atk/Makefile.am +++ b/atk/Makefile.am @@ -5,12 +5,14 @@ METADATA = Atk.metadata SYMBOLS = references = ../glib/glib-sharp.dll -sources = +sources = \ + TextChangedDetail.cs customs = \ Global.custom \ Misc.custom \ Object.custom \ + TextAdapter.custom \ Util.custom add_dist = diff --git a/atk/Object.custom b/atk/Object.custom index f56ae6842..67447c1ba 100644 --- a/atk/Object.custom +++ b/atk/Object.custom @@ -104,7 +104,11 @@ Add, Remove } - + + protected void EmitVisibleDataChanged () + { + GLib.Signal.Emit (this, "visible-data-changed"); + } [DllImport("atksharpglue-2")] static extern void atksharp_object_override_ref_state_set (IntPtr type, RefStateSetDelegate cb); diff --git a/atk/TextAdapter.custom b/atk/TextAdapter.custom new file mode 100644 index 000000000..a39ca5a12 --- /dev/null +++ b/atk/TextAdapter.custom @@ -0,0 +1,29 @@ +// TextAdapter.custom - Atk TextAdapter class customizations +// +// Author: Brad Taylor +// +// Copyright (c) 2008 Novell, Inc. +// +// This code is inserted after the automatically generated code. +// +// +// 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. + + 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/TextChangedDetail.cs b/atk/TextChangedDetail.cs new file mode 100644 index 000000000..8b1de132d --- /dev/null +++ b/atk/TextChangedDetail.cs @@ -0,0 +1,26 @@ +// TextChangedDetail.cs - Detail enumeration for the TextChanged signal +// +// Authors: Brad Taylor +// +// Copyright (c) 2008 Novell, Inc. +// +// 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. + +namespace Atk { + public enum TextChangedDetail { + Insert, + Delete + } +} diff --git a/glib/Value.cs b/glib/Value.cs index b5ac589f0..d474bd463 100755 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -380,6 +380,8 @@ namespace GLib { return (GLib.Object) this; else if (g_type_is_a (type, GType.Boxed.Val)) return ToBoxed (); + else if (type == IntPtr.Zero) + return null; else throw new Exception ("Unknown type " + new GType (type).ToString ()); }