Commit Graph

508 Commits

Author SHA1 Message Date
Mike Kestner
02bac350eb Avoid collisions in generated variable usage.
* generator/CallbackGen.cs: s/result/__result/ for temporary callback
return values in the native invoker generation.
2011-01-22 19:43:14 -06:00
Mike Kestner
0c6b54c9d9 Collision detection for iface method -> prop.
* generator/ObjectGen.cs: detect method collisions on interfaces
against the object properties to avoid duplicate property generation.
2011-01-22 13:06:01 -06:00
Mike Kestner
8459ac5560 Initial support for GVariant
* generator/SymbolTable.cs : add GVariant type mapping.
* glib/Variant.cs: initial implementation of an opaque class to expose
the GVariant type from glib.  We won't make any attempt to combine managed
references since there is no "toggle" ref capability.  We'll do a one-to-one
ref_sink/unref pair on construction/dispose.
2011-01-22 12:52:38 -06:00
Mike Kestner
fe2d4c311a Flatten the bootstrap and remove glade-sharp
2010-11-21  Mike Kestner  <mkestner@novell.com>

	* removed the glade dir from the build since libglade is
	no longer supported in gnome3.  removed the gapi2-compat stuff
	since it doesn't make much sense now.  Removed the bootstrap
	mechanism since we are unlikely to be releasing multiple API
	versions from the same tree going forward.  The build is now a
	straight autogen.sh like most autotools projects.
