Commit Graph

71 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
c9580f2355 2003-10-07 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs (Generate): check sigs.Count in addition
	to the null check to determine if the signals hash should be
	generated.

svn path=/trunk/gtk-sharp/; revision=18718
2003-10-07 22:21:45 +00:00
Mike Kestner
06a02e97b4 2003-10-06 Mike Kestner <mkestner@ximian.com>
* generator/CodeGenerator.cs (Main): use new ObjectGen.GenerateMappers.
	* generator/GenerationInfo.cs (Ctor): new (dir, assembly) ctor
	* generator/ObjectGen.cs : move hash management to Generate from Ctor,
	index it on dir, and make it hold new DirectoryInfo refs.  Refactor
	GenerateMapper. The object mappers are now assembly based instead of
	namespace based.

svn path=/trunk/gtk-sharp/; revision=18681
2003-10-06 18:18:49 +00:00
Mike Kestner
460b3e5623 2003-10-04 Mike Kestner <mkestner@ximian.com>
* generator/AliasGen.cs : stub new Generate overload.
	* generator/BoxedGen.cs : implement new Generate overload.
	* generator/CallbackGen.cs (Generate):implement new overload.
	* generator/ClassBase.cs : implement new Generate overload and
	pass around the gen_info.
	* generator/ClassGen.cs : implement new Generate overload.
	* generator/Ctor.cs (Generate): s/sw/gen_info.
	* generator/EnumGen.cs : implement new Generate overload.
	* generator/GenBase.cs : expose NSElem, add gen_info param to
	AppendCustom. kill CreateWriter.
	(GenWrapper): add gen_info param and use it to open stream.
	* generator/GenerationInfo.cs : new class to pass around generation
	related information and perform tasks like opening streams.
	* generator/IGeneratable.cs : add Generate(gen_info) overload.
	* generator/InterfaceGen.cs : implement new Generate overload.
	* generator/ManualGen.cs : stub new Generate overload.
	* generator/Method.cs (Generate): accept gen_info. kill GenerateComments.
	* generator/ObjectGen.cs : implement new Generate overload.
	* generator/OpaqueGen.cs : implement new Generate overload.
	* generator/Parameters.cs (Initialize): s/sw/gen_info.
	* generator/Property.cs (Generate): accept gen_info.
	* generator/Signal.cs (Generate): accept gen_info.
	* generator/SimpleGen.cs : stub new Generate overload.
	* generator/StructBase.cs : s/sw/gen_info
	* generator/StructGen.cs : implement new Generate overload.

