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