diff --git a/examples/column_view_datagrid/grid_cell/mod.rs b/examples/column_view_datagrid/grid_cell/mod.rs index 84c36783f38d..ad9591dede65 100644 --- a/examples/column_view_datagrid/grid_cell/mod.rs +++ b/examples/column_view_datagrid/grid_cell/mod.rs @@ -7,7 +7,8 @@ pub struct Entry { glib::wrapper! { pub struct GridCell(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for GridCell { 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/composite_template/ex_application_window/mod.rs b/examples/composite_template/ex_application_window/mod.rs index 39c036652405..794cc619789b 100644 --- a/examples/composite_template/ex_application_window/mod.rs +++ b/examples/composite_template/ex_application_window/mod.rs @@ -5,7 +5,8 @@ use gtk::{gio, glib, prelude::*, subclass::prelude::*}; glib::wrapper! { pub struct ExApplicationWindow(ObjectSubclass) @extends gtk::Widget, gtk::Window, gtk::ApplicationWindow, - @implements gio::ActionMap, gio::ActionGroup; + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, + gtk::Native, gtk::Root, gtk::ShortcutManager, gio::ActionMap, gio::ActionGroup; } impl ExApplicationWindow { diff --git a/examples/composite_template/ex_menu_button/mod.rs b/examples/composite_template/ex_menu_button/mod.rs index 9bcf93b6c88a..2c71a251974d 100644 --- a/examples/composite_template/ex_menu_button/mod.rs +++ b/examples/composite_template/ex_menu_button/mod.rs @@ -4,5 +4,6 @@ use gtk::glib; glib::wrapper! { pub struct ExMenuButton(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } 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_buildable/custom_buildable/mod.rs b/examples/custom_buildable/custom_buildable/mod.rs index b7ad3c7adf26..86f25463b0ac 100644 --- a/examples/custom_buildable/custom_buildable/mod.rs +++ b/examples/custom_buildable/custom_buildable/mod.rs @@ -5,7 +5,7 @@ use gtk::{glib, prelude::*, subclass::prelude::*}; glib::wrapper! { pub struct CustomBuildable(ObjectSubclass) @extends gtk::Widget, - @implements gtk::Buildable; + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl CustomBuildable { diff --git a/examples/custom_editable/custom_editable/mod.rs b/examples/custom_editable/custom_editable/mod.rs index 2d167919364a..d79623158449 100644 --- a/examples/custom_editable/custom_editable/mod.rs +++ b/examples/custom_editable/custom_editable/mod.rs @@ -7,7 +7,7 @@ use crate::custom_tag::CustomTag; glib::wrapper! { pub struct CustomEditable(ObjectSubclass) @extends gtk::Widget, - @implements gtk::Editable; + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Editable; } impl Default for CustomEditable { diff --git a/examples/custom_editable/custom_tag/mod.rs b/examples/custom_editable/custom_tag/mod.rs index 2f511dbfdc1e..47b7188e1a55 100644 --- a/examples/custom_editable/custom_tag/mod.rs +++ b/examples/custom_editable/custom_tag/mod.rs @@ -4,7 +4,8 @@ use gtk::glib; glib::wrapper! { pub struct CustomTag(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl CustomTag { 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/gif_paintable/gif_paintable_window/mod.rs b/examples/gif_paintable/gif_paintable_window/mod.rs index 667a246432d0..122604e02c3f 100644 --- a/examples/gif_paintable/gif_paintable_window/mod.rs +++ b/examples/gif_paintable/gif_paintable_window/mod.rs @@ -7,7 +7,8 @@ use crate::gif_paintable::GifPaintable; glib::wrapper! { pub struct GifPaintableWindow(ObjectSubclass) @extends gtk::Widget, gtk::Window, gtk::ApplicationWindow, - @implements gio::ActionMap, gio::ActionGroup; + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, + gtk::Native, gtk::Root, gtk::ShortcutManager, gio::ActionMap, gio::ActionGroup; } impl GifPaintableWindow { diff --git a/examples/glium_gl_area/glium_gl_area/mod.rs b/examples/glium_gl_area/glium_gl_area/mod.rs index a9c4eb36efdf..91d47f97427a 100644 --- a/examples/glium_gl_area/glium_gl_area/mod.rs +++ b/examples/glium_gl_area/glium_gl_area/mod.rs @@ -4,7 +4,8 @@ use gtk::{gdk, glib, prelude::*}; glib::wrapper! { pub struct GliumGLArea(ObjectSubclass) - @extends gtk::GLArea, gtk::Widget; + @extends gtk::GLArea, gtk::Widget + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for GliumGLArea { diff --git a/examples/list_box_model/list_box_row/mod.rs b/examples/list_box_model/list_box_row/mod.rs index 1b775c1c5456..ec2339ce50ce 100644 --- a/examples/list_box_model/list_box_row/mod.rs +++ b/examples/list_box_model/list_box_row/mod.rs @@ -6,7 +6,8 @@ use crate::row_data::RowData; glib::wrapper! { pub struct ListBoxRow(ObjectSubclass) - @extends gtk::Widget, gtk::ListBoxRow; + @extends gtk::Widget, gtk::ListBoxRow, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl ListBoxRow { diff --git a/examples/list_view_apps_launcher/application_row/mod.rs b/examples/list_view_apps_launcher/application_row/mod.rs index 0b18f966823b..f8f382250016 100644 --- a/examples/list_view_apps_launcher/application_row/mod.rs +++ b/examples/list_view_apps_launcher/application_row/mod.rs @@ -4,7 +4,8 @@ use gtk::{gio, glib, prelude::*, subclass::prelude::*}; glib::wrapper! { pub struct ApplicationRow(ObjectSubclass) - @extends gtk::Widget, gtk::Box; + @extends gtk::Widget, gtk::Box, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } impl Default for ApplicationRow { 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/video_player/video_player_window/mod.rs b/examples/video_player/video_player_window/mod.rs index 4e924a42b961..1776c636497d 100644 --- a/examples/video_player/video_player_window/mod.rs +++ b/examples/video_player/video_player_window/mod.rs @@ -5,7 +5,8 @@ use gtk::{gio, glib, prelude::*, subclass::prelude::*}; glib::wrapper! { pub struct VideoPlayerWindow(ObjectSubclass) @extends gtk::Widget, gtk::Window, gtk::ApplicationWindow, - @implements gio::ActionMap, gio::ActionGroup; + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, + gtk::Native, gtk::Root, gtk::ShortcutManager, gio::ActionMap, gio::ActionGroup; } impl VideoPlayerWindow { 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/src/lib.rs b/gtk4-macros/src/lib.rs index 07df6049a909..fba40903e36a 100644 --- a/gtk4-macros/src/lib.rs +++ b/gtk4-macros/src/lib.rs @@ -132,7 +132,9 @@ pub fn include_blueprint(input: TokenStream) -> TokenStream { /// } /// /// glib::wrapper! { -/// pub struct MyWidget(ObjectSubclass) @extends gtk::Widget, gtk::Box; +/// pub struct MyWidget(ObjectSubclass) +/// @extends gtk::Widget, gtk::Box, +/// @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; /// } /// /// impl MyWidget { @@ -197,7 +199,9 @@ pub fn include_blueprint(input: TokenStream) -> TokenStream { /// } /// /// glib::wrapper! { -/// pub struct MyWidget(ObjectSubclass) @extends gtk::Widget; +/// pub struct MyWidget(ObjectSubclass) +/// @extends gtk::Widget, +/// @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; /// } /// ``` #[proc_macro_derive(CompositeTemplate, attributes(template, template_child))] @@ -351,7 +355,9 @@ pub fn composite_template_derive(input: TokenStream) -> TokenStream { /// } /// /// glib::wrapper! { -/// pub struct MyWidget(ObjectSubclass) @extends gtk::Widget, gtk::Box; +/// pub struct MyWidget(ObjectSubclass) +/// @extends gtk::Widget, gtk::Box, +/// @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; /// } /// /// #[gtk::template_callbacks] diff --git a/gtk4-macros/tests/templates.rs b/gtk4-macros/tests/templates.rs index f597137024af..4e5813b88676 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] @@ -248,7 +254,9 @@ mod imp4 { #[cfg(feature = "blueprint")] glib::wrapper! { - pub struct MyWidget4(ObjectSubclass) @extends gtk::Widget; + pub struct MyWidget4(ObjectSubclass) + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } #[gtk::test] @@ -295,7 +303,9 @@ mod imp5 { #[cfg(feature = "blueprint")] glib::wrapper! { - pub struct MyWidget5(ObjectSubclass) @extends gtk::Widget; + pub struct MyWidget5(ObjectSubclass) + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } #[gtk::test] @@ -348,5 +358,6 @@ mod imp6 { glib::wrapper! { pub struct TestWidget(ObjectSubclass) - @extends gtk::Widget; + @extends gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; } 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 4fe0dc2bb129..9d451cceb22e 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() }