svn path=/trunk/gtk-sharp/; revision=18615
2003-10-05 00:20:17 +00:00
Mike Kestner
5b7aaf1c4f 2003-10-03 Mike Kestner <mkestner@ximian.com>
* generator/*.cs : Kill DoGenerate.

svn path=/trunk/gtk-sharp/; revision=18572
2003-10-03 22:20:40 +00:00
Mike Kestner
b6114fef1e 2003-05-18 Mike Kestner <mkestner@speakeasy.net>
* generator/CallbackGen.cs : use non-static symtab, kill doc comments
	* generator/ClassBase.cs : use non-static symtab
	* generator/CodeGenerator.cs : use non-static symtab
	* generator/EnumGen.cs : kill doc comments, don't gen using System here
	* generator/GenBase.cs : gen using System here for all types
	* generator/InterfaceGen.cs : don't gen using System here.
	* generator/Method.cs : use non-static symtab
	* generator/ObjectGen.cs : kill doc comments, use non-static symtab
	* generator/OpaqueGen.cs : don't gen using System here.
	* generator/Parameters.cs : use non static symtab.
	* generator/Parser.cs : use non static symtab. add SimpleGen's and
	ManualGen's
	* generator/Property.cs : use non static symtab
	* generator/SignalHandler.cs : use non static symtab
	* generator/StructBase.cs : use non static symtab
	* generator/SymbolTable.cs : major refactoring. now uses SimpleGen and
	ManualGen IGeneratables to simplify the method and prop code.  Is now
	instance based with a static prop to get the singleton instance, so that
	a this indexer can be provided to access the IGeneratables nicely. Gearing
	up to remove even more code from here by accessing IGeneratables directly.

svn path=/trunk/gtk-sharp/; revision=14687
2003-05-19 02:45:17 +00:00
Mike Kestner
9066fcac16 2003-05-18 Mike Kestner <mkestner@speakeasy.net>
* generator/ClassBase.cs : Use QualifiedName in spew
	* generator/ObjectGen.cs (Validate): kill, not used

svn path=/trunk/gtk-sharp/; revision=14673
2003-05-18 19:24:28 +00:00
Mike Kestner
9e325bd283 2003-05-07 Mike Kestner <mkestner@speakeasy.net>
* generator/ClassBase.cs (GenSignals): remove doc comment param
	* generator/GenBase.cs (CreateWriter): alter generated file comment
	* generator/InterfaceGen.cs (CreateWriter): remove doc comments
	* generator/ObjectGen.cs (Generate): use new GenSignals sig
	* generator/Signal.cs : make signal marshalers internal and remove
	doc comments.
	* generator/SignalHandler.cs : make signal marshalers internal and remove
	doc comments.
	* gnome/CanvasProxy.cs : use Gnome.voidObjectSignal since the gtk one is
	inaccessible now.

svn path=/trunk/gtk-sharp/; revision=14385
2003-05-08 04:44:13 +00:00
Mike Kestner
95fc33f785 2003-02-24 Mike Kestner <mkestner@speakeasy.net>
* generator/ObjectGen.cs : gen GLib.Value ctor, not uint
	* glib/Object.cs : use GLib.Type in RegisterGType and
	  make the g_object_new ctor use GLib.Type.
	* glib/Type.cs : new thin wrapper for GValue type
	* glib/*.cs : s/Type/System.Type

svn path=/trunk/gtk-sharp/; revision=11920
2003-02-24 06:39:30 +00:00
Duncan Mak
fb60c23e4a 2003-01-05 Duncan Mak <duncan@ximian.com>
* generator/GenBase.cs (AppendCustom): Add #region to code from
	.custom files.

	* generator/*Gen.cs: Add #region markers.

svn path=/trunk/gtk-sharp/; revision=10188
2003-01-05 23:51:37 +00:00
Mike Kestner
f750d78d6a 2002-12-24 Mike Kestner <mkestner@speakeasy.net>
* generator/ObjectGen.cs : generate protected GType ctors
	* generator/SymbolTable.cs : map GType to uint
	* glib/Object.cs : add GType ctor. add RegisterGType.
	* glue/type.c (gtksharp_register_type): new GType registrar
	* */*.custom : make GType params uints
	* sample/Subclass.cs : a simple type registration example

svn path=/trunk/gtk-sharp/; revision=9870
2002-12-25 00:36:00 +00:00
Mike Kestner
ab081f8358 2002-09-04 Mike Kestner <mkestner@speakeasy.net>
* generator/ObjectGen.cs : generate dtors.
	* glib/Object.cs : Implement IDisposable. Add a new DisposeNative
	method. Implement default dtor.
	* glue/object.c : new gtksharp_object_unref_if_floating method.
	* gtk/Object.custom : override DisposeNative to check float bit.

