示例#1
0
		public SignalClosure (IntPtr obj, string signal_name, Delegate custom_marshaler, Signal signal)
		{
			gch = GCHandle.Alloc (signal);
			raw_closure = g_cclosure_new (custom_marshaler, (IntPtr) gch, Notify);
			closures [raw_closure] = this;
			handle = obj;
			name = signal_name;
			this.custom_marshaler = custom_marshaler;
		}
示例#2
0
  		public void Free ()
  		{
			Signal[] signals = new Signal [Signals.Count];
			Signals.Values.CopyTo (signals, 0);
			foreach (Signal s in signals)
				s.Free ();
			if (hardened)
				g_object_unref (handle);
			else
				g_object_remove_toggle_ref (handle, ToggleNotifyCallback, (IntPtr) gch);
			reference = null;
			gch.Free ();
		}
示例#3
0
        public void AddSignalHandler(string name, Delegate handler, Type args_type)
        {
            if (args_type == null)
                args_type = handler.Method.GetParameters ()[1].ParameterType;

            Signal sig;
            if (!Signals.TryGetValue (name, out sig)) {
                sig = new Signal (this, name, args_type);
                Signals [name] = sig;
            }

            sig.AddDelegate (handler);
        }
示例#4
0
        public void AddSignalHandler(string name, Delegate handler, Delegate marshaler)
        {
            Signal sig;
            if (!Signals.TryGetValue (name, out sig)) {
                sig = new Signal (this, name, marshaler);
                Signals [name] = sig;
            }

            sig.AddDelegate (handler);
        }
示例#5
0
		public static Signal Lookup (GLib.Object obj, string name, Type args_type)
		{
			Signal result = obj.ToggleRef.Signals [name] as Signal;
			if (result == null)
				result = new Signal (obj, name, args_type);
			return result;
		}
示例#6
0
		public static Signal Lookup (GLib.Object obj, string name, Delegate marshaler)
		{
			Signal result = obj.ToggleRef.Signals [name] as Signal;
			if (result == null)
				result = new Signal (obj, name, marshaler);
			return result;
		}