Skip to main content

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 gdk_pixbuf;
10pub use gdk4_sys as ffi;
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(clippy::let_and_return)]
75#[allow(unused_imports)]
76mod auto;
77
78#[macro_use]
79mod event;
80
81pub mod builders;
82pub mod prelude;
83pub mod subclass;
84
85mod button_event;
86mod cairo_interaction;
87mod clipboard;
88mod content_deserializer;
89mod content_formats;
90mod content_formats_builder;
91mod content_provider;
92mod content_serializer;
93mod crossing_event;
94#[cfg(feature = "v4_16")]
95#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
96mod cursor;
97mod delete_event;
98mod display;
99#[cfg(target_os = "linux")]
100#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
101#[cfg(feature = "v4_14")]
102#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
103mod dmabuf_texture_builder;
104mod dnd_event;
105#[cfg(feature = "v4_12")]
106#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
107mod drag_surface;
108#[cfg(feature = "v4_12")]
109#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
110mod drag_surface_size;
111mod draw_context;
112mod drop;
113mod focus_event;
114mod functions;
115mod gl_texture;
116#[cfg(feature = "v4_12")]
117#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
118mod gl_texture_builder;
119mod grab_broken_event;
120mod key_event;
121mod keymap_key;
122mod keys;
123#[cfg(feature = "v4_16")]
124#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
125mod memory_texture_builder;
126mod motion_event;
127mod pad_event;
128mod popup_layout;
129mod proximity_event;
130mod rectangle;
131mod rgba;
132mod scroll_event;
133mod surface;
134mod texture;
135mod time_coord;
136mod toplevel;
137mod toplevel_size;
138mod touch_event;
139mod touchpad_event;
140
141pub use auto::*;
142pub use display::Backend;
143#[cfg(feature = "v4_12")]
144#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
145pub use drag_surface_size::DragSurfaceSize;
146pub use functions::*;
147pub use keymap_key::KeymapKey;
148pub use keys::Key;
149pub use time_coord::TimeCoord;
150pub use toplevel_size::ToplevelSize;