Commit Graph

594 Commits

Author SHA1 Message Date
Bertrand Lorentz
f0f998ccf3 generator: Fix compilation warning in some generated interface adapters
Don't generate a static field if it's not going to be used.

This fixes a compilation warning on the generated code for interfaces
that don't have virtual methods.
2012-11-18 11:10:18 +01: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
Bertrand Lorentz
f20970258e generator: Update the documentation in generator/DESIGN 2012-11-15 19:31:28 +01:00
Bertrand Lorentz
fdd1b201f7 generator: Fix misleading warning for callbacks in virtual methods
Wen generating a virtual method, the current member was not set in the
GenerationInfo. That caused the warning message about the callback scope
to refer to a wrong method name.
2012-11-15 15:06:07 +01:00
Bertrand Lorentz
fa32f2ec36 generator: Refactor the member hashes in ClassBase
Switch the hash tables used to store fields, properties and methods to
strong-type dictionaries, and make them private. Make the necessary
adjustments in the subclasses.
2012-11-04 17:26:26 +01:00
Bertrand Lorentz
eddc5fa796 generator: Use a Dictionary to hold the class structs cache
Again, nicer generated code, and no impact outside of it.
2012-11-04 16:58:49 +01:00
Bertrand Lorentz
3d6decbd0d generator: Use List<T> in generated constructors
This makes the generated code a bit nicer, but has no impact outside of
the generated constructors.
2012-11-04 16:58:49 +01:00
Bertrand Lorentz
15c5820cd8 generator: Rework data structures used by ManagedCallString
Use a single dictionary to hold the parameters and mark them as special,
instead of maintaining two lists in parallel.
2012-11-04 16:58:49 +01:00
Bertrand Lorentz
82a957bc9d generator: Switch a lot of collections to their generic counterpart
The additional type information makes the code a bit more safe
and readable.

At least one bug is fixed by this: in ObjectGen, an invalid child
property could still be generated, as it was not removed from the hash
table.

This should cause no real change to the generated code, except maybe in
the order of some members.
2012-11-04 16:58:49 +01:00
Bertrand Lorentz
687e986c55 generator: Add using statements in generated code for generics 2012-11-03 17:03:31 +01:00
Bertrand Lorentz
f748be34c1 generator: Implement Parameters using the generics class List<T>
A first step in the wonderful world of strong-typed collections. We
don't need to limit ourselves to the old ways of the .NET 1.1 profile.
2012-11-03 16:56:51 +01:00
Bertrand Lorentz
d467cce6e6 generator: Move some classes from Parameters.cs into their own file
This is just code being moved around, there are no real code changes.
2012-11-03 15:46:06 +01:00
Bertrand Lorentz
b8b1cfa5d7 generator: Convert all .cs files to Unix line endings
There are no real code changes in this commit.
2012-11-03 15:20:06 +01:00
Bertrand Lorentz
4f29defd5c generator: Add validation check for return values that are arrays
When a C function returns an array, we need to be able to determine its
length. This is done either through a parameter to that function, or
because the array is null-terminated. If we don't know about either of
those, we print out a warning and fail the validation for the return
value. This means the corresponding method will not be generated.

This fixes a crash when trying to generate a method for which this
information is missing.

This wasn't a problem until now because the parser doesn't handle array
return values, so they were always handled through fix-ups. But now we
can get a GAPI XML converted from GIR which contains the "array"
attribute for a return value but no other information.
2012-11-03 14:17:02 +01:00
Bertrand Lorentz
482dec1900 generator: Fix compilation warnings 2012-10-21 18:22:13 +02:00
Bertrand Lorentz
4d19e5ac2a generator: Properly handle boolean attributes when parsing the XML
In a lot of places, we were only checking the presence of boolean
attributes, like "array", automatically assuming they were true. This
meant that we didn't allow setting them explicitly to false, which
apparently is needed for some bindings.

For all boolean attributes, we now use the GetAttributeAsBoolean method
added in the previous commit, to correctly check the value of the
attribute. As before, if the attribute is not present, it is considered
to be false.

