Skip to content

Commit 0db9921

Browse files
Add a basic gdk4-macos
1 parent b734344 commit 0db9921

26 files changed

+742
-0
lines changed

Cargo.lock

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ members = [
2323
"gdk4-wayland/sys",
2424
"gdk4-win32",
2525
"gdk4-win32/sys",
26+
"gdk4-macos",
27+
"gdk4-macos/sys",
2628
"gsk4",
2729
"gsk4/sys",
2830
"gtk4",
@@ -58,6 +60,7 @@ libc = "0.2"
5860
pango-sys = {git = "https://github.com/gtk-rs/gtk-rs-core", version = "0.21", branch = "main", features = ["v1_46"]}
5961
pango = {git = "https://github.com/gtk-rs/gtk-rs-core", version = "0.21", branch = "main", features = ["v1_46"]}
6062
gir-format-check = "^0.1"
63+
gdk4-macos-sys = {path = "gdk4-macos/sys", version = "0.10"}
6164
gdk4-x11-sys = {path = "gdk4-x11/sys", version = "0.10"}
6265
gdk4-wayland-sys = {path = "gdk4-wayland/sys", version = "0.10"}
6366
gdk4-win32-sys = {path = "gdk4-win32/sys", version = "0.10"}

gdk4-macos/COPYRIGHT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../COPYRIGHT

gdk4-macos/Cargo.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[package]
2+
name = "gdk4-macos"
3+
description = "Rust bindings of the GDK4 macos library"
4+
documentation = "https://gtk-rs.org/gtk4-rs/stable/latest/docs/gdk4_macos/"
5+
keywords = ["gdk4", "gdk4-macos", "gtk-rs", "gnome", "GUI"]
6+
readme = "README.md"
7+
authors.workspace = true
8+
categories.workspace = true
9+
edition.workspace = true
10+
homepage.workspace = true
11+
license.workspace = true
12+
repository.workspace = true
13+
rust-version.workspace = true
14+
version.workspace = true
15+
16+
[features]
17+
18+
[dependencies]
19+
gdk4-macos-sys.workspace = true
20+
gdk.workspace = true
21+
gio.workspace = true
22+
glib.workspace = true
23+
libc.workspace = true
24+
25+
[dev-dependencies]
26+
gir-format-check.workspace = true
27+
28+
[package.metadata.docs.rs]
29+
all-features = true
30+
rustc-args = ["--cfg", "docsrs"]
31+
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]

gdk4-macos/Gir.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[options]
2+
girs_directories = ["../gir-files"]
3+
library = "GdkMacos"
4+
version = "4.0"
5+
min_cfg_version = "4.0.0"
6+
target_path = "."
7+
work_mode = "normal"
8+
use_gi_docgen = true
9+
single_version_file = true
10+
generate_safety_asserts = true
11+
deprecate_by_min_version = true
12+
trust_return_value_nullability = true
13+
14+
generate = [
15+
"GdkMacos.MacosDevice",
16+
"GdkMacos.MacosDisplay",
17+
"GdkMacos.MacosGLContext",
18+
"GdkMacos.MacosKeymap",
19+
"GdkMacos.MacosMonitor",
20+
"GdkMacos.MacosSeat",
21+
"GdkMacos.MacosSurface",
22+
]
23+
24+
manual = [
25+
"Gdk.Device",
26+
"Gdk.Display",
27+
"Gdk.DrawContext",
28+
"Gdk.GLContext",
29+
"Gdk.Monitor",
30+
"Gdk.Rectangle",
31+
"Gdk.Seat",
32+
"Gdk.Surface",
33+
]

gdk4-macos/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

