sourceview5/
lib.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![allow(clippy::needless_doctest_main)]
4#![doc(
5    html_logo_url = "https://gnome.pages.gitlab.gnome.org/gtksourceview/gtksourceview5/logo.svg",
6    html_favicon_url = "https://gnome.pages.gitlab.gnome.org/gtksourceview/gtksourceview5/logo.svg"
7)]
8
9//! # GtkSourceView 5 Rust bindings
10//!
11//! This library contains safe Rust bindings for [GtkSourceView](https://gitlab.gnome.org/GNOME/gtksourceview).
12//!
13//! See also
14//!
15//! - [GTK 4 Rust bindings documentation](mod@gtk)
16//! - [The C API documentation](https://gnome.pages.gitlab.gnome.org/gtksourceview/gtksourceview5/)
17//! - [gtk-rs project overview](https://gtk-rs.org/)
18
19// Re-export -sys
20pub use ffi;
21#[doc(hidden)]
22pub use gdk_pixbuf;
23#[doc(hidden)]
24pub use gio;
25#[doc(hidden)]
26pub use glib;
27#[doc(hidden)]
28pub use gtk;
29
30macro_rules! assert_initialized_main_thread {
31    () => {
32        if !::gtk::is_initialized_main_thread() {
33            if ::gtk::is_initialized() {
34                panic!("GtkSourceView may only be used from the main thread.");
35            } else {
36                panic!("Gtk has to be initialized before using GtkSourceView.");
37            }
38        }
39    };
40}
41
42macro_rules! skip_assert_initialized {
43    () => {};
44}
45
46#[allow(clippy::clone_on_copy)]
47#[allow(clippy::let_and_return)]
48#[allow(clippy::type_complexity)]
49#[allow(unused_doc_comments)]
50#[allow(unused_imports)]
51mod auto;
52pub use auto::functions::*;
53mod file_loader;
54mod file_saver;
55mod hover_context;
56pub use auto::*;
57pub mod subclass;
58
59mod region_iter;
60mod search_context;
61mod view;
62
63pub mod prelude;
64pub use region_iter::RegionIter;