xref: /haiku/headers/private/app/ServerProtocol.h (revision 52c4471a3024d2eb81fe88e2c3982b9f8daa5e56)
1 /*
2  * Copyright 2001-2016, 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  *		Axel Dörfler, axeld@pinc-software.de
9  *		Andrej Spielmann, <andrej.spielmann@seh.ox.ac.uk>
10  *		Julian Harnath, <julian.harnath@rwth-aachen.de>
11  */
12 #ifndef APP_SERVER_PROTOCOL_H
13 #define APP_SERVER_PROTOCOL_H
14 
15 
16 #include <SupportDefs.h>
17 
18 
19 #ifdef HAIKU_TARGET_PLATFORM_LIBBE_TEST
20 #	define SERVER_PORT_NAME "haiku-test:app_server"
21 #endif
22 
23 #if TEST_MODE
24 #	define SERVER_INPUT_PORT "haiku-test:input port"
25 #endif
26 
27 #define AS_PROTOCOL_VERSION	1
28 
29 #define AS_REQUEST_COLOR_KEY 0x00010000
30 	// additional option for AS_VIEW_SET_VIEW_BITMAP
31 
32 enum {
33 	// NOTE: all defines have to start with "AS_" to let the "code_to_name"
34 	// utility work correctly
35 
36 	AS_GET_DESKTOP,
37 	AS_REGISTER_INPUT_SERVER = 1,
38 	AS_EVENT_STREAM_CLOSED,
39 		// Notification of event stream closing to restart input_server
40 
41 	// Desktop definitions (through the ServerApp, though)
42 	AS_GET_WINDOW_LIST,
43 	AS_GET_WINDOW_INFO,
44 	AS_MINIMIZE_TEAM,
45 	AS_BRING_TEAM_TO_FRONT,
46 	AS_WINDOW_ACTION,
47 	AS_GET_APPLICATION_ORDER,
48 	AS_GET_WINDOW_ORDER,
49 
50 	// Application definitions
51 	AS_CREATE_APP,
52 	AS_DELETE_APP,
53 	AS_QUIT_APP,
54 	AS_ACTIVATE_APP,
55 	AS_APP_CRASHED,
56 
57 	AS_CREATE_WINDOW,
58 	AS_CREATE_OFFSCREEN_WINDOW,
59 	AS_DELETE_WINDOW,
60 	AS_CREATE_BITMAP,
61 	AS_DELETE_BITMAP,
62 	AS_GET_BITMAP_OVERLAY_RESTRICTIONS,
63 	AS_GET_BITMAP_SUPPORT_FLAGS,
64 	AS_RECONNECT_BITMAP,
65 
66 	// Cursor commands
67 	AS_SET_CURSOR,
68 	AS_SET_VIEW_CURSOR,
69 
70 	AS_SHOW_CURSOR,
71 	AS_HIDE_CURSOR,
72 	AS_OBSCURE_CURSOR,
73 	AS_QUERY_CURSOR_HIDDEN,
74 
75 	AS_CREATE_CURSOR,
76 	AS_CREATE_CURSOR_BITMAP,
77 	AS_REFERENCE_CURSOR,
78 	AS_DELETE_CURSOR,
79 
80 	AS_BEGIN_RECT_TRACKING,
81 	AS_END_RECT_TRACKING,
82 
83 	AS_GET_CURSOR_POSITION,
84 	AS_GET_CURSOR_BITMAP,
85 
86 	// Window definitions
87 	AS_SHOW_OR_HIDE_WINDOW,
88 	AS_INTERNAL_HIDE_WINDOW,
89 	AS_MINIMIZE_WINDOW,
90 	AS_QUIT_WINDOW,
91 	AS_SEND_BEHIND,
92 	AS_SET_LOOK,
93 	AS_SET_FEEL,
94 	AS_SET_FLAGS,
95 	AS_DISABLE_UPDATES,
96 	AS_ENABLE_UPDATES,
97 	AS_BEGIN_UPDATE,
98 	AS_END_UPDATE,
99 	AS_NEEDS_UPDATE,
100 	AS_SET_WINDOW_TITLE,
101 	AS_ADD_TO_SUBSET,
102 	AS_REMOVE_FROM_SUBSET,
103 	AS_SET_ALIGNMENT,
104 	AS_GET_ALIGNMENT,
105 	AS_GET_WORKSPACES,
106 	AS_SET_WORKSPACES,
107 	AS_WINDOW_RESIZE,
108 	AS_WINDOW_MOVE,
109 	AS_SET_SIZE_LIMITS,
110 	AS_ACTIVATE_WINDOW,
111 	AS_IS_FRONT_WINDOW,
112 
113 	// BPicture definitions
114 	AS_CREATE_PICTURE,
115 	AS_DELETE_PICTURE,
116 	AS_CLONE_PICTURE,
117 	AS_DOWNLOAD_PICTURE,
118 
119 	// Font-related server communications
120 	AS_SET_SYSTEM_FONT,
121 	AS_GET_SYSTEM_FONTS,
122 	AS_GET_SYSTEM_DEFAULT_FONT,
123 	AS_SYSTEM_FONT_CHANGED,
124 
125 	AS_GET_FONT_LIST_REVISION,
126 	AS_GET_FAMILY_AND_STYLES,
127 
128 	AS_GET_FAMILY_AND_STYLE,
129 	AS_GET_FAMILY_AND_STYLE_IDS,
130 	AS_GET_FONT_BOUNDING_BOX,
131 	AS_GET_TUNED_COUNT,
132 	AS_GET_TUNED_INFO,
133 	AS_GET_FONT_HEIGHT,
134 	AS_GET_FONT_FILE_FORMAT,
135 	AS_GET_EXTRA_FONT_FLAGS,
136 
137 	AS_GET_STRING_WIDTHS,
138 	AS_GET_EDGES,
139 	AS_GET_ESCAPEMENTS,
140 	AS_GET_ESCAPEMENTS_AS_FLOATS,
141 	AS_GET_BOUNDINGBOXES_CHARS,
142 	AS_GET_BOUNDINGBOXES_STRING,
143 	AS_GET_BOUNDINGBOXES_STRINGS,
144 	AS_GET_HAS_GLYPHS,
145 	AS_GET_GLYPH_SHAPES,
146 	AS_GET_TRUNCATED_STRINGS,
147 	AS_GET_UNICODE_BLOCKS,
148 	AS_GET_HAS_UNICODE_BLOCK,
149 	AS_ADD_FONT_FILE,
150 	AS_ADD_FONT_MEMORY,
151 	AS_REMOVE_FONT,
152 
153 	// Screen methods
154 	AS_VALID_SCREEN_ID,
155 	AS_GET_NEXT_SCREEN_ID,
156 	AS_SCREEN_GET_MODE,
157 	AS_SCREEN_SET_MODE,
158 	AS_PROPOSE_MODE,
159 	AS_GET_MODE_LIST,
160 	AS_GET_SCREEN_FRAME,
161 
162 	AS_GET_PIXEL_CLOCK_LIMITS,
163 	AS_GET_TIMING_CONSTRAINTS,
164 
165 	AS_SCREEN_GET_COLORMAP,
166 	AS_GET_DESKTOP_COLOR,
167 	AS_SET_DESKTOP_COLOR,
168 	AS_GET_SCREEN_ID_FROM_WINDOW,
169 
170 	AS_READ_BITMAP,
171 
172 	AS_GET_RETRACE_SEMAPHORE,
173 	AS_GET_ACCELERANT_INFO,
174 	AS_GET_MONITOR_INFO,
175 	AS_GET_FRAME_BUFFER_CONFIG,
176 
177 	AS_SET_DPMS,
178 	AS_GET_DPMS_STATE,
179 	AS_GET_DPMS_CAPABILITIES,
180 
181 	AS_SCREEN_SET_BRIGHTNESS,
182 	AS_SCREEN_GET_BRIGHTNESS,
183 
184 	// Misc stuff
185 	AS_GET_ACCELERANT_PATH,
186 	AS_GET_DRIVER_PATH,
187 
188 	// Global function call defs
189 	AS_SET_UI_COLORS,
190 	AS_SET_UI_COLOR,
191 	AS_SET_DECORATOR,
192 	AS_GET_DECORATOR,
193 	AS_R5_SET_DECORATOR,
194 	AS_COUNT_DECORATORS,
195 	AS_GET_DECORATOR_NAME,
196 	AS_SET_CONTROL_LOOK,
197 	AS_GET_CONTROL_LOOK,
198 
199 	AS_COUNT_WORKSPACES,
200 	AS_CURRENT_WORKSPACE,
201 	AS_ACTIVATE_WORKSPACE,
202 	AS_SET_WORKSPACE_LAYOUT,
203 	AS_GET_WORKSPACE_LAYOUT,
204 	AS_GET_SCROLLBAR_INFO,
205 	AS_SET_SCROLLBAR_INFO,
206 	AS_GET_MENU_INFO,
207 	AS_SET_MENU_INFO,
208 	AS_IDLE_TIME,
209 	AS_SET_MOUSE_MODE,
210 	AS_GET_MOUSE_MODE,
211 	AS_SET_FOCUS_FOLLOWS_MOUSE_MODE,
212 	AS_GET_FOCUS_FOLLOWS_MOUSE_MODE,
213 	AS_SET_ACCEPT_FIRST_CLICK,
214 	AS_GET_ACCEPT_FIRST_CLICK,
215 	AS_GET_MOUSE,
216 	AS_SET_DECORATOR_SETTINGS,
217 	AS_GET_DECORATOR_SETTINGS,
218 	AS_GET_SHOW_ALL_DRAGGERS,
219 	AS_SET_SHOW_ALL_DRAGGERS,
220 
221 	// Subpixel antialiasing & hinting
222 	AS_SET_SUBPIXEL_ANTIALIASING,
223 	AS_GET_SUBPIXEL_ANTIALIASING,
224 	AS_SET_HINTING,
225 	AS_GET_HINTING,
226 	AS_SET_SUBPIXEL_AVERAGE_WEIGHT,
227 	AS_GET_SUBPIXEL_AVERAGE_WEIGHT,
228 	AS_SET_SUBPIXEL_ORDERING,
229 	AS_GET_SUBPIXEL_ORDERING,
230 
231 	// Graphics calls
232 	AS_SET_HIGH_COLOR,
233 	AS_SET_LOW_COLOR,
234 	AS_SET_VIEW_COLOR,
235 
236 	AS_STROKE_ARC,
237 	AS_STROKE_BEZIER,
238 	AS_STROKE_ELLIPSE,
239 	AS_STROKE_LINE,
240 	AS_STROKE_LINEARRAY,
241 	AS_STROKE_POLYGON,
242 	AS_STROKE_RECT,
243 	AS_STROKE_ROUNDRECT,
244 	AS_STROKE_SHAPE,
245 	AS_STROKE_TRIANGLE,
246 
247 	AS_FILL_ARC,
248 	AS_FILL_ARC_GRADIENT,
249 	AS_FILL_BEZIER,
250 	AS_FILL_BEZIER_GRADIENT,
251 	AS_FILL_ELLIPSE,
252 	AS_FILL_ELLIPSE_GRADIENT,
253 	AS_FILL_POLYGON,
254 	AS_FILL_POLYGON_GRADIENT,
255 	AS_FILL_RECT,
256 	AS_FILL_RECT_GRADIENT,
257 	AS_FILL_REGION,
258 	AS_FILL_REGION_GRADIENT,
259 	AS_FILL_ROUNDRECT,
260 	AS_FILL_ROUNDRECT_GRADIENT,
261 	AS_FILL_SHAPE,
262 	AS_FILL_SHAPE_GRADIENT,
263 	AS_FILL_TRIANGLE,
264 	AS_FILL_TRIANGLE_GRADIENT,
265 
266 	AS_DRAW_STRING,
267 	AS_DRAW_STRING_WITH_DELTA,
268 	AS_DRAW_STRING_WITH_OFFSETS,
269 
270 	AS_SYNC,
271 
272 	AS_VIEW_CREATE,
273 	AS_VIEW_DELETE,
274 	AS_VIEW_CREATE_ROOT,
275 	AS_VIEW_SHOW,
276 	AS_VIEW_HIDE,
277 	AS_VIEW_MOVE,
278 	AS_VIEW_RESIZE,
279 	AS_VIEW_DRAW,
280 
281 	// View/Layer definitions
282 	AS_VIEW_GET_COORD,
283 	AS_VIEW_SET_FLAGS,
284 	AS_VIEW_SET_ORIGIN,
285 	AS_VIEW_GET_ORIGIN,
286 	AS_VIEW_RESIZE_MODE,
287 	AS_VIEW_BEGIN_RECT_TRACK,
288 	AS_VIEW_END_RECT_TRACK,
289 	AS_VIEW_DRAG_RECT,
290 	AS_VIEW_DRAG_IMAGE,
291 	AS_VIEW_SCROLL,
292 	AS_VIEW_SET_LINE_MODE,
293 	AS_VIEW_GET_LINE_MODE,
294 	AS_VIEW_PUSH_STATE,
295 	AS_VIEW_POP_STATE,
296 	AS_VIEW_SET_SCALE,
297 	AS_VIEW_GET_SCALE,
298 	AS_VIEW_SET_DRAWING_MODE,
299 	AS_VIEW_GET_DRAWING_MODE,
300 	AS_VIEW_SET_BLENDING_MODE,
301 	AS_VIEW_GET_BLENDING_MODE,
302 	AS_VIEW_SET_PEN_LOC,
303 	AS_VIEW_GET_PEN_LOC,
304 	AS_VIEW_SET_PEN_SIZE,
305 	AS_VIEW_GET_PEN_SIZE,
306 	AS_VIEW_SET_HIGH_COLOR,
307 	AS_VIEW_SET_HIGH_UI_COLOR,
308 	AS_VIEW_SET_LOW_COLOR,
309 	AS_VIEW_SET_LOW_UI_COLOR,
310 	AS_VIEW_SET_VIEW_COLOR,
311 	AS_VIEW_SET_VIEW_UI_COLOR,
312 	AS_VIEW_GET_HIGH_COLOR,
313 	AS_VIEW_GET_HIGH_UI_COLOR,
314 	AS_VIEW_GET_LOW_COLOR,
315 	AS_VIEW_GET_LOW_UI_COLOR,
316 	AS_VIEW_GET_VIEW_COLOR,
317 	AS_VIEW_GET_VIEW_UI_COLOR,
318 
319 	AS_VIEW_PRINT_ALIASING,
320 	AS_VIEW_CLIP_TO_PICTURE,
321 	AS_VIEW_GET_CLIP_REGION,
322 	AS_VIEW_DRAW_BITMAP,
323 	AS_VIEW_SET_EVENT_MASK,
324 	AS_VIEW_SET_MOUSE_EVENT_MASK,
325 
326 	AS_VIEW_DRAW_STRING,
327 	AS_VIEW_SET_CLIP_REGION,
328 	AS_VIEW_LINE_ARRAY,
329 	AS_VIEW_BEGIN_PICTURE,
330 	AS_VIEW_APPEND_TO_PICTURE,
331 	AS_VIEW_END_PICTURE,
332 	AS_VIEW_COPY_BITS,
333 	AS_VIEW_DRAW_PICTURE,
334 	AS_VIEW_INVALIDATE_RECT,
335 	AS_VIEW_DELAYED_INVALIDATE_RECT,
336 	AS_VIEW_INVALIDATE_REGION,
337 	AS_VIEW_INVERT_RECT,
338 	AS_VIEW_MOVE_TO,
339 	AS_VIEW_RESIZE_TO,
340 	AS_VIEW_SET_STATE,
341 	AS_VIEW_SET_FONT_STATE,
342 	AS_VIEW_GET_STATE,
343 	AS_VIEW_SET_VIEW_BITMAP,
344 	AS_VIEW_SET_PATTERN,
345 	AS_SET_CURRENT_VIEW,
346 	AS_VIEW_BEGIN_LAYER,
347 	AS_VIEW_END_LAYER,
348 
349 	// BDirectWindow/BWindowScreen codes
350 	AS_DIRECT_WINDOW_GET_SYNC_DATA,
351 	AS_DIRECT_WINDOW_SET_FULLSCREEN,
352 	AS_DIRECT_SCREEN_LOCK,
353 
354 	// desktop listener communications
355 	AS_TALK_TO_DESKTOP_LISTENER,
356 
357 	// debugging helper
358 	AS_DUMP_ALLOCATOR,
359 	AS_DUMP_BITMAPS,
360 
361 	// transformation in addition to origin/scale
362 	AS_VIEW_SET_TRANSFORM,
363 	AS_VIEW_GET_TRANSFORM,
364 	AS_VIEW_GET_PARENT_COMPOSITE,
365 
366 	AS_VIEW_AFFINE_TRANSLATE,
367 	AS_VIEW_AFFINE_SCALE,
368 	AS_VIEW_AFFINE_ROTATE,
369 
370 	// Polygon filling rules
371 	AS_VIEW_SET_FILL_RULE,
372 	AS_VIEW_GET_FILL_RULE,
373 
374 	// New clipping: cumulative, transformed
375 	AS_VIEW_CLIP_TO_RECT,
376 	AS_VIEW_CLIP_TO_SHAPE,
377 
378 	// Internal messages
379 	AS_COLOR_MAP_UPDATED,
380 
381 	AS_LAST_CODE
382 };
383 
384 // TODO: move this into a private app header, together with the rest of the
385 //		private message definitions in AppDefs.h
386 enum {
387 	kMsgDeleteServerMemoryArea		= '_DSA',
388 };
389 
390 // bitmap allocation flags
391 enum {
392 	kAllocator			= 0x1,
393 	kFramebuffer		= 0x2,
394 	kHeap				= 0x4,
395 	kNewAllocatorArea	= 0x8,
396 };
397 
398 #endif	// APP_SERVER_PROTOCOL_H
399