Commit Graph

682 Commits

Author SHA1 Message Date
Mike Kestner
8a0d28372c Merge pull request #31 from bl8/cairo-fixes
Cairo fixes
2012-03-28 20:04:06 -07:00
Bertrand Lorentz
a804895ce6 Add fix-ups so that missing properties are generated
A few properties would not be generated, as a property with the same
name already exists in the Widget class. To resolve this, we mark the
corresponding accessors as new.
2011-12-10 14:53:47 +01:00
Bertrand Lorentz
d9bef0d869 gtk: Fix creation of ComboBox and ComboBoxText subclasses with entry
When creating a subclass of ComboBox with an entry, the has-entry
property was not initialized, leading to a crash when trying to access
the entry.

For subclasses of ComboBoxText, two other properties were not
initialized, leading to Gtk-CRITICAL error messages.
2011-12-05 19:14:05 +01:00
Bertrand Lorentz
21bfaa7a9d gtk: Mark the Cairo.Context in Widget.Drawn as owned
We shouldn't increase the reference count on the native cairo context
when we get it as a signal parameter, so we mark it as owned.
2011-12-04 22:39:52 +01:00
Bertrand Lorentz
7c61e2bdc0 Remove custom code for PrintContext.CairoContext
As Cairo.Context is now marked as an ownable, the accessor generated
for PrintContext.CairoContext will be equivalent to what was in the
custom code.
2011-12-04 22:39:52 +01:00
Mike Kestner
aae2b05300 Implement IEquatable<T> on structs.
* gdk/Gdk.metadata: suppress Color.GetHashCode().
* gdk/Point.custom: remove generated methods.
* generator/StructBase.cs: Generate Equals(T), Equals(object), and GetHashCode.
* generator/StructField.cs: helper property for equality testing.
* gtk/TreeIter.custom: remove generated methods.
2011-10-07 21:55:26 -05:00
Olivier Dufour
b14746d856 Fix build of gtk# by avoiding colision introduced with properties for ginterface 2011-08-02 19:27:22 +02:00
Olivier Dufour
f0579eb53d parser: Add property support for ginterface 2011-08-01 21:18:02 +02:00
Mike Kestner
fe776b3a48 Merge pull request #21 from bl8/gtk-settings-props
Gtk.Settings: Add all properties as a fixup
2011-08-01 07:45:00 -07:00
Bertrand Lorentz
ecc2fa29fa Gtk.Settings: Add all properties as a fixup
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.
2011-07-31 15:29:48 +02:00
Bertrand Lorentz
63db97e9ad parser: Handle the G_DEFINE_TYPE_EXTENDED macro
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.
2011-07-31 12:32:43 +02:00
Mike Kestner
da1481b23d Mark Widget::draw as manually marshaled
* gtk/Gtk.metadata: Widget draw signal has a cairo_t param that is
    problematic to marshal as a GLib.Value.  Manually marshal it.
2011-07-28 17:16:28 -05:00
Mike Kestner
1a0ecbb111 Add gio-sharp dep to gtk-sharp pc file 2011-07-18 12:44:44 -05:00
Bertrand Lorentz
b0768d35f6 gtk: Include ComboBoxText.cs in the build
Also add missing using statement.
2011-07-16 18:18:14 +02:00
Bertrand Lorentz
9463e98ca2 gtk: move ComboBoxText custom code to a partial class
Also rename the constructor parameter to has_entry and pass its value to
CreateNativeObject.
2011-07-16 17:53:21 +02:00
Bertrand Lorentz
bef589e836 gtk: Facilitate use of ComboBox and ComboBoxText with an Entry
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.
2011-07-16 15:45:30 +02:00
Bertrand Lorentz
a529ca3a94 Temporary quick fix for properties in interfaces without accessors
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.
2011-07-08 20:12:07 +02:00
Bertrand Lorentz
139191f537 Fix naming collisions created by the interface parsing fix
The previous commit added several new signals in Gio.ActionGroup and
Gtk.GtkCellEditable that collide with method names. Do some rename
to fix this.
2011-07-08 20:12:07 +02:00
Bertrand Lorentz
ad74c64345 parser: Fix handling of initialization functions for interfaces
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.
2011-07-08 20:12:07 +02:00
Mike Kestner
59e38f55dc Merge pull request #10 from bl8/various-fixes
Various build fixes, fixups and clean ups
2011-07-04 10:17:52 -07:00
Bertrand Lorentz
e108bf59d4 gtk: Re-enable NodeView.CreateRowDragIcon method 2011-07-03 16:44:15 +02:00
Bertrand Lorentz
23a0aa7af2 gtk: Fix crash in CellRenderer.OnGetSize callback
Handle the case when the native cell_area is not set.
2011-07-03 13:32:35 +02:00
Bertrand Lorentz
a85ebc481f Remove opaque attr from Gtk.Border and fixup some StyleContext methods 2011-07-03 13:32:35 +02:00
Mike Kestner
ebc40cd400 Merge pull request #8 from bl8/update-samples
Update most remaining samples to the new APIs
2011-06-29 17:53:03 -07:00
Mike Kestner
094e6ce29d Merge pull request #7 from bl8/fix-warnings
Various fixes for warnings during codegen, compilation and in the samples
2011-06-29 17:49:37 -07:00
Bertrand Lorentz
5568a568a7 Have Dialog.ActionArea return a ButtonBox instead of a HButtonBox
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.
2011-06-19 12:26:33 +02:00
Bertrand Lorentz
ef74b70ce6 Various return-type fix-ups in Gtk.metadata
Add element_type and ownership information for the return type of
various methods.
2011-06-12 22:15:51 +02:00
Bertrand Lorentz
6556eeb610 Implement GetHashCode() in TreePath.custom
This fixes a warning about GetHashCode() not being implement while
Equals is.
2011-06-12 20:25:16 +02:00
Bertrand Lorentz
64a0c81868 Remove incorrect new keyword for CheckMenuItem.Toggle() 2011-06-12 20:23:48 +02:00
Bertrand Lorentz
680dd23965 Handle floating refs in InitiallyUnowned
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.
2011-06-11 19:08:21 +02:00
Mike Kestner
f3c7384701 Widget.GetPreferredSize out params
* gtk/Gtk.metadata: out params on Widget.SetPreferredSize
2011-06-05 20:33:18 -05:00
Mike Kestner
c6a3bf4b73 Fix TextBufferSerializeFunc signature
* 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.
2011-04-28 18:38:07 -05:00
Mike Kestner
07cd515482 mark Render.IconPixbuf retval owned.
* gtk/Gtk.metadata: gtk_render_icon_pixbuf transfers ownership of the
     returned pixbuf so mark it owned.
2011-04-26 08:11:59 -05:00
Mike Kestner
9a2fd72001 Add cairo-sharp.dll to the pkgconfig file
* gtk/gtk-sharp-3.0.pc.in: add cairo-sharp.dll to libs
2011-04-21 18:00:09 -05:00
Mike Kestner
ca6bf1df51 Kill dead Input.custom file
* gtk/Input.custom: dead file, remove
* gtk/Makefile.am: remove custom
2011-04-21 12:59:46 -05:00
Mike Kestner
0d315af7a6 Add the gtk_render_* methods to StyleContext
* 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.
2011-04-21 12:10:36 -05:00
Mike Kestner
9e5e8e5491 StyleContenxt and GdkRGBA property cleanup
* 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.
2011-04-21 10:49:39 -05:00
Mike Kestner
567e3c81e0 struct padding member regex fix
* gtk/gtk-api.raw: reparse
* parser/gapi2xml.pl: match padding_n for padding members too to catch
   GtkSwitch padding vm slots.
2011-04-20 17:32:55 -05:00
Mike Kestner
256a80399c Obsolete and fwd Widget.GdkWindow property.
* gtk/Widget.custom: mark GdkWindow obsolete and forward it to the
    Window property which is read/write in 3.0. [Fixes #688791]
2011-04-20 10:11:03 -05:00
Mike Kestner
e79c46cdcb Cleanup remaining fixup mismatches in Gtk.
* gtk/Gtk.metadata: remove dead rules
2011-04-20 10:09:56 -05:00
Mike Kestner
173c185bc5 Move new ShowUri API to partial class.
* gtk/gtk/Global.cs: partial class changes. moved from Global.custom.
* gtk/Makefile.am: add new file
2011-04-18 11:49:17 -05:00
Andrés G. Aragoneses
fe769d0360 Gtk: New Global.custom file to bring some overloads from Hyena
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.
2011-04-18 11:37:56 -05:00
Mike Kestner
713f7ae892 Remove some dead metadata rules.
* gtk/Gtk.metadata: remove mismatched rules from prior release
2011-04-18 10:14:15 -05:00
Mike Kestner
880c332174 Remove opaque attr from Gtk.Requisition
* gtk/Gtk.metadata: set opaque=false for GtkRequisition.
2011-04-15 13:40:24 -05:00
Andrés G. Aragoneses
3ee97db664 Gtk: Set param as "out" for Widget.GetRequisition in metadata.
This way it will be converted to a property as it was in Gtk# < 3.0
Fixes bug http://bugzilla.novell.com/687823.
2011-04-15 12:54:57 +02:00
Andrés G. Aragoneses
ae67076d76 Gtk: Set param as "out" for StyleContext.GetBackgroundColor.
Fixes bug http://bugzilla.novell.com/687551
2011-04-15 12:17:57 +02:00
Mike Kestner
1c980d6e71 Switch GLib.Object to Dispose(bool) pattern.
* 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)
2011-03-25 12:22:04 -05:00
Mike Kestner
6be0718ff2 Simplified Signal handling
* 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
2011-03-24 18:33:24 -05:00
Mike Kestner
3ed7e0901e Update to Gtk+ 3.0.0 API.
* configure.ac: require gtk+-3.0.0 and glib-2.28.0
* gdk/gdk-api.raw: reparse
* gdk/gdk-symbols.xml: add alias for Window (XID) to gulong
* gtk/Plug.custom: update custom ctors to ulong XID versions.
* gtk/gtk-api.raw: reparse
* gtk/gtk-sharp.dll.config.in: change dllname remap to match 3.0.0 so.
* sources/.gitignore: fix glib and gtk+ dirs
* sources/Makefile.am: update to gtk+ 3.0.0
* sources/sources.xml: update to gtk+ 3.0.0
2011-02-12 15:30:20 -06:00
Mike Kestner
cc32e0ef71 Fix TreeViewDemo build
* 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.
2011-02-09 18:23:18 -06:00