Commit Graph

632 Commits

Author SHA1 Message Date
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
Mike Kestner
fab4c3eed1 2007-03-01 Mike Kestner <mkestner@novell.com>
* generator/MethodBody.cs : handle set method conversion to 
	property for array parameters with preceding count params.

svn path=/trunk/gtk-sharp/; revision=73613
2007-03-01 18:37:06 +00:00
Mike Kestner
1d105a960b 2007-01-09 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : add PersistUntilCalled method generation
	to the wrapper class.  Holds a GCHandle for the wrapper which is Freed
	when the delegate is invoked.
	* generator/MethodBody.cs : add "async" case for delegate scope.  Use
	this scope to identify a callback parameter that needs to persist 
	until the native side calls back.  Only valid for single-invoke
	callbacks.
	* gtk/Gtk.metadata : mark Print.RunPageSetupDialogAsync done_cb param
	with the new async scope.

svn path=/trunk/gtk-sharp/; revision=71767
2007-01-26 20:46:09 +00:00
Mike Kestner
2ac6bb5457 2006-05-10 Mike Kestner <mkestner@novell.com>
* bootstrap-2.10 : strap for the new 2.9.0 API.
	* generator/SymbolTable.cs : add GLib.InitiallyUnowned mapping.
	* glib/InitiallyUnowned.cs : new floating class "stub".
	* glib/Makefile.am : build new class.
	* gdk/gdk-api-2.10.raw: parse from 2.9.0
	* gtk/Gtk.metadata: cleanup conflicts in 2.10 API.
	* gtk/gtk-api-2.10.raw: parse from 2.9.0
	* pango/pango-api-2.10.raw: parse from 1.11.99
	* sources/Makefile.am : 2.10 parse setup and api-2.10 
	* sources/gtk_tree_model_signal_fix-2.10.patch : 2.10 patch.
	* sources/gtk-sharp-2.10-sources.xml : parse rules for 2.10

