xref: /haiku/headers/private/app/ServerProtocol.h (revision fef6144999c2fa611f59ee6ffe6dd7999501385c)
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_SERVER_BMESSAGE = 1,
29 	AS_SERVER_AREALINK,
30 	AS_SERVER_SESSION,
31 	AS_SERVER_PORTLINK,
32 	AS_CLIENT_DEAD,
33 	AS_GET_DESKTOP,
34 
35 	// Desktop definitions
36 	AS_GET_WINDOW_LIST,
37 	AS_GET_WINDOW_INFO,
38 
39 	// Application definitions
40 	AS_CREATE_APP,
41 	AS_DELETE_APP,
42 	AS_QUIT_APP,
43 	AS_ACTIVATE_APP,
44 
45 	AS_SET_SERVER_PORT,
46 
47 	AS_CREATE_WINDOW,
48 	AS_CREATE_OFFSCREEN_WINDOW,
49 	AS_DELETE_WINDOW,
50 	AS_CREATE_BITMAP,
51 	AS_DELETE_BITMAP,
52 
53 	AS_ACQUIRE_SERVERMEM,
54 	AS_RELEASE_SERVERMEM,
55 	AS_AREA_MESSAGE,
56 
57 	// Cursor definitions
58 	AS_SET_CURSOR_DATA,
59 	AS_SET_CURSOR_BCURSOR,
60 	AS_SET_CURSOR_BBITMAP,
61 	AS_SET_CURSOR_SYSTEM,
62 
63 	AS_SET_SYSCURSOR_DATA,
64 	AS_SET_SYSCURSOR_BCURSOR,
65 	AS_SET_SYSCURSOR_BBITMAP,
66 	AS_SET_SYSCURSOR_DEFAULTS,
67 	AS_GET_SYSCURSOR,
68 
69 	AS_SHOW_CURSOR,
70 	AS_HIDE_CURSOR,
71 	AS_OBSCURE_CURSOR,
72 	AS_QUERY_CURSOR_HIDDEN,
73 
74 	AS_CREATE_BCURSOR,
75 	AS_DELETE_BCURSOR,
76 
77 	AS_BEGIN_RECT_TRACKING,
78 	AS_END_RECT_TRACKING,
79 
80 	// Window definitions
81 	AS_SHOW_WINDOW,
82 	AS_HIDE_WINDOW,
83 	AS_QUIT_WINDOW,
84 	AS_SEND_BEHIND,
85 	AS_SET_LOOK,
86 	AS_SET_FEEL,
87 	AS_SET_FLAGS,
88 	AS_DISABLE_UPDATES,
89 	AS_ENABLE_UPDATES,
90 	AS_BEGIN_UPDATE,
91 	AS_END_UPDATE,
92 	AS_NEEDS_UPDATE,
93 	AS_SET_WINDOW_TITLE,
94 	AS_ADD_TO_SUBSET,
95 	AS_REM_FROM_SUBSET,
96 	AS_SET_ALIGNMENT,
97 	AS_GET_ALIGNMENT,
98 	AS_GET_WORKSPACES,
99 	AS_SET_WORKSPACES,
100 	AS_WINDOW_RESIZE,
101 	AS_WINDOW_MOVE,
102 	AS_SET_SIZE_LIMITS,
103 	AS_ACTIVATE_WINDOW,
104 	AS_WINDOW_MINIMIZE,
105 	AS_UPDATE_IF_NEEDED,
106 	_ALL_UPDATED_,	// this should be moved in place of _UPDATE_IF_NEEDED_ in AppDefs.h
107 
108 	// BPicture definitions
109 	AS_CREATE_PICTURE,
110 	AS_DELETE_PICTURE,
111 	AS_CLONE_PICTURE,
112 	AS_DOWNLOAD_PICTURE,
113 
114 	// Font-related server communications
115 	AS_SET_SYSTEM_FONT,
116 	AS_QUERY_FONTS_CHANGED,
117 	AS_UPDATED_CLIENT_FONTLIST,
118 	AS_GET_FAMILY_NAME,
119 	AS_GET_STYLE_NAME,
120 	AS_GET_FAMILY_AND_STYLE,
121 	AS_GET_FONT_DIRECTION,
122 	AS_GET_FONT_BOUNDING_BOX,
123 	AS_GET_TUNED_COUNT,
124 	AS_GET_TUNED_INFO,
125 	AS_GET_FONT_HEIGHT,
126 
127 	AS_QUERY_FONT_FIXED,
128 	AS_SET_FAMILY_NAME,
129 	AS_SET_FAMILY_AND_STYLE,
130 	AS_SET_FAMILY_AND_STYLE_FROM_ID,
131 	AS_SET_FAMILY_AND_FACE,
132 
133 	AS_COUNT_FONT_FAMILIES,
134 	AS_COUNT_FONT_STYLES,
135 
136 	AS_GET_STRING_WIDTHS,
137 	AS_GET_EDGES,
138 	AS_GET_ESCAPEMENTS,
139 	AS_GET_ESCAPEMENTS_AS_FLOATS,
140 	AS_GET_BOUNDINGBOXES_CHARS,
141 	AS_GET_BOUNDINGBOXES_STRINGS,
142 	AS_GET_HAS_GLYPHS,
143 	AS_GET_GLYPH_SHAPES,
144 	AS_GET_TRUNCATED_STRINGS,
145 
146 	AS_SET_SYSFONT_PLAIN,
147 	AS_SET_SYSFONT_BOLD,
148 	AS_SET_SYSFONT_FIXED,
149 
150 	// Screen methods
151 	AS_SCREEN_GET_MODE,
152 	AS_SCREEN_SET_MODE,
153 	AS_PROPOSE_MODE,
154 	AS_GET_MODE_LIST,
155 
156 	AS_GET_PIXEL_CLOCK_LIMITS,
157 	AS_GET_TIMING_CONSTRAINTS,
158 
159 	AS_SCREEN_GET_COLORMAP,
160 	AS_GET_DESKTOP_COLOR,
161 	AS_SET_DESKTOP_COLOR,
162 
163 	AS_READ_BITMAP,
164 
165 	AS_GET_RETRACE_SEMAPHORE,
166 	AS_GET_ACCELERANT_INFO,
167 
168 	AS_SET_DPMS,
169 	AS_GET_DPMS_STATE,
170 	AS_GET_DPMS_CAPABILITIES,
171 
172 	// Global function call defs
173 	AS_SET_UI_COLORS,
174 	AS_GET_UI_COLORS,
175 	AS_GET_UI_COLOR,
176 	AS_SET_DECORATOR,
177 	AS_GET_DECORATOR,
178 	AS_R5_SET_DECORATOR,
179 	AS_COUNT_DECORATORS,
180 	AS_GET_DECORATOR_NAME,
181 
182 	AS_COUNT_WORKSPACES,
183 	AS_SET_WORKSPACE_COUNT,
184 	AS_CURRENT_WORKSPACE,
185 	AS_ACTIVATE_WORKSPACE,
186 	AS_GET_SCROLLBAR_INFO,
187 	AS_SET_SCROLLBAR_INFO,
188 	AS_GET_MENU_INFO,
189 	AS_SET_MENU_INFO,
190 	AS_IDLE_TIME,
191 	AS_SELECT_PRINTER_PANEL,
192 	AS_ADD_PRINTER_PANEL,
193 	AS_RUN_BE_ABOUT,
194 	AS_SET_MOUSE_MODE,
195 	AS_GET_MOUSE_MODE,
196 
197 	// Hook function messages
198 	AS_WORKSPACE_ACTIVATED,
199 	AS_WORKSPACES_CHANGED,
200 	AS_WINDOW_ACTIVATED,
201 	AS_SCREENMODE_CHANGED,
202 
203 	// Graphics calls
204 	// Are these TRANSACTION codes needed ?
205 	AS_BEGIN_TRANSACTION,
206 	AS_END_TRANSACTION,
207 	AS_SET_HIGH_COLOR,
208 	AS_SET_LOW_COLOR,
209 	AS_SET_VIEW_COLOR,
210 
211 	AS_STROKE_ARC,
212 	AS_STROKE_BEZIER,
213 	AS_STROKE_ELLIPSE,
214 	AS_STROKE_LINE,
215 	AS_STROKE_LINEARRAY,
216 	AS_STROKE_POLYGON,
217 	AS_STROKE_RECT,
218 	AS_STROKE_ROUNDRECT,
219 	AS_STROKE_SHAPE,
220 	AS_STROKE_TRIANGLE,
221 
222 	AS_FILL_ARC,
223 	AS_FILL_BEZIER,
224 	AS_FILL_ELLIPSE,
225 	AS_FILL_POLYGON,
226 	AS_FILL_RECT,
227 	AS_FILL_REGION,
228 	AS_FILL_ROUNDRECT,
229 	AS_FILL_SHAPE,
230 	AS_FILL_TRIANGLE,
231 
232 	AS_MOVEPENBY,
233 	AS_MOVEPENTO,
234 	AS_SETPENSIZE,
235 	AS_DRAW_STRING,
236 	AS_SET_FONT,
237 	AS_SET_FONT_SIZE,
238 
239 	AS_FLUSH,
240 	AS_SYNC,
241 
242 	AS_LAYER_CREATE,
243 	AS_LAYER_DELETE,
244 	AS_LAYER_CREATE_ROOT,
245 	AS_LAYER_DELETE_ROOT,
246 	AS_LAYER_ADD_CHILD,
247 	AS_LAYER_REMOVE_CHILD,
248 	AS_LAYER_REMOVE_SELF,
249 	AS_LAYER_SHOW,
250 	AS_LAYER_HIDE,
251 	AS_LAYER_MOVE,
252 	AS_LAYER_RESIZE,
253 	AS_LAYER_INVALIDATE,
254 	AS_LAYER_DRAW,
255 
256 	AS_LAYER_GET_TOKEN,
257 	AS_LAYER_ADD,
258 	AS_LAYER_REMOVE,
259 
260 	// View/Layer definitions
261 	AS_LAYER_GET_COORD,
262 	AS_LAYER_SET_FLAGS,
263 	AS_LAYER_SET_ORIGIN,
264 	AS_LAYER_GET_ORIGIN,
265 	AS_LAYER_RESIZE_MODE,
266 	AS_LAYER_CURSOR,
267 	AS_LAYER_BEGIN_RECT_TRACK,
268 	AS_LAYER_END_RECT_TRACK,
269 	AS_LAYER_DRAG_RECT,
270 	AS_LAYER_DRAG_IMAGE,
271 	AS_LAYER_GET_MOUSE_COORDS,
272 	AS_LAYER_SCROLL,
273 	AS_LAYER_SET_LINE_MODE,
274 	AS_LAYER_GET_LINE_MODE,
275 	AS_LAYER_PUSH_STATE,
276 	AS_LAYER_POP_STATE,
277 	AS_LAYER_SET_SCALE,
278 	AS_LAYER_GET_SCALE,
279 	AS_LAYER_SET_DRAW_MODE,
280 	AS_LAYER_GET_DRAW_MODE,
281 	AS_LAYER_SET_BLEND_MODE,
282 	AS_LAYER_GET_BLEND_MODE,
283 	AS_LAYER_SET_PEN_LOC,
284 	AS_LAYER_GET_PEN_LOC,
285 	AS_LAYER_SET_PEN_SIZE,
286 	AS_LAYER_GET_PEN_SIZE,
287 	AS_LAYER_SET_HIGH_COLOR,
288 	AS_LAYER_SET_LOW_COLOR,
289 	AS_LAYER_SET_VIEW_COLOR,
290 	AS_LAYER_GET_HIGH_COLOR,
291 	AS_LAYER_GET_LOW_COLOR,
292 	AS_LAYER_GET_VIEW_COLOR,
293 	AS_LAYER_PRINT_ALIASING,
294 	AS_LAYER_CLIP_TO_PICTURE,
295 	AS_LAYER_GET_CLIP_REGION,
296 	AS_LAYER_DRAW_BITMAP_ASYNC_IN_RECT,
297 	AS_LAYER_DRAW_BITMAP_ASYNC_AT_POINT,
298 	AS_LAYER_DRAW_BITMAP_SYNC_IN_RECT,
299 	AS_LAYER_DRAW_BITMAP_SYNC_AT_POINT,
300 	AS_LAYER_SET_EVENT_MASK,
301 	AS_LAYER_SET_MOUSE_EVENT_MASK,
302 
303 	AS_LAYER_DRAW_STRING,
304 	AS_LAYER_SET_CLIP_REGION,
305 	AS_LAYER_LINE_ARRAY,
306 	AS_LAYER_BEGIN_PICTURE,
307 	AS_LAYER_APPEND_TO_PICTURE,
308 	AS_LAYER_END_PICTURE,
309 	AS_LAYER_COPY_BITS,
310 	AS_LAYER_DRAW_PICTURE,
311 	AS_LAYER_INVAL_RECT,
312 	AS_LAYER_INVAL_REGION,
313 	AS_LAYER_INVERT_RECT,
314 	AS_LAYER_MOVE_TO,
315 	AS_LAYER_RESIZE_TO,
316 	AS_LAYER_SET_STATE,
317 	AS_LAYER_SET_FONT_STATE,
318 	AS_LAYER_GET_STATE,
319 	AS_LAYER_SET_VIEW_IMAGE,
320 	AS_LAYER_SET_PATTERN,
321 	AS_SET_CURRENT_LAYER,
322 
323 	// BDirectWindow codes
324 	AS_DW_GET_SYNC_DATA,
325 	AS_DW_SUPPORTS_WINDOW_MODE,
326 	AS_DW_SET_FULLSCREEN,
327 
328 	// TODO: Move these elsewhere. They don't need to
329 	// be shared with libbe
330 	// app_server internal communication
331 	AS_ROOTLAYER_SHOW_WINBORDER,
332 	AS_ROOTLAYER_HIDE_WINBORDER,
333 	AS_ROOTLAYER_DO_INVALIDATE,
334 	AS_ROOTLAYER_DO_REDRAW,
335 	AS_ROOTLAYER_LAYER_MOVE,
336 	AS_ROOTLAYER_LAYER_RESIZE,
337 	AS_ROOTLAYER_LAYER_SCROLL,
338 	AS_ROOTLAYER_LAYER_COPYBITS,
339 	AS_ROOTLAYER_ADD_TO_SUBSET,
340 	AS_ROOTLAYER_REMOVE_FROM_SUBSET,
341 	AS_ROOTLAYER_WINBORDER_SET_WORKSPACES,
342 	AS_ROOTLAYER_DO_CHANGE_WINBORDER_FEEL
343 };
344 
345 #define AS_PATTERN_SIZE 8
346 #define AS_SET_COLOR_MSG_SIZE 8+4
347 #define AS_STROKE_ARC_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
348 #define AS_STROKE_BEZIER_MSG_SIZE 8+8*sizeof(float)+AS_PATTERN_SIZE
349 #define AS_STROKE_ELLIPSE_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
350 #define AS_STROKE_LINE_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
351 #define AS_STROKE_RECT_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
352 #define AS_STROKE_ROUNDRECT_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
353 #define AS_STROKE_TRIANGLE_MSG_SIZE 8+10*sizeof(float)+AS_PATTERN_SIZE
354 #define AS_FILL_ARC_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
355 #define AS_FILL_BEZIER_MSG_SIZE 8+8*sizeof(float)+AS_PATTERN_SIZE
356 #define AS_FILL_ELLIPSE_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
357 #define AS_FILL_RECT_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
358 #define AS_FILL_ROUNDRECT_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
359 #define AS_FILL_TRIANGLE_MSG_SIZE 8+10*sizeof(float)+AS_PATTERN_SIZE
360 
361 #endif
362