Commit Graph

29 Commits

Author SHA1 Message Date
Dan Winship
40c4db88a4 * parser/gapi2xml.pl: Make the enum value parser do the right
thing with parenthesized values ("FOO = (1 << 2)") and within-type
	aliases ("GTK_ANCHOR_N = GTK_ANCHOR_NORTH"). Make it intentionally
	do the wrong thing with unparsable values (outputting them as-is
	into the api file) so that we are forced to fix them with metadata
	rather than silently getting incorrect values.

	* gdk/gdk-api-2.4.raw: 
	* gdk/gdk-api-2.6.raw (PixdataType): Now recognized as flags,
	not enum

	* gtk/Gtk.metadata: hide the enums ArgFlags and RcTokenType (which
	are not used by any wrapped API, and which formerly contained
	entirely wrong values).

	* gtk/gtk-api-2.4.raw: 
	* gtk/gtk-api-2.6.raw (AnchorType, SelectionMode): update with
	values for aliases

	* gnome/Gnome.metadata: fix value of Gnome.PrintButtons.Cancel

	* gnome/gnome-api.raw (PrintUnitBase, PaperSelectorFlags,
	PrintDialogFlags, PrintDialogRangeFlags): Now recognized as flags,
	with values.

svn path=/trunk/gtk-sharp/; revision=44937
2005-05-24 18:11:33 +00:00
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
Dan Winship
a7d8b64f7a * generator/Parameters.cs (Parameters.Validate): If the parameters
end with "callback, gpointer, GDestroyNotify", then mark the
	callback as having "notified" Scope.
	(Parameters.IsHidden): Hide user_data and GDestroyNotify after a
	callback.
	(Parameter.Scope): make this settable
	(Parameter.IsDestroyNotify): new test

	* generator/MethodBody.cs (Initialize): Handle "notified" callback
	scope (using a GCHandle and GLib.DestroyHelper.NotifyHandler)

	* generator/CallbackGen.cs (GenWrapper): Add a static
	"GetManagedDelegate" method to the wrapper type, to translate a
	native delegate back to its corresponding managed delegate.
	(FromNative): use GetManagedDelegate.

	* generator/ReturnValue.cs (Validate): We handle callback return
	values now

	* generator/SymbolTable.cs: marshal GDestroyNotify as
	GLib.DestroyNotify

	* glib/DestroyNotify.cs: Moved from gtk

	* gtk/Gtk.metadata: globally change GtkDestroyNotify to
	GDestroyNotify, but then change back the ones that are exposed in
	the API. Un-hide lots of methods we can correctly autogenerate
	now.

	* gtk/DestroyHelper.cs: moved to glib

	* gtk/*.custom: remove methods that are autogenerated now, add
	Obsolete wrappers where needed, replace Gtk.DestroyHelper usage
	with GLib.DestroyHelper.

	* gdk/Gdk.metadata: 
	* gnome/Gnome.metadata: Turn Gdk.Drawable.SetData and
	Gnome.IconList.SetIconDataFull's GDestroyNotify args into
	gpointers so the generated API stays the same as it used to be.

	* rsvg/Handle.custom: implement deprecated SetSizeCallback

	* sample/GtkDemo/DemoIconView.cs (CreateSort): update for API
	changes

svn path=/trunk/gtk-sharp/; revision=44020
2005-05-04 11:47:25 +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
Dan Winship
faa783fba7 * gnome/Gnome.metadata: mark GnomeTriggerActionFunction's char**
param const

        * glib/Marshaller.cs (Utf8PtrToString): Add an IntPtr[]->string[]
        overload, since that's what we actually need in the case where
        it's used (above). Leave the IntPtr[]->string[] overload of
        PtrToStringGFree in case anyone is using it manually.

        * gtk/Gtk.metadata: hide GtkModuleInitFunc and
        GtkModuleDisplayInitFunc; they are the signatures of user-defined
        methods that gtk only ever resolves via g_module_symbol(), so
        they're not useful from C#. (And the marshalling was all wrong
        anyway...)

svn path=/trunk/gtk-sharp/; revision=43461
2005-04-22 19:43:46 +00:00
Mike Kestner
801cbb7e65 2005-03-03 Mike Kestner <mkestner@novell.com>
* gdk/Gdk.metadata : remove unnecessary null_ok rules.
	* generator/Ctor.cs : remove NullOk check.
	* gnome/Gnome.metadata : remove unnecessary null_ok rules.
	* gtk/Gtk.metadata : remove unnecessary null_ok rules.

svn path=/trunk/gtk-sharp/; revision=41413
2005-03-03 21:25:26 +00:00
Mike Kestner
a9ecebce8f 2005-01-25 Mike Kestner <mkestner@novell.com>
* gnome/About.custom : implement a subclassable ctor.
	* gnome/Gnome.metadata : hide About ctor, fix About.Construct parms.
	* gnome/Makefile.am : add the new custom.
	[Fixes #71271]

svn path=/trunk/gtk-sharp/; revision=39521
2005-01-25 18:09:20 +00:00
Mike Kestner
a5ea868d90 2005-01-18 Mike Kestner <mkestner@novell.com>
* generator/Method.cs : deal with owned retvals.
	* generator/ReturnValue.cs : add Owned prop.
	* gnome/Gnome.metadata : mark Thumbnail.ScaleDownPixbuf return owned.
	[Fixes #71335]

svn path=/trunk/gtk-sharp/; revision=39128
2005-01-19 02:58:42 +00:00
Mike Kestner
574aa2ee06 2005-01-07 Mike Kestner <mkestner@novell.com>
* configure.in : check for panelapplet in enable_gnome and remove
	all the stuff for a separate panelapplet-sharp assembly.
	* Makefile.am : remove panelapplet dir from build.
	* gnome/BonoboUIVerb.cs : moved from panelapplet.
	* gnome/Gnome.metadata : add rules from panelapplet.
	* gnome/Makefile.am : add new files.
	* gnome/PanelApplet.custom : moved from panelapplet.
	* gnome/PanelAppletFactory.cs : moved from panelapplet.
	* gnome/glue/panelapplet.c : moved from panelapplet.
	* gnome/glue/Makefile.am : add new file.
	* gnomedb/GnomeDb.metadata : hide a newly parsed "obsolete" type.
	* gtk/Gtk.metadata : hide a newly parsed "obsolete" callback type.
	* panelapplet : kill dir.
	* parser/gapi2xml.pl : update callback name sanity check.
	* sources/gtk-sharp-sources.xml : move panelapplet parse into gnome.
	* */*-api.raw : regen.