svn path=/trunk/gtk-sharp/; revision=60521
2006-05-10 17:13:30 +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
8be43289ae 2005-01-21 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs : alias off_t to ssize_t as it is
	signed according to harold.  [Fixes #77016]

svn path=/trunk/gtk-sharp/; revision=55887
2006-01-21 17:31:03 +00:00
Mike Kestner
0486846a0e 2005-01-12 Mike Kestner <mkestner@novell.com>
* sources/MethodBody.cs : use Utf8.GetByteCount for hidden len params.
	[Fixes #77097]

svn path=/trunk/gtk-sharp/; revision=55456
2006-01-12 20:24:57 +00:00
Lluis Sanchez
fe3b98a79b 2005-12-21 Lluis Sanchez Gual <lluis@novell.com>
* generator/FieldBase.cs: Properly convert marshalled value 
	to native value.
	* generator/CallbackGen.cs: Added parens to the result of ToNativeReturn,
	since it may have problems with the cast.


svn path=/trunk/gtk-sharp/; revision=54671
2005-12-21 00:18:52 +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
626b964336 2005-11-19 Mike Kestner <mkestner@novell.com>
* generator/ManualGen.cs (CallByName): add null handling.
	[Fixes #76540]

svn path=/trunk/gtk-sharp/; revision=53280
2005-11-19 18:56:27 +00:00
Wade Berrier
a36a3d4c0e * .pc and wrapper scripts: Use relative paths so gtk-sharp is
relocatable


svn path=/trunk/gtk-sharp/; revision=52437
2005-11-01 05:12:12 +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
Joe Shaw
5f89b3da2f 2005-08-23 Joe Shaw <joeshaw@novell.com>
* generator/SymbolTable.cs: Add "unsigned" as a type
	which maps to "uint".

svn path=/trunk/gtk-sharp/; revision=48754
2005-08-23 18:36:43 +00:00
Dan Winship
ba1eeecbfb * generator/Property.cs (Generate): Mark properties [Obsolete] if
they or their accessors are marked deprecated. (Affects
	Gtk.Entry.Editable, Gtk.FontSelection.Font,
	Gtk.Notebook.*TabBorder, Gtk.Object.UserData, and a bunch of old
	Gtk.ProgressBar properties).

	* gtk/Gtk.metadata: Hide Entry.Editable. Mark Notebook.Homogeneous
	deprecated.

	* gtk/Entry.custom: Implement Editable property with an Obsolete
	pointing to IsEditable.

svn path=/trunk/gtk-sharp/; revision=48680
2005-08-22 16:55:20 +00:00
Dan Winship
b0f83bc0ad * generator/CallbackGen.cs (Validate, MarshalType): if validation
fails, set MarshalType to "" to propagate that failure into
	methods that have args of this type. [Fixes #75851]

svn path=/trunk/gtk-sharp/; revision=48679
2005-08-22 16:51:38 +00:00
Dan Winship
622c360576 * parser/gapi2xml.pl (addFuncElems): if a struct or boxed type has
a constructor or a ref, unref, or destroy method, then it must be
	a reference type, so mark it "opaque" but then also mark all of
	its fields public and writable.

	* */*-api*.raw: Regen

	* generator/Parser.cs (ParseNamespace): make the opaque attribute
	check actually look at the value of the attribute rather than just
	checking if it's there, so that you can change a struct's opaque
	attribute from "true" to "false" via metadata and have that work.

	* generator/BoxedGen.cs (Generate): do not generate the boxed's
	"Free" method (since it's guaranteed to crash when we pass it a
	stack pointer). If "Copy" is marked deprecated, create a
	deprecated no-op for it, otherwise just skip it (since otherwise
	it will just leak memory when we copy its result onto the stack).

	* pango/Pango.metadata: deprecate Pango.Color.Copy and
	Pango.Matrix.Copy. Hide some array fields in Pango.GlyphString
	that we've never generated correctly. Tweak Pango.LayoutLine
	fields to be the same as they used to be.

	* pango/GlyphItem.custom (glyphs, item):
	* pango/GlyphString.custom (Zero, New):
	* pango/Item.custom (Zero, New):
	* pango/LayoutRun.custom (glyphs, item): add deprecated API compat

	* gdk/Gdk.metadata: undo the parser's new opaquification of
	Gdk.Font; it's been deprecated since pre-gtk# times, and no one
	should be using it, so there's no point in fixing it now. Fix up a
	few other things to match how they used to be. Fix RgbCmap's
	constructor args.

	* gdk/RgbCmap.custom (Zero, New): deprecated API compat

	* gdk/PangoAttrEmbossed.custom:
	* gdk/PangoAttrStipple.custom (Zero, New, Attr): deprecated API
	compat
	(explicit operator ...): allow casting back and forth between
	Pango.Attribute. (We can't usefully make them real subclasses of
	Pango.Attribute, because there's no way for
	Pango.Attribute.GetAttribute() to be able to dtrt with them.)

	* gtk/Gtk.metadata: deprecate Gtk.Requisition.Copy,
	Gtk.TextIter.Copy, and Gtk.TreeIter.Copy. Mark the return value of
	TextView.DefaultAttributes as "owned". Mark TargetList's fields
	private so it stays how it used to be.

	* gtk/TextAttributes.custom (Zero, New): deprecated API compat

	* gnomevfs/Gnomevfs.metadata: remove a bunch of opaque
	declarations that the parser figures out on its own now.

	* art/Art.metadata:
	* glade/Glade.metadata:
	* rsvg/Rsvg.metadata: un-mark everything the parser marked opaque
	in these libraries, because all of the structs in question would
	still be unusably broken, so the API churn would be pointless.

svn path=/trunk/gtk-sharp/; revision=48387
2005-08-15 15:15:57 +00:00
Dan Winship
737a794d76 * generator/OpaqueGen.cs (Generate):
* generator/StructBase.cs (Generate): Add the [Obsolete] attribute
	to deprecated structs/boxeds/opaques too. (Affects Gdk.Font,
	Gtk.Arg, Gtk.ItemFactoryEntry, Gnome.IconData, and [in 2.6/2.8]
	Gnome.Vfs.MimeAction)

svn path=/trunk/gtk-sharp/; revision=48288
2005-08-11 14:13:25 +00:00
Dan Winship
963ae98d5d * configure.in.in: kill off all gda/gnomedb references.
(Henceforth gda# and gnomedb# will be part of gda and gnomedb. Or
	maybe separate modules in Mono SVN. Not part of gtk-sharp though.)

	* Makefile.am (SUBDIRS): remove gda and gnomedb

	* gda/, gnomedb/: buh-bye

svn path=/trunk/gtk-sharp/; revision=48200
2005-08-09 20:10:45 +00:00
Dan Winship
1428e774c8 * generator/Method.cs (GenerateDeclCommon): Strip "Get"/"Set" even
in the context of "Gtk.TreeModel.GetNColumns"

	* generator/CallbackGen.cs (GenWrapper): treat InterfaceGen return
	values the same as ObjectGen

svn path=/trunk/gtk-sharp/; revision=48192
2005-08-09 18:38:35 +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
9a71bd5ee2 * 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.

svn path=/trunk/gtk-sharp/; revision=48177
2005-08-09 15:59:30 +00:00
Dan Winship
12cd8d0d17 * generator/OpaqueGen.cs (Generate): Tweak the generated Ref/Unref
a bit; only Ref the pointer if Owned is false (and then set it to
	true), and vice versa for Unref.

	* glib/Opaque.cs (Opaque): set owned before setting Raw, so
	that Raw will be reffed properly.
	(GetOpaque): Fix this up to dtrt in all cases with refcounted
	opaques.
	
	* gtk/TreeView.custom (GetPathAtPos): Use "GetOpaque(...)" rather
	than "new TreePath()"

	* sample/opaquetest/*: regression test for opaque free/ref/unref
	handling

	* sample/Makefile.am (SUBDIRS): add opaquetest

	* configure.in.in (AC_OUTPUT): add opaquetest files

svn path=/trunk/gtk-sharp/; revision=48168
2005-08-09 14:44:32 +00:00
Dan Winship
85d88fe1ca Change the way generatable validation works. Some generatable
properties can't be set until Validate-time (eg, Method.IsGetter),
	but it's annoying for every potential user of those properties to
	have to make sure it has Validated the generatable first. So now
	we add an explicit Validate() step after everything is loaded but
	before anything is Generated, so that at Generation time,
	everything can be assumed to have been Validated.

	* generator/IGeneratable.cs: add "bool Validate()"

	* generator/CodeGenerator.cs (Main): after loading all of the
	generatables, DeAlias the SymbolTable, Validate() all the
	generatables, and discard any invalid ones.

	* generator/*.cs: Implement Validate() trivially in generatables
	that didn't implement it before. Move Validate() calls from
	Generate() to Validate(). Remove non-hierarchical Validate()
	calls.

	* generator/SymbolTable.cs: GPtrArray is IntPtr, not IntPtr[]

svn path=/trunk/gtk-sharp/; revision=48046
2005-08-05 20:34:45 +00:00
Mike Kestner
3e19a1d102 2005-08-04 Mike Kestner <mkestner@novell.com>
* generator/Ctor.cs : call Finish and HandleException for static ctor
	method bodies. [Fixes #75493]

svn path=/trunk/gtk-sharp/; revision=47998
2005-08-04 14:41:11 +00:00
Dan Winship
38c70d2503 * generator/Property.cs (Generate): cast GLib.Values to
System.Enum before casting them to an enum type, to fix the build
	with csc 1.1.

svn path=/trunk/gtk-sharp/; revision=47962
2005-08-03 14:58:38 +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
6bf7376094 * parser/gapi2xml.pl (addParamsElem): change the handling of
anonymous function pointer types in method signatures. Before, we
	added a <callback> child to the <parameters> node, but the
	generator just ignored it. Now we add the callback (with a made-up
	name) to the toplevel node, and add an ordinary <param> node
	referencing it to the <parameters> node. Also, if the last param
	of the callback is a gpointer, rename it from "arg#" to "data" so
	it will be treated correctly (as the user data passed from the
	calling method). [Fixes #66241]

	* art/art-api.raw: 
	* gdk/gdk-api-2.4.raw: 
	* gdk/gdk-api-2.6.raw: Regen

	* generator/Parameters.cs (IsHidden): loosen the definition of
	hideable user_data; it doesn't have to occur at the end of the
	parameter list, as long as there's a callback arg before it.

	* generator/MethodBody.cs (GetCallString): Use Parameters.IsHidden
	to decide whether or not to squash user_data params, rather than
	trying to duplicate its logic. As a side effect, this also causes
	a handful of methods that take non-hidden IntPtr arguments to
	start actually passing those arguments to C rather than always
	passing IntPtr.Zero.

	* generator/Method.cs (Equals, GetHashCode): Remove unnecessary
	and possibly erroneous hashing overrides.

	* gtk/Gtk.metadata: Hide Gtk.Container.ForeachFull, since it's
	useless and wasn't in gtk# 1.0

	* gtk/Menu.custom (Popup):
	* gtk/TextIter.custom (ForwardFindChar, BackwardFindChar):
	* gnome/App.custom (CreateMenusInterp, InsertMenusInterp,
	CreateToolbarInterp):
	* gnome/Client.custom (RequestInteractionInterp):
	* gnome/Popup.custom (MenuDoPopupModal, MenuDoPopup): Add
	[Obsolete] compat overloads for methods that have now lost a
	useless IntPtr.

svn path=/trunk/gtk-sharp/; revision=47566
2005-07-22 19:10:04 +00:00
Dan Winship
196be89bc9 * glib/Value.cs: Obsolete the EnumWrapper and UnwrappedObject
constructors and casts. Add a new Enum cast.
	(Val): Handle Pointer values. Change the handling of Enum/Flags
	values to return the value directly rather than returning an
	EnumWrapper. Remove the Char (ie, "byte") handling since there
	aren't any char properties in all of gtk-sharp and the generator
	mistakenly converts them to strings anyway.

	* glib/EnumWrapper.cs: 
	* glib/UnwrappedObject.cs: Mark these Obsolete.

	* glib/glue/type.c (gtksharp_get_parent_type,
	gtksharp_get_type_name_for_id): 
	* glib/glue/value.c (gtksharp_value_get_value_type): Remove some
	unneeded glue methods.

	* generator/Ctor.cs (Generate):
	* generator/Property.cs (Generate): Simplify the enum and object
	property glue to not use EnumWrapper or UnwrappedObject.

	* sample/valtest/*: a regression test for GLib.Value

	* configure.in.in: add sample/valtest

svn path=/trunk/gtk-sharp/; revision=47564
2005-07-22 18:36:50 +00:00
Dan Winship
d37d940eb8 * parser/gapi2xml.pl (parseInitFunc): handle interface properties
as well as class properties

	* gtk/gtk-api-2.4.raw: 
	* gtk/gtk-api-2.6.raw: Regen (adding properties to GtkFileChooser).

	* generator/Property.cs (GenerateDecl): new method to generate
	just a property declaration (for an interface).
	(Generate): Add an "implementor" arg as with Method.Generate.

	* generator/InterfaceGen.cs (Generate): Generate properties. Also,
	validate methods *before* checking if they should be ignored,
	since certain Method properties aren't set until Validate-time.

	* generator/*.cs: misc minor changes/reorg for the above.

svn path=/trunk/gtk-sharp/; revision=47563
2005-07-22 18:35:37 +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
0863f8703f 2005-07-02 Mike Kestner <mkestner@novell.com>
* generator/StructField.cs : fix name exception throw conditional.

svn path=/trunk/gtk-sharp/; revision=46890
2005-07-03 15:14:09 +00:00
Mike Kestner
144a0f9d20 2005-07-02 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : implement new IAccessor iface so that
	callback fields on structs can now be accessed.
	* generator/ClassBase.cs : remove/abstract some methods incorrectly
	located here.
	* generator/ClassGen.cs : implement methods previously inherited from
	ClassBase incorrectly.
	* generator/HandleBase.cs : new base class for native ptr wrappers.
	Implements new IAccessor interface and code moved from ClassBase.
	* generator/IAccessor.cs : new iface to generate field/prop accessors.
	* generator/InterfaceGen.cs : derive from new ObjectBase.
	* generator/LPGen.cs : implement IAccessor.
	* generator/LPUGen.cs : implement IAccessor.
	* generator/ObjectBase.cs : new base class for Object/Iface types.
	* generator/ObjectGen.cs : derive from new ObjectBase.
	* generator/OpaqueGen.cs : derive from HandleBase.
	* generator/StructField.cs : refactor Generate method using new
	IAccessor interface.
	* */*.custom : add obsolete impls for some existing c_cased struct
	field accessors that are now StudlyNamed.

svn path=/trunk/gtk-sharp/; revision=46878
2005-07-02 15:23:27 +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
Mike Kestner
3c531aa299 2005-07-01 Mike Kestner <mkestner@novell.com>
* generator/Parameters.cs : init allow_complex_refs to true to fix
	build.

svn path=/trunk/gtk-sharp/; revision=46839
2005-07-01 16:46:37 +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
eddfdc7910 2005-06-23 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs : support owned and elements_owned for lists.
	* glib/List.cs : add ctor overloads for memory mgmt.
	* glib/ListBase.cs : add ctor overloads for memory mgmt. Dispose
	elements if specified.
	* glib/SList.cs : add ctor overloads for memory mgmt.
	* gnome/Gnome.metadata : unhide and generate a List prop.
	* gnomevfs/Gnomevfs.metadata : unhide and generate a List prop.
	* gtk/FileChooser.custom : new. add hidden props.
	* gtk/FileChooserButton.custom : new. impl hidden props.
	* gtk/FileChooserDialog.custom : remove some List props and use the
	GLib.Marshaller for the remaining ones..
	* gtk/FileChooserWidget.custom : remove some List props and use the
	GLib.Marshaller for the remaining ones..
	* gtk/Gtk.metadata : unhide and let the generator do some List props.

svn path=/trunk/gtk-sharp/; revision=46457
2005-06-23 22:28:06 +00:00
Mike Kestner
d3c6721f1e 2005-06-22 Mike Kestner <mkestner@novell.com>
* generator/ManagedCallString.cs : don't assume ref for structs.
	* generator/VMSignature.cs : don't assume ref for structs.

svn path=/trunk/gtk-sharp/; revision=46373
2005-06-22 16:56:52 +00:00
Mike Kestner
ab8285550b 2005-06-21 Mike Kestner <mkestner@novell.com>
* generator/ConstStringGen.cs : override ToNativeReturn ().
	* generator/ClassBase.cs : use fully qualified interface names for
	conflicting implementations.

svn path=/trunk/gtk-sharp/; revision=46320
2005-06-21 16:11:22 +00:00
Mike Kestner
463618c958 2005-06-08 Mike Kestner <mkestner@novell.com>
* generator/SimpleBase.cs : off-by-one in namespace join.
	* glib/ListBase.cs : support IntPtr element_type.
	* gnomevfs/FileInfo.cs : make it ManualGen friendly.
	* gnomevfs/*.cs : rework for FileInfo api changes.
	* gnomevfs/Gnomevfs.metadata : make FileInfo a manual symbol.
	* gnomevfs/Uri.custom : rework for FileInfo api changes.
	* gnome/Makefile.am : add gnomevfs dependency to pick up some more api
	symbols.
	* gnome/gnome-sharp-2.0.pc.in : advertise the vfs dep.
	[Fixes #71060]

svn path=/trunk/gtk-sharp/; revision=45702
2005-06-09 14:27:48 +00:00
Mike Kestner
e24d72317a 2005-06-08 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs : don't write a sem in FromNative.
	* glib/ListBase.cs : handle GLib.Object explicit element types.
	* glib/Marshaler.cs : only copy lists if Count > 0.
	* gtk/Gtk.metadata : unhide Window.ListToplevels with a proper element
	type for automatic list to array marshaling.
	* gtk/Window.custom : kill manual ListToplevels impl.

svn path=/trunk/gtk-sharp/; revision=45654
2005-06-08 17:29:48 +00:00
Mike Kestner
a307c78232 2005-06-08 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs : improved list to array marshaling.
	* glib/Marshaller.cs : added ListToArray ().
	* gnomevfs/Gnomevfs.metadata : mark element_type on
	Mime.GetAllApplications. [Fixes #71888]

svn path=/trunk/gtk-sharp/; revision=45649
2005-06-08 16:53:12 +00:00
Mike Kestner
abaf1ce343 2005-06-06 Mike Kestner <mkestner@novell.com>
* generator/ImportSignature.cs : fix native delegate namespacing hack.
	* gnomevfs/gnome-vfs-api.raw : regen.
	* gnomevfs/Gnomevfs.metadata : replace all the type renames with a
	namespace rename.  remove-node several manually implemented callback
	types and broken generated types for now.
	* gnomevfs/Async.cs : use Opaque.Handle.
	* gnomevfs/Handle.cs : kill. replaced by generated GLib.Opaque type.
	* gnomevfs/Makefile.am : kill Handle.cs.
	* gnomevfs/Sync.cs : use Opaque.Handle.
	* sources/gtk-sharp-2.6-sources.xml : s/Gnome.Vfs/GnomeVFS.

svn path=/trunk/gtk-sharp/; revision=45507
2005-06-06 17:16:04 +00:00
Mike Kestner
fee353d525 2005-06-02 Mike Kestner <mkestner@novell.com>
* generator/ConstFilenameGen.cs : new generatable for filename encoded
	const string marshaling
	* generator/Makefile.am : add new file
	* generator/SymbolTable.cs : add new gfilename types.
	* glib/Marshaller.cs : add new filename-encoded string marshalers.
	* gtk/FileSelection.custom : use FilenamePtrToString to marshal.
	* gtk/Gtk.metadata : map the FileSelector filename types to my new
	imaginary gfilename type.  [Fixes #74963]

svn path=/trunk/gtk-sharp/; revision=45328
2005-06-02 14:16:52 +00:00
Dan Winship
f6f9fd0c79 * glib/Value.cs: Add a constructor and an explicit cast for
string[] (using a G_TYPE_STRV boxed value).

	* generator/SymbolTable.cs (SymbolTable): Map GStrv to string[].
	(The mapping relies on the above GLib.Value magic, so it only
	works correctly for properties, but that's ok, because GStrv isn't
	a real type anyway and only shows up in the api files for
	G_TYPE_STRV properties.) Makes the Gtk.AboutDialog Artists,
	Authors, and Documenters properties show up.

	* gtk/Gtk.metadata: hide
	AboutDialog.Get/SetArtists/Authors/Documenters, which can't be
	used to implement the Artists/Authors/Documenters properties,
	because the generated code doesn't know to NULL-terminate the
	arrays.

svn path=/trunk/gtk-sharp/; revision=45301
2005-06-01 17:58:28 +00:00
Dan Winship
b6d7f14268 * generator/StructBase.cs: update field-generation logic a bit
* generator/CodeGenerator.cs: add a --glue-includes flag

	* generator/GenerationInfo.cs: Accept glue_includes value from
	Main and output it to the glue_filename.

	* generator/FieldBase.cs (Ignored): handle more ignorable cases.
	(CheckGlue): New method to figure out what kind of glue we'll need
	for a field.
	(GenerateImports): generate appropriate imports per CheckGlue.
	(GenerateGlue): Generate C glue for accessing a struct field;
	either a fully-C-based accessor, or a method to just return the
	field's offset in the struct.
	(Generate): Use the generated glue to read the field.

	* generator/PropertyBase.cs (CType): if the field is a single bit,
	set its type to gboolean.

	* generator/ObjectGen.cs (Generate):
	* generator/OpaqueGen.cs (Generate): Call GenFields.

	* generator/StructField.cs: Use FieldBase's glue-generation code
	to handle bitfields. [#54489]

	* generator/ObjectField.cs: Generates accessors for public fields
	of objects and opaque structs. [#69514]

	* generator/ClassBase.cs (ClassBase): Parse <fields> nodes and
	create ObjectField objects.
	(GenFields): Output field properties
	(IgnoreMethod): Ignore Get/Set methods that duplicate fields

	* generator/Makefile.am (sources): update

	* {gdk,gnome,gtk,pango}/*.metadata: Mark some additional fields as
	public. Rename/retype some fields for consistency with earlier
	hand-coded bindings.

	* {gdk,gnome,gtk,pango}/*.custom: Remove custom methods that can
	now be autogenerated.

	* {gdk,gnome,gtk,pango}/glue/*.c: Remove glue methods that can now
	be autogenerated
	
	* {gdk,glade,gnome,gtk,pango,vte}/Makefile.am
	* {gdk,glade,gnome,gtk,pango,vte}/glue/Makefile.am
	* {gdk,gnome,gtk,pango}/glue/makefile.win32: Update

svn path=/trunk/gtk-sharp/; revision=44563
2005-05-16 14:28:55 +00:00
Mike Kestner
9ac721885b 2005-05-13 Mike Kestner <mkestner@novell.com>
* generator/MethodBody.cs : don't create a new destroy notify
	delegate, just use GLib.DestroyHelper.NotifyHandler directly.

svn path=/trunk/gtk-sharp/; revision=44504
2005-05-13 17:34:37 +00:00
Mike Kestner
8c8f6b1448 2005-05-11 Mike Kestner <mkestner@novell.com>
* generator/ObjectGen.cs : default empty assembly names for the
	mapper.  [Fixes #74769]

svn path=/trunk/gtk-sharp/; revision=44395
2005-05-11 17:37:50 +00:00
Dan Winship
900b14290c * parser/gapi2xml.pl: make note of _get_type methods for enums
* */*-api.xml: Regen, adding gtype="..." to many enum types

	* generator/EnumGen.cs (Generate): if the enum has the
	"gtype" property, add a GTypeAttribute pointing to an internal
	FooGType class whose GType property can be used to get the enum's
	GType.

	* generator/ObjectGen.cs:
	s/ObjectManager.RegisterType/GType.Register/

	* glib/GTypeAttribute.cs: attribute for indicating a property that
	will return the GType of a type (particularly for enums, which
	can't have GType properties added to them).

	* glib/GType.cs: renamed from Type.cs to match the type name
	(public static readonly GType ...): add a few missing types.
	(Register): moved from ObjectManager.RegisterType
	(LookupGType): moved from TypeConverter.LookupType and extended to
	handle GTypeAttribute. Also, fix mappings for sbyte/byte/char, and
	return specific GTypes for Object subclasses rather than always
	returning GType.Object.	[Fixes #74699]
	(LookupType): moved from ObjectWrapper.LookupType
	(ToString): return the type name
	
	* glib/Object.cs (RegisterGType):
	s/ObjectManager.Register/GType.Register/
	(LookupGType): Make this protected internal so GType can access
	it.

	* glib/ObjectManager.cs (RegisterType): deprecate in favor of
	GType.Register.
	(LookupType): moved to GType
	
	* glib/TypeConverter.cs (LookupType): now a deprecated wrapper
	around GType.LookupGType.

	* glib/Value.cs: Use GType casts rather than TypeConverter

	* gtk/NodeStore.cs (ScanType):
	* gtk/ListStore.custom (ListStore): 
	* gtk/TreeStore.custom (TreeStore): Use (GType) cast rather than
	TypeConverter. Remove the error check and exception, since the
	cast never returns GType.Invalid. (The check probably predates
	GLib.ManagedValue.)

	* gnome/PanelAppletFactory.cs (Register): Use a GType cast rather
	than GLib.Object.LookupGType (which is no longer accessible after
	an mcs bugfix)

	* sample/GtkDemo/DemoIconView.cs (CreateStore): use the Type[]
	constructor rather than the GType[] constructor, since it
	translates typeof(Gdk.Pixbuf) correctly now.

svn path=/trunk/gtk-sharp/; revision=44038
2005-05-04 16:54:24 +00:00
Dan Winship
a7d8b64f7a * generator/Parameters.cs (Parameters.Validate): If the parameters
end with "callback, gpointer, GDestroyNotify", then mark the
	callback as having "notified" Scope.
	(Parameters.IsHidden): Hide user_data and GDestroyNotify after a
	callback.
	(Parameter.Scope): make this settable
	(Parameter.IsDestroyNotify): new test

	* generator/MethodBody.cs (Initialize): Handle "notified" callback
	scope (using a GCHandle and GLib.DestroyHelper.NotifyHandler)

	* generator/CallbackGen.cs (GenWrapper): Add a static
	"GetManagedDelegate" method to the wrapper type, to translate a
	native delegate back to its corresponding managed delegate.
	(FromNative): use GetManagedDelegate.

	* generator/ReturnValue.cs (Validate): We handle callback return
	values now

	* generator/SymbolTable.cs: marshal GDestroyNotify as
	GLib.DestroyNotify

	* glib/DestroyNotify.cs: Moved from gtk

	* gtk/Gtk.metadata: globally change GtkDestroyNotify to
	GDestroyNotify, but then change back the ones that are exposed in
	the API. Un-hide lots of methods we can correctly autogenerate
	now.

	* gtk/DestroyHelper.cs: moved to glib

	* gtk/*.custom: remove methods that are autogenerated now, add
	Obsolete wrappers where needed, replace Gtk.DestroyHelper usage
	with GLib.DestroyHelper.

	* gdk/Gdk.metadata: 
	* gnome/Gnome.metadata: Turn Gdk.Drawable.SetData and
	Gnome.IconList.SetIconDataFull's GDestroyNotify args into
	gpointers so the generated API stays the same as it used to be.

	* rsvg/Handle.custom: implement deprecated SetSizeCallback

	* sample/GtkDemo/DemoIconView.cs (CreateSort): update for API
	changes

svn path=/trunk/gtk-sharp/; revision=44020
2005-05-04 11:47:25 +00:00
Dan Winship
b7e4cc507e * generator/Parameters.cs (IsHidden): method to check if a
parameter should be hidden in the managed sig (eg, because it's
	user_data, or it's the length of the preceding array/string, etc).
	(VisibleCount): the number of parameters that will actually be
	exposed in the managed signature.
	(IsAccessor): test VisibleCount, not Count
	(AccessorReturnType, AccessorName): deal with the fact that the
	accessor parameter might not be the first one.

	* generator/CallbackGen.cs:
	* generator/Signature.cs: use Parameters.IsHidden.

	* generator/Method.cs (Initialize): set is_set based on
	VisibleCount, not Count.
	(Validate): call base.Validate() before Initialize() so that
	VisibleCount will be correct in Initialize.

	* generator/MethodBody.cs (GetCallString, CallArrayLength,
	Initialize): update to deal with accessors with multiple args.

	* gtk/Clipboard.custom (SetText): implement as an Obsolete variant
	of the Text property

	* gtk/IconTheme.custom (SearchPath, SetSearchPath): obsolete
	SetSearchPath, implement a setter on SearchPath instead.

	* gtk/ListStore.custom (SetColumnTypes):
	* gtk/TreeStore.custom (SetColumnTypes): implement as an Obsolete
	variant of the ColumnTypes property.

	* glade/XML.custom (CustomHandler): implement as a property
	(SetCustomHandler): Mark this obsolete

	* glade/Global.custom (SetCustomHandler): deprecate in favor of
	XML.CustomHandler.

	* gnomedb/Editor.custom (SetText): implement as an Obsolete
	variant of the Text property

svn path=/trunk/gtk-sharp/; revision=43898
2005-05-02 20:10:03 +00:00
Dan Winship
5825f7f4fe Apply the parts of the generator reorganization from #69514 that
don't actually affect the generated output
	
	* generator/PropertyBase.cs: new base class for fields and
	properties (mostly containing code formerly in Property.cs).

	* generator/Property.cs: derive from PropertyBase

	* generator/FieldBase.cs: base class for fields (containing some
	code formerly in Field.cs)

	* generator/StructField.cs: class for struct fields (the rest of
	what used to be Field.cs)

	* generator/StructBase.cs: s/Field/StructField/

	* gnome/Gnome.metadata: hide a few funky _get_ methods that the
	generator is just now noticing, to preserve the old output.

svn path=/trunk/gtk-sharp/; revision=43896
2005-05-02 18:40:30 +00:00
Mike Kestner
6da18b5d4a 2005-05-02 Mike Kestner <mkestner@novell.com>
* generator/Property.cs : fix interface setter generation.
	[Fixes #74766]

svn path=/trunk/gtk-sharp/; revision=43893
2005-05-02 17:23:05 +00:00
Ben Maurer
9f5eb0a70d * */Makefile.am: more build fixes
svn path=/trunk/gtk-sharp/; revision=43697
2005-04-27 23:21:55 +00:00
Mike Kestner
1f555ab568 2005-04-21 Mike Kestner <mkestner@novell.com>
* configure.in : require gtk+ 2.6.
	* generator/ReturnValue.cs : invalidate Callback returns for now.
	* gtk/Gtk.metadata : some renames for conflicting new API.
	* parser/gapi2xml.pl : whitespace tweak for class VM regexen.
	* sources/Makefile.am : add new patch, kill atk patch, revise dirs.
	* sources/atkhyperlink.patch : kill unnecessary patch.
	* sources/gtkclipboard.patch : add new clipboard patch.
	* sources/gtk-sharp-sources.xml : parse gtk+-2.6.
	* */*-api.raw : regen pango, atk, gdk, and gtk for new versions.

svn path=/trunk/gtk-sharp/; revision=43412
2005-04-21 17:10:54 +00:00
Mike Kestner
251cb8e4be 2005-04-20 Mike Kestner <mkestner@novell.com>
* generator/*.cs : cleanup the unused private member warnings.

svn path=/trunk/gtk-sharp/; revision=43370
2005-04-21 01:40:08 +00:00
Mike Kestner
e56d2feafc kill useless .cvsignore files
svn path=/trunk/gtk-sharp/; revision=43355
2005-04-20 20:11:00 +00:00
Dan Winship
b8126ce3af * generator/ClassBase.cs (ParseImplements): record both managed
and unmanaged interface declarations.
	(Implements): check recursively

	* generator/ObjectGen.cs (Generate): output managed interfaces

	* gtk/Gtk.metadata: make Container implement IEnumerable

	* gtk/Container.custom (GetEnumerator): implement (a simplified
	form of Children).
	(AllChildren): add this (which accumulates the results of
	Forall()).
	(ForAll): mark ForAll(bool,CallbackInvoker) obsolete and add a
	ForAll(bool,Gtk.Callback) overload to replace it.

	* sample/PolarFixed.cs: new silly but fully-functional demo of
	how to subclass container.

	* sample/CustomNotebook.cs: kill this, since it was really
	complicated, and never fully functional.

	* sample/GtkDemo/DemoImages.cs (ToggleSensitivity): Use foreach
	directly on the container, rather than on its .Children.

svn path=/trunk/gtk-sharp/; revision=42805
2005-04-11 20:35:56 +00:00
Mike Kestner
96f81cfbd4 2005-04-04 Mike Kestner <mkestner@novell.com>
* gdk/Gdk.metadata : hide some manually implemented callback methods.
	* gdk/*.custom : implement several methods containing persistent
	callback parameters.
	* generator/BoxedGen.cs : set gen_info.CurrentType in Generate.
	* generator/ClassGen.cs : set gen_info.CurrentType in Generate.
	* generator/Ctor.cs : set gen_info.CurrentMember in Generate.
	* generator/GenerationInfo.cs : add CurrentMember and CurrentType.
	* generator/Method.cs : set gen_info.CurrentMember in Generate.
	* generator/MethodBody.cs : always generate null guarding for array
	parameters, and add a nag for callback parameters without a scope attr.
	* generator/ObjectGen.cs : set gen_info.CurrentType in Generate.
	* generator/OpaqueGen.cs : set gen_info.CurrentType in Generate.
	* generator/Parameters.cs : kill NullOk. add Scope property.
	* generator/StructGen.cs : set gen_info.CurrentType in Generate.
	* gtk/Gtk.metadata : kill a few null_ok attrs.
	* pango/Pango.metadata : mark the callback params as call scope. kill
	a couple null_ok attrs.

svn path=/trunk/gtk-sharp/; revision=42529
2005-04-04 16:27:08 +00:00
Mike Kestner
639c24e0de 2005-03-29 Mike Kestner <mkestner@novell.com>
* generator/Parser.cs : add symbol type='marshal' support.
	* gdk/Event.cs : add GetEvent method to wrap arbitrary events.
	* gdk/gdk-symbols.xml : make Event, EventAny, and EventNoExpose
	marshal symbols using Event.GetEvent (). [Fixes #74184]

svn path=/trunk/gtk-sharp/; revision=42344
2005-03-29 18:02:04 +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
d4af78e347 2005-03-24 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : don't create native delegates for nulls.
	* generator/ObjectGen.cs : revamp the ObjectManager code.
	* glib/Object.cs : use new ObjectManager.RegisterType overload.
	* glib/ObjectManager.cs : rewrite to kill the lameass LoadWithPartial
	hack and keep a GType to Type mapping for quicker lookup/activation.

svn path=/trunk/gtk-sharp/; revision=42241
2005-03-24 22:47:50 +00:00
Mike Kestner
bd50999b1b 2005-03-12 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : don't derive Wrappers from DelegateWrapper
	any more.  It leaks delegates like crazy. We effectively now use call
	scope as the default for delegate parameters.
	* generator/MethodBody.cs : use new simpler Wrapper ctor.
	* glib/DelegateWrapper.cs : mark the ctor obsolete so people know to
	update any manually coded wrappers out there.
	* */*.custom : use new simpler Callback Wrapper ctors.

svn path=/trunk/gtk-sharp/; revision=41738
2005-03-12 18:54:53 +00:00
Mike Kestner
320977f58f 2005-03-10 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs : fix gssize and gsize, they aren't 32 bit
	like the docs say they are.

svn path=/trunk/gtk-sharp/; revision=41666
2005-03-10 22:15:07 +00:00
Mike Kestner
90a870e2de 2005-03-08 Mike Kestner <mkestner@novell.com>
* */*.cs : scrub for StringToPtrAnsi and string usage in DllImports.
	* */*.custom : begin the scrub here too.
	* generator/ConstStringGen.cs : implement IManualMarshaler and move to
	100% IntPtr marshaling.
	* generator/Ctor.cs : call Body.Finish too.
	* generator/IManualMarshaler.cs : new interface for generatables that
	marshal manually and need cleanup.
	* generator/Makefile.am : new file.
	* generator/MethodBody.cs : use IManualMarshaler if applicable.

svn path=/trunk/gtk-sharp/; revision=41579
2005-03-08 21:28:08 +00:00
Mike Kestner
24bbc054f2 2005-03-07 Mike Kestner <mkestner@novell.com>
* generator/MethodBody.cs : remove an unused var.
	* generator/ReturnValue.cs : privatize a couple props. Refactor the
	SymbolTable lookup logic to be generatable based.

svn path=/trunk/gtk-sharp/; revision=41528
2005-03-07 15:54:49 +00:00
Mike Kestner
0b0700bae6 2005-03-04 Mike Kestner <mkestner@novell.com>
* generator/ImportSignature.cs : out param handling fix.
	* generator/Makefile.am : kill StringGen.cs.
	* generator/MethodBody.cs : simplify out param handling.
	* generator/StringGen.cs : kill it, now using MarshalGen.
	* generator/SymbolTable.cs : make non-const strings use an appropriate
	MarshalGen.  Non-const strings are now correctly marshaled as Utf8.
	* glib/Marshaller.cs : add some utf8-fu for strdup/free marshaling.
	Add a method to alloc/copy structs to native memory, unused yet.
	* gtk/Gtk.metadata : partially fix a broken delegate.

svn path=/trunk/gtk-sharp/; revision=41459
2005-03-04 18:59:09 +00:00
Mike Kestner
2fcb8f1b79 2005-03-04 Mike Kestner <mkestner@novell.com>
* generator/Method.cs : refactor out some retval logic.
	* generator/ReturnValue.cs : add FromNative and IsVoid members.

svn path=/trunk/gtk-sharp/; revision=41446
2005-03-04 16:02:44 +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
801cbb7e65 2005-03-03 Mike Kestner <mkestner@novell.com>
* gdk/Gdk.metadata : remove unnecessary null_ok rules.
	* generator/Ctor.cs : remove NullOk check.
	* gnome/Gnome.metadata : remove unnecessary null_ok rules.
	* gtk/Gtk.metadata : remove unnecessary null_ok rules.

svn path=/trunk/gtk-sharp/; revision=41413
2005-03-03 21:25:26 +00:00
Mike Kestner
0677e5ac75 2005-03-03 Mike Kestner <mkestner@novell.com>
* generator/ClassBase.cs : use "as" instead of a cast in FromNative.
	* generator/Method.cs : remove the if/else checks for Object retvals.
	* glib/Object.cs : return null immediately for NULL in GetObject.

svn path=/trunk/gtk-sharp/; revision=41409
2005-03-03 20:50:46 +00:00
Mike Kestner
eec84f4b5d 2005-03-03 Mike Kestner <mkestner@novell.com>
* generator/ClassBase.cs : add null checking to CallByName. No sense
	manually adding this for the ones that need it. Better to have g_criticals
	then NullRefExceptions anyway.
	* generator/MethodBody.cs : simplify out handle generation.
	[A babystep toward #86620]

svn path=/trunk/gtk-sharp/; revision=41408
2005-03-03 20:35:47 +00:00
Dan Winship
eb4269562f * generator/Field.cs (Validate): new, to check that a field has a
valid type (or is hidden).

	* generator/StructBase.cs (Validate): new, to check that all of
	the struct fields have valid types

	* generator/BoxedGen.cs (Generate):
	* generator/StructGen.cs: (Generate): Call Validate() and bail out
	if it fails; it's no good to generate a struct with the wrong
	layout.

	* gdk/gdk-symbols.xml: add a line for GdkKey -> Gdk.Key. (There's
	no actual C type GdkKey, but we can use metadata to change uints
	to GdkKeys, which will then become Gdk.Keys.)

	* gtk/AccelKey.custom: remove the "Key" field (which was being
	added in the wrong place in the struct), since it's properly
	generated now.

	* gtk/Gtk.metadata: Fix the line that renames AccelKey.AccelKey
	to AccelKey.Key

	* gnomevfs/Gnomevfs.metadata: hide the (mis-parsed) "action" field
	in MimeAction, leaving the struct in the same broken state it was
	in with the old generator code

svn path=/trunk/gtk-sharp/; revision=41104
2005-02-23 17:37:33 +00:00
Dan Winship
14ae0b1953 * generator/ObjectGen.cs (GenChildProperties): If the class has an
ancestor that also defines child properties, make its child
        properties class be a subclass of that ancestor's child properties
        class. (Eg, make Gtk.ButtonBox.ButtonBoxChild be a subclass of
        Gtk.Box.BoxChild.)

svn path=/trunk/gtk-sharp/; revision=40720
2005-02-15 21:52:21 +00:00
Dan Winship
053248d566 * generator/MethodBase.cs (Validate): use CName rather than always
saying "in ctor"

svn path=/trunk/gtk-sharp/; revision=40475
2005-02-11 15:07:22 +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
31a6de44ca 2005-01-31 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs : handle unsigned-*.
	* parser/gapi2xml.pl : handle const unsigned * parameters. Also fix
	a G_GNUC_PRINTF parsing bug exposed by a GMime.
	* */*-api.raw : regen.
	[Fixes #71825]


svn path=/trunk/gtk-sharp/; revision=39851
2005-01-31 15:23:41 +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
Mike Kestner
b8380e84ba 2005-01-24 Jeroen Zwartepoorte <jeroen@xs4all.nl>
* generator/MethodBody.cs : fix out LPUGen params.

svn path=/trunk/gtk-sharp/; revision=39435
2005-01-24 19:44:37 +00:00
Mike Kestner
ea489c2353 2005-01-24 Mike Kestner <mkestner@novell.com>
* gda/Makefile.am : add new custom.
	* gda/XmlConnection.custom : add backcompat static ctor.
	* generator/ClassBase.cs : refactor lookup logic to here from Ctor
	and improve the collision resolution.
	* generator/Ctor.cs : refactor to use MethodBase.
	* generator/Makefile.am : add new file.
	* generator/MethodBase.cs : new base class for ctors and methods.
	* generator/Method.cs : refactor to use MethodBase.
	* generator/StructBase.cs : move some logic from here to Ctor.
	* gnome/CanvasPathDef.custom : add backcompat static ctor.
	* gnome/GPPath.custom : add backcompat static ctor.
	* gnome/Makefile.am : add new custom.
	* gtk/Gtk.metadata : mark a colliding Button ctor shared.

svn path=/trunk/gtk-sharp/; revision=39431
2005-01-24 18:25:02 +00:00
Mike Kestner
a5ea868d90 2005-01-18 Mike Kestner <mkestner@novell.com>
* generator/Method.cs : deal with owned retvals.
	* generator/ReturnValue.cs : add Owned prop.
	* gnome/Gnome.metadata : mark Thumbnail.ScaleDownPixbuf return owned.
	[Fixes #71335]

svn path=/trunk/gtk-sharp/; revision=39128
2005-01-19 02:58:42 +00:00
Dan Winship
027b9c0179 * generator/ObjectGen.cs: Make ContainerChild constructors
"protected internal" rather than just "internal", so the classes
	can be subclassed nicely.

svn path=/trunk/gtk-sharp/; revision=38874
2005-01-13 14:54:22 +00:00
Mike Kestner
8fd87b2e0a 2005-01-08 Mike Kestner <mkestner@novell.com>
* configure.in : kill a ton of redundant stuff.
	* AssemblyInfo.cs.in : moved here, only need one.
	* Makefile.include : rules for building generated assemblies.
	* Makefile.am : removed gtk-sharp-2.0.pc handling.
	* */AssemblyInfo.cs.in : killed
	* */Makefile.am : refactored out a ton of rules to an include.
	* */*-pc.in : added Cflags entries pointing to the gapi files.
	* generator/CodeGenerator.cs : add -I: synonym --include.
	* gnomevfs/gnome-vfs-api.raw : remamed from gnomevfs-api.raw.
	* gtk/gtk-sharp-2.0.pc.in : moved here from top.
	* parser/gapi-fixup.cs : add --symbol arg to merge sym files.
	* sources/gtk-sharp-sources.xml : remamed gnome-vfs-api.raw.

svn path=/trunk/gtk-sharp/; revision=38551
2005-01-09 00:26:45 +00:00
Mike Kestner
e068a811e3 2005-01-06 Mike Kestner <mkestner@novell.com>
* gnomevfs/gnomevfs-symbols.xml : FileSize is a long long.
	* generator/SymbolTable.cs : map longlong to C# long.

svn path=/trunk/gtk-sharp/; revision=38434
2005-01-06 16:10:35 +00:00
Mike Kestner
458a09ff4c 2005-01-05 Mike Kestner <mkestner@novell.com>
* generator/Field.cs : deal with LPGen/LPUGen fields.
                                                                                                                                                      
2005-01-05  Mike Kestner  <mkestner@novell.com>
                                                                                                                                                      
        * gtk/gtk-api.raw : regen.
        * sources/gtk-sharp-sources.xml : exclude gtkiconthemeparser.h.
        [Fixes #70898]


svn path=/trunk/gtk-sharp/; revision=38391
2005-01-05 20:54:39 +00:00
Mike Kestner
4f2d941b51 2004-12-27 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : use ReturnValue and more of Parameter.
	* generator/GenBase.cs : remove unused NSElem prop.

svn path=/trunk/gtk-sharp/; revision=38115
2004-12-27 21:32:08 +00:00
Mike Kestner
bf9ed95944 2004-12-27 Mike Kestner <mkestner@novell.com>
* generator/EnumGen.cs : rework for a single pass thru ChildNodes.
	* generator/Parameters.cs : simplify PassAs logic.
	* generator/SimpleBase.cs : mark abstract.

svn path=/trunk/gtk-sharp/; revision=38111
2004-12-27 20:00:55 +00:00
Mike Kestner
5562bf645f some updates to generator/DESIGN
svn path=/trunk/gtk-sharp/; revision=38110
2004-12-27 18:02:52 +00:00
Mike Kestner
8d53021079 2004-12-27 Mike Kestner <mkestner@novell.com>
* generator/AliasGen.cs : derive from SimpleBase.
	* generator/ConstStringGen.cs : derive from SimpleBase.
	* generator/GObjectGen.cs : kill. now uses ManualGen.
	* generator/GStringGen.cs : kill. now uses MarshalGen.
	* generator/GUnicharGen.cs : kill. now uses MarshalGen.
	* generator/LPGen.cs : derive from SimpleGen.
	* generator/Makefile.am : update source files.
	* generator/ManualGen : make this general for handle types.
	* generator/MarshalGen : new CallByName/FromNative formatter class.
	* generator/SymbolTable.cs : needed some reorganizing and some
	restructuring of types to use MarshalGen.
	* generator/TimeTGen.cs : kill. now uses MarshalGen.

svn path=/trunk/gtk-sharp/; revision=38109
2004-12-27 17:38:52 +00:00
Mike Kestner
1d72136dd8 2004-12-26 Mike Kestner <mkestner@novell.com>
* generator/Makefile.am : add new file.
	* generator/SimpleBase.cs : new class for non-generated type mappers.
	* generator/*Gen.cs : first refactoring of "Simple" generatable types.
	Derive them all from SimpleBase. More to come.

svn path=/trunk/gtk-sharp/; revision=38097
2004-12-26 21:22:50 +00:00
Mike Kestner
1c4b5f81ba 2004-12-26 Mike Kestner <mkestner@novell.com>
* generator/CustomMarshalerGen.cs : kill bad idea unused class.
	* generator/Makefile.am : remove CustomMarshalerGen.cs.
	* generator/Method.cs : remove CustomMarshalerGen reference.

svn path=/trunk/gtk-sharp/; revision=38092
2004-12-26 19:40:24 +00:00
Mike Kestner
d8aa13ac21 2004-12-26 Mike Kestner <mkestner@novell.com>
* generator/*Gen.cs : implement IGeneratable fully on GenBase
	with abstract methods where necessary to refactor a ton of redundant
	code.

svn path=/trunk/gtk-sharp/; revision=38091
2004-12-26 19:33:34 +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
Mike Kestner
b6b89a0633 2004-12-20 Mike Kestner <mkestner@novell.com>
* gdk/Gdk.metadata : mark a couple array params.
	* generator/Field.cs : remove the MarshalAs hack. We have to
	do something much more evil since MarshalAs can't hang.
	* generator/ImportSignature.cs : deal with out LP(U)Gen params.
	* generator/LPGen.cs : moved from SSizeTGen and generalized.
	* generator/LPUGen.cs : moved from SizeTGen and generalized.
	* generator/Makefile.am : update sources.
	* generator/MethodBody.cs : deal with out LP(U)Gen params.
	* generator/Parameters.cs : deal with out LP(U)Gen params.
	* generator/SymbolTable.cs : make all longs and size_t types LP(U)Gens.

svn path=/trunk/gtk-sharp/; revision=37999
2004-12-20 22:08:43 +00:00
Dan Winship
a610fb9a79 * generator/GUnicharGen.cs: generatable for gunichar, using
GLib.Marshaller.CharToGUnichar and .GUnicharToChar [#70704]

        * generator/SymbolTable.cs (SymbolTable): add a GUnicharGen.

        * generator/Makefile.am (sources): add GUnicharGen.cs

        * parser/gapi2xml.pl (addPropElem): g_param_spec_unichar() has
        type "gunichar" not "unichar".

        * gtk/gtk-api.raw: Regen

        * glib/Marshaller.cs: Import CharToGUnichar's glue method by the
        right name

svn path=/trunk/gtk-sharp/; revision=37998
2004-12-20 22:05:21 +00:00
Mike Kestner
5e298ce11a 2004-12-20 Mike Kestner <mkestner@novell.com>
* generator/Property.cs : generate Interface properties.
	* gtk/ComboBox.custom : remove dup model prop.
	* gtk/TreeView.custom : remove dup model prop.

svn path=/trunk/gtk-sharp/; revision=37985
2004-12-20 18:01:55 +00:00
Mike Kestner
b0ede33602 2004-12-18 Mike Kestner <mkestner@novell.com>
* generator/Field.cs : add MarshalAs attrs for (u)longs.

svn path=/trunk/gtk-sharp/; revision=37922
2004-12-18 17:40:51 +00:00
Dan Winship
8457bacdc9 * generator/Field.cs (StudlyName): Fall back to using "cname" if
"name" isn't defined (ie, when using the latest generator against
	api files output by an older parser).

svn path=/trunk/gtk-sharp/; revision=37902
2004-12-17 20:29:54 +00:00
Dan Winship
104dbedf07 * generator/ClassBase.cs (IgnoreMethod): Don't ignore GetFoo and
SetFoo methods if they aren't in the right form to be turned into
        property accessors. (Causes 13 previously ignored methods to now
        be wrapped. See doc/ChangeLog.)

        * gtk/Gtk.metadata: Fix up a few of those newly-exposed methods

svn path=/trunk/gtk-sharp/; revision=37891
2004-12-17 17:55:07 +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
Dan Winship
88cc4817f5 * parser/gapi_pp.pl: Don't strip out /*< public >*/ and
/*< private >*/ comments.

        * parser/gapi2xml.pl: Use those comments to determine the
        accessibility of struct/object fields, and set the "access"
        attribute on fields with non-default accessibiliy (private for
        structs, public for objects). Also, output a StudlyName for each
        field as well as a c_name.

        * */*-api.raw: Regen

        * generator/Field.cs (StudlyName): Use the parser-generated studly
        name rather than studlifying Name, which might have been mangled
        to avoid conflicts with an all-lowercase keyword.
        (Generate): Respect the access property on all field types rather
        than always making certain types public. Don't bother outputting
        wrapper properties for private fields, since the only code that
        could use them is the generated code, which won't.

        See doc/ChangeLog for the (very minimal) fallout from these
        changes.

        * en/Art/AlphaGamma.xml:
        * en/Gtk/TextAttributes.xml (Refcount):
        * en/Pango/GlyphString.xml (Space): these are now private

        * en/Gda/XqlItem.xml:
        * en/Glade/SignalInfo.xml:
        * en/Gnome.Vfs/ModuleCallbackSaveAuthenticationIn.xml: 
        * en/Gnome.Vfs/ModuleCallbackFullAuthenticationIn.xml: 
        * en/Gnome.Vfs/ModuleCallbackFillAuthenticationIn.xml: rename
        Objekt to Object.

        * en/Atk/KeyEventStruct.xml: rename Str1ng to String

svn path=/trunk/gtk-sharp/; revision=37853
2004-12-16 23:22:07 +00:00
Mike Kestner
62977484e6 2004-12-09 Mike Kestner <mkestner@novell.com>
* generator/Makefile.am : new files.
	* generator/MethodBody.cs : fix for length param code.
	* generator/SizeTGen.cs : smarter size_t marshaling.
	* generator/SSizeTGen.cs : smarter ssize_t marshaling.
	* generator/SymbolTable.cs : use the new generatables.

svn path=/trunk/gtk-sharp/; revision=37509
2004-12-09 18:40:09 +00:00
Mike Kestner
993d91fa31 2004-12-07 Mike Kestner <mkestner@novell.com>
* */*.cs : s/glue-2.0/glue-2 so that dllimport works on win32.
	* */*.custom : s/glue-2.0/glue-2
	* */glue/makefile.win32 : s/glue-2.0/glue-2
	* */glue/Makefile.am : s/glue-2.0/glue-2

svn path=/trunk/gtk-sharp/; revision=37324
2004-12-07 19:03:55 +00:00
Mike Kestner
089845650c 2004-12-06 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs : add off_t as an IntPtr.

svn path=/trunk/gtk-sharp/; revision=37247
2004-12-06 22:14:03 +00:00
Mike Kestner
5834d8e024 2004-12-06 Mike Kestner <mkestner@novell.com>
* generator/SignalHandler.cs : s/[]/Array in BaseName. [Fixes #69383]

svn path=/trunk/gtk-sharp/; revision=37239
2004-12-06 21:40:44 +00:00
Mike Kestner
6277977ca5 kill a C.WL that snuck in.
svn path=/trunk/gtk-sharp/; revision=37238
2004-12-06 21:38:53 +00:00
Mike Kestner
84d8a42f96 2004-12-06 Mike Kestner <mkestner@novell.com>
* doc/en/*/*.xml : docs for new GValue members and size_t changes.
	* generator/SymbolTable.cs : add ssize_t and make size_t a UIntPtr
	instead of the current broken int mapping on 64 bit platforms.
	* gtkhtml/HTMLStream.custom : fix size_t related overload.
	[fixes #69574]

svn path=/trunk/gtk-sharp/; revision=37223
2004-12-06 19:37:03 +00:00
Todd Berman
6d9785c7f7 2004-12-01 Todd Berman <tberman@off.net>
* generator/StructGen.cs: Check to see if a GType is going to be
        generated. If not, generate a GType.Pointer. This fixes bug
        #70017.
        * glib/TypeConverter.cs: Remove the .IsValueType check, as those
        now have GType properties.
        * gda/Gda.metadata: Change GdaValue.GType to GdaValue.GdaType.
        * doc/en/Gda/Value.xml: Regenerated to reflect new API.

svn path=/trunk/gtk-sharp/; revision=36912
2004-12-01 21:41:10 +00:00
Dan Winship
30cc0b8109 * generator/ClassBase.cs:
* generator/ObjectGen.cs: Move child property handling from
        ClassBase to ObjectGen (as suggested by Mike) since it's only
        used there

svn path=/trunk/gtk-sharp/; revision=36398
2004-11-22 17:52:17 +00:00
Mike Kestner
69eabbd1a3 2004-11-18 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs : beginnings of a real
	implementation for GInterfaces.  Not quite ready yet,
	so it's not active in generation.

svn path=/trunk/gtk-sharp/; revision=36294
2004-11-18 23:04:32 +00:00
Mike Kestner
0881ba5489 2004-11-18 Mike Kestner <mkestner@novell.com>
* generator/Makefile.am : add new file.
	* generator/Method.cs : add Declaration property.
	* generator/VirtualMethod.cs : new class to generate virtual
	methods for Interfaces and objects. Unfinished.

svn path=/trunk/gtk-sharp/; revision=36292
2004-11-18 22:47:05 +00:00
Mike Kestner
f763364f04 2004-11-18 Mike Kestner <mkestner@novell.com>
* generator/ClassBase.cs : remove a "new" string in the
	ChildProp class holder decl to fix build warnings.

svn path=/trunk/gtk-sharp/; revision=36291
2004-11-18 22:35:19 +00:00
Mike Kestner
6072350f1e 2004-11-18 Mike Kestner <mkestner@novell.com>
* generator/*Gen.cs : add ToNativeReturnType to deal with
	the g_free string nonsense in the virtual method case.

svn path=/trunk/gtk-sharp/; revision=36289
2004-11-18 22:19:31 +00:00
Mike Kestner
487929df7f 2004-11-18 Mike Kestner <mkestner@novell.com>
* generator/AliasGen.cs : make this a SimpleGen.

svn path=/trunk/gtk-sharp/; revision=36288
2004-11-18 21:51:56 +00:00
Dan Winship
9d04b4dd06 Redo child property handling; now we generate classes to hold
the
        child properties for a given widget in a container, and generate
        the child properties as properties on those classes.
        
        * parser/gapi2xml.pl (addPropElem): don't prepend "child_" to
        child prop names any more

        * generator/ClassBase.cs (ClassBase): keep childprops separate
        from properties
        (GenChildProperties): create a subclass of Gtk.ContainerChild
        containing the container type's child properties, and override
the
        Container indexer to return that type.

        * generator/ObjectGen.cs (Generate): call GenChildProperties

        * generator/Property.cs:
        * generator/ChildProperty.cs: Simplify these a bunch, since
        * child
        properties are now represented as C# properties as well. Also
add
        [GLib.Property(cname)] and [Gtk.ChildProperty(cname)]
attributes.

        * glib/Makefile.am (sources): add PropertyAttribute.cs

        * glib/PropertyAttribute.cs: attribute used to label
        GObject properties

        * gtk/Makefile.am (sources): add ChildPropertyAttribute.cs

        * gtk/gtk-api.raw: regenerate for parser changes (remove
        "Child"/"child_" from child property names).

        * gtk/ChildPropertyAttribute.cs: attribute used to label
        GtkContainer child properties

        * gtk/Container.custom: define the ContainerChild class, and an
        indexer to return instances of it.

        * doc/en/Gtk/: update for container child property change

svn path=/trunk/gtk-sharp/; revision=36284
2004-11-18 20:31:22 +00:00
Mike Kestner
343e5274dd oops, miscommit
svn path=/trunk/gtk-sharp/; revision=36221
2004-11-17 16:06:59 +00:00
Mike Kestner
7dbea0aa67 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=36219
2004-11-17 16:00:00 +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
Dan Winship
598f8e28e5 * glib/Value.cs: add new constructors for enum and boxed values
that take the name of the type rather than an object/property
        name pair; this way they work for both GObject properties and
        GtkContainer child properties.

        * glib/glue/value.c (gtksharp_value_create_from_type_name): glue
        for that

        * glib/Opaque.cs (GetOpaque): Fix this.

        * generator/Property.cs (Generate): Use the new GLib.Value
        constructors. (Fixes setting of enum-valued child properties.)

svn path=/trunk/gtk-sharp/; revision=36174
2004-11-16 18:03:58 +00:00
Dan Winship
bf07e92f42 * generator/DESIGN: Document what the different classes do
svn path=/trunk/gtk-sharp/; revision=36140
2004-11-15 16:00:08 +00:00
Dan Winship
03ca54df2f Fix the handful of LF-only lines in otherwise CRLF files, so that
emacs won't show the ^Ms on the other 99% of lines

svn path=/trunk/gtk-sharp/; revision=36135
2004-11-15 13:56:34 +00:00
Duncan Mak
0469f00a60 2004-11-13 Duncan Mak <duncan@ximian.com>
* generator/SymbolTable.cs: Add support for GDestroyNotify, so
	that `gtk_cell_layout_set_cell_data_func' will be generated in
	Gtk.ComboBox.

svn path=/trunk/gtk-sharp/; revision=36095
2004-11-14 03:13:09 +00:00
Dan Winship
e1dc10e4c8 * glib/Object.cs (CreateNativeObject): virtualize
(Object(GType)): Mark this ctor Obsolete

	* gtk/Gtk.metadata: disable the generated GType ctor on Gtk.Widget

	* gtk/Widget.custom (Widget, CreateNativeObject,
	Widget_ParentSet): Connect to our own ParentSet event from
	CreateNativeObject and the GType ctor, and keep a static Hashtable
	of parented widgets, so that adding a managed widget to a
	container keeps both the GObject and the managed object alive.

	* generator/ObjectGen.cs (GenCtors): handle the disable_gtype_ctor
	flag. Also, mark GType ctors [Obsolete]

svn path=/trunk/gtk-sharp/; revision=35885
2004-11-09 14:22:39 +00:00
Dan Winship
9084ce3133 * generator/ChildProperty.cs:
* generator/Property.cs: Fix child property names.

svn path=/trunk/gtk-sharp/; revision=35835
2004-11-08 17:48:27 +00:00
Dan Winship
df41dcc177 * parser/gapi2xml.pl (parseInitFunc, addPropElem): handle
GtkContainer child properties

	* generator/Property.cs:
	* generator/ChildProperty.cs: make Property subclassable and add a
	"ChildProperty" subclass.

	* generator/Makefile.am (sources): add ChildProperty.cs

	* generator/ClassBase.cs: handle "childprop" nodes by creating
	ChildProperty objects.

	* glib/Value.cs (explicit operator EnumWrapper): use
	g_value_get_flags() rather than g_value_get_enum() when
	appropriate.

	* glib/glue/value.c (glibsharp_value_holds_flags): glue for that

	* gtk/gtk-api.raw: regen to pick up child properties

	* gtk/Gtk.metadata:
	* gtk/Container.custom: hide the auto-generated
	Gtk.Container.ChildGetProperty and implement a nicer one by hand.

	* gtk/glue/container.c (gtksharp_container_child_get_property):
	utility function to set up an appropriate GValue for us

svn path=/trunk/gtk-sharp/; revision=35702
2004-11-05 16:47:15 +00:00
Tambet Ingo
2a3d6563db 2004-11-05 Tambet Ingo <tambet@ximian.com>
* generator/OpaqueGen.cs: Add optional "parent" attribute to Opaque
	types.

svn path=/trunk/gtk-sharp/; revision=35681
2004-11-05 07:18:14 +00:00
Mike Kestner
7f3171c814 merge to HEAD of jeroen and friends' work on the 2-4 branch. HEAD
is now tracking Gnome 2.6.

svn path=/trunk/gtk-sharp/; revision=35479
2004-10-29 20:33:07 +00:00
Mike Kestner
ed44e2d365 2004-10-21 Mike Kestner <mkestner@ximian.com>
* generator/SymbolTable.cs : map unsigned int to uint.  [Fixes #67732]

svn path=/trunk/gtk-sharp/; revision=35214
2004-10-21 19:11:13 +00:00
Dan Winship
5e9eb345d5 * generator/OpaqueGen.cs: Don't build the (IntPtr raw) constructor
if "disable_raw_ctor" is set on the opaque type.

        * gtk/Gtk.metadata: Make GtkTargetList opaque (fixes a crash in
        Gtk.Drag.Begin), hide the generated constructor and ref/unref
        methods, and fix up the interpretation of AddTable.

        * gtk/TargetList.custom (TargetList, ~TargetList): Implement the
        suppressed constructors and add a finalizer, which handle
        refcounting the underlying struct.
        (Add, Find, Remove): convenience overloads that take string
        instead of Gdk.Atom.

        * gtk/Makefile.am (customs): add TargetList.custom

svn path=/trunk/gtk-sharp/; revision=35135
2004-10-19 14:21:48 +00:00
Mike Kestner
f923d44d7a 2004-09-29 Mike Kestner <mkestner@ximian.com>
* generator/GStringGen.cs : new generatable impl for GStrings.
	* generator/InterfaceGen.cs : better error reporting.
	* generator/Makefile.am : add new source file.
	* generator/Method.cs : better error reporting.
	* generator/SymbolTable.cs : add new GString igen.

svn path=/trunk/gtk-sharp/; revision=34525
2004-09-29 18:00:38 +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
Mike Kestner
f96454a364 2004-06-25 Mike Kestner <mkestner@ximian.com>
* generator/*.cs : add gpl license blurb and clean up (c)'s.
	* parser/* : ditto
	* doc/*.cs : ditto
	* doc/gen-handlerargs-docs.cs : add little scripty.

svn path=/trunk/gtk-sharp/; revision=30398
2004-06-25 16:35:15 +00:00
Mike Kestner
0372a77462 2004-06-11 Mike Kestner <mkestner@ximian.com>
* doc/en/*/*.xml : update to remove Override* methods.
	* generator/Signal.cs : make the Override* methods private.  They
	should not ever be called manually and it saves about 800 "do not
	call this method" doc entries.

svn path=/trunk/gtk-sharp/; revision=29388
2004-06-11 22:41:01 +00:00
Mike Kestner
4cc4140ea5 2004-06-02 Mike Kestner <mkestner@ximian.com>
* generator/Field.cs : add field hiding, for manual impl.
	* generator/StructBase.cs : support disable_new, for manual impl.

svn path=/trunk/gtk-sharp/; revision=28715
2004-06-02 20:28:42 +00:00
Mike Kestner
77d1b452f5 2004-06-01 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : generate protected ctor () for all
	GLib.Objects that don't have any ctors.
	* gtk/CellRenderer.custom : remove ctor ().
	* gtkhtml/Gtk.metadata : add a disable_void_ctor rule for HTML.

svn path=/trunk/gtk-sharp/; revision=28645
2004-06-01 18:00:09 +00:00
Mike Kestner
73632b2747 2004-05-28 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : adjust to ObjectManager ns change.
	* glib/ManagedValue.cs : move to GLib and internalize.
	* glib/Object.cs : adjust to ObjectManager ns change.
	* glib/ObjectManager.cs : move to GLib.
	* glib/TypeConverter.cs : move to GLib.  return ManagedValue.GType
	when we can't match a type instead of GType.None.
	* gtk/*.custom: adjust for new TypeConverter ns and behavior.

2004-05-28  Mike Kestner  <mkestner@ximian.com>

	* en/* : run updater. fix a few *Sharp copy/pastisms.

svn path=/trunk/gtk-sharp/; revision=28362
2004-05-28 16:59:21 +00:00
Mike Kestner
ca91d3c85f 2004-05-23 Mike Kestner <mkestner@ximian.com>
* generator/SignalHandler.cs : put back the ObjectGen hack
	for param wrapping.  [Fixes #58876]

svn path=/trunk/gtk-sharp/; revision=27940
2004-05-24 02:25:16 +00:00
Mike Kestner
9f54a63375 2004-05-19 Mike Kestner <mkestner@ximian.com>
* gtk/Container.custom : add CallbackInvoke and use it in OnForall.

2004-05-19  Mike Kestner  <mkestner@ximian.com>

	* generator/Makefile.am : add TimeTGen.cs
	* generator/SymbolTable.cs : use new TimeTGen.
	* generator/StringGen.cs : s/GLibSharp/GLib
	* generator/TimeTGen.cs : generatable to marshal time_t.
	* glib/time_t_CustomMarshaler.cs : kill
	* glib/Makefile.am : remove time_t_CustomMarshaler.cs
	* glib/Markup.cs : s/GLibSharp/GLib
	* glib/Marshaller.cs : move to GLib namespace. Add methods to
	marshal time_t to and from DateTime.
	* glib/glue/time_t.c : kill
	* glib/glue/Makefile.am : remove time_t.c
	* glib/glue/makefile.win32 : remove time_t.o
	* gnome/*.custom : use GLib.Marshaller instead of the time_t custom
	marshaler.
	* gtk/*.custom : s/GLibSharp/GLib

svn path=/trunk/gtk-sharp/; revision=27704
2004-05-19 18:57:28 +00:00
Mike Kestner
bfc77b2230 2004-05-17 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : Generate a .cctor that calls the assembly's
	ObjectManager.Initialize method if the class will need to be registered
	with GLib.ObjectManager.  Enhance the Initialize method to allow
	multiple invocations.

svn path=/trunk/gtk-sharp/; revision=27554
2004-05-18 02:46:17 +00:00
Mike Kestner
ffe268c415 2004-05-17 Mike Kestner <mkestner@ximian.com>
* generator/SignalHandler.cs : fix some broken/redundant generation in
	the Object/Struct wrapping for sig params.
	* glib/Object.cs : internalize/protect lots of API that shouldn't need
	to be used by non-subclass/non-glib code. Return GType.Object as GType.
	* glib/Value.cs : use internal GLib.Object.NativeType prop.
	* sample/TestDnd.cs : use ToString instead of TypeName.

svn path=/trunk/gtk-sharp/; revision=27530
2004-05-17 17:52:00 +00:00
Mike Kestner
60d2fab857 2004-05-11 Mike Kestner <mkestner@ximian.com>
* *.pc.in : add Requires so that dependent libs are pulled in too.

svn path=/trunk/gtk-sharp/; revision=27132
2004-05-11 20:56:24 +00:00
Mike Kestner
c9f1eadc11 2004-05-07 Mike Kestner <mkestner@ximian.com>
[Derived from a patch by Ben Maurer]
	* generator/Ctor.cs : generate code to detect subclassing and handle
	GType registration and native object creation properly.
	* generator/Parameters.cs : add PropertyName accessor for param attr.
	* generator/Property.cs : use a new GLib.Value ctor.
	* glib/ObjectManager.cs : redo hash access.
	* glib/Object.cs : CreateNativeObject method to invoke g_object_newv
	and some refactoring of RegisterGType and LookupGType.
	* glib/Value.cs : make gtype field an IntPtr.
	* glib/glue/object.c : glue for g_object_newv use.
	* glib/glue/value.c : new glue for value creation.
	* gtk/Dialog.custom : fix a ctor declaration for auto-reg.
	* gtk/Gtk.metadata : mark a couple property_name attrs as examples.
	* sample/Subclass.cs : use auto-GType-registration now.

svn path=/trunk/gtk-sharp/; revision=26916
2004-05-07 13:42:59 +00:00
Jeroen Zwartepoorte
e07bb75fd6 2004-05-06 Jeroen Zwartepoorte <jeroen@xs4all.nl>
* generator/Method.cs: Don't use the "unsafe" modifier for methods which
	are part of an interface [fixes #58059].

svn path=/trunk/gtk-sharp/; revision=26843
2004-05-06 15:58:00 +00:00
Mike Kestner
31ef54a54a 2004-05-05 Mike Kestner <mkestner@ximian.com>
* generator/BoxedGen.cs : remove g_value_init DllImport and change
	(g|s)et_boxed to use a glue method to simplify dllmapping.
	* glib/Value.cs : add Init method.
	* glib/glue/value.cs : add get/set_boxed glue methods.
	* */*.config.in : remove libgobject mappings for dlls that no longer
	need them.

svn path=/trunk/gtk-sharp/; revision=26787
2004-05-05 20:14:14 +00:00
Mike Kestner
01acd7f576 2004-05-05 Mike Kestner <mkestner@ximian.com>
* generator/Signal.cs : rmv Handle param to SignalCallback ctor calls.
	s/GtkSharp.Signal*/GLib.Signal*.
	* generator/SignalHandler.cs : rmv Handle param to ctors as it's
	redundant.  s/GtkSharp.Signal*/GLib.Signal*. Use new Connect/Disconnect
	instead of generating DllImports into libgobject directly.
	* glib/SignalArgs.cs : move the the GLib namespace.
	* glib/SignalCallback.cs : expose Connect and Disconnect methods to
	hide some pinvokes that were previously generated. Also move to the
	GLib namespace.
	gnome/*Handler.cs : update to new SignalHandler API.
	gnome/CanvasProxy.cs : ditto
	gnome/void*Signal.cs : ditto

svn path=/trunk/gtk-sharp/; revision=26778
2004-05-05 18:24:04 +00:00
Owen Fraser-Green
ce55d821aa Minor fixed to get gstreamer working.
svn path=/trunk/gtk-sharp/; revision=26341
2004-04-29 21:21:57 +00:00
Rachel Hestilow
aee0a1f894 2004-04-16 Rachel Hestilow <rachel@nullenvoid.com>
* generator/GObjectGen.cs: Added new generatable to handle
	plain GObjects the same way we do subclasses.
	* generator/ManualGen.cs: Make FromNative/FromNativeReturn virtual
	to allow overriding.
	* generator/SymbolTable.cs: Use GObjectGen instead of
	ManualGen for GObject.
	* generator/Makefile.am: Add GObjectGen.cs.

svn path=/trunk/gtk-sharp/; revision=25651
2004-04-18 03:19:15 +00:00
Mike Kestner
1ac00ff205 2004-04-12 Mike Kestner <mkestner@ximian.com>
[Rework of a patch from Ben Maurer to turn GLib.Value
	into a valuetype.]
	* generator/BoxedGen.cs : fix operators for new valuetype GValues.
	* generator/ByRefGen.cs : new generatable for byref value types.
	* generator/Makefile.am : add ByRefGen.cs.
	* generator/MethodBody.cs : remove GValue special casing.
	* generator/Property.cs : rework value handling.
	* generator/Signal.cs : fix base virtual method value passing.
	* generator/SymbolTable.cs : map GValue to ByRefGen.
	* glib/Object.cs : rework GetProperty and SetProperty.
	* glib/Value.cs : make it a value type.
	* glib/ValueArray.cs : fix GValue passing.
	* glib/glue/value.c : rework for valuetype GValues.
	* gnome/Program.custom : fix GValue passing
	* gtk/Gtk.metadata : make TreeModel.GetValue value param pass_as=ref.
	* gtk/ListStore.custom : fix GValue passing
	* gtk/NodeStore.cs : fix GValue passing
	* gtk/TextTag.custom : fix GValue passing
	* gtk/TreeModelSort.custom : fix GValue passing
	* gtk/TreeStore.custom : fix GValue passing

svn path=/trunk/gtk-sharp/; revision=25368
2004-04-12 15:54:57 +00:00
Mike Kestner
e7bf3a279f 2004-04-07 Mike Kestner <mkestner@ximian.com>
* generator/ClassBase.cs : remove default ctor generation and
	hasDefaultConstructor field.
	* generator/Ctor.cs : chain to base (IntPtr.Zero).
	* generator/StructBase.cs : remove hasDefaultConstructor usage.
	* glib/Object.cs : remove Object () ctor.  Add Ben's GetGType
	method, although nothing uses it yet.  Still working on integrating
	the remainder of Ben's patch.
	* gtk/Gtk.metadata : remove all the disabledefaultctor rules.
	* */*.custom : add base (IntPtr.Zero) or this (...) chaining for
	all ctors.

svn path=/trunk/gtk-sharp/; revision=25184
2004-04-07 19:15:01 +00:00
Mike Kestner
05e4e0b9d3 2004-04-04 Mike Kestner <mkestner@ximian.com>
* generator/SymbolTable.cs : don't use StringGen for gunichar.
	* glib/glue/unichar.c : glue to fetch a gunichar as a utf8 string.
	* glib/glue/Makefile.am : add unichar.c
	* glib/glue/makefile.win32 : add unichar.c
	* gtk/Gtk.metadata : hide TextIter.GetChar
	* gtk/TextIter.custom : manually impl Char prop. [fixes #53425]

svn path=/trunk/gtk-sharp/; revision=25054
2004-04-05 18:31:34 +00:00
Mike Kestner
7b15abe5fd 2004-04-04 Mike Kestner <mkestner@ximian.com>
* generator/BoxedGen.cs : DllImport glibsharpglue for value_create.

svn path=/trunk/gtk-sharp/; revision=25045
2004-04-05 16:06:49 +00:00
Mike Kestner
ab2f05fa77 2004-03-31 Mike Kestner <mkestner@ximian.com>
* configure.in : remove atk/glue/Makefile
	* atk/Makefile.am : comment out subdirs for now
	* atk/makefile.win32 : don't build glue
	* */glue/Makefile.am : remove generated.c from sources
	* */glue/makefile.win32 : remove generated.c from sources
	* generator/ObjectGen.cs : disable vm glue generation for now.

svn path=/trunk/gtk-sharp/; revision=24850
2004-03-31 16:34:08 +00:00
Mike Kestner
9861569931 2004-03-18 Mike Kestner <mkestner@ximian.com>
* configure.in : expand atk/glue/Makefile
	* atk/Makefile.am : generate glue and build glue dir
	* atk/makefile.win32 : ditto
	* atk/glue/Makefile.am : build new glue
	* atk/glue/makefile.win32 : build new glue
	* atk/glue/vmglueheaders.h : new includes for vm glue
	* atk/glue/win32dll.c : win dll building code
	* generator/CodeGenerator.cs : add --gluelib-name and
	--glue-filename argument parsing.
	* generator/GenerationInfo.cs : add GluelibName, GlueFilename,
	GlueEnabled, GlueWriter, and CloseGlueWriter.
	* generator/ObjectGen.cs : Add VirtualMethod glue generation
	* generator/Statistics.cs : Add warning message for virtual
	method throttling.

svn path=/trunk/gtk-sharp/; revision=24292
2004-03-18 20:56:32 +00:00
Mike Kestner
f5289b6c93 2004-03-16 Mike Kestner <mkestner@ximian.com>
* generator/Signal.cs : streamline the remove code a tad.

svn path=/trunk/gtk-sharp/; revision=24170
2004-03-16 21:21:11 +00:00
Mike Kestner
7cf239155e 2004-03-16 Mike Kestner <mkestner@ximian.com>
* generator/Signal.cs : remove a C.WL.

svn path=/trunk/gtk-sharp/; revision=24161
2004-03-16 20:10:05 +00:00
Mike Kestner
1a1f5e1702 2004-03-16 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : don't gen a Signals hash per class.
	* generator/Signal.cs : gen checks for [ConnectBefore].
	* generator/SignalHandler.cs : add connect_flags param to ctor.
	* glib/ConnectBeforeAttribute.cs : new attr
	* glib/Makefile.am : add new file
	* glib/Object.cs : add before/after hashes and EventLists
	* gnome/CanvasProxy.cs : use AfterSignals and AfterHandlers.

svn path=/trunk/gtk-sharp/; revision=24157
2004-03-16 19:43:04 +00:00
John Luke
51a6b95ed4 2004-03-14 John Luke <jluke@cfl.rr.com>
* parser/gapi-fixup.in:
        * generator/gapi-codegen.in: s/@MONO@/@RUNTIME@

svn path=/trunk/gtk-sharp/; revision=24026
2004-03-14 21:51:37 +00:00
Mike Kestner
e83c55a242 2004-03-12 Mike Kestner <mkestner@ximian.com>
* */Makefile.am : automakify the build
	* */Makefile.in : kill
	* *.custom : remove System.Drawing dependencies
	* *.cs : remove System.Drawing dependencies
	* *-api.xml : mv to *-api.raw
	* glue/* : mv to lib specific gluelibs for glib, gdk, gtk, and glade.
	* gtk/gtk-symbols : alias GtkType to GType
	* sources/gtk-sharp-sources.xml : create .raw files. They are now
	transformed to .xml files by the metadata compilation step.

svn path=/trunk/gtk-sharp/; revision=23967
2004-03-12 21:18:11 +00:00
Urs C. Muff
c8511cd513 Using configurable runtime during build process --> RUNTIME=@MONO@ in Makefile.in files. MONO is defined in configure.in. For Mac OS X == Darwin it is 'mint' for now, for the others it remains 'mono'. Also use the more generic code from mono/autogen.sh to detect libtool.
svn path=/trunk/gtk-sharp/; revision=23880
2004-03-10 15:57:33 +00:00
Mike Kestner
64e69d3832 2004-03-08 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : ignore virtual_method elems for now.
	* parser/gapi2xml.pl : parse the non-signal class methods and add as
	virtual_method elements in the API xml
	* */*-api.xml : regen

svn path=/trunk/gtk-sharp/; revision=23809
2004-03-08 18:08:48 +00:00
Mike Kestner
f774796311 2004-02-10 Mike Kestner <mkestner@ximian.com>
* gconf/GConf.PropertyEditors/PropertyEditorColorPicker.cs :
	nuke a GnomeSharp.
	* generator/Signal.cs : move eventhandlers and args into the
	base namespace instead of a *Sharp namespace.
	* sample/*.cs : nuke using *Sharp.

svn path=/trunk/gtk-sharp/; revision=22956
2004-02-10 20:35:40 +00:00
Mike Kestner
d41f6593b0 2004-02-10 Mike Kestner <mkestner@ximian.com>
* art/Art.metadata : mark a field private
	* art/art-api.xml : regen
	* gda/Gda.metadata : mark a few structs opaque
	* gda/gda-api.xml : regen
	* gdk/*.custom : fix changed field names
	* gdk/gdk-api.xml : regen
	* generator/Field.cs : StudlyCase simple typed field names.
	* gnome/Gnome.metadata : mark FontEntry.weight private to
	avoid collision with Weight field. s|//|/api/namespace|g
	* gnome/gnome-api.xml : regen
	* gtk/Gtk.metadata : rename AccelKey.accel_key to key to
	avoid collision with type name.
	* gtk/*.custom : fix changed field names
	* gtk/gtk-api.xml : regen
	* pango/pango-api.xml : regen
	* parser/gapi_pp.pl : add a private_regex to hide BACKEND
	and ENGINE apis, which are by convention private.
	* sample/* : make compile
	* sample/GtkDemo/* : make compile
	* sample/test/* : make compile
	* sources/gtk-sharp-sources.xml : exclude a bunch of pango
	source files.

svn path=/trunk/gtk-sharp/; revision=22947
2004-02-10 16:04:50 +00:00
Mike Kestner
3d95f23f6f 2004-02-07 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : oops, remove a couple C.WLs.

svn path=/trunk/gtk-sharp/; revision=22866
2004-02-07 23:43:35 +00:00
Mike Kestner
f91aeb5425 2004-02-07 Gustavo Giraldez <gustavo.giraldez@gmx.net>
* atk/Makefile.in : fix copy/paste error in --assembly-name.
	* generator/ObjectGen.cs : rework ObjectManager generation code.
	* glade/Makefile.in : fix copy/paste error in --assembly-name.

svn path=/trunk/gtk-sharp/; revision=22865
2004-02-07 23:24:15 +00:00
Mike Kestner
dc7145103d 2004-02-06 Mike Kestner <mkestner@ximian.com>
* generator/Method.cs : for Opaque/Object retvals, if raw_ret is
	NULL, return null instead of an object with a NULL handle.

svn path=/trunk/gtk-sharp/; revision=22847
2004-02-06 21:33:14 +00:00
Mike Kestner
4251d47fe9 2004-02-04 Mike Kestner <mkestner@ximian.com>
* generator/CustomMarshalerGen.cs : impl MarshalReturnType.
	* generator/Method.cs : add CustomMarshalerGen return type handling.
	* generator/Property.cs : rework property type selection.
	* generator/SymbolTable.cs : add time_t mapping
	* glib/time_t_CustomMarshaler.cs : impl native to managed methods.
	* glue/time_t.c : remove debugging code.

svn path=/trunk/gtk-sharp/; revision=22772
2004-02-04 19:54:46 +00:00
Mike Kestner
d4c8fc78c7 2004-02-02 Mike Kestner <mkestner@ximian.com>
* generator/CustomMarshalerGen.cs : beginnings of a new generatable.
	* generator/SymbolTable.cs : mangle interface keyword to iface.

svn path=/trunk/gtk-sharp/; revision=22712
2004-02-02 21:35:01 +00:00
Martin Willemoes Hansen
058077b7f1 * generator/ClassBase.cs: Converted String uses to the string alias.
* generator/ConstStringGen.cs: Ditto
        * generator/Ctor.cs: Ditto
        * generator/EnumGen.cs: Ditto
        * generator/ManualGen.cs: Ditto
        * generator/SignalHandler.cs: Ditto
        * generator/StringGen.cs: Ditto

svn path=/trunk/gtk-sharp/; revision=22710
2004-02-02 20:19:43 +00:00
Mike Kestner
1742a837c1 2004-01-27 Mike Kestner <mkestner@ximian.com>
* generator/BoxedGen.cs : gen a Value to Boxed explicit cast op.
	* generator/Property.cs : use new cast in Boxed getters.
	[Fixes #53414]

svn path=/trunk/gtk-sharp/; revision=22553
2004-01-27 22:06:24 +00:00
Mike Kestner
2dc2f1ed0f 2004-01-27 Mike Kestner <mkestner@ximian.com>
* generator/MethodBody.cs : remove unnecessary generation for
	Handle using out parameters.
	* gtk/Gtk.Metadata : make TextIter opaque
	* gtk/TextBuffer.custom : remove redundant dllimport
	* gtk/gtk-api.xml : regen

svn path=/trunk/gtk-sharp/; revision=22551
2004-01-27 19:58:59 +00:00
Mike Kestner
2340cb040e 2004-01-25 Mike Kestner <mkestner@ximian.com>
* art/art-api.xml : regen
	* gdk/gdk-api.xml : regen
	* generator/SymbolTable.cs : add unsigned char mapping
	* gnome/gnome-api.xml : regen
	* parser/gapi2xml.pl : handle unsigned keyword in fields,
	typedefs, and parameter types.
	[Fixes #53055]

svn path=/trunk/gtk-sharp/; revision=22487
2004-01-26 04:53:05 +00:00
Martin Willemoes Hansen
64e7ad9f30 * generator/Ctor.cs: Warnings was output like "ctor" fixed to
output like "in ctor", like the rest of the warnings.

svn path=/trunk/gtk-sharp/; revision=22394
2004-01-22 11:27:29 +00:00
Mike Kestner
e4165fbb18 2004-01-21 Mike Kestner <mkestner@ximian.com>
* generator/Field.cs : kill Protection, restructure Generate
	and add FIXMEs for broken parts. Add StudlyName and move array
	fields to use Studly names.

svn path=/trunk/gtk-sharp/; revision=22357
2004-01-21 20:47:41 +00:00
Mike Kestner
13c8647b1e 2004-01-19 Mike Kestner <mkestner@ximian.com>
* art/Art.metadata : correct a couple symbolic array_lens
	* art/art-api.xml : regen
	* gdk/Gdk.metadata : correct a symbolic array_len
	* gdk/gdk-api.xml : regen
	* generator/Field.cs : generate array fields with MarshalAs
	attrs for correct marshaling.

svn path=/trunk/gtk-sharp/; revision=22261
2004-01-19 17:05:53 +00:00
Mike Kestner
d1367eb515 2004-01-18 Mike Kestner <mkestner@ximian.com>
* generator/Field.cs : refactored code from StructBase
	* generator/StructBase.cs : spin off Field class

svn path=/trunk/gtk-sharp/; revision=22239
2004-01-19 05:30:05 +00:00
Mike Kestner
b17f91170f 2004-01-18 Mike Kestner <mkestner@ximian.com>
* generator/SymbolTable.cs : mangle parms named readonly

svn path=/trunk/gtk-sharp/; revision=22238
2004-01-19 05:27:42 +00:00
Martin Willemoes Hansen
c2d4c12e67 * generator/Method.cs: Methods which returns void and has a single out parameter
like void Foobar (..., out int baz, ...) are turned into the more .NET like
          signature int Foobar (...), this fixes bug 46392
        * generator/Signature.cs: Ditto
        * generator/MethodBody.cs: Ditto
        * gtk/ListStore.custom: Ditto
        * gtk/TextBuffer.custom: Ditto
        * gtk/TreeStore.custom: Ditto

svn path=/trunk/gtk-sharp/; revision=22126
2004-01-15 21:18:46 +00:00
Mike Kestner
80a630a8a4 2004-01-13 Tambet Ingo <tambet@ximian.com>
* gtk-sharp.pc.in : add libdir var
	* generator/SymbolTable.cs : add GByteArray mapping.

svn path=/trunk/gtk-sharp/; revision=22070
2004-01-14 18:40:00 +00:00
Mike Kestner
6ec923833e 2004-01-13 Mike Kestner <mkestner@ximian.com>
* generator/Signal.cs : use ValueArray to assemble parms arg for
	g_signal_chain_from_overriden call.  Initialize retval GValue for
	above.
	* glib/Object.cs : g_signal_chain_from_overridden parms are IntPtrs.
	* glib/TypeConverter.cs : handle unboxed ValueTypes.
	* glib/Value.cs : handle unboxed struct types.  add ctor for init'd
	unset Values.
	* glib/ValueArray.cs : new binding for GValueArray used by VMs.
	* glue/valuearray.c : field accessors
	* glue/Makefile.am : add new glue file
	* glue/makefile.win32 : add new glue file
	[Fixes #52680]

svn path=/trunk/gtk-sharp/; revision=22069
2004-01-14 18:05:50 +00:00
Joe Shaw
0925be2387 2003-12-16 Joe Shaw <joe@ximian.com>
* generator/SymbolTable.cs (MangleName): Add "lock" and "callback"
	to the list of names that need to be mangled.  The former is a C#
	reserved keyword and the latter is already used as an argument to
	methods which marshal callbacks.

svn path=/trunk/gtk-sharp/; revision=21276
2003-12-17 15:27:34 +00:00
Mike Kestner
ff263164e3 2003-12-15 Mike Kestner <mkestner@ximian.com>
* generator/BoxedGen.cs : s/uint/GLib.GType
	* generator/ManualGen.cs : add a ctor to pass ToNative handle name
	* generator/ObjectGen.cs : s/uint/GLib.GType
	* generator/Signal.cs : use GLib.GType and call OverrideVirtualMethod
	* generator/SymbolTable.cs : make GType a ManualGen and update a few
	ManualGens to the new signatures.
	* glib/DefaultSignalHandler.cs : s/Type/System.Type
	* glib/ManagedValue.cs : s/uint/GLib.GType
	* glib/Object.cs : s/uint/GLib.GType, add OverrideVirtualMethod.
	* glib/Type.cs : s/uint/IntPtr, add static fields for fundamentals.
	make it a value type and add ==, !=, Equals, and GetHashCode.
	* glib/TypeConverter.cs : use new GType statics, not fundamentals.
	* glib/Value.cs : use new GType statics, not fundamentals.
	* gnome/*.custom : s/uint/GLib.GType
	* gtk/*Store.custom : use GType statics, not fundamentals.
	* sample/Subclass.cs : s/uint/GLib.GType.

svn path=/trunk/gtk-sharp/; revision=21181
2003-12-15 16:59:25 +00:00
Mike Kestner
027410def9 2003-12-12 Mike Kestner <mkestner@ximian.com>
* generator/CallbackGen.cs : kill some redundant generation
	* generator/MethodBody.cs : pass array parameters as arrays of
	the corresponding native type.

svn path=/trunk/gtk-sharp/; revision=21083
2003-12-12 22:56:28 +00:00
Mike Kestner
ba1d3996a4 2003-12-10 Mike Kestner <mkestner@ximian.com>
* generator/CallbackGen.cs : kill ref_owned generation
	* generator/ClassBase.cs : use simple GetObject w/o ref_owned
	* generator/ManagedCallString.cs : new class to generate native
	to managed method calls.
	* generator/Method.cs : kill ref_owned generation
	* generator/MethodBody.cs : kill ref_owned generation
	* generator/Property.cs : kill ref_owned generation
	* generator/Signal.cs : generate delegates and vtable connect
	methods for all signals. Mark VMs with new attr.
	* generator/StructBase.cs : kill ref_owned generation
	* glib/DefaultSignalHandlerAttribute.cs : new attr to mark
	virtual methods.
	* glib/Object.cs : add overload for GetObject that defaults
	to ref_owned=false. Add extern for VM override glue.

svn path=/trunk/gtk-sharp/; revision=21005
2003-12-10 22:56:49 +00:00
Mike Kestner
bc37b4ff76 2003-12-08 Mike Kestner <mkestner@ximian.com>
* generator/Signal.cs : add virtual method generation for the
	default signal handlers.
	* glib/Object.cs : add g_signal_chain_from_overridden extern

svn path=/trunk/gtk-sharp/; revision=20920
2003-12-09 05:01:22 +00:00
Mike Kestner
968230bd25 2003-12-08 Mike Kestner <mkestner@ximian.com>
* generator/VMSignature.cs : new class to generate virtual method
	signatures for default signal handlers.

svn path=/trunk/gtk-sharp/; revision=20888
2003-12-08 19:14:12 +00:00
Mike Kestner
9c3f47e5d3 2003-12-08 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : stupid little whitespace change

svn path=/trunk/gtk-sharp/; revision=20887
2003-12-08 19:05:03 +00:00
Mike Kestner
f61ac5c89c 2003-12-03 Mike Kestner <mkestner@speakeasy.net>
* generator/CallbackGen.cs : use new sig and isig classes.
	* generator/Ctor.cs : use new sig, isig, and body classes.
	* generator/ImportSignature.cs : isig code spun out from Parameters.
	* generator/Method.cs : use new sig, isig, and body classes.
	* generator/MethodBody.cs : spun Initialize, GetCallString,
	Finish, and Exception throwing methods from Parameters.
	* generator/Parameters.cs : Slayed the evilness that was CreateSignature.
	It is now essentially a container for Parameter classes instead of a
	tangled mess of code trying to do everything remotely related to
	parameter lists. Also completely killed the VAType/IsVarArgs stuff,
	as it can be done with the array and params attrs instead.
	* generator/Property.cs : use new sig class.
	* generator/Signature.cs : new method sig generator extracted from
	Parameters class. add "params" keyword support for tagged parameters.
	* gnome/Gnome.metadata : hide IconList.GetSearchPath (to be manual)
	* gnome/gnome-api.xml : regen
	* gtk/ListStore.custom : kill unneeded overload
	* gtk/TreeStore.custom : kill unneeded overload
	* gtk/Gtk.metadata : mark params/args on *store_newv
	* gtk/gtk-api.xml : regenerated

svn path=/trunk/gtk-sharp/; revision=20755
2003-12-03 23:08:14 +00:00
Mike Kestner
c1916a0aa0 2003-11-29 Mike Kestner <mkestner@speakeasy.net>
* generator/Parameters.cs : handle null_ok for arrays.
	* gtk/Gtk.metadata : mark a null_ok in Drag.DestSet
	* gtk/gtk-api.xml : regen

svn path=/trunk/gtk-sharp/; revision=20619
2003-11-30 03:25:35 +00:00
Mike Kestner
c8afbd3ca2 2003-11-29 Mike Kestner <mkestner@speakeasy.net>
* generator/StructBase.cs : remove ==/!= operator generation.

svn path=/trunk/gtk-sharp/; revision=20611
2003-11-29 23:12:54 +00:00
Mike Kestner
c2d44cbb6a 2003-11-23 Mike Kestner <mkestner@ximian.com>
* generator/SignalHandler.cs : use CONNECT_AFTER.

svn path=/trunk/gtk-sharp/; revision=20360
2003-11-23 21:43:55 +00:00
Mike Kestner
62a858e0cd 2003-11-16 Mike Kestner <mkestner@ximian.com>
* generator/Parameters: handle array+len param pairs.
	* gtk/Gtk.metadata : unhide DestDefaults and mark targets param of
	drag_dest_set as array.
	* gtk/gtk-api.xml : regenerate

svn path=/trunk/gtk-sharp/; revision=20096
2003-11-17 03:44:32 +00:00
Mike Kestner
5dd6cef552 2003-11-13 Mike Kestner <mkestner@ximian.com>
* generator/SignalHandler.cs : guard against destroyed signalhandlers.

svn path=/trunk/gtk-sharp/; revision=19982
2003-11-14 03:05:20 +00:00
Mike Kestner
d69268abbf 2003-11-07 Mike Kestner <mkestner@ximian.com>
* configure.in : add mono check.  expand wrapper scripts
	* generator/Makefile.in : use install. install a gapi-codegen wrapper.
	* generator/SymbolTable.cs : add SimpleGen for short
	* generator/gapi-codegen.in : new wrapper script in file.
	* parser/Makefile.in : use install. install a gapi-fixup wrapper.
	* generator/gapi-fixup.in : new wrapper script in file.
	* parser/gapi2xml.pl : deal with non-namespaced enums. ignore
	forward struct declarations.

svn path=/trunk/gtk-sharp/; revision=19712
2003-11-07 18:14:35 +00:00
Mike Kestner
7ade209999 2003-11-02 Mike Kestner <mkestner@ximian.com>
* generator/CallbackGen.cs : use a temporary ret value if there
	is any cleanup to be done after the call.  Thanks to John Luke
	for a patch which identified the problem.

svn path=/trunk/gtk-sharp/; revision=19561
2003-11-03 01:36:55 +00:00
Martin Willemoes Hansen
d5a4cdb689 * generator/Method.cs: marked Is and Has methods,
to be generated as properties, fixes bug [47910]

svn path=/trunk/gtk-sharp/; revision=19468
2003-10-29 22:11:59 +00:00
Mike Kestner
0cdee479e2 2003-10-28 Mike Kestner <mkestner@ximian.com>
* generator/BoxedGen.cs : generate GLib.Value ctors. [fixes #47168]
	* generator/Property.cs : use new Boxed value ctors.
	* generator/StructBase.cs : use existing Writer if available.

svn path=/trunk/gtk-sharp/; revision=19433
2003-10-28 15:45:35 +00:00
Mike Kestner
5eadb9b87c 2003-10-20 Mike Kestner <mkestner@ximian.com>
* generator/Parameters.cs : treat interface out params like objects.
	* gtk/gtk-api.xml : regenerated
	* gtk/Gtk.metadata : mark TreeSelection.GetSelected params out.
	* gtk/TreeSelection.custom : emptied since it's now generated.
	* sources/Gtk.metadata : kill hide of TreeSelection.GetSelected.
	[fixes #49858]

svn path=/trunk/gtk-sharp/; revision=19229
2003-10-20 21:27:38 +00:00
Mike Kestner
0525cb807e 2003-10-20 Mike Kestner <mkestner@ximian.com>
* generator/Parameters.cs : add a cast to the call_string for Length
	params other than int.

svn path=/trunk/gtk-sharp/; revision=19202
2003-10-20 17:33:05 +00:00
Mike Kestner
c62e9ab977 2003-10-17 Mike Kestner <mkestner@ximian.com>
* generator/Parameters.cs : mark enum pointer params as out.
	need to audit if any are really arrays.  [Fixes #49779]

svn path=/trunk/gtk-sharp/; revision=19153
2003-10-17 23:06:37 +00:00
Mike Kestner
686688d760 2003-10-15 Mike Kestner <mkestner@ximian.com>
* generator/Property.cs : use new Opaque value ctor and
	rework get/set blocks for Opaque types. [Fixes #47959]
	* glib/Opaque.cs : kill explicit IntPtr operator.
	* glib/Value.cs : rework Opaque value ctor.

svn path=/trunk/gtk-sharp/; revision=19088
2003-10-15 20:13:50 +00:00
Mike Kestner
bdc5c7071f 2003-10-13 Mike Kestner <mkestner@ximian.com>
* gdk/Gdk.metadata : mark an array param on PixbufDestroyNotify
	* gdk/gdk-api.xml : regenerated
	* generator/CallbackGen.cs : Handle out params in callback sigs
	and ditch the object[] args handling for typed args.
	* generator/Parameters.cs : more proactive PassAs logic.  We now
	default all simple pointer types (uint*, int*, double*, etc...)
	to out params unless they are marked otherwise in the XML with a
	pass_as tag or an array tag.  [Fixes #32104]

svn path=/trunk/gtk-sharp/; revision=18993
2003-10-13 21:53:40 +00:00
Mike Kestner
03ac3ab7fe 2003-10-11 Mike Kestner <mkestner@ximian.com>
* generator/OpaqueGen.cs (FromNativeReturn): just do a
	new on the type.  GLib.Opaque.GetOpaque was apparently an
	homage to GetObject that just seems wrong.

svn path=/trunk/gtk-sharp/; revision=18893
2003-10-11 21:33:16 +00:00
Mike Kestner
71e9414883 2003-10-11 Mike Kestner <mkestner@ximian.com>
* generator/Parameters.cs : Properly handle out params for
	Object and Opaque types.
	* gtk/ListStore.custom: remove out on GetValue overload
	* gtk/TreeStore.custom: remove out on GetValue overload
	* gtk/gtk-api.xml : regenerated
	* sources/Gtk.metadata : remove some incorrect out tags

svn path=/trunk/gtk-sharp/; revision=18891
2003-10-11 20:53:10 +00:00