Commit Graph

82 Commits

Author SHA1 Message Date
Stephan Sundermann
a74534e835 generator: Create a directory for each namespace
When dealing with several namespaces there might be classes with the same name
(especially Global which is autogenerated in g-i based bindings). On generation
the file would be overriden by the last occurence in the xml. To encounter
this every namespace has it's own directory now. This also improves structure
a lot when dealing with big libraries.

Also do the necessary adaption for the build and the csproj files.
2014-03-01 21:16:54 +01:00
Bertrand Lorentz
51f102bc34 generator: Dispose ownable parameters in signal callbacks (bxc#237)
A similar situation to what is described in commit e48ac63d54 also
happens with signal callbacks: some signals are passed a native object
that is wrapped in an IDisposable managed object, which is then passed
as an argument to the signal handler. We need to dispose those objects
when the signal handler is done.

Those parameters will now be disposed in a finally {...} block, after
the signal handler has returned. This means that handlers should not
keep a reference to such a parameter, as it will be disposed right after
they return.

This change only affects the Cairo.Context parameter of the Widget.Drawn
signal, but it was badly needed, as shown by the Pixbuf demo in the
GtkDemo sample, which was leaking tens of MBs of memory.
2013-11-17 19:10:24 +01:00
Bertrand Lorentz
b7df1d2e13 generator: Fix indentation in Signal.cs
Only whitespace changes, no real code change.
2013-11-17 17:17:57 +01:00
Andres G. Aragoneses
6cb03440c1 generator: generate all interfaces with the "I" prefix (.NET convention)
To be able to do this, Name property of GenBase class is now virtual, so
that it can be overriden in InterfaceGen with the new name.

Adapters, however, are still classes and then need special care as such
(cannot use the 'Name' property anymore), but this improves a bit the
readability of some parts of the code as the *Implementor and *Adapter
suffixes are now concentrated in just two new properties of GenBase and
not repeated all over the place.
2013-07-23 12:05:24 -05: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
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
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
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
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
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
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
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
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
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 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
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
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
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
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
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
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
Mike Kestner
11dade8683 2005-02-03 Mike Kestner <mkestner@novell.com>
* generator/Signal.cs : virtual method enum retvals must be case to 
	Enum before casting to their ultimate type.  Also dispose retval 
	gvalues to avoid reference leaks.

svn path=/trunk/gtk-sharp/; revision=56529
2006-02-03 15:55:22 +00:00
Mike Kestner
33fafe7842 2005-12-12 Mike Kestner <mkestner@novell.com>
* generator/Signal.cs : pass byte cnt for autogenerated string length
	parameters.  Thanks to Itamar Rogel for the report and a candidate
	patch. [Fixes #76952]

svn path=/trunk/gtk-sharp/; revision=54239
2005-12-12 14:46:19 +00:00
Mike Kestner
880b1ff3e9 2005-10-08 Mike Kestner <mkestner@novell.com>
* generator/Signal.cs : handle enum return values GTypes.
	* gtk/TextBuffer.custom : mark Text prop !GTK_SHARP_2_8.
	[Fixes #75885]

svn path=/trunk/gtk-sharp/; revision=51484
2005-10-09 01:50:37 +00:00
Dan Winship
d6ec3f77ff * generator/ClassBase.cs (Validate): Don't fully validate the
parent class and interfaces (because we don't want to see the
	warnings about certain GtkWidget methods in every single library
	that defines a widget, etc). Instead, use the new
	ValidateForSubclass() method.
	(ValidateForSubclass): only validate the signals

	* generator/InterfaceGen.cs (ValidateForSubclass): for interfaces
	we need to validate the methods too.

	* generator/ObjectGen.cs (Generate): Check for interface method
	collisions against the class's own methods too, not just its other
	interfaces. Also, it's only a collision if the methods' signatures
	have the same types.

	* generator/Signal.cs (GenDefaultHandlerDelegate): Use
	"{0}_managed" rather than "obj" for the internal variable name, to
	avoid compile problems with signals that have a parameter named
	"obj".

	* generator/SymbolTable.cs (MangleName): mangle "internal" to
	"_internal".

svn path=/trunk/gtk-sharp/; revision=48184
2005-08-09 17:33:46 +00:00
Dan Winship
eb4fdee774 Automatic memory management for opaque types [#49565]
* glib/Opaque.cs (Owned): new property saying whether or not gtk#
	owns the memory.
	(Opaque): Set Owned to true in the void ctor and false in the
	IntPtr one.
	(GetOpaque): add a new overload that can also create opaques, a la
	GLib.Object.GetObject.
	(Ref, Unref, Free): empty virtual methods to be overridden by
	subclasses.
	(set_Raw): Unref() and possibly Free() the old value, Ref() the
	new one.
	(~Opaque, Dispose): set Raw to IntPtr.Zero (triggering Free/Unref
	if needed)

	* parser/gapi2xml.pl (addReturnElem): if the method is named Copy
	and returns a pointer, set the "owned" attribute on the
	return-type.

	* */*-api.raw: Regen
	
	* generator/HandleBase.cs (FromNative): Add new
	FromNative/FromNativeReturn overloads that takes a "bool owned"
	param. Implement the 1-arg FromNative and FromNativeReturn in
	terms of that.

	* generator/ObjectBase.cs (FromNative): Implement HandleBase's new
	overload. Use the two-arg version of GLib.Object.GetObject when
	"owned" is true.

	* generator/OpaqueGen.cs (Generate): Pull out Ref, Unref, and
	Free/Destroy/Dispose methods and handle them specially by
	overriding Opaque.Ref, .Unref, and .Free appropriately. (If any
	of the methods are marked deprecated, output a deprecated
	do-nothing method as well, to save us from having to write all
	those deprecated methods by hand.)
	(FromNative): use GetOpaque, passing "owned".

	* generator/ReturnValue.cs (FromNative): if the value is a
	HandleBase, pass Owned to its FromNative().

	* generator/Parameters.cs (Owned): new property (for use on out
	params)
	(FromNative): Call FromNative() on the generatable, handling Owned
	in the case of HandleBase.

	* generator/ManagedCallString.cs:
	* generator/MethodBody.cs:
	* generator/Signal.cs: use param.FromNative() rather than
	param.Generatable.FromNative(), to get ownership right.

	* */*.metadata: Mark opaque ref/unref/free methods deprecated
	(except where we were hiding them before). Add "owned" attributes
	to return values and out params as needed.

	* pango/AttrIterator.custom (GetFont): work around a
	memory-management oddity of the underlying method.

	* pango/AttrFontDesc.cs (AttrFontDesc): copy the passed-in
	FontDescriptor, since the attribute will assume ownership of it.

	* gtk/TreeView.custom (GetPathAtPos): set the "owned" flag on the
	returned TreePaths.

	* gtk/TargetList.custom: Remove refcounting stuff, which is
	now handled automatically

	* gtk/NodeStore.cs (GetPath): clear the Owned flag on the created
	TreePath so that the underlying structure doesn't get freed when
	the function returns

	* gtkhtml/HTMLStream.custom (Destroy): hide this and then
	reimplement it by hand to keep OpaqueGen from using it in
	Dispose(), since calling it after an HTMLStream.Close() will
	result in a crash.

svn path=/trunk/gtk-sharp/; revision=47928
2005-08-02 18:45:21 +00:00
Dan Winship
6b31c3542f * generator/Parameters.cs: Remove the AllowComplexRefs flag.
(They're always allowed now.)

	* generator/Signal.cs (GenVirtualMethod): Fix up the use of CSType
	vs MarshalType in the ref/out-handling code so that this can
	marshal any type.

svn path=/trunk/gtk-sharp/; revision=47412
2005-07-19 15:27:08 +00:00
Mike Kestner
f1336f2f2b 2005-07-02 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : remove an old workaround that put
	the native wrapper class into the implementor's *Sharp namespace.
	Use new ImportSignature sig.
	* generator/ImportSignature.cs : don't mangle the callback wrapper
	namespace any more. Remove impl_ns ctor param and field.
	* generator/MethodBase.cs : use new MethodBody and ImportSignature
	ctor sigs.
	* generator/MethodBody.cs : drop the impl_ns ctor param.
	* generator/Signal.cs : use new ImportSignature ctor sig.
	* generator/VirtualMethod.cs : use new ImportSignature ctor sig.

svn path=/trunk/gtk-sharp/; revision=46877
2005-07-02 14:55:08 +00:00
Dan Winship
635ed16db4 * generator/Parameters.cs (AllowComplexRefs): new property for
whether or not to allow "complex" ref/out args.
	(Validate): update for that

	* generator/Signal.cs: set AllowComplexRefs false on the params.
	(Validate): fix the messages
	(GenCallback, GenEventHandler): properly handle ref/out args, by
	manually pointerifying them (except for boxed args, which are
	already pointers).

	* glib/Marshaller.cs (StructureToPtrAlloc): Rename from
	PtrToStructureAlloc, since it wraps Marshal.StructureToPtr.

svn path=/trunk/gtk-sharp/; revision=46773
2005-06-30 17:09:39 +00:00
Mike Kestner
b35b48248c 2005-03-28 Mike Kestner <mkestner@novell.com>
* generator/Signal.cs  : Dispose the values passed to 
	g_signal_chain_from_overriden in base VM invocations. [Fixes #73522]

svn path=/trunk/gtk-sharp/; revision=42312
2005-03-28 18:26:00 +00:00
Mike Kestner
a7c49200ee 2005-03-25 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : add CDeclCallback attrs to native dels.
	* generator/Signal.cs : add CDeclCallback attrs to native dels.

svn path=/trunk/gtk-sharp/; revision=42256
2005-03-25 18:13:00 +00:00
Mike Kestner
8b6cf6e5ea 2005-03-03 Mike Kestner <mkestner@novell.com>
* gdk/Gdk.metadata : remove unnecessary null_ok rules.
	* generator/Ctor.cs : don't add null params to CreateNativeObject call
	for InterfaceGen or OpaqueGen in addition to ObjectGen.
	* generator/Field.cs : simplify Object/Opaque gen.
	* generator/Method.cs : remove OpaqueGen special casing.
	* generator/OpaqueGen.cs : make FromNative null_ok robust.
	* generator/Signal.cs : remove arg marshaling ClassBase special case.
	* gtk/Gtk.metadata : remove unnecessary null_ok rules.

svn path=/trunk/gtk-sharp/; revision=41416
2005-03-03 22:40:32 +00:00
Mike Kestner
da4e49bd31 2005-02-02 Mike Kestner <mkestner@novell.com>
* generator/Signal.cs : kill unnecessary BaseName prop.

svn path=/trunk/gtk-sharp/; revision=40008
2005-02-02 22:15:52 +00:00
Mike Kestner
6590388024 2005-02-02 Mike Kestner <mkestner@novell.com>
* generator/Makefile.am : remove source file.
	* generator/Signal.cs : generate marshaling callbacks and use new
	GLib.Signal marshaling class for events.
	* generator/SignalHandler.cs : kill. byebye SignalCallback subclasses.
	* glib/Makefile.am : update source files.
	* glib/GLibSharp.voidObjectIntPtrSignal.cs : kill.
	* glib/Object.cs : mark the old Before/After props Obsolete. Use
	GLib.Signal for the notify prop methods.
	* glib/Signal.cs : new signal marshaling class.  It manages all the 
	ConnectBefore/After stuff internally and connects itself to the native
	object using GCHandles and DestroyNotify lifecycle management.
	* glib/SignalCallback.cs : mark Obsolete.
	[Fixes #72018 and #69847]

svn path=/trunk/gtk-sharp/; revision=40007
2005-02-02 21:57:15 +00:00
Mike Kestner
8364dd2be1 2005-01-28 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs : use ToNativeReturnType for ToNativeType
	instead of MarshalType.
	* generator/Signal.cs : deal with boxed return values. beef up return
	handling in the default handler generation code.
	* generator/SignalHandler.cs : use ToNative return types for native 
	callbacks. Remove redundant casting/conversion in callback impl.
	[Fixes #71899]

svn path=/trunk/gtk-sharp/; revision=39724
2005-01-28 20:24:14 +00:00
Mike Kestner
33cb5d82b4 2005-01-26 Mike Kestner <mkestner@novell.com>
* generator/*.cs : refactoring of Parameters class. Added IEnumerable
	to Parameters and gracefully handle elem == null instead of special
	casing parms == null all over the place. Parameter logic is now Count
	driven. [Fixes #71750]

svn path=/trunk/gtk-sharp/; revision=39594
2005-01-26 19:17:07 +00:00
Dan Winship
26198086f4 * generator/Property.cs (Generate): Remove a redundant WriteLine (that
resulted in there being 2 blank lines before every property).

	* generator/Signal.cs (Generate): s/Write/WriteLine/ to fix a
	weirdly-formatted if statement in the generated code.

svn path=/trunk/gtk-sharp/; revision=39584
2005-01-26 14:49:52 +00:00
Dan Winship
7cc3f74b9c * generator/Signal.cs: fix some WriteLine()s that should have been
Write()s

svn path=/trunk/gtk-sharp/; revision=38056
2004-12-22 21:52:18 +00:00
Dan Winship
62258ca7c3 * generator/CallbackGen.cs:
* generator/CodeGenerator.cs: 
        * generator/ManagedCallString.cs:
        * generator/Property.cs: Remove unused vars

        * generator/Method.cs (GetHashCode): have to implement this since
        we're overriding Equals.

        * generator/CallbackGen.cs: print a message when generating a
        broken struct-returning callback. (Currently affects
        GtkSharp.TextSegSplitFuncNative and
        GtkSharp.TextSegCleanupFuncNative)

        * gdk/glue/device.c: 
        * gdk/glue/dragcontext.c: Add missing prototypes

        * gtk/Gtk.metadata: Mark SeparatorToolItem.Draw "new". Re-rename
        CheckMenuItem.Toggled to EmitToggled rather than Toggle, since
        that's a better description of what it does.

        * gtk/CheckMenuItem.custom: implement a "Toggle" method that does
        what the documentation claims it does.

        * gtk/NodeStore.cs: remove unused var

        * gnome/Gnome.metadata: mark DateEdit.Flags, Dialog.Default, and
        PropertyBox.State "new". Hide GnomePixmapEntry.GnomeEntry and
        GnomePixmapEntry.GtkEntry since they do exactly the same thing as
        the methods of the same names inherited from GnomeFileEntry.

        * gnome/glue/canvas-proxy.c:
        * gnome/glue/canvas-proxy.h:
        * gnome/glue/canvas-proxy-marshal.c:
        * gnome/glue/canvas-proxy-marshal.h:
        * gnome/glue/canvas-proxy-marshal.list: Remove unused code

        * gnome/glue/Makefile.am (libgnomesharpglue_2_la_SOURCES): update

        * panelapplet/PanelApplet.metadata: mark PanelApplet.Flags "new"

        * sample/CanvasExample.cs: 
        * sample/CustomCellRenderer.cs: 
        * sample/CustomNotebook.cs: 
        * sample/DrawingSample.cs:
        * sample/Fifteen.cs: 
        * sample/GladeTest.cs: 
        * sample/GtkDemo/DemoHyperText.cs: 
        * sample/GtkDemo/DemoPixbuf.cs: 
        * sample/ScribbleXInput.cs: remove unused vars, use
        GLib.Timeout.Add rather than the deprecated Gtk.Timeout.Add

svn path=/trunk/gtk-sharp/; revision=38043
2004-12-21 18:46:42 +00:00
Dan Winship
faaccd7e0b * generator/ManagedCallString.cs (Setup, Finish, ToString): Add
new methods to allow arbitrary setup and teardown code around the
        managed call. When passing a type with "complicated" marshalling
        requirements as a ref or out param, first assign the value to a
        temporary variable (in Setup), then pass the temp as the ref or
        out param (in ToString), and then assign the new value back to the
        original argument (in Finish).

        * generator/Signal.cs: 
        * generator/SignalHandler.cs: Update to generate correct glue for
        signals with "ref" or "out" params. (#70566)

        * generator/VirtualMethod.cs: Update for ManagedCallString change

        * generator/IGeneratable.cs: add comments explaining what each
        member does

        * gtk/Gtk.metadata: mark Editable.InsertText's "position" arg
        * pass-by-ref

        * sample/Size.cs: connect to the SizeRequested event and override
        it, to test/demo the changes

svn path=/trunk/gtk-sharp/; revision=37854
2004-12-16 23:38:35 +00:00
Mike Kestner
520eb22a96 2004-11-17 Mike Kestner <mkestner@novell.com>
* generator/Makefile.am : add new file.
	* generator/Method.cs : refactoring to use ReturnValue.
	* generator/MethodBody.cs : remove unnecessary code.
	* generator/ReturnValue.cs : class for redundant retval handling.
	* generator/Signal.cs : refactoring for ReturnValue.
	* generator/SignalHandler.cs : refactoring for ReturnValue.

svn path=/trunk/gtk-sharp/; revision=36218
2004-11-17 15:57:17 +00:00
Mike Kestner
7a395905ac 2004-08-25 Mike Kestner <mkestner@ximian.com>
* generator/Signal.cs : use typeof instead of Type.GetType to
	specify the event args type.
	* glib/ObjectManager.cs : beef up the type lookup code using
	Assembly.LoadWithPartialName to fix a very popular win32 bug.
	[Fixes #61139 and friends]  Thanks to John Luke for expert
	patch testing on win32.

svn path=/trunk/gtk-sharp/; revision=32831
2004-08-25 18:16:17 +00:00