Add pointlog2svg utility for the thesis
[numtypysics.git] / Multitouch.h
blobabb5a58835ddc6262aec40ccc6ae0916b2b83600
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 struct t_cursor_event {
53 int cursor_id;
56 typedef struct t_cursor_event CursorEvent;
59 enum
61 /* SDL_Events with one of the following have a DrawEvent as data1 */
62 SDL_NP_START_STROKE = SDL_USEREVENT+1,
63 SDL_NP_APPEND_STROKE,
64 SDL_NP_FINISH_STROKE,
66 SDL_NP_START_ROPE,
67 SDL_NP_APPEND_ROPE,
68 SDL_NP_FINISH_ROPE,
70 SDL_NP_PREVIEW_CURSOR,
72 /* SDL_Event with one of the following types have a CursorEvent as data1 */
73 SDL_NP_CANCEL_DRAW,
75 /* SDL_Events with one of the following types have a DragEvent as data1 */
76 SDL_NP_START_DRAG,
77 SDL_NP_DRAG,
78 SDL_NP_END_DRAG,
80 /* SDL_Events with one of the following types have a PanEvent as data1 */
81 SDL_NP_PAN,
83 /* SDL_Events with one of the following types have a ZoomEvent as data1 */
84 SDL_NP_ZOOM,
86 /* SDL_Events with one of the following types have a DeletEvent as data1 */
87 SDL_NP_DELETE,
89 /* SDL_Events with one of the following types don't have any user data */
90 SDL_NP_RESTART_LEVEL,
91 SDL_NP_NEXT_LEVEL,
92 SDL_NP_PREV_LEVEL,
93 SDL_NP_TOGGLE_MENU,
94 SDL_NP_SHOW_MENU,
95 SDL_NP_HIDE_MENU,
96 SDL_NP_TOGGLE_PAUSE,
97 SDL_NP_PAUSE,
98 SDL_NP_RESUME,
99 SDL_NP_SAVE,
100 SDL_NP_TOGGLE_EDITOR,
101 SDL_NP_REPLAY
106 void queueStartStrokeEvent(int cursor_id, int x, int y);
107 void queueAppendStrokeEvent(int cursor_id, int x, int y);
108 void queueFinishStrokeEvent(int cursor_id, int x, int y);
109 void queueCancelDrawEvent(int cursor_id);
110 void queuePreviewCursorEvent(int cursor_id, int x, int y);
111 void queueCursorEvent(int type, int cursor_id);
112 void queueStartRopeEvent(int cursor_id, int x, int y);
113 void queueAppendRopeEvent(int cursor_id, int x, int y);
114 void queueFinishRopeEvent(int cursor_id, int x, int y);
115 void queueStartDragEvent(int cursor_id, int x, int y);
116 void queueDragEvent(int cursor_id, int x, int y);
117 void queueEndDragEvent(int cursor_id, int x, int y);
118 void queuePanEvent(int xdiff, int ydiff);
119 void queueZoomEvent(int x, int y, float zoomfactor);
120 void queueDeleteEvent(int x, int y);
121 void queueRestartLevelEvent();
122 void queueNextLevelEvent();
123 void queuePreviousLevelEvent();
124 void queueToggleMenuEvent();
125 void queueShowMenuEvent();
126 void queueHideMenuEvent();
127 void queueTogglePauseEvent();
128 void queuePauseEvent();
129 void queueResumeEvent();
130 void queueSaveEvent();
131 void queueToggleEditorEvent();
132 void queueReplayEvent();
133 void queueUserEvent(int type, void *data1, void *data2);