diff --git a/examples/composite_dialog/my_app_window/mod.rs b/examples/composite_dialog/my_app_window/mod.rs index 36c2dce3dc6c..2e2e79cc70b2 100644 --- a/examples/composite_dialog/my_app_window/mod.rs +++ b/examples/composite_dialog/my_app_window/mod.rs @@ -2,11 +2,14 @@ #[allow(deprecated)] mod imp; -use gtk::{glib, prelude::*, subclass::prelude::*}; +use gtk::{gio, glib, prelude::*, subclass::prelude::*}; glib::wrapper! { pub struct MyAppWindow(ObjectSubclass) - @extends gtk::Widget, gtk::Window, gtk::ApplicationWindow; + @extends gtk::Widget, gtk::Window, gtk::ApplicationWindow, + @implements gtk::Accessible, gio::ActionGroup, gio::ActionMap, + gtk::Buildable, gtk::ConstraintTarget, gtk::Native, gtk::Root, + gtk::ShortcutManager; } #[gtk::template_callbacks] diff --git a/examples/confetti_snapshot_animation/confetti_widget/mod.rs b/examples/confetti_snapshot_animation/confetti_widget/mod.rs index 7fd02de499ea..b52e9e3d15c5 100644 --- a/examples/confetti_snapshot_animation/confetti_widget/mod.rs +++ b/examples/confetti_snapshot_animation/confetti_widget/mod.rs @@ -9,7 +9,9 @@ use gtk::{ use crate::{AnimatedExplosion, ExplosionParameters}; glib::wrapper! { - pub struct ConfettiWidget(ObjectSubclass) @implements gtk::Widget; + pub struct ConfettiWidget(ObjectSubclass) + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for ConfettiWidget { diff --git a/examples/custom_layout_manager/custom_layout_child/mod.rs b/examples/custom_layout_manager/custom_layout_child/mod.rs index 554ead3de805..e0fc15c773e7 100644 --- a/examples/custom_layout_manager/custom_layout_child/mod.rs +++ b/examples/custom_layout_manager/custom_layout_child/mod.rs @@ -4,7 +4,8 @@ use gtk::{gdk, glib}; glib::wrapper! { pub struct CustomLayoutChild(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl CustomLayoutChild { diff --git a/examples/custom_layout_manager/simple_widget/mod.rs b/examples/custom_layout_manager/simple_widget/mod.rs index 974dd1c30acb..9271688d06d4 100644 --- a/examples/custom_layout_manager/simple_widget/mod.rs +++ b/examples/custom_layout_manager/simple_widget/mod.rs @@ -10,7 +10,8 @@ use crate::custom_layout::CustomLayout; glib::wrapper! { pub struct SimpleWidget(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for SimpleWidget { diff --git a/examples/custom_orientable/custom_orientable/mod.rs b/examples/custom_orientable/custom_orientable/mod.rs index 5bb1f4e78774..c64ecacbb847 100644 --- a/examples/custom_orientable/custom_orientable/mod.rs +++ b/examples/custom_orientable/custom_orientable/mod.rs @@ -5,7 +5,7 @@ use gtk::glib; glib::wrapper! { pub struct CustomOrientable(ObjectSubclass) @extends gtk::Widget, - @implements gtk::Orientable; + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable; } impl Default for CustomOrientable { diff --git a/examples/custom_widget/ex_button/mod.rs b/examples/custom_widget/ex_button/mod.rs index d9ff1748fb04..dfd0ea33b779 100644 --- a/examples/custom_widget/ex_button/mod.rs +++ b/examples/custom_widget/ex_button/mod.rs @@ -5,7 +5,7 @@ use gtk::glib; glib::wrapper! { pub struct ExButton(ObjectSubclass) @extends gtk::Widget, - @implements gtk::Accessible; + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for ExButton { diff --git a/examples/rotation_bin/rotation_bin/mod.rs b/examples/rotation_bin/rotation_bin/mod.rs index 0d34f6653b08..987470059fa7 100644 --- a/examples/rotation_bin/rotation_bin/mod.rs +++ b/examples/rotation_bin/rotation_bin/mod.rs @@ -46,7 +46,8 @@ impl From for f32 { glib::wrapper! { pub struct RotationBin(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for RotationBin { diff --git a/examples/scale_bin/scale_bin/mod.rs b/examples/scale_bin/scale_bin/mod.rs index 361639a6166d..5bd8b25b9df8 100644 --- a/examples/scale_bin/scale_bin/mod.rs +++ b/examples/scale_bin/scale_bin/mod.rs @@ -4,7 +4,8 @@ use gtk::glib; glib::wrapper! { pub struct ScaleBin(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for ScaleBin { diff --git a/examples/squares/squares_widget/mod.rs b/examples/squares/squares_widget/mod.rs index d6daeadcc035..d82e8971802d 100644 --- a/examples/squares/squares_widget/mod.rs +++ b/examples/squares/squares_widget/mod.rs @@ -4,7 +4,8 @@ use gtk::glib; glib::wrapper! { pub struct SquaresWidget(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for SquaresWidget { diff --git a/examples/squeezer_bin/squeezer_bin/mod.rs b/examples/squeezer_bin/squeezer_bin/mod.rs index e7fc5c91c879..10a0872466c9 100644 --- a/examples/squeezer_bin/squeezer_bin/mod.rs +++ b/examples/squeezer_bin/squeezer_bin/mod.rs @@ -4,7 +4,8 @@ use gtk::glib; glib::wrapper! { pub struct SqueezerBin(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for SqueezerBin { diff --git a/examples/virtual_methods/base_button/mod.rs b/examples/virtual_methods/base_button/mod.rs index a0139bcd5356..01449499700c 100644 --- a/examples/virtual_methods/base_button/mod.rs +++ b/examples/virtual_methods/base_button/mod.rs @@ -11,7 +11,8 @@ pub type PinnedFuture = Pin>>; glib::wrapper! { /// Public type for the `BaseButton` instances. pub struct BaseButton(ObjectSubclass) - @extends gtk::Widget, gtk::Button; + @extends gtk::Widget, gtk::Button, + @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; } impl Default for BaseButton { diff --git a/examples/virtual_methods/derived_button/mod.rs b/examples/virtual_methods/derived_button/mod.rs index 53092c1fb282..bdbb04c9654d 100644 --- a/examples/virtual_methods/derived_button/mod.rs +++ b/examples/virtual_methods/derived_button/mod.rs @@ -4,7 +4,8 @@ use gtk::glib; glib::wrapper! { pub struct DerivedButton(ObjectSubclass) - @extends gtk::Widget, gtk::Button, crate::base_button::BaseButton; + @extends gtk::Widget, gtk::Button, crate::base_button::BaseButton, + @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; } impl Default for DerivedButton { diff --git a/gtk4-macros/tests/templates.rs b/gtk4-macros/tests/templates.rs index c581d190c79d..de4f59e9210a 100644 --- a/gtk4-macros/tests/templates.rs +++ b/gtk4-macros/tests/templates.rs @@ -53,7 +53,9 @@ mod imp { } glib::wrapper! { - pub struct MyWidget(ObjectSubclass) @extends gtk::Widget; + pub struct MyWidget(ObjectSubclass) + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } #[gtk::test] @@ -145,7 +147,9 @@ mod imp2 { } glib::wrapper! { - pub struct MyWidget2(ObjectSubclass) @extends gtk::Widget; + pub struct MyWidget2(ObjectSubclass) + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } #[gtk::test] @@ -192,7 +196,9 @@ mod imp3 { } glib::wrapper! { - pub struct MyWidget3(ObjectSubclass) @extends gtk::Widget; + pub struct MyWidget3(ObjectSubclass) + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } #[gtk::test] diff --git a/gtk4/src/subclass/application_window.rs b/gtk4/src/subclass/application_window.rs index 7fd9c26b96e8..58decd5888a3 100644 --- a/gtk4/src/subclass/application_window.rs +++ b/gtk4/src/subclass/application_window.rs @@ -6,7 +6,9 @@ use crate::{prelude::*, subclass::prelude::*, ApplicationWindow}; pub trait ApplicationWindowImpl: - WindowImpl + ObjectSubclass> + 'static + WindowImpl + + ObjectSubclass + IsA + IsA> + + 'static { } diff --git a/gtk4/src/subclass/button.rs b/gtk4/src/subclass/button.rs index f29cb8dca7b8..54a72a46ef10 100644 --- a/gtk4/src/subclass/button.rs +++ b/gtk4/src/subclass/button.rs @@ -5,9 +5,9 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, Button}; +use crate::{ffi, prelude::*, subclass::prelude::*, Actionable, Button}; -pub trait ButtonImpl: WidgetImpl + ObjectSubclass> { +pub trait ButtonImpl: WidgetImpl + ObjectSubclass + IsA> { fn activate(&self) { self.parent_activate() } diff --git a/gtk4/src/subclass/cell_area.rs b/gtk4/src/subclass/cell_area.rs index cb56103b1b32..5f1e278bc241 100644 --- a/gtk4/src/subclass/cell_area.rs +++ b/gtk4/src/subclass/cell_area.rs @@ -8,8 +8,9 @@ use std::mem; use glib::{translate::*, ParamSpec, Value}; use crate::{ - ffi, prelude::*, subclass::prelude::*, CellArea, CellAreaContext, CellRenderer, - CellRendererState, DirectionType, SizeRequestMode, Snapshot, TreeIter, TreeModel, Widget, + ffi, prelude::*, subclass::prelude::*, Buildable, CellArea, CellAreaContext, CellLayout, + CellRenderer, CellRendererState, DirectionType, SizeRequestMode, Snapshot, TreeIter, TreeModel, + Widget, }; #[derive(Debug)] @@ -63,7 +64,9 @@ impl CellCallbackAllocate { #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] -pub trait CellAreaImpl: ObjectImpl + ObjectSubclass> { +pub trait CellAreaImpl: + ObjectImpl + ObjectSubclass + IsA + IsA> +{ fn cell_properties() -> &'static [ParamSpec] { &[] } diff --git a/gtk4/src/subclass/cell_editable.rs b/gtk4/src/subclass/cell_editable.rs index 16b1cc6f4bdf..97a5b16c49c9 100644 --- a/gtk4/src/subclass/cell_editable.rs +++ b/gtk4/src/subclass/cell_editable.rs @@ -9,7 +9,7 @@ use crate::{ffi, prelude::*, subclass::prelude::*, CellEditable}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] -pub trait CellEditableImpl: ObjectImpl + ObjectSubclass> { +pub trait CellEditableImpl: WidgetImpl + ObjectSubclass> { fn editing_done(&self) { self.parent_editing_done() } diff --git a/gtk4/src/subclass/check_button.rs b/gtk4/src/subclass/check_button.rs index 5717a3374a40..5ecf81090d3c 100644 --- a/gtk4/src/subclass/check_button.rs +++ b/gtk4/src/subclass/check_button.rs @@ -5,9 +5,11 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, CheckButton}; +use crate::{ffi, prelude::*, subclass::prelude::*, Actionable, CheckButton}; -pub trait CheckButtonImpl: WidgetImpl + ObjectSubclass> { +pub trait CheckButtonImpl: + WidgetImpl + ObjectSubclass + IsA> +{ fn toggled(&self) { self.parent_toggled() } diff --git a/gtk4/src/subclass/combo_box.rs b/gtk4/src/subclass/combo_box.rs index 23cb62da23c7..7bad87c9c281 100644 --- a/gtk4/src/subclass/combo_box.rs +++ b/gtk4/src/subclass/combo_box.rs @@ -5,11 +5,13 @@ use glib::{translate::*, GString}; -use crate::{ffi, prelude::*, subclass::prelude::*, ComboBox}; +use crate::{ffi, prelude::*, subclass::prelude::*, CellEditable, CellLayout, ComboBox}; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] -pub trait ComboBoxImpl: WidgetImpl + ObjectSubclass> { +pub trait ComboBoxImpl: + WidgetImpl + ObjectSubclass + IsA + IsA> +{ #[cfg(feature = "v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))] fn activate(&self) { diff --git a/gtk4/src/subclass/entry.rs b/gtk4/src/subclass/entry.rs index 658562098fd6..0e3b6f0e138a 100644 --- a/gtk4/src/subclass/entry.rs +++ b/gtk4/src/subclass/entry.rs @@ -5,9 +5,9 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, Entry}; +use crate::{ffi, prelude::*, subclass::prelude::*, CellEditable, Entry}; -pub trait EntryImpl: WidgetImpl + ObjectSubclass> { +pub trait EntryImpl: WidgetImpl + ObjectSubclass + IsA> { fn activate(&self) { self.parent_activate() } diff --git a/gtk4/src/subclass/grid.rs b/gtk4/src/subclass/grid.rs index a1e009ee908e..b00cd6ccf83e 100644 --- a/gtk4/src/subclass/grid.rs +++ b/gtk4/src/subclass/grid.rs @@ -3,8 +3,8 @@ // rustdoc-stripper-ignore-next //! Traits intended for subclassing [`Grid`]. -use crate::{prelude::*, subclass::prelude::*, Grid}; +use crate::{prelude::*, subclass::prelude::*, Grid, Orientable}; -pub trait GridImpl: WidgetImpl + ObjectSubclass> {} +pub trait GridImpl: WidgetImpl + ObjectSubclass + IsA> {} unsafe impl IsSubclassable for Grid {} diff --git a/gtk4/src/subclass/list_box_row.rs b/gtk4/src/subclass/list_box_row.rs index 4b9d50e585eb..df237bfc9221 100644 --- a/gtk4/src/subclass/list_box_row.rs +++ b/gtk4/src/subclass/list_box_row.rs @@ -5,9 +5,11 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, ListBoxRow}; +use crate::{ffi, prelude::*, subclass::prelude::*, Actionable, ListBoxRow}; -pub trait ListBoxRowImpl: WidgetImpl + ObjectSubclass> { +pub trait ListBoxRowImpl: + WidgetImpl + ObjectSubclass + IsA> +{ fn activate(&self) { self.parent_activate() } diff --git a/gtk4/src/subclass/media_file.rs b/gtk4/src/subclass/media_file.rs index 3ae20a0d50f8..1e3720cec50b 100644 --- a/gtk4/src/subclass/media_file.rs +++ b/gtk4/src/subclass/media_file.rs @@ -3,11 +3,14 @@ // rustdoc-stripper-ignore-next //! Traits intended for subclassing [`MediaFile`]. +use gdk::Paintable; use glib::translate::*; use crate::{ffi, prelude::*, subclass::prelude::*, MediaFile}; -pub trait MediaFileImpl: MediaStreamImpl + ObjectSubclass> { +pub trait MediaFileImpl: + MediaStreamImpl + ObjectSubclass + IsA> +{ fn close(&self) { self.parent_close() } diff --git a/gtk4/src/subclass/media_stream.rs b/gtk4/src/subclass/media_stream.rs index 9873fcbe6ac6..00d57cc01b6a 100644 --- a/gtk4/src/subclass/media_stream.rs +++ b/gtk4/src/subclass/media_stream.rs @@ -3,11 +3,14 @@ // rustdoc-stripper-ignore-next //! Traits intended for subclassing [`MediaStream`]. +use gdk::Paintable; use glib::translate::*; use crate::{ffi, prelude::*, subclass::prelude::*, MediaStream}; -pub trait MediaStreamImpl: ObjectImpl + ObjectSubclass> { +pub trait MediaStreamImpl: + ObjectImpl + ObjectSubclass + IsA> +{ fn pause(&self) { self.parent_pause() } diff --git a/gtk4/src/subclass/popover.rs b/gtk4/src/subclass/popover.rs index 3e799ecfba91..f2c0bedacf17 100644 --- a/gtk4/src/subclass/popover.rs +++ b/gtk4/src/subclass/popover.rs @@ -5,9 +5,11 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, Popover}; +use crate::{ffi, prelude::*, subclass::prelude::*, Native, Popover, ShortcutManager}; -pub trait PopoverImpl: WidgetImpl + ObjectSubclass> { +pub trait PopoverImpl: + WidgetImpl + ObjectSubclass + IsA + IsA> +{ fn activate_default(&self) { self.parent_activate_default() } diff --git a/gtk4/src/subclass/print_operation.rs b/gtk4/src/subclass/print_operation.rs index 5ef0e85f6e02..c53a483259c7 100644 --- a/gtk4/src/subclass/print_operation.rs +++ b/gtk4/src/subclass/print_operation.rs @@ -11,7 +11,7 @@ use crate::{ }; pub trait PrintOperationImpl: - PrintOperationPreviewImpl + ObjectSubclass> + ObjectImpl + ObjectSubclass + IsA> { fn begin_print(&self, context: &PrintContext) { self.parent_begin_print(context) diff --git a/gtk4/src/subclass/range.rs b/gtk4/src/subclass/range.rs index df85b04396c1..02ba48d55fe2 100644 --- a/gtk4/src/subclass/range.rs +++ b/gtk4/src/subclass/range.rs @@ -5,9 +5,9 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, Border, Range, ScrollType}; +use crate::{ffi, prelude::*, subclass::prelude::*, Border, Orientable, Range, ScrollType}; -pub trait RangeImpl: WidgetImpl + ObjectSubclass> { +pub trait RangeImpl: WidgetImpl + ObjectSubclass + IsA> { fn adjust_bounds(&self, new_value: f64) { self.parent_adjust_bounds(new_value) } diff --git a/gtk4/src/subclass/scale.rs b/gtk4/src/subclass/scale.rs index 752a4c5820df..9c2e67fdb7ab 100644 --- a/gtk4/src/subclass/scale.rs +++ b/gtk4/src/subclass/scale.rs @@ -5,9 +5,9 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, Scale}; +use crate::{ffi, prelude::*, subclass::prelude::*, Orientable, Scale}; -pub trait ScaleImpl: RangeImpl + ObjectSubclass> { +pub trait ScaleImpl: RangeImpl + ObjectSubclass + IsA> { #[doc(alias = "get_layout_offsets")] fn layout_offsets(&self) -> (i32, i32) { self.parent_layout_offsets() diff --git a/gtk4/src/subclass/scale_button.rs b/gtk4/src/subclass/scale_button.rs index 2ef65b1735f5..2b5d58b10165 100644 --- a/gtk4/src/subclass/scale_button.rs +++ b/gtk4/src/subclass/scale_button.rs @@ -5,9 +5,11 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, ScaleButton}; +use crate::{ffi, prelude::*, subclass::prelude::*, Orientable, ScaleButton}; -pub trait ScaleButtonImpl: WidgetImpl + ObjectSubclass> { +pub trait ScaleButtonImpl: + WidgetImpl + ObjectSubclass + IsA> +{ fn value_changed(&self, new_value: f64) { self.parent_value_changed(new_value) } diff --git a/gtk4/src/subclass/text_view.rs b/gtk4/src/subclass/text_view.rs index 5a43da5b4a82..a55df000e103 100644 --- a/gtk4/src/subclass/text_view.rs +++ b/gtk4/src/subclass/text_view.rs @@ -6,11 +6,11 @@ use glib::translate::*; use crate::{ - ffi, prelude::*, subclass::prelude::*, DeleteType, MovementStep, Snapshot, TextExtendSelection, - TextIter, TextView, TextViewLayer, + ffi, prelude::*, subclass::prelude::*, DeleteType, MovementStep, Scrollable, Snapshot, + TextExtendSelection, TextIter, TextView, TextViewLayer, }; -pub trait TextViewImpl: WidgetImpl + ObjectSubclass> { +pub trait TextViewImpl: WidgetImpl + ObjectSubclass + IsA> { fn backspace(&self) { self.parent_backspace() } diff --git a/gtk4/src/subclass/toggle_button.rs b/gtk4/src/subclass/toggle_button.rs index ae3676c7674c..3681aad1ba31 100644 --- a/gtk4/src/subclass/toggle_button.rs +++ b/gtk4/src/subclass/toggle_button.rs @@ -5,9 +5,11 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, ToggleButton}; +use crate::{ffi, prelude::*, subclass::prelude::*, Actionable, ToggleButton}; -pub trait ToggleButtonImpl: ButtonImpl + ObjectSubclass> { +pub trait ToggleButtonImpl: + ButtonImpl + ObjectSubclass + IsA> +{ fn toggled(&self) { self.parent_toggled() } diff --git a/gtk4/src/subclass/tree_view.rs b/gtk4/src/subclass/tree_view.rs index be25940c864c..eed8dd071d76 100644 --- a/gtk4/src/subclass/tree_view.rs +++ b/gtk4/src/subclass/tree_view.rs @@ -6,13 +6,13 @@ use glib::translate::*; use crate::{ - ffi, prelude::*, subclass::prelude::*, MovementStep, TreeIter, TreePath, TreeView, + ffi, prelude::*, subclass::prelude::*, MovementStep, Scrollable, TreeIter, TreePath, TreeView, TreeViewColumn, }; #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] #[allow(deprecated)] -pub trait TreeViewImpl: WidgetImpl + ObjectSubclass> { +pub trait TreeViewImpl: WidgetImpl + ObjectSubclass + IsA> { fn columns_changed(&self) { self.parent_columns_changed() } diff --git a/gtk4/src/subclass/widget.rs b/gtk4/src/subclass/widget.rs index 2e8e6dd29d78..ef6fec8f6890 100644 --- a/gtk4/src/subclass/widget.rs +++ b/gtk4/src/subclass/widget.rs @@ -8,9 +8,9 @@ use std::{boxed::Box as Box_, collections::HashMap, fmt, future::Future}; use glib::{clone::Downgrade, subclass::SignalId, translate::*, GString, Variant}; use crate::{ - ffi, prelude::*, subclass::prelude::*, AccessibleRole, BuilderRustScope, BuilderScope, - DirectionType, LayoutManager, Orientation, Shortcut, SizeRequestMode, Snapshot, StateFlags, - SystemSetting, TextDirection, Tooltip, Widget, + ffi, prelude::*, subclass::prelude::*, Accessible, AccessibleRole, Buildable, BuilderRustScope, + BuilderScope, ConstraintTarget, DirectionType, LayoutManager, Orientation, Shortcut, + SizeRequestMode, Snapshot, StateFlags, SystemSetting, TextDirection, Tooltip, Widget, }; #[derive(Debug, Default)] @@ -104,7 +104,10 @@ impl Iterator for WidgetActionIter { impl std::iter::FusedIterator for WidgetActionIter {} -pub trait WidgetImpl: ObjectImpl + ObjectSubclass> { +pub trait WidgetImpl: + ObjectImpl + + ObjectSubclass + IsA + IsA + IsA> +{ fn compute_expand(&self, hexpand: &mut bool, vexpand: &mut bool) { self.parent_compute_expand(hexpand, vexpand) } diff --git a/gtk4/src/subclass/window.rs b/gtk4/src/subclass/window.rs index b4a21dfe015e..69d85e7d9083 100644 --- a/gtk4/src/subclass/window.rs +++ b/gtk4/src/subclass/window.rs @@ -5,9 +5,11 @@ use glib::translate::*; -use crate::{ffi, prelude::*, subclass::prelude::*, Window}; +use crate::{ffi, prelude::*, subclass::prelude::*, Native, Root, ShortcutManager, Window}; -pub trait WindowImpl: WidgetImpl + ObjectSubclass> { +pub trait WindowImpl: + WidgetImpl + ObjectSubclass + IsA + IsA + IsA> +{ fn activate_focus(&self) { self.parent_activate_focus() }