In gtksettings.c, properties are installed using a custom function. So a
few properties were added as custom code. Move those as a fixup, and add
all the other properties too.
The only missing properties now are gtk-im-preedit-style and
gtk-im-status-style, because their type is hidden.
G_DEFINE_TYPE_EXTENDED is the general macro for type implementations, on
which G_DEFINE_TYPE_WITH_CODE is based. Handle it just like
G_DEFINE_TYPE_WITH_CODE.
Reparse the API with that change, which marks a few classes as
implementing GtkStyleProvider.
Add ComboBox[Text] (bool with_entry) protected constructors to allow
subclasses with an Entry.
Add an Entry property for easy access to the Entry child widget.
Also remove the unused gtk/ComboBoxEntry.custom.
The interface parsing fix added a few properties on interfaces that have
no accessors. In this case, the code generated in the adapter for those
properties does not build: it tries to use (Get/Set)Property but they
don"t inherit from Glib.Object.
Hide those properties for now, until a proper fix is implemented. As
they were not available before, it's not that bad.
With the new G_DEFINE_INTERFACE macro, the interface initialization
function is named *_default_init, so we need to handle that like
*_base_init and *_class_init.
Reparse gtk/gtk-api.raw and gio/gio-api.raw. This creates some new
signals that were previously incorrectly reported as virtual methods,
and also adds some properties.
The action area is created as a GtkButtonBox, so casting it to a
GtkHButtonBox doesn't work. And GtkHButtonBox is going to be deprecated
in 3.2 anyway.
This fixes a crash when accessing Dialog.ActionArea. With this,
everything in sample/test seems to work OK.
When Gtk.Object was removed, most of the code was moved to Gtk.Widget.
But the part that deals with floating references actually belongs in
Glib.InitiallyUnowned.
This fixes various issues, in particular crashes in the TreeModelDemo
sample.
* generator/CallbackGen.cs: connect return value count parameters
* generator/ManagedCallString.cs: out count params aren't special
* generator/MethodBody.cs: don't finish hidden params
* generator/Parameters.cs: explicit IsCount setting support, with
Parameters.GetCountParameter(name) interface. Clear IsCount
values during validation if they have no associated array. Any
remaining count params must be associated with a retval, so
hide them.
* generator/ReturnValue.cs: support array_length_param attribute to
associate a return value with a "count" param. Use new helper
methods to marshal these array retvals to IntPtr and back.
* glib/Marshaller.cs: support for byte[] marshaling to and from
IntPtr using a count and type in the from native direction.
* gtk/Gtk.metadata: mark TextBufferSerializeFunc return type as
an array with the length specific in the length param.
* gtk/Gtk.metadata: hide the Render class
* gtk/Makefile.am: build the new file
* gtk/StyleContext.cs: instance methods for the gtk_render_* api using
the internal generated Render class.
* gtk/Gtk.metadata: properties of type GdkRGBA get converted to
type="GdkRgba" by the parser name mangling. Manual fix those
and clean up the lists, ellipsis, and out param API in the new
StyleContext object.
Hyena has bindings to gtk_show_uri. Now that gtk-sharp binds
this API targeting 3.x, we can bring the extra overloads from
hyena and mark them as obsolete there.
* 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
* gtk/Gtk.metadata: mark GetContentArea return as a GtkBox* and
remove some unmatched fields on GtkDialog.
* sample/TreeViewDemo.cs: use Dialog.ContentArea instead of VBox.
* *: s/win32-2.0-0/win32-3.0-0/ I suspect this will need to change
again when I see some win32 binaries. I think the win32 goes away.
Killing a few dead customs in the list as well.
* configure.ac: drop cairo conditionality
* cairo/AssemblyInfo.cs: set version to 1.10.0.0
* cairo/Makefile.am: unconditional build and add Region.cs
* cairo/cairo-api.xml: initial type exposure.
* pango/Makefile.am: use cairo-sharp.dll and cairo-api.xml
* pango/Pango.metadata: drop explicit symbol additions.
* gdk/Gdk.metadata: drop explicit symbol additions.
* gdk/Makefile.am: use cairo-sharp.dll and cairo-api.xml
* gtk/Makefile.am: use cairo-sharp.dll and cairo-api.xml
* sample/Makefile.am: use cairo-sharp.dll
* sample/GtkDemo/Makefile.am: use cairo-sharp.dll
This is an initial stab at a 1.10 binding. It will probably take
more based on the number of errors still coming out of the Gdk
build.
2010-11-21 Mike Kestner <mkestner@novell.com>
* removed the glade dir from the build since libglade is
no longer supported in gnome3. removed the gapi2-compat stuff
since it doesn't make much sense now. Removed the bootstrap
mechanism since we are unlikely to be releasing multiple API
versions from the same tree going forward. The build is now a
straight autogen.sh like most autotools projects.
* generator/Method.cs: support win32_utf8_variant attribute on methods.
* glib/*.cs: support win32 utf8 variant methods.
* gtk/*.custom: support win32 utf8 variant methods.
* gtk/Gtk.metadata: mark some win32_utf8_variant methods.
[Fixes#550961] Adapted from a patch by Tor Lillqvist.
svn path=/trunk/gtk-sharp/; revision=147113
* gtk/Application.cs: Port the theming-relevant part of the
SWF.Application.DoEvents code to avoid loading the assembly
at runtime on the Windows platform.
svn path=/trunk/gtk-sharp/; revision=141783
* 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
Complete the major version jump. Gtk# 3 and 2 are now both
installable within the same prefix.
* */glue/Makefile.am: Produce *sharpglue-3 gluelibs.
* *.custom, *.cs: pinvoke the new glue library.
* *-2.0.pc.in: Rename to *-3.0.pc.in.
svn path=/trunk/gtk-sharp/; revision=140941
* gtk/Object.custom: Deglue the floating reference API.
We should consider moving all that stuff to GInitiallyUnowned
as Gtk+ did several releases ago.
svn path=/trunk/gtk-sharp/; revision=140940
* gtk/StatusIcon.custom: Use managed code to pass the address of
gtk_status_icon_position_menu to gtk_menu_popup.
svn path=/trunk/gtk-sharp/; revision=140939
* gtk/Widget.custom: Set the activate/set_scroll_adjustments signal IDs
from managed code. Use the gtk_widget_get_window accessor.
* gtk/glue/widget.c: Remove the corresponding glue functions.
svn path=/trunk/gtk-sharp/; revision=139851
* configure.in.in: Detect GDK backend.
* */*.dll.config.in: Link against the libs of the correct GDK backend
instead of using x11 on Linux/win32 on Windows.
Patch by Christian Hergert. [Fixes 527840]
svn path=/trunk/gtk-sharp/; revision=139750
* 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
* gtk/Widget.custom: Don't use [MarshalAs] for struct fields since
that is not supported in the .net framework
svn path=/trunk/gtk-sharp/; revision=136157
* gtk/Application.cs: add the theme initialization workaround for
windows. Hopefully we can find a better solution that doesn't
involve loading SWF. [Fixes#471682]
svn path=/trunk/gtk-sharp/; revision=134008
* gtk/Widget.custom: Implement signal registration for the
Activate, SettScrollAdjustments and key binding signals
in managed code.
svn path=/trunk/gtk-sharp/; revision=132771
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
* gtk/Target.custom: custom implementation of TableNewFromList.
* gtk/TargetList.custom: use Target.TableNewFromList method
to convert the TargetList to a TargetEntry array.
* gtk/glue/targetlist.c: deleted.
svn path=/trunk/gtk-sharp/; revision=131066
* parser/gapi2xml.pl: Introduce a "parser_version" attribute.
* generator/GenBase.cs: Implement a property to access the
attribute's value.
svn path=/trunk/gtk-sharp/; revision=129807
* gtk/NodeSelection.cs: use new Adapter prop on NodeStore.
* gtk/NodeStore.cs: some encapsulation rework.
* gtk/NodeView.cs: use new Adapter prop on NodeStore. new methods
to support manipulation of the view by TreeNode, like scrolling
and cell bounds lookups.
* gtk/TreeView.cs: use new Adapter prop on NodeStore.
* doc/en/Gtk/NodeView.xml: new doc updates.
Patch provided by Vladimir Giszpenc. [Fixes#480067]
svn path=/trunk/gtk-sharp/; revision=129498
* generator/ReturnValue.cs: map gfilename* list elements to type
ListBase.FilenameString so they are marshaled correctly.
* glib/Marshaller.cs: handle FilenameStrings in ListPtrToArray.
* gtk/Gtk.metadata: FileChooser.GetFilenames and ListShortcutFolders
return type mangling to avoid custom implementations.
* gtk/FileChooser*.custom: kill manual Filenames and ShortcutFolders.
svn path=/trunk/gtk-sharp/; revision=122802
* gtk/Gtk.metadata: mark the SpinButton::Output signal as manually
marshaled to avoid a compat break. The old manual marshaler expected
and int RetVal and the new signal closure more accurately expects a
bool. Since returning 1 previously worked, we need to revert to the
int expectation, even though bool is technically more correct.
svn path=/trunk/gtk-sharp/; revision=118944
* atk/atk-api-2.12.raw: regen
* gtk/gtk-api-2.12.raw: regen
* generator/Signal.cs: reinstate old custom marshaler generation and
generate custom marshaling when 'manual' attr is set.
* parser/gapi2xml.pl: set manual attr on sigs that have G_TYPE_POINTER
parameters since the generic closure can't cope with them.
svn path=/trunk/gtk-sharp/; revision=118068
* gtk/TreeModelAdapter.custom:
* gtk/TreeModelFilter.custom:
* gtk/TreeModelSort.custom:
* gtk/TreeStore.custom: Don't trigger any gtk+ critical
warnings when the 'rows-reodered' signal is fired.
svn path=/trunk/gtk-sharp/; revision=116800
* configure.in.in: magic for local Mono.Cairo build.
* cairo/*: a local build of Mono.Cairo for .Net-only builds on win32.
* */Makefile.am: use local Mono.Cairo where necessary.
svn path=/trunk/gtk-sharp/; revision=115399
* generator/ManagedCallString.cs: revert last change. There are a
lot of "broken" callback sigs out there which expose user data because
it's not in the last parameter in the list. I don't think we can
reasonably make a change to hide all those at this point. This change
at least hides all the user_data which comes right before a GError
param at the end of the list. I need to follow up with a change which
handles data parameters in any parameter position, but allows the user
to mark "exposed" data params for compatibility reasons.
* generator/Parameters.cs: hide data params which are at the end of a
list behind an error param.
* gtk/Gtk.metadata: mark an array parameter on
TextBufferDeserializeFunc.
svn path=/trunk/gtk-sharp/; revision=111716
* generator/ReturnValue.cs: use new ListPtrToArray marshaler for
lists with known element types.
* glib/Marshaller.cs: new ListPtrToArray marshaller with more
aggressive list disposal.
* gtk/Container.custom: remove manual Children impl. Use Children
in GetEnumerator instead of pinvoking directly.
* gtk/Gtk.metadata: remove hidden attr and add element type and owned
for Container.GetChildren to generate it properly.
svn path=/trunk/gtk-sharp/; revision=111173
Patch from Christian Hoff with a few minor tweaks.
* generator/CallbackGen.cs: refactor to use ManagedCallString
and drop a ton of redundant, half-baked code.
* generator/ManagedCallString.cs: add Unconditional setup
method for stuff that has to happen before the try block.
Add "drop_first" concept so it can be reused by CallbackGen
which doesn't drop first params.
* generator/Signal.cs: use Unconditional method for prep.
* generator/VirtualMethod.cs: use Unconditional method for prep.
* gtk/Gtk.metadata: mark a ref param. [Fixes#394352]
svn path=/trunk/gtk-sharp/; revision=107494
* gtk/Gtk.metadata: mark ListStore.Reorder array param.
* gtk/ListStore.cs: compat obsolete method, though the old one
was useless.
svn path=/trunk/gtk-sharp/; revision=106853
* gtk/Object.custom: move Dispose call to a vm override so that
it runs after all signals and native overrides have run.
* gtk/glue/object.c: destroy override implementation.
svn path=/trunk/gtk-sharp/; revision=104315
* gtk/Object.custom: If all destroy handlers have been
unregistered, remove the hashtable entry since it is
not needed anymore.
svn path=/trunk/gtk-sharp/; revision=104287
* gtk/Widget.custom: guard against MissingIntPtrCtorException in
the Activate and SetScrollAdjustments funky signal VM impl. Can't
use SignalClosure easily. Could be reworked more cleanly at some
point. Or not.
svn path=/trunk/gtk-sharp/; revision=103827
* kill the makefile.win32 build system. it has been unmaintained
for quite some time, replaced by the auto* build in cygwin.
svn path=/trunk/gtk-sharp/; revision=103308
* atk/atk-api-2.12.raw: reparsed.
* gdk/gdk-api-2.12.raw: reparsed.
* gtk/gtk-api-2.12.raw: reparsed.
* parser/gapi2xml.pl: fixes for signal and vm order needed for
proper interface struct layout. [Fixes#386802]
svn path=/trunk/gtk-sharp/; revision=102848
* generator/GenerationInfo.cs: refactor glue writer implementation
so that GlueEnabled means there is a valid glue writer available.
Avoids crashes in scenarios where an unwriteable glue path is provided
to the generator. Generate a glue function which scans the type
hierarchy of an object for the most-derived unmanaged ancestor so
that we can invoke class methods on it, avoiding infinite recursions.
* generator/Signal.cs: revamp the default handler vm overriding
mechanism. When class fields exist which can be directly hooked into,
we now generate glue to override and chain up to unmanaged base funcs.
This avoids some strangeness in the g_signal_override_class_closure
and g_signal_chain_from_overridden reported in #332300 and also lays
the groundwork for automated generation of non-signal VMs.
* gtk/Gtk.metadata: block signal glue generation for a few types which
don't seem to install headers.
svn path=/trunk/gtk-sharp/; revision=102350
* parser/gapi2xml.pl: put class struct field in the signal elems.
* atk/atk-api-2.12.raw:
* gdk/gdk-api-2.12.raw:
* gtk/gtk-api-2.12.raw:
svn path=/trunk/gtk-sharp/; revision=102238
* glib/ToggleRef.cs: Add a Harden method to switch to a standard
ref and just leak it.
* gtk/Application.cs: revert the QuitPrepare stuff since it didn't
always work.
svn path=/trunk/gtk-sharp/; revision=101021
* gtk/TreeModelAdapter.custom:
* gtk/TreeModelFilter.custom:
* gtk/TreeModelSort.custom: reworked patch from Christian Hoff to
throw NotImplementedException for SetValue methods. Those should
never have been added to the interface, and it's better to throw
an exception than have infinite recursion kill the program.
[Fixes#379542]
svn path=/trunk/gtk-sharp/; revision=100996
* gtk/Gtk.metadata: hide PrintContext.get_CairoContext.
* gtk/PrintContext.custom: manual get_cairo_context implementation.
Mono.Cairo assumes it is wrapping owned references, so we need to
take a ref out on the returned cairo_t pointer.
* sample/GtkDemo/DemoPrinting.cs: dispose the CairoContext in
to be a good citizen and avoid warnings.
svn path=/trunk/gtk-sharp/; revision=100942
* glib/Global.cs: renamed from Program.cs. Program.Name is now
Global.ProgramName to try to avoid clashes with existing Gnome.Program
usage.
* gtk/Application.cs: s/GLib.Program.Name/GLib.Global.ProgramName.
svn path=/trunk/gtk-sharp/; revision=99875
the code to call g_set_prgname() from gtk/Application.cs to here,
and changing return value of g_set_program_name from bool to void.
* gtk/Application.cs: Use Program.Name as a replacement of
calling the native function g_set_prgname().
* glib/Makefile.am: add Program.cs.
(Patch reviewed by mkestner)
svn path=/trunk/gtk-sharp/; revision=99134
* glib/DestroyNotify.cs: add CDeclCallback to the delegate.
* glib/Signal.cs: use DestroyHelper.
* gdk/Input.custom: use DestroyHelper.
* gtk/Quit.custom: remove new on DestroyHelper handler.
* gtk/TreeModelFilter.custom: remove new on DestroyHelper handler.
* gtk/TreeViewColumn.custom: remove new on DestroyHelper handler.
svn path=/trunk/gtk-sharp/; revision=86897
* generator/*.cs: implement the interfaces on the adapters too.
Generate an Implementor interface for users which exposes the
methods to implement. Register based on the Implementor sub-iface.
* gtk/*Adapter.custom: custom implementations for the custom
interface members.
* gtk/TreeIter.custom: make UserData public.
* sample/TreeModelDemo.cs: sample for implementing a TreeModel
interface.
svn path=/trunk/gtk-sharp/; revision=86753
* 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
* gtk/Object.custom (Destroy): add a null check to avoid
Gtk criticals. The destroy case seems to be problematic with
a bunch of existing code, so this turns it into a noop.
svn path=/trunk/gtk-sharp/; revision=85657
* 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
* 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
* gtk/gtk-api-2.10.raw : refresh.
* parser/gapi_pp.pl : combine lines that end in '\' before sending
them through the pattern matching. [Fixes#79214]
svn path=/trunk/gtk-sharp/; revision=82359