Fix (lots of) memory leaks in Game.cpp
[numtypysics.git] / Multitouch.h
blob5e5d7f10dd3020f6cca99a62b11a467823f17bf4
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;
24 typedef struct t_drag_event DragEvent;
27 struct t_pan_event {
28 int xdiff;
29 int ydiff;
32 typedef struct t_pan_event PanEvent;
35 struct t_zoom_event {
36 int x;
37 int y;
38 float zoomfactor;
41 typedef struct t_zoom_event ZoomEvent;
44 struct t_delete_event {
45 int x;
46 int y;
49 typedef struct t_delete_event DeleteEvent;
52 enum
54 /* SDL_Events with one of the following have a DrawEvent as data1 */
55 SDL_NP_START_STROKE = SDL_USEREVENT+1,
56 SDL_NP_APPEND_STROKE,
57 SDL_NP_FINISH_STROKE,
59 SDL_NP_START_ROPE,
60 SDL_NP_APPEND_ROPE,
61 SDL_NP_FINISH_ROPE,
64 /* SDL_Events with one of the following types have a DragEvent as data1 */
65 SDL_NP_START_DRAG,
66 SDL_NP_DRAG,
67 SDL_NP_END_DRAG,
69 /* SDL_Events with one of the following types have a PanEvent as data1 */
70 SDL_NP_PAN,
72 /* SDL_Events with one of the following types have a ZoomEvent as data1 */
73 SDL_NP_ZOOM,
75 /* SDL_Events with one of the following types have a DeletEvent as data1 */
76 SDL_NP_DELETE
80 void queueStartStrokeEvent(int cursor_id, int x, int y);
81 void queueAppendStrokeEvent(int cursor_id, int x, int y);
82 void queueFinishStrokeEvent(int cursor_id, int x, int y);
83 void queueStartRopeEvent(int cursor_id, int x, int y);
84 void queueAppendRopeEvent(int cursor_id, int x, int y);
85 void queueFinishRopeEvent(int cursor_id, int x, int y);
86 void queueStartDragEvent(int cursor_id, int x, int y);
87 void queueDragEvent(int cursor_id, int x, int y);
88 void queueEndDragEvent(int cursor_id, int x, int y);
89 void queuePanEvent(int xdiff, int ydiff);
90 void queueZoomEvent(int x, int y, float zoomfactor);
91 void queueDeleteEvent(int x, int y);
92 void queueUserEvent(int type, void *data1, void *data2);