示例#1
0
        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);

            if (signal_id <= 0)
            {
                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));
        }
示例#2
0
 public EmissionHookMarshaler(EmissionHookNative callback, IntPtr user_data)
 {
     cb             = callback;
     this.user_data = user_data;
     handler        = new EmissionHook(NativeInvoker);
 }
示例#3
0
 public EmissionHookMarshaler(EmissionHook handler)
 {
     this.handler = handler;
     cb           = new EmissionHookNative(NativeCallback);
     gch          = GCHandle.Alloc(this);
 }
示例#4
0
 public EmissionHookMarshaler(EmissionHookNative callback, IntPtr user_data)
 {
     cb = callback;
     this.user_data = user_data;
     handler = new EmissionHook (NativeInvoker);
 }
示例#5
0
 public EmissionHookMarshaler(EmissionHook handler)
 {
     this.handler = handler;
     cb = new EmissionHookNative (NativeCallback);
     gch = GCHandle.Alloc (this);
 }
示例#6
0
 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);
     if (signal_id <= 0)
         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);
 }