* 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
* gtk/Gtk.metadata: Change the Gtk.Style.Paint* methods to use a
Gdk.Drawable instead of a Gdk.Window
* doc/en/Gtk/Style.xml: Update the documentation for the above
change.
svn path=/trunk/gtk-sharp/; revision=47895
* sources/gtk-sharp-2.6-sources.xml: exclude a bunch of
gnome-print stuff that is not part of gnome-print's public API.
* gnome/gnome-api.raw: regen
* gnome/Gnome.metadata: remove some no-longer-needed metadata
* gnome/GPFontEntry.custom:
* gnome/GPPath.custom: no longer needed
* gnome/FontFamily.cs: moved from FontFamily.custom, since there's
no longer any non-custom portion of this.
svn path=/trunk/gtk-sharp/; revision=47802
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
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
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
* gtk/TreeSelection.custom: Add an overload for GetSelected to remove
the need to always pass in that damn TreeModel.
* doc/en/Gtk/TreeSelection.xml: Add documentation for the new
overload.
svn path=/trunk/gtk-sharp/; revision=47475
(They're always allowed now.)
* generator/Signal.cs (GenVirtualMethod): Fix up the use of CSType
vs MarshalType in the ref/out-handling code so that this can
marshal any type.
svn path=/trunk/gtk-sharp/; revision=47412
"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
* sources/gtk-sharp-2.6-sources.xml: remove some gnome-vfs files:
gnome-vfs-method and gnome-vfs-transform, because they're
internal/part of the module API, and gnome-vfs-file-size.h,
because it's generated and shouldn't be in the source tarball (and
we don't parse it right anyway).
* gnomevfs/gnome-vfs-api.raw: Regen
* gnomevfs/gnomevfs-symbols.xml: add GnomeVFSFileOffset
* gnomevfs/Gnomevfs.metadata: remove a whole bunch of callback
types that are only used from methods and structs that we hide.
svn path=/trunk/gtk-sharp/; revision=47268
* pango/*.raw : regen.
* sources/gtk-sharp-2.4-sources.xml : exclude some xft and fc files.
* sources/gtk-sharp-2.6-sources.xml : exclude some xft and fc files.
svn path=/trunk/gtk-sharp/; revision=47124
that are only used inside ModuleInfo, so we don't marshal the
function pointers into (incorrect) delegates.
* gnome/Modules.cs:
* gnome/Program.custom: update for ModuleInfo being a class rather
than a struct now
svn path=/trunk/gtk-sharp/; revision=47045
* generator/CallbackGen.cs : implement new IAccessor iface so that
callback fields on structs can now be accessed.
* generator/ClassBase.cs : remove/abstract some methods incorrectly
located here.
* generator/ClassGen.cs : implement methods previously inherited from
ClassBase incorrectly.
* generator/HandleBase.cs : new base class for native ptr wrappers.
Implements new IAccessor interface and code moved from ClassBase.
* generator/IAccessor.cs : new iface to generate field/prop accessors.
* generator/InterfaceGen.cs : derive from new ObjectBase.
* generator/LPGen.cs : implement IAccessor.
* generator/LPUGen.cs : implement IAccessor.
* generator/ObjectBase.cs : new base class for Object/Iface types.
* generator/ObjectGen.cs : derive from new ObjectBase.
* generator/OpaqueGen.cs : derive from HandleBase.
* generator/StructField.cs : refactor Generate method using new
IAccessor interface.
* */*.custom : add obsolete impls for some existing c_cased struct
field accessors that are now StudlyNamed.
svn path=/trunk/gtk-sharp/; revision=46878
* generator/CallbackGen.cs : remove an old workaround that put
the native wrapper class into the implementor's *Sharp namespace.
Use new ImportSignature sig.
* generator/ImportSignature.cs : don't mangle the callback wrapper
namespace any more. Remove impl_ns ctor param and field.
* generator/MethodBase.cs : use new MethodBody and ImportSignature
ctor sigs.
* generator/MethodBody.cs : drop the impl_ns ctor param.
* generator/Signal.cs : use new ImportSignature ctor sig.
* generator/VirtualMethod.cs : use new ImportSignature ctor sig.
svn path=/trunk/gtk-sharp/; revision=46877
whether or not to allow "complex" ref/out args.
(Validate): update for that
* generator/Signal.cs: set AllowComplexRefs false on the params.
(Validate): fix the messages
(GenCallback, GenEventHandler): properly handle ref/out args, by
manually pointerifying them (except for boxed args, which are
already pointers).
* glib/Marshaller.cs (StructureToPtrAlloc): Rename from
PtrToStructureAlloc, since it wraps Marshal.StructureToPtr.
svn path=/trunk/gtk-sharp/; revision=46773
* generator/ReturnValue.cs : support owned and elements_owned for lists.
* glib/List.cs : add ctor overloads for memory mgmt.
* glib/ListBase.cs : add ctor overloads for memory mgmt. Dispose
elements if specified.
* glib/SList.cs : add ctor overloads for memory mgmt.
* gnome/Gnome.metadata : unhide and generate a List prop.
* gnomevfs/Gnomevfs.metadata : unhide and generate a List prop.
* gtk/FileChooser.custom : new. add hidden props.
* gtk/FileChooserButton.custom : new. impl hidden props.
* gtk/FileChooserDialog.custom : remove some List props and use the
GLib.Marshaller for the remaining ones..
* gtk/FileChooserWidget.custom : remove some List props and use the
GLib.Marshaller for the remaining ones..
* gtk/Gtk.metadata : unhide and let the generator do some List props.
svn path=/trunk/gtk-sharp/; revision=46457
* gconf/GConf/Client.cs : support add/remove of a single notify handle
to multiple directories. [Fixes#55877]
svn path=/trunk/gtk-sharp/; revision=46456
* sample/GladeTest.cs : add a menu item signal connect to test for the
problem described in bug#74946.
* sample/test.glade : add menubar.
svn path=/trunk/gtk-sharp/; revision=46397
* Makefile.include : add included apis as deps on the generation
target to force regen if dependency lib api changes.
* pango/Analysis.custom : new custom to implement the ExtraAttrs
property. [Fixes#74668]
* pango/Makefile.am : add new custom file.
svn path=/trunk/gtk-sharp/; revision=46166
* bootstrap : use assembly version 2.6.0.0.
* bootstrap-2.4 : use assembly version 2.4.0.0.
* configure.in.in : substitute the assembly version.
svn path=/trunk/gtk-sharp/; revision=46136
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
* glade/XML.custom : add a try block on field autoconnect to make it
easier to catch type mismatches and such. Suggestion from Gonzalito.
svn path=/trunk/gtk-sharp/; revision=45766
* generator/SimpleBase.cs : off-by-one in namespace join.
* glib/ListBase.cs : support IntPtr element_type.
* gnomevfs/FileInfo.cs : make it ManualGen friendly.
* gnomevfs/*.cs : rework for FileInfo api changes.
* gnomevfs/Gnomevfs.metadata : make FileInfo a manual symbol.
* gnomevfs/Uri.custom : rework for FileInfo api changes.
* gnome/Makefile.am : add gnomevfs dependency to pick up some more api
symbols.
* gnome/gnome-sharp-2.0.pc.in : advertise the vfs dep.
[Fixes#71060]
svn path=/trunk/gtk-sharp/; revision=45702
* generator/ReturnValue.cs : don't write a sem in FromNative.
* glib/ListBase.cs : handle GLib.Object explicit element types.
* glib/Marshaler.cs : only copy lists if Count > 0.
* gtk/Gtk.metadata : unhide Window.ListToplevels with a proper element
type for automatic list to array marshaling.
* gtk/Window.custom : kill manual ListToplevels impl.
svn path=/trunk/gtk-sharp/; revision=45654
* 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
Gdk.PangoRenderer.GetDefault() like the C gtk-demo rather than
creating a new Gdk.PangoRenderer. [Fixes#74865]
* gdk/Gdk.metadata: fix return type of Gdk.PangoRenderer.GetDefault
svn path=/trunk/gtk-sharp/; revision=45494
* glib/ListBase.cs : add a nested class to support filename encoded
string element marshaling.
* gtk/Gtk.metadata : mark the filenames and folders as filename
encoded.
* gtk/FileChooserDialog.custom : use new ListBase.FilenameString type
for list element type of filenames and folders.
* gtk/FileChooserWidget.custom : use new ListBase.FilenameString type
for list element type of filenames and folders.
[Fixes#72701]
svn path=/trunk/gtk-sharp/; revision=45334