svn path=/trunk/gtk-sharp/; revision=38509
2005-01-07 21:29:38 +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
cf2596acf0 2004-12-15 Mike Kestner <mkestner@novell.com>
* gnome/Gnome.metadata : resolve a collision that was causing
	Print class methods to be lost.

svn path=/trunk/gtk-sharp/; revision=37814
2004-12-15 22:41:14 +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
Martin Willemoes Hansen
9d940b1bb5 * gnome/Gnome.metadata: Fixed typo i to 1
Remove unnessesary disabledefaultconstructor
        * gnome/PrintJob.custom: Change ctor to an overload ctor

svn path=/trunk/gtk-sharp/; revision=31048
2004-07-12 18:13:06 +00:00
Larry Ewing
b39bc105e6 2004-06-17 Larry Ewing <lewing@ximian.com>
* gdk/Makefile.am (sources): add Pixdata.custom

	* gdk/Pixdata.custom: add new file to fix Serialize.

	* gnome/CanvasItem.custom: remove the incorrect custom bindings.

	* gnome/Gnome.metadata: stop hiding the AffineRelative and
	AffineAbsolute the generator gets them right they are not out
	params.

	* gdk/Gdk.metadata: mark the Pixdata byte stream as and array hide
	the broken serialize method.

svn path=/trunk/gtk-sharp/; revision=29941
2004-06-19 14:46:11 +00:00
Todd Berman
d04d7d6fa4 2004-05-07 Todd Berman <tberman@sevenl.net>
* gnome/Makefile.am: add DruidPageEdge.custom
        * gnome/Gnome.metadata: hide DruidPageEdge ctors
        * gnome/DruidPageEdge.custom: subclassable ctors.

svn path=/trunk/gtk-sharp/; revision=26964
2004-05-08 02:50:28 +00:00
Todd Berman
534948c298 2004-05-07 Todd Berman <tberman@sevenl.net>
* gnome/IconList.custom: subclassable ctor.
	* gnome/Gnome.metadata: hide IconList ctor.

svn path=/trunk/gtk-sharp/; revision=26963
2004-05-08 02:27:26 +00:00
Mike Kestner
b9cee94a37 2004-05-07 Mike Kestner <mkestner@ximian.com>
* gnome/Canvas.custom : PixelsPerUnit prop.
	* gnome/Gnome.metadata : hide Canvas.SetPixelsPerUnit.
	* gnome/glue/Makefile.am : get_pixels_per_unit.
	* gnome/glue/canvas.c : get_pixels_per_unit.
	* gtk/Container.custom : OnForall virtual method impl.
	* gtk/glue/Makefile.am : add container.c
	* gtk/glue/container.c : virtual method glue for forall.
	* gtk/glue/makefile.win32 : add container.o

svn path=/trunk/gtk-sharp/; revision=26962
2004-05-08 02:14:19 +00:00
Todd Berman
fe63913e7e 2004-05-07 Todd Berman <tberman@sevenl.net>
* gnome/Gnome.metadata: map properties for with_flags DateEdit ctor,
        and hide the DateTime, bool, bool ctor
        * gnome/Makefile.am: Add DateEdit.custom.
        * gnome/DateEdit.custom: Add subclassable ctor for DateEdit and
        add enough overloads that accept variable parameter lists to make
        Mike Kestner sick.

svn path=/trunk/gtk-sharp/; revision=26961
2004-05-08 02:10:00 +00:00
Todd Berman
b138697051 2004-05-07 Todd Berman <tberman@sevenl.net>
* gnome/Gnome.metadat: Hide App ctor.
        * gnome/Makefile.am: add App.custom.
        * gnome/App.custom: New custom for subclassing.

