Commit graph

4084 commits

Author SHA1 Message Date
Andrii Kurdiumov 238b98b631 Make Marshal.SizeOf AOT friendly
See https://github.com/dotnet/corert/issues/5374#issuecomment-455706335
Current state in NativeAOT experiment is the same.
2021-06-13 22:24:09 +06:00
lytico f77efced1a
Merge pull request #259 from zii-dmg/PangoApis
Added/fixed some Pango APIs
2021-06-07 17:23:08 +02:00
dmg 4c80c5fc42 Added/fixed some Pango APIs
* Added pango_layout_get_direction
* Added pango_layout_get_line_spacing / pango_layout_set_line_spacing
* Added pango_layout_line_get_height
* Added return type to pango_itemize_with_base_dir
* Fixed pango_layout_line_get_x_ranges
* Fixed pango_layout_get_log_attrs / pango_layout_get_log_attrs_readonly (using only readonly version because we make copy anyway, added LogAttr bitfield reading properties)
2021-06-02 22:33:03 +03:00
zii-dmg 317440bafe
Add Cairo.Surface.DeviceScale property (#251) 2021-05-25 11:55:01 +02:00
zii-dmg 4e4cc157b7
Fix IScrollableImplementor.GetBorder out param (#255)
IScrollableImplementor.GetBorder was not generated with out param as in IScrollable.
2021-05-25 11:54:02 +02:00
lytico 7b196865b0
Merge pull request #253 from zii-dmg/IdleAddPriorityFix
GLib.Idle.Add: use expected default priority, add priority overload
2021-05-19 20:31:42 +02:00
dmg d34958e871 GLib.Idle.Add: use expected default priority, add priority overload 2021-05-18 23:49:59 +03:00
lytico 6a0e721132
Merge pull request #250 from zii-dmg/FixPixBufAnimationLeak
Fix PixBufAnimation ctors leak

@zii-dmg  thanks!
2021-05-16 18:14:22 +02:00
dmg 0461f7411c Fix PixBufAnimation ctors leak
Taken from PixBuf ctors.
2021-05-16 13:45:04 +03:00
zii-dmg aa1095a02d
Use embedded resources in CssProvider.LoadFromResource (#238) 2021-04-22 16:50:39 +02:00
Drew Holzworth c81830ad50 Fix some mistakes in GtkSourceSearchContext wrapper
The match_start and match_end arguments in the searching functions of
GtkSourceSearchContext are out parameters.
2021-04-10 16:34:42 +02:00
dmg f86752770b Fixed more metadata
Added element types, callback scopes.
Removed invalid rules (fewer "no matched nodes" messages in log).
Removed garbage property in GtkSharp-api.xml.
2021-04-10 16:34:19 +02:00
dmg 43bcf0ace0 Extend XSD schema
Added some elements that is supported in GapiCodegen to reduce number of validation errors in build log.
2021-04-03 22:17:58 +02:00
Harry 7995f132e1
Bump required nuget in templates 2021-04-02 19:24:05 +02:00
dmg 94ea7051f9 GException improvements with multithreading
Read all GError fields in GException constructor and free GError memory.

Quote from gtksharp2 fix: The original impl did not take into account exceptions marshalling across thread boundaries so it could end up with the error being accessed after being disposed.
2021-04-02 18:40:51 +02:00
Harry bfcf29b070
[GtkSource] Add array information to Language classes 2021-04-02 18:39:28 +02:00
zii-dmg 8ac2892938
TreePath improvements (#235)
* TreePath(int[]) constructor is now using one API call instead of many.
* Indices property is now using one API call instead of two.
2021-04-01 12:38:54 +02:00
lytico 2e7297b22e
Merge pull request #234 from zii-dmg/PixbufWin
Pixbuf Windows fixes (utf8 suffix)
2021-03-30 02:49:27 +02:00
dmg ba97d6bff5 Pixbuf Windows fixes (utf8 suffix)
Some Pixbuf, PixbufAnimation functions on Windows is exported with "_utf8" suffix.
I hid generated versions, copied and modified code to use "_utf8" on Windows.
Also hid "gdk_pixbuf_new_from_resource*", "gdk_pixbuf_animation_new_from_resource" because they are using GResources and we already have constructors for .NET resources.
2021-03-29 23:54:06 +03:00
Sergii Fesenko 9be7e092a8
Signal.Handler: correct flag check (#233) 2021-03-27 19:11:59 +01:00
dmg a23d44fb82 Fixed some more APIs according to GTK docs 2021-03-24 10:28:10 +01:00
Harry 354c8e8cf7
Ups, GetRawOwnedObject already returns an IntPtr 2021-03-19 19:32:33 +01:00
Harry 24f3d17d5c
Update README.md 2021-03-19 18:18:08 +01:00
Harry 6045b816db
Update templates to use GetRawOwnedObject 2021-03-19 18:16:08 +01:00
dmg cd0468edc8 Fixed some APIs according to GTK docs 2021-03-19 18:04:58 +01:00
lytico 010116ef0d
Merge pull request #229 from lytico/lytico/issues/226
PixbufSection.cs: ajdust writetestfile to work on windows
2021-03-18 21:05:44 +01:00
lytico b6b2183954 PixbufSection.cs: ajdust writetestfile to work on windows 2021-03-18 21:04:37 +01:00
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
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