-1

I want to create a GUI toolkit for my desktop environment (because neither gtk nor qt don't fit to my needs) but I don't know how to start. I don't want a cross-platform or display-server independent library, theming options, configurable icons etc. just a few basic widgets for making wayland clients. (widgets like button, entry, label, window and images... and I want to use CSD if it's important)

My problem is that I can't understand how graphics work in wayland (in X you only need to create a window and use XDrawLine etc. right?) also I don't know how to write a graphical toolkit. Can you give me some articles or recommendations on how can I do this?

  • Did you consider *improving* the source code of [GTK](http://gtk.org/) or of [Qt](https://qt.io/)? Both are open source, and you are allowed to download them and improve them. Writing a GUI toolkit from scratch could take you *years* of work. – Basile Starynkevitch Sep 13 '21 at 06:58
  • @BasileStarynkevitch both GTK and Qt have widgets and options that I don't want to use. I think improving their source code takes (at least) as long as writing another toolkit from scratch. –  Sep 13 '21 at 07:53

1 Answers1

1

The easiest way to create a wayland client is to use the wayland-client library. Basically, it abstracts the wire format.

example:

#include <stdio.h>
#include <wayland-client.h>

int main(void)
{
    struct wl_display *display = wl_display_connect(NULL);
    if (display) {
        printf("Connected!\n");
    } else {
        printf("Error connecting ;(\n");
        return 1;
    }

    wl_display_disconnect(display);
    return 0;
}
HackerDev-Felix
  • 226
  • 2
  • 5