svn path=/trunk/gtk-sharp/; revision=26960
2004-05-08 01:44:21 +00:00
Todd Berman
864884b4f0 2004-05-07 Todd Berman <tberman@sevenl.net>
* gnome/Gnome.metadata: Hide Scores ctor.
        * gnome/Makefile.am: add Scores.custom.
        * gnome/Scores.custom: New custom for overridable ctor.

svn path=/trunk/gtk-sharp/; revision=26958
2004-05-08 01:27:28 +00:00
Todd Berman
be2f2257c8 2004-05-07 Todd Berman <tberman@sevenl.net>
* gnome/Gnome.metadata: Hide Druid with_window ctor, map About property.        add some null_ok from bug #57948.
        * gnome/Druid.custom: implement with_window ctor for subclassing, and
        a 3 paramatered version for when you dont care about the returned
        window. another 3 parametered version for when you have want null
        parent, and a 2 parametered version for the null parent and the
        discarding of the window (THANKS MIKE!)
        * gnome/Makefile.am: add new custom.

svn path=/trunk/gtk-sharp/; revision=26948
2004-05-07 21:29:11 +00:00
Larry Ewing
bcb63e0e1d 2004-04-05 Larry Ewing <lewing@ximian.com>
* gnome/Gnome.metadata: Make data an array type so that the image
	functions can be used.
	* gnome/Print.custom: add a custom handler to print Pixbufs.
	* gnome/Makefile.am: add Print.custom.

svn path=/trunk/gtk-sharp/; revision=25252
2004-04-09 16:58:07 +00:00
Mike Kestner
f692bf6d37 2004-02-12 Mike Kestner <mkestner@ximian.com>
* gnome/Gnome.metadata : hide the GList API
	* gnome/*.custom : manually wrap GList api using typed arrays
	* gnome/gnome-api.xml : regen.

svn path=/trunk/gtk-sharp/; revision=23045
2004-02-12 22:38:43 +00:00
Mike Kestner
d41f6593b0 2004-02-10 Mike Kestner <mkestner@ximian.com>
* art/Art.metadata : mark a field private
	* art/art-api.xml : regen
	* gda/Gda.metadata : mark a few structs opaque
	* gda/gda-api.xml : regen
	* gdk/*.custom : fix changed field names
	* gdk/gdk-api.xml : regen
	* generator/Field.cs : StudlyCase simple typed field names.
	* gnome/Gnome.metadata : mark FontEntry.weight private to
	avoid collision with Weight field. s|//|/api/namespace|g
	* gnome/gnome-api.xml : regen
	* gtk/Gtk.metadata : rename AccelKey.accel_key to key to
	avoid collision with type name.
	* gtk/*.custom : fix changed field names
	* gtk/gtk-api.xml : regen
	* pango/pango-api.xml : regen
	* parser/gapi_pp.pl : add a private_regex to hide BACKEND
	and ENGINE apis, which are by convention private.
	* sample/* : make compile
	* sample/GtkDemo/* : make compile
	* sample/test/* : make compile
	* sources/gtk-sharp-sources.xml : exclude a bunch of pango
	source files.

svn path=/trunk/gtk-sharp/; revision=22947
2004-02-10 16:04:50 +00:00
Mike Kestner
ea1be0fdac 2004-01-27 Mike Kestner <mkestner@ximian.com>
* gnome/Gnome.metadata : Icon.LookupSync mark factory param
	null_ok.  Reworked from patch by Todd Berman.
	* gnome/gnome-api.xml : regen

svn path=/trunk/gtk-sharp/; revision=22550
2004-01-27 18:34:04 +00:00
Mike Kestner
90130994c0 2003-12-07 Mike Kestner <mkestner@ximian.com>
* gnome/Gnome.metadata : About ctor's logo_pixbuf is null_ok
	* gnome/gnome-api.xml : regen

svn path=/trunk/gtk-sharp/; revision=20836
2003-12-07 15:49:23 +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
b922fdc99b 2003-10-17 Mike Kestner <mkestner@ximian.com>
* gnome/CanvasPoints.custom : make New overload a ctor overload.
	* gnome/Gnome.metadata : mark CanvasPoints as opaque
	* gnome/gnome-api.xml : regenerated. [Fixes #37256]

svn path=/trunk/gtk-sharp/; revision=19145
2003-10-17 20:23:24 +00:00
Mike Kestner
f314da0c9f 2003-10-13 Mike Kestner <mkestner@ximian.com>
* gnome/Gnome.metadata : new xpath metadata rules
	* gnome/Makefile.in : apply metadata before generation
	* gnome/gnome-api.xml : regenerated
	* parser/gapi-fixup.cs : use XmlDocument.Save (filename)
	instead of opening a stream manually.
	* sources/Gnome.metadata : killed

svn path=/trunk/gtk-sharp/; revision=18975
2003-10-13 17:38:22 +00:00