Commit Graph

30 Commits

Author SHA1 Message Date
Andrés G. Aragoneses
f1005da47c glib: Make all DllImports in custom code use a common const
This way there's less redundancy, and if the library name changes in the
future, it will be changed only in one place.

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
2013-11-17 13:05:12 +01:00
Andrés G. Aragoneses
234717712e glib: remove unused 'using' statements 2013-09-24 01:24:24 +02:00
Mike Kestner
6be0718ff2 Simplified Signal handling
* gdk/Display.custom: rework signal connection
* gdk/Window.custom: rework signal connection
* generator/Signal.cs: generate for new API.
* glib/Object.cs: add (Add|Remove)SignalHandler methods and use
them for the Notify connections.  Move to generic collections for
everything but the Data hash.
* glib/Signal.cs: kill Lookup methods and add delegate fields
* glib/ToggleRef.cs: remove Signals hash, it doesn't belong here.
* gtk/Clipboard.custom: rework signal connection
* gtk/ListStore.custom: rework signal connection
* gtk/TextView.custom: remove obsolete signal
* gtk/TreeModelAdapter.custom: rework signal connection
* gtk/TreeModelFilter.custom: rework signal connection
* gtk/TreeModelSort.custom: rework signal connection
* gtk/TreeStore.custom: rework signal connection
* gtk/Widget.custom: rework signal connection
* gtk/Window.custom: remove obsolete signal
2011-03-24 18:33:24 -05:00
Mike Kestner
db738c401b Make ToggleRef.Signals a Dictionary
* glib/Object.cs: don't bother with IsAlive check on tref
* glib/Signal.cs: remove unnecessary as usage
* glib/ToggleRef.cs: make Signals a generic dictionary
2011-03-24 18:33:19 -05:00
Christian Hoff
7b752d233c 2009-09-03 Christian Hoff <christian_hoff@gmx.net>
* glib/Global.cs: Kill the calling convention field again.
	It breaks GLib 2.x compatibility in the generator and there is
	probably no need to make the calling convention configurable.
	* .cs, *.custom: Hardcode Cdecl calling convention instead of
	using GLib's field.

svn path=/trunk/gtk-sharp/; revision=141283
2009-09-03 19:50:53 +00:00
Christian Hoff
58e97c087a 2009-09-02 Christian Hoff <christian_hoff@gmx.net>
* glib/Global.cs: Add a public constant field specifying the
	calling convention used by GLib and depending libraries.
	By now it's hardcoded to Cdecl as every non-Win32 runtime
	should ignore this attribute.
	* *.cs, *.custom: Use GLib.Global.CallingConvention for both
	pinvokes and callbacks. Plugs a stack leak on Win32. All
	pinvokes defaulted to StdCall and thus the stack was never
	cleaned up.