Thanks to Stephan Sundermann for noticing this issue.
2012-10-21 18:22:13 +02:00
Bertrand Lorentz
d35ef48f86 generator: Add a XmlElement.GetAttributeAsBoolean extension method
This will make it easier to correctly handle attributes that contain a
boolean value.
2012-10-21 18:21:54 +02:00
Stephan Sundermann
0b355e0335 generator: Fix abstract class generation
Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
2012-10-21 12:40:56 +02:00
Bertrand Lorentz
60612071c1 Add a MonoDevelop solution and projects for browsing the codebase
This is just to be able to use MonoDevelop to browse the codebase, both
custom and generated code. It is NOT intended to be used to build
anything.
2012-10-13 16:44:10 +02:00
Bertrand Lorentz
c1e9a8c613 generator: Remove support for .custom files
We don't use any .custom file anymore, and nobody should. You can
do the same things with partial classes, and they're much nicer.
2012-08-05 18:29:18 +02:00
Mike Kestner
9d319c8033 Merge pull request #26 from dufoli/master
ginterface properties support
2011-11-20 21:42:02 -08:00
Olivier Dufour
37d15305a3 GInterface: Add properties support 2011-11-20 19:41:56 +01:00
Mike Kestner
aae2b05300 Implement IEquatable<T> on structs.
* gdk/Gdk.metadata: suppress Color.GetHashCode().
* gdk/Point.custom: remove generated methods.
* generator/StructBase.cs: Generate Equals(T), Equals(object), and GetHashCode.
* generator/StructField.cs: helper property for equality testing.
* gtk/TreeIter.custom: remove generated methods.
2011-10-07 21:55:26 -05:00
Age Bosma
240ff0995a Add support for GValueArray type 2011-09-26 13:54:48 +02:00
Age Bosma
d900b32e93 Add support for gintptr and guintptr types 2011-09-26 13:53:32 +02:00
Mike Kestner
c6a3bf4b73 Fix TextBufferSerializeFunc signature
* generator/CallbackGen.cs: connect return value count parameters
* generator/ManagedCallString.cs: out count params aren't special
* generator/MethodBody.cs: don't finish hidden params
* generator/Parameters.cs: explicit IsCount setting support, with
    Parameters.GetCountParameter(name) interface. Clear IsCount
    values during validation if they have no associated array. Any
    remaining count params must be associated with a retval, so
    hide them.
* generator/ReturnValue.cs: support array_length_param attribute to
    associate a return value with a "count" param.  Use new helper
    methods to marshal these array retvals to IntPtr and back.
* glib/Marshaller.cs: support for byte[] marshaling to and from
    IntPtr using a count and type in the from native direction.
* gtk/Gtk.metadata: mark TextBufferSerializeFunc return type as
    an array with the length specific in the length param.
