a constructor or a ref, unref, or destroy method, then it must be
a reference type, so mark it "opaque" but then also mark all of
its fields public and writable.
* */*-api*.raw: Regen
* generator/Parser.cs (ParseNamespace): make the opaque attribute
check actually look at the value of the attribute rather than just
checking if it's there, so that you can change a struct's opaque
attribute from "true" to "false" via metadata and have that work.
* generator/BoxedGen.cs (Generate): do not generate the boxed's
"Free" method (since it's guaranteed to crash when we pass it a
stack pointer). If "Copy" is marked deprecated, create a
deprecated no-op for it, otherwise just skip it (since otherwise
it will just leak memory when we copy its result onto the stack).
* pango/Pango.metadata: deprecate Pango.Color.Copy and
Pango.Matrix.Copy. Hide some array fields in Pango.GlyphString
that we've never generated correctly. Tweak Pango.LayoutLine
fields to be the same as they used to be.
* pango/GlyphItem.custom (glyphs, item):
* pango/GlyphString.custom (Zero, New):
* pango/Item.custom (Zero, New):
* pango/LayoutRun.custom (glyphs, item): add deprecated API compat
* gdk/Gdk.metadata: undo the parser's new opaquification of
Gdk.Font; it's been deprecated since pre-gtk# times, and no one
should be using it, so there's no point in fixing it now. Fix up a
few other things to match how they used to be. Fix RgbCmap's
constructor args.
* gdk/RgbCmap.custom (Zero, New): deprecated API compat
* gdk/PangoAttrEmbossed.custom:
* gdk/PangoAttrStipple.custom (Zero, New, Attr): deprecated API
compat
(explicit operator ...): allow casting back and forth between
Pango.Attribute. (We can't usefully make them real subclasses of
Pango.Attribute, because there's no way for
Pango.Attribute.GetAttribute() to be able to dtrt with them.)
* gtk/Gtk.metadata: deprecate Gtk.Requisition.Copy,
Gtk.TextIter.Copy, and Gtk.TreeIter.Copy. Mark the return value of
TextView.DefaultAttributes as "owned". Mark TargetList's fields
private so it stays how it used to be.
* gtk/TextAttributes.custom (Zero, New): deprecated API compat
* gnomevfs/Gnomevfs.metadata: remove a bunch of opaque
declarations that the parser figures out on its own now.
* art/Art.metadata:
* glade/Glade.metadata:
* rsvg/Rsvg.metadata: un-mark everything the parser marked opaque
in these libraries, because all of the structs in question would
still be unusably broken, so the API churn would be pointless.
svn path=/trunk/gtk-sharp/; revision=48387
* glib/Opaque.cs (Owned): new property saying whether or not gtk#
owns the memory.
(Opaque): Set Owned to true in the void ctor and false in the
IntPtr one.
(GetOpaque): add a new overload that can also create opaques, a la
GLib.Object.GetObject.
(Ref, Unref, Free): empty virtual methods to be overridden by
subclasses.
(set_Raw): Unref() and possibly Free() the old value, Ref() the
new one.
(~Opaque, Dispose): set Raw to IntPtr.Zero (triggering Free/Unref
if needed)
* parser/gapi2xml.pl (addReturnElem): if the method is named Copy
and returns a pointer, set the "owned" attribute on the
return-type.
* */*-api.raw: Regen
* generator/HandleBase.cs (FromNative): Add new
FromNative/FromNativeReturn overloads that takes a "bool owned"
param. Implement the 1-arg FromNative and FromNativeReturn in
terms of that.
* generator/ObjectBase.cs (FromNative): Implement HandleBase's new
overload. Use the two-arg version of GLib.Object.GetObject when
"owned" is true.
* generator/OpaqueGen.cs (Generate): Pull out Ref, Unref, and
Free/Destroy/Dispose methods and handle them specially by
overriding Opaque.Ref, .Unref, and .Free appropriately. (If any
of the methods are marked deprecated, output a deprecated
do-nothing method as well, to save us from having to write all
those deprecated methods by hand.)
(FromNative): use GetOpaque, passing "owned".
* generator/ReturnValue.cs (FromNative): if the value is a
HandleBase, pass Owned to its FromNative().
* generator/Parameters.cs (Owned): new property (for use on out
params)
(FromNative): Call FromNative() on the generatable, handling Owned
in the case of HandleBase.
* generator/ManagedCallString.cs:
* generator/MethodBody.cs:
* generator/Signal.cs: use param.FromNative() rather than
param.Generatable.FromNative(), to get ownership right.
* */*.metadata: Mark opaque ref/unref/free methods deprecated
(except where we were hiding them before). Add "owned" attributes
to return values and out params as needed.
* pango/AttrIterator.custom (GetFont): work around a
memory-management oddity of the underlying method.
* pango/AttrFontDesc.cs (AttrFontDesc): copy the passed-in
FontDescriptor, since the attribute will assume ownership of it.
* gtk/TreeView.custom (GetPathAtPos): set the "owned" flag on the
returned TreePaths.
* gtk/TargetList.custom: Remove refcounting stuff, which is
now handled automatically
* gtk/NodeStore.cs (GetPath): clear the Owned flag on the created
TreePath so that the underlying structure doesn't get freed when
the function returns
* gtkhtml/HTMLStream.custom (Destroy): hide this and then
reimplement it by hand to keep OpaqueGen from using it in
Dispose(), since calling it after an HTMLStream.Close() will
result in a crash.
svn path=/trunk/gtk-sharp/; revision=47928
params... some functions use that to mark const "out" params. In
fact, let's use it as a hint to mark them pass_as="out" too...
* pango/pango-api-2.4.raw:
* pango/pango-api-2.6.raw:
* gtk/gtk-api-2.6.raw: Regen, fixing pango_script_iter_get_range
and gtk_image_get_icon_name.
* pango/Pango.metadata:
* pango/ScriptIter.cs: Alas, exposing GetRange makes it clear that
PangoScriptIter is really weird and we weren't wrapping it
correctly before anyway, so mark the whole thing hidden and wrap
it by hand.
svn path=/trunk/gtk-sharp/; revision=47748
anonymous function pointer types in method signatures. Before, we
added a <callback> child to the <parameters> node, but the
generator just ignored it. Now we add the callback (with a made-up
name) to the toplevel node, and add an ordinary <param> node
referencing it to the <parameters> node. Also, if the last param
of the callback is a gpointer, rename it from "arg#" to "data" so
it will be treated correctly (as the user data passed from the
calling method). [Fixes#66241]
* art/art-api.raw:
* gdk/gdk-api-2.4.raw:
* gdk/gdk-api-2.6.raw: Regen
* generator/Parameters.cs (IsHidden): loosen the definition of
hideable user_data; it doesn't have to occur at the end of the
parameter list, as long as there's a callback arg before it.
* generator/MethodBody.cs (GetCallString): Use Parameters.IsHidden
to decide whether or not to squash user_data params, rather than
trying to duplicate its logic. As a side effect, this also causes
a handful of methods that take non-hidden IntPtr arguments to
start actually passing those arguments to C rather than always
passing IntPtr.Zero.
* generator/Method.cs (Equals, GetHashCode): Remove unnecessary
and possibly erroneous hashing overrides.
* gtk/Gtk.metadata: Hide Gtk.Container.ForeachFull, since it's
useless and wasn't in gtk# 1.0
* gtk/Menu.custom (Popup):
* gtk/TextIter.custom (ForwardFindChar, BackwardFindChar):
* gnome/App.custom (CreateMenusInterp, InsertMenusInterp,
CreateToolbarInterp):
* gnome/Client.custom (RequestInteractionInterp):
* gnome/Popup.custom (MenuDoPopupModal, MenuDoPopup): Add
[Obsolete] compat overloads for methods that have now lost a
useless IntPtr.
svn path=/trunk/gtk-sharp/; revision=47566
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
"last if ($line =~ /^}/);" to
"last if ($line =~ /^(deprecated)?}/);" to prevent runaway
parsing (in particular in libgnomeui).
* sources/gtk-sharp-2.4-sources.xml:
* sources/gtk-sharp-2.6-sources.xml: exclude a handful of
libgnomeui files that were omitted in gtk# 1.0 due to the parser
bug, but which are entirely deprecated anyway. (Some of them
showed up in earlier 1.9/2.4/2.6 releases but are going away again
now.)
* gnome/gnome-api.raw: Regen
* gnome/Gnome.metadata: Hide a few more things that should be
hidden, remove a few rules that aren't needed any more. Keeping
hiding GnomeIconTheme though and using the old by-hand IconTheme
for the moment, since the by-hand one isn't compatible with the
autogenerated one.
* gnome/IconData.cs: kill this, use the autogenerated version
svn path=/trunk/gtk-sharp/; revision=47398
be set at construct time") and CONSTRUCT_ONLY ("can only be set at
construct time") properties, rather than marking them all
"construct-only".
* gnome/gnome-api.raw:
* gtk/gtk-api-2.4.raw:
* gtk/gtk-api-2.6.raw: Regen, causing a few formerly-read-only
properties to become writable.
svn path=/trunk/gtk-sharp/; revision=45767
* Makefile.include : depend on gapi-fixup.exe for the api target.
* parser/gapi-fixup.cs : remove-node rule handling.
svn path=/trunk/gtk-sharp/; revision=45502
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
* */*-api.xml: Regen, adding gtype="..." to many enum types
* generator/EnumGen.cs (Generate): if the enum has the
"gtype" property, add a GTypeAttribute pointing to an internal
FooGType class whose GType property can be used to get the enum's
GType.
* generator/ObjectGen.cs:
s/ObjectManager.RegisterType/GType.Register/
* glib/GTypeAttribute.cs: attribute for indicating a property that
will return the GType of a type (particularly for enums, which
can't have GType properties added to them).
* glib/GType.cs: renamed from Type.cs to match the type name
(public static readonly GType ...): add a few missing types.
(Register): moved from ObjectManager.RegisterType
(LookupGType): moved from TypeConverter.LookupType and extended to
handle GTypeAttribute. Also, fix mappings for sbyte/byte/char, and
return specific GTypes for Object subclasses rather than always
returning GType.Object. [Fixes#74699]
(LookupType): moved from ObjectWrapper.LookupType
(ToString): return the type name
* glib/Object.cs (RegisterGType):
s/ObjectManager.Register/GType.Register/
(LookupGType): Make this protected internal so GType can access
it.
* glib/ObjectManager.cs (RegisterType): deprecate in favor of
GType.Register.
(LookupType): moved to GType
* glib/TypeConverter.cs (LookupType): now a deprecated wrapper
around GType.LookupGType.
* glib/Value.cs: Use GType casts rather than TypeConverter
* gtk/NodeStore.cs (ScanType):
* gtk/ListStore.custom (ListStore):
* gtk/TreeStore.custom (TreeStore): Use (GType) cast rather than
TypeConverter. Remove the error check and exception, since the
cast never returns GType.Invalid. (The check probably predates
GLib.ManagedValue.)
* gnome/PanelAppletFactory.cs (Register): Use a GType cast rather
than GLib.Object.LookupGType (which is no longer accessible after
an mcs bugfix)
* sample/GtkDemo/DemoIconView.cs (CreateStore): use the Type[]
constructor rather than the GType[] constructor, since it
translates typeof(Gdk.Pixbuf) correctly now.
svn path=/trunk/gtk-sharp/; revision=44038
* parser/gapi-parser.cs : add a directory element with child exclude
elements to simplify source version updating.
* sources/gtk-sharp-sources.xml : switch to directory elements.
svn path=/trunk/gtk-sharp/; revision=43354
into the type name
* gtk/gtk-api.raw: Regen, exposing the previously-broken
AccelGroup.AccelActivate, AccelMap.Changed,
ActionGroup.ConnectProxy, ActionGroup.DisconnectProxy,
ActionGroup.PreActivate, ActionGroup.PostActivate, and
Widget.EventAfter.
* gtk/Gtk.metadata: Give proper names to the parameters of those
signals
svn path=/trunk/gtk-sharp/; revision=41111
rather than "FOO_TYPE_BAR" in G_TYPE_CHECK_INSTANCE_CAST macros,
allowing large parts of libgda that were previously misparsed to
be parsed correctly
* gda/gda-api.raw: Regen
* gda/Gda.metadata: Make Gda.Value opaque, since it's mostly a
union and we're horribly butchering its layout.
svn path=/trunk/gtk-sharp/; revision=41103
* configure.in : kill a ton of redundant stuff.
* AssemblyInfo.cs.in : moved here, only need one.
* Makefile.include : rules for building generated assemblies.
* Makefile.am : removed gtk-sharp-2.0.pc handling.
* */AssemblyInfo.cs.in : killed
* */Makefile.am : refactored out a ton of rules to an include.
* */*-pc.in : added Cflags entries pointing to the gapi files.
* generator/CodeGenerator.cs : add -I: synonym --include.
* gnomevfs/gnome-vfs-api.raw : remamed from gnomevfs-api.raw.
* gtk/gtk-sharp-2.0.pc.in : moved here from top.
* parser/gapi-fixup.cs : add --symbol arg to merge sym files.
* sources/gtk-sharp-sources.xml : remamed gnome-vfs-api.raw.
svn path=/trunk/gtk-sharp/; revision=38551
* 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
GLib.Marshaller.CharToGUnichar and .GUnicharToChar [#70704]
* generator/SymbolTable.cs (SymbolTable): add a GUnicharGen.
* generator/Makefile.am (sources): add GUnicharGen.cs
* parser/gapi2xml.pl (addPropElem): g_param_spec_unichar() has
type "gunichar" not "unichar".
* gtk/gtk-api.raw: Regen
* glib/Marshaller.cs: Import CharToGUnichar's glue method by the
right name
svn path=/trunk/gtk-sharp/; revision=37998
/*< private >*/ comments.
* parser/gapi2xml.pl: Use those comments to determine the
accessibility of struct/object fields, and set the "access"
attribute on fields with non-default accessibiliy (private for
structs, public for objects). Also, output a StudlyName for each
field as well as a c_name.
* */*-api.raw: Regen
* generator/Field.cs (StudlyName): Use the parser-generated studly
name rather than studlifying Name, which might have been mangled
to avoid conflicts with an all-lowercase keyword.
(Generate): Respect the access property on all field types rather
than always making certain types public. Don't bother outputting
wrapper properties for private fields, since the only code that
could use them is the generated code, which won't.
See doc/ChangeLog for the (very minimal) fallout from these
changes.
* en/Art/AlphaGamma.xml:
* en/Gtk/TextAttributes.xml (Refcount):
* en/Pango/GlyphString.xml (Space): these are now private
* en/Gda/XqlItem.xml:
* en/Glade/SignalInfo.xml:
* en/Gnome.Vfs/ModuleCallbackSaveAuthenticationIn.xml:
* en/Gnome.Vfs/ModuleCallbackFullAuthenticationIn.xml:
* en/Gnome.Vfs/ModuleCallbackFillAuthenticationIn.xml: rename
Objekt to Object.
* en/Atk/KeyEventStruct.xml: rename Str1ng to String
svn path=/trunk/gtk-sharp/; revision=37853
* #68824]
* gdk/Gdk.metadata: Remove the earlier GdkBitmap hack now that
it's aliased. Also move Gdk.Bitmap.CreateFromData to
Gdk.Pixmap.CreateBitmapFromData
* gdk/Pixbuf.custom (RenderPixmapAndMask,
RenderPixmapAndMaskForColormap, RenderThresholdAlpha):
s/Bitmap/Pixmap/
* sample/GtkDemo/DemoTextView.cs: uncomment the fg/bg stipple
code, since that works now
* parser/gapi-fixup.cs: Add an "add-node" rule. This turned out
* to
not actually be needed for this fix, but we know we'll need it
later, so here it is.
svn path=/trunk/gtk-sharp/; revision=37055
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
* */*-api.raw : rerun the parser for new vm-age and cleanups.
* parser/gapi_pp.pl : suppress union types, since we can't generate
them. smarter get_type regex. ignore #errors.
* parser/gapi2xml.pl : generate vm elements for GInterfaces. Deal
with G_CONST_RETURN in vms. deal with "struct _foo" types in method
prototypes.
svn path=/trunk/gtk-sharp/; revision=36088
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
* */Makefile.am : automakify the build
* */Makefile.in : kill
* *.custom : remove System.Drawing dependencies
* *.cs : remove System.Drawing dependencies
* *-api.xml : mv to *-api.raw
* glue/* : mv to lib specific gluelibs for glib, gdk, gtk, and glade.
* gtk/gtk-symbols : alias GtkType to GType
* sources/gtk-sharp-sources.xml : create .raw files. They are now
transformed to .xml files by the metadata compilation step.
svn path=/trunk/gtk-sharp/; revision=23967
* generator/ObjectGen.cs : ignore virtual_method elems for now.
* parser/gapi2xml.pl : parse the non-signal class methods and add as
virtual_method elements in the API xml
* */*-api.xml : regen
svn path=/trunk/gtk-sharp/; revision=23809