2008-03-28 11:02:39 +00:00
|
|
|
// Object.custom - Atk Object class customizations
|
|
|
|
//
|
|
|
|
// Author: Andres G. Aragoneses <aaragoneses@novell.com>
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
[DllImport("atksharpglue-2")]
|
2008-05-07 12:49:37 +00:00
|
|
|
static extern void atksharp_object_override_get_n_children (IntPtr type, NChildrenDelegate cb);
|
2008-03-28 11:02:39 +00:00
|
|
|
|
|
|
|
[GLib.CDeclCallback]
|
|
|
|
delegate int NChildrenDelegate (IntPtr raw);
|
|
|
|
|
|
|
|
static NChildrenDelegate NChildrenCallback;
|
|
|
|
|
|
|
|
static int NChildren_cb (IntPtr raw)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Atk.Object obj = GLib.Object.GetObject (raw, false) as Atk.Object;
|
2008-06-06 14:56:01 +00:00
|
|
|
return obj.OnGetNChildren ();
|
2008-03-28 11:02:39 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void OverrideNChildren (GLib.GType gtype)
|
|
|
|
{
|
|
|
|
if (NChildrenCallback == null)
|
|
|
|
NChildrenCallback = new NChildrenDelegate (NChildren_cb);
|
|
|
|
atksharp_object_override_get_n_children (gtype.Val, NChildrenCallback);
|
|
|
|
}
|
|
|
|
|
|
|
|
[GLib.DefaultSignalHandler (Type=typeof(Atk.Object), ConnectionMethod="OverrideNChildren")]
|
|
|
|
protected virtual int OnGetNChildren() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[DllImport("atksharpglue-2")]
|
2008-05-07 12:49:37 +00:00
|
|
|
static extern void atksharp_object_override_ref_child (IntPtr type, RefChildDelegate cb);
|
2008-03-28 11:02:39 +00:00
|
|
|
|
|
|
|
[GLib.CDeclCallback]
|
|
|
|
delegate IntPtr RefChildDelegate (IntPtr raw, int i);
|
|
|
|
|
|
|
|
static RefChildDelegate RefChildCallback;
|
|
|
|
|
2008-04-04 05:00:42 +00:00
|
|
|
[DllImport("libgobject-2.0-0.dll")]
|
|
|
|
static extern IntPtr g_object_ref (IntPtr handle);
|
|
|
|
|
2008-03-28 11:02:39 +00:00
|
|
|
static IntPtr RefChild_cb (IntPtr raw, int i)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Atk.Object obj = GLib.Object.GetObject (raw, false) as Atk.Object;
|
2008-04-04 05:00:42 +00:00
|
|
|
Atk.Object child = obj.OnRefChild (i);
|
|
|
|
if (child != null)
|
|
|
|
g_object_ref (child.Handle);
|
|
|
|
return child == null ? IntPtr.Zero : child.Handle;
|
2008-03-28 11:02:39 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
|
|
}
|
|
|
|
|
2008-04-04 05:00:42 +00:00
|
|
|
return IntPtr.Zero;
|
2008-03-28 11:02:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void OverrideRefChild (GLib.GType gtype)
|
|
|
|
{
|
|
|
|
if (RefChildCallback == null)
|
|
|
|
RefChildCallback = new RefChildDelegate (RefChild_cb);
|
|
|
|
atksharp_object_override_ref_child (gtype.Val, RefChildCallback);
|
|
|
|
}
|
|
|
|
|
|
|
|
[GLib.DefaultSignalHandler (Type=typeof(Atk.Object), ConnectionMethod="OverrideRefChild")]
|
2008-06-06 14:56:01 +00:00
|
|
|
protected virtual Atk.Object OnRefChild (int i) {
|
2008-03-28 11:02:39 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2008-04-24 17:11:11 +00:00
|
|
|
protected void EmitChildrenChanged (ChildrenChangedDetail detail, uint child_index, Atk.Object child)
|
|
|
|
{
|
2008-05-14 16:03:13 +00:00
|
|
|
GLib.Signal.Emit (this,
|
|
|
|
"children-changed::" + detail.ToString ().ToLower (),
|
2008-10-24 22:11:46 +00:00
|
|
|
child_index, child.Handle);
|
2008-04-24 17:11:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected enum ChildrenChangedDetail
|
|
|
|
{
|
|
|
|
Add,
|
|
|
|
Remove
|
|
|
|
}
|
2008-08-19 22:00:33 +00:00
|
|
|
|
|
|
|
protected void EmitVisibleDataChanged ()
|
|
|
|
{
|
|
|
|
GLib.Signal.Emit (this, "visible-data-changed");
|
|
|
|
}
|
2008-06-06 14:56:01 +00:00
|
|
|
|
|
|
|
[DllImport("atksharpglue-2")]
|
|
|
|
static extern void atksharp_object_override_ref_state_set (IntPtr type, RefStateSetDelegate cb);
|
|
|
|
|
|
|
|
[DllImport("atksharpglue-2")]
|
2008-06-16 18:03:28 +00:00
|
|
|
static extern IntPtr atksharp_object_base_ref_state_set (IntPtr atk_obj);
|
2008-06-06 14:56:01 +00:00
|
|
|
|
|
|
|
[GLib.CDeclCallback]
|
|
|
|
delegate IntPtr RefStateSetDelegate (IntPtr raw);
|
|
|
|
|
|
|
|
static RefStateSetDelegate RefStateSetCallback;
|
|
|
|
|
|
|
|
static IntPtr RefStateSet_cb (IntPtr raw)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Atk.Object obj = GLib.Object.GetObject (raw, false) as Atk.Object;
|
|
|
|
Atk.StateSet state_set = obj.OnRefStateSet ();
|
|
|
|
if (state_set != null)
|
|
|
|
g_object_ref (state_set.Handle);
|
|
|
|
return state_set == null ? IntPtr.Zero : state_set.Handle;
|
|
|
|
} catch (Exception e) {
|
|
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
return IntPtr.Zero;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void OverrideRefStateSet (GLib.GType gtype)
|
|
|
|
{
|
|
|
|
if (RefStateSetCallback == null)
|
|
|
|
RefStateSetCallback = new RefStateSetDelegate (RefStateSet_cb);
|
|
|
|
atksharp_object_override_ref_state_set (gtype.Val, RefStateSetCallback);
|
|
|
|
}
|
|
|
|
|
|
|
|
[GLib.DefaultSignalHandler (Type=typeof(Atk.Object), ConnectionMethod="OverrideRefStateSet")]
|
2008-06-06 15:46:24 +00:00
|
|
|
protected virtual Atk.StateSet OnRefStateSet ()
|
|
|
|
{
|
2008-06-16 18:03:28 +00:00
|
|
|
IntPtr raw = atksharp_object_base_ref_state_set (Handle);
|
2008-06-06 15:46:24 +00:00
|
|
|
return GLib.Object.GetObject (raw, true) as StateSet;
|
2008-06-06 14:56:01 +00:00
|
|
|
}
|
2008-06-06 15:06:29 +00:00
|
|
|
|
2008-09-12 19:47:38 +00:00
|
|
|
[DllImport("atksharpglue-2")]
|
|
|
|
static extern void atksharp_object_override_get_index_in_parent (IntPtr type, IndexInParentDelegate cb);
|
|
|
|
|
|
|
|
[GLib.CDeclCallback]
|
|
|
|
delegate int IndexInParentDelegate (IntPtr raw);
|
2008-06-09 16:12:03 +00:00
|
|
|
|
2008-09-12 19:47:38 +00:00
|
|
|
static IndexInParentDelegate IndexInParentCallback;
|
|
|
|
|
|
|
|
static int IndexInParent_cb (IntPtr raw)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Atk.Object obj = GLib.Object.GetObject (raw, false) as Atk.Object;
|
|
|
|
return obj.OnGetIndexInParent ();
|
|
|
|
} catch (Exception e) {
|
|
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void OverrideIndexInParent (GLib.GType gtype)
|
|
|
|
{
|
|
|
|
if (IndexInParentCallback == null)
|
|
|
|
IndexInParentCallback = new IndexInParentDelegate (IndexInParent_cb);
|
|
|
|
atksharp_object_override_get_index_in_parent (gtype.Val, IndexInParentCallback);
|
|
|
|
}
|
|
|
|
|
|
|
|
[GLib.DefaultSignalHandler (Type=typeof(Atk.Object), ConnectionMethod="OverrideIndexInParent")]
|
|
|
|
protected virtual int OnGetIndexInParent() {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2008-09-23 13:59:30 +00:00
|
|
|
public void NotifyStateChange (Atk.StateType state, bool value) {
|
|
|
|
NotifyStateChange ((ulong)state, value);
|
|
|
|
}
|
2008-09-12 19:47:38 +00:00
|
|
|
|
2008-11-04 20:17:00 +00:00
|
|
|
[DllImport("atksharpglue-2")]
|
|
|
|
static extern void atksharp_object_override_ref_relation_set (IntPtr type, RefRelationSetDelegate cb);
|
|
|
|
|
|
|
|
[DllImport("atksharpglue-2")]
|
|
|
|
static extern IntPtr atksharp_object_base_ref_relation_set (IntPtr atk_obj);
|
|
|
|
|
|
|
|
[GLib.CDeclCallback]
|
|
|
|
delegate IntPtr RefRelationSetDelegate (IntPtr raw);
|
|
|
|
|
|
|
|
static RefRelationSetDelegate RefRelationSetCallback;
|
|
|
|
|
|
|
|
static IntPtr RefRelationSet_cb (IntPtr raw)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Atk.Object obj = GLib.Object.GetObject (raw, false) as Atk.Object;
|
|
|
|
Atk.RelationSet relation_set = obj.OnRefRelationSet ();
|
|
|
|
if (relation_set != null)
|
|
|
|
g_object_ref (relation_set.Handle);
|
|
|
|
return relation_set == null ? IntPtr.Zero : relation_set.Handle;
|
|
|
|
} catch (Exception e) {
|
|
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
return IntPtr.Zero;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void OverrideRefRelationSet (GLib.GType gtype)
|
|
|
|
{
|
|
|
|
if (RefRelationSetCallback == null)
|
|
|
|
RefRelationSetCallback = new RefRelationSetDelegate (RefRelationSet_cb);
|
|
|
|
atksharp_object_override_ref_relation_set (gtype.Val, RefRelationSetCallback);
|
|
|
|
}
|
|
|
|
|
|
|
|
[GLib.DefaultSignalHandler (Type=typeof(Atk.Object), ConnectionMethod="OverrideRefRelationSet")]
|
|
|
|
protected virtual Atk.RelationSet OnRefRelationSet ()
|
|
|
|
{
|
|
|
|
IntPtr raw = atksharp_object_base_ref_relation_set (Handle);
|
|
|
|
return GLib.Object.GetObject (raw, true) as RelationSet;
|
|
|
|
}
|
|
|
|
|