svn path=/trunk/gtk-sharp/; revision=7235
2002-09-04 05:25:58 +00:00
Rachel Hestilow
e9d1e0b6dc 2002-08-19 Rachel Hestilow <hestilow@ximian.com>
* art/Makefile.in (clean): Change to avoid bugging out on generated/CVS.

	* glib/ObjectManager.cs: Added. Used to be auto-generated, but
	now it can infer names, and relies on per-namespace ObjectManager
	classes to inform it of oddly-named classes.

	* generator/IGeneratable.cs, GenBase.cs: New "DoGenerate" property.
	* generator/*Gen.cs: Honor DoGenerate.
	* generator/CodeGenerator.cs: Support including dependency files
	which will not be generated.
	* generator/ObjectGen.cs: Generate mapping file per-namespace, as one
	that calls back to the one in glib. Only generate if the name does
	not follow the normal conventions, otherwise, GtkSharp.ObjectManager
	can infer the name.
	* generator/Parser.cs: Accept 'generate' flag to pass on to the
	IGeneratables. Parse a new toplevel element, "symbol", which adds
	a type to the SymbolTable (instead of hard-coding it).
	* generator/SignalHandler.cs: Do not optimize signal handler creation,
   instead creating them in their own namespaces. Do not generate
	if the calling Signal told us not to.
	* generator/Signal.cs: Do not generate handlers if container's DoGenerate
	is false. Adjust to the marshaller name being in a sub-namespace.
	* generator/SymbolTable.cs (AddSimpleType, AddManualType): Used
	to add simple and manually wrapped types at runtime instead of
	compile-time.
	(FromNative): Remove hard-coded cases for manually wrapped types, use
	a generic case instead.

	* api: Added. Move api files and generation targets here.
	* source: Added. Move source parsing here.

	* generator/makefile: Move actual generation to api/.
	* glib/Makefile.in: Remove generated/* target.
	* glue/Makefile.am: Fix to include canvas-marshal. Move canvas stuff
	to GNOME target.

	* gnome/CanvasProxy.cs: Update to work with SignalHandlers being
	namespace-specific.

	* parser/Metadata.pm: Moved to GAPI/Metadata.pm, renamed, etc.
	* parser/gapi2xml.pl: Use GAPI::Metadata.
	* parser/makefile: Install scripts, remove source parse build target.
	Rename formatXML to gapi_format_xml.

svn path=/trunk/gtk-sharp/; revision=6818
2002-08-20 19:56:18 +00:00
Mike Kestner
6365d4113b 2002-08-09 Mike Kestner <mkestner@speakeasy.net>
* generator/ObjectGen.cs (GenerateMapper): guard against IntPtr.Zero

svn path=/trunk/gtk-sharp/; revision=6569
2002-08-09 16:26:41 +00:00
Mike Kestner
66c0ec1d43 2002-08-07 Mike Kestner <mkestner@speakeasy.net>
* generator/CodeGenerator.cs : call ObjectGen.GenerateMapper
	* generator/Method.cs : Remove the if null workaround
	* generator/ObjectGen.cs : build a hash of object types.
	(GenerateMapper): generate the GtkSharp.ObjectManager class.
	* glib/Object.cs : use ObjectManager.CreateObject.
	* glue/type.c : helper for typename lookup.

svn path=/trunk/gtk-sharp/; revision=6526
2002-08-08 04:48:41 +00:00
Rachel Hestilow
4d92d54b3f 2002-07-25 Rachel Hestilow <hestilow@ximian.com>
[about 60% of the marshalling patch that I lost.
	 The rest to come tomorrow.]

	* generator/BoxedGen.cs, StructGen.cs: Move most of this to StructBase,
	delete large chunks duplicated from ClassBase.

	* generator/IGeneratable.cs: Add MarshalReturnType, FromNativeReturn.

	* generator/ClassBase.cs: Move ctor stuff here. Add a CallByName
	overload with no parameters for the "self" reference.

	* generator/EnumGen.cs, CallbackGen.cs: Implement new MarshalReturnType,
	  FromNativeReturn.

   * generator/Method.cs: Use container_type.MarshalType, CallByName, and
	  SymbolTable.FromNativeReturn when generating call and import sigs.

	* generator/OpaqueGen.cs: Added.

	* generator/Property.cs: Handle boxed and opaques differently.

	* generator/SymbolTable.cs: Update for the opaque stuff and the new Return
	methods. Also change GetClassGen to simply call the as operator.

	* glib/Boxed.cs: Update for struct usage -- this is now a wrapper for
	  the purposes of using with Value.

   * glib/Opaque.cs: Added. New base class for opaque structs.

	* glue/textiter.c, gtk/TextIter.custom: Remove.

	* gnome/Program.cs: Update for new struct marshalling.

	* parser/Metadata.pm: Use our own getChildrenByTagName.

	* parser/README: Update for new requirements (was out of sync with
	  build.pl)

	* parser/gapi2xml.pl: Hide struct like const in field elements.

	* parser/gapi_pp.pl: Handle embedded union fields (poorly).

	* sample/test/TestColorSelection.cs: Comment out null color tests
     for now.

svn path=/trunk/gtk-sharp/; revision=6186
2002-07-26 06:08:52 +00:00
Mike Kestner
d837953e6c 2002-07-20 Mike Kestner <mkestner@speakeasy.net>
* generator/Method.cs : beef up !Validate warnings
	* generator/ObjectGen.cs : beef up !Validate warnings
	* generator/Parameters.cs (Validate): fail on ellipsis parm
	* parser/gapi2xml.pl : Handle more opaque types properly

svn path=/trunk/gtk-sharp/; revision=5965
2002-07-20 14:43:48 +00:00
Radek Doulik
33b715ef83 2002-07-17 Radek Doulik <rodo@ximian.com>
* gtk/ScrolledWindow.custom: new file with ScrolledWindow custom
	default constructor

	* parser/Metadata.pm: addClassData subroutine to add
	<disabledefaultconstructor/>

	* parser/Gtk.metadata: disable default constructor for
	ScrolledWindow

	* generator/ObjectGen.cs: added hasDefaultConstructor flag, dont
	generate default protected empty constructor if
	hasDefaultConstructor is false, it will be provided by .custom
	file

	* generator/makefile (RUNTIME): use RUNTIME variable

svn path=/trunk/gtk-sharp/; revision=5854
2002-07-17 15:05:22 +00:00
Rachel Hestilow
fb1256d2f3 2002-07-13 Rachel Hestilow <hestilow@ximian.com>
* parser/Gnome.metadata, Gtk.metadata: More conflict
	fixes.
	* parser/build.pl: Fully qualify all lib names. (Gtk+ packages
	are now LFS-compliant in Debian...)
	* parser/gapi2xml.pl: Fix for whitespace in fields, defines,
	and docs.

	* generator/BoxedGen.cs: Remove extraneous CallByName definition,
	add "override" keyword to FromNative.
	(Generate): Generate methods after fields.
	* generator/ClassBase.cs: Change CallByName, FromNative to virtual.
	(.ctor): Ignore "hidden" nodes. Set container on signal.
	(GenSignals, GenMethods): Add "implementor" argument for interface
	use.
	(Get(Method|Signal|Property)Recursively): Rework to correctly
	recurse interfaces.
	(Implements): Added.
	* generator/Ctor.cs (Initialize): Move clash initialization completely
	out of Generate, so we can check for collisions.
	* generator/Method.cs (GenerateDeclCommon): Check for duplicates,
	for "new" keyword.
	(Generate): Add "implementor" argument.
	* generator/ObjectGen.cs (Generate): Initialize ctor clashes on
	this and all parents, before generating.
	(Ctors, InitializeCtors): Added.
	* generator/Signal.cs: Store the container_type, check for
	collisions.
	* generator/StructGen.cs: Add "override" keyword to overriden methods.

	* gtk/FileSelection.custom (ActionArea): Add "new" keyword.

svn path=/trunk/gtk-sharp/; revision=5782
2002-07-13 20:31:23 +00:00
Rachel Hestilow
c653c18543 2002-07-06 Rachel Hestilow <hestilow@ximian.com>
* ObjectGen.cs: Support static string elements. Do
	not generate Ctors or Signals if it is not a GObject.

	* parser/gapi2xml.pl: Add stock defines.

svn path=/trunk/gtk-sharp/; revision=5616
2002-07-06 07:08:19 +00:00
Rachel Hestilow
b203c33bb7 2002-06-26 Rachel Hestilow <hestilow@ximian.com>
* generator/*.cs: Deal with whitespace XmlNodes.

	* parser/build.pl: Dump non-indented file to local directory.

	* parser/makefile, parser/formatXml.c: Added.

	* generator/gtkapi.xml: Nicely indented now. woo!

svn path=/trunk/gtk-sharp/; revision=5465
2002-06-26 13:10:48 +00:00
Rachel Hestilow
02c9fb725c 2002-06-26 Rachel Hestilow <hestilow@ximian.com>
* configure.in, makefile, makefile.win32: add gnome.

	* doc/index.html, netdoc.xsl: Add gnome.

	* gdk/Event.cs: New manual wrap for GdkEvent.

	* generator/ClassBase.cs: Add methods GetProperty,
	GetPropertyRecursively, GetMethodRecursively.
	Move Parent property here from ObjectGen.cs. Pass this pointer
	into Property.

	* generator/Ctor.cs: Generate docs.

	* generator/Method.cs, Property.cs: Tag method as "new" if a
	Method/Property with the same name is found in the class hierarchy.

	* generator/SignalHandler.cs: Correctly wrap complex signal argument
	types. Add gnome directory.

	* generator/SymbolTable.cs: Add manually wrapped types hash
	(contains GLib.GSList and Gdk.Event). Add method IsManuallyWrapped.

	* glib/SList.cs: Add constructor from IntPtr.

	* glue/slist.c, glue/event.c: Added (field accessor glue).

	* glue/Makefile.am: Update.

	* parser/Gtk.metadata: Add new signal renames for new signals
	exposed by GdkEvent changes.

	* parser/README, parser/build.pl: Add libgnome, libgnomecanvas,
	libgnomeui.

	* parser/gapi2xml.pl: Handle literal-length array parameters,
	and NULL property doc strings.

	* sample/: Add new test GnomeHelloWorld.cs.

	* gnome/: Added.

	* parser/Gnome.metadata: Added.

svn path=/trunk/gtk-sharp/; revision=5461
2002-06-26 08:36:05 +00:00
Rachel Hestilow
1f4ff5bb86 2002-06-24 Rachel Hestilow <hestilow@ximian.com>
* glib/EnumWrapper.cs: New class which holds an enum int.

	* glib/Value.cs: Add support for glib enum types. We needed
	to use EnumWrapper for this because otherwise the int operator
	wouldn't know which glib function to use.

	* generator/BoxedGen.cs, ClassBase.cs, Ctor.cs, EnumGen.cs,
	InterfaceGen.cs, Method.cs, ObjectGen.cs, Signal.cs, StructGen.cs:
	Create more doc stubs.

	* generator/Property.cs: Generate enum values correctly.

	* generator/Ctor.cs: Refactor generation to honor metadata-specified
	collision preference.

	* parser/Gtk.metadata: Added constructor collision preferences to
	all known clashes.

	* parse/Gdk.metadata: Added (for Pixbuf clashes).

svn path=/trunk/gtk-sharp/; revision=5437
2002-06-24 22:04:10 +00:00
Rachel Hestilow
7fb558bea0 2002-06-23 Rachel Hestilow <hestilow@ximian.com>
* generator/ClassBase.cs: Add accessors for methods and signals.
	Change GenSignals and GenMethods to public, as csc has a different
	idea of protected than mcs. Handle interface collisions in
	GenMethods.

	* generator/Method.cs: Add accessor Protection - "public" by default.

	* generator/ObjectGen.cs: Make sure wrapper's Signals hashtable only
	gets generated once. Generate a list of collisions for GenMethods.
	Remove dead foreach loop from Validate.

	* generator/Paramaters.cs (CreateSignature): Initialize last_param.

	* parser/Gtk.metadata: Add property & event collision renames
	for TextBuffer and OldEditable.

	* sample/makefile.win32: Reference atk-sharp.dll.

	* makefile.win32: Do not build gdk.imaging.

svn path=/trunk/gtk-sharp/; revision=5420
2002-06-23 03:38:02 +00:00
Mike Kestner
5d67982de9 2002-06-21 Mike Kestner <mkestner@speakeasy.net>
* makefile : remove gdk.imaging from the build
	* gdk.imaging/* : kill
	* generated/BoxedGen.cs : XmlNode namespace handling. Use GenBase.
	* generated/CallbackGen.cs : XmlNode namespace handling.
	* generated/Ctor.cs : construct with libname not ns.
	* generated/EnumGen.cs : XmlNode namespace handling.
	* generated/GenBase.cs : XmlNode namespace handling. Make AppendCustom
	  an instance method so it can use the private fields instead of params.
	* generated/InterfaceGen.cs : XmlNode namespace handling.
	* generated/Method.cs : construct with libname not ns.
	* generated/ObjectGen.cs : XmlNode namespace handling.
	* generated/Parser.cs : Use new XmlNode namespace ctors.
	* generated/Signal.cs : Lose the namespace field.
	* generated/StructBase.cs : derive from ClassBase
	* generated/StructGen.cs : XmlNode namespace handling. Use GenBase.
	* generated/SymbolTable.cs : nuke GetDllName method.
	* generator/gtkapi.xml : Add library name to namespace node.
	* parser/build.pl : refactor for library name param
	* parser/gapi2xml.pl : add libname param handling
	* sample/Makefile.in : build linux on make install, but don't install.

svn path=/trunk/gtk-sharp/; revision=5400
2002-06-21 20:25:43 +00:00
Rachel Hestilow
6857128f07 2002-06-21 Rachel Hestilow <hestilow@ximian.com>
* generator/ClassBase.cs: New base class for classes and interfaces.

	* generator/InterfaceGen.cs: Inherit from ClassBase, generate declarations.

	* generator/ObjectGen.cs: Move half of this into ClassBase.

	* generator/Method.cs: Turn all applicable Get/Set functions into .NET
	accessors. Remove redundant == overload and move into Equals, as
	it was confusing "!= null".

	* generator/Parameters.cs: Alter signature creation to accept "is_set"
	option, add support for variable arguments. Add properties "Count",
	"IsVarArgs", "VAType".

	* generator/Ctor.cs: Fixup for changes in Parameters (indenting,
	signature creation).

	* generator/Signal.cs: Support generating declarations.

	* generator/SymbolTable: Change GetObjectGen to GetClassGen.

	* glib/IWrapper.cs: Move "Handle" declaration to here, so
	both classes and interfaces can benefit from it.

	* glib/Object.cs: Inherit from IWrapper.cs

	* parser/Metadata.pm: Support attribute changes on constructors,
	methods, signals, and paramater lists.

	* parser/gapi2xml.pl: Parse init funcs for interfaces. Ignore "_"
	functions here.

	* parser/gapi_pp.pl: Remove boxed_type_register check, as it will
	be caught in the init funcs.

	* parser/Atk.metadata: Added.

	* parser/Gtk.metadata: Add all needed signal/method collision
	renames. Rename GtkEditable.Editable accessors to IsEditable,
	as .NET does not like accessors with the same name as their
	declaring type. Tag TreeStore constructor as varargs.

	* samples/ButtonApp.cs: s/EmitAdd/Add.

	* samples/Menu.cs: s/EmitAdd/Add, s/Activate/Activated.

svn path=/trunk/gtk-sharp/; revision=5394
2002-06-21 17:15:19 +00:00
Rachel Hestilow
eea6465cf2 2002-06-09 Rachel Hestilow <hestilow@ximian.com>
* generator/GenBase.cs: new method AppendCustom, moved from ObjectGen.
	* generator/BoxedGen.cs, ObjectGen.cs, StructGen.cs:
	Call AppendCustom in Generate ();
	* generator/Method.cs, Parameters.cs: Add support for "out"
	parameters. Additionally, output an accessor instead of a
	regular method if it is an accessor-style function (ie GetStartIter).
	* generator/Property.cs: Add additional cast to Boxed, if necessary.
	* glue/textiter.c: New constructor for GtkTextIter.
	* glue/Makefile.am: Add textiter.c, build with Gtk+ cflags.
	* configure.in: Check for Gtk+ cflags.
	* parser/Metadata.pm, Gtk.metadata: Added.
	* parser/gapi2xml.pl: Call Metadata::fixup on the document.
	Also work around gtk's screwy boxed type name registration
	(GtkFoo -> GtkTypeFoo).
	* gtk/TextIter.custom: Added.

svn path=/trunk/gtk-sharp/; revision=5205
2002-06-10 12:34:09 +00:00
Mike Kestner
6d30cf0c3e refactoring to remove substantial code duplication thoughout the generator
2002-05-23  Mike Kestner <mkestner@speakeasy.net>

	* generator/BoxedGen.cs : Update for Static SymbolTable
	* generator/CallbackGen.cs : Use GenBase and Parameters classes
	* generator/CodeGenerator.cs : Update for Static SymbolTable
	* generator/Ctor.cs : code from StructBase using Parameters class
	* generator/EnumGen.cs : Use GenBase
	* generator/GenBase.cs : Abstract Stream Writer creation, stream
	  boilerplate, and common *Name properties
	* generator/IGeneratable.cs : Update for Static SymbolTable
	* generator/InterfaceGen.cs : Use GenBase
	* generator/Method.cs : code from StructBase using Parameters class
	* generator/ObjectGen.cs : Major refactoring. Use GenBase. Build
	  tables of Member generatables at construct time to facilitate
	  future name collision resolution logic.
	* generator/Parameters.cs : new generatable to abstract duplicated
	  parameter parsing logic.
	* generator/Parser.cs : Update for Static SymbolTable
	* generator/Property.cs : code from ObjectGen
	* generator/Signal.cs : code from ObjectGen
	* generator/SignalHandler.cs : Update for Static SymbolTable
	* generator/StructBase.cs : Update for Static SymbolTable
	* generator/StructGen.cs : Update for Static SymbolTable
	* generator/SymbolTable.cs : Make all methods and private members
	  static.  There is no reason to ever have multiple tables.

svn path=/trunk/gtk-sharp/; revision=4895
2002-05-23 23:43:25 +00:00