gdk4-macos/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Rust GDK 4 X11 bindings
2+
3+
The project website is [here](https://gtk-rs.org/).
4+
5+
Rust bindings of [GDK 4's X11 backend](https://docs.gtk.org/gdk4-x11/),
6+
part of [gtk4-rs](https://github.com/gtk-rs/gtk4-rs/).
7+
8+
GDK is an intermediate layer that isolates GTK from the details of the windowing system.
9+
GDK X11 contains functions specific to the X11 backend.
10+
11+
## Minimum supported Rust version
12+
13+
Currently, the minimum supported Rust version is `1.80`.
14+
15+
## Documentation
16+
17+
- The Rust API [Stable](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gdk4_x11)/[Development](https://gtk-rs.org/gtk4-rs/git/docs/gdk4_x11/)
18+
- [The C API](https://docs.gtk.org/gdk4-x11/)
19+
- [GTK Installation instructions](https://www.gtk.org/docs/installations/)
20+
21+
## Using
22+
23+
We recommend using [crates from crates.io](https://crates.io/keywords/gtk-rs),
24+
as [demonstrated here](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/index.html#library-versions).
25+
26+
If you want to track the bleeding edge, use the git dependency instead:
27+
28+
```toml
29+
[dependencies]
30+
gdk-wayland = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gdk4-wayland" }
31+
```
32+
33+
Avoid mixing versioned and git crates like this:
34+
35+
```toml
36+
# This will not compile
37+
[dependencies]
38+
gdk-x11 = {version = "0.1", package = "gdk4-x11"}
39+
gdk-wayland = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gdk4-wayland" }
40+
```
41+
42+
### Features
43+
44+
| Feature | Description |
45+
| --- | ----------- |
46+
| `v4_16` | Enable the new APIs part of GTK 4.16 |
47+
| `v4_10` | Enable the new APIs part of GTK 4.10 |
48+
| `v4_4` | Enable the new APIs part of GTK 4.4 |
49+
| `egl` | Integration with the [khronos-egl](https://crates.io/crates/khronos-egl) crate |
50+
| `xlib` | Integration with the [x11](https://crates.io/crates/x11) crate |
51+
52+
### See Also
53+
54+
- [glib](https://crates.io/crates/glib)
55+
- [gio](https://crates.io/crates/gio)
56+
- [gsk4](https://crates.io/crates/gsk4)
57+
- [gdk4](https://crates.io/crates/gdk4)
58+
- [gtk4](https://crates.io/crates/gtk4)
59+
60+
## License
61+
62+
The Rust bindings of __gdk4-x11__ are available under the MIT License, please refer to it.

gdk4-macos/src/auto/macos_device.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file was generated by gir (https://github.com/gtk-rs/gir)
2+
// from gir-files (https://github.com/gtk-rs/gir-files)
3+
// DO NOT EDIT
4+
5+
use crate::ffi;
6+
7+
glib::wrapper! {
8+
#[doc(alias = "GdkMacosDevice")]
9+
pub struct MacosDevice(Object<ffi::GdkMacosDevice, ffi::GdkMacosDeviceClass>) @extends gdk::Device;
10+
11+
match fn {
12+
type_ => || ffi::gdk_macos_device_get_type(),
13+
}
14+
}
15+
16+
impl MacosDevice {}

gdk4-macos/src/auto/macos_display.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file was generated by gir (https://github.com/gtk-rs/gir)
2+
// from gir-files (https://github.com/gtk-rs/gir-files)
3+
// DO NOT EDIT
4+
5+
use crate::ffi;
6+
7+
glib::wrapper! {
8+
#[doc(alias = "GdkMacosDisplay")]
9+
pub struct MacosDisplay(Object<ffi::GdkMacosDisplay, ffi::GdkMacosDisplayClass>) @extends gdk::Display;
10+
11+
match fn {
12+
type_ => || ffi::gdk_macos_display_get_type(),
13+
}
14+
}
15+
16+
impl MacosDisplay {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file was generated by gir (https://github.com/gtk-rs/gir)
2+
// from gir-files (https://github.com/gtk-rs/gir-files)
3+
// DO NOT EDIT
4+
5+
use crate::ffi;
6+
7+
glib::wrapper! {
8+
#[doc(alias = "GdkMacosGLContext")]
9+
pub struct MacosGLContext(Object<ffi::GdkMacosGLContext, ffi::GdkMacosGLContextClass>) @extends gdk::GLContext, gdk::DrawContext;
10+
11+
match fn {
12+
type_ => || ffi::gdk_macos_gl_context_get_type(),
13+
}
14+
}
15+
16+
impl MacosGLContext {}

0 commit comments

Comments
 (0)