gdk4/
lib.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![allow(deprecated)]
5#![allow(clippy::manual_c_str_literals)]
6#![doc = include_str!("../README.md")]
7
8pub use cairo;
9pub use gdk4_sys as ffi;
10pub use gdk_pixbuf;
11pub use gio;
12#[cfg(feature = "gl")]
13#[cfg_attr(docsrs, doc(cfg(feature = "gl")))]
14pub use gl;
15pub use glib;
16pub use pango;
17
18/// This is the priority that the idle handler processing surface updates
19/// is given in the main loop.
20#[doc(alias = "GDK_PRIORITY_REDRAW")]
21pub const PRIORITY_REDRAW: u32 = ffi::GDK_PRIORITY_REDRAW as u32;
22
23/// A mask covering all entries in [`ModifierType`][crate::ModifierType].
24#[doc(alias = "GDK_MODIFIER_MASK")]
25pub const MODIFIER_MASK: ModifierType = ModifierType::all();
26
27/// Defines all possible DND actions.
28///
29/// This can be used in [`Drop::status()`][crate::Drop::status()] messages when any drop
30/// can be accepted or a more specific drop method is not yet known.
31#[doc(alias = "GDK_ACTION_ALL")]
32pub const ACTION_ALL: u32 = ffi::GDK_ACTION_ALL as u32;
33
34/// Represents the current time, and can be used anywhere a time is expected.
35#[doc(alias = "GDK_CURRENT_TIME")]
36pub const CURRENT_TIME: u32 = ffi::GDK_CURRENT_TIME as u32;
37
38/// The primary button. This is typically the left mouse button, or the
39/// right button in a left-handed setup.
40#[doc(alias = "GDK_BUTTON_PRIMARY")]
41pub const BUTTON_PRIMARY: u32 = ffi::GDK_BUTTON_PRIMARY as u32;
42
43/// The middle button.
44#[doc(alias = "GDK_BUTTON_MIDDLE")]
45pub const BUTTON_MIDDLE: u32 = ffi::GDK_BUTTON_MIDDLE as u32;
46
47/// The secondary button. This is typically the right mouse button, or the
48/// left button in a left-handed setup.
49#[doc(alias = "GDK_BUTTON_SECONDARY")]
50pub const BUTTON_SECONDARY: u32 = ffi::GDK_BUTTON_SECONDARY as u32;
51
52/// Use this macro as the return value for stopping the propagation of
53/// an event handler.
54#[doc(alias = "GDK_EVENT_STOP")]
55pub const EVENT_STOP: u32 = ffi::GDK_EVENT_STOP as u32;
56
57/// Use this macro as the return value for continuing the propagation of
58/// an event handler.
59#[doc(alias = "GDK_EVENT_PROPAGATE")]
60pub const EVENT_PROPAGATE: u32 = ffi::GDK_EVENT_PROPAGATE as u32;
61
62// GDK 4 has no runtime to initialize
63macro_rules! assert_initialized_main_thread {
64    () => {};
65}
66
67// No-op
68macro_rules! skip_assert_initialized {
69    () => {};
70}
71
72#[allow(clippy::derived_hash_with_manual_eq)]
73#[allow(clippy::type_complexity)]
74#[allow(unused_imports)]
75mod auto;
76
77#[macro_use]
78mod event;
79
80pub mod builders;
81pub mod prelude;
82pub mod subclass;
83
84mod button_event;
85mod cairo_interaction;
86mod clipboard;
87mod content_deserializer;
88mod content_formats;
89mod content_formats_builder;
90mod content_provider;
91mod content_serializer;
92mod crossing_event;
93#[cfg(feature = "v4_16")]
94#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
95mod cursor;
96mod delete_event;
97mod display;
98#[cfg(feature = "v4_14")]
99#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
100mod dmabuf_texture_builder;
101mod dnd_event;
102#[cfg(feature = "v4_12")]
103#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
104mod drag_surface;
105#[cfg(feature = "v4_12")]
106#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
107mod drag_surface_size;
108mod draw_context;
109mod drop;
110mod focus_event;
111mod functions;
112mod gl_texture;
113#[cfg(feature = "v4_12")]
114#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
115mod gl_texture_builder;
116mod grab_broken_event;
117mod key_event;
118mod keymap_key;
119mod keys;
120mod motion_event;
121mod pad_event;
122mod popup_layout;
123mod proximity_event;
124mod rectangle;
125mod rgba;
126mod scroll_event;
127mod surface;
128mod texture;
129mod time_coord;
130mod toplevel;
131mod toplevel_size;
132mod touch_event;
133mod touchpad_event;
134
135pub use auto::*;
136pub use display::Backend;
137#[cfg(feature = "v4_12")]
138#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
139pub use drag_surface_size::DragSurfaceSize;
140pub use functions::*;
141pub use keymap_key::KeymapKey;
142pub use keys::Key;
143pub use time_coord::TimeCoord;
144pub use toplevel_size::ToplevelSize;