gtk/lib.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3#![allow(clippy::needless_doctest_main)]
4#![allow(clippy::upper_case_acronyms)]
5#![allow(clippy::wrong_self_convention)]
6#![doc = include_str!("../README.md")]
7#![allow(clippy::type_complexity)]
8#![allow(clippy::derived_hash_with_manual_eq)]
9#![allow(clippy::too_many_arguments)]
10#![allow(clippy::missing_safety_doc)]
11#![allow(clippy::new_without_default)]
12#![cfg_attr(docsrs, feature(doc_cfg))]
13
14pub use ffi;
15// Re-export gtk dependencies
16pub use atk;
17pub use cairo;
18pub use gdk;
19pub use gdk_pixbuf;
20pub use gio;
21pub use glib;
22pub use pango;
23
24#[doc(hidden)]
25pub use field_offset::*;
26#[doc(hidden)]
27pub use gtk3_macros::*;
28
29pub mod xlib;
30
31/// The priority used for default style information
32/// that is used in the absence of themes.
33///
34/// Note that this is not very useful for providing default
35/// styling for custom style classes - themes are likely to
36/// override styling provided at this priority with
37/// catch-all `* {...}` rules.
38#[doc(alias = "GTK_STYLE_PROVIDER_PRIORITY_FALLBACK")]
39pub const STYLE_PROVIDER_PRIORITY_FALLBACK: u32 = ffi::GTK_STYLE_PROVIDER_PRIORITY_FALLBACK as u32;
40/// The priority used for style information provided
41/// by themes.
42#[doc(alias = "GTK_STYLE_PROVIDER_PRIORITY_THEME")]
43pub const STYLE_PROVIDER_PRIORITY_THEME: u32 = ffi::GTK_STYLE_PROVIDER_PRIORITY_THEME as u32;
44/// The priority used for style information provided
45/// via [`Settings`][crate::Settings].
46///
47/// This priority is higher than `GTK_STYLE_PROVIDER_PRIORITY_THEME`
48/// to let settings override themes.
49#[doc(alias = "GTK_STYLE_PROVIDER_PRIORITY_SETTINGS")]
50pub const STYLE_PROVIDER_PRIORITY_SETTINGS: u32 = ffi::GTK_STYLE_PROVIDER_PRIORITY_SETTINGS as u32;
51/// A priority that can be used when adding a [`StyleProvider`][crate::StyleProvider]
52/// for application-specific style information.
53#[doc(alias = "GTK_STYLE_PROVIDER_PRIORITY_APPLICATION")]
54pub const STYLE_PROVIDER_PRIORITY_APPLICATION: u32 =
55 ffi::GTK_STYLE_PROVIDER_PRIORITY_APPLICATION as u32;
56/// The priority used for the style information from
57/// `XDG_CONFIG_HOME/gtk-3.0/gtk.css`.
58///
59/// You should not use priorities higher than this, to
60/// give the user the last word.
61#[doc(alias = "GTK_STYLE_PROVIDER_PRIORITY_USER")]
62pub const STYLE_PROVIDER_PRIORITY_USER: u32 = ffi::GTK_STYLE_PROVIDER_PRIORITY_USER as u32;
63
64#[macro_use]
65mod rt;
66
67#[cfg(test)]
68pub(crate) static TEST_THREAD_WORKER: glib::once_cell::sync::Lazy<glib::ThreadPool> =
69 glib::once_cell::sync::Lazy::new(|| {
70 let pool = glib::ThreadPool::exclusive(1).unwrap();
71 pool.push(move || {
72 crate::init().expect("Tests failed to initialize gtk");
73 })
74 .expect("Failed to schedule a test call");
75 pool
76 });
77
78#[allow(clippy::let_and_return)]
79#[allow(clippy::many_single_char_names)]
80#[allow(clippy::wrong_self_convention)]
81#[allow(clippy::clone_on_copy)]
82#[allow(unused_imports)]
83mod auto;
84
85mod accel_group;
86mod app_chooser;
87mod application;
88mod application_window;
89mod border;
90mod buildable;
91mod builder;
92mod cell_renderer_pixbuf;
93mod clipboard;
94mod color_button;
95mod color_chooser;
96mod combo_box;
97mod container;
98mod dialog;
99mod drag_context;
100mod entry;
101mod entry_buffer;
102mod entry_completion;
103mod enums;
104mod file_chooser;
105mod file_chooser_dialog;
106mod file_filter_info;
107mod fixed;
108mod flow_box;
109mod functions;
110#[cfg(feature = "v3_24")]
111mod gesture_stylus;
112mod im_context_simple;
113mod image;
114mod invisible;
115mod list_box;
116mod list_store;
117mod menu;
118mod message_dialog;
119mod native_dialog;
120mod notebook;
121mod pad_action_entry;
122mod pad_controller;
123mod page_range;
124mod print_operation;
125mod print_settings;
126mod radio_button;
127mod radio_menu_item;
128mod radio_tool_button;
129mod recent_chooser_dialog;
130mod recent_data;
131mod requisition;
132mod response_type;
133mod selection_data;
134mod signal;
135mod stack_switcher;
136mod style_context;
137mod switch;
138mod target_entry;
139mod target_list;
140mod text_buffer;
141mod text_iter;
142mod tree_model_filter;
143mod tree_path;
144mod tree_row_reference;
145mod tree_sortable;
146mod tree_store;
147mod tree_view_column;
148mod widget;
149
150#[macro_use]
151pub mod subclass;
152
153pub mod builders;
154pub mod prelude;
155
156pub use crate::auto::functions::*;
157pub use crate::auto::*;
158pub use crate::rt::*;
159pub use crate::signal::*;
160
161pub use gdk::Rectangle as Allocation;
162pub use gdk::Rectangle;
163
164pub use crate::app_chooser::AppChooser;
165pub use crate::border::Border;
166pub use crate::entry_buffer::EntryBuffer;
167pub use crate::file_filter_info::FileFilterInfo;
168pub use crate::page_range::PageRange;
169pub use crate::recent_data::RecentData;
170pub use crate::requisition::Requisition;
171pub use crate::response_type::ResponseType;
172pub use crate::target_entry::TargetEntry;
173pub use crate::tree_sortable::SortColumn;
174pub use crate::widget::TickCallbackId;
175pub use functions::*;
176pub use pad_action_entry::PadActionEntry;