• Stars
    star
    1,792
  • Rank 25,925 (Top 0.6 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rust bindings of GTK 4

gtk4-rs CI

A group of crates that aims to provide complete GTK 4 bindings. This repository contains all the "core" crates of GTK 4.

  • GTK
  • GDK: An intermediate layer which isolates GTK from the details of the windowing system.
    • GDK Wayland: Wayland backend specific functions.
    • GDK Win32: Windows backend specific functions.
    • GDK X11: X backend specific functions.
  • GSK: An intermediate layer which isolates GTK from the details of the OpenGL or Vulkan implementation.

The GTK 4 crates also depends on other libraries part of the platform like:

Those are common with the GTK 3 and GStreamer bindings and are part of the gtk-rs-core repository.

For more information about each crate, please refer to their README.md file in their directory.

Minimum supported Rust version

Currently, the minimum supported Rust version is 1.70.

Documentation

Useful links

Ecosystem

The gtk4-rs repository contains Rust crates for GTK 4. However there is a large ecosystem of GObject libraries and many of these libraries have Rust bindings based on the tooling included in gtk-rs. Of particular note:

  • gtk-rs-core - bindings for some of the core libraries such as glib, gio, pango, graphene
  • gstreamer-rs - bindings for the GStreamer media framework

Additionally, Rust bindings for various libraries are hosted on GNOME's GitLab instance and can be found at https://gitlab.gnome.org/World/Rust.

When using crates that are not part of the gtk4-rs repository, you will need to be careful and ensure that they do not pull in incompatible versions of core crates like glib-rs.

Built with GTK4 Rust bindings

A small list of applications built with gtk4-rs:

Libraries built with gtk4-rs:

  • Relm4: An idiomatic GUI library inspired by Elm

Contributing

The bindings are composed of two parts:

  • Automatically generated ones using gir
  • Manual parts

The automatic ones can be generated using the generator.py script

python3 ./generator.py

If you didn't do so yet, please check out all the submodules before via

$ git submodule update --checkout

All the crates except gtk4-macros follow this structure

   ./crate 
   ├── Gir.toml
   ├── README.md
   ├── src
   │   ╰── auto
   ├── sys
   ╰── tests
  • README.md: Explanations about the crate itself and eventually some details.
  • Gir.toml: Used by gir to generate most of the code.
  • src: Contains the source code of the crate.
  • src/auto: Contains the automatically generated part of the source code.
  • sys: Contains the 1:1 bindings of the C API.

More Repositories

1

gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
Rust
1,263
star
2

gtk3-rs

Rust bindings for GTK 3
Rust
476
star
3

examples

DEPRECATED, use https://github.com/gtk-rs/gtk-rs repository instead!
Rust
284
star
4

gir

Tool to generate rust bindings and user API for glib-based libraries
Rust
209
star
5

gtk-rs-core

Rust bindings for GNOME libraries
Rust
201
star
6

cairo

DEPRECATED, use https://github.com/gtk-rs/gtk-rs-core repository instead!
Rust
148
star
7

glib

DEPRECATED, use https://github.com/gtk-rs/gtk-rs-core repository instead!
Rust
93
star
8

gio

DEPRECATED, use https://github.com/gtk-rs/gtk-rs-core repository instead!
Rust
41
star
9

pango

DEPRECATED, use https://github.com/gtk-rs/gtk-rs-core repository instead!
Rust
33
star
10

sys

DEPRECATED, each crate has its own sys folder now.
Rust
31
star
11

gtk-test

Testing GTK UI
Rust
30
star
12

gdk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
Rust
30
star
13

gir-files

Shell
25
star
14

sourceview

sourceview binding for Rust
Rust
21
star
15

gtk-rs.github.io

The gtk-rs.org website
SCSS
20
star
16

examples4

DEPRECATED, use https://github.com/gtk-rs/gtk4-rs repository instead!
Rust
16
star
17

gdk-pixbuf

DEPRECATED, use https://github.com/gtk-rs/gtk-rs-core repository instead!
Rust
15
star
18

pangocairo

DEPRECATED, use https://github.com/gtk-rs/gtk-rs-core repository instead!
Rust
9
star
19

webkit2gtk-webextension-rs

[UNMAINTAINED] WebKit2GTK+ Web Extensions bindings and wrappers for Rust
Rust
9
star
20

gdk4

DEPRECATED, use https://github.com/gtk-rs/gtk4-rs repository instead!
Rust
8
star
21

gsk4

DEPRECATED, use https://github.com/gtk-rs/gtk4-rs repository instead!
Rust
7
star
22

atk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
Rust
7
star
23

gobject-subclass

Rust GObject subclassing infrastructure
Rust
6
star
24

soup-sys-rs

[UNMAINTAINED] Soup FFI crate for Rust
Rust
4
star
25

lgpl-docs

LGPL-licensed docs for Gtk-rs crates
Rust
4
star
26

tests

tests for gtk-rs
Rust
3
star
27

graphene

DEPRECATED, use https://github.com/gtk-rs/gtk-rs-core repository instead!
Rust
3
star
28

gdkx11

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
Rust
3
star
29

docs

The old source repo of http://gtk-rs.org/docs/
HTML
2
star
30

release

Python
2
star
31

checker

Repository which contains various scripts to run for CI
Python
2
star
32

gir-ctest

Rust
1
star
33

gir-format-check

Rust
1
star