Commit graph

4158 commits

Author SHA1 Message Date
lytico 9bec86e406
Merge pull request #228 from lytico/lytico/issues/226
add test for https://github.com/GtkSharp/GtkSharp/issues/226
2021-03-18 19:07:50 +01:00
lytico c4da085925 add test for https://github.com/GtkSharp/GtkSharp/issues/226 2021-03-18 19:01:48 +01:00
Harry 7f5e81cf47
Bump up dependencies (#221) 2021-03-07 12:31:19 +01:00
Harry e512b6da64
Merge pull request #220 from GtkSharp/revert-203-patch-1
Revert "Don't add reference to PixbufHandle"
2021-02-27 16:22:26 +01:00
Harry 92752a2bf6 Revert "Don't add reference to PixbufHandle"
This reverts commit b831ee8ca1.
2021-02-27 16:16:10 +01:00
Harry 402c57ae5a
Merge pull request #214 from GSharpKit/develop_pr_210125
Disposing of Widgets and Signals
2021-02-25 12:35:28 +01:00
zii-dmg d3687a9370 Support style properties
Added support for style properties and marked some style properties in GtkSharp.metadata.
2021-02-06 20:27:25 +03:00
Mads Kruse Johnsen 0daa985316 Add method GetRawOwnedObject to Builder.
This method performs a GetRawObject, but also increases the refcount.

This is (at least) needed in cases where you wish to have a class inherting a widget,
and use a builder in the constructor : base (builder.GetRawObject("name"))
Because no ref is taken the eventual freeing of the builder will cause the our object (this)
to have a refcount 0.
This is an issue since the freeing of our ToggleRef (which should happen later) performs an unref.
2021-01-25 12:29:04 +01:00
Mads Kruse Johnsen 41d6f0bf28 Queue freeing of GCHandles instead of freeing them immidiately 2021-01-25 11:07:39 +01:00
Mads Kruse Johnsen 06b88bdbc5 Queue freeing of signals on the main-thread instead of on the Finalizer thread. 2021-01-25 11:07:39 +01:00
Mads Kruse Johnsen 470ce6cff7 Invoke Destroy in Dispose if the Widget IsToplevel and it is not already destroyed
If the Widget is a toplevel then we have not ref'ed the Object, so ref before destroying it, and let the freeing of the ToggleRef undo the ref.
2021-01-25 11:07:39 +01:00
Mads Kruse Johnsen c3364fd338 Fix MessageDialog effectively creating an additional Dialog due to wrong base call 2021-01-25 11:07:39 +01:00
Mads Kruse Johnsen 7fb112727a Prevent double removal of timeout sources
See https://github.com/GLibSharp/GtkSharp/pull/49
2021-01-25 11:07:39 +01:00
Midhun Mohan cd47acba85 Cleanup of sourceproxy Dictionary and its usages 2021-01-24 19:55:17 +01:00
Midhun Mohan 6af04a1058 Changing timeout_add and idle_add to _full. 2021-01-24 19:55:17 +01:00
Sebastian Dröge 89cfd16c10 Ensure to sink floating references passed unowned to GetObject() and to not increase their reference count
The API contract between GObject-Introspection and bindings is that
functions returning transfer-none floating references pass a reference
to the bindings that should be taken ownership of by sinking it. Not
doing so is wrong and will lead to memory leaks or double frees.

Previously we would not distinguish this case and simply increment the
reference count. In addition we would then sink the floating reference
when the Object.Raw field is set later for InitiallyUnowned subclasses.

Remove that last part and instead check directly in Object.Raw.set if we
get a floating reference and if so simply sink it here and take
ownership of it. The general assumption of Object.Raw.set is that it
gets passed a reference that it should take ownership of.

So in summary:
1) GetObject() would only increase the reference count of unowned,
   non-floating references so that we own it. For unowned, floating
   references it assumes ownership of the reference.
2) Raw.set assumes ownership of the reference passed to it and if it
   happens to be a floating reference then it will first sink it.

Also warn if we get a floating, owned reference passed to GetObject() as
that case is not allowed by GObject-Introspection and would cause the
reference to be leaked.

This fixes a memory leak with functions returning unowned, floating
references and with functions returning owned, non-floating references
of InitiallyUnowned subclasses. And at the same time keeps constructors
for InitiallyUnowned subclasses working correctly without leaks.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-sharp/issues/31
2021-01-24 19:55:17 +01:00
Sebastian Dröge 5b63473a1c Use correct GType for GLib.InitiallyUnowned
It's not the same type as GLib.Object but a subclass thereof.
2021-01-24 19:55:17 +01:00
Thibault Saunier 1b9fe6a8ed Revert "Attempt minimal changes to obtain proper disposing."
This reverts commit 2e1882d31e.
2021-01-24 19:55:17 +01:00
Thibault Saunier d0bb5efa3a generator: Trim type "const " the same way as "const-" as both are valid 2021-01-24 19:55:17 +01:00
Olivier Crête a7d3e85829 ValueArray: Create copy when receiving pointer
The "ref" operation of GValueArray is a copy, so we don't have a
choice.
2021-01-24 19:55:17 +01:00
Thibault Saunier 9002cefe44 generator: Add a way to force constructors to be names
In some cases (GstEvent) unnamed constructors make no sense
2021-01-24 19:55:17 +01:00
Thibault Saunier dd8f3f994e glib: Handle GValue containing GType 2021-01-24 19:55:17 +01:00
Thibault Saunier 57ea279ceb generator: Fix accessing EqualityName for GArray*s 2021-01-24 19:55:17 +01:00
Thibault Saunier 939111a348 Do not check padding ABI offset correctness
As it will break the test build as soon as the padding
starts actually being used.
2021-01-24 19:55:17 +01:00
Justin Kim c980ef4f90 Object: Fix string leakages 2021-01-24 19:55:17 +01:00
Cameron White 7d5190865e Add a simple demo for using Gdk.Seat to query the mouse position. 2021-01-08 22:47:47 +01:00
Cameron White 216cfd941e Set the correct parent class for Gdk.SeatDefault
This fixes issues with using the Gdk.Seat value returned by  `gdk_display_get_default_seat()`.

