1 | /****************************************************************************** |
---|
2 | * SAGE - Scalable Adaptive Graphics Environment |
---|
3 | * |
---|
4 | * Module: sage.h |
---|
5 | * Author : Byungil Jeong |
---|
6 | * |
---|
7 | * Copyright (C) 2004 Electronic Visualization Laboratory, |
---|
8 | * University of Illinois at Chicago |
---|
9 | * |
---|
10 | * All rights reserved. |
---|
11 | * |
---|
12 | * Redistribution and use in source and binary forms, with or without |
---|
13 | * modification, are permitted provided that the following conditions are met: |
---|
14 | * |
---|
15 | * * Redistributions of source code must retain the above copyright |
---|
16 | * notice, this list of conditions and the following disclaimer. |
---|
17 | * * Redistributions in binary form must reproduce the above |
---|
18 | * copyright notice, this list of conditions and the following disclaimer |
---|
19 | * in the documentation and/or other materials provided with the distribution. |
---|
20 | * * Neither the name of the University of Illinois at Chicago nor |
---|
21 | * the names of its contributors may be used to endorse or promote |
---|
22 | * products derived from this software without specific prior written permission. |
---|
23 | * |
---|
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
---|
27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
---|
28 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
---|
29 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
30 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
---|
31 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
35 | * |
---|
36 | * Direct questions, comments etc about SAGE to sage_users@listserv.uic.edu or |
---|
37 | * http://www.evl.uic.edu/cavern/forum/ |
---|
38 | * |
---|
39 | *****************************************************************************/ |
---|
40 | |
---|
41 | #ifndef _SAGE_H |
---|
42 | #define _SAGE_H |
---|
43 | |
---|
44 | #include "sageBase.h" |
---|
45 | |
---|
46 | #define SAGE_BLOCK_NO_SYNC 100 |
---|
47 | #define SAGE_BLOCK_CONST_SYNC 101 |
---|
48 | #define SAGE_BLOCK_SOFT_SYNC 102 |
---|
49 | #define SAGE_BLOCK_HARD_SYNC 103 |
---|
50 | |
---|
51 | // Message Start Point |
---|
52 | #define FS_CORE_MESSAGE 0 |
---|
53 | #define SAGE_UI_TO_FSM 1000 |
---|
54 | #define APP_UI_TO_FSM 2000 |
---|
55 | #define APP_TO_FSM 3000 |
---|
56 | #define DISP_MESSAGE 10000 |
---|
57 | #define GRCV_MESSAGE 20000 |
---|
58 | #define SAIL_MESSAGE 30000 |
---|
59 | #define APP_MESSAGE 31000 |
---|
60 | #define FSM_TO_SAGE_UI 40000 |
---|
61 | #define FSM_TO_APP_UI 41000 |
---|
62 | #define BRIDGE_MESSAGE 50000 |
---|
63 | #define ARCV_MESSAGE 15000 |
---|
64 | |
---|
65 | // fsManager Messages |
---|
66 | #define REG_APP FS_CORE_MESSAGE + 1 // app_name block_width block_height pixel_size sync_mode |
---|
67 | #define REG_GRCV FS_CORE_MESSAGE + 2 |
---|
68 | #define FS_APPDISP_KILLED FS_CORE_MESSAGE + 3 |
---|
69 | #define FS_TIME_MSG FS_CORE_MESSAGE + 4 |
---|
70 | #define REG_ARCV FS_CORE_MESSAGE + 5 |
---|
71 | #define SYNC_INIT_ARCV FS_CORE_MESSAGE + 6 |
---|
72 | #define NOTIFY_APP_SHUTDOWN FS_CORE_MESSAGE + 7 |
---|
73 | |
---|
74 | // UI to fsManager |
---|
75 | #define SAGE_UI_REG SAGE_UI_TO_FSM |
---|
76 | #define EXEC_APP SAGE_UI_TO_FSM + 1 |
---|
77 | #define SHUTDOWN_APP SAGE_UI_TO_FSM + 2 |
---|
78 | #define MOVE_WINDOW SAGE_UI_TO_FSM + 3 |
---|
79 | #define RESIZE_WINDOW SAGE_UI_TO_FSM + 4 |
---|
80 | #define PERF_INFO_REQ SAGE_UI_TO_FSM + 5 |
---|
81 | #define STOP_PERF_INFO SAGE_UI_TO_FSM + 6 |
---|
82 | #define SAGE_BG_COLOR SAGE_UI_TO_FSM + 7 |
---|
83 | #define SAGE_Z_VALUE SAGE_UI_TO_FSM + 8 |
---|
84 | #define SAGE_ADMIN_CHECK SAGE_UI_TO_FSM + 9 |
---|
85 | #define BRING_TO_FRONT SAGE_UI_TO_FSM + 10 |
---|
86 | #define UPDATE_WIN_PROP SAGE_UI_TO_FSM + 11 |
---|
87 | #define APP_FRAME_RATE SAGE_UI_TO_FSM + 12 |
---|
88 | #define APP_PAUSE_INTV SAGE_UI_TO_FSM + 13 |
---|
89 | #define SAGE_APP_SHARE SAGE_UI_TO_FSM + 14 |
---|
90 | #define SAGE_FLIP_WINDOW SAGE_UI_TO_FSM + 15 |
---|
91 | #define SAGE_CHECK_LATENCY SAGE_UI_TO_FSM + 17 |
---|
92 | #define ROTATE_WINDOW SAGE_UI_TO_FSM + 18 |
---|
93 | |
---|
94 | #define NETWORK_RESERVED SAGE_UI_TO_FSM + 50 |
---|
95 | |
---|
96 | #define SAGE_SHUTDOWN SAGE_UI_TO_FSM + 100 |
---|
97 | #define STREAM_PAUSE SAGE_UI_TO_FSM + 101 |
---|
98 | #define STREAM_RESUME SAGE_UI_TO_FSM + 102 |
---|
99 | |
---|
100 | #define ADD_OBJECT SAGE_UI_TO_FSM + 200 |
---|
101 | #define MOVE_OBJECT SAGE_UI_TO_FSM + 201 |
---|
102 | #define REMOVE_OBJECT SAGE_UI_TO_FSM + 202 |
---|
103 | #define OBJECT_MESSAGE SAGE_UI_TO_FSM + 203 |
---|
104 | #define SHOW_OBJECT SAGE_UI_TO_FSM + 204 |
---|
105 | |
---|
106 | #define APP_UI_REG APP_UI_TO_FSM |
---|
107 | |
---|
108 | // displayInstance Messages from SAIL |
---|
109 | #define DISP_STREAM_INFO DISP_MESSAGE |
---|
110 | #define DISP_SAIL_RESUME DISP_MESSAGE + 4 |
---|
111 | #define DISP_SAIL_PERF_RPT DISP_MESSAGE + 5 |
---|
112 | |
---|
113 | // displayInstance Messages from SAGE Receiver |
---|
114 | #define DISP_START_STREAM DISP_MESSAGE + 100 |
---|
115 | #define DISP_APP_CONNECTED DISP_MESSAGE + 101 |
---|
116 | #define DISP_DEPTH_CHANGED DISP_MESSAGE + 103 |
---|
117 | #define DISP_RCV_FRATE_RPT DISP_MESSAGE + 104 |
---|
118 | #define DISP_RCV_BANDWITH_RPT DISP_MESSAGE + 105 |
---|
119 | |
---|
120 | // gStreamRcv Messages |
---|
121 | #define RCV_INIT GRCV_MESSAGE |
---|
122 | #define RCV_UPDATE_DISPLAY GRCV_MESSAGE + 1 |
---|
123 | #define RCV_CLEAR_DISPLAY GRCV_MESSAGE + 2 |
---|
124 | #define SHUTDOWN_RECEIVERS GRCV_MESSAGE + 3 |
---|
125 | #define RCV_CHANGE_BGCOLOR GRCV_MESSAGE + 4 |
---|
126 | #define RCV_SHUTDOWN_APP GRCV_MESSAGE + 5 |
---|
127 | #define RCV_CHANGE_DEPTH GRCV_MESSAGE + 6 |
---|
128 | #define RCV_PERF_INFO_REQ GRCV_MESSAGE + 7 |
---|
129 | #define RCV_PERF_INFO_STOP GRCV_MESSAGE + 8 |
---|
130 | #define UPDATE_OBJECT_POSITION GRCV_MESSAGE + 9 |
---|
131 | |
---|
132 | // aStreamRcv Messages |
---|
133 | #define ARCV_AUDIO_INIT ARCV_MESSAGE |
---|
134 | #define ARCV_SYNC_INIT ARCV_MESSAGE + 1 |
---|
135 | #define ARCV_SHUTDOWN_APP ARCV_MESSAGE + 2 |
---|
136 | |
---|
137 | // sage bridge messages |
---|
138 | #define BRIDGE_REG_NODE BRIDGE_MESSAGE |
---|
139 | #define BRIDGE_SLAVE_INIT BRIDGE_MESSAGE + 1 |
---|
140 | #define BRIDGE_SHUTDOWN BRIDGE_MESSAGE + 2 |
---|
141 | #define BRIDGE_SHUTDOWN_APP BRIDGE_MESSAGE + 3 |
---|
142 | #define BRIDGE_SLAVE_PERF BRIDGE_MESSAGE + 4 |
---|
143 | #define BRIDGE_SYNC_ID BRIDGE_MESSAGE + 5 |
---|
144 | #define BRIDGE_APP_REG BRIDGE_MESSAGE + 6 |
---|
145 | #define BRIDGE_SLAVE_READY BRIDGE_MESSAGE + 7 |
---|
146 | #define BRIDGE_STREAM_INIT BRIDGE_MESSAGE + 8 |
---|
147 | #define BRIDGE_UI_REG BRIDGE_MESSAGE + 9 |
---|
148 | #define BRIDGE_APP_INST_READY BRIDGE_MESSAGE + 10 |
---|
149 | #define CLEAR_APP_INSTANCE BRIDGE_MESSAGE + 11 |
---|
150 | |
---|
151 | // fsManager to UI : 40000 |
---|
152 | #define SAGE_STATUS FSM_TO_SAGE_UI |
---|
153 | #define APP_INFO_RETURN FSM_TO_SAGE_UI + 1 |
---|
154 | #define UI_PERF_INFO FSM_TO_SAGE_UI + 2 |
---|
155 | #define UI_APP_SHUTDOWN FSM_TO_SAGE_UI + 3 |
---|
156 | #define SAGE_DISPLAY_INFO FSM_TO_SAGE_UI + 4 |
---|
157 | #define Z_VALUE_RETURN FSM_TO_SAGE_UI + 5 |
---|
158 | #define APP_EXEC_CONFIG FSM_TO_SAGE_UI + 6 |
---|
159 | #define DISP_CONNECTION_INFO FSM_TO_SAGE_UI + 7 |
---|
160 | #define UI_ADMIN_INFO FSM_TO_SAGE_UI + 8 |
---|
161 | #define UI_MOVE_FAIL FSM_TO_SAGE_UI + 15 |
---|
162 | #define UI_RESIZE_FAIL FSM_TO_SAGE_UI + 16 |
---|
163 | #define UI_PERF_REQ_FAIL FSM_TO_SAGE_UI + 17 |
---|
164 | #define UI_OBJECT_INFO FSM_TO_SAGE_UI + 18 |
---|
165 | |
---|
166 | #define REQUEST_BANDWIDTH FSM_TO_SAGE_UI + 100 |
---|
167 | |
---|
168 | #define POINTER_STATUS FSM_TO_SAGE_UI + 200 |
---|
169 | |
---|
170 | #define APP_STATUS FSM_TO_APP_UI |
---|
171 | |
---|
172 | // SAIL Messages |
---|
173 | #define SAIL_UI_CLIENT SAIL_MESSAGE + 1 |
---|
174 | #define SAIL_SLAVE_REG SAIL_MESSAGE + 2 |
---|
175 | #define SAIL_SHUTDOWN SAIL_MESSAGE + 3 |
---|
176 | #define SAIL_STREAM_START SAIL_MESSAGE + 4 |
---|
177 | #define SAIL_CONNECTED_TO_RCV SAIL_MESSAGE + 5 |
---|
178 | #define SAIL_PERF_INFO SAIL_MESSAGE + 6 |
---|
179 | #define SAIL_SEND_TIME_BLOCK SAIL_MESSAGE + 7 |
---|
180 | #define SAIL_CONFIG_STREAM SAIL_MESSAGE + 8 |
---|
181 | #define SAIL_INIT_STREAM SAIL_MESSAGE + 9 |
---|
182 | |
---|
183 | #define SAIL_CONNECT_TO_RCV SAIL_MESSAGE + 101 |
---|
184 | #define SAIL_INIT_MSG SAIL_MESSAGE + 102 |
---|
185 | #define SAIL_PERF_INFO_REQ SAIL_MESSAGE + 103 |
---|
186 | #define SAIL_PERF_INFO_STOP SAIL_MESSAGE + 104 |
---|
187 | #define SAIL_FRAME_RATE SAIL_MESSAGE + 105 |
---|
188 | #define SAIL_FLIP_WINDOW SAIL_MESSAGE + 106 |
---|
189 | #define SAIL_CONNECT_TO_ARCV SAIL_MESSAGE + 107 |
---|
190 | #define SAIL_RESEND_FRAME SAIL_MESSAGE + 108 |
---|
191 | #define SAIL_CONNECT_TO_RCV_PORT SAIL_MESSAGE + 109 |
---|
192 | #define SAIL_SET_RAIL SAIL_MESSAGE + 110 // sungwon experimental |
---|
193 | |
---|
194 | // App UI to APP |
---|
195 | #define SAGE_EVT_CLICK APP_MESSAGE |
---|
196 | #define SAGE_EVT_DOUBLE_CLICK (APP_MESSAGE + 1) |
---|
197 | #define SAGE_EVT_MOVE (APP_MESSAGE + 2) |
---|
198 | #define SAGE_EVT_ANALOG1 (APP_MESSAGE + 3) |
---|
199 | #define SAGE_EVT_PAN (APP_MESSAGE + 3) |
---|
200 | #define SAGE_EVT_ANALOG2 (APP_MESSAGE + 4) |
---|
201 | #define SAGE_EVT_ROTATE (APP_MESSAGE + 4) |
---|
202 | #define SAGE_EVT_ANALOG3 (APP_MESSAGE + 5) |
---|
203 | #define SAGE_EVT_ZOOM (APP_MESSAGE + 5) |
---|
204 | #define SAGE_EVT_ARROW (APP_MESSAGE + 6) |
---|
205 | #define SAGE_EVT_KEY (APP_MESSAGE + 7) |
---|
206 | |
---|
207 | //aliases |
---|
208 | #define EVT_CLICK SAGE_EVT_CLICK |
---|
209 | #define EVT_DOUBLE_CLICK SAGE_EVT_DOUBLE_CLICK |
---|
210 | #define EVT_MOVE SAGE_EVT_MOVE |
---|
211 | #define EVT_ANALOG1 SAGE_EVT_ANALOG1 |
---|
212 | #define EVT_PAN SAGE_EVT_PAN |
---|
213 | #define EVT_ANALOG2 SAGE_EVT_ANALOG2 |
---|
214 | #define EVT_ROTATE SAGE_EVT_ROTATE |
---|
215 | #define EVT_ANALOG3 SAGE_EVT_ANALOG3 |
---|
216 | #define EVT_ZOOM SAGE_EVT_ZOOM |
---|
217 | #define EVT_ARROW SAGE_EVT_ARROW |
---|
218 | #define EVT_KEY SAGE_EVT_KEY |
---|
219 | |
---|
220 | // FSM to APP |
---|
221 | #define APP_QUIT APP_MESSAGE + 2000 |
---|
222 | #define APP_REFRESH_FRAME APP_MESSAGE + 2001 |
---|
223 | |
---|
224 | #if defined(WIN32) |
---|
225 | // Conversion from 'size_t' to 'int' |
---|
226 | #pragma warning (disable: 4267) //disable warning 4267 |
---|
227 | // Nonstandard extension used : zero-sized array in struct/union |
---|
228 | #pragma warning (disable: 4200) //disable warning 4267 |
---|
229 | #endif |
---|
230 | |
---|
231 | #endif |
---|