2011-04-28 18:38:07 -05:00
Mike Kestner
0fc5126228 Implement Ownable Generatable type.
* cairo/Context.cs: add ctor (IntPtr, bool owned)
* cairo/cairo-api.xml: expose cairo_t as new ownable symbol type
* generator/HandleBase.cs: implement IOwnable
* generator/IOwnable.cs: new interface for wrapping ownable types
* generator/Makefile.am: add new files to build
* generator/OwnableGen.cs: SimpleBase subclass to expose IOwnable
* generator/Parameters.cs: use IOwnable.FromNative instead of HandleBase
* generator/Parser.cs: parse ownable symbol type
* generator/ReturnValue.cs: use IOwnable.FromNative instead of HandleBase
2011-04-21 18:04:47 -05:00
Mike Kestner
1752fca097 Hush versioned scripts generally 2011-04-06 10:53:53 -05: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
d1b852bdf3 Add missing file.
* generator/LogWriter.cs: still getting used to this git thing...
2011-02-21 11:19:10 -06:00
Mike Kestner
2ba496479f Restructure log warnings in validation.
* generator/*.cs: Add a LogWriter class which formats warnings
consistently on the console.  Supports the concept of non-fatal
validation warnings, since it doesn't rely on the unrolling of the
validation stack to associate a warning to a given type.

Main purpose was to add a non-fatal warning for missing element_type
attributes on list return values, though it results in cleaner log
output, and also updates some warning messages to be more helpful in
how to resolve them.
2011-02-20 12:11:08 -06:00
Mike Kestner
001956432c Some more GIO interface cleanup
* generator/InterfaceGen.cs: don't grab the StreamWriter for consume-only.
* generator/InterfaceVM.cs: don't bitch or fail validation when missing
target on consume-only.
* generator/ObjectBase.cs: support a target_method attr on vms to point the
callback invocations at when the names don't match.
* gio/Gio.metadata: marks a few more ifaces consume-only until somebody
complains they need to implement one of them.
2011-02-12 15:52:57 -06:00
Mike Kestner
1794158599 Suppress override on iface ToString decls.
* generator/Method.cs: interface method declarations do not support or
need an override keyword, so block the generation of it when the implementor
and container_type indicate generation of the iface itself.
2011-02-12 15:27:10 -06:00
Mike Kestner
88af56dd68 Implement GVariantType binding.
* generator/SymbolTable.cs: add GVariantType mapping.
* glib/Makefile.am: add file
* glib/Value.cs: add cast to VariantType.
* glib/VariantType.cs: hand binding for yet another ref counted glib
type system.
2011-02-11 13:52:13 -06:00
Mike Kestner
0d44b5e973 Throw a more helpful exception for missing GetType.
* generator/InterfaceGen.cs: if we don't have a GetType method, it's
a fatal situation.  Throw an exception that identifies the iface in
question.
2011-01-30 23:28:02 -06:00
Mike Kestner
955cdcf123 Update Gdk to the 2.99 API
* cairo/Surface.cs: expose LookupSurface
* cairo/cairo-api.xml: add surface mapping
* gdk/*: updates and hobbling to get gdk building.  lots of work
to come.
2011-01-30 22:49:15 -06:00
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
Stephane Delcroix
a1f8ed79de 2008-09-30 Stephane Delcroix <sdelcroix@novell.com>
* generator/CallbackGen.cs:
	* generator/ClassGen.cs:
	* generator/EnumGen.cs:
	* generator/GenBase.cs:
	* generator/InterfaceGen.cs:
	* generator/Method.cs:
	* generator/OpaqueGen.cs:
	* generator/StructBase.cs:
	* generator/ObjectGen: check for the internal attribute
	* generator/Method.cs: check for the accessibility attribute;

svn path=/trunk/gtk-sharp/; revision=114497
2008-09-30 17:44:24 +00:00
Mike Kestner
eae4bed64f 2008-09-18 Mike Kestner <mkestner@novell.com>
* bootstrap-2.12: bump svn version.
	* generator/Signal.cs: add a workaround for G_TYPE_POINTER usage
	in the GtkEditable::text_inserted signal.  The signal parameter
	received by the closure will be an IntPtr, which we then have to
	use to read/write the value directly from unmanaged memory.
	[Fixes #427588]

svn path=/trunk/gtk-sharp/; revision=113547
2008-09-19 16:29:23 +00:00
Mike Kestner
667b1462d6 2008-09-18 Mike Kestner <mkestner@novell.com>
* generator/LPGen.cs: remove WIN64LONGS hackery.
	* generator/LPUGen.cs: remove WIN64LONGS hackery.
	* generator/SymbolTable.cs: for WIN64LONGS, map them directly to
	  (u)int SimpleGens instead of using the LP generatables.

svn path=/trunk/gtk-sharp/; revision=113420
2008-09-18 14:23:29 +00:00
Jeffrey Stedfast
ccb3ac6a13 2008-09-16 Jeffrey Stedfast <fejj@novell.com>
* generator/Property.cs (IsDeprecated): Allow "1" or "true".

	* generator/Method.cs (.ctor): Allow "1" or "true".

	* generator/ClassBase.cs: Allow a value of "true" to work the same
	as "1" for the deprecated and abstract attributes.


svn path=/trunk/gtk-sharp/; revision=113238
2008-09-16 23:21:50 +00:00
Jeffrey Stedfast
2afce85920 2008-09-16 Jeffrey Stedfast <fejj@novell.com>
* generator/ObjectGen.cs (Generate): Remove the extra generated
	space if the class isn't abstract.


svn path=/trunk/gtk-sharp/; revision=113237
2008-09-16 23:11:40 +00:00
Mike Kestner
899e942b48 2008-09-09 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs: warning cleanup.

svn path=/trunk/gtk-sharp/; revision=112615
2008-09-09 20:31:28 +00:00
Mike Kestner
eaa13bdd98 2008-08-27 Mike Kestner <mkestner@novell.com>
* generator/ManagedCallString.cs: use existing Parameters.IsHidden
	method to check for hidden user data. 

svn path=/trunk/gtk-sharp/; revision=111721
2008-08-27 17:18:41 +00:00
Mike Kestner
2d0fc94e2f 2008-08-27 Mike Kestner <mkestner@novell.com>
* generator/ManagedCallString.cs: revert last change.  There are a
	lot of "broken" callback sigs out there which expose user data because
	it's not in the last parameter in the list.  I don't think we can 
	reasonably make a change to hide all those at this point.  This change
	at least hides all the user_data which comes right before a GError 
	param at the end of the list.  I need to follow up with a change which
	handles data parameters in any parameter position, but allows the user
	to mark "exposed" data params for compatibility reasons.
	* generator/Parameters.cs: hide data params which are at the end of a
	list behind an error param.
	* gtk/Gtk.metadata: mark an array parameter on 
	TextBufferDeserializeFunc.

svn path=/trunk/gtk-sharp/; revision=111716
2008-08-27 16:23:32 +00:00
Mike Kestner
568fd5e2a8 2008-08-27 Mike Kestner <mkestner@novell.com>
* generator/ManagedCallString.cs: fixes for data parameter hiding
	in native to managed callback generation.

svn path=/trunk/gtk-sharp/; revision=111706
2008-08-27 13:51:49 +00:00
Mike Kestner
cab2f46db5 2008-08-20 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs: use new ListPtrToArray marshaler for
	lists with known element types.
	* glib/Marshaller.cs: new ListPtrToArray marshaller with more
	aggressive list disposal.
	* gtk/Container.custom: remove manual Children impl.  Use Children
	in GetEnumerator instead of pinvoking directly.
	* gtk/Gtk.metadata: remove hidden attr and add element type and owned 
	for Container.GetChildren to generate it properly.

svn path=/trunk/gtk-sharp/; revision=111173
2008-08-20 19:48:26 +00:00
Mike Kestner
b2e51e9989 2008-08-20 Mike Kestner <mkestner@novell.com>
Patch from Christian Hoff fixing bug #396195.
	* generator/Property.cs: handle interface adapter values.
	* generator/InterfaceGen.cs: register the gtype so mapping occurs
	automatically for interface adapters.  New GetObject overload to
	handle already wrapped objects more efficiently.
	* glib/Value.cs: handle set_Val for interface adapter objects.

svn path=/trunk/gtk-sharp/; revision=111154
2008-08-20 15:53:03 +00:00
Mike Kestner
7d611f77e4 2008-07-08 Mike Kestner <mkestner@novell.com>
Patch from Christian Hoff with a few minor tweaks.
	* generator/CallbackGen.cs: refactor to use ManagedCallString
	and drop a ton of redundant, half-baked code.
	* generator/ManagedCallString.cs: add Unconditional setup
	method for stuff that has to happen before the try block.
	Add "drop_first" concept so it can be reused by CallbackGen
	which doesn't drop first params.
	* generator/Signal.cs: use Unconditional method for prep.
	* generator/VirtualMethod.cs: use Unconditional method for prep.
	* gtk/Gtk.metadata: mark a ref param. [Fixes #394352]

svn path=/trunk/gtk-sharp/; revision=107494
2008-07-08 21:12:22 +00:00
Mike Kestner
64ff72c07f 2008-05-27 Mike Kestner <mkestner@novell.com>
* generator/Method.cs (GenerateBody): when generating value type
	methods, we should demarshal the 'this' memory before any ref or
	out parameters in the event that someone passes 'this' as a param.
	That will ensure that an updated value coming back from the native
	side ends up in the memory location.

svn path=/trunk/gtk-sharp/; revision=104166
2008-05-27 17:04:06 +00:00
Mike Kestner
621b39b531 2008-05-15 Mike Kestner <mkestner@novell.com>
* kill the makefile.win32 build system.  it has been unmaintained
	for quite some time, replaced by the auto* build in cygwin.

svn path=/trunk/gtk-sharp/; revision=103308
2008-05-15 17:36:46 +00:00