xref: /haiku/headers/private/app/ServerProtocol.h (revision d374a27286b8a52974a97dba0d5966ea026a665d)
1 /*
2  * Copyright 2001-2010, 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 
69 	// Cursor commands
70 	AS_SET_CURSOR,
71 	AS_SET_VIEW_CURSOR,
72 
73 	AS_SHOW_CURSOR,
74 	AS_HIDE_CURSOR,
75 	AS_OBSCURE_CURSOR,
76 	AS_QUERY_CURSOR_HIDDEN,
77 
78 	AS_CREATE_CURSOR,
79 	AS_REFERENCE_CURSOR,
80 	AS_DELETE_CURSOR,
81 
82 	AS_BEGIN_RECT_TRACKING,
83 	AS_END_RECT_TRACKING,
84 
85 	AS_GET_CURSOR_POSITION,
86 	AS_GET_CURSOR_BITMAP,
87 
88 	// Window definitions
89 	AS_SHOW_WINDOW,
90 	AS_HIDE_WINDOW,
91 	AS_MINIMIZE_WINDOW,
92 	AS_QUIT_WINDOW,
93 	AS_SEND_BEHIND,
94 	AS_SET_LOOK,
95 	AS_SET_FEEL,
96 	AS_SET_FLAGS,
97 	AS_DISABLE_UPDATES,
98 	AS_ENABLE_UPDATES,
99 	AS_BEGIN_UPDATE,
100 	AS_END_UPDATE,
101 	AS_NEEDS_UPDATE,
102 	AS_SET_WINDOW_TITLE,
103 	AS_ADD_TO_SUBSET,
104 	AS_REMOVE_FROM_SUBSET,
105 	AS_SET_ALIGNMENT,
106 	AS_GET_ALIGNMENT,
107 	AS_GET_WORKSPACES,
108 	AS_SET_WORKSPACES,
109 	AS_WINDOW_RESIZE,
110 	AS_WINDOW_MOVE,
111 	AS_SET_SIZE_LIMITS,
112 	AS_ACTIVATE_WINDOW,
113 	AS_IS_FRONT_WINDOW,
114 
115 	// BPicture definitions
116 	AS_CREATE_PICTURE,
117 	AS_DELETE_PICTURE,
118 	AS_CLONE_PICTURE,
119 	AS_DOWNLOAD_PICTURE,
120 
121 	// Font-related server communications
122 	AS_SET_SYSTEM_FONT,
123 	AS_GET_SYSTEM_FONTS,
124 	AS_GET_SYSTEM_DEFAULT_FONT,
125 	AS_SYSTEM_FONT_CHANGED,
126 
127 	AS_GET_FONT_LIST_REVISION,
128 	AS_GET_FAMILY_AND_STYLES,
129 
130 	AS_GET_FAMILY_AND_STYLE,
131 	AS_GET_FAMILY_AND_STYLE_IDS,
132 	AS_GET_FONT_BOUNDING_BOX,
133 	AS_GET_TUNED_COUNT,
134 	AS_GET_TUNED_INFO,
135 	AS_GET_FONT_HEIGHT,
136 	AS_GET_FONT_FILE_FORMAT,
137 	AS_GET_EXTRA_FONT_FLAGS,
138 
139 	AS_GET_STRING_WIDTHS,
140 	AS_GET_EDGES,
141 	AS_GET_ESCAPEMENTS,
142 	AS_GET_ESCAPEMENTS_AS_FLOATS,
143 	AS_GET_BOUNDINGBOXES_CHARS,
144 	AS_GET_BOUNDINGBOXES_STRING,
145 	AS_GET_BOUNDINGBOXES_STRINGS,
146 	AS_GET_HAS_GLYPHS,
147 	AS_GET_GLYPH_SHAPES,
148 	AS_GET_TRUNCATED_STRINGS,
149 
150 	// Screen methods
151 	AS_VALID_SCREEN_ID,
152 	AS_GET_NEXT_SCREEN_ID,
153 	AS_SCREEN_GET_MODE,
154 	AS_SCREEN_SET_MODE,
155 	AS_PROPOSE_MODE,
156 	AS_GET_MODE_LIST,
157 	AS_GET_SCREEN_FRAME,
158 
159 	AS_GET_PIXEL_CLOCK_LIMITS,
160 	AS_GET_TIMING_CONSTRAINTS,
161 
162 	AS_SCREEN_GET_COLORMAP,
163 	AS_GET_DESKTOP_COLOR,
164 	AS_SET_DESKTOP_COLOR,
165 	AS_GET_SCREEN_ID_FROM_WINDOW,
166 
167 	AS_READ_BITMAP,
168 
169 	AS_GET_RETRACE_SEMAPHORE,
170 	AS_GET_ACCELERANT_INFO,
171 	AS_GET_MONITOR_INFO,
172 	AS_GET_FRAME_BUFFER_CONFIG,
173 
174 	AS_SET_DPMS,
175 	AS_GET_DPMS_STATE,
176 	AS_GET_DPMS_CAPABILITIES,
177 
178 	// Misc stuff
179 	AS_GET_ACCELERANT_PATH,
180 	AS_GET_DRIVER_PATH,
181 
182 	// Global function call defs
183 	AS_SET_UI_COLORS,
184 	AS_SET_UI_COLOR,
185 	AS_SET_DECORATOR,
186 	AS_GET_DECORATOR,
187 	AS_R5_SET_DECORATOR,
188 	AS_COUNT_DECORATORS,
189 	AS_GET_DECORATOR_NAME,
190 
191 	AS_COUNT_WORKSPACES,
192 	AS_CURRENT_WORKSPACE,
193 	AS_ACTIVATE_WORKSPACE,
194 	AS_SET_WORKSPACE_LAYOUT,
195 	AS_GET_WORKSPACE_LAYOUT,
196 	AS_GET_SCROLLBAR_INFO,
197 	AS_SET_SCROLLBAR_INFO,
198 	AS_GET_MENU_INFO,
199 	AS_SET_MENU_INFO,
200 	AS_IDLE_TIME,
201 	AS_SET_MOUSE_MODE,
202 	AS_GET_MOUSE_MODE,
203 	AS_SET_FOCUS_FOLLOWS_MOUSE_MODE,
204 	AS_GET_FOCUS_FOLLOWS_MOUSE_MODE,
205 	AS_SET_ACCEPT_FIRST_CLICK,
206 	AS_GET_ACCEPT_FIRST_CLICK,
207 	AS_GET_MOUSE,
208 	AS_SET_DECORATOR_SETTINGS,
209 	AS_GET_DECORATOR_SETTINGS,
210 	AS_GET_SHOW_ALL_DRAGGERS,
211 	AS_SET_SHOW_ALL_DRAGGERS,
212 
213 	// Subpixel antialiasing & hinting
214 	AS_SET_SUBPIXEL_ANTIALIASING,
215 	AS_GET_SUBPIXEL_ANTIALIASING,
216 	AS_SET_HINTING,
217 	AS_GET_HINTING,
218 	AS_SET_SUBPIXEL_AVERAGE_WEIGHT,
219 	AS_GET_SUBPIXEL_AVERAGE_WEIGHT,
220 	AS_SET_SUBPIXEL_ORDERING,
221 	AS_GET_SUBPIXEL_ORDERING,
222 
223 	// Graphics calls
224 	AS_SET_HIGH_COLOR,
225 	AS_SET_LOW_COLOR,
226 	AS_SET_VIEW_COLOR,
227 
228 	AS_STROKE_ARC,
229 	AS_STROKE_BEZIER,
230 	AS_STROKE_ELLIPSE,
231 	AS_STROKE_LINE,
232 	AS_STROKE_LINEARRAY,
233 	AS_STROKE_POLYGON,
234 	AS_STROKE_RECT,
235 	AS_STROKE_ROUNDRECT,
236 	AS_STROKE_SHAPE,
237 	AS_STROKE_TRIANGLE,
238 
239 	AS_FILL_ARC,
240 	AS_FILL_ARC_GRADIENT,
241 	AS_FILL_BEZIER,
242 	AS_FILL_BEZIER_GRADIENT,
243 	AS_FILL_ELLIPSE,
244 	AS_FILL_ELLIPSE_GRADIENT,
245 	AS_FILL_POLYGON,
246 	AS_FILL_POLYGON_GRADIENT,
247 	AS_FILL_RECT,
248 	AS_FILL_RECT_GRADIENT,
249 	AS_FILL_REGION,
250 	AS_FILL_REGION_GRADIENT,
251 	AS_FILL_ROUNDRECT,
252 	AS_FILL_ROUNDRECT_GRADIENT,
253 	AS_FILL_SHAPE,
254 	AS_FILL_SHAPE_GRADIENT,
255 	AS_FILL_TRIANGLE,
256 	AS_FILL_TRIANGLE_GRADIENT,
257 
258 	AS_DRAW_STRING,
259 	AS_DRAW_STRING_WITH_DELTA,
260 	AS_DRAW_STRING_WITH_OFFSETS,
261 
262 	AS_SYNC,
263 
264 	AS_VIEW_CREATE,
265 	AS_VIEW_DELETE,
266 	AS_VIEW_CREATE_ROOT,
267 	AS_VIEW_SHOW,
268 	AS_VIEW_HIDE,
269 	AS_VIEW_MOVE,
270 	AS_VIEW_RESIZE,
271 	AS_VIEW_DRAW,
272 
273 	// View/Layer definitions
274 	AS_VIEW_GET_COORD,
275 	AS_VIEW_SET_FLAGS,
276 	AS_VIEW_SET_ORIGIN,
277 	AS_VIEW_GET_ORIGIN,
278 	AS_VIEW_RESIZE_MODE,
279 	AS_VIEW_BEGIN_RECT_TRACK,
280 	AS_VIEW_END_RECT_TRACK,
281 	AS_VIEW_DRAG_RECT,
282 	AS_VIEW_DRAG_IMAGE,
283 	AS_VIEW_SCROLL,
284 	AS_VIEW_SET_LINE_MODE,
285 	AS_VIEW_GET_LINE_MODE,
286 	AS_VIEW_PUSH_STATE,
287 	AS_VIEW_POP_STATE,
288 	AS_VIEW_SET_SCALE,
289 	AS_VIEW_GET_SCALE,
290 	AS_VIEW_SET_DRAWING_MODE,
291 	AS_VIEW_GET_DRAWING_MODE,
292 	AS_VIEW_SET_BLENDING_MODE,
293 	AS_VIEW_GET_BLENDING_MODE,
294 	AS_VIEW_SET_PEN_LOC,
295 	AS_VIEW_GET_PEN_LOC,
296 	AS_VIEW_SET_PEN_SIZE,
297 	AS_VIEW_GET_PEN_SIZE,
298 	AS_VIEW_SET_HIGH_COLOR,
299 	AS_VIEW_SET_LOW_COLOR,
300 	AS_VIEW_SET_VIEW_COLOR,
301 	AS_VIEW_GET_HIGH_COLOR,
302 	AS_VIEW_GET_LOW_COLOR,
303 	AS_VIEW_GET_VIEW_COLOR,
304 	AS_VIEW_PRINT_ALIASING,
305 	AS_VIEW_CLIP_TO_PICTURE,
306 	AS_VIEW_GET_CLIP_REGION,
307 	AS_VIEW_DRAW_BITMAP,
308 	AS_VIEW_SET_EVENT_MASK,
309 	AS_VIEW_SET_MOUSE_EVENT_MASK,
310 
311 	AS_VIEW_DRAW_STRING,
312 	AS_VIEW_SET_CLIP_REGION,
313 	AS_VIEW_LINE_ARRAY,
314 	AS_VIEW_BEGIN_PICTURE,
315 	AS_VIEW_APPEND_TO_PICTURE,
316 	AS_VIEW_END_PICTURE,
317 	AS_VIEW_COPY_BITS,
318 	AS_VIEW_DRAW_PICTURE,
319 	AS_VIEW_INVALIDATE_RECT,
320 	AS_VIEW_INVALIDATE_REGION,
321 	AS_VIEW_INVERT_RECT,
322 	AS_VIEW_MOVE_TO,
323 	AS_VIEW_RESIZE_TO,
324 	AS_VIEW_SET_STATE,
325 	AS_VIEW_SET_FONT_STATE,
326 	AS_VIEW_GET_STATE,
327 	AS_VIEW_SET_VIEW_BITMAP,
328 	AS_VIEW_SET_PATTERN,
329 	AS_SET_CURRENT_VIEW,
330 
331 	// BDirectWindow/BWindowScreen codes
332 	AS_DIRECT_WINDOW_GET_SYNC_DATA,
333 	AS_DIRECT_WINDOW_SET_FULLSCREEN,
334 	AS_DIRECT_SCREEN_LOCK,
335 
336 	// desktop listener communications
337 	AS_TALK_TO_DESKTOP_LISTENER,
338 
339 	// debugging helper
340 	AS_DUMP_ALLOCATOR,
341 	AS_DUMP_BITMAPS,
342 
343 	AS_LAST_CODE
344 };
345 
346 // bitmap allocation flags
347 enum {
348 	kAllocator			= 0x1,
349 	kFramebuffer		= 0x2,
350 	kHeap				= 0x4,
351 	kNewAllocatorArea	= 0x8,
352 };
353 
354 #endif	// APP_SERVER_PROTOCOL_H
355