/
qgesturerecognizer.go
307 lines (253 loc) · 9.17 KB
/
qgesturerecognizer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
package qtwidgets
// /usr/include/qt/QtWidgets/qgesturerecognizer.h
// #include <qgesturerecognizer.h>
// #include <QtWidgets>
// header block end
// main block begin
// main block end
// use block begin
// use block end
// ext block begin
/*
#include <stdlib.h>
// extern C begin: 13
*/
// import "C"
import "unsafe"
import "reflect"
import "fmt"
import "log"
import "github.com/kitech/qt.go/qtrt"
import "github.com/kitech/qt.go/qtcore"
import "github.com/kitech/qt.go/qtgui"
// ext block end
// body block begin
/*
*/
type QGestureRecognizer struct {
*qtrt.CObject
}
type QGestureRecognizer_ITF interface {
QGestureRecognizer_PTR() *QGestureRecognizer
}
func (ptr *QGestureRecognizer) QGestureRecognizer_PTR() *QGestureRecognizer { return ptr }
func (this *QGestureRecognizer) GetCthis() unsafe.Pointer {
if this == nil {
return nil
} else {
return this.Cthis
}
}
func (this *QGestureRecognizer) SetCthis(cthis unsafe.Pointer) {
if this.CObject == nil {
this.CObject = &qtrt.CObject{cthis}
} else {
this.CObject.Cthis = cthis
}
}
func NewQGestureRecognizerFromPointer(cthis unsafe.Pointer) *QGestureRecognizer {
return &QGestureRecognizer{&qtrt.CObject{cthis}}
}
func (*QGestureRecognizer) NewFromPointer(cthis unsafe.Pointer) *QGestureRecognizer {
return NewQGestureRecognizerFromPointer(cthis)
}
// /usr/include/qt/QtWidgets/qgesturerecognizer.h:77
// index:0
// Public Visibility=Default Availability=Available
// [-2] void QGestureRecognizer()
/*
Constructs a new gesture recognizer object.
*/
func (*QGestureRecognizer) NewForInherit() *QGestureRecognizer {
return NewQGestureRecognizer()
}
func NewQGestureRecognizer() *QGestureRecognizer {
rv, err := qtrt.InvokeQtFunc6("_ZN18QGestureRecognizerC2Ev", qtrt.FFI_TYPE_POINTER)
qtrt.ErrPrint(err, rv)
gothis := NewQGestureRecognizerFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.SetFinalizer(gothis, DeleteQGestureRecognizer)
return gothis
}
// /usr/include/qt/QtWidgets/qgesturerecognizer.h:78
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void ~QGestureRecognizer()
/*
*/
func DeleteQGestureRecognizer(this *QGestureRecognizer) {
rv, err := qtrt.InvokeQtFunc6("_ZN18QGestureRecognizerD2Ev", qtrt.FFI_TYPE_VOID, this.GetCthis())
qtrt.Cmemset(this.GetCthis(), 9, 8)
qtrt.ErrPrint(err, rv)
this.SetCthis(nil)
}
// /usr/include/qt/QtWidgets/qgesturerecognizer.h:80
// index:0
// Public virtual Visibility=Default Availability=Available
// [8] QGesture * create(QObject *)
/*
This function is called by Qt to create a new QGesture object for the given target (QWidget or QGraphicsObject).
Reimplement this function to create a custom QGesture-derived gesture object if necessary.
The application takes ownership of the created gesture object.
*/
func (this *QGestureRecognizer) Create(target qtcore.QObject_ITF /*777 QObject **/) *QGesture /*777 QGesture **/ {
var convArg0 unsafe.Pointer
if target != nil && target.QObject_PTR() != nil {
convArg0 = target.QObject_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN18QGestureRecognizer6createEP7QObject", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
return /*==*/ NewQGestureFromPointer(unsafe.Pointer(uintptr(rv))) // 444
}
// /usr/include/qt/QtWidgets/qgesturerecognizer.h:81
// index:0
// Public purevirtual virtual Visibility=Default Availability=Available
// [4] QGestureRecognizer::Result recognize(QGesture *, QObject *, QEvent *)
/*
Handles the given event for the watched object, updating the state of the gesture object as required, and returns a suitable result for the current recognition step.
This function is called by the framework to allow the recognizer to filter input events dispatched to QWidget or QGraphicsObject instances that it is monitoring.
The result reflects how much of the gesture has been recognized. The state of the gesture object is set depending on the result.
See also QGestureRecognizer::Result.
*/
func (this *QGestureRecognizer) Recognize(state QGesture_ITF /*777 QGesture **/, watched qtcore.QObject_ITF /*777 QObject **/, event qtcore.QEvent_ITF /*777 QEvent **/) int {
var convArg0 unsafe.Pointer
if state != nil && state.QGesture_PTR() != nil {
convArg0 = state.QGesture_PTR().GetCthis()
}
var convArg1 unsafe.Pointer
if watched != nil && watched.QObject_PTR() != nil {
convArg1 = watched.QObject_PTR().GetCthis()
}
var convArg2 unsafe.Pointer
if event != nil && event.QEvent_PTR() != nil {
convArg2 = event.QEvent_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN18QGestureRecognizer9recognizeEP8QGestureP7QObjectP6QEvent", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, convArg1, convArg2)
qtrt.ErrPrint(err, rv)
return int(rv)
}
// /usr/include/qt/QtWidgets/qgesturerecognizer.h:83
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void reset(QGesture *)
/*
This function is called by the framework to reset a given gesture.
Reimplement this function to implement additional requirements for custom QGesture objects. This may be necessary if you implement a custom QGesture whose properties need special handling when the gesture is reset.
*/
func (this *QGestureRecognizer) Reset(state QGesture_ITF /*777 QGesture **/) {
var convArg0 unsafe.Pointer
if state != nil && state.QGesture_PTR() != nil {
convArg0 = state.QGesture_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN18QGestureRecognizer5resetEP8QGesture", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtWidgets/qgesturerecognizer.h:85
// index:0
// Public static Visibility=Default Availability=Available
// [4] Qt::GestureType registerRecognizer(QGestureRecognizer *)
/*
Registers the given recognizer in the gesture framework and returns a gesture ID for it.
The application takes ownership of the recognizer and returns the gesture type ID associated with it. For gesture recognizers which handle custom QGesture objects (i.e., those which return Qt::CustomGesture in a QGesture::gestureType() function) the return value is a generated gesture ID with the Qt::CustomGesture flag set.
See also unregisterRecognizer(), QGestureRecognizer::create(), and QGesture.
*/
func (this *QGestureRecognizer) RegisterRecognizer(recognizer QGestureRecognizer_ITF /*777 QGestureRecognizer **/) int {
var convArg0 unsafe.Pointer
if recognizer != nil && recognizer.QGestureRecognizer_PTR() != nil {
convArg0 = recognizer.QGestureRecognizer_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN18QGestureRecognizer18registerRecognizerEPS_", qtrt.FFI_TYPE_POINTER, convArg0)
qtrt.ErrPrint(err, rv)
return int(rv)
}
func QGestureRecognizer_RegisterRecognizer(recognizer QGestureRecognizer_ITF /*777 QGestureRecognizer **/) int {
var nilthis *QGestureRecognizer
rv := nilthis.RegisterRecognizer(recognizer)
return rv
}
// /usr/include/qt/QtWidgets/qgesturerecognizer.h:86
// index:0
// Public static Visibility=Default Availability=Available
// [-2] void unregisterRecognizer(Qt::GestureType)
/*
Unregisters all gesture recognizers of the specified type.
See also registerRecognizer().
*/
func (this *QGestureRecognizer) UnregisterRecognizer(type_ int) {
rv, err := qtrt.InvokeQtFunc6("_ZN18QGestureRecognizer20unregisterRecognizerEN2Qt11GestureTypeE", qtrt.FFI_TYPE_POINTER, type_)
qtrt.ErrPrint(err, rv)
}
func QGestureRecognizer_UnregisterRecognizer(type_ int) {
var nilthis *QGestureRecognizer
nilthis.UnregisterRecognizer(type_)
}
/*
*/
type QGestureRecognizer__ResultFlag = int
//
const QGestureRecognizer__Ignore QGestureRecognizer__ResultFlag = 1
//
const QGestureRecognizer__MayBeGesture QGestureRecognizer__ResultFlag = 2
//
const QGestureRecognizer__TriggerGesture QGestureRecognizer__ResultFlag = 4
//
const QGestureRecognizer__FinishGesture QGestureRecognizer__ResultFlag = 8
//
const QGestureRecognizer__CancelGesture QGestureRecognizer__ResultFlag = 16
//
const QGestureRecognizer__ResultState_Mask QGestureRecognizer__ResultFlag = 255
//
const QGestureRecognizer__ConsumeEventHint QGestureRecognizer__ResultFlag = 256
//
const QGestureRecognizer__ResultHint_Mask QGestureRecognizer__ResultFlag = 65280
func (this *QGestureRecognizer) ResultFlagItemName(val int) string {
switch val {
case QGestureRecognizer__Ignore: // 1
return "Ignore"
case QGestureRecognizer__MayBeGesture: // 2
return "MayBeGesture"
case QGestureRecognizer__TriggerGesture: // 4
return "TriggerGesture"
case QGestureRecognizer__FinishGesture: // 8
return "FinishGesture"
case QGestureRecognizer__CancelGesture: // 16
return "CancelGesture"
case QGestureRecognizer__ResultState_Mask: // 255
return "ResultState_Mask"
case QGestureRecognizer__ConsumeEventHint: // 256
return "ConsumeEventHint"
case QGestureRecognizer__ResultHint_Mask: // 65280
return "ResultHint_Mask"
default:
return fmt.Sprintf("%d", val)
}
}
func QGestureRecognizer_ResultFlagItemName(val int) string {
var nilthis *QGestureRecognizer
return nilthis.ResultFlagItemName(val)
}
// body block end
// keep block begin
func init_unused_11163() {
if false {
reflect.TypeOf(123)
}
if false {
reflect.TypeOf(unsafe.Sizeof(0))
}
if false {
fmt.Println(123)
}
if false {
log.Println(123)
}
if false {
qtrt.KeepMe()
}
if false {
qtcore.KeepMe()
}
if false {
qtgui.KeepMe()
}
}
// keep block end