Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rust bindings of GTK 4

License

NotificationsYou must be signed in to change notification settings

gtk-rs/gtk4-rs

Repository files navigation

A group of crates that aims to provide completeGTK 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.
  • 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 thegtk-rs-core repository.

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

Minimum supported Rust version

Currently, the minimum supported Rust version is1.83.

Documentation

Useful links

Ecosystem

Thegtk4-rs repository contains Rust crates for GTK 4. However there is a large ecosystem ofGObject libraries and many of theselibraries have Rust bindings based on the tooling included ingtk-rs.Of particular note:

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

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

When using crates that are not part of thegtk4-rs repository, you willneed to be careful and ensure that they do not pull in incompatible versions of corecrates likeglib-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 usinggir
  • Manual parts

The automatic ones can be generated using thegenerator.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 exceptgtk4-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 bygir 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.

[8]ページ先頭

©2009-2025 Movatter.jp