2010-11-21 21:18:06 -06:00
Mike Kestner
a948792be0 2009-11-30 Mike Kestner <mkestner@novell.com>
* */Makefile.am: standardize on - options over / options for 
	consistency.  Also assists with build on msys. [Fixes #550667]

svn path=/trunk/gtk-sharp/; revision=147125
2009-11-30 20:40:34 +00:00
Mike Kestner
536c3aca54 2009-11-30 Mike Kestner <mkestner@novell.com>
* generator/Method.cs: support win32_utf8_variant attribute on methods.
	* glib/*.cs: support win32 utf8 variant methods.
	* gtk/*.custom: support win32 utf8 variant methods.
	* gtk/Gtk.metadata: mark some win32_utf8_variant methods.
	  [Fixes #550961] Adapted from a patch by Tor Lillqvist.

svn path=/trunk/gtk-sharp/; revision=147113
2009-11-30 17:39:11 +00:00
Christian Hoff
88a7a7305c 2009-11-23 Christian Hoff <christian_hoff@gmx.net>
* generator/Signal.cs: Return a GInterfaceAdapter in the signalargs's
	accessor properties instead of trying to return the implementor as stored in
	the arguments array.

svn path=/trunk/gtk-sharp/; revision=146744
2009-11-23 17:19:46 +00:00
Mike Kestner
c5c48dfd1c 2009-09-23 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs: support metadata override of default return
	values.  Based on a patch from Sebastian Dröge. [Fixes #541299]

svn path=/trunk/gtk-sharp/; revision=142516
2009-09-23 21:27:15 +00: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
50355ad102 2009-08-19 Christian Hoff <christian_hoff@gmx.net>
* generator/*.cs: Add the "partial" keyword to each generated class, 
	struct and interface.

svn path=/trunk/gtk-sharp/; revision=140257
2009-08-19 16:13:17 +00:00
Christian Hoff
08b43fbd76 2009-08-13 Christian Hoff <christian_hoff@gmx.net>
* generator/IGeneratable.cs: Remove MarshalReturnType, ToNativeReturnType,
	FromNativeReturn and ToNativeReturn as they never returned something else
	than MarshalType, FromNative/AllocNative and CallByName, respectively.
	* generator/Signal.cs: Use AllocNative for IManualMarshalers.

svn path=/trunk/gtk-sharp/; revision=139849
2009-08-13 14:46:33 +00:00
Mike Kestner
7db633218f 2009-08-07 Mike Kestner <mkestner@novell.com>
* configure.in.in: add new dir and autofu for it.
	* Makefile.am: add new dir
	* gapi/*: a small extension method library to add generation-related
	api to GType in 2.0. Access it with -pkg:gapi-2.0-compat to pick up
	the needed refs.
	* generator/GObjectVM.cs: generate new GType getter methods.
	* generator/ObjectGen.cs: generate new GType getter methods.
	* glib/GType.cs: change a few props to methods to make them extension
	method friendly for 2.0 compat.
	* glib/Object.cs: use new GType getter methods.
	* glib/Value.cs: use new GType getter methods.
	* gtk/Widget.custom: use new GetClassPtr method.

svn path=/trunk/gtk-sharp/; revision=139609
2009-08-08 23:42:15 +00:00
Mike Kestner
10cae1b1cb 2009-08-07 Mike Kestner <mkestner@novell.com>
* generator/ObjectGen.cs: kill GType ctor generation.
	* glib/InitiallyUnowned.cs: kill obsolete GType ctor.
	* glib/Object.cs: kill obsolete GType ctor.
	* gtk/Gtk.metadata: kill disable_gtype_ctor rules.
	* gtk/Widget.cs: kill obsolete GType ctor.

svn path=/trunk/gtk-sharp/; revision=139600
2009-08-08 03:06:53 +00:00
Christian Hoff
6002d77051 2009-08-05 Christian Hoff <christian_hoff@gmx.net>
* generator/InterfaceGen: Override CallByName to handle interface
	adaptors properly.	[Fixes #527478]

svn path=/trunk/gtk-sharp/; revision=139390
2009-08-05 06:24:27 +00:00
Mike Kestner
b122c1b11d 2009-07-30 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs: remove var keyword usage to fix build on
	.Net 2.0.  fix a couple mixed line endings as well.

svn path=/trunk/gtk-sharp/; revision=139109
2009-07-30 18:33:15 +00:00
Christian Hoff
c969175187 2009-07-24 Christian Hoff <christian_hoff@gmx.net>
* generator/gapi3-codegen.in, parser/gapi3-fixup.in, parser/gapi3-parser.in:
	"svn add" a few missing files to resurrect the build.

svn path=/trunk/gtk-sharp/; revision=138603
2009-07-24 05:19:17 +00:00
Christian Hoff
a4331a40ed 2009-07-23 Christian Hoff <christian_hoff@gmx.net>
* configure.in.in, Makefile.include: Bump up GAPI version to 3.0.
	* bootstrap-2.14: Renamed to bootstrap-for-the-insane, added message
	of doom.	[Fixes #521449]

svn path=/trunk/gtk-sharp/; revision=138572
2009-07-23 17:18:03 +00:00
Gabriel Burt
1cd652998e 2009-07-13 Gabriel Burt <gabriel.burt@gmail.com>
* generator/GenBase.cs: Add AppendCustom override that you can pass the
	type name in, used to include .custom for Name + Adapter and Name +
	Implementor .custom files for interface gen.

	* generator/InterfaceGen.cs: Use the new AppendCustom override for the
	Name + Adapter.custom file, and add support for including custom file for
	the Name + Implementor interface; necessary to manually implement an
	interface method.

svn path=/trunk/gtk-sharp/; revision=137809
2009-07-13 18:55:08 +00:00
Mike Kestner
45c8f24cdf 2009-07-12 Mike Kestner <mkestner@novell.com>
* generator/Parameters.cs: another owned parameter patch from Sebastian.
	[Fixes #498498]

svn path=/trunk/gtk-sharp/; revision=137757
2009-07-12 22:01:52 +00:00
Mike Kestner
0f10232e71 2009-07-12 Mike Kestner <mkestner@novell.com>
* generator/ObjectBase.cs: add CallByName overload with ownership.
	* generator/Parameters.cs: support owned by callee parameters.
	Adapted from a patch by Maarten Bosmans. [Fixes #513680]

svn path=/trunk/gtk-sharp/; revision=137754
2009-07-12 21:21:25 +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
Christian Hoff
f84bc5f1ac 2009-06-08 Christian Hoff <christian_hoff@gmx.net>
* generator/Signal.cs: Fix indexing of the signal arguments array for
	"out" and "ref" parameters.  [Fixes #508572]

svn path=/trunk/gtk-sharp/; revision=135661
2009-06-08 13:21:01 +00:00
Aaron Bockover
9d215affce 2009-05-28 Aaron Bockover <abockover@novell.com>
* generator/EnumGen.cs: Fix enum generator to properly parse integer
    values with type modifier suffixes (UL, L, U), and not accidentally
    munge named values that happen to end in one of these suffixes


svn path=/trunk/gtk-sharp/; revision=134980
2009-05-28 18:49:11 +00:00
Mike Kestner
60618ca6f0 2009-05-06 Mike Kestner <mkestner@novell.com>
* generator/EnumGen.cs: support 1L long values or explicit types.

svn path=/trunk/gtk-sharp/; revision=133685
2009-05-06 20:52:24 +00:00
Mike Kestner
2d8692338d 2009-05-06 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs: null-term array marshaling for vms.
	* generator/VirtualMethod.cs: use ToNative return type in native 
	callbacks.
	[Fixes #501294] Patch by Sebastian Dröge.

svn path=/trunk/gtk-sharp/; revision=133670
2009-05-06 16:20:35 +00:00
Mike Kestner
8c8138e17e 2009-05-06 Mike Kestner <mkestner@novell.com>
* generator/FieldBase.cs: mangle compound typenames for glue.
	[Fixes #501329] Patch by Sebastian Dröge.

svn path=/trunk/gtk-sharp/; revision=133659
2009-05-06 14:58:39 +00:00
Mike Kestner
20ad2b1a31 2009-05-06 Mike Kestner <mkestner@novell.com>
* generator/VirtualMethod.cs: refactoring to reuse retval prop.
	[Fixes #501307] Patch by Sebastian Dröge.

svn path=/trunk/gtk-sharp/; revision=133658
2009-05-06 14:15:21 +00:00
Christian Hoff
8996f860ad 2009-05-04 Christian Hoff <christian_hoff@gmx.net>
* generator/ClassField.cs: Derive from StructField.
	* generator/ObjectBase.cs: Implement validation mechanism for
	class structures. If the structure contains bitfields or fields
	of unknown types, we cannot generate it in managed code.
	* generator/GObjectVM.cs: Fall back to glue if the class structure
	cannot be generated.	[Fixes #498051]

svn path=/trunk/gtk-sharp/; revision=133514
2009-05-04 17:39:45 +00:00
Mike Kestner
9e3a996ea6 2009-04-28 Mike Kestner <mkestner@novell.com>
* generator/Parameters.cs: ref parameter marshaling fix.
	[Fixes #498472] Patch by Sebastian Dröge.

svn path=/trunk/gtk-sharp/; revision=132863
2009-04-28 17:09:41 +00:00
Mike Kestner
39739ae746 2009-04-25 Mike Kestner <mkestner@novell.com>
* generator/OpaqueGen.cs: support abstract opaque classes,
	though I have no idea why anyone would want one.
	[Fixes #494212] Revised patch from Sebastian Dröge.

svn path=/trunk/gtk-sharp/; revision=132678
2009-04-26 03:21:47 +00:00
Mike Kestner
a2715073d1 2009-04-25 Mike Kestner <mkestner@novell.com>
* generator/OpaqueGen.cs: support declaring managed ifaces.
	[Fixes #494193] Revised patch from Sebastian Dröge.

svn path=/trunk/gtk-sharp/; revision=132675
2009-04-26 02:57:11 +00:00
Stephane Delcroix
89702a7e51 Read the name attribute for constructors converted to static factory methods
svn path=/trunk/gtk-sharp/; revision=132561
2009-04-24 08:08:17 +00:00
Christian Hoff
291ee61b2d 2009-04-13 Christian Hoff <christian_hoff@gmx.net>
Add support for virtual methods(vm) to the generator.

	* parser/gapi2xml.pl: Generate a class_struct element with
	all members of the class structure. Dump the first (instance)
	parameter for signal and vm elements. Bump up parser version.
	* generator/GObjectVM.cs: Added. Support for GObject virtual methods.
	* generator/DefaultSignalHandler.cs: Signal specific part of vm
	generation.
	* generator/InterfaceVM.cs: New class for interface vms.
	* generator/ObjectBase.cs: Parse the class struct.

svn path=/trunk/gtk-sharp/; revision=131604
2009-04-13 17:44:48 +00:00
Christian Hoff
01ed1a5e3e 2009-03-19 Christian Hoff <christian_hoff@gmx.net>
* parser/gapi2xml.pl: Introduce a "parser_version" attribute.
	* generator/GenBase.cs: Implement a property to access the
	attribute's value.

svn path=/trunk/gtk-sharp/; revision=129807
2009-03-19 18:13:01 +00:00
Mike Kestner
bc188c9358 2009-01-29 Mike Kestner <mkestner@novell.com>
* generator/OpaqueGen.cs: generate a finalizer for classes which
	have free or unref methods and ensure it runs on the gui thread.
	* glib/Opaque.cs:  remove finalize handling.
	Fixes a 'resurrection' issue with the previous 419777 fix.

svn path=/trunk/gtk-sharp/; revision=124940
2009-01-29 16:26:09 +00:00
Mike Kestner
756e0c49b9 2009-01-08 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs: generate Adapters for consume_only ifaces
	too.  This seems unusual, but is primarily to produce at least one
	'generic' implementation of every interface and a GetObject method
	so that the marshaling code can always return an object which
	implements the interface, even if no public object wrapper exists for
	the underlying c GObject type.

svn path=/trunk/gtk-sharp/; revision=122814
2009-01-08 19:27:54 +00:00
Mike Kestner
1a16f66803 2009-01-08 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs: map gfilename* list elements to type
	ListBase.FilenameString so they are marshaled correctly.
	* glib/Marshaller.cs: handle FilenameStrings in ListPtrToArray.
	* gtk/Gtk.metadata: FileChooser.GetFilenames and ListShortcutFolders
	return type mangling to avoid custom implementations.
	* gtk/FileChooser*.custom: kill manual Filenames and ShortcutFolders.

svn path=/trunk/gtk-sharp/; revision=122802
2009-01-08 18:43:00 +00:00
Mike Kestner
3030c6d535 fix inconsistent line endings
svn path=/trunk/gtk-sharp/; revision=122798
2009-01-08 18:00:47 +00:00
Mike Kestner
f38c129f6d 2009-01-07 Mike Kestner <mkestner@novell.com>
* generator/MethodBody.cs: avoid null ref when passing null to
	destroy notified callback parameters. [Fixes #464120]

svn path=/trunk/gtk-sharp/; revision=122677
2009-01-07 17:10:08 +00:00
Mike Kestner
146deaa38c 2009-01-04 Mike Kestner <mkestner@novell.com>
* *: update to 2.14.  parser support for GSEALed fields. svn build
	now uses bootstrap-2.14.  integrate gio-sharp module.  

svn path=/trunk/gtk-sharp/; revision=122402
2009-01-04 22:29:56 +00:00
Andrés G. Aragoneses
a8b28619be 2008-12-22 Andrés G. Aragoneses <aaragoneses@novell.com>
* glib/GType.cs: simplify, avoiding a static method.  
        * generator/InterfaceGen.cs: track API.
        * glib/Value.cs: reuse g_type_is_a.
        [Improves fix for #448009 in r121990]


svn path=/trunk/gtk-sharp/; revision=121991
2008-12-22 17:16:03 +00:00
Andrés G. Aragoneses
8191911b26 2008-12-22 Andrés G. Aragoneses <aaragoneses@novell.com>
* generator/InterfaceGen.cs: use the new GLib API to detect
	instances that don't implement GInterfaces.
	* glib/GType.cs: add new API for checking if an IntPtr instance
	implements a certain GType.
	[Fixes #448009]


svn path=/trunk/gtk-sharp/; revision=121990
2008-12-22 17:02:09 +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
Stephane Delcroix
66be12eebe 2008-12-02 Stephane Delcroix <sdelcroix@novell.com>
* generator/Ctor.cs:
	* generator/Method.cs:
	* generator/MethodBase.cs: refactor the Protection from Method to
	MethodBase, generate ctors with the correct proteciton too.

svn path=/trunk/gtk-sharp/; revision=120487
2008-12-02 15:03:02 +00:00
Mike Kestner
0018a5a4f0 2008-11-28 Mike Kestner <mkestner@novell.com>
* generator/Signal.cs: remove ref int workaround now that we fallback
	to signal-specific marshalers for G_TYPE_POINTER using signals.
	Fixes #450119.

svn path=/trunk/gtk-sharp/; revision=120254
2008-11-28 20:16:26 +00:00
Mike Kestner
74105a1c80 2008-11-05 Mike Kestner <mkestner@novell.com>
* atk/atk-api-2.12.raw: regen
	* gtk/gtk-api-2.12.raw: regen
	* generator/Signal.cs: reinstate old custom marshaler generation and
	generate custom marshaling when 'manual' attr is set.
	* parser/gapi2xml.pl: set manual attr on sigs that have G_TYPE_POINTER
	parameters since the generic closure can't cope with them.

svn path=/trunk/gtk-sharp/; revision=118068
2008-11-06 02:23:21 +00:00
Mike Gorse
c9d658f381 2008-11-04 Mike Gorse <mgorse@novell.com>
* glib/PtrArray.cs, glib/glue/ptrarray.c, glib/Makefile.am,
	  glib/glue/Makefile.am, glib/gtype.cs, generator/SymbolTable.cs,
	  generator/ReturnValue.cs: Add PtrArray.
	* glib/Marshaller.cs: Add PtrArrayToArray.

	* atk/Atk.metadata: Specify GetTarget return type.

	* atk/Object.custom, atk/glue/object.c: Support overriding
	  RefRelationSet.

svn path=/trunk/gtk-sharp/; revision=117919
2008-11-04 20:17:00 +00:00
Andrés G. Aragoneses
d677bb90f0 Fixes BNC#426876.
* generator/InterfaceGen.cs: throw ArgumentNullException in
the Adapter's constructor that receives an implementor.

svn path=/trunk/gtk-sharp/; revision=115571
2008-10-12 15:20:52 +00:00
Mike Kestner
efc522e7f9 2008-09-30 Mike Kestner <mkestner@novell.com>
* generator/EnumGen.cs:
	* generator/InterfaceGen.cs:
	* generator/StructBase.cs: fix build breakage in prev commit.

svn path=/trunk/gtk-sharp/; revision=114509
2008-09-30 21:21:53 +00:00