Skip to content

Commit 1df4431

Browse files
Make ClassExt traits names consistent
With the naming used by GStreamer bindings
1 parent acb4c55 commit 1df4431

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

gtk4-macros/src/composite_template_derive.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ fn gen_set_template(source: &TemplateSource, crate_ident: &proc_macro2::Ident) -
3333
};
3434

3535
quote! {
36-
#crate_ident::subclass::widget::WidgetClassSubclassExt::set_template_static(
36+
#crate_ident::subclass::widget::WidgetClassExt::set_template_static(
3737
klass,
3838
#template,
3939
);
4040
}
4141
}
4242
TemplateSource::Resource(resource) => quote! {
43-
#crate_ident::subclass::widget::WidgetClassSubclassExt::set_template_from_resource(
43+
#crate_ident::subclass::widget::WidgetClassExt::set_template_from_resource(
4444
klass,
4545
&#resource,
4646
);
4747
},
4848
TemplateSource::Xml(template) => quote! {
49-
#crate_ident::subclass::widget::WidgetClassSubclassExt::set_template_static(
49+
#crate_ident::subclass::widget::WidgetClassExt::set_template_static(
5050
klass,
5151
#template.as_bytes(),
5252
);
@@ -57,7 +57,7 @@ fn gen_set_template(source: &TemplateSource, crate_ident: &proc_macro2::Ident) -
5757
compile_blueprint(blueprint.as_bytes()).expect("can't compile blueprint");
5858

5959
quote! {
60-
#crate_ident::subclass::widget::WidgetClassSubclassExt::set_template_static(
60+
#crate_ident::subclass::widget::WidgetClassExt::set_template_static(
6161
klass,
6262
#template.as_bytes(),
6363
);

gtk4/src/subclass/cell_area.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ unsafe extern "C" fn cell_area_foreach_alloc<T: CellAreaImpl>(
10091009
}
10101010

10111011
#[allow(clippy::missing_safety_doc)]
1012-
pub unsafe trait CellAreaClassSubclassExt: ClassStruct {
1012+
pub unsafe trait CellAreaClassExt: ClassStruct {
10131013
#[doc(alias = "gtk_cell_area_class_find_cell_property")]
10141014
fn find_cell_property(&self, property_name: &str) -> Option<ParamSpec> {
10151015
unsafe {
@@ -1035,4 +1035,4 @@ pub unsafe trait CellAreaClassSubclassExt: ClassStruct {
10351035
}
10361036
}
10371037

1038-
unsafe impl<T: ClassStruct> CellAreaClassSubclassExt for T where T::Type: CellAreaImpl {}
1038+
unsafe impl<T: ClassStruct> CellAreaClassExt for T where T::Type: CellAreaImpl {}

gtk4/src/subclass/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub mod prelude {
110110
pub use super::buildable::{BuildableImpl, BuildableImplExt};
111111
pub use super::builder_scope::{BuilderCScopeImpl, BuilderScopeImpl, BuilderScopeImplExt};
112112
pub use super::button::{ButtonImpl, ButtonImplExt};
113-
pub use super::cell_area::{CellAreaClassSubclassExt, CellAreaImpl, CellAreaImplExt};
113+
pub use super::cell_area::{CellAreaClassExt, CellAreaImpl, CellAreaImplExt};
114114
pub use super::cell_area_context::{CellAreaContextImpl, CellAreaContextImplExt};
115115
pub use super::cell_editable::{CellEditableImpl, CellEditableImplExt};
116116
pub use super::cell_layout::{CellLayoutImpl, CellLayoutImplExt};
@@ -170,7 +170,7 @@ pub mod prelude {
170170
pub use super::widget::CompositeTemplateClass;
171171
pub use super::widget::CompositeTemplateInstanceCallbacksClass;
172172
pub use super::widget::TemplateChild;
173-
pub use super::widget::WidgetClassSubclassExt;
173+
pub use super::widget::WidgetClassExt;
174174
pub use super::widget::{
175175
CompositeTemplateDisposeExt, CompositeTemplateInitializingExt, WidgetImpl, WidgetImplExt,
176176
};

gtk4/src/subclass/widget.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ unsafe extern "C" fn widget_unroot<T: WidgetImpl>(ptr: *mut ffi::GtkWidget) {
879879
}
880880

881881
#[allow(clippy::missing_safety_doc)]
882-
pub unsafe trait WidgetClassSubclassExt: ClassStruct {
882+
pub unsafe trait WidgetClassExt: ClassStruct {
883883
#[doc(alias = "gtk_widget_class_set_template")]
884884
fn set_template_bytes(&mut self, template: &glib::Bytes) {
885885
unsafe {
@@ -1232,7 +1232,7 @@ pub unsafe trait WidgetClassSubclassExt: ClassStruct {
12321232
}
12331233
}
12341234

1235-
unsafe impl<T: ClassStruct> WidgetClassSubclassExt for T where T::Type: WidgetImpl {}
1235+
unsafe impl<T: ClassStruct> WidgetClassExt for T where T::Type: WidgetImpl {}
12361236

12371237
#[derive(Debug, PartialEq, Eq)]
12381238
#[repr(transparent)]
@@ -1345,13 +1345,13 @@ pub trait CompositeTemplateCallbacks {
13451345

13461346
// rustdoc-stripper-ignore-next
13471347
/// Binds the template callbacks from this type into the default template scope for `klass`.
1348-
fn bind_template_callbacks<T: WidgetClassSubclassExt>(klass: &mut T) {
1348+
fn bind_template_callbacks<T: WidgetClassExt>(klass: &mut T) {
13491349
Self::add_callbacks_to_scope(&klass.rust_template_scope());
13501350
}
13511351
// rustdoc-stripper-ignore-next
13521352
/// Binds the template callbacks from this type into the default template scope for `klass`,
13531353
/// prepending `prefix` to each callback name.
1354-
fn bind_template_callbacks_prefixed<T: WidgetClassSubclassExt>(klass: &mut T, prefix: &str) {
1354+
fn bind_template_callbacks_prefixed<T: WidgetClassExt>(klass: &mut T, prefix: &str) {
13551355
Self::add_callbacks_to_scope_prefixed(&klass.rust_template_scope(), prefix);
13561356
}
13571357
// rustdoc-stripper-ignore-next
@@ -1383,7 +1383,7 @@ pub trait CompositeTemplateCallbacksClass {
13831383

13841384
impl<T, U> CompositeTemplateCallbacksClass for T
13851385
where
1386-
T: ClassStruct<Type = U> + WidgetClassSubclassExt,
1386+
T: ClassStruct<Type = U> + WidgetClassExt,
13871387
U: ObjectSubclass<Class = T> + CompositeTemplateCallbacks,
13881388
{
13891389
fn bind_template_callbacks(&mut self) {
@@ -1403,7 +1403,7 @@ pub trait CompositeTemplateInstanceCallbacksClass {
14031403

14041404
impl<T, U, V> CompositeTemplateInstanceCallbacksClass for T
14051405
where
1406-
T: ClassStruct<Type = U> + WidgetClassSubclassExt,
1406+
T: ClassStruct<Type = U> + WidgetClassExt,
14071407
U: ObjectSubclass<Class = T, Type = V>,
14081408
V: CompositeTemplateCallbacks,
14091409
{

0 commit comments

Comments
 (0)