1 //******************************************************************************
2 //  Copyright (c) 2005-2013 by Jan Van hijfte
3 //
4 //  See the included file COPYING.TXT for details about the copyright.
5 //
6 //  This program is distributed in the hope that it will be useful,
7 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 //******************************************************************************
10 
11 
12 #include "qgesture_c.h"
13 
QGesture_Create(QObjectH parent)14 QGestureH QGesture_Create(QObjectH parent)
15 {
16 	return (QGestureH) new QGesture((QObject*)parent);
17 }
18 
QGesture_Destroy(QGestureH handle)19 void QGesture_Destroy(QGestureH handle)
20 {
21 	delete (QGesture *)handle;
22 }
23 
QGesture_gestureType(QGestureH handle)24 Qt::GestureType QGesture_gestureType(QGestureH handle)
25 {
26 	return (Qt::GestureType) ((QGesture *)handle)->gestureType();
27 }
28 
QGesture_state(QGestureH handle)29 Qt::GestureState QGesture_state(QGestureH handle)
30 {
31 	return (Qt::GestureState) ((QGesture *)handle)->state();
32 }
33 
QGesture_hotSpot(QGestureH handle,PQtPointF retval)34 void QGesture_hotSpot(QGestureH handle, PQtPointF retval)
35 {
36 	*(QPointF *)retval = ((QGesture *)handle)->hotSpot();
37 }
38 
QGesture_setHotSpot(QGestureH handle,const QPointFH value)39 void QGesture_setHotSpot(QGestureH handle, const QPointFH value)
40 {
41 	((QGesture *)handle)->setHotSpot(*(const QPointF*)value);
42 }
43 
QGesture_hasHotSpot(QGestureH handle)44 bool QGesture_hasHotSpot(QGestureH handle)
45 {
46 	return (bool) ((QGesture *)handle)->hasHotSpot();
47 }
48 
QGesture_unsetHotSpot(QGestureH handle)49 void QGesture_unsetHotSpot(QGestureH handle)
50 {
51 	((QGesture *)handle)->unsetHotSpot();
52 }
53 
QGesture_setGestureCancelPolicy(QGestureH handle,QGesture::GestureCancelPolicy policy)54 void QGesture_setGestureCancelPolicy(QGestureH handle, QGesture::GestureCancelPolicy policy)
55 {
56 	((QGesture *)handle)->setGestureCancelPolicy(policy);
57 }
58 
QGesture_gestureCancelPolicy(QGestureH handle)59 QGesture::GestureCancelPolicy QGesture_gestureCancelPolicy(QGestureH handle)
60 {
61 	return (QGesture::GestureCancelPolicy) ((QGesture *)handle)->gestureCancelPolicy();
62 }
63 
QPanGesture_Create(QObjectH parent)64 QPanGestureH QPanGesture_Create(QObjectH parent)
65 {
66 	return (QPanGestureH) new QPanGesture((QObject*)parent);
67 }
68 
QPanGesture_Destroy(QPanGestureH handle)69 void QPanGesture_Destroy(QPanGestureH handle)
70 {
71 	delete (QPanGesture *)handle;
72 }
73 
QPanGesture_lastOffset(QPanGestureH handle,PQtPointF retval)74 void QPanGesture_lastOffset(QPanGestureH handle, PQtPointF retval)
75 {
76 	*(QPointF *)retval = ((QPanGesture *)handle)->lastOffset();
77 }
78 
QPanGesture_offset(QPanGestureH handle,PQtPointF retval)79 void QPanGesture_offset(QPanGestureH handle, PQtPointF retval)
80 {
81 	*(QPointF *)retval = ((QPanGesture *)handle)->offset();
82 }
83 
QPanGesture_delta(QPanGestureH handle,PQtPointF retval)84 void QPanGesture_delta(QPanGestureH handle, PQtPointF retval)
85 {
86 	*(QPointF *)retval = ((QPanGesture *)handle)->delta();
87 }
88 
QPanGesture_acceleration(QPanGestureH handle)89 qreal QPanGesture_acceleration(QPanGestureH handle)
90 {
91 	return (qreal) ((QPanGesture *)handle)->acceleration();
92 }
93 
QPanGesture_setLastOffset(QPanGestureH handle,const QPointFH value)94 void QPanGesture_setLastOffset(QPanGestureH handle, const QPointFH value)
95 {
96 	((QPanGesture *)handle)->setLastOffset(*(const QPointF*)value);
97 }
98 
QPanGesture_setOffset(QPanGestureH handle,const QPointFH value)99 void QPanGesture_setOffset(QPanGestureH handle, const QPointFH value)
100 {
101 	((QPanGesture *)handle)->setOffset(*(const QPointF*)value);
102 }
103 
QPanGesture_setAcceleration(QPanGestureH handle,qreal value)104 void QPanGesture_setAcceleration(QPanGestureH handle, qreal value)
105 {
106 	((QPanGesture *)handle)->setAcceleration(value);
107 }
108 
QPinchGesture_Create(QObjectH parent)109 QPinchGestureH QPinchGesture_Create(QObjectH parent)
110 {
111 	return (QPinchGestureH) new QPinchGesture((QObject*)parent);
112 }
113 
QPinchGesture_Destroy(QPinchGestureH handle)114 void QPinchGesture_Destroy(QPinchGestureH handle)
115 {
116 	delete (QPinchGesture *)handle;
117 }
118 
QPinchGesture_totalChangeFlags(QPinchGestureH handle)119 unsigned int QPinchGesture_totalChangeFlags(QPinchGestureH handle)
120 {
121 	return (unsigned int) ((QPinchGesture *)handle)->totalChangeFlags();
122 }
123 
QPinchGesture_setTotalChangeFlags(QPinchGestureH handle,unsigned int value)124 void QPinchGesture_setTotalChangeFlags(QPinchGestureH handle, unsigned int value)
125 {
126 	((QPinchGesture *)handle)->setTotalChangeFlags((QPinchGesture::ChangeFlags)value);
127 }
128 
QPinchGesture_changeFlags(QPinchGestureH handle)129 unsigned int QPinchGesture_changeFlags(QPinchGestureH handle)
130 {
131 	return (unsigned int) ((QPinchGesture *)handle)->changeFlags();
132 }
133 
QPinchGesture_setChangeFlags(QPinchGestureH handle,unsigned int value)134 void QPinchGesture_setChangeFlags(QPinchGestureH handle, unsigned int value)
135 {
136 	((QPinchGesture *)handle)->setChangeFlags((QPinchGesture::ChangeFlags)value);
137 }
138 
QPinchGesture_startCenterPoint(QPinchGestureH handle,PQtPointF retval)139 void QPinchGesture_startCenterPoint(QPinchGestureH handle, PQtPointF retval)
140 {
141 	*(QPointF *)retval = ((QPinchGesture *)handle)->startCenterPoint();
142 }
143 
QPinchGesture_lastCenterPoint(QPinchGestureH handle,PQtPointF retval)144 void QPinchGesture_lastCenterPoint(QPinchGestureH handle, PQtPointF retval)
145 {
146 	*(QPointF *)retval = ((QPinchGesture *)handle)->lastCenterPoint();
147 }
148 
QPinchGesture_centerPoint(QPinchGestureH handle,PQtPointF retval)149 void QPinchGesture_centerPoint(QPinchGestureH handle, PQtPointF retval)
150 {
151 	*(QPointF *)retval = ((QPinchGesture *)handle)->centerPoint();
152 }
153 
QPinchGesture_setStartCenterPoint(QPinchGestureH handle,const QPointFH value)154 void QPinchGesture_setStartCenterPoint(QPinchGestureH handle, const QPointFH value)
155 {
156 	((QPinchGesture *)handle)->setStartCenterPoint(*(const QPointF*)value);
157 }
158 
QPinchGesture_setLastCenterPoint(QPinchGestureH handle,const QPointFH value)159 void QPinchGesture_setLastCenterPoint(QPinchGestureH handle, const QPointFH value)
160 {
161 	((QPinchGesture *)handle)->setLastCenterPoint(*(const QPointF*)value);
162 }
163 
QPinchGesture_setCenterPoint(QPinchGestureH handle,const QPointFH value)164 void QPinchGesture_setCenterPoint(QPinchGestureH handle, const QPointFH value)
165 {
166 	((QPinchGesture *)handle)->setCenterPoint(*(const QPointF*)value);
167 }
168 
QPinchGesture_totalScaleFactor(QPinchGestureH handle)169 qreal QPinchGesture_totalScaleFactor(QPinchGestureH handle)
170 {
171 	return (qreal) ((QPinchGesture *)handle)->totalScaleFactor();
172 }
173 
QPinchGesture_lastScaleFactor(QPinchGestureH handle)174 qreal QPinchGesture_lastScaleFactor(QPinchGestureH handle)
175 {
176 	return (qreal) ((QPinchGesture *)handle)->lastScaleFactor();
177 }
178 
QPinchGesture_scaleFactor(QPinchGestureH handle)179 qreal QPinchGesture_scaleFactor(QPinchGestureH handle)
180 {
181 	return (qreal) ((QPinchGesture *)handle)->scaleFactor();
182 }
183 
QPinchGesture_setTotalScaleFactor(QPinchGestureH handle,qreal value)184 void QPinchGesture_setTotalScaleFactor(QPinchGestureH handle, qreal value)
185 {
186 	((QPinchGesture *)handle)->setTotalScaleFactor(value);
187 }
188 
QPinchGesture_setLastScaleFactor(QPinchGestureH handle,qreal value)189 void QPinchGesture_setLastScaleFactor(QPinchGestureH handle, qreal value)
190 {
191 	((QPinchGesture *)handle)->setLastScaleFactor(value);
192 }
193 
QPinchGesture_setScaleFactor(QPinchGestureH handle,qreal value)194 void QPinchGesture_setScaleFactor(QPinchGestureH handle, qreal value)
195 {
196 	((QPinchGesture *)handle)->setScaleFactor(value);
197 }
198 
QPinchGesture_totalRotationAngle(QPinchGestureH handle)199 qreal QPinchGesture_totalRotationAngle(QPinchGestureH handle)
200 {
201 	return (qreal) ((QPinchGesture *)handle)->totalRotationAngle();
202 }
203 
QPinchGesture_lastRotationAngle(QPinchGestureH handle)204 qreal QPinchGesture_lastRotationAngle(QPinchGestureH handle)
205 {
206 	return (qreal) ((QPinchGesture *)handle)->lastRotationAngle();
207 }
208 
QPinchGesture_rotationAngle(QPinchGestureH handle)209 qreal QPinchGesture_rotationAngle(QPinchGestureH handle)
210 {
211 	return (qreal) ((QPinchGesture *)handle)->rotationAngle();
212 }
213 
QPinchGesture_setTotalRotationAngle(QPinchGestureH handle,qreal value)214 void QPinchGesture_setTotalRotationAngle(QPinchGestureH handle, qreal value)
215 {
216 	((QPinchGesture *)handle)->setTotalRotationAngle(value);
217 }
218 
QPinchGesture_setLastRotationAngle(QPinchGestureH handle,qreal value)219 void QPinchGesture_setLastRotationAngle(QPinchGestureH handle, qreal value)
220 {
221 	((QPinchGesture *)handle)->setLastRotationAngle(value);
222 }
223 
QPinchGesture_setRotationAngle(QPinchGestureH handle,qreal value)224 void QPinchGesture_setRotationAngle(QPinchGestureH handle, qreal value)
225 {
226 	((QPinchGesture *)handle)->setRotationAngle(value);
227 }
228 
QSwipeGesture_Create(QObjectH parent)229 QSwipeGestureH QSwipeGesture_Create(QObjectH parent)
230 {
231 	return (QSwipeGestureH) new QSwipeGesture((QObject*)parent);
232 }
233 
QSwipeGesture_Destroy(QSwipeGestureH handle)234 void QSwipeGesture_Destroy(QSwipeGestureH handle)
235 {
236 	delete (QSwipeGesture *)handle;
237 }
238 
QSwipeGesture_horizontalDirection(QSwipeGestureH handle)239 QSwipeGesture::SwipeDirection QSwipeGesture_horizontalDirection(QSwipeGestureH handle)
240 {
241 	return (QSwipeGesture::SwipeDirection) ((QSwipeGesture *)handle)->horizontalDirection();
242 }
243 
QSwipeGesture_verticalDirection(QSwipeGestureH handle)244 QSwipeGesture::SwipeDirection QSwipeGesture_verticalDirection(QSwipeGestureH handle)
245 {
246 	return (QSwipeGesture::SwipeDirection) ((QSwipeGesture *)handle)->verticalDirection();
247 }
248 
QSwipeGesture_swipeAngle(QSwipeGestureH handle)249 qreal QSwipeGesture_swipeAngle(QSwipeGestureH handle)
250 {
251 	return (qreal) ((QSwipeGesture *)handle)->swipeAngle();
252 }
253 
QSwipeGesture_setSwipeAngle(QSwipeGestureH handle,qreal value)254 void QSwipeGesture_setSwipeAngle(QSwipeGestureH handle, qreal value)
255 {
256 	((QSwipeGesture *)handle)->setSwipeAngle(value);
257 }
258 
QTapGesture_Create(QObjectH parent)259 QTapGestureH QTapGesture_Create(QObjectH parent)
260 {
261 	return (QTapGestureH) new QTapGesture((QObject*)parent);
262 }
263 
QTapGesture_Destroy(QTapGestureH handle)264 void QTapGesture_Destroy(QTapGestureH handle)
265 {
266 	delete (QTapGesture *)handle;
267 }
268 
QTapGesture_position(QTapGestureH handle,PQtPointF retval)269 void QTapGesture_position(QTapGestureH handle, PQtPointF retval)
270 {
271 	*(QPointF *)retval = ((QTapGesture *)handle)->position();
272 }
273 
QTapGesture_setPosition(QTapGestureH handle,const QPointFH pos)274 void QTapGesture_setPosition(QTapGestureH handle, const QPointFH pos)
275 {
276 	((QTapGesture *)handle)->setPosition(*(const QPointF*)pos);
277 }
278 
QTapAndHoldGesture_Create(QObjectH parent)279 QTapAndHoldGestureH QTapAndHoldGesture_Create(QObjectH parent)
280 {
281 	return (QTapAndHoldGestureH) new QTapAndHoldGesture((QObject*)parent);
282 }
283 
QTapAndHoldGesture_Destroy(QTapAndHoldGestureH handle)284 void QTapAndHoldGesture_Destroy(QTapAndHoldGestureH handle)
285 {
286 	delete (QTapAndHoldGesture *)handle;
287 }
288 
QTapAndHoldGesture_position(QTapAndHoldGestureH handle,PQtPointF retval)289 void QTapAndHoldGesture_position(QTapAndHoldGestureH handle, PQtPointF retval)
290 {
291 	*(QPointF *)retval = ((QTapAndHoldGesture *)handle)->position();
292 }
293 
QTapAndHoldGesture_setPosition(QTapAndHoldGestureH handle,const QPointFH pos)294 void QTapAndHoldGesture_setPosition(QTapAndHoldGestureH handle, const QPointFH pos)
295 {
296 	((QTapAndHoldGesture *)handle)->setPosition(*(const QPointF*)pos);
297 }
298 
QTapAndHoldGesture_setTimeout(int msecs)299 void QTapAndHoldGesture_setTimeout(int msecs)
300 {
301 	QTapAndHoldGesture::setTimeout(msecs);
302 }
303 
QTapAndHoldGesture_timeout()304 int QTapAndHoldGesture_timeout()
305 {
306 	return (int) QTapAndHoldGesture::timeout();
307 }
308 
QGestureEvent_Create(PPtrIntArray gestures)309 QGestureEventH QGestureEvent_Create(PPtrIntArray gestures)
310 {
311 	QList<QGesture*> t_gestures;
312 	copyPtrIntArrayToQListTemplate(gestures, t_gestures);
313 	return (QGestureEventH) new QGestureEvent(t_gestures);
314 }
315 
QGestureEvent_Destroy(QGestureEventH handle)316 void QGestureEvent_Destroy(QGestureEventH handle)
317 {
318 	delete (QGestureEvent *)handle;
319 }
320 
QGestureEvent_gestures(QGestureEventH handle,PPtrIntArray retval)321 void QGestureEvent_gestures(QGestureEventH handle, PPtrIntArray retval)
322 {
323 	QList<QGesture*> t_retval;
324 	t_retval = ((QGestureEvent *)handle)->gestures();
325 	copyQListTemplateToPtrIntArray(t_retval, retval);
326 }
327 
QGestureEvent_gesture(QGestureEventH handle,Qt::GestureType type)328 QGestureH QGestureEvent_gesture(QGestureEventH handle, Qt::GestureType type)
329 {
330 	return (QGestureH) ((QGestureEvent *)handle)->gesture(type);
331 }
332 
QGestureEvent_activeGestures(QGestureEventH handle,PPtrIntArray retval)333 void QGestureEvent_activeGestures(QGestureEventH handle, PPtrIntArray retval)
334 {
335 	QList<QGesture*> t_retval;
336 	t_retval = ((QGestureEvent *)handle)->activeGestures();
337 	copyQListTemplateToPtrIntArray(t_retval, retval);
338 }
339 
QGestureEvent_canceledGestures(QGestureEventH handle,PPtrIntArray retval)340 void QGestureEvent_canceledGestures(QGestureEventH handle, PPtrIntArray retval)
341 {
342 	QList<QGesture*> t_retval;
343 	t_retval = ((QGestureEvent *)handle)->canceledGestures();
344 	copyQListTemplateToPtrIntArray(t_retval, retval);
345 }
346 
QGestureEvent_setAccepted(QGestureEventH handle,QGestureH AnonParam1,bool AnonParam2)347 void QGestureEvent_setAccepted(QGestureEventH handle, QGestureH AnonParam1, bool AnonParam2)
348 {
349 	((QGestureEvent *)handle)->setAccepted((QGesture*)AnonParam1, AnonParam2);
350 }
351 
QGestureEvent_accept(QGestureEventH handle,QGestureH AnonParam1)352 void QGestureEvent_accept(QGestureEventH handle, QGestureH AnonParam1)
353 {
354 	((QGestureEvent *)handle)->accept((QGesture*)AnonParam1);
355 }
356 
QGestureEvent_ignore(QGestureEventH handle,QGestureH AnonParam1)357 void QGestureEvent_ignore(QGestureEventH handle, QGestureH AnonParam1)
358 {
359 	((QGestureEvent *)handle)->ignore((QGesture*)AnonParam1);
360 }
361 
QGestureEvent_isAccepted(QGestureEventH handle,QGestureH AnonParam1)362 bool QGestureEvent_isAccepted(QGestureEventH handle, QGestureH AnonParam1)
363 {
364 	return (bool) ((QGestureEvent *)handle)->isAccepted((QGesture*)AnonParam1);
365 }
366 
QGestureEvent_setAccepted2(QGestureEventH handle,Qt::GestureType AnonParam1,bool AnonParam2)367 void QGestureEvent_setAccepted2(QGestureEventH handle, Qt::GestureType AnonParam1, bool AnonParam2)
368 {
369 	((QGestureEvent *)handle)->setAccepted(AnonParam1, AnonParam2);
370 }
371 
QGestureEvent_accept2(QGestureEventH handle,Qt::GestureType AnonParam1)372 void QGestureEvent_accept2(QGestureEventH handle, Qt::GestureType AnonParam1)
373 {
374 	((QGestureEvent *)handle)->accept(AnonParam1);
375 }
376 
QGestureEvent_ignore2(QGestureEventH handle,Qt::GestureType AnonParam1)377 void QGestureEvent_ignore2(QGestureEventH handle, Qt::GestureType AnonParam1)
378 {
379 	((QGestureEvent *)handle)->ignore(AnonParam1);
380 }
381 
QGestureEvent_isAccepted2(QGestureEventH handle,Qt::GestureType AnonParam1)382 bool QGestureEvent_isAccepted2(QGestureEventH handle, Qt::GestureType AnonParam1)
383 {
384 	return (bool) ((QGestureEvent *)handle)->isAccepted(AnonParam1);
385 }
386 
QGestureEvent_setWidget(QGestureEventH handle,QWidgetH widget)387 void QGestureEvent_setWidget(QGestureEventH handle, QWidgetH widget)
388 {
389 	((QGestureEvent *)handle)->setWidget((QWidget*)widget);
390 }
391 
QGestureEvent_widget(QGestureEventH handle)392 QWidgetH QGestureEvent_widget(QGestureEventH handle)
393 {
394 	return (QWidgetH) ((QGestureEvent *)handle)->widget();
395 }
396 
QGestureEvent_mapToGraphicsScene(QGestureEventH handle,PQtPointF retval,const QPointFH gesturePoint)397 void QGestureEvent_mapToGraphicsScene(QGestureEventH handle, PQtPointF retval, const QPointFH gesturePoint)
398 {
399 	*(QPointF *)retval = ((QGestureEvent *)handle)->mapToGraphicsScene(*(const QPointF*)gesturePoint);
400 }
401 
402