4
4
5
5
use crate :: EventController ;
6
6
use crate :: Gesture ;
7
- use crate :: PropagationLimit ;
8
- use crate :: PropagationPhase ;
9
7
use glib:: object:: Cast ;
10
8
use glib:: object:: IsA ;
11
9
use glib:: signal:: connect_raw;
12
10
use glib:: signal:: SignalHandlerId ;
13
11
use glib:: translate:: * ;
14
- use glib:: StaticType ;
15
- use glib:: ToValue ;
16
12
use std:: boxed:: Box as Box_ ;
17
13
use std:: fmt;
18
14
use std:: mem:: transmute;
@@ -26,103 +22,6 @@ glib::wrapper! {
26
22
}
27
23
}
28
24
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
-
126
25
pub const NONE_GESTURE_SINGLE : Option < & GestureSingle > = None ;
127
26
128
27
pub trait GestureSingleExt : ' static {
0 commit comments