Skip to main content

gtk4/subclass/
mod.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3// rustdoc-stripper-ignore-next
4//! Traits intended for creating custom types.
5
6// rustdoc-stripper-ignore-next
7/// Struct to hold a pointer and free it on `Drop::drop`
8pub(crate) struct PtrHolder<T, F: Fn(*mut T) + 'static>(*mut T, F);
9
10impl<T, F: Fn(*mut T) + 'static> Drop for PtrHolder<T, F> {
11    #[inline]
12    fn drop(&mut self) {
13        (self.1)(self.0)
14    }
15}
16
17#[cfg(feature = "v4_10")]
18#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
19pub mod accessible;
20#[cfg(feature = "v4_10")]
21#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
22pub mod accessible_range;
23#[cfg(feature = "v4_14")]
24#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
25pub mod accessible_text;
26pub mod actionable;
27pub mod adjustment;
28pub mod application;
29pub mod application_window;
30pub mod box_;
31pub mod buildable;
32mod buildable_parser;
33pub mod builder_scope;
34pub mod button;
35pub mod cell_area;
36pub mod cell_area_context;
37pub mod cell_editable;
38pub mod cell_layout;
39pub mod cell_renderer;
40pub mod cell_renderer_text;
41pub mod check_button;
42pub mod color_chooser;
43pub mod combo_box;
44pub mod dialog;
45pub mod drawing_area;
46pub mod editable;
47pub mod entry;
48pub mod entry_buffer;
49pub mod filter;
50pub mod fixed;
51pub mod flow_box_child;
52pub mod font_chooser;
53pub mod frame;
54pub mod gl_area;
55pub mod grid;
56pub mod im_context;
57pub mod layout_child;
58pub mod layout_manager;
59pub mod list_box_row;
60pub mod media_file;
61pub mod media_stream;
62pub mod native_dialog;
63pub mod orientable;
64pub mod popover;
65pub mod print_operation;
66pub mod print_operation_preview;
67pub mod range;
68pub mod recent_manager;
69pub mod scale;
70pub mod scale_button;
71pub mod scrollable;
72#[cfg(feature = "v4_12")]
73#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
74pub mod section_model;
75pub mod selection_model;
76pub mod shortcut_manager;
77pub mod sorter;
78pub mod style_context;
79#[cfg(feature = "v4_6")]
80#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
81pub mod symbolic_paintable;
82pub mod text_buffer;
83pub mod text_view;
84pub mod toggle_button;
85pub mod tree_drag_dest;
86pub mod tree_drag_source;
87pub mod tree_model_filter;
88pub mod tree_view;
89pub mod widget;
90pub mod window;
91pub mod window_group;
92
93pub use buildable_parser::{BuildableParseContext, BuildableParser, BuildableParserImpl};
94
95// rustdoc-stripper-ignore-next
96/// Traits intended for blanket imports.
97pub mod prelude {
98    #[doc(hidden)]
99    pub use gdk::subclass::prelude::*;
100
101    #[cfg(feature = "v4_10")]
102    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
103    pub use super::accessible::{AccessibleImpl, AccessibleImplExt};
104    #[cfg(feature = "v4_10")]
105    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
106    pub use super::accessible_range::{AccessibleRangeImpl, AccessibleRangeImplExt};
107    #[cfg(feature = "v4_14")]
108    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
109    pub use super::accessible_text::{AccessibleTextImpl, AccessibleTextImplExt};
110    #[cfg(feature = "v4_12")]
111    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
112    pub use super::section_model::{SectionModelImpl, SectionModelImplExt};
113    #[cfg(feature = "v4_6")]
114    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
115    pub use super::symbolic_paintable::{SymbolicPaintableImpl, SymbolicPaintableImplExt};
116    pub use super::{
117        actionable::{ActionableImpl, ActionableImplExt},
118        adjustment::{AdjustmentImpl, AdjustmentImplExt},
119        application::{GtkApplicationImpl, GtkApplicationImplExt},
120        application_window::{ApplicationWindowImpl, ApplicationWindowImplExt},
121        box_::BoxImpl,
122        buildable::{BuildableImpl, BuildableImplExt},
123        builder_scope::{BuilderCScopeImpl, BuilderScopeImpl, BuilderScopeImplExt},
124        button::{ButtonImpl, ButtonImplExt},
125        cell_area::{CellAreaClassExt, CellAreaImpl, CellAreaImplExt},
126        cell_area_context::{CellAreaContextImpl, CellAreaContextImplExt},
127        cell_editable::{CellEditableImpl, CellEditableImplExt},
128        cell_layout::{CellLayoutImpl, CellLayoutImplExt},
129        cell_renderer::{CellRendererImpl, CellRendererImplExt},
130        cell_renderer_text::{CellRendererTextImpl, CellRendererTextImplExt},
131        check_button::{CheckButtonImpl, CheckButtonImplExt},
132        color_chooser::{ColorChooserImpl, ColorChooserImplExt},
133        combo_box::{ComboBoxImpl, ComboBoxImplExt},
134        dialog::{DialogImpl, DialogImplExt},
135        drawing_area::{DrawingAreaImpl, DrawingAreaImplExt},
136        editable::{EditableImpl, EditableImplExt},
137        entry::{EntryImpl, EntryImplExt},
138        entry_buffer::{EntryBufferImpl, EntryBufferImplExt},
139        filter::{FilterImpl, FilterImplExt},
140        fixed::FixedImpl,
141        flow_box_child::{FlowBoxChildImpl, FlowBoxChildImplExt},
142        font_chooser::{FontChooserImpl, FontChooserImplExt},
143        frame::{FrameImpl, FrameImplExt},
144        gl_area::{GLAreaImpl, GLAreaImplExt},
145        grid::GridImpl,
146        im_context::{IMContextImpl, IMContextImplExt},
147        layout_child::LayoutChildImpl,
148        layout_manager::{LayoutManagerImpl, LayoutManagerImplExt},
149        list_box_row::{ListBoxRowImpl, ListBoxRowImplExt},
150        media_file::{MediaFileImpl, MediaFileImplExt},
151        media_stream::{MediaStreamImpl, MediaStreamImplExt},
152        native_dialog::{NativeDialogImpl, NativeDialogImplExt},
153        orientable::OrientableImpl,
154        popover::{PopoverImpl, PopoverImplExt},
155        print_operation::{PrintOperationImpl, PrintOperationImplExt},
156        print_operation_preview::PrintOperationPreviewImpl,
157        range::{RangeImpl, RangeImplExt},
158        recent_manager::{RecentManagerImpl, RecentManagerImplExt},
159        scale::{ScaleImpl, ScaleImplExt},
160        scale_button::{ScaleButtonImpl, ScaleButtonImplExt},
161        scrollable::{ScrollableImpl, ScrollableImplExt},
162        selection_model::{SelectionModelImpl, SelectionModelImplExt},
163        shortcut_manager::{ShortcutManagerImpl, ShortcutManagerImplExt},
164        sorter::{SorterImpl, SorterImplExt},
165        style_context::{StyleContextImpl, StyleContextImplExt},
166        text_buffer::{TextBufferImpl, TextBufferImplExt},
167        text_view::{TextViewImpl, TextViewImplExt},
168        toggle_button::{ToggleButtonImpl, ToggleButtonImplExt},
169        tree_drag_dest::{TreeDragDestImpl, TreeDragDestImplExt},
170        tree_drag_source::{TreeDragSourceImpl, TreeDragSourceImplExt},
171        tree_model_filter::{TreeModelFilterImpl, TreeModelFilterImplExt},
172        tree_view::{TreeViewImpl, TreeViewImplExt},
173        widget::{
174            CompositeTemplate, CompositeTemplateCallbacks, CompositeTemplateCallbacksClass,
175            CompositeTemplateClass, CompositeTemplateDisposeExt, CompositeTemplateInitializingExt,
176            CompositeTemplateInstanceCallbacksClass, TemplateChild, WidgetClassExt, WidgetImpl,
177            WidgetImplExt,
178        },
179        window::{WindowImpl, WindowImplExt},
180        window_group::WindowGroupImpl,
181    };
182    pub use crate::widget::WidgetClassManualExt;
183}