3 unstable releases

0.14.8 Oct 9, 2021
0.14.0 Jun 22, 2021
0.0.0 Apr 4, 2021

#222 in GUI

Download history 831/week @ 2021-07-06 853/week @ 2021-07-13 1158/week @ 2021-07-20 1312/week @ 2021-07-27 2007/week @ 2021-08-03 2171/week @ 2021-08-10 1787/week @ 2021-08-17 2124/week @ 2021-08-24 1786/week @ 2021-08-31 2392/week @ 2021-09-07 2301/week @ 2021-09-14 3045/week @ 2021-09-21 4054/week @ 2021-09-28 3317/week @ 2021-10-05 2700/week @ 2021-10-12 2215/week @ 2021-10-19

9,146 downloads per month
Used in 23 crates (4 directly)

MIT license

345KB
7.5K SLoC

gtk-rs-core CI

The gtk-rs organization aims to provide safe Rust binding over GObject-based libraries. You can find more about it on https://gtk-rs.org.

This repository contains all the "core" crates of the gtk-rs organization. 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.54.0.

Documentation

Ecosystem

The gtk-rs-core repository contains Rust crates for the foundational GObject-based libraries. 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:

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 gtk-rs repository, you will need to be careful and ensure that they do not pull in incompatible versions of core crates like glib-rs.

Regenerating

To regenerate crates using gir, please use the generator.py file as follows:

$ python3 generator.py

Development

This repository is mostly split into two branches: master and crate. master contains the not yet released code and is where new developments are happening. crate contains the last release source code and isn't supposed to be updated.

This repository is structured as follows:

- crate/
   |
   |-- README.md
   |-- Gir.toml
   |-- Cargo.toml
   |-- src/
   |-- sys/

The crate is a "top" directory (so "atk" or "gdk" in here for example). Each crate contains:

  • README.md: explanations about the crate itself and eventually some details.
  • Cargo.toml: descriptor of the crate, used by cargo and Rust.
  • Gir.toml: configuration used by gir to generate most of the crates' code.
  • src: the source code of the crate.
  • sys: the 1:1 bindings of the C API.

The gir and gir-files top folders are not crates, but are git submodules which respectively contain the gir tool and the gir files used by the generator.

When running generator.py the tool will automatically update these git submodules and run the gir tool on the gir files to regenerate the code.

During development, it is useful to execute the generator with a different version of the gir tool or of the gir files, for instance to test if the code generation is successful before submitting a pull request to update one of the submodules. This can be done by specifying arguments to the generator script, for instance, to run the generator on a local copy of the gir files:

$ python3 generator.py --gir-files-directory ../gir-files/

See python3 generator.py --help for more details.

Dependencies

~0.3–295KB