xref: /haiku/headers/private/app/ServerProtocol.h (revision 93aeb8c3bc3f13cb1f282e3e749258a23790d947)
1 /*
2  * Copyright 2001-2005, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		DarkWyrm <bpmagic@columbus.rr.com>
7  *		Jérôme Duval, jerome.duval@free.fr
8  */
9 
10 #ifndef _APPSERVER_PROTOCOL_
11 #define _APPSERVER_PROTOCOL_
12 
13 
14 #include <SupportDefs.h>
15 
16 
17 // Server port names. The input port is the port which is used to receive
18 // input messages from the Input Server. The other is the "main" port for
19 // the server and is utilized mostly by BApplication objects.
20 #define SERVER_PORT_NAME "OBappserver"
21 #define SERVER_INPUT_PORT "OBinputport"
22 
23 enum {
24 	// Used for quick replies from the app_server
25 	SERVER_TRUE = B_OK,
26 	SERVER_FALSE = B_ERROR,
27 
28 	AS_REGISTER_INPUT_SERVER = 1,
29 	AS_ACQUIRED_INPUT_STREAM,
30 	AS_GET_DESKTOP,
31 
32 	// Desktop definitions
33 	AS_GET_WINDOW_LIST,
34 	AS_GET_WINDOW_INFO,
35 
36 	// Application definitions
37 	AS_CREATE_APP,
38 	AS_DELETE_APP,
39 	AS_QUIT_APP,
40 	AS_ACTIVATE_APP,
41 
42 	AS_SET_SERVER_PORT,
43 
44 	AS_CREATE_WINDOW,
45 	AS_CREATE_OFFSCREEN_WINDOW,
46 	AS_DELETE_WINDOW,
47 	AS_CREATE_BITMAP,
48 	AS_DELETE_BITMAP,
49 
50 	AS_ACQUIRE_SERVERMEM,
51 	AS_RELEASE_SERVERMEM,
52 	AS_AREA_MESSAGE,
53 
54 	// Cursor definitions
55 	AS_SET_CURSOR_DATA,
56 	AS_SET_CURSOR_BCURSOR,
57 	AS_SET_CURSOR_BBITMAP,
58 	AS_SET_CURSOR_SYSTEM,
59 
60 	AS_SET_SYSCURSOR_DATA,
61 	AS_SET_SYSCURSOR_BCURSOR,
62 	AS_SET_SYSCURSOR_BBITMAP,
63 	AS_SET_SYSCURSOR_DEFAULTS,
64 	AS_GET_SYSCURSOR,
65 
66 	AS_SHOW_CURSOR,
67 	AS_HIDE_CURSOR,
68 	AS_OBSCURE_CURSOR,
69 	AS_QUERY_CURSOR_HIDDEN,
70 
71 	AS_CREATE_BCURSOR,
72 	AS_DELETE_BCURSOR,
73 
74 	AS_BEGIN_RECT_TRACKING,
75 	AS_END_RECT_TRACKING,
76 
77 	// Window definitions
78 	AS_SHOW_WINDOW,
79 	AS_HIDE_WINDOW,
80 	AS_QUIT_WINDOW,
81 	AS_SEND_BEHIND,
82 	AS_SET_LOOK,
83 	AS_SET_FEEL,
84 	AS_SET_FLAGS,
85 	AS_DISABLE_UPDATES,
86 	AS_ENABLE_UPDATES,
87 	AS_BEGIN_UPDATE,
88 	AS_END_UPDATE,
89 	AS_NEEDS_UPDATE,
90 	AS_SET_WINDOW_TITLE,
91 	AS_ADD_TO_SUBSET,
92 	AS_REM_FROM_SUBSET,
93 	AS_SET_ALIGNMENT,
94 	AS_GET_ALIGNMENT,
95 	AS_GET_WORKSPACES,
96 	AS_SET_WORKSPACES,
97 	AS_WINDOW_RESIZE,
98 	AS_WINDOW_MOVE,
99 	AS_SET_SIZE_LIMITS,
100 	AS_ACTIVATE_WINDOW,
101 	AS_WINDOW_MINIMIZE,
102 	AS_UPDATE_IF_NEEDED,
103 	_ALL_UPDATED_,	// this should be moved in place of _UPDATE_IF_NEEDED_ in AppDefs.h
104 
105 	// BPicture definitions
106 	AS_CREATE_PICTURE,
107 	AS_DELETE_PICTURE,
108 	AS_CLONE_PICTURE,
109 	AS_DOWNLOAD_PICTURE,
110 
111 	// Font-related server communications
112 	AS_SET_SYSTEM_FONT,
113 	AS_GET_SYSTEM_FONTS,
114 	AS_GET_SYSTEM_DEFAULT_FONT,
115 
116 	AS_GET_FONT_LIST_REVISION,
117 	AS_GET_FAMILY_AND_STYLES,
118 
119 	AS_GET_FAMILY_AND_STYLE,
120 	AS_GET_FAMILY_AND_STYLE_IDS,
121 	AS_GET_FONT_BOUNDING_BOX,
122 	AS_GET_TUNED_COUNT,
123 	AS_GET_TUNED_INFO,
124 	AS_GET_FONT_HEIGHT,
125 	AS_GET_FONT_FILE_FORMAT,
126 	AS_GET_EXTRA_FONT_FLAGS,
127 
128 	AS_GET_STRING_WIDTHS,
129 	AS_GET_EDGES,
130 	AS_GET_ESCAPEMENTS,
131 	AS_GET_ESCAPEMENTS_AS_FLOATS,
132 	AS_GET_BOUNDINGBOXES_CHARS,
133 	AS_GET_BOUNDINGBOXES_STRINGS,
134 	AS_GET_HAS_GLYPHS,
135 	AS_GET_GLYPH_SHAPES,
136 	AS_GET_TRUNCATED_STRINGS,
137 
138 	// Screen methods
139 	AS_VALID_SCREEN_ID,
140 	AS_GET_NEXT_SCREEN_ID,
141 	AS_SCREEN_GET_MODE,
142 	AS_SCREEN_SET_MODE,
143 	AS_PROPOSE_MODE,
144 	AS_GET_MODE_LIST,
145 
146 	AS_GET_PIXEL_CLOCK_LIMITS,
147 	AS_GET_TIMING_CONSTRAINTS,
148 
149 	AS_SCREEN_GET_COLORMAP,
150 	AS_GET_DESKTOP_COLOR,
151 	AS_SET_DESKTOP_COLOR,
152 	AS_GET_SCREEN_ID_FROM_WINDOW,
153 
154 	AS_READ_BITMAP,
155 
156 	AS_GET_RETRACE_SEMAPHORE,
157 	AS_GET_ACCELERANT_INFO,
158 	AS_GET_FRAME_BUFFER_CONFIG,
159 
160 	AS_SET_DPMS,
161 	AS_GET_DPMS_STATE,
162 	AS_GET_DPMS_CAPABILITIES,
163 
164 	// Global function call defs
165 	AS_SET_UI_COLORS,
166 	AS_GET_UI_COLORS,
167 	AS_GET_UI_COLOR,
168 	AS_SET_DECORATOR,
169 	AS_GET_DECORATOR,
170 	AS_R5_SET_DECORATOR,
171 	AS_COUNT_DECORATORS,
172 	AS_GET_DECORATOR_NAME,
173 
174 	AS_COUNT_WORKSPACES,
175 	AS_SET_WORKSPACE_COUNT,
176 	AS_CURRENT_WORKSPACE,
177 	AS_ACTIVATE_WORKSPACE,
178 	AS_GET_SCROLLBAR_INFO,
179 	AS_SET_SCROLLBAR_INFO,
180 	AS_GET_MENU_INFO,
181 	AS_SET_MENU_INFO,
182 	AS_IDLE_TIME,
183 	AS_SELECT_PRINTER_PANEL,
184 	AS_ADD_PRINTER_PANEL,
185 	AS_RUN_BE_ABOUT,
186 	AS_SET_MOUSE_MODE,
187 	AS_GET_MOUSE_MODE,
188 
189 	// Hook function messages
190 	AS_WORKSPACE_ACTIVATED,
191 	AS_WORKSPACES_CHANGED,
192 	AS_WINDOW_ACTIVATED,
193 	AS_SCREENMODE_CHANGED,
194 
195 	// Graphics calls
196 	AS_BEGIN_TRANSACTION,
197 	AS_END_TRANSACTION,
198 	AS_SET_HIGH_COLOR,
199 	AS_SET_LOW_COLOR,
200 	AS_SET_VIEW_COLOR,
201 
202 	AS_STROKE_ARC,
203 	AS_STROKE_BEZIER,
204 	AS_STROKE_ELLIPSE,
205 	AS_STROKE_LINE,
206 	AS_STROKE_LINEARRAY,
207 	AS_STROKE_POLYGON,
208 	AS_STROKE_RECT,
209 	AS_STROKE_ROUNDRECT,
210 	AS_STROKE_SHAPE,
211 	AS_STROKE_TRIANGLE,
212 
213 	AS_FILL_ARC,
214 	AS_FILL_BEZIER,
215 	AS_FILL_ELLIPSE,
216 	AS_FILL_POLYGON,
217 	AS_FILL_RECT,
218 	AS_FILL_REGION,
219 	AS_FILL_ROUNDRECT,
220 	AS_FILL_SHAPE,
221 	AS_FILL_TRIANGLE,
222 
223 	AS_MOVEPENBY,
224 	AS_MOVEPENTO,
225 	AS_SETPENSIZE,
226 	AS_DRAW_STRING,
227 	AS_SET_FONT,
228 	AS_SET_FONT_SIZE,
229 
230 	AS_FLUSH,
231 	AS_SYNC,
232 
233 	AS_LAYER_CREATE,
234 	AS_LAYER_DELETE,
235 	AS_LAYER_CREATE_ROOT,
236 	AS_LAYER_DELETE_ROOT,
237 	AS_LAYER_ADD_CHILD,
238 	AS_LAYER_REMOVE_CHILD,
239 	AS_LAYER_REMOVE_SELF,
240 	AS_LAYER_SHOW,
241 	AS_LAYER_HIDE,
242 	AS_LAYER_MOVE,
243 	AS_LAYER_RESIZE,
244 	AS_LAYER_INVALIDATE,
245 	AS_LAYER_DRAW,
246 
247 	AS_LAYER_GET_TOKEN,
248 	AS_LAYER_ADD,
249 	AS_LAYER_REMOVE,
250 
251 	// View/Layer definitions
252 	AS_LAYER_GET_COORD,
253 	AS_LAYER_SET_FLAGS,
254 	AS_LAYER_SET_ORIGIN,
255 	AS_LAYER_GET_ORIGIN,
256 	AS_LAYER_RESIZE_MODE,
257 	AS_LAYER_CURSOR,
258 	AS_LAYER_BEGIN_RECT_TRACK,
259 	AS_LAYER_END_RECT_TRACK,
260 	AS_LAYER_DRAG_RECT,
261 	AS_LAYER_DRAG_IMAGE,
262 	AS_LAYER_GET_MOUSE_COORDS,
263 	AS_LAYER_SCROLL,
264 	AS_LAYER_SET_LINE_MODE,
265 	AS_LAYER_GET_LINE_MODE,
266 	AS_LAYER_PUSH_STATE,
267 	AS_LAYER_POP_STATE,
268 	AS_LAYER_SET_SCALE,
269 	AS_LAYER_GET_SCALE,
270 	AS_LAYER_SET_DRAW_MODE,
271 	AS_LAYER_GET_DRAW_MODE,
272 	AS_LAYER_SET_BLEND_MODE,
273 	AS_LAYER_GET_BLEND_MODE,
274 	AS_LAYER_SET_PEN_LOC,
275 	AS_LAYER_GET_PEN_LOC,
276 	AS_LAYER_SET_PEN_SIZE,
277 	AS_LAYER_GET_PEN_SIZE,
278 	AS_LAYER_SET_HIGH_COLOR,
279 	AS_LAYER_SET_LOW_COLOR,
280 	AS_LAYER_SET_VIEW_COLOR,
281 	AS_LAYER_GET_HIGH_COLOR,
282 	AS_LAYER_GET_LOW_COLOR,
283 	AS_LAYER_GET_VIEW_COLOR,
284 	AS_LAYER_PRINT_ALIASING,
285 	AS_LAYER_CLIP_TO_PICTURE,
286 	AS_LAYER_GET_CLIP_REGION,
287 	AS_LAYER_DRAW_BITMAP_ASYNC_IN_RECT,
288 	AS_LAYER_DRAW_BITMAP_ASYNC_AT_POINT,
289 	AS_LAYER_DRAW_BITMAP_SYNC_IN_RECT,
290 	AS_LAYER_DRAW_BITMAP_SYNC_AT_POINT,
291 	AS_LAYER_SET_EVENT_MASK,
292 	AS_LAYER_SET_MOUSE_EVENT_MASK,
293 
294 	AS_LAYER_DRAW_STRING,
295 	AS_LAYER_SET_CLIP_REGION,
296 	AS_LAYER_LINE_ARRAY,
297 	AS_LAYER_BEGIN_PICTURE,
298 	AS_LAYER_APPEND_TO_PICTURE,
299 	AS_LAYER_END_PICTURE,
300 	AS_LAYER_COPY_BITS,
301 	AS_LAYER_DRAW_PICTURE,
302 	AS_LAYER_INVAL_RECT,
303 	AS_LAYER_INVAL_REGION,
304 	AS_LAYER_INVERT_RECT,
305 	AS_LAYER_MOVE_TO,
306 	AS_LAYER_RESIZE_TO,
307 	AS_LAYER_SET_STATE,
308 	AS_LAYER_SET_FONT_STATE,
309 	AS_LAYER_GET_STATE,
310 	AS_LAYER_SET_VIEW_IMAGE,
311 	AS_LAYER_SET_PATTERN,
312 	AS_SET_CURRENT_LAYER,
313 
314 	// BDirectWindow codes
315 	AS_DW_GET_SYNC_DATA,
316 	AS_DW_SUPPORTS_WINDOW_MODE,
317 	AS_DW_SET_FULLSCREEN,
318 
319 };
320 
321 #define AS_PATTERN_SIZE 8
322 #define AS_SET_COLOR_MSG_SIZE 8+4
323 #define AS_STROKE_ARC_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
324 #define AS_STROKE_BEZIER_MSG_SIZE 8+8*sizeof(float)+AS_PATTERN_SIZE
325 #define AS_STROKE_ELLIPSE_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
326 #define AS_STROKE_LINE_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
327 #define AS_STROKE_RECT_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
328 #define AS_STROKE_ROUNDRECT_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
329 #define AS_STROKE_TRIANGLE_MSG_SIZE 8+10*sizeof(float)+AS_PATTERN_SIZE
330 #define AS_FILL_ARC_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
331 #define AS_FILL_BEZIER_MSG_SIZE 8+8*sizeof(float)+AS_PATTERN_SIZE
332 #define AS_FILL_ELLIPSE_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
333 #define AS_FILL_RECT_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
334 #define AS_FILL_ROUNDRECT_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
335 #define AS_FILL_TRIANGLE_MSG_SIZE 8+10*sizeof(float)+AS_PATTERN_SIZE
336 
337 #endif
338