gdk/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(clippy::missing_safety_doc)]
5#![allow(clippy::upper_case_acronyms)]
6#![allow(clippy::wrong_self_convention)]
7#![doc = include_str!("../README.md")]
8
9pub use cairo;
10pub use ffi;
11pub use gdk_pixbuf;
12pub use gio;
13pub use glib;
14pub use pango;
15
16#[macro_use]
17mod rt;
18#[macro_use]
19mod event;
20
21#[allow(clippy::type_complexity)]
22#[allow(unused_imports)]
23mod auto;
24
25pub mod prelude;
26
27pub use self::auto::functions::*;
28pub use crate::auto::*;
29
30mod atom;
31mod cairo_interaction;
32mod change_data;
33mod device;
34mod device_manager;
35mod display;
36mod drag_context;
37mod event_button;
38mod event_configure;
39mod event_crossing;
40mod event_dnd;
41mod event_expose;
42mod event_focus;
43mod event_grab_broken;
44mod event_key;
45mod event_motion;
46mod event_owner_change;
47mod event_pad_axis;
48mod event_pad_button;
49mod event_pad_group_mode;
50mod event_property;
51mod event_proximity;
52mod event_scroll;
53mod event_selection;
54mod event_setting;
55mod event_touch;
56mod event_touchpad_pinch;
57mod event_touchpad_swipe;
58mod event_visibility;
59mod event_window_state;
60mod frame_clock;
61mod frame_timings;
62mod functions;
63mod geometry;
64mod keymap;
65mod keymap_key;
66pub mod keys;
67mod rectangle;
68mod rgba;
69mod screen;
70mod time_coord;
71mod visual;
72mod window;
73
74pub use ffi::GdkColor as Color;
75
76pub use self::rt::{init, set_initialized};
77
78pub use crate::atom::Atom;
79pub use crate::atom::NONE as ATOM_NONE;
80pub use crate::atom::SELECTION_CLIPBOARD;
81pub use crate::atom::SELECTION_PRIMARY;
82pub use crate::atom::SELECTION_SECONDARY;
83pub use crate::atom::SELECTION_TYPE_ATOM;
84pub use crate::atom::SELECTION_TYPE_BITMAP;
85pub use crate::atom::SELECTION_TYPE_COLORMAP;
86pub use crate::atom::SELECTION_TYPE_DRAWABLE;
87pub use crate::atom::SELECTION_TYPE_INTEGER;
88pub use crate::atom::SELECTION_TYPE_PIXMAP;
89pub use crate::atom::SELECTION_TYPE_STRING;
90pub use crate::atom::SELECTION_TYPE_WINDOW;
91pub use crate::atom::TARGET_BITMAP;
92pub use crate::atom::TARGET_COLORMAP;
93pub use crate::atom::TARGET_DRAWABLE;
94pub use crate::atom::TARGET_PIXMAP;
95pub use crate::atom::TARGET_STRING;
96pub use crate::change_data::ChangeData;
97pub use crate::display::Backend;
98pub use crate::event::{Event, FromEvent};
99pub use crate::event_button::EventButton;
100pub use crate::event_configure::EventConfigure;
101pub use crate::event_crossing::EventCrossing;
102pub use crate::event_dnd::EventDND;
103pub use crate::event_expose::EventExpose;
104pub use crate::event_focus::EventFocus;
105pub use crate::event_grab_broken::EventGrabBroken;
106pub use crate::event_key::EventKey;
107pub use crate::event_motion::EventMotion;
108pub use crate::event_owner_change::EventOwnerChange;
109pub use crate::event_property::EventProperty;
110pub use crate::event_proximity::EventProximity;
111pub use crate::event_scroll::EventScroll;
112pub use crate::event_selection::EventSelection;
113pub use crate::event_setting::EventSetting;
114pub use crate::event_touch::EventTouch;
115pub use crate::event_visibility::EventVisibility;
116pub use crate::event_window_state::EventWindowState;
117pub use crate::functions::*;
118pub use crate::geometry::Geometry;
119pub use crate::keymap_key::KeymapKey;
120pub use crate::time_coord::TimeCoord;
121pub use crate::window::WindowAttr;
122pub use event_pad_axis::EventPadAxis;
123pub use event_pad_button::EventPadButton;
124pub use event_pad_group_mode::EventPadGroupMode;
125pub use event_touchpad_pinch::EventTouchpadPinch;
126pub use event_touchpad_swipe::EventTouchpadSwipe;
127
128#[allow(non_camel_case_types)]
129pub type key = i32;
130
131/// The primary button. This is typically the left mouse button, or the right button in a left-handed setup.
132#[doc(alias = "GDK_BUTTON_PRIMARY")]
133pub const BUTTON_PRIMARY: u32 = ffi::GDK_BUTTON_PRIMARY as u32;
134
135/// The middle button.
136#[doc(alias = "GDK_BUTTON_MIDDLE")]
137pub const BUTTON_MIDDLE: u32 = ffi::GDK_BUTTON_MIDDLE as u32;
138
139/// The secondary button. This is typically the right mouse button, or the left button in a left-handed setup.
140#[doc(alias = "GDK_BUTTON_SECONDARY")]
141pub const BUTTON_SECONDARY: u32 = ffi::GDK_BUTTON_SECONDARY as u32;
142
143// Used as the return value for stopping the propagation of an event handler.
144#[doc(alias = "GDK_EVENT_STOP")]
145pub const EVENT_STOP: u32 = ffi::GDK_EVENT_STOP as u32;
146
147// Used as the return value for continuing the propagation of an event handler.
148#[doc(alias = "GDK_EVENT_PROPAGATE")]
149pub const EVENT_PROPAGATE: u32 = ffi::GDK_EVENT_PROPAGATE as u32;