// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace GLib { using System; using System.Runtime.InteropServices; #region Autogenerated code public partial class ActionGroupAdapter : GLib.GInterfaceAdapter, GLib.IActionGroup { [StructLayout (LayoutKind.Sequential)] struct GActionGroupInterface { public HasActionNativeDelegate HasAction; public ListActionsNativeDelegate ListActions; public GetActionEnabledNativeDelegate GetActionEnabled; public GetActionParameterTypeNativeDelegate GetActionParameterType; public GetActionStateTypeNativeDelegate GetActionStateType; public GetActionStateHintNativeDelegate GetActionStateHint; public GetActionStateNativeDelegate GetActionState; public ChangeActionStateNativeDelegate ChangeActionState; public ActivateActionNativeDelegate ActivateAction; IntPtr ActionAdded; IntPtr ActionRemoved; IntPtr ActionEnabledChanged; IntPtr ActionStateChanged; public QueryActionNativeDelegate QueryAction; } static GActionGroupInterface iface; static ActionGroupAdapter () { GLib.GType.Register (_gtype, typeof (ActionGroupAdapter)); iface.HasAction = new HasActionNativeDelegate (HasAction_cb); iface.ListActions = new ListActionsNativeDelegate (ListActions_cb); iface.GetActionEnabled = new GetActionEnabledNativeDelegate (GetActionEnabled_cb); iface.GetActionParameterType = new GetActionParameterTypeNativeDelegate (GetActionParameterType_cb); iface.GetActionStateType = new GetActionStateTypeNativeDelegate (GetActionStateType_cb); iface.GetActionStateHint = new GetActionStateHintNativeDelegate (GetActionStateHint_cb); iface.GetActionState = new GetActionStateNativeDelegate (GetActionState_cb); iface.ChangeActionState = new ChangeActionStateNativeDelegate (ChangeActionState_cb); iface.ActivateAction = new ActivateActionNativeDelegate (ActivateAction_cb); iface.QueryAction = new QueryActionNativeDelegate (QueryAction_cb); } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool HasActionNativeDelegate (IntPtr inst, IntPtr action_name); static bool HasAction_cb (IntPtr inst, IntPtr action_name) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; bool __result; __result = __obj.HasAction (GLib.Marshaller.Utf8PtrToString (action_name)); return __result; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr ListActionsNativeDelegate (IntPtr inst); static IntPtr ListActions_cb (IntPtr inst) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; string[] __result; __result = __obj.ListActions (); return GLib.Marshaller.StringArrayToNullTermStrvPointer (__result); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool GetActionEnabledNativeDelegate (IntPtr inst, IntPtr action_name); static bool GetActionEnabled_cb (IntPtr inst, IntPtr action_name) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; bool __result; __result = __obj.GetActionEnabled (GLib.Marshaller.Utf8PtrToString (action_name)); return __result; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr GetActionParameterTypeNativeDelegate (IntPtr inst, IntPtr action_name); static IntPtr GetActionParameterType_cb (IntPtr inst, IntPtr action_name) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; GLib.VariantType __result; __result = __obj.GetActionParameterType (GLib.Marshaller.Utf8PtrToString (action_name)); return __result == null ? IntPtr.Zero : __result.Handle; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr GetActionStateTypeNativeDelegate (IntPtr inst, IntPtr action_name); static IntPtr GetActionStateType_cb (IntPtr inst, IntPtr action_name) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; GLib.VariantType __result; __result = __obj.GetActionStateType (GLib.Marshaller.Utf8PtrToString (action_name)); return __result == null ? IntPtr.Zero : __result.Handle; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr GetActionStateHintNativeDelegate (IntPtr inst, IntPtr action_name); static IntPtr GetActionStateHint_cb (IntPtr inst, IntPtr action_name) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; GLib.Variant __result; __result = __obj.GetActionStateHint (GLib.Marshaller.Utf8PtrToString (action_name)); return __result == null ? IntPtr.Zero : __result.Handle; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr GetActionStateNativeDelegate (IntPtr inst, IntPtr action_name); static IntPtr GetActionState_cb (IntPtr inst, IntPtr action_name) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; GLib.Variant __result; __result = __obj.GetActionState (GLib.Marshaller.Utf8PtrToString (action_name)); return __result == null ? IntPtr.Zero : __result.Handle; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void ChangeActionStateNativeDelegate (IntPtr inst, IntPtr action_name, IntPtr value); static void ChangeActionState_cb (IntPtr inst, IntPtr action_name, IntPtr value) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; __obj.ChangeActionState (GLib.Marshaller.Utf8PtrToString (action_name), new GLib.Variant(value)); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, false); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void ActivateActionNativeDelegate (IntPtr inst, IntPtr action_name, IntPtr parameter); static void ActivateAction_cb (IntPtr inst, IntPtr action_name, IntPtr parameter) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; __obj.ActivateAction (GLib.Marshaller.Utf8PtrToString (action_name), new GLib.Variant(parameter)); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, false); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool QueryActionNativeDelegate (IntPtr inst, IntPtr action_name, out bool enabled, IntPtr parameter_type, IntPtr state_type, IntPtr state_hint, IntPtr state); static bool QueryAction_cb (IntPtr inst, IntPtr action_name, out bool enabled, IntPtr parameter_type, IntPtr state_type, IntPtr state_hint, IntPtr state) { try { IActionGroupImplementor __obj = GLib.Object.GetObject (inst, false) as IActionGroupImplementor; bool __result; __result = __obj.QueryAction (GLib.Marshaller.Utf8PtrToString (action_name), out enabled, new GLib.VariantType(parameter_type), new GLib.VariantType(state_type), new GLib.Variant(state_hint), new GLib.Variant(state)); return __result; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } static int class_offset = 2 * IntPtr.Size; static void Initialize (IntPtr ptr, IntPtr data) { IntPtr ifaceptr = new IntPtr (ptr.ToInt64 () + class_offset); GActionGroupInterface native_iface = (GActionGroupInterface) Marshal.PtrToStructure (ifaceptr, typeof (GActionGroupInterface)); native_iface.HasAction = iface.HasAction; native_iface.ListActions = iface.ListActions; native_iface.GetActionEnabled = iface.GetActionEnabled; native_iface.GetActionParameterType = iface.GetActionParameterType; native_iface.GetActionStateType = iface.GetActionStateType; native_iface.GetActionStateHint = iface.GetActionStateHint; native_iface.GetActionState = iface.GetActionState; native_iface.ChangeActionState = iface.ChangeActionState; native_iface.ActivateAction = iface.ActivateAction; native_iface.QueryAction = iface.QueryAction; Marshal.StructureToPtr (native_iface, ifaceptr, false); } GLib.Object implementor; public ActionGroupAdapter () { InitHandler = new GLib.GInterfaceInitHandler (Initialize); } public ActionGroupAdapter (IActionGroupImplementor implementor) { if (implementor == null) throw new ArgumentNullException ("implementor"); else if (!(implementor is GLib.Object)) throw new ArgumentException ("implementor must be a subclass of GLib.Object"); this.implementor = implementor as GLib.Object; } public ActionGroupAdapter (IntPtr handle) { if (!_gtype.IsInstance (handle)) throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle"); implementor = GLib.Object.GetObject (handle); } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_g_action_group_get_type(); static d_g_action_group_get_type g_action_group_get_type = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_action_group_get_type")); private static GLib.GType _gtype = new GLib.GType (g_action_group_get_type ()); public static GLib.GType GType { get { return _gtype; } } public override GLib.GType GInterfaceGType { get { return _gtype; } } public override IntPtr Handle { get { return implementor.Handle; } } public IntPtr OwnedHandle { get { return implementor.OwnedHandle; } } public static IActionGroup GetObject (IntPtr handle, bool owned) { GLib.Object obj = GLib.Object.GetObject (handle, owned); return GetObject (obj); } public static IActionGroup GetObject (GLib.Object obj) { if (obj == null) return null; else if (obj is IActionGroupImplementor) return new ActionGroupAdapter (obj as IActionGroupImplementor); else if (obj as IActionGroup == null) return new ActionGroupAdapter (obj.Handle); else return obj as IActionGroup; } public IActionGroupImplementor Implementor { get { return implementor as IActionGroupImplementor; } } [GLib.Signal("action-state-changed")] public event GLib.ActionStateChangedHandler ActionStateChanged { add { GLib.Object.GetObject (Handle).AddSignalHandler ("action-state-changed", value, typeof (GLib.ActionStateChangedArgs)); } remove { GLib.Object.GetObject (Handle).RemoveSignalHandler ("action-state-changed", value); } } [GLib.Signal("action-removed")] public event GLib.ActionRemovedHandler ActionRemoved { add { GLib.Object.GetObject (Handle).AddSignalHandler ("action-removed", value, typeof (GLib.ActionRemovedArgs)); } remove { GLib.Object.GetObject (Handle).RemoveSignalHandler ("action-removed", value); } } [GLib.Signal("action-added")] public event GLib.ActionAddedHandler ActionAdded { add { GLib.Object.GetObject (Handle).AddSignalHandler ("action-added", value, typeof (GLib.ActionAddedArgs)); } remove { GLib.Object.GetObject (Handle).RemoveSignalHandler ("action-added", value); } } [GLib.Signal("action-enabled-changed")] public event GLib.ActionEnabledChangedHandler ActionEnabledChanged { add { GLib.Object.GetObject (Handle).AddSignalHandler ("action-enabled-changed", value, typeof (GLib.ActionEnabledChangedArgs)); } remove { GLib.Object.GetObject (Handle).RemoveSignalHandler ("action-enabled-changed", value); } } [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(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(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(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(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(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(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(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(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(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(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(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(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(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(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; } #endregion } }