When dealing with several namespaces there might be classes with the same name
(especially Global which is autogenerated in g-i based bindings). On generation
the file would be overriden by the last occurence in the xml. To encounter
this every namespace has it's own directory now. This also improves structure
a lot when dealing with big libraries.
Also do the necessary adaption for the build and the csproj files.
* generator/*.cs: Add a LogWriter class which formats warnings
consistently on the console. Supports the concept of non-fatal
validation warnings, since it doesn't rely on the unrolling of the
validation stack to associate a warning to a given type.
Main purpose was to add a non-fatal warning for missing element_type
attributes on list return values, though it results in cleaner log
output, and also updates some warning messages to be more helpful in
how to resolve them.
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
* 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
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
* 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
* 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
* 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
[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
* generator/StructGen.cs : make them public structs, not classes.
* parser/build.pl : step up to the g2final tarballs.
* parser/gapi2xml.pl : suppress *Private struct types. Mark
ellipsis terminated param lists.
svn path=/trunk/gtk-sharp/; revision=5902
* generator/ClassBase.cs : make MarshalType virtual.
* generator/Parameters.cs : add Parameter class and Indexer.
* generator/Signal.cs : Now use Parameters.
(GetHandlerName): New abstraction of name handling.
(GenerateDecls): use GetHandlerName.
(GenComments): make private.
(GenHandler): New. Generate custom event handlers and args.
(Generate): use GenHandler. Pass args type to SignalHandler.
* generate/SignalHandler.cs : store args type. Generate handler
dependent args and use MulticastDelegate.DynamicInvoke.
* generate/StructGen.cs : override MarshalType.
* glib/SignalCallback.cs : store a MulticastDelegate and args type
* sample/*.cs : use new DeleteEventHandler
svn path=/trunk/gtk-sharp/; revision=5834
* 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
* 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
* 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
* 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-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
* generator/Statistics.cs : New. Gathers stats about generation.
* generator/*.cs : Hook in the stat counters.
svn path=/trunk/gtk-sharp/; revision=2491
api.xml file from CVS with this commit. It can be downloaded from
http://sf.net/projects/gtk-sharp. I will be uploading new versions of the
file, now named gtkapi.xml, to the project download area from now on.
2002-02-08 Mike Kestner <mkestner@speakeasy.net>
* README : Some updates.
* generator/BoxedGen.cs : Add FromNative method.
* generator/CallbackGen.cs : Add FromNative method.
* generator/EnumGen.cs : Add FromNative method.
* generator/IGeneratable.cs : Add FromNative method.
* generator/InterfaceGen.cs : Add FromNative method.
* generator/ObjectGen.cs : Add FromNative method. Hook in GenMethod.
* generator/StructBase.cs : Revamp param handling. Add GenMethod.
* generator/StructGen.cs : Add FromNative method.
* generator/SymbolTable.cs : Add FromNative method.
* parser/gapi2xml.pl : Detect ctors before methods. Fix method names.
* sample/HelloWorld.cs : uncomment the Show call.
svn path=/trunk/gtk-sharp/; revision=2277
* generator/BoxedGen.cs : Marshal as IntPtr using Raw prop.
* generator/ObjectGen.cs : Use Handle for marshaling.
* generator/StructBase.cs (CallByName): Fill out the stub.
(GetImportSig): Fill out the stub.
* generator/StructGen.cs (MarshalType): Use QualifiedName.
* generator/SymbolTable.cs (GetMarshalType): Trim type.
(CallByName): New. Provides calling syntax.
* sample/HelloWorld.cs : Make it compile.
svn path=/trunk/gtk-sharp/; revision=2253
* generator/BoxedGen.cs : New boxed type generatable.
* generator/ObjectGen.cs : Add boxed type property generation and stub
off interface properties for now.
* generator/Parser.cs : Add boxed element parsing.
* generator/SymbolTable.cs : Add IsBoxed and IsInterface methods.
* glib/Boxed.cs : New base class for deriving boxed types.
* glib/Object.cs : Add boxed GetProp/SetProp methods.
* parser/gapi2xml.pl : Add boxed type element formatting.
* parser/gapi_pp.pl : Add preprocessing of the generated sourcefiles.
Handle the builtins and make them identifiable to the xml generator.
svn path=/trunk/gtk-sharp/; revision=2012
* */makefile : Add atk to the build.
* generator/EnumGen.cs : Create the generated dir if necessary.
* generator/ObjectGen.cs : Create the generated dir if necessary.
* generator/StructGen.cs : Create the generated dir if necessary.
* parser/gapi2xml.pl : Squash bug in comma separated field defs.
svn path=/trunk/gtk-sharp/; revision=1882
* generator/*.cs : Move into GtkSharp.Generation namespace.
* generator/CodeGenerator.cs (Main): Add usage check. Add SymbolTable.
* generator/EnumGen.cs (QualifiedName): New.
(Generate): Add SymbolTable to signature.
* generator/IGeneratable : Add QualifiedName prop and update Generate
signature.
* generator/Parser.cs : Switch from plain Hashtable to SymbolTable.
(Parse): Replaces the Types property and returns a SymbolTable.
* generator/StructBase.cs : New base class to derive struct and object
types. Initial implementation of protected GenField method and ctor.
* generator/StructGen.cs : New non-object struct type generatable.
* generator/SymbolTable.cs : New. Manages complex types hash and a
simple types hash. Will provide generic lookup interface.
svn path=/trunk/gtk-sharp/; revision=1855