svn path=/trunk/gtk-sharp/; revision=141175
2009-09-02 20:17:37 +00:00
Christian Hoff
940cf88750 2009-07-02 Christian Hoff <christian_hoff@gmx.net>
* configure.in.in: Target .net 2.0 profile
	* gapi-cdecl-insert: Kill. We are now using the UnmanagedFunctionPointerAttribute
	for callbacks.
	* glib/CdeclCallback: Mark obsolete.
	* generator/*.cs:
	* *.custom: Use [UnmanagedFunctionPointer (CallingConvention.Cdecl)] instead of
	[GLib.CDeclCallback].

svn path=/trunk/gtk-sharp/; revision=137323
2009-07-02 20:18:10 +00:00
Mike Kestner
89afb3f49f 2008-12-19 Mike Kestner <mkestner@novell.com>
* generator/BoxedGen.cs: don't generate glue dependencies.
	* glib/*.cs: remove glibsharpglue usage except thread.c.
	* glib/glue/*.c: kill all but thread.c. need glib 2.20 to kill
	it eventually.
	* pango/Attr*.cs: kill glue usage.
	* pango/glue/*.c: kill all but generated.c. it's next.
	* gtk/TreeIter.custom: kill a dumb glibsharpglue usage.

svn path=/trunk/gtk-sharp/; revision=121880
2008-12-19 18:57:42 +00:00
Andrés G. Aragoneses
470776ccea * glib/Signal.cs: Improve protection against invalid signals.
svn path=/trunk/gtk-sharp/; revision=121045
2008-12-08 21:54:20 +00:00
Mike Kestner
4de7ad4914 2008-10-29 Mike Kestner <mkestner@novell.com>
* glib/Signal.cs : custom marshaling hooks
	* glib/SignalClosure.cs : support for custom marshalers.

svn path=/trunk/gtk-sharp/; revision=117424
2008-10-29 21:41:57 +00:00
Andrés G. Aragoneses
a4bc03d66d 2008-09-05 Andrés G. Aragoneses <aaragoneses@novell.com>
Fixes BNC#387220.
        * glib/glue/signal.c: New glue file to call g_signal_query().
        * glib/glue/Makefile.am: Add signal.c.
        * glib/Signal.cs: check return type prior to emitting.


svn path=/trunk/gtk-sharp/; revision=112360
2008-09-05 07:38:11 +00:00
Mike Kestner
dee1e4f321 2008-08-27 Mike Kestner <mkestner@novell.com>
* glib/Signal.cs: multiple dispose guarding for closures.

svn path=/trunk/gtk-sharp/; revision=111710
2008-08-27 14:54:34 +00:00
Mike Kestner
47e002a7d4 2008-08-20 Mike Kestner <mkestner@novell.com>
* glib/Object.cs:
	* glib/Signal.cs: fix a couple 2.0-isms.  Patch from Christian Hoff.

svn path=/trunk/gtk-sharp/; revision=111574
2008-08-25 20:43:09 +00:00
Andrés G. Aragoneses
52e68fbeb6 * atk/Object.custom: Track API changes in GLib.Signal.
* glib/Signal.cs: AddEmissionHook binding (for closing #386950), and
  change API of Emit to mimic the detailed_signal pattern.
* glib/GType.cs: GType.FromName: new wrapper for native call.
* glib/ObjectManager.cs: Use the new FromName managed method.

svn path=/trunk/gtk-sharp/; revision=103198
2008-05-14 16:03:13 +00:00
Mike Kestner
0780ed3c0d 2008-04-30 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs:
	* generator/Signal.cs: use generic signal marshaling instead of
	generating signature specific marshaling callbacks.
	* glib/glue/closure.c: glue for new closure impl.
	* glib/Object.cs: open up a couple hashes internally. 
	* glib/Signal.cs: hook in closure based connection and expose
	EmissionHook functionality for atk usage.
	* glib/SignalClosure.cs: new generic signal marshaling mechanism.
	* glib/ToggleRef.cs: null guarding in Target and let Signal remove
	itself from hash when it disposes itself.

svn path=/trunk/gtk-sharp/; revision=102241
2008-04-30 20:15:45 +00:00
Andrés G. Aragoneses
a0d608fcd2 * glib/Signal.cs: Remove unneeded cast.
svn path=/trunk/gtk-sharp/; revision=101704
2008-04-24 17:18:59 +00:00
Andrés G. Aragoneses
d0b8f4c279 * atk/Object.custom: custom protected method for firing
the ChildrenChanged signal.
* glib/Signal.cs: first implementation of a managed
method for emitting signals.

svn path=/trunk/gtk-sharp/; revision=101700
2008-04-24 17:11:11 +00:00
Mike Kestner
776aeccdbb 2008-01-22 Mike Kestner <mkestner@novell.com>
* glib/Object.cs: expose an internal ToggleRef prop.
	* glib/Signal.cs: use ToggleRef for lookups instead of Object. Add
	a Free method and release connections and gchandles.
	* glib/ToggleRef.cs: add signal hash and release signals on free.

svn path=/trunk/gtk-sharp/; revision=93548
2008-01-22 16:54:44 +00:00
Mike Kestner
209f353fc8 2007-12-06 Mike Kestner <mkestner@novell.com>
* * : update to 2.12 API.

svn path=/trunk/gtk-sharp/; revision=90823
2007-12-06 17:23:28 +00:00
Mike Kestner
3839abb463 2007-11-29 Mike Kestner <mkestner@novell.com>
* glib/Signal.cs: ignore GCHandles with null targets since
	their object has been collected.  [Fixes #344250 again]

svn path=/trunk/gtk-sharp/; revision=90428
2007-11-29 14:36:26 +00:00
Mike Kestner
70018d857d 2007-11-16 Mike Kestner <mkestner@novell.com>
* glib/Object.cs: use toggle refs for all objects.
	de-obsolete Data hash.  Add internal Signals hash.
	* glib/Signal.cs: switch to weak gchandles.
	* glib/WeakObject.cs: kill.

svn path=/trunk/gtk-sharp/; revision=89776
2007-11-16 18:35:38 +00:00
Mike Kestner
925a2b63c3 2007-10-04 Mike Kestner <mkestner@novell.com>
* glib/DestroyNotify.cs: add CDeclCallback to the delegate.
	* glib/Signal.cs: use DestroyHelper.
	* gdk/Input.custom: use DestroyHelper.
	* gtk/Quit.custom: remove new on DestroyHelper handler.
	* gtk/TreeModelFilter.custom: remove new on DestroyHelper handler.
	* gtk/TreeViewColumn.custom: remove new on DestroyHelper handler.

svn path=/trunk/gtk-sharp/; revision=86897
2007-10-04 17:52:35 +00:00
Mike Kestner
fd01afc12b 2007-03-08 Mike Kestner <mkestner@novell.com>
* glib/Signal.cs : guard against NULL gchandles.
	* gdk/Input.custom : add try/catch blocks to native callbacks.
	* gtk/*.custom : ditto
	* gtk/NodeStore.cs : ditto

svn path=/trunk/gtk-sharp/; revision=74004
2007-03-09 14:22:43 +00:00
Mike Kestner
57810954a3 2007-03-08 Mike Kestner <mkestner@novell.com>
* glib/*.cs : add try/catch blocks to native callback
	methods for DestroyNotify, Copy/Free, and ToggleNotify handlers.  
	Raise UnhandledException events on catches.  

svn path=/trunk/gtk-sharp/; revision=73965
2007-03-08 20:28:24 +00:00
Mike Kestner
32de2832db 2007-03-06 Mike Kestner <mkestner@novell.com>
* generator/Signal.cs : add try/catch blocks to native callback
	delegates so that exceptions are not propagated across the native
	boundary.  Now raises GLib.ExceptionManager.UnhandledException.
	* glib/ExceptionManager.cs : new class with UnhandledException
	event and a static method to raise it.
	* glib/Signal.cs : wrap the generic EventHandler callback delegate
	with try/catch blocks and raise the UnhandledException event.

svn path=/trunk/gtk-sharp/; revision=73840
2007-03-06 20:10:15 +00:00
John Luke
a12a4b48f0 2005-08-26 John Luke <john.luke@gmail.com>
* glib/Signal.cs: deal with obj.Handle == IntPtr.Zero
        to avoid assertions


svn path=/trunk/gtk-sharp/; revision=48959
2005-08-27 00:27:42 +00:00
Mike Kestner
b957224b9f 2005-05-04 Mike Kestner <mkestner@novell.com>
* glib/Signal.cs : s/DestroyNotify/SignalDestroyNotify to fix mcs 1.0
	compilation.
	* gdk/Input.custom : ditto.

svn path=/trunk/gtk-sharp/; revision=44046
2005-05-04 20:36:55 +00:00
Mike Kestner
4caefdec00 2005-03-25 Mike Kestner <mkestner@novell.com>
* */*.cs : tag native callback delegates with [CDeclCallback].
	* */*.custom : tag native callback delegates with [CDeclCallback].

svn path=/trunk/gtk-sharp/; revision=42253
2005-03-25 17:57:15 +00:00
Mike Kestner
90a870e2de 2005-03-08 Mike Kestner <mkestner@novell.com>
* */*.cs : scrub for StringToPtrAnsi and string usage in DllImports.
	* */*.custom : begin the scrub here too.
	* generator/ConstStringGen.cs : implement IManualMarshaler and move to
	100% IntPtr marshaling.
	* generator/Ctor.cs : call Body.Finish too.
	* generator/IManualMarshaler.cs : new interface for generatables that
	marshal manually and need cleanup.
	* generator/Makefile.am : new file.
	* generator/MethodBody.cs : use IManualMarshaler if applicable.

svn path=/trunk/gtk-sharp/; revision=41579
2005-03-08 21:28:08 +00:00
Mike Kestner
6590388024 2005-02-02 Mike Kestner <mkestner@novell.com>
* generator/Makefile.am : remove source file.
	* generator/Signal.cs : generate marshaling callbacks and use new
	GLib.Signal marshaling class for events.
	* generator/SignalHandler.cs : kill. byebye SignalCallback subclasses.
	* glib/Makefile.am : update source files.
	* glib/GLibSharp.voidObjectIntPtrSignal.cs : kill.
	* glib/Object.cs : mark the old Before/After props Obsolete. Use
	GLib.Signal for the notify prop methods.
	* glib/Signal.cs : new signal marshaling class.  It manages all the 
	ConnectBefore/After stuff internally and connects itself to the native
	object using GCHandles and DestroyNotify lifecycle management.
	* glib/SignalCallback.cs : mark Obsolete.
	[Fixes #72018 and #69847]

svn path=/trunk/gtk-sharp/; revision=40007
2005-02-02 21:57:15 +00:00