Skip to content

Releases: gircore/gir.core

0.9.0-preview.1

0.9.0-preview.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 15 Sep 14:32
ccfc283

This release is the first preview of the upcoming 0.9.0 release. To get an overview of the planned features of the 0.9.0 release please see the corresponding milestone.

Noteworthy

  • Fix: Support nullable return values for instance factories (#1602)
  • Feature: Improved exception integration allows to filter for gobject error-domains (documentation, #1596)

What's Changed

New Contributors

Full Changelog: 0.8.1...0.9.0-preview.1

0.8.1

Choose a tag to compare

@github-actions github-actions released this 12 Jul 17:13
abde56f

This is the first bugfix release for the GirCore 0.8 releases.

Note

It is recommended to update to this release as it fixes a bug that could create obsolete object instances during instance creation in case of custom subclasses inheriting from another custom subclass.

Noteworthy

  • Feature: New cairo API to read / write PNG files (#1554).
  • Fix: Source generators now support multiple classes with the same name if they are located in different namespaces (#1545).
  • Fix: Source generators now support abstract subclasses (#1555).
  • Fix: Subclass initialization does not create obsolete instances anymore (#1552)

What's Changed

New Contributors

Full Changelog: 0.8.0...0.8.1

0.8.0

Choose a tag to compare

@github-actions github-actions released this 25 Jun 17:39
41bd0a6

This is the first non-preview release of 0.8.0 which introduces GTK composite template support, GNOME 50 support (inlcuding GTK 4.22 and libadwaita 1.9) and under the hood fixes for several runtime errors.

Please be aware that there are resulting breaking changes:

Please continue reading to get an overview of all relevant changes and a description of the breaking changes and the newly introduced GTK composite template support.

Noteworthy

Since 0.8.0-preview.1

  • Fix: Construct properties don't produce a runtime error anymore (#1489)
  • Fix: GObject.Value now supports extracting arrays (#1490)
  • Fix: Improved internal rendering of arrays (#1515)
  • Fix: In case of a race condition between GObject and the dotnet garbage collector the application will not crash anymore but a detailed warning will be logged (#1536)
  • Feature: Updated to GNOME 50 APIs (#1527)
  • Feature: Gio.ListStore.New<T> method to allow a more idiomatic instantiation (#1495)
  • Feature: It is now possible to register a custom DLL import resolver to connect GirCore to arbitrary binaries (Module.SetCustomDllImportResolver). Please be aware that this API is marked as Experimental and should be avoided in favor of a custom GirCore build (#1501)
  • Feature: New template loader for GResource (#1510)
  • Feature: Handler of GLib.UnhandledException.SetHandler will be triggered for regular callbacks (#1529)

0.8.0-preview.1

  • Feature: Composite template support, details below (#1405, #1395, #1425, #1419, #1442, #1437, #1455, #1466)
  • Feature: New GdkWayland-4.0 nuget packages (#1423)
  • Feature: out / ref enums are now supported (#1459)
  • Feature: out opaque typed records are now supported (#1463)
  • Sample: New dropdown sample (#1428)
  • Sample: New async-UI sample (#1461)

Breaking changes

This release includes GTK composite support which is a major milestone for the GirCore project. To reach this goal there were some breaking changes necessary. Those mainly affect the usage of Gtk.Builder, the creation of subclasses and to a lesser extent the creation of native classes. In total those changes are a first step to allow deeper integration with the GObject type system.

The API was held as backwards compatible as possible. Warnings are raised for APIs which will be removed in a later release (0.9.0). Please read ahead carefully to get an overview of the breaking changes and how to resolve them.

The following sections describe the breaking changes and how to solve them. A more detailed explanation why the breaking changes are necessary can be found in the explanation of the diagnostic message 1007. Issue 1441 describes the available feature set between versions.

Instance creation

Since the beginning of GirCore constructors of GObjects were rendered as static factory methods. There is one exception: It is possible to create instances with a parameterless constructor or an array of ConstructArgument. As GObject itself expects all objects to be creatable without a parameterized class specific constructor this public constructor will be marked as obsolete and a new factory method will be rendered as an alternative. This means the API is not yet removed but its usage is discouraged as the deeper integration with GObject requires a workaround to make it work.

var obj = new MyObject(); // GirCore 1007 warning
var obj = new MyObject([]); // GirCore 1007 warning
var obj = MyObject.NewWithProperties([]); //No warning

Subclasses

To make subclasses work they will rely on source generators to integrate dotnet deeply with the GObject type system. This requires some unsafe code to be rendered as C will call directly into dotnet code. For this to work projects using GObject based subclasses must set <AllowUnsafeBlocks>true</AllowUnsafeBlocks> in their csproj files.

The creation of subclasses includes several scenarios. The classic dotnet way of subclassing via a parent parameterless constructor now raises a warning. Please note that the Initialize method is called always if an instance of the subclass is created. Even if the instance is created by the GObject type system itself. Therefore it is safe to mark the member _value as not null.

public class MyObject : GObject.Object
{
    private string _value;

    public MyObject() // GirCore 1007 warning
    {
        _value = "test";
    }
} 

[GObject.Subclass<GObject.Object>]
public partial class MyObject
{
    private string _value;

    [MemberNotNull(nameof(_value))]
    partial void Initialize() // No warning
    {
        _value = "test";
    } 
}

For code that uses parameterized constructors without the GObject.SubclassAttribute a warning is emitted. Please note that _value got nullable in the reworked code. This is a direct result from the deeper GObject integration as GObject requires objects to be creatable without any explicit parameterized constructor.

public class MyObject : GObject.Object
{
    private string _value;

    public MyObject(string value)  // GirCore 1007 warning
    {
        _value = value;
    }
}

[GObject.Subclass<GObject.Object>]
public partial class MyObject
{
    private string? _value;
    
    public static MyObject NewWithValue(string value) // No warning
    {
        var obj = MyObject.NewWithProperties([]);
        obj._value = value;

        return obj;
    }
}

Code that already used the GObject.SubclassAttribute with a parameterized constructor must migrate as this() is not available anymore.

//Emits a compiler error
[GObject.Subclass<GObject.Object>]
public partial class MyObject
{
    private string _value;
    
    public MyObject(string value) : this()
    {
        _value = value;
    }
}

//Emits no compiler error, uses a static factory method
[GObject.Subclass<GObject.Object>]
public partial class MyObject
{
    private string? _value;
    
    public static MyObject NewWithValue(string value)
    {
        var obj = MyObject.NewWithProperties([]);
        obj._value = value;

        return obj;
    }
}

Gtk.Builder and composite templates

To create some Gtk UI based on XML templates GirCore used Gtk.Builder. The user was required to inject instances created by Gtk.Builder into the dependency chain with some internal code needed to make it work at all. The deeper integration with the GObject type system in combination with composite template support allows to write UI classes like they should be.

Any Gtk.Builder based view classes must be migrated as the deeper type system integration does not support injecting arbitrary pointers without resulting memory management issues. Additionally Gtk.Builder implementation in GirCore does not connect members anymore. It is just doing what it was intended for: Creating Gtk.Widget hierarchies from a given XML file. The composite template support is a replacement for the original advertised workaround to mimic composite template like behaviour with Gtk.Builder.

Please note that the Gtk.Label in the composite sample must not be marked as nullable. The Gtk.Connect attributes tells the source generator that the member will be initialized by the template so it generates the MemberNotNullAttribute automatically in the background.

Another improvement over the Gtk.Builder variant is that Gtk.Template allows to specify a Gtk.TemplateLoader. Gtk.AssemblyResource is a Gtk.TemplateLoader which expects template files to be available as a dotnet assembly resource. By implementing a custom Gtk.TemplateLoader it is possible to load composite templates from any location.

Gtk.Subclass gained a new optional prameter: qualifiedName. This allows to specify the native name of the subclass. It makes it easier to reference the class in template files. If no qualifiedName is supplied the generated native class name is [namespace].[classname]. If the qualifiedName is set the generated native class name is [qualifiedName].

For a complete working sample of composite widgets please see the samples in the repository.

// Old Gtk.Builder way
public class SampleTestDialog : Gtk.Dialog
{
    [Gtk.Connect("my_label")]
    private readonly Gtk.Label _label;

    private SampleTestDialog(Gtk.Builder builder, string name) : base(new Gtk.Internal.DialogHandle(builder.GetPointer(name), false))
    {
        builder.Connect(this);
        _label.Label_ = "With support for connected members!";
    }

    public SampleTestDialog() : this(new Gtk.Builder("SampleTestDialog.ui"), "dialog")
    {
    }
}

//New Gtk composite templates
[GObject.Subclass<Gtk.Dialog>(qualifiedName: nameof(SampleTestDialog))]
[Gtk.Template<Gtk.AssemblyResource>("SampleTestDialog.ui")]
public partial class SampleTestDialog
{
    [Gtk.Connect("my_label")]
    private Gtk.Label _label;

    partial void Initialize()
    {
        _l...
Read more

0.8.0-preview.1

0.8.0-preview.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 12 Mar 17:26
a1ff833

This release is the first preview of the upcoming 0.8.0 release. To get an overview of the planned features of the 0.8.0 release please see the corresponding milestone.

Important
This release includes GTK composite support which is a major milestone for the GirCore project. To reach this goal there were some breaking changes necessary. Those mainly affect the usage of Gtk.Builder, the creation of subclasses and to a lesser extent the creation of native classes. In total those changes are a first step to allow deeper integration with the GObject type system.

The API was held as backwards compatible as possible. Warnings are raised for APIs which will be removed in a later release (0.9.0). Please read ahead carefully to get an overview of the breaking changes and how to resolve them.

As the deeper GObject integration required modifications in the memory management code, there might be memory related bugs. If anything comes up please open an issue.

Noteworthy

  • Feature: Composite template support, details below (#1405, #1395, #1425, #1419, #1442, #1437, #1455, #1466)
  • Feature: New GdkWayland-4.0 nuget packages (#1423)
  • Feature: out / ref enums are now supported (#1459)
  • Feature: out opaque typed records are now supported (#1463)
  • Sample: New dropdown sample (#1428)
  • Sample: New async-UI sample (#1461)

Breaking changes

The following sections describe the breaking changes and how to solve them. A more detailed explanation why the breaking changes are necessary can be found in the explanation of the diagnostic message 1007. Issue 1441 describes the available feature set between versions.

Instance creation

Since the beginning of GirCore constructors of GObjects were rendered as static factory methods. There is one exception: It is possible to create instances with a parameterless constructor or an array of ConstructArgument. As GObject itself expects all objects to be creatable without a parameterized class specific constructor this public constructor will be marked as obsolete and a new factory method will be rendered as an alternative. This means the API is not yet removed but its usage is discouraged as the deeper integration with GObject requires a workaround to make it work.

var obj = new MyObject(); // GirCore 1007 warning
var obj = new MyObject([]); // GirCore 1007 warning
var obj = MyObject.NewWithProperties([]); //No warning

Subclasses

To make subclasses work they will rely on source generators to integrate dotnet deeply with the GObject type system. This requires some unsafe code to be rendered as C will call directly into dotnet code. For this to work projects using GObject based subclasses must set <AllowUnsafeBlocks>true</AllowUnsafeBlocks> in their csproj files.

The creation of subclasses includes several scenarios. The classic dotnet way of subclassing via a parent parameterless constructor now raises a warning. Please note that the Initialize method is called always if an instance of the subclass is created. Even if the instance is created by the GObject type system itself. Therefore it is safe to mark the member _value as not null.

public class MyObject : GObject.Object
{
    private string _value;

    public MyObject() // GirCore 1007 warning
    {
        _value = "test";
    }
} 

[GObject.Subclass<GObject.Object>]
public partial class MyObject
{
    private string _value;

    [MemberNotNull(nameof(_value))]
    partial void Initialize() // No warning
    {
        _value = "test";
    } 
}

For code that uses parameterized constructors without the GObject.SubclassAttribute a warning is emitted. Please note that _value got nullable in the reworked code. This is a direct result from the deeper GObject integration as GObject requires objects to be creatable without any explicit parameterized constructor.

public class MyObject : GObject.Object
{
    private string _value;

    public MyObject(string value)  // GirCore 1007 warning
    {
        _value = value;
    }
}

[GObject.Subclass<GObject.Object>]
public partial class MyObject
{
    private string? _value;
    
    public static MyObject NewWithValue(string value) // No warning
    {
        var obj = MyObject.NewWithProperties([]);
        obj._value = value;

        return obj;
    }
}

Code that already used the GObject.SubclassAttribute with a parameterized constructor must migrate as this() is not available anymore.

//Emits a compiler error
[GObject.Subclass<GObject.Object>]
public partial class MyObject
{
    private string _value;
    
    public MyObject(string value) : this()
    {
        _value = value;
    }
}

//Emits no compiler error, uses a static factory method
[GObject.Subclass<GObject.Object>]
public partial class MyObject
{
    private string? _value;
    
    public static MyObject NewWithValue(string value)
    {
        var obj = MyObject.NewWithProperties([]);
        obj._value = value;

        return obj;
    }
}

Gtk.Builder and composite templates

To create some Gtk UI based on XML templates GirCore used Gtk.Builder. The user was required to inject instances created by Gtk.Builder into the dependency chain with some internal code needed to make it work at all. The deeper integration with the GObject type system in combination with composite template support allows to write UI classes like they should be.

Any Gtk.Builder based view classes must be migrated as the deeper type system integration does not support injecting arbitrary pointers without resulting memory management issues. Additionally Gtk.Builder implementation in GirCore does not connect members anymore. It is just doing what it was intended for: Creating Gtk.Widget hierarchies from a given XML file. The composite template support is a replacement for the original advertised workaround to mimic composite template like behaviour with Gtk.Builder.

Please note that the Gtk.Label in the composite sample must not be marked as nullable. The Gtk.Connect attributes tells the source generator that the member will be initialized by the template so it generates the MemberNotNullAttribute automatically in the background.

Another improvement over the Gtk.Builder variant is that Gtk.Template allows to specify a Gtk.TemplateLoader. Gtk.AssemblyResource is a Gtk.TemplateLoader which expects template files to be available as a dotnet assembly resource. By implementing a custom Gtk.TemplateLoader it is possible to load composite templates from any location.

Gtk.Subclass gained a new optional prameter: qualifiedName. This allows to specify the native name of the subclass. It makes it easier to reference the class in template files. If no qualifiedName is supplied the generated native class name is [namespace].[classname]. If the qualifiedName is set the generated native class name is [qualifiedName].

For a complete working sample of composite widgets please see the samples in the repository.

// Old Gtk.Builder way
public class SampleTestDialog : Gtk.Dialog
{
    [Gtk.Connect("my_label")]
    private readonly Gtk.Label _label;

    private SampleTestDialog(Gtk.Builder builder, string name) : base(new Gtk.Internal.DialogHandle(builder.GetPointer(name), false))
    {
        builder.Connect(this);
        _label.Label_ = "With support for connected members!";
    }

    public SampleTestDialog() : this(new Gtk.Builder("SampleTestDialog.ui"), "dialog")
    {
    }
}

//New Gtk composite templates
[GObject.Subclass<Gtk.Dialog>(qualifiedName: nameof(SampleTestDialog))]
[Gtk.Template<Gtk.AssemblyResource>("SampleTestDialog.ui")]
public partial class SampleTestDialog
{
    [Gtk.Connect("my_label")]
    private Gtk.Label _label;

    partial void Initialize()
    {
        _label.Label_ = "With support for connected members!";
    }
}

That's all for 0.8.0-preview.1. A big thanks goes to all contributors which made this release possible through code contributions and providing feedback through issues or the matrix channel.

What's Changed

Read more

0.7.0

Choose a tag to compare

@github-actions github-actions released this 18 Dec 08:35
dce3253

This is the first release of 0.7.0.

Please be aware that there are some breaking changes:

  • Due to improved API generation string[] parameters may not need an explicit size parameter anymore.
  • Gst.Application.Init was removed. Gstreamer does not provide an Application class. This was a relict from the very beginning of the project and was a result of missing binding for gst_init which is now available as Gst.Functions.Init.

There is a new ecosystem page on the homepage. Anyone interested in promoting their GirCore related library is welcome to open a pull request.

Noteworthy

Since 0.7.0-preview.3

  • Fix: Gtk.FontDialog.ChooseFaceAsync (#1350)
  • Fix: InvalidCastException on certain APIs (#1331)
  • Feature: Improved Glib.PtrArray support (#1349, #1361) thanks @alansartorio
  • Feature: Dotnet 10 support (#1370 based on work from @kashifsoofi)
  • Feature: Bindings for GdkWin32 (#1359)
  • Feature: Add Gtk.CustomSorter.New<T> as a generic variant of Gtk.CustomSorter.New. See samples for usage (#1375)
  • Fix + Feature: Improved generation of native non null termainted string arrays. The public API does not require a length parameter anymore as the length is determined automatically. This changes allows to generate more string array related APIs. (#1379)

0.7.0-preview.3

  • Feature: Add support for the GNOME 49 SDK including GTK 4.20 and libadwaita 1.8.
  • Fix: Properties of type Long are now always working as expected (#1311)
  • Feature: First steps to improve support for native GLib.SList. See the unit tests for example usage (#1317)
  • Feature: New Pango methods and constants which are not available in the GIR file (#1320, #1321)
  • Feature: Allow a Cairo.ImageSurface to be directly created from GLib.Bytes (#1322)

0.7.0-preview.2

  • Signals which are part of an interface are now available in the bindings (#1302).
  • A new convenience function to retrieve a GLib.Bytes region as ReadOnlySpan (#1306).
  • Thanks to @czirok for adding bindings for librsvg (#1263).
  • Thanks to @toomasz for adding bindings for GstApp which is part of GStreamer (#1276).
  • Thanks to @AeonLucid for contributing support for callbacks which are nested in classes (#1290).
  • Thanks to @UrtsiSantsi and @kashifsoofi for their ongoing support of the project.

0.7.0-preview.1

  • Update to GNOME 48 which includes GTK 4.18 and libadwaita 1.7 (#1237).
  • Bindings for libsecret are now available as a nuget package (#1236).
  • The gir.core SynchronizationContext now implements the Send method allowing users to dispatch actions into the main thread (#1222).
  • Several bug fixes and improvements in regard to closures and signal handling (#1238, #1247, #1248)
  • A bug fix which allows to properly set uint64 based properties (#1259).

What's Changed

Read more

0.7.0-preview.3

0.7.0-preview.3 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Nov 20:56
f15dc08

This release is the third preview of the upcoming 0.7.0 release. To get an overview of the planned features of the 0.7.0 release please see the corresponding milestone.

This release adds support for the GNOME 49 SDK including GTK 4.20 and libadwaita 1.8.

Noteworthy

  • Fix: Properties of type Long are now always working as expected (#1311)
  • Feature: First steps to improve support for native GLib.SList. See the unit tests for example usage (#1317)
  • Feature: New Pango methods and constants which are not available in the GIR file (#1320, #1321)
  • Feature: Allow a Cairo.ImageSurface to be directly created from GLib.Bytes (#1322)

What's Changed

  • Rename existing Long-Testers by @badcel in #1309
  • Rename long tester by @badcel in #1312
  • Properly support Long / ULong / Int64 / UInt64 properties by @badcel in #1311
  • Add GObject.Object to generic type constraint of instance factory/wrapper by @ousnius in #1316
  • GLib.SList: Add IEnumerable and related extensions by @ousnius in #1317
  • Add Pango CSS scale factor constants by @ousnius in #1321
  • Fix typo in exception for TypedRecord ParameterConverter by @ousnius in #1323
  • Add Pango unit conversion/rounding functions from C function macros by @ousnius in #1320
  • Generate methods with typed records as out parameter (non-nullable, no transfer) by @ousnius in #1324
  • Cairo: Support ImageSurface for data by @badcel in #1322
  • Bump AwesomeAssertions from 9.1.0 to 9.2.0 by @dependabot[bot] in #1326
  • Bump actions/checkout from 4 to 5 by @dependabot[bot] in #1300
  • Bump AwesomeAssertions from 9.2.0 to 9.2.1 by @dependabot[bot] in #1333
  • Update to GNOME 49 by @badcel in #1336

New Contributors

Full Changelog: 0.7.0-preview.2...0.7.0-preview.3

0.7.0-preview.2

0.7.0-preview.2 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 23 Aug 19:36
a70b1f3

This release is the second preview of the upcoming 0.7.0 release. To get an overview of the planned features of the 0.7.0 release please see the corresponding milestone.

Noteworthy

  • Signals which are part of an interface are now available in the bindings (#1302).
  • A new convenience function to retrieve a GLib.Bytes region as ReadOnlySpan (#1306).
  • Thanks to @czirok for adding bindings for librsvg (#1263).
  • Thanks to @toomasz for adding bindings for GstApp which is part of GStreamer (#1276).
  • Thanks to @AeonLucid for contributing support for callbacks which are nested in classes (#1290).
  • Thanks to @UrtsiSantsi and @kashifsoofi for their ongoing support of the project.

What's Changed

New Contributors

Full Changelog: 0.7.0-preview.1...0.7.0-preview.2

0.7.0-preview.1

0.7.0-preview.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 26 May 19:57
c7b3fea

This release is the first preview of the upcoming 0.7.0 release. To get an overview of the planned features of the 0.7.0 release please see the corresponding milestone.

Noteworthy

  • Update to GNOME 48 which includes GTK 4.18 and libadwaita 1.7 (#1237).
  • Bindings for libsecret are now available as a nuget package (#1236).
  • The gir.core SynchronizationContext now implements the Send method allowing users to dispatch actions into the main thread (#1222).
  • Several bug fixes and improvements in regard to closures and signal handling (#1238, #1247, #1248)
  • A bug fix which allows to properly set uint64 based properties (#1259).

What's Changed

New Contributors

Full Changelog: 0.6.3...0.7.0-preview.1

0.6.3

Choose a tag to compare

@badcel badcel released this 26 Feb 21:23
41992a3

This is a follow up release to 0.6.2. This release adds some missing bits to GObject-2.0.Integration, adds IDisposable support on interfaces and fixes a bug in several async methods.

Noteworthy

  • GObject-2.0.Integration: Subclassing now supports global namespaces (#1188)
  • GObject-2.0.Integration: Generates a partial Initialize() method to allow custom initialization of an object no matter if it is created by dotnet or C code. (#1189). See the Gridview-Sample to see how to use the new method.
  • Several GTK async methods now support a nullable parent window (#1199)
  • Interfaces implement IDisposable (#1203)

What's Changed

New Contributors

Full Changelog: 0.6.2...0.6.3

0.6.2

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.

Noteworthy

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