2005-02-02 21:57:15 +00:00
|
|
|
// GLib.Signal.cs - signal marshaling class
|
|
|
|
//
|
|
|
|
// Authors: Mike Kestner <mkestner@novell.com>
|
2008-05-14 16:03:13 +00:00
|
|
|
// Andrés G. Aragoneses <aaragoneses@novell.com>
|
2005-02-02 21:57:15 +00:00
|
|
|
//
|
2008-05-14 16:03:13 +00:00
|
|
|
// Copyright (c) 2005,2008 Novell, Inc.
|
2005-02-02 21:57:15 +00:00
|
|
|
//
|
|
|
|
// 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 GLib {
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
2007-12-06 17:23:28 +00:00
|
|
|
[Flags]
|
|
|
|
public enum ConnectFlags {
|
|
|
|
After = 1 << 0,
|
|
|
|
Swapped = 1 << 1,
|
|
|
|
}
|
|
|
|
|
2008-04-30 20:15:45 +00:00
|
|
|
public class Signal {
|
2005-02-02 21:57:15 +00:00
|
|
|
|
2008-04-30 20:15:45 +00:00
|
|
|
[Flags]
|
|
|
|
public enum Flags {
|
|
|
|
RunFirst = 1 << 0,
|
|
|
|
RunLast = 1 << 1,
|
|
|
|
RunCleanup = 1 << 2,
|
|
|
|
NoRecurse = 1 << 3,
|
|
|
|
Detailed = 1 << 4,
|
|
|
|
Action = 1 << 5,
|
|
|
|
NoHooks = 1 << 6
|
|
|
|
}
|
2005-02-02 21:57:15 +00:00
|
|
|
|
2008-04-30 20:15:45 +00:00
|
|
|
[StructLayout (LayoutKind.Sequential)]
|
|
|
|
public struct InvocationHint {
|
|
|
|
public uint signal_id;
|
|
|
|
public uint detail;
|
|
|
|
public Flags run_type;
|
|
|
|
}
|
|
|
|
|
2008-12-19 18:57:42 +00:00
|
|
|
[StructLayout (LayoutKind.Sequential)]
|
|
|
|
struct Query {
|
|
|
|
public uint signal_id;
|
|
|
|
public IntPtr signal_name;
|
|
|
|
public IntPtr itype;
|
|
|
|
public Flags signal_flags;
|
|
|
|
public IntPtr return_type;
|
|
|
|
public uint n_params;
|
|
|
|
public IntPtr param_types;
|
|
|
|
}
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
2008-04-30 20:15:45 +00:00
|
|
|
public delegate bool EmissionHookNative (ref InvocationHint hint, uint n_pvals, IntPtr pvals, IntPtr data);
|
|
|
|
|
|
|
|
public delegate bool EmissionHook (InvocationHint ihint, object[] inst_and_param_values);
|
|
|
|
|
|
|
|
public class EmissionHookMarshaler {
|
|
|
|
|
|
|
|
EmissionHook handler;
|
|
|
|
EmissionHookNative cb;
|
|
|
|
IntPtr user_data;
|
|
|
|
GCHandle gch;
|
|
|
|
|
|
|
|
public EmissionHookMarshaler (EmissionHook handler)
|
|
|
|
{
|
|
|
|
this.handler = handler;
|
|
|
|
cb = new EmissionHookNative (NativeCallback);
|
|
|
|
gch = GCHandle.Alloc (this);
|
|
|
|
}
|
|
|
|
|
|
|
|
public EmissionHookMarshaler (EmissionHookNative callback, IntPtr user_data)
|
|
|
|
{
|
|
|
|
cb = callback;
|
|
|
|
this.user_data = user_data;
|
|
|
|
handler = new EmissionHook (NativeInvoker);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool NativeCallback (ref InvocationHint hint, uint n_pvals, IntPtr pvals_ptr, IntPtr data)
|
|
|
|
{
|
|
|
|
object[] pvals = new object [n_pvals];
|
|
|
|
for (int i = 0; i < n_pvals; i++) {
|
|
|
|
IntPtr p = new IntPtr ((long) pvals_ptr + i * Marshal.SizeOf (typeof (Value)));
|
|
|
|
Value v = (Value) Marshal.PtrToStructure (p, typeof (Value));
|
|
|
|
pvals [i] = v.Val;
|
|
|
|
}
|
|
|
|
bool result = handler (hint, pvals);
|
|
|
|
if (!result)
|
|
|
|
gch.Free ();
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
public EmissionHookNative Callback {
|
|
|
|
get {
|
|
|
|
return cb;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool NativeInvoker (InvocationHint ihint, object[] pvals)
|
|
|
|
{
|
|
|
|
int val_sz = Marshal.SizeOf (typeof (Value));
|
|
|
|
IntPtr buf = Marshal.AllocHGlobal (pvals.Length * val_sz);
|
|
|
|
Value[] vals = new Value [pvals.Length];
|
|
|
|
for (int i = 0; i < pvals.Length; i++) {
|
|
|
|
vals [i] = new Value (pvals [i]);
|
|
|
|
IntPtr p = new IntPtr ((long) buf + i * val_sz);
|
|
|
|
Marshal.StructureToPtr (vals [i], p, false);
|
|
|
|
}
|
|
|
|
bool result = cb (ref ihint, (uint) pvals.Length, buf, user_data);
|
|
|
|
foreach (Value v in vals)
|
|
|
|
v.Dispose ();
|
|
|
|
Marshal.FreeHGlobal (buf);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
public EmissionHook Invoker {
|
|
|
|
get {
|
|
|
|
return handler;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-02-02 21:57:15 +00:00
|
|
|
|
2011-03-24 23:11:10 +00:00
|
|
|
GLib.Object obj;
|
2005-02-02 21:57:15 +00:00
|
|
|
string name;
|
2008-04-30 20:15:45 +00:00
|
|
|
Type args_type;
|
|
|
|
SignalClosure before_closure;
|
|
|
|
SignalClosure after_closure;
|
2011-03-24 23:11:10 +00:00
|
|
|
Delegate after_handler;
|
|
|
|
Delegate before_handler;
|
2008-10-29 21:41:57 +00:00
|
|
|
Delegate marshaler;
|
2005-02-02 21:57:15 +00:00
|
|
|
|
2011-03-24 23:11:10 +00:00
|
|
|
internal Signal (GLib.Object obj, string name, Delegate marshaler)
|
2008-01-22 16:54:44 +00:00
|
|
|
{
|
2011-03-24 23:11:10 +00:00
|
|
|
this.obj = obj;
|
|
|
|
this.name = name;
|
2008-10-29 21:41:57 +00:00
|
|
|
this.marshaler = marshaler;
|
2008-01-22 16:54:44 +00:00
|
|
|
}
|
|
|
|
|
2011-03-24 23:11:10 +00:00
|
|
|
internal Signal (GLib.Object obj, string name, Type args_type)
|
2005-02-02 21:57:15 +00:00
|
|
|
{
|
2011-03-24 23:11:10 +00:00
|
|
|
this.obj = obj;
|
|
|
|
this.name = name;
|
2008-04-30 20:15:45 +00:00
|
|
|
this.args_type = args_type;
|
2008-01-22 16:54:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
internal void Free ()
|
|
|
|
{
|
2008-04-30 20:15:45 +00:00
|
|
|
if (before_closure != null)
|
|
|
|
before_closure.Dispose ();
|
|
|
|
if (after_closure != null)
|
|
|
|
after_closure.Dispose ();
|
2008-01-22 16:54:44 +00:00
|
|
|
GC.SuppressFinalize (this);
|
2005-02-02 21:57:15 +00:00
|
|
|
}
|
|
|
|
|
2008-04-30 20:15:45 +00:00
|
|
|
void ClosureDisposedCB (object o, EventArgs args)
|
|
|
|
{
|
|
|
|
if (o == before_closure) {
|
2008-08-25 20:43:09 +00:00
|
|
|
before_closure.Disposed -= new EventHandler (ClosureDisposedHandler);
|
|
|
|
before_closure.Invoked -= new ClosureInvokedHandler (ClosureInvokedCB);
|
2008-04-30 20:15:45 +00:00
|
|
|
before_closure = null;
|
2011-03-24 23:11:10 +00:00
|
|
|
before_handler = null;
|
2008-08-27 14:54:34 +00:00
|
|
|
} else if (o == after_closure) {
|
2008-08-25 20:43:09 +00:00
|
|
|
after_closure.Disposed -= new EventHandler (ClosureDisposedHandler);
|
|
|
|
after_closure.Invoked -= new ClosureInvokedHandler (ClosureInvokedCB);
|
2008-04-30 20:15:45 +00:00
|
|
|
after_closure = null;
|
2011-03-24 23:11:10 +00:00
|
|
|
after_handler = null;
|
2008-04-30 20:15:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EventHandler closure_disposed_cb;
|
|
|
|
EventHandler ClosureDisposedHandler {
|
|
|
|
get {
|
|
|
|
if (closure_disposed_cb == null)
|
|
|
|
closure_disposed_cb = new EventHandler (ClosureDisposedCB);
|
|
|
|
return closure_disposed_cb;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ClosureInvokedCB (object o, ClosureInvokedArgs args)
|
|
|
|
{
|
|
|
|
Delegate handler;
|
|
|
|
if (o == before_closure)
|
2011-03-24 23:11:10 +00:00
|
|
|
handler = before_handler;
|
2008-04-30 20:15:45 +00:00
|
|
|
else
|
2011-03-24 23:11:10 +00:00
|
|
|
handler = after_handler;
|
2008-04-30 20:15:45 +00:00
|
|
|
|
|
|
|
if (handler != null)
|
|
|
|
handler.DynamicInvoke (new object[] {args.Target, args.Args});
|
|
|
|
}
|
|
|
|
|
|
|
|
ClosureInvokedHandler closure_invoked_cb;
|
|
|
|
ClosureInvokedHandler ClosureInvokedHandler {
|
|
|
|
get {
|
|
|
|
if (closure_invoked_cb == null)
|
|
|
|
closure_invoked_cb = new ClosureInvokedHandler (ClosureInvokedCB);
|
|
|
|
return closure_invoked_cb;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-02 21:57:15 +00:00
|
|
|
public Delegate Handler {
|
|
|
|
get {
|
2011-03-24 23:11:10 +00:00
|
|
|
InvocationHint hint = (InvocationHint) Marshal.PtrToStructure (g_signal_get_invocation_hint (obj.Handle), typeof (InvocationHint));
|
2008-04-30 20:15:45 +00:00
|
|
|
if (hint.run_type == Flags.RunFirst)
|
2011-03-24 23:11:10 +00:00
|
|
|
return before_handler;
|
2005-02-02 21:57:15 +00:00
|
|
|
else
|
2011-03-24 23:11:10 +00:00
|
|
|
return after_handler;
|
2005-02-02 21:57:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void AddDelegate (Delegate d)
|
|
|
|
{
|
2008-04-30 20:15:45 +00:00
|
|
|
if (args_type == null)
|
|
|
|
args_type = d.Method.GetParameters ()[1].ParameterType;
|
2005-02-02 21:57:15 +00:00
|
|
|
|
|
|
|
if (d.Method.IsDefined (typeof (ConnectBeforeAttribute), false)) {
|
2011-03-24 23:11:10 +00:00
|
|
|
before_handler = Delegate.Combine (before_handler, d);
|
2008-04-30 20:15:45 +00:00
|
|
|
if (before_closure == null) {
|
2008-10-29 21:41:57 +00:00
|
|
|
if (marshaler == null)
|
2011-03-24 23:11:10 +00:00
|
|
|
before_closure = new SignalClosure (obj.Handle, name, args_type);
|
2008-10-29 21:41:57 +00:00
|
|
|
else
|
2011-03-24 23:11:10 +00:00
|
|
|
before_closure = new SignalClosure (obj.Handle, name, marshaler, this);
|
2008-04-30 20:15:45 +00:00
|
|
|
before_closure.Disposed += ClosureDisposedHandler;
|
|
|
|
before_closure.Invoked += ClosureInvokedHandler;
|
|
|
|
before_closure.Connect (false);
|
2005-02-02 21:57:15 +00:00
|
|
|
}
|
|
|
|
} else {
|
2011-03-24 23:11:10 +00:00
|
|
|
after_handler = Delegate.Combine (after_handler, d);
|
2008-04-30 20:15:45 +00:00
|
|
|
if (after_closure == null) {
|
2008-10-29 21:41:57 +00:00
|
|
|
if (marshaler == null)
|
2011-03-24 23:11:10 +00:00
|
|
|
after_closure = new SignalClosure (obj.Handle, name, args_type);
|
2008-10-29 21:41:57 +00:00
|
|
|
else
|
2011-03-24 23:11:10 +00:00
|
|
|
after_closure = new SignalClosure (obj.Handle, name, marshaler, this);
|
2008-04-30 20:15:45 +00:00
|
|
|
after_closure.Disposed += ClosureDisposedHandler;
|
|
|
|
after_closure.Invoked += ClosureInvokedHandler;
|
|
|
|
after_closure.Connect (true);
|
2005-02-02 21:57:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-04-30 20:15:45 +00:00
|
|
|
public void RemoveDelegate (Delegate d)
|
2005-02-02 21:57:15 +00:00
|
|
|
{
|
2008-04-30 20:15:45 +00:00
|
|
|
if (d.Method.IsDefined (typeof (ConnectBeforeAttribute), false)) {
|
2011-03-24 23:11:10 +00:00
|
|
|
before_handler = Delegate.Remove (before_handler, d);
|
|
|
|
if (before_handler == null && before_closure != null) {
|
2008-04-30 20:15:45 +00:00
|
|
|
before_closure.Dispose ();
|
|
|
|
before_closure = null;
|
|
|
|
}
|
|
|
|
} else {
|
2011-03-24 23:11:10 +00:00
|
|
|
after_handler = Delegate.Remove (after_handler, d);
|
|
|
|
if (after_handler == null && after_closure != null) {
|
2008-04-30 20:15:45 +00:00
|
|
|
after_closure.Dispose ();
|
|
|
|
after_closure = null;
|
2007-03-06 20:10:15 +00:00
|
|
|
}
|
|
|
|
}
|
2005-02-02 21:57:15 +00:00
|
|
|
}
|
|
|
|
|
2008-05-14 16:03:13 +00:00
|
|
|
// format: children-changed::add
|
|
|
|
private static void ParseSignalDetail (string signal_detail, out string signal_name, out uint gquark)
|
2008-04-24 17:11:11 +00:00
|
|
|
{
|
2008-05-14 16:03:13 +00:00
|
|
|
//can't use String.Split because it doesn't accept a string arg (only char) in the 1.x profile
|
|
|
|
int link_pos = signal_detail.IndexOf ("::");
|
|
|
|
if (link_pos < 0) {
|
|
|
|
gquark = 0;
|
|
|
|
signal_name = signal_detail;
|
|
|
|
} else if (link_pos == 0) {
|
2008-12-08 21:54:20 +00:00
|
|
|
throw new FormatException ("Invalid detailed signal: " + signal_detail);
|
2008-05-14 16:03:13 +00:00
|
|
|
} else {
|
|
|
|
signal_name = signal_detail.Substring (0, link_pos);
|
|
|
|
gquark = GetGQuarkFromString (signal_detail.Substring (link_pos + 2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static object Emit (GLib.Object instance, string detailed_signal, params object[] args)
|
|
|
|
{
|
|
|
|
uint gquark, signal_id;
|
|
|
|
string signal_name;
|
|
|
|
ParseSignalDetail (detailed_signal, out signal_name, out gquark);
|
|
|
|
signal_id = GetSignalId (signal_name, instance);
|
2008-12-08 21:54:20 +00:00
|
|
|
if (signal_id <= 0)
|
|
|
|
throw new ArgumentException ("Invalid signal name: " + signal_name);
|
2008-04-24 17:11:11 +00:00
|
|
|
GLib.Value[] vals = new GLib.Value [args.Length + 1];
|
|
|
|
GLib.ValueArray inst_and_params = new GLib.ValueArray ((uint) args.Length + 1);
|
|
|
|
|
|
|
|
vals [0] = new GLib.Value (instance);
|
|
|
|
inst_and_params.Append (vals [0]);
|
|
|
|
for (int i = 1; i < vals.Length; i++) {
|
|
|
|
vals [i] = new GLib.Value (args [i - 1]);
|
|
|
|
inst_and_params.Append (vals [i]);
|
|
|
|
}
|
|
|
|
|
2008-09-05 07:38:11 +00:00
|
|
|
object ret_obj = null;
|
2008-12-19 18:57:42 +00:00
|
|
|
Query query;
|
|
|
|
g_signal_query (signal_id, out query);
|
|
|
|
if (query.return_type != GType.None.Val) {
|
2008-09-05 07:38:11 +00:00
|
|
|
GLib.Value ret = GLib.Value.Empty;
|
|
|
|
g_signal_emitv (inst_and_params.ArrayPtr, signal_id, gquark, ref ret);
|
|
|
|
ret_obj = ret.Val;
|
|
|
|
ret.Dispose ();
|
|
|
|
} else
|
|
|
|
g_signal_emitv (inst_and_params.ArrayPtr, signal_id, gquark, IntPtr.Zero);
|
2008-04-24 17:11:11 +00:00
|
|
|
|
|
|
|
foreach (GLib.Value val in vals)
|
|
|
|
val.Dispose ();
|
2008-09-05 07:38:11 +00:00
|
|
|
|
2008-04-24 17:11:11 +00:00
|
|
|
return ret_obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
private static uint GetGQuarkFromString (string str) {
|
|
|
|
IntPtr native_string = GLib.Marshaller.StringToPtrGStrdup (str);
|
|
|
|
uint ret = g_quark_from_string (native_string);
|
|
|
|
GLib.Marshaller.Free (native_string);
|
|
|
|
return ret;
|
|
|
|
}
|
2005-02-02 21:57:15 +00:00
|
|
|
|
2008-04-24 17:11:11 +00:00
|
|
|
private static uint GetSignalId (string signal_name, GLib.Object obj)
|
|
|
|
{
|
2008-12-19 18:57:42 +00:00
|
|
|
IntPtr typeid = GType.ValFromInstancePtr (obj.Handle);
|
2008-05-14 16:03:13 +00:00
|
|
|
return GetSignalId (signal_name, typeid);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static uint GetSignalId (string signal_name, IntPtr typeid)
|
|
|
|
{
|
2008-04-24 17:11:11 +00:00
|
|
|
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (signal_name);
|
|
|
|
uint signal_id = g_signal_lookup (native_name, typeid);
|
|
|
|
GLib.Marshaller.Free (native_name);
|
|
|
|
return signal_id;
|
|
|
|
}
|
|
|
|
|
2008-05-14 16:03:13 +00:00
|
|
|
public static ulong AddEmissionHook (string detailed_signal, GLib.GType type, EmissionHook handler_func)
|
|
|
|
{
|
|
|
|
uint gquark;
|
|
|
|
string signal_name;
|
|
|
|
ParseSignalDetail (detailed_signal, out signal_name, out gquark);
|
|
|
|
uint signal_id = GetSignalId (signal_name, type.Val);
|
2008-12-08 21:54:20 +00:00
|
|
|
if (signal_id <= 0)
|
2008-05-14 16:03:13 +00:00
|
|
|
throw new Exception ("Invalid signal name: " + signal_name);
|
|
|
|
return g_signal_add_emission_hook (signal_id, gquark, new EmissionHookMarshaler (handler_func).Callback, IntPtr.Zero, IntPtr.Zero);
|
|
|
|
}
|
|
|
|
|
2008-12-19 18:57:42 +00:00
|
|
|
internal static void OverrideDefaultHandler (GType gtype, string name, Delegate cb)
|
|
|
|
{
|
|
|
|
IntPtr closure = g_cclosure_new (cb, IntPtr.Zero, IntPtr.Zero);
|
|
|
|
gtype.EnsureClass ();
|
|
|
|
uint id = GetSignalId (name, gtype.Val);
|
|
|
|
g_signal_override_class_closure (id, gtype.Val, closure);
|
|
|
|
}
|
|
|
|
|
2013-11-05 10:12:27 +00:00
|
|
|
[DllImport (Global.GObjectNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
2008-12-19 18:57:42 +00:00
|
|
|
static extern IntPtr g_cclosure_new (Delegate cb, IntPtr data, IntPtr notify);
|
|
|
|
|
2013-11-05 10:12:27 +00:00
|
|
|
[DllImport (Global.GObjectNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
2005-02-02 21:57:15 +00:00
|
|
|
static extern IntPtr g_signal_get_invocation_hint (IntPtr instance);
|
|
|
|
|
2013-11-05 10:12:27 +00:00
|
|
|
[DllImport (Global.GObjectNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
2008-04-24 17:11:11 +00:00
|
|
|
static extern void g_signal_emitv (IntPtr instance_and_params, uint signal_id, uint gquark_detail, ref GLib.Value return_value);
|
|
|
|
|
2013-11-05 10:12:27 +00:00
|
|
|
[DllImport (Global.GObjectNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
2008-09-05 07:38:11 +00:00
|
|
|
static extern void g_signal_emitv (IntPtr instance_and_params, uint signal_id, uint gquark_detail, IntPtr return_value);
|
|
|
|
|
2013-11-05 10:12:27 +00:00
|
|
|
[DllImport (Global.GObjectNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
2008-04-24 17:11:11 +00:00
|
|
|
static extern uint g_signal_lookup (IntPtr name, IntPtr itype);
|
|
|
|
|
2013-11-05 10:12:27 +00:00
|
|
|
[DllImport (Global.GObjectNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
2008-12-19 18:57:42 +00:00
|
|
|
static extern void g_signal_override_class_closure (uint id, IntPtr gtype, IntPtr closure);
|
|
|
|
|
2013-11-05 10:12:27 +00:00
|
|
|
[DllImport (Global.GObjectNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
2008-12-19 18:57:42 +00:00
|
|
|
static extern void g_signal_query (uint signal_id, out Query query);
|
|
|
|
|
2008-04-24 17:11:11 +00:00
|
|
|
//better not to expose g_quark_from_static_string () due to memory allocation issues
|
2013-11-05 10:12:27 +00:00
|
|
|
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
2008-04-24 17:11:11 +00:00
|
|
|
static extern uint g_quark_from_string (IntPtr str);
|
|
|
|
|
2013-11-05 10:12:27 +00:00
|
|
|
[DllImport (Global.GObjectNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
2008-05-14 16:03:13 +00:00
|
|
|
static extern ulong g_signal_add_emission_hook (uint signal_id, uint gquark_detail, EmissionHookNative hook_func, IntPtr hook_data, IntPtr data_destroy);
|
|
|
|
|
2005-02-02 21:57:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|