Skip to content

WhatIf... GC09E01 - GirCore Mutter #1497

Description

@czirok

WhatIf... GC09E01 - GirCore Mutter

Introduction

This is just a proof of concept. A demonstration of how brilliant the GirCore you created is. Sincere thanks on behalf of the .NET community that loves Linux and develops on Linux.

This is still a concept, but in its current state, using the .NET and NuGet ecosystem, it could even enable a full .NET-based GNOME Shell implementation. The only limit is imagination, as it makes possible highly unique, pluggable, and themeable Linux desktop experiences unlike anything seen before in the history of Linux.

GirCore Mutter

To give a concrete example, here is a pure C# WM, effectively a minimal Mutter-style sample, implemented in just a few lines of C#:

language files code comment blank total
C# 2 76 1 18 95
XML 2 51 5 9 65
Shell Script 1 6 1 2 9
GirCoreMutter_small.mp4

Source: GirCore Mutter

And 18 NuGets

ATK-1.0

Source: ATK-1.0

Generator extensions:

Mtk-18

Source: Mtk-18

Generator extensions:

EGL-1.5 and Cogl-18

Source: EGL-1.5 and Cogl-18

This was the first time I encountered that gir files do not reflect real dependencies. In Cogl-18.gir, EGL is required instead of GL. This was an important lesson, as it showed that gir files are not always accurate.

The EGL-1.5.gir file did not exist, so it had to be created. This was another important lesson: sometimes gir files need to be created. EGL-1.5 README.md

After that, GL had to be replaced with EGL in Cogl-18.gir, and missing types had to be defined. Cogl-18 README.md

Clutter-18

Source: Clutter-18

Generator extensions:

P11Kit-0.26, Gck-2, Gcr-4

The situation here was similar to Cogl-18: a missing P11Kit-0.26.gir file. This also had to be created, and Gck-2.gir and Gcr-4.gir had to be made compatible. A shell script was used to generate and modify the P11Kit-0.26.gir file. P11Kit-0.26 generation

Generator extensions:

Description of the generator extensions: CLongUnsignedCLong.md

GModule-2.0

Source: GModule-2.0

GioUnix-2.0

Source: GioUnix-2.0

Gvc-1.0

Source: Gvc-1.0

GDesktopEnums-3.0

Source: GDesktopEnums-3.0

xfixes-4.0, xlib-2.0

Source: xfixes-4.0, xlib-2.0

Meta-18

Source: Meta-18

Here, the Meta-18.gir file needed to be modified. README.md

NM-1.0

Source: NM-1.0

Generator extensions:

Here, the EscapeString needed to be extended with a KnownNumericPrefixes dictionary, where 80211 is replaced with IEEE80211. I intentionally deviated from the escape behavior because this felt more logical, and it can be extended as needed. NumericDictionary.md

    private static readonly Dictionary<string, string> KnownNumericPrefixes = new()
    {
        { "80211", "IEEE80211" }
    };

Polkit-1.0, PolkitAgent-1.0

Source: Polkit-1.0, PolkitAgent-1.0

Here, the Polkit-1.0.gir file needed to be modified. README.md

St-18

Source: St-18

The St-18.gir file was incomplete, so it had to be extended with a Cogl-18.gir include. README.md

Shell-18

Source: Shell-18

Closing thoughts on generation

During the generation process, I came to the conclusion that in many cases it is more practical to modify gir files than to write generator extensions. This highlighted that gir files are not always accurate. In some cases, they are inconsistent and depend on non-existent gir files to such an extent that creating and modifying those files is simpler than extending the generator.

I would like to thank you once again for this amazing GirCore, and for the fantastic experience of using it. This project is a true gem for the Linux and .NET community, and I am looking forward to seeing what amazing things developers will create with it.

Keep it up!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions