Commit Graph

16 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
ac2b7b906a 2003-09-11 Mike Kestner <mkestner@ximian.com>
* generator/Ctor.cs : kill inline doc comments once and for all
	* generator/EnumGen.cs : ditto
	* generator/Method.cs : ditto
	* generator/OpaqueGen.cs : ditto
	* generator/Property.cs : ditto

svn path=/trunk/gtk-sharp/; revision=18028
2003-09-11 04:50:13 +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
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
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
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