535 lines
23 KiB
C#
535 lines
23 KiB
C#
|
|
// This file was generated by the Gtk# code generator.
|
||
|
|
// Any changes made will be lost if regenerated.
|
||
|
|
|
||
|
|
namespace GLib {
|
||
|
|
|
||
|
|
using System;
|
||
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using System.Runtime.InteropServices;
|
||
|
|
using static GLib.AbiStructExtension;
|
||
|
|
|
||
|
|
#region Autogenerated code
|
||
|
|
public partial class SimpleActionGroup : GLib.Object, GLib.IActionGroup, GLib.IActionMap {
|
||
|
|
|
||
|
|
public SimpleActionGroup (IntPtr raw) : base(raw) {}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_simple_action_group_new();
|
||
|
|
static d_g_simple_action_group_new g_simple_action_group_new = FuncLoader.LoadFunction<d_g_simple_action_group_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_simple_action_group_new"));
|
||
|
|
|
||
|
|
public SimpleActionGroup () : base (IntPtr.Zero)
|
||
|
|
{
|
||
|
|
if (GetType () != typeof (SimpleActionGroup)) {
|
||
|
|
CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
Raw = g_simple_action_group_new();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// Internal representation of the wrapped structure ABI.
|
||
|
|
static GLib.AbiStruct _class_abi = null;
|
||
|
|
static public unsafe new GLib.AbiStruct class_abi {
|
||
|
|
get {
|
||
|
|
if (_class_abi == null)
|
||
|
|
_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{
|
||
|
|
new GLib.AbiField("padding"
|
||
|
|
, GLib.Object.class_abi.Fields
|
||
|
|
, (uint) sizeof( IntPtr ) * 12 // padding
|
||
|
|
, null
|
||
|
|
, null
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
});
|
||
|
|
|
||
|
|
return _class_abi;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// End of the ABI representation.
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_simple_action_group_get_type();
|
||
|
|
static d_g_simple_action_group_get_type g_simple_action_group_get_type = FuncLoader.LoadFunction<d_g_simple_action_group_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_simple_action_group_get_type"));
|
||
|
|
|
||
|
|
public static new GLib.GType GType {
|
||
|
|
get {
|
||
|
|
IntPtr raw_ret = g_simple_action_group_get_type();
|
||
|
|
GLib.GType ret = new GLib.GType(raw_ret);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_action_group_action_added(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_group_action_added g_action_group_action_added = FuncLoader.LoadFunction<d_g_action_group_action_added>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_action_added"));
|
||
|
|
|
||
|
|
public void EmitActionAdded(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
g_action_group_action_added(Handle, native_action_name);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_action_group_action_enabled_changed(IntPtr raw, IntPtr action_name, bool enabled);
|
||
|
|
static d_g_action_group_action_enabled_changed g_action_group_action_enabled_changed = FuncLoader.LoadFunction<d_g_action_group_action_enabled_changed>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_action_enabled_changed"));
|
||
|
|
|
||
|
|
public void EmitActionEnabledChanged(string action_name, bool enabled) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
g_action_group_action_enabled_changed(Handle, native_action_name, enabled);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_action_group_action_removed(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_group_action_removed g_action_group_action_removed = FuncLoader.LoadFunction<d_g_action_group_action_removed>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_action_removed"));
|
||
|
|
|
||
|
|
public void EmitActionRemoved(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
g_action_group_action_removed(Handle, native_action_name);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_action_group_action_state_changed(IntPtr raw, IntPtr action_name, IntPtr state);
|
||
|
|
static d_g_action_group_action_state_changed g_action_group_action_state_changed = FuncLoader.LoadFunction<d_g_action_group_action_state_changed>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_action_state_changed"));
|
||
|
|
|
||
|
|
public void EmitActionStateChanged(string action_name, GLib.Variant state) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
g_action_group_action_state_changed(Handle, native_action_name, state == null ? IntPtr.Zero : state.Handle);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_action_group_activate_action(IntPtr raw, IntPtr action_name, IntPtr parameter);
|
||
|
|
static d_g_action_group_activate_action g_action_group_activate_action = FuncLoader.LoadFunction<d_g_action_group_activate_action>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_activate_action"));
|
||
|
|
|
||
|
|
public void ActivateAction(string action_name, GLib.Variant parameter) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
g_action_group_activate_action(Handle, native_action_name, parameter == null ? IntPtr.Zero : parameter.Handle);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_action_group_change_action_state(IntPtr raw, IntPtr action_name, IntPtr value);
|
||
|
|
static d_g_action_group_change_action_state g_action_group_change_action_state = FuncLoader.LoadFunction<d_g_action_group_change_action_state>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_change_action_state"));
|
||
|
|
|
||
|
|
public void ChangeActionState(string action_name, GLib.Variant value) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
g_action_group_change_action_state(Handle, native_action_name, value == null ? IntPtr.Zero : value.Handle);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_action_group_get_action_enabled(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_group_get_action_enabled g_action_group_get_action_enabled = FuncLoader.LoadFunction<d_g_action_group_get_action_enabled>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_get_action_enabled"));
|
||
|
|
|
||
|
|
public bool GetActionEnabled(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
bool raw_ret = g_action_group_get_action_enabled(Handle, native_action_name);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_action_group_get_action_parameter_type(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_group_get_action_parameter_type g_action_group_get_action_parameter_type = FuncLoader.LoadFunction<d_g_action_group_get_action_parameter_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_get_action_parameter_type"));
|
||
|
|
|
||
|
|
public GLib.VariantType GetActionParameterType(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
IntPtr raw_ret = g_action_group_get_action_parameter_type(Handle, native_action_name);
|
||
|
|
GLib.VariantType ret = new GLib.VariantType(raw_ret);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_action_group_get_action_state(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_group_get_action_state g_action_group_get_action_state = FuncLoader.LoadFunction<d_g_action_group_get_action_state>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_get_action_state"));
|
||
|
|
|
||
|
|
public GLib.Variant GetActionState(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
IntPtr raw_ret = g_action_group_get_action_state(Handle, native_action_name);
|
||
|
|
GLib.Variant ret = new GLib.Variant(raw_ret);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_action_group_get_action_state_hint(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_group_get_action_state_hint g_action_group_get_action_state_hint = FuncLoader.LoadFunction<d_g_action_group_get_action_state_hint>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_get_action_state_hint"));
|
||
|
|
|
||
|
|
public GLib.Variant GetActionStateHint(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
IntPtr raw_ret = g_action_group_get_action_state_hint(Handle, native_action_name);
|
||
|
|
GLib.Variant ret = new GLib.Variant(raw_ret);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_action_group_get_action_state_type(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_group_get_action_state_type g_action_group_get_action_state_type = FuncLoader.LoadFunction<d_g_action_group_get_action_state_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_get_action_state_type"));
|
||
|
|
|
||
|
|
public GLib.VariantType GetActionStateType(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
IntPtr raw_ret = g_action_group_get_action_state_type(Handle, native_action_name);
|
||
|
|
GLib.VariantType ret = new GLib.VariantType(raw_ret);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_action_group_has_action(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_group_has_action g_action_group_has_action = FuncLoader.LoadFunction<d_g_action_group_has_action>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_has_action"));
|
||
|
|
|
||
|
|
public bool HasAction(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
bool raw_ret = g_action_group_has_action(Handle, native_action_name);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_action_group_list_actions(IntPtr raw);
|
||
|
|
static d_g_action_group_list_actions g_action_group_list_actions = FuncLoader.LoadFunction<d_g_action_group_list_actions>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_list_actions"));
|
||
|
|
|
||
|
|
public string[] ListActions() {
|
||
|
|
IntPtr raw_ret = g_action_group_list_actions(Handle);
|
||
|
|
string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, true);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_action_group_query_action(IntPtr raw, IntPtr action_name, out bool enabled, IntPtr parameter_type, IntPtr state_type, IntPtr state_hint, IntPtr state);
|
||
|
|
static d_g_action_group_query_action g_action_group_query_action = FuncLoader.LoadFunction<d_g_action_group_query_action>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_query_action"));
|
||
|
|
|
||
|
|
public bool QueryAction(string action_name, out bool enabled, GLib.VariantType parameter_type, GLib.VariantType state_type, GLib.Variant state_hint, GLib.Variant state) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
bool raw_ret = g_action_group_query_action(Handle, native_action_name, out enabled, parameter_type == null ? IntPtr.Zero : parameter_type.Handle, state_type == null ? IntPtr.Zero : state_type.Handle, state_hint == null ? IntPtr.Zero : state_hint.Handle, state == null ? IntPtr.Zero : state.Handle);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.Signal("action-state-changed")]
|
||
|
|
public event GLib.ActionStateChangedHandler ActionStateChanged {
|
||
|
|
add {
|
||
|
|
this.AddSignalHandler ("action-state-changed", value, typeof (GLib.ActionStateChangedArgs));
|
||
|
|
}
|
||
|
|
remove {
|
||
|
|
this.RemoveSignalHandler ("action-state-changed", value);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.Signal("action-removed")]
|
||
|
|
public event GLib.ActionRemovedHandler ActionRemoved {
|
||
|
|
add {
|
||
|
|
this.AddSignalHandler ("action-removed", value, typeof (GLib.ActionRemovedArgs));
|
||
|
|
}
|
||
|
|
remove {
|
||
|
|
this.RemoveSignalHandler ("action-removed", value);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.Signal("action-added")]
|
||
|
|
public event GLib.ActionAddedHandler ActionAdded {
|
||
|
|
add {
|
||
|
|
this.AddSignalHandler ("action-added", value, typeof (GLib.ActionAddedArgs));
|
||
|
|
}
|
||
|
|
remove {
|
||
|
|
this.RemoveSignalHandler ("action-added", value);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.Signal("action-enabled-changed")]
|
||
|
|
public event GLib.ActionEnabledChangedHandler ActionEnabledChanged {
|
||
|
|
add {
|
||
|
|
this.AddSignalHandler ("action-enabled-changed", value, typeof (GLib.ActionEnabledChangedArgs));
|
||
|
|
}
|
||
|
|
remove {
|
||
|
|
this.RemoveSignalHandler ("action-enabled-changed", value);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static ActionAddedNativeDelegate ActionAdded_cb_delegate;
|
||
|
|
static ActionAddedNativeDelegate ActionAddedVMCallback {
|
||
|
|
get {
|
||
|
|
if (ActionAdded_cb_delegate == null)
|
||
|
|
ActionAdded_cb_delegate = new ActionAddedNativeDelegate (ActionAdded_cb);
|
||
|
|
return ActionAdded_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideActionAdded (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideActionAdded (gtype, ActionAddedVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideActionAdded (GLib.GType gtype, ActionAddedNativeDelegate callback)
|
||
|
|
{
|
||
|
|
OverrideVirtualMethod (gtype, "action-added", callback);
|
||
|
|
}
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void ActionAddedNativeDelegate (IntPtr inst, IntPtr action_name);
|
||
|
|
|
||
|
|
static void ActionAdded_cb (IntPtr inst, IntPtr action_name)
|
||
|
|
{
|
||
|
|
try {
|
||
|
|
GLib.SimpleActionGroup __obj = GLib.Object.GetObject (inst, false) as GLib.SimpleActionGroup;
|
||
|
|
__obj.OnActionAdded (GLib.Marshaller.Utf8PtrToString (action_name));
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.SimpleActionGroup), ConnectionMethod="OverrideActionAdded")]
|
||
|
|
protected virtual void OnActionAdded (string action_name)
|
||
|
|
{
|
||
|
|
InternalActionAdded (action_name);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void InternalActionAdded (string action_name)
|
||
|
|
{
|
||
|
|
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 (action_name);
|
||
|
|
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 ();
|
||
|
|
}
|
||
|
|
|
||
|
|
static ActionRemovedNativeDelegate ActionRemoved_cb_delegate;
|
||
|
|
static ActionRemovedNativeDelegate ActionRemovedVMCallback {
|
||
|
|
get {
|
||
|
|
if (ActionRemoved_cb_delegate == null)
|
||
|
|
ActionRemoved_cb_delegate = new ActionRemovedNativeDelegate (ActionRemoved_cb);
|
||
|
|
return ActionRemoved_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideActionRemoved (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideActionRemoved (gtype, ActionRemovedVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideActionRemoved (GLib.GType gtype, ActionRemovedNativeDelegate callback)
|
||
|
|
{
|
||
|
|
OverrideVirtualMethod (gtype, "action-removed", callback);
|
||
|
|
}
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void ActionRemovedNativeDelegate (IntPtr inst, IntPtr action_name);
|
||
|
|
|
||
|
|
static void ActionRemoved_cb (IntPtr inst, IntPtr action_name)
|
||
|
|
{
|
||
|
|
try {
|
||
|
|
GLib.SimpleActionGroup __obj = GLib.Object.GetObject (inst, false) as GLib.SimpleActionGroup;
|
||
|
|
__obj.OnActionRemoved (GLib.Marshaller.Utf8PtrToString (action_name));
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.SimpleActionGroup), ConnectionMethod="OverrideActionRemoved")]
|
||
|
|
protected virtual void OnActionRemoved (string action_name)
|
||
|
|
{
|
||
|
|
InternalActionRemoved (action_name);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void InternalActionRemoved (string action_name)
|
||
|
|
{
|
||
|
|
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 (action_name);
|
||
|
|
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 ();
|
||
|
|
}
|
||
|
|
|
||
|
|
static ActionEnabledChangedNativeDelegate ActionEnabledChanged_cb_delegate;
|
||
|
|
static ActionEnabledChangedNativeDelegate ActionEnabledChangedVMCallback {
|
||
|
|
get {
|
||
|
|
if (ActionEnabledChanged_cb_delegate == null)
|
||
|
|
ActionEnabledChanged_cb_delegate = new ActionEnabledChangedNativeDelegate (ActionEnabledChanged_cb);
|
||
|
|
return ActionEnabledChanged_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideActionEnabledChanged (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideActionEnabledChanged (gtype, ActionEnabledChangedVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideActionEnabledChanged (GLib.GType gtype, ActionEnabledChangedNativeDelegate callback)
|
||
|
|
{
|
||
|
|
OverrideVirtualMethod (gtype, "action-enabled-changed", callback);
|
||
|
|
}
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void ActionEnabledChangedNativeDelegate (IntPtr inst, IntPtr action_name, bool enabled);
|
||
|
|
|
||
|
|
static void ActionEnabledChanged_cb (IntPtr inst, IntPtr action_name, bool enabled)
|
||
|
|
{
|
||
|
|
try {
|
||
|
|
GLib.SimpleActionGroup __obj = GLib.Object.GetObject (inst, false) as GLib.SimpleActionGroup;
|
||
|
|
__obj.OnActionEnabledChanged (GLib.Marshaller.Utf8PtrToString (action_name), enabled);
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.SimpleActionGroup), ConnectionMethod="OverrideActionEnabledChanged")]
|
||
|
|
protected virtual void OnActionEnabledChanged (string action_name, bool enabled)
|
||
|
|
{
|
||
|
|
InternalActionEnabledChanged (action_name, enabled);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void InternalActionEnabledChanged (string action_name, bool enabled)
|
||
|
|
{
|
||
|
|
GLib.Value ret = GLib.Value.Empty;
|
||
|
|
GLib.ValueArray inst_and_params = new GLib.ValueArray (3);
|
||
|
|
GLib.Value[] vals = new GLib.Value [3];
|
||
|
|
vals [0] = new GLib.Value (this);
|
||
|
|
inst_and_params.Append (vals [0]);
|
||
|
|
vals [1] = new GLib.Value (action_name);
|
||
|
|
inst_and_params.Append (vals [1]);
|
||
|
|
vals [2] = new GLib.Value (enabled);
|
||
|
|
inst_and_params.Append (vals [2]);
|
||
|
|
g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
|
||
|
|
foreach (GLib.Value v in vals)
|
||
|
|
v.Dispose ();
|
||
|
|
}
|
||
|
|
|
||
|
|
static ActionStateChangedNativeDelegate ActionStateChanged_cb_delegate;
|
||
|
|
static ActionStateChangedNativeDelegate ActionStateChangedVMCallback {
|
||
|
|
get {
|
||
|
|
if (ActionStateChanged_cb_delegate == null)
|
||
|
|
ActionStateChanged_cb_delegate = new ActionStateChangedNativeDelegate (ActionStateChanged_cb);
|
||
|
|
return ActionStateChanged_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideActionStateChanged (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideActionStateChanged (gtype, ActionStateChangedVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideActionStateChanged (GLib.GType gtype, ActionStateChangedNativeDelegate callback)
|
||
|
|
{
|
||
|
|
OverrideVirtualMethod (gtype, "action-state-changed", callback);
|
||
|
|
}
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void ActionStateChangedNativeDelegate (IntPtr inst, IntPtr action_name, IntPtr state);
|
||
|
|
|
||
|
|
static void ActionStateChanged_cb (IntPtr inst, IntPtr action_name, IntPtr state)
|
||
|
|
{
|
||
|
|
try {
|
||
|
|
GLib.SimpleActionGroup __obj = GLib.Object.GetObject (inst, false) as GLib.SimpleActionGroup;
|
||
|
|
__obj.OnActionStateChanged (GLib.Marshaller.Utf8PtrToString (action_name), new GLib.Variant(state));
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.SimpleActionGroup), ConnectionMethod="OverrideActionStateChanged")]
|
||
|
|
protected virtual void OnActionStateChanged (string action_name, GLib.Variant state)
|
||
|
|
{
|
||
|
|
InternalActionStateChanged (action_name, state);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void InternalActionStateChanged (string action_name, GLib.Variant state)
|
||
|
|
{
|
||
|
|
GLib.Value ret = GLib.Value.Empty;
|
||
|
|
GLib.ValueArray inst_and_params = new GLib.ValueArray (3);
|
||
|
|
GLib.Value[] vals = new GLib.Value [3];
|
||
|
|
vals [0] = new GLib.Value (this);
|
||
|
|
inst_and_params.Append (vals [0]);
|
||
|
|
vals [1] = new GLib.Value (action_name);
|
||
|
|
inst_and_params.Append (vals [1]);
|
||
|
|
vals [2] = new GLib.Value (state);
|
||
|
|
inst_and_params.Append (vals [2]);
|
||
|
|
g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
|
||
|
|
foreach (GLib.Value v in vals)
|
||
|
|
v.Dispose ();
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_action_map_add_action(IntPtr raw, IntPtr action);
|
||
|
|
static d_g_action_map_add_action g_action_map_add_action = FuncLoader.LoadFunction<d_g_action_map_add_action>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_map_add_action"));
|
||
|
|
|
||
|
|
public void AddAction(GLib.IAction action) {
|
||
|
|
g_action_map_add_action(Handle, action == null ? IntPtr.Zero : ((action is GLib.Object) ? (action as GLib.Object).Handle : (action as GLib.ActionAdapter).Handle));
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_action_map_add_action_entries(IntPtr raw, IntPtr entries, int n_entries, IntPtr user_data);
|
||
|
|
static d_g_action_map_add_action_entries g_action_map_add_action_entries = FuncLoader.LoadFunction<d_g_action_map_add_action_entries>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_map_add_action_entries"));
|
||
|
|
|
||
|
|
public void AddActionEntries(GLib.ActionEntry entries, int n_entries, IntPtr user_data) {
|
||
|
|
IntPtr native_entries = GLib.Marshaller.StructureToPtrAlloc (entries);
|
||
|
|
g_action_map_add_action_entries(Handle, native_entries, n_entries, user_data);
|
||
|
|
Marshal.FreeHGlobal (native_entries);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_action_map_lookup_action(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_map_lookup_action g_action_map_lookup_action = FuncLoader.LoadFunction<d_g_action_map_lookup_action>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_map_lookup_action"));
|
||
|
|
|
||
|
|
public GLib.IAction LookupAction(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
IntPtr raw_ret = g_action_map_lookup_action(Handle, native_action_name);
|
||
|
|
GLib.IAction ret = GLib.ActionAdapter.GetObject (raw_ret, false);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_action_map_remove_action(IntPtr raw, IntPtr action_name);
|
||
|
|
static d_g_action_map_remove_action g_action_map_remove_action = FuncLoader.LoadFunction<d_g_action_map_remove_action>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_map_remove_action"));
|
||
|
|
|
||
|
|
public void RemoveAction(string action_name) {
|
||
|
|
IntPtr native_action_name = GLib.Marshaller.StringToPtrGStrdup (action_name);
|
||
|
|
g_action_map_remove_action(Handle, native_action_name);
|
||
|
|
GLib.Marshaller.Free (native_action_name);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// Internal representation of the wrapped structure ABI.
|
||
|
|
static GLib.AbiStruct _abi_info = null;
|
||
|
|
static public unsafe new GLib.AbiStruct abi_info {
|
||
|
|
get {
|
||
|
|
if (_abi_info == null)
|
||
|
|
_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{
|
||
|
|
new GLib.AbiField("priv"
|
||
|
|
, GLib.Object.abi_info.Fields
|
||
|
|
, (uint) sizeof( IntPtr ) // priv
|
||
|
|
, null
|
||
|
|
, null
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
});
|
||
|
|
|
||
|
|
return _abi_info;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// End of the ABI representation.
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
}
|
||
|
|
}
|