• Stars
    star
    476
  • Rank 92,280 (Top 2 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

Rust bindings for GTK 3

gtk3-rs 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.63.0.

Documentation

Ecosystem

The gtk3-rs repository contains Rust crates for GTK 3. 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 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

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

$ git submodule update --checkout

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.

More Repositories

1

gtk4-rs

Rust bindings of GTK 4
Rust
1,792
star
2

gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
Rust
1,263
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