Skip to content

Commit 6c296e5

Browse files
gtk: disable GestureSingle builder
It's an abstract class that cannot be instantiated. fixes #502
1 parent 9c7f49d commit 6c296e5

File tree

3 files changed

+5
-103
lines changed

3 files changed

+5
-103
lines changed

gtk4/Gir.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ generate = [
109109
"Gtk.GestureLongPress",
110110
"Gtk.GesturePan",
111111
"Gtk.GestureRotate",
112-
"Gtk.GestureSingle",
113112
"Gtk.GestureSwipe",
114113
"Gtk.GestureZoom",
115114
"Gtk.Grid",
@@ -1207,6 +1206,11 @@ status = "generate"
12071206
name = "sequence"
12081207
const = true
12091208

1209+
[[object]]
1210+
name = "Gtk.GestureSingle"
1211+
status = "generate"
1212+
generate_builder = false
1213+
12101214
[[object]]
12111215
name = "Gtk.GestureStylus"
12121216
status = "generate"

gtk4/src/auto/gesture_single.rs

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44

55
use crate::EventController;
66
use crate::Gesture;
7-
use crate::PropagationLimit;
8-
use crate::PropagationPhase;
97
use glib::object::Cast;
108
use glib::object::IsA;
119
use glib::signal::connect_raw;
1210
use glib::signal::SignalHandlerId;
1311
use glib::translate::*;
14-
use glib::StaticType;
15-
use glib::ToValue;
1612
use std::boxed::Box as Box_;
1713
use std::fmt;
1814
use std::mem::transmute;
@@ -26,103 +22,6 @@ glib::wrapper! {
2622
}
2723
}
2824

29-
impl GestureSingle {
30-
// rustdoc-stripper-ignore-next
31-
/// Creates a new builder-pattern struct instance to construct [`GestureSingle`] objects.
32-
///
33-
/// This method returns an instance of [`GestureSingleBuilder`] which can be used to create [`GestureSingle`] objects.
34-
pub fn builder() -> GestureSingleBuilder {
35-
GestureSingleBuilder::default()
36-
}
37-
}
38-
39-
#[derive(Clone, Default)]
40-
// rustdoc-stripper-ignore-next
41-
/// A [builder-pattern] type to construct [`GestureSingle`] objects.
42-
///
43-
/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
44-
pub struct GestureSingleBuilder {
45-
button: Option<u32>,
46-
exclusive: Option<bool>,
47-
touch_only: Option<bool>,
48-
n_points: Option<u32>,
49-
name: Option<String>,
50-
propagation_limit: Option<PropagationLimit>,
51-
propagation_phase: Option<PropagationPhase>,
52-
}
53-
54-
impl GestureSingleBuilder {
55-
// rustdoc-stripper-ignore-next
56-
/// Create a new [`GestureSingleBuilder`].
57-
pub fn new() -> Self {
58-
Self::default()
59-
}
60-
61-
// rustdoc-stripper-ignore-next
62-
/// Build the [`GestureSingle`].
63-
pub fn build(self) -> GestureSingle {
64-
let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
65-
if let Some(ref button) = self.button {
66-
properties.push(("button", button));
67-
}
68-
if let Some(ref exclusive) = self.exclusive {
69-
properties.push(("exclusive", exclusive));
70-
}
71-
if let Some(ref touch_only) = self.touch_only {
72-
properties.push(("touch-only", touch_only));
73-
}
74-
if let Some(ref n_points) = self.n_points {
75-
properties.push(("n-points", n_points));
76-
}
77-
if let Some(ref name) = self.name {
78-
properties.push(("name", name));
79-
}
80-
if let Some(ref propagation_limit) = self.propagation_limit {
81-
properties.push(("propagation-limit", propagation_limit));
82-
}
83-
if let Some(ref propagation_phase) = self.propagation_phase {
84-
properties.push(("propagation-phase", propagation_phase));
85-
}
86-
glib::Object::new::<GestureSingle>(&properties)
87-
.expect("Failed to create an instance of GestureSingle")
88-
}
89-
90-
pub fn button(mut self, button: u32) -> Self {
91-
self.button = Some(button);
92-
self
93-
}
94-
95-
pub fn exclusive(mut self, exclusive: bool) -> Self {
96-
self.exclusive = Some(exclusive);
97-
self
98-
}
99-
100-
pub fn touch_only(mut self, touch_only: bool) -> Self {
101-
self.touch_only = Some(touch_only);
102-
self
103-
}
104-
105-
pub fn n_points(mut self, n_points: u32) -> Self {
106-
self.n_points = Some(n_points);
107-
self
108-
}
109-
110-
pub fn name(mut self, name: &str) -> Self {
111-
self.name = Some(name.to_string());
112-
self
113-
}
114-
115-
pub fn propagation_limit(mut self, propagation_limit: PropagationLimit) -> Self {
116-
self.propagation_limit = Some(propagation_limit);
117-
self
118-
}
119-
120-
pub fn propagation_phase(mut self, propagation_phase: PropagationPhase) -> Self {
121-
self.propagation_phase = Some(propagation_phase);
122-
self
123-
}
124-
}
125-
12625
pub const NONE_GESTURE_SINGLE: Option<&GestureSingle> = None;
12726

12827
pub trait GestureSingleExt: 'static {

gtk4/src/auto/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ pub use self::gesture_rotate::GestureRotate;
414414
pub use self::gesture_rotate::GestureRotateBuilder;
415415

416416
mod gesture_single;
417-
pub use self::gesture_single::GestureSingleBuilder;
418417
pub use self::gesture_single::{GestureSingle, NONE_GESTURE_SINGLE};
419418

420419
mod gesture_stylus;

0 commit comments

Comments
 (0)