Commit Graph

6 Commits

Author SHA1 Message Date
Andrés G. Aragoneses
b15f2eede1 generator: provide a GType static property for adapters
In the same way all GLib.Object-derived classes provided by the
generator have a GType static property (i.e. Gtk.Widget), we need
the same for the *Adapter classes, to access their GType without having
an instance of it. (The first use case would be GStreamerSharp's
Gst.Bin.IterateAllByInterface ().)

For this, we cannot simply add the property to all adapter classes
and be done, because it would clash with a property which is already
there, but is non-static, that has the same name and same value
(this property is needed for complying GInterfaceAdapter abstract
class), so we rename this property to GInterfaceGType because
using this name for the static one would not be consistent with the
rest of the classes generated which already provide the static one
with the name "GType".
2013-10-13 17:45:09 +02:00
Bertrand Lorentz
306f422c38 Fix a crash during initialization of interfaces (bxc#8447)
GInterfaceInfo.Data was automatically set to be a GCHandle on the
interface adapter. But the generated GInterfaceInitHandlers were
not using it, just free'ing it.

But for the GInterface property support, the Data field is now used to
pass the class pointer, so casting it to a GCHandle to free it would
cause an exception.

We now don't assume anything about GInterfaceInfo.Data.
2012-11-17 17:34:50 +01:00
Mike Kestner
51d5faf651 Mark calling convention on GInterface callbacks
Fixes #583901.  Adapted from fix for 2.12 from Markus Henschel.

* glib/GInterfaceAdapter.cs: add UnmanagedFunctionPointer attrs
2011-07-24 18:29:04 -05:00
Christian Hoff
a7bebb15b1 2009-07-21 Christian Hoff <christian_hoff@gmx.net>
* glib/GInterfaceAdapter.cs: Fix a leak related to GCHandles not being freed.
	Patch from Mike Kestner with a minor tweak by me. [Fixes #523306]

svn path=/trunk/gtk-sharp/; revision=138263
2009-07-21 06:51:10 +00:00
Mike Kestner
3341e20c13 2007-10-15 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs : gen Handle props as overrides.
	* glib/GInterfaceAdapter.cs : add abstract Handle prop.
	* glib/Value.cs: add ctor (GInterfaceAdapter).

svn path=/trunk/gtk-sharp/; revision=87532
2007-10-15 20:25:05 +00:00
Mike Kestner
c93ecb7f88 2007-09-11 Mike Kestner <mkestner@novell.com>
* gtk/Gtk.metadata: virtual_method rules for GInterface generation.
	* generator/ReturnValue.cs (ToNative): new method for the virtual
	method generation.
	* generator/Parameters.cs (FromNative): null guarding.
	* generator/ManagedCallString.cs: rework for interface method
	generation including callback and error param support.
	* generator/CallbackGen.cs: Invoker support. new class that deals
	with persistence of native and wrapper delegates in native to managed
	callback method signatures.
	* generator/VirtualMethod.cs: support for generation of interface
	methods, and all the funky parameters that come with that.
	* generator/InterfaceGen.cs: Fill out the adapter implementation.
	* generator/MethodBody.cs: Initialize overload. Extend ThrowsException
	to support GError outside the last parameter slot.
	* glib/GInterfaceAttribute.cs: New attribute to mark interfaces and
	obtain adapter type.
	* glib/Object.cs (AddInterfaces): interface registration method.
	* glib/GInterfaceAdapter.cs: New abstract class for interface
	adapter generation.
	* glib/Makefile.am: add new files.

svn path=/trunk/gtk-sharp/; revision=85658
2007-09-11 20:34:24 +00:00