Commit Graph

20 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
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
84a63992fd remove a C.WL, oops
svn path=/trunk/gtk-sharp/; revision=119652
2008-11-21 17:47:37 +00:00
Mike Kestner
8d6e58e175 2008-11-21 Mike Kestner <mkestner@novell.com>
* glib/ManagedValue.cs: rework to ref count a ManagedValue instance
	and pass a GCHandle to it around, instead of taking out multiple
	gchandles on the managed target itself.

svn path=/trunk/gtk-sharp/; revision=119648
2008-11-21 17:42:16 +00:00
Mike Kestner
b177644f06 2007-06-05 Mike Kestner <mkestner@novell.com>
* glib/ManagedValue.cs (ReleaseWrapper): new method.
	* glib/Value.cs : release the ManagedValue wrapper to avoid leaks.
	[Fixes #81799]

svn path=/trunk/gtk-sharp/; revision=78669
2007-06-05 19:53:34 +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
e3a26238b6 2005-03-31 Mike Kestner <mkestner@novell.com>
* glib/ManagedValue.cs : add null/NULL guarding to Copy, Free, 
	WrapObject, and ObjectForWrapper.  [Fixes #74197]

svn path=/trunk/gtk-sharp/; revision=42434
2005-03-31 16:31:31 +00:00
Mike Kestner
17dc787956 remove some c.wls
svn path=/trunk/gtk-sharp/; revision=42222
2005-03-24 16:22:49 +00:00
Mike Kestner
ac4cc59206 2005-03-23 Mike Kestner <mkestner@novell.com>
* gapi-cdecl-insert : a little perl script to insert modopts
	* Makefile.am : dist the new script.
	for cdecl callback delegates on win32.
	* glade/makefile.win32 : use gapi-cdecl-insert
	* glade/XML.custom : add [GLib.CDeclCallback] to RawXMLConnectFunc.
	* glib/makefile.win32 : use gapi-cdecl-insert
	* glib/CDeclCallbackAttribute.cs : new attr to tag delegates with
	that will be invoked from native code. We have to mangle the il
	with a modopt otherwise they are stdcall'd.
	* glib/ManagedValue.cs : add [GLib.CDeclCallback] to Copy/Free.
	switch to using GCHandles instead of the current IntPtr hack.

svn path=/trunk/gtk-sharp/; revision=42168
2005-03-23 20:35: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
652b7fc82f remove a bunch of doc comments
svn path=/trunk/gtk-sharp/; revision=30951
2004-07-09 15:25:39 +00:00
Mike Kestner
7a6d6b2128 2004-06-25 Mike Kestner <mkestner@ximian.com>
* */*.cs : add lgpl license blurb and clean up (c)'s.
	* */*.custom : add lgpl license blurb and clean up (c)'s.
	* */glue/*.c : add lgpl license blurb and clean up (c)'s.
	file adds without license from now on are punishable by wedgie.

svn path=/trunk/gtk-sharp/; revision=30401
2004-06-25 18:42:19 +00:00
Mike Kestner
73632b2747 2004-05-28 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : adjust to ObjectManager ns change.
	* glib/ManagedValue.cs : move to GLib and internalize.
	* glib/Object.cs : adjust to ObjectManager ns change.
	* glib/ObjectManager.cs : move to GLib.
	* glib/TypeConverter.cs : move to GLib.  return ManagedValue.GType
	when we can't match a type instead of GType.None.
	* gtk/*.custom: adjust for new TypeConverter ns and behavior.

2004-05-28  Mike Kestner  <mkestner@ximian.com>

	* en/* : run updater. fix a few *Sharp copy/pastisms.

svn path=/trunk/gtk-sharp/; revision=28362
2004-05-28 16:59:21 +00:00
Mike Kestner
d723bf3cef 2004-02-03 Mike Kestner <mkestner@ximian.com>
* glib/ManagedValue.cs : null check on Free.
	* glib/Value.cs : some ManagedValue rework because we unset now.

svn path=/trunk/gtk-sharp/; revision=22728
2004-02-03 06:24:42 +00:00
Mike Kestner
ff263164e3 2003-12-15 Mike Kestner <mkestner@ximian.com>
* generator/BoxedGen.cs : s/uint/GLib.GType
	* generator/ManualGen.cs : add a ctor to pass ToNative handle name
	* generator/ObjectGen.cs : s/uint/GLib.GType
	* generator/Signal.cs : use GLib.GType and call OverrideVirtualMethod
	* generator/SymbolTable.cs : make GType a ManualGen and update a few
	ManualGens to the new signatures.
	* glib/DefaultSignalHandler.cs : s/Type/System.Type
	* glib/ManagedValue.cs : s/uint/GLib.GType
	* glib/Object.cs : s/uint/GLib.GType, add OverrideVirtualMethod.
	* glib/Type.cs : s/uint/IntPtr, add static fields for fundamentals.
	make it a value type and add ==, !=, Equals, and GetHashCode.
	* glib/TypeConverter.cs : use new GType statics, not fundamentals.
	* glib/Value.cs : use new GType statics, not fundamentals.
	* gnome/*.custom : s/uint/GLib.GType
	* gtk/*Store.custom : use GType statics, not fundamentals.
	* sample/Subclass.cs : s/uint/GLib.GType.

svn path=/trunk/gtk-sharp/; revision=21181
2003-12-15 16:59:25 +00:00
Rachel Hestilow
4faf8b6b74 2003-05-22 Rachel Hestilow <rachel@nullenvoid.com>
* glib/ManagedValue.cs, glib/Value.cs: A few old-style
	DllImports snuck in during my last commit; update them
	to use Win32 dll names.

svn path=/trunk/gtk-sharp/; revision=14819
2003-05-22 23:39:04 +00:00
Rachel Hestilow
f1a77c0e62 2003-05-19 Rachel Hestilow <rachel@nullenvoid.com>
* glib/ManagedValue.cs, TypeConverter.cs: Added.
	* glib/Value.cs: Make Value inherit from IDisposable, and
	move dtor to Dispose. Add generic object constructor
	with support for ManagedValue. Add a new Val property
	which will call the appropriate explicit cast.

	* glue/value.c: Add new glue function
	gtksharp_value_get_value_type.

	* gtk/TreeViewColumn.custom: Added.
	* gtk/ListStore.custom, TreeStore.custom: Add a number
	of SetValue overloads. Add convenience functtion
	AppendValues. Add new ctor that takes System.Type instead
	of GLib.TypeFundamentals. Add a GetValue convenience wrapper.
	* gtk/TreeView.custom: Add AppendColumn convenience
	functions.

	* sample/ManagedTreeViewDemo.cs: Added.
	* sample/Makefile.in: Update.
	* sample/TreeViewDemo.cs: Update to use new convenience
	APIs.

svn path=/trunk/gtk-sharp/; revision=14691
2003-05-19 07:18:52 +00:00