Candidate patch provided by Andres in pull request #17.
* glib/Object.cs: use ToggleRef.Dispose.
* glib/ToggleRef.cs: implement IDisposable and expose former Free
functionality as Dispose(). Free is now private non-lock taking
called by Dispose and the idle queue handler.
* glib/Object.cs: move finalization queue to ToggleRef and make
Dispose() non-virtual with a protected virtual Dispose(bool).
Also added a WarnOnFinalize static property to produce nags for
undisposed objects.
* glib/ToggleRef.cs: add finalization queue and QueueUnref method.
* gtk/NodeStore.cs: override Dispose(bool)
* gtk/Widget.custom: override Dispose(bool)
* gdk/Display.custom: rework signal connection
* gdk/Window.custom: rework signal connection
* generator/Signal.cs: generate for new API.
* glib/Object.cs: add (Add|Remove)SignalHandler methods and use
them for the Notify connections. Move to generic collections for
everything but the Data hash.
* glib/Signal.cs: kill Lookup methods and add delegate fields
* glib/ToggleRef.cs: remove Signals hash, it doesn't belong here.
* gtk/Clipboard.custom: rework signal connection
* gtk/ListStore.custom: rework signal connection
* gtk/TextView.custom: remove obsolete signal
* gtk/TreeModelAdapter.custom: rework signal connection
* gtk/TreeModelFilter.custom: rework signal connection
* gtk/TreeModelSort.custom: rework signal connection
* gtk/TreeStore.custom: rework signal connection
* gtk/Widget.custom: rework signal connection
* gtk/Window.custom: remove obsolete signal
* glib/Object.cs: don't bother with IsAlive check on tref
* glib/Signal.cs: remove unnecessary as usage
* glib/ToggleRef.cs: make Signals a generic dictionary
* glib/GType.cs:
* glib/Makefile.am:
* glib/Object.cs:
* glib/ParamSpec.cs:
* glib/PtrArray.cs:
* glib/SignalClosure.cs:
* glib/Value.cs:
mark private struct fields public to avoid 0169, and remove the nowarn
from the csc command. fixed one real warning, exposed a bunch of
obsolete usage still to fix.
* glib/Object.cs: add support for native instantiation of
managed types.
* glib/ParamSpec.cs: add Flags ctor overload.
* sample/NativeInstantiationTest.cs: new sample to test the
unmanaged instantiation capability.
Based on a patch from Sebastian Dröge [Fixes#499900]
svn path=/trunk/gtk-sharp/; revision=141819
* glib/Global.cs: Kill the calling convention field again.
It breaks GLib 2.x compatibility in the generator and there is
probably no need to make the calling convention configurable.
* .cs, *.custom: Hardcode Cdecl calling convention instead of
using GLib's field.
svn path=/trunk/gtk-sharp/; revision=141283
* glib/Global.cs: Add a public constant field specifying the
calling convention used by GLib and depending libraries.
By now it's hardcoded to Cdecl as every non-Win32 runtime
should ignore this attribute.
* *.cs, *.custom: Use GLib.Global.CallingConvention for both
pinvokes and callbacks. Plugs a stack leak on Win32. All
pinvokes defaulted to StdCall and thus the stack was never
cleaned up.
svn path=/trunk/gtk-sharp/; revision=141175
* configure.in.in: add new dir and autofu for it.
* Makefile.am: add new dir
* gapi/*: a small extension method library to add generation-related
api to GType in 2.0. Access it with -pkg:gapi-2.0-compat to pick up
the needed refs.
* generator/GObjectVM.cs: generate new GType getter methods.
* generator/ObjectGen.cs: generate new GType getter methods.
* glib/GType.cs: change a few props to methods to make them extension
method friendly for 2.0 compat.
* glib/Object.cs: use new GType getter methods.
* glib/Value.cs: use new GType getter methods.
* gtk/Widget.custom: use new GetClassPtr method.
svn path=/trunk/gtk-sharp/; revision=139609
* configure.in.in: Target .net 2.0 profile
* gapi-cdecl-insert: Kill. We are now using the UnmanagedFunctionPointerAttribute
for callbacks.
* glib/CdeclCallback: Mark obsolete.
* generator/*.cs:
* *.custom: Use [UnmanagedFunctionPointer (CallingConvention.Cdecl)] instead of
[GLib.CDeclCallback].
svn path=/trunk/gtk-sharp/; revision=137323
* glib/Object.cs: get gtype from instance data.
* glib/Value.cs: use instance NativeType when initing for props.
[Fixes#500157] Patch by Sebastian Dröge.
svn path=/trunk/gtk-sharp/; revision=133282
Add support for virtual methods(vm) to the generator.
* parser/gapi2xml.pl: Generate a class_struct element with
all members of the class structure. Dump the first (instance)
parameter for signal and vm elements. Bump up parser version.
* generator/GObjectVM.cs: Added. Support for GObject virtual methods.
* generator/DefaultSignalHandler.cs: Signal specific part of vm
generation.
* generator/InterfaceVM.cs: New class for interface vms.
* generator/ObjectBase.cs: Parse the class struct.
svn path=/trunk/gtk-sharp/; revision=131604
Initial Patch submitted by Christian Hoff with some small
style alterations and a round trip sample by me. Supports the
registration of managed properties with the GType system, so
that things like custom cell renderers can be accessed via the
native property system from treeview.
* glib/glue/object.c : property registration related glue.
* glib/Object.cs: implement managed property registration.
* glib/PropertyAttribute.cs: add new props and ctor for managed
property registration.
* sample/PropertyRegistration.cs: little test app to test round-
tripping of registered properties.
* sample/Makefile.am: add new sample.
svn path=/trunk/gtk-sharp/; revision=105177
* glib/Object.cs: revert the connection optimization from r102349.
It breaks under the current CellRenderer implementation which probably
can't be reworked compatibly to take advantage of this code.
* glib/SignalClosure.cs: use IntPtr.ToInt64 instead of (long) since
the cast apparently has issues on bleeding edge mono.
svn path=/trunk/gtk-sharp/; revision=102693
* glib/Object.cs: Don't bother hooking VM into the class field
if another managed ancestor has already done so. Add a LogFunc
printing a stack trace for the GObject log domain if GTK_SHARP_DEBUG
is set in the environment. It's a bit noisy to do unconditionally.
svn path=/trunk/gtk-sharp/; revision=102349
* generator/InterfaceGen.cs:
* generator/Signal.cs: use generic signal marshaling instead of
generating signature specific marshaling callbacks.
* glib/glue/closure.c: glue for new closure impl.
* glib/Object.cs: open up a couple hashes internally.
* glib/Signal.cs: hook in closure based connection and expose
EmissionHook functionality for atk usage.
* glib/SignalClosure.cs: new generic signal marshaling mechanism.
* glib/ToggleRef.cs: null guarding in Target and let Signal remove
itself from hash when it disposes itself.
svn path=/trunk/gtk-sharp/; revision=102241
* atk/Atk.metadata: markup all the Ref* methods to indicate owned refs.
* generator/ReturnValue.cs: Add owned object ToNative handling.
* generator/VirtualMethod.cs: Split ToNative call from managed method
invocation to avoid duplicate calls in null checking scenarios.
* glib/Object.cs: add OwnedHandle property for use by language binding
code which needs to pass owned refs to native methods.
svn path=/trunk/gtk-sharp/; revision=99849
* glib/Object.cs: expose an internal ToggleRef prop.
* glib/Signal.cs: use ToggleRef for lookups instead of Object. Add
a Free method and release connections and gchandles.
* glib/ToggleRef.cs: add signal hash and release signals on free.
svn path=/trunk/gtk-sharp/; revision=93548
* glib/Object.cs: remove ref from Objects hash prior to releasing it.
2008-01-17 Mike Kestner <mkestner@novell.com>
* glib/ToggleRef.cs: check for null reference in IsAlive.
svn path=/trunk/gtk-sharp/; revision=93204
* glib/Object.cs: add ctor (), which invokes CreateNativeObject
to allow direct subclasses that do all the registration automatically.
svn path=/trunk/gtk-sharp/; revision=86730
* gtk/Gtk.metadata: virtual_method rules for GInterface generation.
* generator/ReturnValue.cs (ToNative): new method for the virtual
method generation.
* generator/Parameters.cs (FromNative): null guarding.
* generator/ManagedCallString.cs: rework for interface method
generation including callback and error param support.
* generator/CallbackGen.cs: Invoker support. new class that deals
with persistence of native and wrapper delegates in native to managed
callback method signatures.
* generator/VirtualMethod.cs: support for generation of interface
methods, and all the funky parameters that come with that.
* generator/InterfaceGen.cs: Fill out the adapter implementation.
* generator/MethodBody.cs: Initialize overload. Extend ThrowsException
to support GError outside the last parameter slot.
* glib/GInterfaceAttribute.cs: New attribute to mark interfaces and
obtain adapter type.
* glib/Object.cs (AddInterfaces): interface registration method.
* glib/GInterfaceAdapter.cs: New abstract class for interface
adapter generation.
* glib/Makefile.am: add new files.
svn path=/trunk/gtk-sharp/; revision=85658
* AssemblyInfo.cs.in : add IgnoreClassInitializers attr to all.
* generator/ObjectGen.cs : add custom-attr generation for objects.
* glib/ClassInitializerAttribute.cs : obsolete
* glib/IgnoreClassInitializersAttribute.cs : new assembly attr
to avoid a blind GetMethods reflection.
* glib/Makefile.am : add files
* glib/TypeInitializerAttribute.cs : new attr to specify init
method to be run at type registration.
* gtk/Widget.custom : remove the ClassInitializerAttr.
* gtk/Gtk.metadata : add a custom-attr node to GtkWidget.
* sample/Subclass.cs : use the IgnoreClassInitializers attr.
svn path=/trunk/gtk-sharp/; revision=85480
* glib/Object.cs : do the Timeout switch in the finalizer
instead of in Dispose, where it can cause problems if people
override Dispose.
* generator/ObjectGen.cs : don't generate finalizers for every
subclass, just rely on the ~GLib.Object implementation.
svn path=/trunk/gtk-sharp/; revision=75657
* glib/Object.cs : switch to ToggleRefs for all items created with
CreateNativeObject. This gets all managed subclasses, with a little
overhang into simple wrappers.
* glib/ToggleRef.cs : new class to manage the weak to strong ref
transitions as a native object flips between shared and unshared
ownership.
* gtk/Object.custom : revamp of the Destroyed signal handling.
* gtk/Gtk.metadata : hide destroy signal so we can deal with it
manually. [Fixes the reopen note of #72018.]
svn path=/trunk/gtk-sharp/; revision=73023
* glib/MainContext.cs: added a Depth property to p/invoke g_main_depth.
* glib/Object.cs:
(Dispose): immediately call g_object_unref without queueing when
possible (MainContext.Depth > 0) and use Timeout.Add instead of Idle.Add
to get our unref callback scheduled more reliably.
svn path=/trunk/gtk-sharp/; revision=51448
* glib/Object.cs : hold strong refs for managed subclasses and
weakrefs for wrappers.
* gtk/Object.custom : don't hold managed refs here, they are now held
in GLib.Object.
svn path=/trunk/gtk-sharp/; revision=48389
* glib/Object.cs : add a try/catch block to g_object_unref calls to
help identify "extra unref" bugs when exceptions occur.
svn path=/trunk/gtk-sharp/; revision=44325
* */*-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
* generator/CallbackGen.cs : don't create native delegates for nulls.
* generator/ObjectGen.cs : revamp the ObjectManager code.
* glib/Object.cs : use new ObjectManager.RegisterType overload.
* glib/ObjectManager.cs : rewrite to kill the lameass LoadWithPartial
hack and keep a GType to Type mapping for quicker lookup/activation.
svn path=/trunk/gtk-sharp/; revision=42241
* glib/Object.cs: use IsDefined to check for ClassInitializer
attribute, fixes a warning and is supposedly better for performance
svn path=/trunk/gtk-sharp/; revision=41839
* glib/Makefile.am : add new file.
* glib/Object.cs : add protected PersistentData hash to hold data
across GC cycles.
* glib/WeakObject.cs : new object to hold managed refs weakly against
the native object.
* gtk/ListStore.custom : hold refs for DefaultSortFuncs.
* gtk/TreeModelSort.custom : hold refs for DefaultSortFuncs.
* gtk/TreeStore.custom : hold refs for DefaultSortFuncs.
svn path=/trunk/gtk-sharp/; revision=41740