xref: /haiku/headers/private/app/ServerProtocol.h (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
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 _APP_SERVER_PROTOCOL_H_
11 #define _APP_SERVER_PROTOCOL_H_
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 #if TEST_MODE
22 #	define SERVER_INPUT_PORT "OBinputport"
23 #endif
24 
25 enum {
26 	// Used for quick replies from the app_server
27 	SERVER_TRUE = B_OK,
28 	SERVER_FALSE = B_ERROR,
29 
30 	// NOTE: all defines have to start with "AS_" to let the "code_to_name"
31 	// utility work correctly
32 
33 	AS_REGISTER_INPUT_SERVER = 1,
34 	AS_GET_DESKTOP,
35 
36 	// Desktop definitions
37 	AS_GET_WINDOW_LIST,
38 	AS_GET_WINDOW_INFO,
39 
40 	// Application definitions
41 	AS_CREATE_APP,
42 	AS_DELETE_APP,
43 	AS_QUIT_APP,
44 	AS_ACTIVATE_APP,
45 
46 	AS_SET_SERVER_PORT,
47 
48 	AS_CREATE_WINDOW,
49 	AS_CREATE_OFFSCREEN_WINDOW,
50 	AS_DELETE_WINDOW,
51 	AS_CREATE_BITMAP,
52 	AS_DELETE_BITMAP,
53 
54 	AS_ACQUIRE_SERVERMEM,
55 	AS_RELEASE_SERVERMEM,
56 	AS_AREA_MESSAGE,
57 
58 	// Cursor definitions
59 	AS_SET_CURSOR_DATA,
60 	AS_SET_CURSOR_BCURSOR,
61 	AS_SET_CURSOR_BBITMAP,
62 	AS_SET_CURSOR_SYSTEM,
63 
64 	AS_SET_SYSCURSOR_DATA,
65 	AS_SET_SYSCURSOR_BCURSOR,
66 	AS_SET_SYSCURSOR_BBITMAP,
67 	AS_SET_SYSCURSOR_DEFAULTS,
68 	AS_GET_SYSCURSOR,
69 
70 	AS_SHOW_CURSOR,
71 	AS_HIDE_CURSOR,
72 	AS_OBSCURE_CURSOR,
73 	AS_QUERY_CURSOR_HIDDEN,
74 
75 	AS_CREATE_BCURSOR,
76 	AS_DELETE_BCURSOR,
77 
78 	AS_BEGIN_RECT_TRACKING,
79 	AS_END_RECT_TRACKING,
80 
81 	// Window definitions
82 	AS_SHOW_WINDOW,
83 	AS_HIDE_WINDOW,
84 	AS_QUIT_WINDOW,
85 	AS_SEND_BEHIND,
86 	AS_SET_LOOK,
87 	AS_SET_FEEL,
88 	AS_SET_FLAGS,
89 	AS_DISABLE_UPDATES,
90 	AS_ENABLE_UPDATES,
91 	AS_BEGIN_UPDATE,
92 	AS_END_UPDATE,
93 	AS_NEEDS_UPDATE,
94 	AS_SET_WINDOW_TITLE,
95 	AS_ADD_TO_SUBSET,
96 	AS_REMOVE_FROM_SUBSET,
97 	AS_SET_ALIGNMENT,
98 	AS_GET_ALIGNMENT,
99 	AS_GET_WORKSPACES,
100 	AS_SET_WORKSPACES,
101 	AS_WINDOW_RESIZE,
102 	AS_WINDOW_MOVE,
103 	AS_SET_SIZE_LIMITS,
104 	AS_ACTIVATE_WINDOW,
105 	AS_WINDOW_MINIMIZE,
106 	AS_UPDATE_IF_NEEDED,
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_GET_SYSTEM_FONTS,
117 	AS_GET_SYSTEM_DEFAULT_FONT,
118 
119 	AS_GET_FONT_LIST_REVISION,
120 	AS_GET_FAMILY_AND_STYLES,
121 
122 	AS_GET_FAMILY_AND_STYLE,
123 	AS_GET_FAMILY_AND_STYLE_IDS,
124 	AS_GET_FONT_BOUNDING_BOX,
125 	AS_GET_TUNED_COUNT,
126 	AS_GET_TUNED_INFO,
127 	AS_GET_FONT_HEIGHT,
128 	AS_GET_FONT_FILE_FORMAT,
129 	AS_GET_EXTRA_FONT_FLAGS,
130 
131 	AS_GET_STRING_WIDTHS,
132 	AS_GET_EDGES,
133 	AS_GET_ESCAPEMENTS,
134 	AS_GET_ESCAPEMENTS_AS_FLOATS,
135 	AS_GET_BOUNDINGBOXES_CHARS,
136 	AS_GET_BOUNDINGBOXES_STRINGS,
137 	AS_GET_HAS_GLYPHS,
138 	AS_GET_GLYPH_SHAPES,
139 	AS_GET_TRUNCATED_STRINGS,
140 
141 	// Screen methods
142 	AS_VALID_SCREEN_ID,
143 	AS_GET_NEXT_SCREEN_ID,
144 	AS_SCREEN_GET_MODE,
145 	AS_SCREEN_SET_MODE,
146 	AS_PROPOSE_MODE,
147 	AS_GET_MODE_LIST,
148 
149 	AS_GET_PIXEL_CLOCK_LIMITS,
150 	AS_GET_TIMING_CONSTRAINTS,
151 
152 	AS_SCREEN_GET_COLORMAP,
153 	AS_GET_DESKTOP_COLOR,
154 	AS_SET_DESKTOP_COLOR,
155 	AS_GET_SCREEN_ID_FROM_WINDOW,
156 
157 	AS_READ_BITMAP,
158 
159 	AS_GET_RETRACE_SEMAPHORE,
160 	AS_GET_ACCELERANT_INFO,
161 	AS_GET_FRAME_BUFFER_CONFIG,
162 
163 	AS_SET_DPMS,
164 	AS_GET_DPMS_STATE,
165 	AS_GET_DPMS_CAPABILITIES,
166 
167 	// Global function call defs
168 	AS_SET_UI_COLORS,
169 	AS_GET_UI_COLORS,
170 	AS_GET_UI_COLOR,
171 	AS_SET_DECORATOR,
172 	AS_GET_DECORATOR,
173 	AS_R5_SET_DECORATOR,
174 	AS_COUNT_DECORATORS,
175 	AS_GET_DECORATOR_NAME,
176 
177 	AS_COUNT_WORKSPACES,
178 	AS_SET_WORKSPACE_COUNT,
179 	AS_CURRENT_WORKSPACE,
180 	AS_ACTIVATE_WORKSPACE,
181 	AS_GET_SCROLLBAR_INFO,
182 	AS_SET_SCROLLBAR_INFO,
183 	AS_GET_MENU_INFO,
184 	AS_SET_MENU_INFO,
185 	AS_IDLE_TIME,
186 	AS_SELECT_PRINTER_PANEL,
187 	AS_ADD_PRINTER_PANEL,
188 	AS_RUN_BE_ABOUT,
189 	AS_SET_MOUSE_MODE,
190 	AS_GET_MOUSE_MODE,
191 	AS_GET_MOUSE,
192 
193 	// Hook function messages
194 	AS_WORKSPACE_ACTIVATED,
195 	AS_WORKSPACES_CHANGED,
196 	AS_WINDOW_ACTIVATED,
197 	AS_SCREENMODE_CHANGED,
198 
199 	// Graphics calls
200 	AS_BEGIN_TRANSACTION,
201 	AS_END_TRANSACTION,
202 	AS_SET_HIGH_COLOR,
203 	AS_SET_LOW_COLOR,
204 	AS_SET_VIEW_COLOR,
205 
206 	AS_STROKE_ARC,
207 	AS_STROKE_BEZIER,
208 	AS_STROKE_ELLIPSE,
209 	AS_STROKE_LINE,
210 	AS_STROKE_LINEARRAY,
211 	AS_STROKE_POLYGON,
212 	AS_STROKE_RECT,
213 	AS_STROKE_ROUNDRECT,
214 	AS_STROKE_SHAPE,
215 	AS_STROKE_TRIANGLE,
216 
217 	AS_FILL_ARC,
218 	AS_FILL_BEZIER,
219 	AS_FILL_ELLIPSE,
220 	AS_FILL_POLYGON,
221 	AS_FILL_RECT,
222 	AS_FILL_REGION,
223 	AS_FILL_ROUNDRECT,
224 	AS_FILL_SHAPE,
225 	AS_FILL_TRIANGLE,
226 
227 	AS_MOVEPENBY,
228 	AS_MOVEPENTO,
229 	AS_SETPENSIZE,
230 	AS_DRAW_STRING,
231 	AS_SET_FONT,
232 	AS_SET_FONT_SIZE,
233 
234 	AS_FLUSH,
235 	AS_SYNC,
236 
237 	AS_LAYER_CREATE,
238 	AS_LAYER_DELETE,
239 	AS_LAYER_CREATE_ROOT,
240 	AS_LAYER_DELETE_ROOT,
241 	AS_LAYER_ADD_CHILD,
242 	AS_LAYER_REMOVE_CHILD,
243 	AS_LAYER_REMOVE_SELF,
244 	AS_LAYER_SHOW,
245 	AS_LAYER_HIDE,
246 	AS_LAYER_MOVE,
247 	AS_LAYER_RESIZE,
248 	AS_LAYER_DRAW,
249 
250 	AS_LAYER_GET_TOKEN,
251 	AS_LAYER_ADD,
252 	AS_LAYER_REMOVE,
253 
254 	// View/Layer definitions
255 	AS_LAYER_GET_COORD,
256 	AS_LAYER_SET_FLAGS,
257 	AS_LAYER_SET_ORIGIN,
258 	AS_LAYER_GET_ORIGIN,
259 	AS_LAYER_RESIZE_MODE,
260 	AS_LAYER_CURSOR,
261 	AS_LAYER_BEGIN_RECT_TRACK,
262 	AS_LAYER_END_RECT_TRACK,
263 	AS_LAYER_DRAG_RECT,
264 	AS_LAYER_DRAG_IMAGE,
265 	AS_LAYER_SCROLL,
266 	AS_LAYER_SET_LINE_MODE,
267 	AS_LAYER_GET_LINE_MODE,
268 	AS_LAYER_PUSH_STATE,
269 	AS_LAYER_POP_STATE,
270 	AS_LAYER_SET_SCALE,
271 	AS_LAYER_GET_SCALE,
272 	AS_LAYER_SET_DRAW_MODE,
273 	AS_LAYER_GET_DRAW_MODE,
274 	AS_LAYER_SET_BLEND_MODE,
275 	AS_LAYER_GET_BLEND_MODE,
276 	AS_LAYER_SET_PEN_LOC,
277 	AS_LAYER_GET_PEN_LOC,
278 	AS_LAYER_SET_PEN_SIZE,
279 	AS_LAYER_GET_PEN_SIZE,
280 	AS_LAYER_SET_HIGH_COLOR,
281 	AS_LAYER_SET_LOW_COLOR,
282 	AS_LAYER_SET_VIEW_COLOR,
283 	AS_LAYER_GET_HIGH_COLOR,
284 	AS_LAYER_GET_LOW_COLOR,
285 	AS_LAYER_GET_VIEW_COLOR,
286 	AS_LAYER_PRINT_ALIASING,
287 	AS_LAYER_CLIP_TO_PICTURE,
288 	AS_LAYER_GET_CLIP_REGION,
289 	AS_LAYER_DRAW_BITMAP_ASYNC_IN_RECT,
290 	AS_LAYER_DRAW_BITMAP_ASYNC_AT_POINT,
291 	AS_LAYER_DRAW_BITMAP_SYNC_IN_RECT,
292 	AS_LAYER_DRAW_BITMAP_SYNC_AT_POINT,
293 	AS_LAYER_SET_EVENT_MASK,
294 	AS_LAYER_SET_MOUSE_EVENT_MASK,
295 
296 	AS_LAYER_DRAW_STRING,
297 	AS_LAYER_SET_CLIP_REGION,
298 	AS_LAYER_LINE_ARRAY,
299 	AS_LAYER_BEGIN_PICTURE,
300 	AS_LAYER_APPEND_TO_PICTURE,
301 	AS_LAYER_END_PICTURE,
302 	AS_LAYER_COPY_BITS,
303 	AS_LAYER_DRAW_PICTURE,
304 	AS_LAYER_INVALIDATE_RECT,
305 	AS_LAYER_INVALIDATE_REGION,
306 	AS_LAYER_INVERT_RECT,
307 	AS_LAYER_MOVE_TO,
308 	AS_LAYER_RESIZE_TO,
309 	AS_LAYER_SET_STATE,
310 	AS_LAYER_SET_FONT_STATE,
311 	AS_LAYER_GET_STATE,
312 	AS_LAYER_SET_VIEW_IMAGE,
313 	AS_LAYER_SET_PATTERN,
314 	AS_SET_CURRENT_LAYER,
315 
316 	// BDirectWindow codes
317 	AS_DIRECT_WINDOW_GET_SYNC_DATA,
318 	AS_DIRECT_WINDOW_SUPPORTS_WINDOW_MODE,
319 	AS_DIRECT_WINDOW_SET_FULLSCREEN,
320 
321 	AS_LAST_CODE
322 };
323 
324 #endif	// _APP_SERVER_PROTOCOL_H_
325