Commit Graph

638 Commits

Author SHA1 Message Date
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
Mike Kestner
39ac15b6b6 2008-05-02 Mike Kestner <mkestner@novell.com>
* generator/GenerationInfo.cs:  refactor glue writer implementation
	so that GlueEnabled means there is a valid glue writer available.
	Avoids crashes in scenarios where an unwriteable glue path is provided
	to the generator.  Generate a glue function which scans the type
	hierarchy of an object for the most-derived unmanaged ancestor so
	that we can invoke class methods on it, avoiding infinite recursions.
	* generator/Signal.cs: revamp the default handler vm overriding 
	mechanism.  When class fields exist which can be directly hooked into,
	we now generate glue to override and chain up to unmanaged base funcs.
	This avoids some strangeness in the g_signal_override_class_closure
	and g_signal_chain_from_overridden reported in #332300 and also lays
	the groundwork for automated generation of non-signal VMs.
	* gtk/Gtk.metadata: block signal glue generation for a few types which 
	don't seem to install headers.

svn path=/trunk/gtk-sharp/; revision=102350
2008-05-02 17:10:05 +00:00
Mike Kestner
399c8e8586 2008-05-01 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs: use CName and mangle it.  ClassFieldName
	is not guaranteed to be set now.
	* generator/Signal.cs: read ClassFieldName from the api xml.  Move 
	glue writer lookup inside the block to avoid exceptions for now.

