xref: /haiku/headers/private/app/ServerProtocol.h (revision be3db2942c0e8dda63cdd226ec3c99309d3eab0c)
1 /*
2  * Copyright 2001-2007, 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  */
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 #define AS_REQUEST_COLOR_KEY 0x00010000
26 	// additional option for AS_LAYER_SET_VIEW_BITMAP
27 
28 enum {
29 	// NOTE: all defines have to start with "AS_" to let the "code_to_name"
30 	// utility work correctly
31 
32 	AS_REGISTER_INPUT_SERVER = 1,
33 	AS_GET_DESKTOP,
34 
35 	// Desktop definitions (through the ServerApp, though)
36 	AS_GET_WINDOW_LIST,
37 	AS_GET_WINDOW_INFO,
38 	AS_MINIMIZE_TEAM,
39 	AS_BRING_TEAM_TO_FRONT,
40 	AS_WINDOW_ACTION,
41 
42 	// Application definitions
43 	AS_CREATE_APP,
44 	AS_DELETE_APP,
45 	AS_QUIT_APP,
46 	AS_ACTIVATE_APP,
47 	AS_APP_CRASHED,
48 
49 	AS_CREATE_WINDOW,
50 	AS_CREATE_OFFSCREEN_WINDOW,
51 	AS_DELETE_WINDOW,
52 	AS_CREATE_BITMAP,
53 	AS_DELETE_BITMAP,
54 	AS_GET_BITMAP_OVERLAY_RESTRICTIONS,
55 
56 	// Cursor commands
57 	AS_SET_CURSOR,
58 
59 	AS_SHOW_CURSOR,
60 	AS_HIDE_CURSOR,
61 	AS_OBSCURE_CURSOR,
62 	AS_QUERY_CURSOR_HIDDEN,
63 
64 	AS_CREATE_CURSOR,
65 	AS_DELETE_CURSOR,
66 
67 	AS_BEGIN_RECT_TRACKING,
68 	AS_END_RECT_TRACKING,
69 
70 	// Window definitions
71 	AS_SHOW_WINDOW,
72 	AS_HIDE_WINDOW,
73 	AS_MINIMIZE_WINDOW,
74 	AS_QUIT_WINDOW,
75 	AS_SEND_BEHIND,
76 	AS_SET_LOOK,
77 	AS_SET_FEEL,
78 	AS_SET_FLAGS,
79 	AS_DISABLE_UPDATES,
80 	AS_ENABLE_UPDATES,
81 	AS_BEGIN_UPDATE,
82 	AS_END_UPDATE,
83 	AS_NEEDS_UPDATE,
84 	AS_SET_WINDOW_TITLE,
85 	AS_ADD_TO_SUBSET,
86 	AS_REMOVE_FROM_SUBSET,
87 	AS_SET_ALIGNMENT,
88 	AS_GET_ALIGNMENT,
89 	AS_GET_WORKSPACES,
90 	AS_SET_WORKSPACES,
91 	AS_WINDOW_RESIZE,
92 	AS_WINDOW_MOVE,
93 	AS_SET_SIZE_LIMITS,
94 	AS_ACTIVATE_WINDOW,
95 	AS_IS_FRONT_WINDOW,
96 	AS_UPDATE_IF_NEEDED,
97 
98 	// BPicture definitions
99 	AS_CREATE_PICTURE,
100 	AS_DELETE_PICTURE,
101 	AS_CLONE_PICTURE,
102 	AS_DOWNLOAD_PICTURE,
103 
104 	// Font-related server communications
105 	AS_SET_SYSTEM_FONT,
106 	AS_GET_SYSTEM_FONTS,
107 	AS_GET_SYSTEM_DEFAULT_FONT,
108 
109 	AS_GET_FONT_LIST_REVISION,
110 	AS_GET_FAMILY_AND_STYLES,
111 
112 	AS_GET_FAMILY_AND_STYLE,
113 	AS_GET_FAMILY_AND_STYLE_IDS,
114 	AS_GET_FONT_BOUNDING_BOX,
115 	AS_GET_TUNED_COUNT,
116 	AS_GET_TUNED_INFO,
117 	AS_GET_FONT_HEIGHT,
118 	AS_GET_FONT_FILE_FORMAT,
119 	AS_GET_EXTRA_FONT_FLAGS,
120 
121 	AS_GET_STRING_WIDTHS,
122 	AS_GET_EDGES,
123 	AS_GET_ESCAPEMENTS,
124 	AS_GET_ESCAPEMENTS_AS_FLOATS,
125 	AS_GET_BOUNDINGBOXES_CHARS,
126 	AS_GET_BOUNDINGBOXES_STRINGS,
127 	AS_GET_HAS_GLYPHS,
128 	AS_GET_GLYPH_SHAPES,
129 	AS_GET_TRUNCATED_STRINGS,
130 
131 	// Screen methods
132 	AS_VALID_SCREEN_ID,
133 	AS_GET_NEXT_SCREEN_ID,
134 	AS_SCREEN_GET_MODE,
135 	AS_SCREEN_SET_MODE,
136 	AS_PROPOSE_MODE,
137 	AS_GET_MODE_LIST,
138 
139 	AS_GET_PIXEL_CLOCK_LIMITS,
140 	AS_GET_TIMING_CONSTRAINTS,
141 
142 	AS_SCREEN_GET_COLORMAP,
143 	AS_GET_DESKTOP_COLOR,
144 	AS_SET_DESKTOP_COLOR,
145 	AS_GET_SCREEN_ID_FROM_WINDOW,
146 
147 	AS_READ_BITMAP,
148 
149 	AS_GET_RETRACE_SEMAPHORE,
150 	AS_GET_ACCELERANT_INFO,
151 	AS_GET_FRAME_BUFFER_CONFIG,
152 
153 	AS_SET_DPMS,
154 	AS_GET_DPMS_STATE,
155 	AS_GET_DPMS_CAPABILITIES,
156 
157 	// Misc stuff
158 	AS_GET_ACCELERANT_PATH,
159 	AS_GET_DRIVER_PATH,
160 
161 	// Global function call defs
162 	AS_SET_UI_COLORS,
163 	AS_SET_UI_COLOR,
164 	AS_SET_DECORATOR,
165 	AS_GET_DECORATOR,
166 	AS_R5_SET_DECORATOR,
167 	AS_COUNT_DECORATORS,
168 	AS_GET_DECORATOR_NAME,
169 
170 	AS_COUNT_WORKSPACES,
171 	AS_SET_WORKSPACE_COUNT,
172 	AS_CURRENT_WORKSPACE,
173 	AS_ACTIVATE_WORKSPACE,
174 	AS_GET_SCROLLBAR_INFO,
175 	AS_SET_SCROLLBAR_INFO,
176 	AS_GET_MENU_INFO,
177 	AS_SET_MENU_INFO,
178 	AS_IDLE_TIME,
179 	AS_SELECT_PRINTER_PANEL,
180 	AS_ADD_PRINTER_PANEL,
181 	AS_RUN_BE_ABOUT,
182 	AS_SET_MOUSE_MODE,
183 	AS_GET_MOUSE_MODE,
184 	AS_GET_MOUSE,
185 	AS_SET_DECORATOR_SETTINGS,
186 	AS_GET_DECORATOR_SETTINGS,
187 
188 	// Graphics calls
189 	AS_SET_HIGH_COLOR,
190 	AS_SET_LOW_COLOR,
191 	AS_SET_VIEW_COLOR,
192 
193 	AS_STROKE_ARC,
194 	AS_STROKE_BEZIER,
195 	AS_STROKE_ELLIPSE,
196 	AS_STROKE_LINE,
197 	AS_STROKE_LINEARRAY,
198 	AS_STROKE_POLYGON,
199 	AS_STROKE_RECT,
200 	AS_STROKE_ROUNDRECT,
201 	AS_STROKE_SHAPE,
202 	AS_STROKE_TRIANGLE,
203 
204 	AS_FILL_ARC,
205 	AS_FILL_BEZIER,
206 	AS_FILL_ELLIPSE,
207 	AS_FILL_POLYGON,
208 	AS_FILL_RECT,
209 	AS_FILL_REGION,
210 	AS_FILL_ROUNDRECT,
211 	AS_FILL_SHAPE,
212 	AS_FILL_TRIANGLE,
213 
214 	AS_DRAW_STRING,
215 	AS_SET_FONT,
216 	AS_SET_FONT_SIZE,
217 
218 	AS_SYNC,
219 
220 	AS_LAYER_CREATE,
221 	AS_LAYER_DELETE,
222 	AS_LAYER_CREATE_ROOT,
223 	AS_LAYER_SHOW,
224 	AS_LAYER_HIDE,
225 	AS_LAYER_MOVE,
226 	AS_LAYER_RESIZE,
227 	AS_LAYER_DRAW,
228 
229 	// View/Layer definitions
230 	AS_LAYER_GET_COORD,
231 	AS_LAYER_SET_FLAGS,
232 	AS_LAYER_SET_ORIGIN,
233 	AS_LAYER_GET_ORIGIN,
234 	AS_LAYER_RESIZE_MODE,
235 	AS_LAYER_SET_CURSOR,
236 	AS_LAYER_BEGIN_RECT_TRACK,
237 	AS_LAYER_END_RECT_TRACK,
238 	AS_LAYER_DRAG_RECT,
239 	AS_LAYER_DRAG_IMAGE,
240 	AS_LAYER_SCROLL,
241 	AS_LAYER_SET_LINE_MODE,
242 	AS_LAYER_GET_LINE_MODE,
243 	AS_LAYER_PUSH_STATE,
244 	AS_LAYER_POP_STATE,
245 	AS_LAYER_SET_SCALE,
246 	AS_LAYER_GET_SCALE,
247 	AS_LAYER_SET_DRAWING_MODE,
248 	AS_LAYER_GET_DRAWING_MODE,
249 	AS_LAYER_SET_BLENDING_MODE,
250 	AS_LAYER_GET_BLENDING_MODE,
251 	AS_LAYER_SET_PEN_LOC,
252 	AS_LAYER_GET_PEN_LOC,
253 	AS_LAYER_SET_PEN_SIZE,
254 	AS_LAYER_GET_PEN_SIZE,
255 	AS_LAYER_SET_HIGH_COLOR,
256 	AS_LAYER_SET_LOW_COLOR,
257 	AS_LAYER_SET_VIEW_COLOR,
258 	AS_LAYER_GET_HIGH_COLOR,
259 	AS_LAYER_GET_LOW_COLOR,
260 	AS_LAYER_GET_VIEW_COLOR,
261 	AS_LAYER_PRINT_ALIASING,
262 	AS_LAYER_CLIP_TO_PICTURE,
263 	AS_LAYER_GET_CLIP_REGION,
264 	AS_LAYER_DRAW_BITMAP,
265 	AS_LAYER_SET_EVENT_MASK,
266 	AS_LAYER_SET_MOUSE_EVENT_MASK,
267 
268 	AS_LAYER_DRAW_STRING,
269 	AS_LAYER_SET_CLIP_REGION,
270 	AS_LAYER_LINE_ARRAY,
271 	AS_LAYER_BEGIN_PICTURE,
272 	AS_LAYER_APPEND_TO_PICTURE,
273 	AS_LAYER_END_PICTURE,
274 	AS_LAYER_COPY_BITS,
275 	AS_LAYER_DRAW_PICTURE,
276 	AS_LAYER_INVALIDATE_RECT,
277 	AS_LAYER_INVALIDATE_REGION,
278 	AS_LAYER_INVERT_RECT,
279 	AS_LAYER_MOVE_TO,
280 	AS_LAYER_RESIZE_TO,
281 	AS_LAYER_SET_STATE,
282 	AS_LAYER_SET_FONT_STATE,
283 	AS_LAYER_GET_STATE,
284 	AS_LAYER_SET_VIEW_BITMAP,
285 	AS_LAYER_SET_PATTERN,
286 	AS_SET_CURRENT_LAYER,
287 
288 	// BDirectWindow codes
289 	AS_DIRECT_WINDOW_GET_SYNC_DATA,
290 	AS_DIRECT_WINDOW_SET_FULLSCREEN,
291 
292 	// Notification of event stream closing to restart input_server
293 	AS_EVENT_STREAM_CLOSED,
294 
295 	AS_LAST_CODE
296 };
297 
298 // Cursor types, currently they are all private besides the first two
299 enum cursor_which {
300 	B_CURSOR_DEFAULT = 1,
301 	B_CURSOR_TEXT,
302 	B_CURSOR_MOVE,
303 	B_CURSOR_DRAG,
304 	B_CURSOR_RESIZE,
305 	B_CURSOR_RESIZE_NWSE,
306 	B_CURSOR_RESIZE_NESW,
307 	B_CURSOR_RESIZE_NS,
308 	B_CURSOR_RESIZE_EW,
309 	B_CURSOR_OTHER,
310 	B_CURSOR_APP,
311 	B_CURSOR_INVALID
312 };
313 
314 // bitmap allocation flags
315 enum {
316 	kAllocator			= 0x1,
317 	kFramebuffer		= 0x2,
318 	kHeap				= 0x4,
319 	kNewAllocatorArea	= 0x8,
320 };
321 
322 #endif	// APP_SERVER_PROTOCOL_H
323