1#![cfg_attr(docsrs, feature(doc_cfg))]
4#![allow(clippy::missing_safety_doc)]
5#![allow(clippy::manual_c_str_literals)]
6#![allow(renamed_and_removed_lints)]
7#![doc = include_str!("../README.md")]
28
29extern crate self as glib;
31
32pub use bitflags;
33#[doc(hidden)]
34pub use glib_macros::cstr_bytes;
35pub use glib_macros::{
36 async_test, clone, closure, closure_local, derived_properties, flags, object_interface,
37 object_subclass, Boxed, Downgrade, Enum, ErrorDomain, Properties, SharedBoxed, ValueDelegate,
38 Variant,
39};
40pub use glib_sys as ffi;
41pub use gobject_sys as gobject_ffi;
42
43pub use self::{
44 byte_array::ByteArray,
45 bytes::Bytes,
46 closure::{Closure, RustClosure},
47 enums::{EnumClass, EnumValue, FlagsBuilder, FlagsClass, FlagsValue, UserDirectory},
48 error::{BoolError, Error},
49 object::{BorrowedObject, Class, InitiallyUnowned, Interface, Object, SendWeakRef, WeakRef},
50 signal::{
51 signal_handler_block, signal_handler_disconnect, signal_handler_unblock,
52 signal_stop_emission_by_name, Propagation, SignalHandlerId,
53 },
54 types::{ILong, Pointer, Type, ULong},
55 value::{BoxedValue, SendValue, Value},
56 variant::{FixedSizeVariantArray, Variant},
57 variant_dict::VariantDict,
58 variant_iter::{VariantIter, VariantStrIter},
59 variant_type::{VariantTy, VariantTyIterator, VariantType},
60 FileError,
61};
62
63#[macro_export]
93macro_rules! function_name {
94 () => {{
95 fn f() {}
97 fn type_name_of<T>(_: T) -> &'static str {
98 std::any::type_name::<T>()
99 }
100 let name = type_name_of(f);
101 &name[..name.len() - 3]
103 }};
104}
105
106pub mod clone;
107#[macro_use]
108pub mod wrapper;
109#[macro_use]
110pub mod boxed;
111#[macro_use]
112pub mod boxed_inline;
113#[macro_use]
114pub mod shared;
115#[macro_use]
116pub mod error;
117#[macro_use]
118pub mod object;
119
120mod boxed_any_object;
121pub use boxed_any_object::BoxedAnyObject;
122mod exit_code;
123pub use exit_code::{ExitCode, InvalidExitCode};
124
125pub mod collections;
126pub use collections::{List, PtrSlice, SList, Slice, StrV, StrVRef};
127
128pub use self::auto::*;
129#[allow(clippy::too_many_arguments)]
130#[allow(clippy::type_complexity)]
131#[allow(unused_imports)]
132#[allow(non_upper_case_globals)]
133mod auto;
134
135#[cfg(feature = "v2_74")]
136#[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
137pub use self::gobject::SignalGroup;
138pub use self::gobject::{
139 Binding, BindingFlags, InterfaceInfo, ParamFlags, SignalFlags, TypeFlags, TypeInfo, TypeModule,
140 TypePlugin, TypeValueTable,
141};
142#[cfg(feature = "v2_72")]
143#[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
144pub use self::gobject::{BindingGroup, BindingGroupBuilder};
145
146mod gobject;
147
148mod byte_array;
149mod bytes;
150mod control_flow;
151pub use self::control_flow::ControlFlow;
152pub mod char;
153pub use self::char::{Char, UChar};
154mod checksum;
155pub mod closure;
156mod convert;
157pub use self::convert::*;
158pub mod enums;
159mod functions;
160pub use self::functions::*;
161mod key_file;
162pub mod prelude;
163pub mod signal;
164pub mod source;
165pub use self::source::*;
166#[macro_use]
167pub mod translate;
168mod gstring;
169pub use self::gstring::*;
170mod gstring_builder;
171pub use self::gstring_builder::GStringBuilder;
172pub mod types;
173mod unicollate;
174pub use self::unicollate::{CollationKey, FilenameCollationKey};
175mod utils;
176pub use self::utils::*;
177mod unichar;
178pub use self::unichar::*;
179mod main_context;
180pub use self::main_context::MainContextAcquireGuard;
181mod date;
182mod date_time;
183mod time_span;
184mod time_zone;
185pub use self::time_span::TimeSpan;
186pub mod value;
187pub mod variant;
188mod variant_dict;
189mod variant_iter;
190mod variant_type;
191pub use self::date::Date;
192mod value_array;
193pub use self::value_array::ValueArray;
194mod param_spec;
195pub use self::param_spec::*;
196pub mod property;
197mod quark;
198pub use self::quark::Quark;
199pub mod match_info;
200pub use self::match_info::MatchInfo;
201pub mod regex;
202#[macro_use]
203mod log;
204#[doc(hidden)]
205#[cfg(feature = "log_macros")]
206#[cfg_attr(docsrs, doc(cfg(feature = "log_macros")))]
207pub use rs_log;
208
209pub use self::log::{
210 log_default_handler, log_remove_handler, log_set_always_fatal, log_set_default_handler,
211 log_set_fatal_mask, log_set_handler, log_set_writer_func, log_structured_array,
212 log_unset_default_handler, log_variant, log_writer_default, log_writer_format_fields,
213 log_writer_journald, log_writer_standard_streams, set_print_handler, set_printerr_handler,
214 unset_print_handler, unset_printerr_handler, LogField, LogHandlerId, LogLevel, LogLevels,
215};
216#[cfg(feature = "v2_68")]
217pub use self::log::{log_writer_default_set_use_stderr, log_writer_default_would_drop};
218#[cfg(unix)]
219pub use self::log::{log_writer_is_journald, log_writer_supports_color};
220
221#[cfg(feature = "log")]
222#[cfg_attr(docsrs, doc(cfg(feature = "log")))]
223#[macro_use]
224mod bridged_logging;
225#[cfg(feature = "log")]
226#[cfg_attr(docsrs, doc(cfg(feature = "log")))]
227pub use self::bridged_logging::{
228 rust_log_handler, rust_log_writer, GlibLogger, GlibLoggerDomain, GlibLoggerFormat,
229};
230
231#[macro_use]
232pub mod subclass;
233
234#[cfg(feature = "futures")]
235mod main_context_futures;
236#[cfg(feature = "futures")]
237pub use main_context_futures::{JoinError, JoinHandle, SpawnWithinJoinHandle};
238#[cfg(feature = "futures")]
239mod source_futures;
240#[cfg(feature = "futures")]
241pub use self::source_futures::*;
242
243#[cfg(feature = "futures")]
244mod future_with_timeout;
245#[cfg(feature = "futures")]
246pub use self::future_with_timeout::*;
247
248mod thread_pool;
249pub use self::thread_pool::{ThreadHandle, ThreadPool};
250
251pub mod thread_guard;
252
253pub const CLONE_MACRO_LOG_DOMAIN: &str = "glib-rs-clone";
258
259#[cfg(target_family = "windows")]
260mod win32;
261
262#[cfg(target_family = "windows")]
263pub use self::win32::*;