Skip to content

0.6.2

Latest
Compare
Choose a tag to compare
@badcel badcel released this 09 Feb 13:46
2398542

This is a follow up release to preview.1. Please be aware that this release includes several breaking changes.

The release 0.6.0 / 0.6.1 were skipped as there were problems with the publishing of the nugets:

  • For 0.6.0 the new GObject-2.0.Integration package had an empty symbol package which resulted in an upload error.
  • For 0.6.1 there were nuget packages created for the tutorial projects which were missing nuget informations thus resulting in an upload error.

The partially uploaded packages got unlisted. This is the reason why this release has the version number 0.6.2.

Notworthy

Since 0.6.0-preview.1

  • Support for .NET 9.0 added. Support for .NET 6.0 and .NET 7.0 got removed.
  • Rework of the GObject.Object instantiation process. Those changes remove the reflection code for object instantiation and subclassing. This brings NativeAOT support a lot closer.
  • Internal: Support individual SafeHandles for classes allowing to report native memory consumption. This improves the garbage collection behavior of the dotnet runtime as classes like Gdk.Pixbuf tend to reference large portions of native memory.

0.6.0-preview.1

  • Update to GNOME 47 which includes GTK 4.16 and libadwaita 1.6.
  • The dummy implementation of INotifyPropertyChanged on GObject.Object was removed.
  • Propertydefinitions have a new Notify / Unnotifymethod which simplifies registration for property specific notifications. For details see the FAQ.
  • The size of the C long datatype on windows is now always 32 bit. On unix it corresponds to 64 / 32 bit depending on the system architecture. In earlier releases it was always 64 bit which was only correct for 64 bit unix systems.
  • The size of C gsize is now equivalent to nint. In earlier releases it was equal to long which was wrong on 32 bit based systems.
  • Fixed implementation of the memory pressure feature of records. In earlier releases memory pressure was only removed if Dispose was called. Now memory pressure is released automatically for records. The feature is not yet implemented for classes and will be part the full 0.6.0 release.
  • First steps to publish the GirCore generator as a dotnet tool.

Breaking changes

Changed public APIs

  • Obsolete interface GLib.IHandle got removed
  • Obsolete interface GObject.IObject got removed
  • GObject.Object new primary constructor requires a ObjectHandle. protected constructors using ConstructArgument[] or IntPtr got removed.
  • GObject.Object method protected virtual void Initialize() got removed. To execute instance initialization either use a custom constructor or custom ObjectHandle.
  • GdkPixbuf.PixbufLoader.FromBytes got removed as it was a purely cosmetic helper function which is not available as native code. The following code shows the corresponding code to recreate the original behavior:
using var bytes = Bytes.New(data);
var pixbufLoader = PixbufLoader.New();
pixbufLoader.WriteBytes(bytes);
pixbufLoader.Close();

var pixbuf = pixbufLoader.GetPixbuf()  ?? throw new Exception("No pixbuf loaded");

Subclass changes

To implement reflection free instantiation and subclassing the data which the reflection based code retrieved during runtime must be available during compile time to register the class with the GObject typesystem. This is done automatically for all classes which are part of the GirCore nuget packages. If custom classes inherit from some GObject.Object this code must be written otherwise the new class is not properly registered with the GObject typesystem.

The boiler plate code needed to properly register a class can be completly avoided if the new nuget package GObject-2.0.Integration is used. This package provides a source generator which generates the needed code if the SubclassAttribute is set on the custom GObject subclass. Please see the following sample and refer to the FAQ:

[Subclass<GObject.Object>]
public partial class Data
{
    public string? MyString { get; set; }

    public Data(string myString) : this()
    {
        MyString = myString;
    }
}

What's Changed

New Contributors

Full Changelog: 0.5.0...0.6.2