Fixes: #131
2021-01-08 22:47:47 +01:00
lytico a0f6a044d7
Merge pull request #208 from lytico/lytico_fix_MonoDevelop_Addin
MonoDevelop.GtkSharp.Addin.csproj: make CI happy
2021-01-08 22:05:30 +01:00
lytico 0c78c9e349 MonoDevelop.GtkSharp.Addin.csproj: adjust TargetFramework to net471 & adjust MonoDevelop.Addins to version 0.4.7 2021-01-08 21:45:28 +01:00
lytico cb1bdfae06 GtkScrollable: GetBorder border as out param 2020-12-08 10:09:05 +01:00
zii-dmg 66d46cbacb Manually marshal UTF-8 dialog title 2020-12-08 10:07:43 +01:00
Curtis Wensley b831ee8ca1 Don't add reference to PixbufHandle
Fixes #186
2020-12-08 10:06:26 +01:00
zii-dmg 7dbde29178 Fixed Container.ChildGetProperty
Properly marshal `gtk_container_class_find_child_property` with return type of pointer instead of struct. When marshal pointer to struct manually.
2020-10-08 15:58:20 +02:00
Harry bc3a55f71b
Merge pull request #187 from cameronwhite/fix-pango-crash
Fix crash when accessing Pango.FontFamily.Faces
2020-08-28 17:35:50 +02:00
Cameron White ca7ed79e77
Fix crash when accessing Pango.FontFamily.Faces
This is similar to the fix for FontFamily in #35, and adds metadata for the parent class.
Without this, I found that the conversion to GObject failed in GLib.Object.GetObject and the pointer was deleted, corrupting memory for the next call.

Fixes: #159
2020-08-27 20:38:56 -04:00
Harry cc3d359b33
Don't sign GtkSourceSharp and fix naming 2020-08-07 13:40:50 +02:00
Harry a761ddea85
Merge pull request #184 from GtkSharp/revert-139-sign
Revert "Sign the DLL files"
2020-08-07 13:31:04 +02:00
Harry 724df41249
Revert "Sign the DLL files" 2020-08-07 13:30:09 +02:00
Harry 92c2332bcf
Merge pull request #183 from cameronwhite/pixbuf-from-surface-lib
Fix runtime errors when calling the Gdk.Pixbuf constructors that take Gdk.Window or Cairo.Surface
2020-08-04 09:23:06 +02:00
Cameron White 90379c40c8 gdk_pixbuf_get_from_surface() is in libgdk, not libgdk_pixbuf
This needs to be explicitly specified since 3a67da38 relocated these methods into Gdk.Pixbuf, which is underneath an element that specified `library="Library.GdkPixbuf"`

This fixes runtime errors when calling this method (similar for gdk_pixbuf_get_from_window)
2020-08-03 20:28:02 -04:00
Harry efb8335e87
[README] Add GtkSourceSharp 2020-08-03 21:41:02 +02:00
Harry 3cac71dded
Bump Gtk dependency to 3.24.20 2020-08-03 21:06:15 +02:00
harry-cpp be0a863b50
Rename SourceView > GtkSourceSharp 2020-07-22 19:32:38 +02:00
Harry 759d62966a
Merge pull request #173 from hol430/sourceview
Added sourceview bindings
2020-07-22 19:05:40 +02:00
Harry cb38e52242
Merge pull request #179 from hol430/filechoosernative
Fixed FileChooserNative
2020-07-22 19:04:56 +02:00
harry-cpp 0b07ea0c52
Finishing touches 2020-07-22 18:49:13 +02:00
Drew Holzworth ce11581485
Fixed FileChooserNative (I hope)
Changed NativeDialog to inherit from GLib.Object, as it does in the C API.

FileChooserNative seems to inherit multiple base classes in the C API,
which isn't possible in C#, but this solution is to mimic multiple
inheritance via a proxy FileChooserAdapter.
2020-07-22 09:49:47 +10:00
Harry 42956bfc3e
Merge pull request #176 from cameronwhite/pixbuf-from-surface
Add Gdk.Pixbuf constructors for a source Gdk.Window or Cairo.Surface.
2020-07-21 23:04:47 +02:00
Harry dcd05c43e4
Merge pull request #175 from cameronwhite/cairo-path-extents
Implement Cairo.Context.PathExtents()
2020-07-21 23:03:27 +02:00
Cameron White 3a67da38aa Add Gdk.Pixbuf constructors for a source Gdk.Window or Cairo.Surface.
This exposes gdk_pixbuf_get_from_window and gdk_pixbuf_get_from_surface via Gdk.Pixbuf constructors. Previously they were in a hidden GdkPixbuf_ class.

Fixes: #174
2020-07-15 22:35:34 -04:00