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
* 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
* 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/*Gen.cs : add ToNativeReturnType to deal with
the g_free string nonsense in the virtual method case.
svn path=/trunk/gtk-sharp/; revision=36289
* 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
* 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
* generator/StructBase.cs:
* generator/SymbolTable.cs: Fixed the keyword base was not
mangled, also did a little refactoring.
svn path=/trunk/gtk-sharp/; revision=17702
[Equal credit to Ettore Perazzoli <ettore@ximian.com> for fixing
all the bugs in the initial patch]
* */*.custom : fix incorrect usage of new Object (IntPtr) where
Glib.Object.GetObject should've been used. add ref_owned param
to GetObject calls.
* generator/CallbackGen.cs : setup ref_owned in bodies
* generator/ClassBase.cs : add ref_owned to GetObject FromNative call
* generator/Method.cs : setup ref_owned in bodies
* generator/Property.cs : setup ref_owned in bodies
* generator/SignalHandler.cs : pass ref_owned to GetObject
* generator/StructBase.cs : setup ref_owned in bodies
* glib/Object.cs : kill Ref/Unref methods. Don't want it to be
easy for users to screw with ref counts, or make it look like they
should need to.
(GetObject): add ref_owned param and ref/unref to remain at 1
* glib/Value.cs : pass ref_owned to GetObject
svn path=/trunk/gtk-sharp/; revision=16581
* generator/GenBase.cs : put #line directive after the
#region so line numbers match up.
2003-07-02 Mike Kestner <mkestner@speakeasy.net>
* generator/StructBase.cs : remove doc comments
svn path=/trunk/gtk-sharp/; revision=15873
* gconf/Value.cs: Update to use new string marshalling.
* generator/StringGen.cs, ConstStringGen.cs: Added.
* generator/IGeneratable.cs: Add new method ToNativeReturn.
* generator/CallbackGen.cs: Implement ToNativeReturn. Call
ToNativeReturn for the return statement. Fix a couple of
places where s_ret was being used incorrectly for m_ret.
* generator/ClassGen.cs, EnumGen.cs, ManualGen.cs,
SimpleGen.cs, StructBase.cs: Implement ToNativeReturn.
* generator/SignalHandler.cs: Call ToNativeReturn for the
return statement, instead of CallByName.
* generator/SymbolTable.cs: Use StringGen for gchar, char,
and gunichar, and ConstStringGen for their const variants.
Add a new method wrapper for ToNativeReturn.
(Trim): Add a special-case for const strings so that the
const is not stripped. Otherwise there is no way of
resolving the const case.
* glade/XML.custom: Update to use new string marshalling.
* glib/Marshaller.cs: Added.
* glib/GException.cs, Markup.cs, ObjectManager.cs,
Value.cs: Update to use new string marshalling.
* glib/Object.cs: Remove old g_type_name DllImport
as it is no longer used.
* glue/fileselection.c (gtksharp_file_selection_get_fileop_entry):
Mark this as const return.
* gtk/ColorSelection.custom, FileSelection.custom,
SelectionData.custom: Update to use new string marshalling.
svn path=/trunk/gtk-sharp/; revision=15286
* 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
* generator/CallbackGen.cs: the new generated wrappers have:
-(optional) Field of the same type returned by the callback.
-A call to RemoveIfNotAlive at the beginning. It returns true,
return the dummy field.
-Added an object to the ctor signature and pass it to the base
class.
* generator/Ctor.cs: added a Params property.
* generator/Method.cs: set Static property in Parameters if the method
is static.
* generator/Parameters.cs: added Static property. The call creation of
the delegate wrapper (if applicable) uses the new signature. Pass a null
as object is the method is static.
* generator/StructBase.cs: set Static for the parameters of the ctors.
* glib/DelegateWrapper.cs: the ctor takes an object (the one creating
the wrapper or null) and creates a weak reference to it. Store it in
a static Hashtable (this way the wrapper itself is not garbage
collected).
(RemoveIfNotAlive): called from the native delegate callbacks. If the
target of the weak reference has been garbage collected, removes itself
from the hashtable to let the GC dispose this instance and returns true.
* gdk/Pixbuf.custom:
* gtk/Clipboard.custom:
* gtk/GtkSharp.GtkClipboardClearFuncNative.cs:
* gtk/GtkSharp.GtkClipboardGetFuncNative.cs:
* glade/XML.custom: changed delegate wrappers to match the new
signature.
svn path=/trunk/gtk-sharp/; revision=13237
use when the IntPtr is NULL.
* generator/SignalHandler.cs, generator/CallbackGen.cs: removed
call to Initialize for structs
* gtk/Clipboard.custom, gtk/ClipboardClearFunc.cs,
gtk/ClipboardGetFunc.cs,
gtk/GtkSharp.GtkClipboardClearFuncNative.cs,
gtk/GtkSharp.ClipboardGetFuncNative.cs, SelectionData.custom:
Hand-wrapped selection handling stuff, along with relevant
signals and the like.
* gnome/voidObjectAffineSVPintSignal.cs: removed Initialize
for hand-wrapped signal
* sample/GnomeHelloWorld.cs, sample/Size.cs: compare against
.Zero instead of using IsNull
* api/gtk-api.xml, sources/Gtk.metadata: metadata updates for
hiding some manually-wrapped stuff
svn path=/trunk/gtk-sharp/; revision=8912
* glib/Object.cs (Ref): Added.
* gtk/Object.custom (Ref): Overload. Note that we were reffed.
(DisposeNative): Unref if we were explicitly reffed.
* generator/Method.cs: Call Ref if needs_ret is set.
* generator/StructBase.cs: Call Ref on all object accessors.
* glue/style.c: Ref returned GCs.
* sources/Gtk.metadata: Set needs_ret on various gdk-related
accessors in GtkWidget. Hide Ref/Unref methods on Widget and
RcStyle as these ought to be deprecated anyway.
svn path=/trunk/gtk-sharp/; revision=7380
* parser/gapi2xml.pl: Add support for "fake struct" opaque types.
* generator/StructBase.cs: Generate wrapper fields for opaque
fields as well as pointer fields.
* api/gdk-symbols.xml: Remove GdkAtom as it is now wrapped.
svn path=/trunk/gtk-sharp/; revision=7311
[ Mike, this is everything I wanted in for the release. ]
* generator/StructBase.cs: Generate field accessors for wrapped
types (opaque, object, and structs/boxed). Bitfields, unions, and
arrays are still unsupported for accessors, and are probably marshalling
incorrectly. But this is enough to get events working (see example
in sample/GnomeHelloWorld.cs).
* parser/Metadata.pm: Support a "delete" directive, and set metadata
on structs and boxed (previously was only checking objects and interfaces).
* parser/Gdk.metadata: Delete bogus entries GdkWindowObject and
GdkPixmapObject (more evil drawable stuff.)
* sample/GnomeHelloWorld.cs: Show an example of how to use marshalled
events, in our selection callback.
svn path=/trunk/gtk-sharp/; revision=6370
* generator/StructBase.cs (GetFieldInfo): Generate strings correctly.
Also, delegates are not marshalling correctly right now, change those
to IntPtr.
* generator/SymbolTable.cs: New method IsCallback.
* sample/GnomeHelloWorld.cs: Use Gnome.App and stock menu items.
Use the new event handlers.
svn path=/trunk/gtk-sharp/; revision=6300
* generator/ClassBase.cs: Change hasDefaultConstructor to protected,
adjust now that it is an attr and not a subnode. Also add virtual
property AssignToName (for ctors).
* generator/Ctor.cs: Add property ForceStatic.
(Generate): Optimize return code a bit for the static case.
* generator/Method.cs: Assign to a "raw_ret" pointer before calling
FromNativeReturn.
* generator/Parameters.cs: Change "out ref" to "out", not "ref".
* generator/Property.cs: Fix to work correctly with all object and
struct types (mostly just some if-cases added).
* generator/SignalHandler.cs: Remove args_type and argfields (unused).
(Generate): Initialize struct if necessary.
* generator/StructBase.cs: Massive reworking to support methods, ctors,
etc.
* generator/SymbolTable.cs: Add GdkAtom and gconstpointer simple types.
* glib/Boxed.cs: Accept both IntPtr and object ctors. Add access for both.
* glib/Opaque.cs: Fix copy/pasted copyright notice, remove data and event
fields. Fix docs.
* glib/Value.cs: Work correctly with boxed properties.
* gnome/Modules.cs: Use new struct ctors.
* gnome/Program.custom: Remove Get, this is being generated now.
* parser/Gdk.metadata: Fix the drawable classes to inherit correctly.
* parser/Metadata.pm: Change per-class attributes to actually be
attributes.
* parser/Gtk.metadata: Add a dummy attribute value for disabledefaultctor.
* parser/gapi2xml.pl: Add hacks for the (broken) Drawable and Bitmap
typedefs.
* sample/test/TestColorSelection.cs: Display color string in hex format,
update to use IsNull instead of == null, and size dialog to look pretty.
* sample/Size.cs: Added.
svn path=/trunk/gtk-sharp/; revision=6264
[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/StructBase.cs : use GetMarshalType for field gen.
* sample/ButtonApp.cs : WriteLine the Gdk.EventAny in DeleteEvent.
svn path=/trunk/gtk-sharp/; revision=5903
* 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-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/ObjectGen.cs : Add IntPtr constructor generation. Pass a
ctor signature hash around to use in clash resolution. Generate a
void ctor if none is present which just calls the parent ctor.
* generator/StructBase.cs : Add non-void signature ctor generation,
including collision handling logic. Collisions are implemented as
static methods.
* generator/SymbolTable.cs : Map GSList to GLib.SList. Add type
trimming to remove trailing *'s. Need to suppress leading const yet.
* glib/Object.cs : Add default ctor for void and IntPtr ctors.
* glib/SList.cs : Implementation of a wrapper class for GSLists. Lots
of FIXMEs.
* parser/gapi2xml.pl : Handle ** and array params.
svn path=/trunk/gtk-sharp/; revision=2232
* generator/StructBase.cs (GenField): Return a bool success indicator.
* generator/ObjectGen.cs : Check the return of GenField.
* generator/SymbolTable.cs : More fixage to simple_types.
* parser/gapi2xml.pl : Fix multiline comment bug, and callback name
hashing logic. Squash callbacks that aren't in the namespace.
* sample/HelloWorld.cs : Clean out some debugging to make it closer to
compiling. Not quite there yet.
svn path=/trunk/gtk-sharp/; revision=1948
* generator/CallbackGen.cs : Use name in QualName, not cname.
* generator/EnumGen.cs : Use name in QualName, not cname.
* generator/InterfaceGen.cs : Use name in QualName, not cname.
* generator/StructBase.cs (GenField): gen as public.
svn path=/trunk/gtk-sharp/; revision=1920