Commit Graph

48 Commits

Author SHA1 Message Date
Thibault Saunier
87d4d29dfd Some fixes to support updated gstreamer-sharp (#29)
* parameters: Ignore UserData arguments to compute if has_optional

Those are never present in the prototypes and thus should not be taken
into account to see if prototype alternative has to be implemented.

* Fix generation of interface properties

* generator: Enhance the way we check if a field is padding

First check that fields are private to see if a field is padding,
in GstVideo we have public field staring with padding
(VideoAlignment.padding_top/bottomg/left/right) and thus need to be
taken into account to compare structures.

Also add a way for user to specify that the field is padding with
the new `is-padding` attribute.

In GStreamer padding fields usually look like __gst_reservedX, meaning
that they go unnoticed by previous code.
2017-08-24 15:20:05 +02:00
Andres G. Aragoneses
6cb03440c1 generator: generate all interfaces with the "I" prefix (.NET convention)
To be able to do this, Name property of GenBase class is now virtual, so
that it can be overriden in InterfaceGen with the new name.

Adapters, however, are still classes and then need special care as such
(cannot use the 'Name' property anymore), but this improves a bit the
readability of some parts of the code as the *Implementor and *Adapter
suffixes are now concentrated in just two new properties of GenBase and
not repeated all over the place.
2013-07-23 12:05:24 -05:00
Bertrand Lorentz
b8b1cfa5d7 generator: Convert all .cs files to Unix line endings
There are no real code changes in this commit.
2012-11-03 15:20:06 +01:00
Bertrand Lorentz
4d19e5ac2a generator: Properly handle boolean attributes when parsing the XML
In a lot of places, we were only checking the presence of boolean
attributes, like "array", automatically assuming they were true. This
meant that we didn't allow setting them explicitly to false, which
apparently is needed for some bindings.

For all boolean attributes, we now use the GetAttributeAsBoolean method
added in the previous commit, to correctly check the value of the
attribute. As before, if the attribute is not present, it is considered
to be false.

Thanks to Stephan Sundermann for noticing this issue.
2012-10-21 18:22:13 +02:00
Mike Kestner
2ba496479f Restructure log warnings in validation.
* 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.
2011-02-20 12:11:08 -06:00
Jeffrey Stedfast
ccb3ac6a13 2008-09-16 Jeffrey Stedfast <fejj@novell.com>
* generator/Property.cs (IsDeprecated): Allow "1" or "true".

	* generator/Method.cs (.ctor): Allow "1" or "true".

	* generator/ClassBase.cs: Allow a value of "true" to work the same
	as "1" for the deprecated and abstract attributes.


svn path=/trunk/gtk-sharp/; revision=113238
2008-09-16 23:21:50 +00:00
Mike Kestner
b2e51e9989 2008-08-20 Mike Kestner <mkestner@novell.com>
Patch from Christian Hoff fixing bug #396195.
	* generator/Property.cs: handle interface adapter values.
	* generator/InterfaceGen.cs: register the gtype so mapping occurs
	automatically for interface adapters.  New GetObject overload to
	handle already wrapped objects more efficiently.
	* glib/Value.cs: handle set_Val for interface adapter objects.

svn path=/trunk/gtk-sharp/; revision=111154
2008-08-20 15:53:03 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
aa9ff69ce1 2003-10-09 Mike Kestner <mkestner@ximian.com>
* generator/Property.cs : don't do new for Objects if FromNativeReturn
        returns null.  [Fixes #48055]

svn path=/trunk/gtk-sharp/; revision=18793
2003-10-09 05:16:37 +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
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
23464e6514 2003-07-23 Mike Kestner <mkestner@ximian.com>
[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
2003-07-23 17:19:21 +00:00
Mike Kestner
31001501ed 2003-07-22 Mike Kestner <mkestner@speakeasy.net>
* generator/Method.cs (GenerateBody): kill the "cast_type"
	overload of this, since cast_type wasn't even used.
	* generator/Property.cs : call simpler GenerateBody sig

svn path=/trunk/gtk-sharp/; revision=16550
2003-07-22 22:56:10 +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
36b2fee78d 2002-08-08 Mike Kestner <mkestner@speakeasy.net>
* generator/Property.cs : getter usage fix

svn path=/trunk/gtk-sharp/; revision=6557
2002-08-09 04:27:15 +00:00
Mike Kestner
71b46ecd41 2002-08-03 Mike Kestner <mkestner@speakeasy.net>
* generator/Method.cs : Added IsGetter, IsSetter, ReturnType. Made
	  GenerateImport, GenerateBody public.
	* generator/Parameters.cs : Added Parameter::MarshalType
	* generator/Property.cs : Added logic to use methods instead of text
	  properties wherever possible.

svn path=/trunk/gtk-sharp/; revision=6391
2002-08-04 04:23:13 +00:00
Rachel Hestilow
54838fec29 2002-08-03 Rachel Hestilow <hestilow@ximian.com>
* generator/Method.cs: Support libname overrides. Call parms.Finish.
	* generator/Parameters.cs: New method parms.Finish. Generate a temporary
	holder variable for enum out parameters.
	* generator/Property.cs: Pass a boolean to EnumWrapper indicating.
	if these are flags.
	* generator/StructBase.cs: Disable array marshalling (it is
	broken in mono.)
	* generator/SymbolTable.cs: Add methods IsEnumFlags.

	* glib/EnumWrapper.cs: New bool "flags".
	* glib/Value.cs: Call flags variant on GValue for enum props, if needed.

	* glue/Makefile.am, glue/style.c, glue/widget.c: Add widget
	and style field accessor methods.

	* gtk/Style.custom, Widget.custom: Added.

	* parser/README: Update requirements (needed for pixbuf drawable hack)
	* parser/Gdk.metadata: Fix library for pixbuf methods in gdk.
	Add Window.GetPointer "out" parameters.
	* parser/gapi2xml.pl: Remap gdk_draw_* methods to Drawable.

	* sample/Makefile.in: Add size and scribble samples.
	* sample/Scribble.cs: Added.

svn path=/trunk/gtk-sharp/; revision=6387
2002-08-03 22:24:37 +00:00
Rachel Hestilow
967e3e9c5a 2002-07-30 Rachel Hestilow <hestilow@ximian.com>
* 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
2002-07-30 23:02:12 +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
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
414a14d93e 2002-06-24 Rachel Hestilow <hestilow@ximian.com>
* glib/UnwrappedObject.cs: New class which holds an IntPtr.
	This is used in Value so that we can retrieve the IntPtr itself
	for an object property.

	* glib/Value.cs: Add UnwrappedObject cast operator.

	* glib/Property.cs: If the retrieved value is an object,
	and there is no wrapper object, create a new one.

svn path=/trunk/gtk-sharp/; revision=5440
2002-06-24 23:38:51 +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
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
e1b9f7343a 2002-06-05 Mike Kestner <mkestner@speakeasy.net>
* generator/Property.cs : Fix get{} GLib.Value passing.
	* glib/Object.cs : GetProperty passes the GLib.Value now.
	* glib/Value.cs : Add a ctor to create Values for props.
	* glue/value.c : add gtksharp_value_create_from_property.

svn path=/trunk/gtk-sharp/; revision=5133
2002-06-05 21:59:10 +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