Remove static glue code
This commit is contained in:
parent
e597d188e8
commit
90bbc67f3c
5 changed files with 172 additions and 572 deletions
|
@ -1,39 +0,0 @@
|
||||||
// Misc.cs - Atk Misc class customizations
|
|
||||||
//
|
|
||||||
// Author: Mike Kestner <mkestner@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.
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
public static void SetSingletonInstance (Misc misc)
|
|
||||||
{
|
|
||||||
atksharp_misc_set_singleton_instance (misc.Handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,113 +0,0 @@
|
||||||
// Util.cs - Atk Util class customizations
|
|
||||||
//
|
|
||||||
// Author: Mike Kestner <mkestner@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.
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
static AddGlobalEventListenerDelegate add_global_event_listener_handler;
|
|
||||||
static AddGlobalEventListenerNativeDelegate add_global_event_listener_callback;
|
|
||||||
|
|
||||||
static uint AddGlobalEventListenerCallback (GLib.Signal.EmissionHookNative hook, IntPtr event_type)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
return add_global_event_listener_handler (new GLib.Signal.EmissionHookMarshaler (hook, IntPtr.Zero).Invoker, GLib.Marshaller.Utf8PtrToString (event_type));
|
|
||||||
} catch (Exception e) {
|
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public delegate uint AddGlobalEventListenerDelegate (GLib.Signal.EmissionHook hook, string event_type);
|
|
||||||
|
|
||||||
[DllImport("atksharpglue-3")]
|
|
||||||
static extern void atksharp_util_override_add_global_event_listener (AddGlobalEventListenerNativeDelegate cb);
|
|
||||||
public static AddGlobalEventListenerDelegate AddGlobalEventListenerHandler {
|
|
||||||
set {
|
|
||||||
add_global_event_listener_handler = value;
|
|
||||||
if (add_global_event_listener_callback == null)
|
|
||||||
add_global_event_listener_callback = new AddGlobalEventListenerNativeDelegate (AddGlobalEventListenerCallback);
|
|
||||||
atksharp_util_override_add_global_event_listener (add_global_event_listener_callback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
||||||
delegate void RemoveListenerNativeDelegate (uint listener_id);
|
|
||||||
|
|
||||||
static RemoveListenerDelegate remove_global_event_listener_handler;
|
|
||||||
static RemoveListenerNativeDelegate remove_global_event_listener_callback;
|
|
||||||
|
|
||||||
static void RemoveGlobalEventListenerCallback (uint listener_id)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
remove_global_event_listener_handler (listener_id);
|
|
||||||
} catch (Exception e) {
|
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("atksharpglue-3")]
|
|
||||||
static extern void atksharp_util_override_remove_global_event_listener (RemoveListenerNativeDelegate cb);
|
|
||||||
|
|
||||||
public delegate void RemoveListenerDelegate (uint listener_id);
|
|
||||||
|
|
||||||
public static RemoveListenerDelegate RemoveGlobalEventListenerHandler {
|
|
||||||
set {
|
|
||||||
remove_global_event_listener_handler = value;
|
|
||||||
if (remove_global_event_listener_callback == null)
|
|
||||||
remove_global_event_listener_callback = new RemoveListenerNativeDelegate (RemoveGlobalEventListenerCallback);
|
|
||||||
atksharp_util_override_remove_global_event_listener (remove_global_event_listener_callback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static RemoveListenerDelegate remove_key_event_listener_handler;
|
|
||||||
static RemoveListenerNativeDelegate remove_key_event_listener_callback;
|
|
||||||
|
|
||||||
static void RemoveKeyEventListenerCallback (uint listener_id)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
remove_key_event_listener_handler (listener_id);
|
|
||||||
} catch (Exception e) {
|
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("atksharpglue-3")]
|
|
||||||
static extern void atksharp_util_override_remove_key_event_listener (RemoveListenerNativeDelegate cb);
|
|
||||||
|
|
||||||
public static RemoveListenerDelegate RemoveKeyEventListenerHandler {
|
|
||||||
set {
|
|
||||||
remove_key_event_listener_handler = value;
|
|
||||||
if (remove_key_event_listener_callback == null)
|
|
||||||
remove_key_event_listener_callback = new RemoveListenerNativeDelegate (RemoveKeyEventListenerCallback);
|
|
||||||
atksharp_util_override_remove_key_event_listener (remove_key_event_listener_callback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -52,57 +52,5 @@ namespace Gtk {
|
||||||
// TODO: Implement "nullable" attribute for value type parameters in GAPI
|
// TODO: Implement "nullable" attribute for value type parameters in GAPI
|
||||||
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate void OnGetSizeDelegate (IntPtr item, IntPtr widget, IntPtr cell_area_ptr, IntPtr x_offset, IntPtr y_offset, IntPtr width, IntPtr height);
|
delegate void OnGetSizeDelegate (IntPtr item, IntPtr widget, IntPtr cell_area_ptr, IntPtr x_offset, IntPtr y_offset, IntPtr width, IntPtr height);
|
||||||
|
|
||||||
static void OnGetSize_cb (IntPtr item, IntPtr widget, IntPtr cell_area_ptr, IntPtr x_offset, IntPtr y_offset, IntPtr width, IntPtr height)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
CellRenderer obj = GLib.Object.GetObject (item, false) as CellRenderer;
|
|
||||||
Gtk.Widget widg = GLib.Object.GetObject (widget, false) as Gtk.Widget;
|
|
||||||
Gdk.Rectangle cell_area = Gdk.Rectangle.Zero;
|
|
||||||
if (cell_area_ptr != IntPtr.Zero)
|
|
||||||
cell_area = Gdk.Rectangle.New (cell_area_ptr);
|
|
||||||
int a, b, c, d;
|
|
||||||
|
|
||||||
obj.OnGetSize (widg, ref cell_area, out a, out b, out c, out d);
|
|
||||||
if (x_offset != IntPtr.Zero)
|
|
||||||
Marshal.WriteInt32 (x_offset, a);
|
|
||||||
if (y_offset != IntPtr.Zero)
|
|
||||||
Marshal.WriteInt32 (y_offset, b);
|
|
||||||
if (width != IntPtr.Zero)
|
|
||||||
Marshal.WriteInt32 (width, c);
|
|
||||||
if (height != IntPtr.Zero)
|
|
||||||
Marshal.WriteInt32 (height, d);
|
|
||||||
} catch (Exception e) {
|
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("gtksharpglue-3")]
|
|
||||||
static extern void gtksharp_cellrenderer_override_get_size (IntPtr gtype, OnGetSizeDelegate cb);
|
|
||||||
|
|
||||||
static OnGetSizeDelegate OnGetSizeCallback;
|
|
||||||
static void OverrideOnGetSize (GLib.GType gtype)
|
|
||||||
{
|
|
||||||
if (OnGetSizeCallback == null)
|
|
||||||
OnGetSizeCallback = new OnGetSizeDelegate (OnGetSize_cb);
|
|
||||||
gtksharp_cellrenderer_override_get_size (gtype.Val, OnGetSizeCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
[GLib.DefaultSignalHandler (Type=typeof(Gtk.CellRenderer), ConnectionMethod="OverrideOnGetSize")]
|
|
||||||
protected virtual void OnGetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
|
|
||||||
{
|
|
||||||
InternalOnGetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("gtksharpglue-3")]
|
|
||||||
static extern void gtksharp_cellrenderer_base_get_size (IntPtr cell, IntPtr widget, IntPtr cell_area, out int x_offset, out int y_offset, out int width, out int height);
|
|
||||||
|
|
||||||
private void InternalOnGetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
|
|
||||||
{
|
|
||||||
IntPtr native_cell_area = GLib.Marshaller.StructureToPtrAlloc (cell_area);
|
|
||||||
gtksharp_cellrenderer_base_get_size (Handle, widget == null ? IntPtr.Zero : widget.Handle, native_cell_area, out x_offset, out y_offset, out width, out height);
|
|
||||||
cell_area = Gdk.Rectangle.New (native_cell_area);
|
|
||||||
Marshal.FreeHGlobal (native_cell_area);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
193
Source/Libs/GtkSharp/Container.cs
Executable file → Normal file
193
Source/Libs/GtkSharp/Container.cs
Executable file → Normal file
|
@ -18,23 +18,51 @@
|
||||||
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
// Boston, MA 02111-1307, USA.
|
// Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
namespace Gtk {
|
namespace Gtk
|
||||||
|
{
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
public partial class Container : IEnumerable {
|
public partial class Container : IEnumerable
|
||||||
|
{
|
||||||
|
[DllImport(Global.GtkNativeDll)]
|
||||||
|
static extern GParamSpec gtk_container_class_find_child_property (IntPtr cclass, string property_name);
|
||||||
|
|
||||||
[DllImport("gtksharpglue-3")]
|
[DllImport(Global.GtkNativeDll)]
|
||||||
static extern void gtksharp_container_child_get_property (IntPtr container, IntPtr child, IntPtr property, ref GLib.Value value);
|
static extern void gtk_container_child_get_property(IntPtr container, IntPtr child, string property_name, ref GLib.Value value);
|
||||||
|
|
||||||
public GLib.Value ChildGetProperty (Gtk.Widget child, string property_name) {
|
struct GTypeInstance
|
||||||
GLib.Value value = new GLib.Value ();
|
{
|
||||||
|
public IntPtr GTypeClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct GParamSpec
|
||||||
|
{
|
||||||
|
public GTypeInstance g_type_instance;
|
||||||
|
|
||||||
|
public IntPtr name;
|
||||||
|
public int flags;
|
||||||
|
public GLib.GType value_type;
|
||||||
|
public GLib.GType owner_type;
|
||||||
|
|
||||||
|
IntPtr _nick;
|
||||||
|
IntPtr _blurb;
|
||||||
|
IntPtr qdata;
|
||||||
|
uint ref_count;
|
||||||
|
uint param_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
public GLib.Value ChildGetProperty(Gtk.Widget child, string property_name)
|
||||||
|
{
|
||||||
|
var value = new GLib.Value();
|
||||||
|
var cclass = ((GTypeInstance)Marshal.PtrToStructure(Handle, typeof(GTypeInstance))).GTypeClass;
|
||||||
|
var prop = gtk_container_class_find_child_property(cclass, property_name);
|
||||||
|
|
||||||
|
value.Init(prop.value_type);
|
||||||
|
gtk_container_child_get_property(Handle, child.Handle, property_name, ref value);
|
||||||
|
|
||||||
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (property_name);
|
|
||||||
gtksharp_container_child_get_property (Handle, child.Handle, native, ref value);
|
|
||||||
GLib.Marshaller.Free (native);
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +71,8 @@ namespace Gtk {
|
||||||
return Children.GetEnumerator();
|
return Children.GetEnumerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChildAccumulator {
|
class ChildAccumulator
|
||||||
|
{
|
||||||
public ArrayList Children = new ArrayList();
|
public ArrayList Children = new ArrayList();
|
||||||
|
|
||||||
public void Add(Gtk.Widget widget)
|
public void Add(Gtk.Widget widget)
|
||||||
|
@ -52,8 +81,10 @@ namespace Gtk {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable AllChildren {
|
public IEnumerable AllChildren
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
ChildAccumulator acc = new ChildAccumulator();
|
ChildAccumulator acc = new ChildAccumulator();
|
||||||
Forall(new Gtk.Callback(acc.Add));
|
Forall(new Gtk.Callback(acc.Add));
|
||||||
return acc.Children;
|
return acc.Children;
|
||||||
|
@ -66,8 +97,10 @@ namespace Gtk {
|
||||||
[DllImport(Global.GtkNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(Global.GtkNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gtk_container_set_focus_chain(IntPtr raw, IntPtr list_ptr);
|
static extern void gtk_container_set_focus_chain(IntPtr raw, IntPtr list_ptr);
|
||||||
|
|
||||||
public Widget[] FocusChain {
|
public Widget[] FocusChain
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
IntPtr list_ptr;
|
IntPtr list_ptr;
|
||||||
bool success = gtk_container_get_focus_chain(Handle, out list_ptr);
|
bool success = gtk_container_get_focus_chain(Handle, out list_ptr);
|
||||||
if (!success)
|
if (!success)
|
||||||
|
@ -79,7 +112,8 @@ namespace Gtk {
|
||||||
result[i] = list[i] as Widget;
|
result[i] = list[i] as Widget;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
set {
|
set
|
||||||
|
{
|
||||||
GLib.List list = new GLib.List(IntPtr.Zero);
|
GLib.List list = new GLib.List(IntPtr.Zero);
|
||||||
foreach (Widget val in value)
|
foreach (Widget val in value)
|
||||||
list.Append(val.Handle);
|
list.Append(val.Handle);
|
||||||
|
@ -88,22 +122,14 @@ namespace Gtk {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("gtksharpglue-3")]
|
|
||||||
static extern void gtksharp_container_base_forall (IntPtr handle, bool include_internals, IntPtr cb, IntPtr data);
|
|
||||||
|
|
||||||
[DllImport("gtksharpglue-3")]
|
|
||||||
static extern void gtksharp_container_override_forall (IntPtr gtype, ForallDelegate cb);
|
|
||||||
|
|
||||||
[DllImport("gtksharpglue-3")]
|
|
||||||
static extern void gtksharp_container_invoke_gtk_callback (IntPtr cb, IntPtr handle, IntPtr data);
|
|
||||||
|
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate void ForallDelegate(IntPtr container, bool include_internals, IntPtr cb, IntPtr data);
|
delegate void ForallDelegate(IntPtr container, bool include_internals, IntPtr cb, IntPtr data);
|
||||||
|
|
||||||
static ForallDelegate ForallOldCallback;
|
static ForallDelegate ForallOldCallback;
|
||||||
static ForallDelegate ForallCallback;
|
static ForallDelegate ForallCallback;
|
||||||
|
|
||||||
public struct CallbackInvoker {
|
public struct CallbackInvoker
|
||||||
|
{
|
||||||
IntPtr cb;
|
IntPtr cb;
|
||||||
IntPtr data;
|
IntPtr data;
|
||||||
|
|
||||||
|
@ -113,101 +139,34 @@ namespace Gtk {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal IntPtr Data {
|
internal IntPtr Data
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal IntPtr Callback {
|
internal IntPtr Callback
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return cb;
|
return cb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Invoke (Widget w)
|
|
||||||
{
|
|
||||||
gtksharp_container_invoke_gtk_callback (cb, w.Handle, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ForallOld_cb (IntPtr container, bool include_internals, IntPtr cb, IntPtr data)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
//GtkContainer's unmanaged dispose calls forall, but by that time the managed object is gone
|
|
||||||
//so it couldn't do anything useful, and resurrecting it would cause a resurrection cycle.
|
|
||||||
//In that case, just chain to the native base in case it can do something.
|
|
||||||
Container obj = (Container) GLib.Object.TryGetObject (container);
|
|
||||||
if (obj != null) {
|
|
||||||
CallbackInvoker invoker = new CallbackInvoker (cb, data);
|
|
||||||
obj.ForAll (include_internals, invoker);
|
|
||||||
} else {
|
|
||||||
gtksharp_container_base_forall (container, include_internals, cb, data);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void OverrideForallOld (GLib.GType gtype)
|
|
||||||
{
|
|
||||||
if (ForallOldCallback == null)
|
|
||||||
ForallOldCallback = new ForallDelegate (ForallOld_cb);
|
|
||||||
gtksharp_container_override_forall (gtype.Val, ForallOldCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Obsolete ("Override the ForAll(bool,Gtk.Callback) method instead")]
|
|
||||||
[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideForallOld")]
|
|
||||||
protected virtual void ForAll (bool include_internals, CallbackInvoker invoker)
|
|
||||||
{
|
|
||||||
gtksharp_container_base_forall (Handle, include_internals, invoker.Callback, invoker.Data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Forall_cb (IntPtr container, bool include_internals, IntPtr cb, IntPtr data)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
//GtkContainer's unmanaged dispose calls forall, but by that time the managed object is gone
|
|
||||||
//so it couldn't do anything useful, and resurrecting it would cause a resurrection cycle.
|
|
||||||
//In that case, just chain to the native base in case it can do something.
|
|
||||||
Container obj = (Container) GLib.Object.TryGetObject (container);
|
|
||||||
if (obj != null) {
|
|
||||||
CallbackInvoker invoker = new CallbackInvoker (cb, data);
|
|
||||||
obj.ForAll (include_internals, new Gtk.Callback (invoker.Invoke));
|
|
||||||
} else {
|
|
||||||
gtksharp_container_base_forall (container, include_internals, cb, data);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void OverrideForall (GLib.GType gtype)
|
|
||||||
{
|
|
||||||
if (ForallCallback == null)
|
|
||||||
ForallCallback = new ForallDelegate (Forall_cb);
|
|
||||||
gtksharp_container_override_forall (gtype.Val, ForallCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideForall")]
|
|
||||||
protected virtual void ForAll (bool include_internals, Gtk.Callback callback)
|
|
||||||
{
|
|
||||||
CallbackInvoker invoker;
|
|
||||||
try {
|
|
||||||
invoker = (CallbackInvoker)callback.Target;
|
|
||||||
} catch {
|
|
||||||
throw new ApplicationException ("ForAll can only be called as \"base.ForAll()\". Use Forall() or Foreach().");
|
|
||||||
}
|
|
||||||
gtksharp_container_base_forall (Handle, include_internals, invoker.Callback, invoker.Data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compatibility code for old ChildType() virtual method
|
// Compatibility code for old ChildType() virtual method
|
||||||
static IntPtr ObsoleteChildType_cb(IntPtr raw)
|
static IntPtr ObsoleteChildType_cb(IntPtr raw)
|
||||||
{
|
{
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
Container obj = GLib.Object.GetObject(raw, false) as Container;
|
Container obj = GLib.Object.GetObject(raw, false) as Container;
|
||||||
GLib.GType gtype = obj.ChildType();
|
GLib.GType gtype = obj.ChildType();
|
||||||
return gtype.Val;
|
return gtype.Val;
|
||||||
} catch (Exception e) {
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
GLib.ExceptionManager.RaiseUnhandledException(e, false);
|
GLib.ExceptionManager.RaiseUnhandledException(e, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,11 +184,13 @@ namespace Gtk {
|
||||||
|
|
||||||
[Obsolete("Replaced by OnChildType for implementations and SupportedChildType for callers.")]
|
[Obsolete("Replaced by OnChildType for implementations and SupportedChildType for callers.")]
|
||||||
[GLib.DefaultSignalHandler(Type = typeof(Gtk.Container), ConnectionMethod = "OverrideObsoleteChildType")]
|
[GLib.DefaultSignalHandler(Type = typeof(Gtk.Container), ConnectionMethod = "OverrideObsoleteChildType")]
|
||||||
public virtual GLib.GType ChildType() {
|
public virtual GLib.GType ChildType()
|
||||||
|
{
|
||||||
return InternalChildType(); // -> autogenerated method
|
return InternalChildType(); // -> autogenerated method
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ContainerChild {
|
public class ContainerChild
|
||||||
|
{
|
||||||
protected Container parent;
|
protected Container parent;
|
||||||
protected Widget child;
|
protected Widget child;
|
||||||
|
|
||||||
|
@ -239,21 +200,27 @@ namespace Gtk {
|
||||||
this.child = child;
|
this.child = child;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Container Parent {
|
public Container Parent
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Widget Child {
|
public Widget Child
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual ContainerChild this [Widget w] {
|
public virtual ContainerChild this[Widget w]
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return new ContainerChild(this, w);
|
return new ContainerChild(this, w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,163 +0,0 @@
|
||||||
pkg = 'gtk'
|
|
||||||
assembly_name = pkg + '-sharp'
|
|
||||||
symbols = join_paths(meson.current_source_dir(), pkg + '-symbols.xml')
|
|
||||||
|
|
||||||
raw_api_fname = join_paths(meson.current_source_dir(), pkg + '-api.raw')
|
|
||||||
metadata = files('Gtk.metadata')
|
|
||||||
glueincludes = 'gtk/gtk.h'
|
|
||||||
gluefile = join_paths(meson.current_build_dir(), 'generate.c')
|
|
||||||
|
|
||||||
configure_file(input: assembly_name + '.dll.config.in',
|
|
||||||
output: assembly_name + '.dll.config',
|
|
||||||
configuration : remap_dl_data)
|
|
||||||
|
|
||||||
if install
|
|
||||||
configure_file(input: assembly_name + '-3.0.pc.in',
|
|
||||||
output: assembly_name + '-3.0.pc',
|
|
||||||
configuration : version_data,
|
|
||||||
install_dir: pkg_install_dir)
|
|
||||||
endif
|
|
||||||
|
|
||||||
subdir('generated')
|
|
||||||
|
|
||||||
sources = [
|
|
||||||
'Accel.cs',
|
|
||||||
'AccelKey.cs',
|
|
||||||
'Action.cs',
|
|
||||||
'ActionEntry.cs',
|
|
||||||
'ActionGroup.cs',
|
|
||||||
'Adjustment.cs',
|
|
||||||
'Application.cs',
|
|
||||||
'ArrayExtensions.cs',
|
|
||||||
'Bin.cs',
|
|
||||||
'BindingAttribute.cs',
|
|
||||||
'Builder.cs',
|
|
||||||
'Button.cs',
|
|
||||||
'Calendar.cs',
|
|
||||||
'CellAreaBox.cs',
|
|
||||||
'CellLayoutAdapter.cs',
|
|
||||||
'CellRenderer.cs',
|
|
||||||
'CellView.cs',
|
|
||||||
'CheckMenuItem.cs',
|
|
||||||
'ChildPropertyAttribute.cs',
|
|
||||||
'Clipboard.cs',
|
|
||||||
'ColorSelection.cs',
|
|
||||||
'ComboBox.cs',
|
|
||||||
'ComboBoxText.cs',
|
|
||||||
'Container.cs',
|
|
||||||
'Dialog.cs',
|
|
||||||
'Drag.cs',
|
|
||||||
'Entry.cs',
|
|
||||||
'EntryCompletion.cs',
|
|
||||||
'FileChooserDialog.cs',
|
|
||||||
'FileChooserNative.cs',
|
|
||||||
'Frame.cs',
|
|
||||||
'Global.cs',
|
|
||||||
'HBox.cs',
|
|
||||||
'HScale.cs',
|
|
||||||
'ICellLayout.cs',
|
|
||||||
'IconFactory.cs',
|
|
||||||
'IconSet.cs',
|
|
||||||
'IconTheme.cs',
|
|
||||||
'IconView.cs',
|
|
||||||
'Image.cs',
|
|
||||||
'ImageMenuItem.cs',
|
|
||||||
'Init.cs',
|
|
||||||
'ITreeModel.cs',
|
|
||||||
'ITreeNode.cs',
|
|
||||||
'Key.cs',
|
|
||||||
'Label.cs',
|
|
||||||
'ListStore.cs',
|
|
||||||
'Menu.cs',
|
|
||||||
'MenuItem.cs',
|
|
||||||
'MessageDialog.cs',
|
|
||||||
'NativeDialog.cs',
|
|
||||||
'NodeCellDataFunc.cs',
|
|
||||||
'NodeSelection.cs',
|
|
||||||
'NodeStore.cs',
|
|
||||||
'NodeView.cs',
|
|
||||||
'Notebook.cs',
|
|
||||||
'PaperSize.cs',
|
|
||||||
'Plug.cs',
|
|
||||||
'Printer.cs',
|
|
||||||
'RadioAction.cs',
|
|
||||||
'RadioActionEntry.cs',
|
|
||||||
'RadioButton.cs',
|
|
||||||
'RadioMenuItem.cs',
|
|
||||||
'RadioToolButton.cs',
|
|
||||||
'RecentManager.cs',
|
|
||||||
'RowsReorderedHandler.cs',
|
|
||||||
'ScrolledWindow.cs',
|
|
||||||
'SelectionData.cs',
|
|
||||||
'Settings.cs',
|
|
||||||
'SpinButton.cs',
|
|
||||||
'StatusIcon.cs',
|
|
||||||
'Stock.cs',
|
|
||||||
'StockItem.cs',
|
|
||||||
'StockManager.cs',
|
|
||||||
'Style.cs',
|
|
||||||
'StyleContext.cs',
|
|
||||||
'StyleProviderPriority.cs',
|
|
||||||
'Target.cs',
|
|
||||||
'TargetEntry.cs',
|
|
||||||
'TargetList.cs',
|
|
||||||
'TextAttributes.cs',
|
|
||||||
'TextBuffer.cs',
|
|
||||||
'TextChildAnchor.cs',
|
|
||||||
'TextIter.cs',
|
|
||||||
'TextMark.cs',
|
|
||||||
'TextTag.cs',
|
|
||||||
'TextView.cs',
|
|
||||||
'ThreadNotify.cs',
|
|
||||||
'ToggleActionEntry.cs',
|
|
||||||
'TreeEnumerator.cs',
|
|
||||||
'TreeIter.cs',
|
|
||||||
'TreeMenu.cs',
|
|
||||||
'TreeModelAdapter.cs',
|
|
||||||
'TreeModelFilter.cs',
|
|
||||||
'TreeModelSort.cs',
|
|
||||||
'TreeNode.cs',
|
|
||||||
'TreeNodeAttribute.cs',
|
|
||||||
'TreeNodeValueAttribute.cs',
|
|
||||||
'TreePath.cs',
|
|
||||||
'TreeSelection.cs',
|
|
||||||
'TreeStore.cs',
|
|
||||||
'TreeView.cs',
|
|
||||||
'TreeViewColumn.cs',
|
|
||||||
'UIManager.cs',
|
|
||||||
'VBox.cs',
|
|
||||||
'Viewport.cs',
|
|
||||||
'VScale.cs',
|
|
||||||
'Widget.cs',
|
|
||||||
'Window.cs',
|
|
||||||
]
|
|
||||||
|
|
||||||
deps = [glib_sharp, pango_sharp, cairo_sharp, gio_sharp, atk_sharp, gdk_sharp]
|
|
||||||
gtk_sharp = library(assembly_name, source_gen, sources, assemblyinfo,
|
|
||||||
cs_args: ['-unsafe', '-nowarn:0618,0612,0169'],
|
|
||||||
link_with: deps,
|
|
||||||
install: install,
|
|
||||||
install_dir: lib_install_dir
|
|
||||||
)
|
|
||||||
|
|
||||||
nuget_infos += [['GtkSharp', gtk_sharp, ['GlibSharp', 'GioSharp',
|
|
||||||
'AtkSharp', 'GdkSharp']]]
|
|
||||||
install_infos += [assembly_name, gtk_sharp.full_path()]
|
|
||||||
gtk_sharp_dep = declare_dependency(link_with: deps + [gtk_sharp])
|
|
||||||
|
|
||||||
if add_languages('c', required: false) and csc.get_id() == 'mono'
|
|
||||||
c_abi_exe = executable(assembly_name + '_c_abi', c_abi,
|
|
||||||
c_args: ['-Wno-deprecated', '-Wno-deprecated-declarations'],
|
|
||||||
dependencies: [glib_dep, gio_dep, atk_dep, gdk_dep, gtk_dep])
|
|
||||||
|
|
||||||
cs_abi_exe = executable(assembly_name + '_cs_abi', cs_abi,
|
|
||||||
cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-nowarn:0618', '-unsafe'],
|
|
||||||
dependencies: [gtk_sharp_dep])
|
|
||||||
|
|
||||||
env = environment()
|
|
||||||
env.prepend('MONO_PATH', mono_path)
|
|
||||||
test(assembly_name + 'abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()],
|
|
||||||
env: env)
|
|
||||||
else
|
|
||||||
message('Not running tests ' + csc.get_id())
|
|
||||||
endif
|
|
Loading…
Reference in a new issue