Support for multi-touch stroke drawing in tuioinput.py
[numtypysics.git] / Multitouch.h
blob7f64196cd8bb2e03906b2ebcfb8f8d4f66189816
1 #include <SDL/SDL.h>
3 #define MT_MAX_CURSORS 10
5 /* we don't want to break any unrelated code */
6 #define m_createStroke m_createStrokes[0]
7 #define m_moveStroke m_moveStrokes[0]
9 struct t_draw_event {
10 int cursor_id;
11 int x;
12 int y;
15 typedef struct t_draw_event DrawEvent;
18 struct t_drag_event {
19 int cursor_id;
20 int x;
21 int y;
22 int xdiff;
23 int ydiff;
26 typedef struct t_drag_event DragEvent;
29 struct t_pan_event {
30 int xdiff;
31 int ydiff;
34 typedef struct t_pan_event PanEvent;
37 struct t_zoom_event {
38 int x;
39 int y;
40 float zoomfactor;
43 typedef struct t_zoom_event ZoomEvent;
46 struct t_delete_event {
47 int x;
48 int y;
51 typedef struct t_delete_event DeleteEvent;
54 enum
56 /* SDL_Events with one of the following have a DrawEvent as data1 */
57 SDL_NP_START_STROKE = SDL_USEREVENT+1,
58 SDL_NP_APPEND_STROKE,
59 SDL_NP_FINISH_STROKE,
61 SDL_NP_START_ROPE,
62 SDL_NP_APPEND_ROPE,
63 SDL_NP_FINISH_ROPE,
66 /* SDL_Events with one of the following types have a DragEvent as data1 */
67 SDL_NP_START_DRAG,
68 SDL_NP_DRAG,
69 SDL_NP_END_DRAG,
71 /* SDL_Events with one of the following types have a PanEvent as data1 */
72 SDL_NP_PAN,
74 /* SDL_Events with one of the following types have a ZoomEvent as data1 */
75 SDL_NP_ZOOM,
77 /* SDL_Events with one of the following types have a DeletEvent as data1 */
78 SDL_NP_DELETE
82 void queueStartStrokeEvent(int cursor_id, int x, int y);
83 void queueAppendStrokeEvent(int cursor_id, int x, int y);
84 void queueFinishStrokeEvent(int cursor_id, int x, int y);
85 void queueStartRopeEvent(int cursor_id, int x, int y);
86 void queueAppendRopeEvent(int cursor_id, int x, int y);
87 void queueFinishRopeEvent(int cursor_id, int x, int y);
88 void queueStartDragEvent(int cursor_id, int x, int y, int xdiff, int ydiff);
89 void queueDragEvent(int cursor_id, int x, int y, int xdiff, int ydiff);
90 void queueEndDragEvent(int cursor_id, int x, int y, int xdiff, int ydiff);
91 void queuePanEvent(int xdiff, int ydiff);
92 void queueZoomEvent(int x, int y, float zoomfactor);
93 void queueDeleteEvent(int x, int y);
94 void queueUserEvent(int type, void *data1, void *data2);