svn path=/trunk/gtk-sharp/; revision=102276
2008-05-01 15:04:17 +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
Mike Kestner
11286d19c6 2008-04-15 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs: use new GLib.Opaque.OwnedCopy for owned
	opaque return values.
	* glib/Opaque.cs: introduce OwnedCopy property to support returning
	owned opaque instances from native to managed callbacks. 
	[Fixes #374641]

svn path=/trunk/gtk-sharp/; revision=100762
2008-04-15 19:43:16 +00:00
Marek Habersack
20d764bb6f 2008-04-08 Marek Habersack <mhabersack@novell.com>
* generator/InterfaceGen.cs: added a check for null obj in the
	generated GetObject method.

svn path=/trunk/gtk-sharp/; revision=100145
2008-04-08 20:59:34 +00:00
Mike Kestner
bdeb30bbad 2008-04-04 Mike Kestner <mkestner@novell.com>
* atk/Atk.metadata: markup all the Ref* methods to indicate owned refs.
	* generator/ReturnValue.cs: Add owned object ToNative handling.
	* generator/VirtualMethod.cs: Split ToNative call from managed method
	invocation to avoid duplicate calls in null checking scenarios.
	* glib/Object.cs: add OwnedHandle property for use by language binding
	code which needs to pass owned refs to native methods.

svn path=/trunk/gtk-sharp/; revision=99849
2008-04-04 16:10:08 +00:00
Mike Kestner
b1d6be02d5 2008-04-01 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs: support "generic" interface
	implementations like those exposed by gio.  This is specifically for
	libraries which return GTypes which are not exposed by the library
	but which implement GInterfaces which are exposed by the library.

svn path=/trunk/gtk-sharp/; revision=99541
2008-04-01 16:08:33 +00:00
Mike Kestner
de56504f8b 2008-03-21 Mike Kestner <mkestner@novell.com>
* bootstrap-2.12: bump svn version
	* generator/CallbackGen.cs: add dnotify support to invoker.
	Store and respond with incoming UserData params. Start using 
	__prefixed private vars to avoid collisions with parameters, 
	like the 'result' params in gio.
	* generator/ManagedCallString.cs: use new data/dnotify invoker
	ctors.
	* generator/MethodBody.cs:
	* generator/Parameters.cs: don't link "out" length params to 
	preceding strings.
	* generator/VMSignature.cs: don't require UserData to be last
	param, since it can have things like error after it.

svn path=/trunk/gtk-sharp/; revision=98782
2008-03-22 01:30:42 +00:00
Mike Kestner
be28ed3597 2008-02-29 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs: null-term array handling.
	* glib/Marshaller.cs: marshaling methods for null-term arrays.

svn path=/trunk/gtk-sharp/; revision=97032
2008-02-29 23:42:27 +00:00
Mike Kestner
80d977610f 2008-02-26 Mike Kestner <mkestner@novell.com>
* generator/ByRefGen.cs: fix mismatched alloc/free.

svn path=/trunk/gtk-sharp/; revision=96661
2008-02-26 16:29:14 +00:00
Mike Kestner
4c6671c625 2008-02-07 Mike Kestner <mkestner@novell.com>
* generator/Parameters.cs: fix off-by-1 in null term array marshaling.

svn path=/trunk/gtk-sharp/; revision=95214
2008-02-08 01:32:34 +00:00
Mike Kestner
445ea379bc 2008-01-30 Mike Kestner <mkestner@novell.com>
* generator/ClassBase.cs: null check ifaces in recursive method
	and signal lookup.

svn path=/trunk/gtk-sharp/; revision=94388
2008-01-30 15:30:27 +00:00
Mike Kestner
adda8bdcf5 2008-01-29 Mike Kestner <mkestner@novell.com>
* generator/ManagedCallString (Setup): use error param name instead
	of hardcoding error.

svn path=/trunk/gtk-sharp/; revision=94309
2008-01-29 20:04:27 +00:00
Mike Kestner
6a668a2cc8 2008-01-29 Mike Kestner <mkestner@novell.com>
* generator/VirtualMethod (CName): mangle the name.
	* generator/SymbolTable.cs (MangleName): add 'remove' and 'foreach'
	mappings.  Should probably just get a C# keyword list and map all of
	them instead of onesy twoseys.
	Fixes for tnymail binding generation.

svn path=/trunk/gtk-sharp/; revision=94286
2008-01-29 18:48:04 +00:00
Mike Kestner
f53935b65d 2008-01-17 Mike Kestner <mkestner@novell.com>
* generator/Property.cs: missing Parent null check needed for direct
	GLib.Object subclasses.  Suggested by mario@gnome.cl.  [Fixes #321536]

svn path=/trunk/gtk-sharp/; revision=93151
2008-01-17 14:37:02 +00:00
Mike Kestner
9716ffe57e 2008-01-07 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs: map "unsigned long" to LPUGen.

svn path=/trunk/gtk-sharp/; revision=92413
2008-01-07 21:12:33 +00:00
Mike Kestner
57c664572c 2007-12-12 Mike Kestner <mkestner@novell.com>
* generator/Parameters.cs: fix marshaling for ArrayCount params where
	casting is required, like gsize/size_t count parameters.

svn path=/trunk/gtk-sharp/; revision=91199
2007-12-13 05:11:07 +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
385af2ab32 2007-12-04 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs: add goffset mapping.

svn path=/trunk/gtk-sharp/; revision=90770
2007-12-05 15:25:45 +00:00
Mike Kestner
e26a98a763 2007-12-04 Mike Kestner <mkestner@novell.com>
* configure.in.in: check for default off_t size
	* generator/SymbolTable.cs: map off_t based on configure check.
	* generator/Makefile.am: add OFF_T_FLAGS to compile.

svn path=/trunk/gtk-sharp/; revision=90727
2007-12-04 23:52:08 +00:00
Mark Probst
e1fd1b014c 2007-12-03 Mark Probst <mark.probst@gmail.com>
* generator/SymbolTable.cs: Added "where" to the list of mangled
	names.

svn path=/trunk/gtk-sharp/; revision=90559
2007-12-03 17:08:03 +00:00
Mike Kestner
75d2981d82 2007-11-29 Mike Kestner <mkestner@novell.com>
* generator/MethodBase.cs: move Name stuff from subclasses.
	Check for (G|S)et<UpperCaseLetter> in new Has props.
	* generator/Method.cs:
	* generator/VirtualMethod.cs: refactor out Name stuff. Use
	new Has(G|S)etterName props.
	* pango/Pango.metadata: workaround Has/Hash collision with
	the old broken getter check. [Fixes #344954]

svn path=/trunk/gtk-sharp/; revision=90458
2007-11-29 20:01:28 +00:00
Mike Kestner
86d29321c3 2007-11-12 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs: remove GCallback mapping.
	* glib/GCallback.cs: kill, bad idea.

svn path=/trunk/gtk-sharp/; revision=89519
2007-11-13 03:04:32 +00:00
Mike Kestner
373951876b 2007-11-09 Mike Kestner <mkestner@novell.com>
* generator/Parameters.cs: support for null_term_array attribute.

svn path=/trunk/gtk-sharp/; revision=89345
2007-11-09 21:06:30 +00:00
Mike Kestner
663b457f63 2007-11-02 Mike Kestner <mkestner@novell.com>
* generator/Method.cs: need to use on the Base method name to 
	lookup complements and determine if the method is a getter or setter
	when an explicit interface method name is used.

svn path=/trunk/gtk-sharp/; revision=88726
2007-11-02 15:54:26 +00:00
Mike Kestner
1fa0231217 2007-10-24 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs: mappings for GCallback and GSourceFunc.
	* glib/GCallback.cs: GCallback declaration.
	* glib/Source.cs: GSourceFunc declaration.

svn path=/trunk/gtk-sharp/; revision=88126
2007-10-24 20:13:08 +00:00
Mike Kestner
0347cd44dc 2007-10-24 Mike Kestner <mkestner@novell.com>
* generator/VirtualMethod.cs: clean up compiler warning and duplicate
	call.

svn path=/trunk/gtk-sharp/; revision=88125
2007-10-24 20:08:24 +00:00
Mike Kestner
6fa5d61269 2007-10-24 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs: generate an Implementor prop on the
	adapters to obtain the underlying object.

svn path=/trunk/gtk-sharp/; revision=88124
2007-10-24 20:06:13 +00:00
Mike Kestner
2a7b706c5a 2007-10-22 Mike Kestner <mkestner@novell.com>
* configure.in.in: add a win64 check and a compiler define for
	handling win64 32bit longs.
	* generator/LPGen.cs: use int to marshal on win64.
	* generator/LPUGen.cs: use uint to marshal on win64.
	* generator/SymbolTable.cs: remove fixme.

svn path=/trunk/gtk-sharp/; revision=87922
2007-10-22 17:34:02 +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
b2db2cda9e 2007-10-02 Mike Kestner <mkestner@novell.com>
* generator/*.cs: implement the interfaces on the adapters too.
	Generate an Implementor interface for users which exposes the 
	methods to implement.  Register based on the Implementor sub-iface.
	* gtk/*Adapter.custom: custom implementations for the custom
	interface members.
	* gtk/TreeIter.custom: make UserData public.
	* sample/TreeModelDemo.cs: sample for implementing a TreeModel
	interface.

svn path=/trunk/gtk-sharp/; revision=86753
2007-10-02 15:57:45 +00:00
Mike Kestner
70f976e020 2007-10-01 Mike Kestner <mkestner@novell.com>
* generator/OpaqueGen.cs: disable Copy generation fix until I can
	figure out why it breaks DnD.

svn path=/trunk/gtk-sharp/; revision=86732
2007-10-02 03:08:44 +00:00
Mike Kestner
9f780a56b2 2007-09-21 Mike Kestner <mkestner@novell.com>
* generator/*.cs: add DefaultValue prop for obtaining a
	sane value when we need to return a value but something bad has 
	happened such that we can't get a real value.  Needed for iface
	signal marshaling, among other places we're partially working 
	around it now.

svn path=/trunk/gtk-sharp/; revision=86157
2007-09-21 16:37:04 +00:00
Mike Kestner
e18e0b7995 2007-09-19 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs: remove some dead code from a previous
	implementation attempt.

svn path=/trunk/gtk-sharp/; revision=86027
2007-09-19 18:22:22 +00:00
Mike Kestner
74458aa03a 2007-09-19 Mike Kestner <mkestner@novell.com>
* generator/VirtualMethod.cs: refactor delegate generation into
	GenerateCallback and add [CDeclCallback] which was missing.
	* generator/InterfaceGen.cs: kill GenerateDelegates.  They are now
	generated by VirtualMethod.GenerateCallback.

svn path=/trunk/gtk-sharp/; revision=86026
2007-09-19 18:15:55 +00:00
Mike Kestner
2c82cec395 2007-09-14 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs (GenInvoker): null check the sig field
	and set it up.  This can happen when generating the marshaling types
	from dependent libraries instead of via the Generate method. 

svn path=/trunk/gtk-sharp/; revision=85831
2007-09-14 17:35:14 +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
Mike Kestner
c2230278b3 2007-09-06 Mike Kestner <mkestner@novell.com>
* AssemblyInfo.cs.in : add IgnoreClassInitializers attr to all.
 	* generator/ObjectGen.cs : add custom-attr generation for objects.
 	* glib/ClassInitializerAttribute.cs : obsolete
 	* glib/IgnoreClassInitializersAttribute.cs : new assembly attr
 	to avoid a blind GetMethods reflection.
 	* glib/Makefile.am : add files
 	* glib/TypeInitializerAttribute.cs : new attr to specify init
 	method to be run at type registration.
 	* gtk/Widget.custom : remove the ClassInitializerAttr.
 	* gtk/Gtk.metadata : add a custom-attr node to GtkWidget.
 	* sample/Subclass.cs : use the IgnoreClassInitializers attr.

svn path=/trunk/gtk-sharp/; revision=85480
2007-09-07 14:40:46 +00:00
Mike Kestner
bc971d723f 2007-08-13 Mike Kestner <mkestner@novell.com>
* generator/MethodBody.cs : finally kill the s/out ref/ref/ hack.
	* generator/Parameter.cs : ditto.

svn path=/trunk/gtk-sharp/; revision=83985
2007-08-13 18:18:12 +00:00
Mike Kestner
71e9b3c99a 2007-08-13 Mike Kestner <mkestner@novell.com>
* generator/ByRefGen.cs : implement IManualMarshaler.
	* generator/Parameter.cs : use StructParameter for ByRefGen.

svn path=/trunk/gtk-sharp/; revision=83978
2007-08-13 17:48:24 +00:00
Mike Kestner
fc06f3829a 2007-08-13 Mike Kestner <mkestner@novell.com>
* generator/*.cs : switch to IntPtr marshaling for struct types
	in the managed to native direction.
	* gtk/*.custom : adjust to new gapi struct pinvoke sigs.

svn path=/trunk/gtk-sharp/; revision=83961
2007-08-13 14:29:06 +00:00
Mike Kestner
d24e54974d 2007-08-01 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : use Parameters.NativeCallbackSignature.
	* generator/Ctor.cs : use Parameters.ImportSignature prop.
	* generator/ImportSignature.cs : kill
	* generator/MethodBase.cs : kill ImportSignature prop.
	* generator/Method.cs : use Parameters.ImportSignature prop.
	* generator/NativeCallbackSignature.cs : kill
	* generator/Parameters.cs : add ImportSig and NativeCallbackSig.
	* generator/Signal.cs : use Parameters.NativeCallbackSignature prop.
	* generator/VirtualMethod.cs : use Parameters.ImportSignature prop.

svn path=/trunk/gtk-sharp/; revision=83214
2007-08-01 17:30:47 +00:00
Mike Kestner
296c948db1 2007-07-31 Mike Kestner <mkestner@novell.com>
* generator/Ctor.cs : Validate before generating and adjust protection
	on a couple private methods.
	* generator/Parameters.cs : remove unused var to kill warning.

svn path=/trunk/gtk-sharp/; revision=83132
2007-07-31 18:29:13 +00:00
Mike Kestner
0f6cac6623 2007-07-30 Mike Kestner <mkestner@novell.com>
* generator/MethodBody.cs : refactor finish logic into parameter.
	* generator/Parameters.cs : refactor finish logic into parameter and
	fix some failures to marshal ref params post call.

svn path=/trunk/gtk-sharp/; revision=83020
2007-07-30 19:40:49 +00:00
Mike Kestner
4bbe8a8faf 2007-07-27 Mike Kestner <mkestner@novell.com>
* generator/OpaqueGen.cs : only generate Copy override for methods
	with no parameters.  Fixes a gnome-sharp build problem.

svn path=/trunk/gtk-sharp/; revision=82869
2007-07-27 16:16:16 +00:00
Mike Kestner
a06235f02f 2007-07-19 Mike Kestner <mkestner@novell.com>
* generator/OpaqueGen.cs : override the new Copy vm if a Copy method
	exists for the type.
	* glib/Opaque.cs : add a virtual method to allow subclasses with
	Copy methods to override.  Use the method in GetOpaque for unowned
	instantiations to try to obtain an owned instance. [Fixes #82037]

svn path=/trunk/gtk-sharp/; revision=82293
2007-07-19 15:35:28 +00:00
Mike Kestner
d3996abfdb 2007-07-17 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : make GError** signatures fatal to
	avoid compilation problem in gmime-sharp.

svn path=/trunk/gtk-sharp/; revision=82105
2007-07-17 15:17:39 +00:00
Mike Kestner
ce3db510d7 2007-07-12 Mike Kestner <mkestner@novell.com>
* generator/StructBase.cs : use typeof to pass type to PtrToStruct
	to avoid an instantiation and method call.  Duh.

svn path=/trunk/gtk-sharp/; revision=81907
2007-07-12 21:23:47 +00:00
Mike Kestner
b1bb3f9056 2007-07-03 Mike Kestner <mkestner@novell.com>
* generator/ImportSignature.cs : use Parameter.NativeSignature 
	prop and refactor out some GError handling.
	* generator/MethodBody.cs : Refactor logic into Parameters.
	* generator/Parameters.cs : add ArrayParameter, ArrayCountPair, and
	ErrorParameter subclasses to refactor spaghetti code in MethodBody.

svn path=/trunk/gtk-sharp/; revision=81721
2007-07-10 15:25:14 +00:00
Wade Berrier
3e3e0f1469 * generator/gapi2-codegen.in:
* parser/gapi2-fixup.in:
* parser/gapi2-parser.in:
Don't use 'which' anymore, as it doesn't work in all caes (ie:
when symlinks are
in the way)


svn path=/trunk/gtk-sharp/; revision=76653
2007-05-03 22:36:34 +00:00
Mike Kestner
54bc72e0a3 2007-04-28 Mike Kestner <mkestner@novell.com>
* generator/NativeCallbackSignature.cs :
	* generator/Signal.cs : don't use ref IntPtr in native callback sigs
	for struct parameters.  Use IntPtr and StructureToPtr.  Fixes the 
	layout issues in MD introduced by the structure marshaling rework.

svn path=/trunk/gtk-sharp/; revision=76433
2007-04-28 16:42:10 +00:00
Mike Kestner
d8fb820b89 2007-04-20 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : switch to NativeCallbackSignature.
	* generator/GenBase.cs : add NativeCallbackType member.
	* generator/IGeneratable.cs : add NativeCallbackType member.
	* generator/ManagedCallString.cs : add guarded post call struct
	marshaling back to the native struct.
	* generator/NativeCallbackSignature.cs : new parallel to ImportSignature
	but using NativeCallbackType instead of MarshalType.
	* generator/Signal.cs : switch vm and sig marshaler callbacks to 
	NativeCallbackSignature. Perform guarding post call struct marshaling
	back to the native struct.
	* generator/Parameters.cs : add NativeCallbackType member.
	* generator/SimpleBase.cs : add NativeCallbackType member.
	* generator/StructBase.cs : add NativeCallbackType member using IntPtr
	to support NULL handling.
	* gtk/NodeCellDataFunc.cs : update native marshaler sig.

svn path=/trunk/gtk-sharp/; revision=76011
2007-04-20 15:38:47 +00:00
Mike Kestner
2ff726d3e6 2007-04-12 Mike Kestner <mkestner@novell.com>
* glib/Object.cs : do the Timeout switch in the finalizer
	instead of in Dispose, where it can cause problems if people
	override Dispose.
	* generator/ObjectGen.cs : don't generate finalizers for every
	subclass, just rely on the ~GLib.Object implementation.

svn path=/trunk/gtk-sharp/; revision=75657
2007-04-12 18:01:33 +00:00
Mike Kestner
b9a21bee0b 2007-03-15 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : generate try/catch blocks for
	native to managed marshallers.  [Fixes the rest of #80516]

svn path=/trunk/gtk-sharp/; revision=74425
2007-03-15 21:26:38 +00:00
Mike Kestner
da407f8ed7 2007-03-06 Mike Kestner <mkestner@novell.com>
* generator/Signal.cs : add try/catch blocks to native callback
	virtual method delegate too.

svn path=/trunk/gtk-sharp/; revision=73849
2007-03-06 21:45:51 +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