xref: /haiku/headers/private/app/ServerProtocol.h (revision d3d8b26997fac34a84981e6d2b649521de2cc45a)
1 /*
2  * Copyright 2001-2006, 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 
48 	AS_SET_SERVER_PORT,
49 
50 	AS_CREATE_WINDOW,
51 	AS_CREATE_OFFSCREEN_WINDOW,
52 	AS_DELETE_WINDOW,
53 	AS_CREATE_BITMAP,
54 	AS_DELETE_BITMAP,
55 	AS_GET_BITMAP_OVERLAY_RESTRICTIONS,
56 
57 	// Cursor commands
58 	AS_SET_CURSOR,
59 
60 	AS_SHOW_CURSOR,
61 	AS_HIDE_CURSOR,
62 	AS_OBSCURE_CURSOR,
63 	AS_QUERY_CURSOR_HIDDEN,
64 
65 	AS_CREATE_CURSOR,
66 	AS_DELETE_CURSOR,
67 
68 	AS_BEGIN_RECT_TRACKING,
69 	AS_END_RECT_TRACKING,
70 
71 	// Window definitions
72 	AS_SHOW_WINDOW,
73 	AS_HIDE_WINDOW,
74 	AS_MINIMIZE_WINDOW,
75 	AS_QUIT_WINDOW,
76 	AS_SEND_BEHIND,
77 	AS_SET_LOOK,
78 	AS_SET_FEEL,
79 	AS_SET_FLAGS,
80 	AS_DISABLE_UPDATES,
81 	AS_ENABLE_UPDATES,
82 	AS_BEGIN_UPDATE,
83 	AS_END_UPDATE,
84 	AS_NEEDS_UPDATE,
85 	AS_SET_WINDOW_TITLE,
86 	AS_ADD_TO_SUBSET,
87 	AS_REMOVE_FROM_SUBSET,
88 	AS_SET_ALIGNMENT,
89 	AS_GET_ALIGNMENT,
90 	AS_GET_WORKSPACES,
91 	AS_SET_WORKSPACES,
92 	AS_WINDOW_RESIZE,
93 	AS_WINDOW_MOVE,
94 	AS_SET_SIZE_LIMITS,
95 	AS_ACTIVATE_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 
186 	// Graphics calls
187 	AS_SET_HIGH_COLOR,
188 	AS_SET_LOW_COLOR,
189 	AS_SET_VIEW_COLOR,
190 
191 	AS_STROKE_ARC,
192 	AS_STROKE_BEZIER,
193 	AS_STROKE_ELLIPSE,
194 	AS_STROKE_LINE,
195 	AS_STROKE_LINEARRAY,
196 	AS_STROKE_POLYGON,
197 	AS_STROKE_RECT,
198 	AS_STROKE_ROUNDRECT,
199 	AS_STROKE_SHAPE,
200 	AS_STROKE_TRIANGLE,
201 
202 	AS_FILL_ARC,
203 	AS_FILL_BEZIER,
204 	AS_FILL_ELLIPSE,
205 	AS_FILL_POLYGON,
206 	AS_FILL_RECT,
207 	AS_FILL_REGION,
208 	AS_FILL_ROUNDRECT,
209 	AS_FILL_SHAPE,
210 	AS_FILL_TRIANGLE,
211 
212 	AS_MOVEPENBY,
213 	AS_MOVEPENTO,
214 	AS_SETPENSIZE,
215 	AS_DRAW_STRING,
216 	AS_SET_FONT,
217 	AS_SET_FONT_SIZE,
218 
219 	AS_SYNC,
220 
221 	AS_LAYER_CREATE,
222 	AS_LAYER_DELETE,
223 	AS_LAYER_CREATE_ROOT,
224 	AS_LAYER_SHOW,
225 	AS_LAYER_HIDE,
226 	AS_LAYER_MOVE,
227 	AS_LAYER_RESIZE,
228 	AS_LAYER_DRAW,
229 
230 	// View/Layer definitions
231 	AS_LAYER_GET_COORD,
232 	AS_LAYER_SET_FLAGS,
233 	AS_LAYER_SET_ORIGIN,
234 	AS_LAYER_GET_ORIGIN,
235 	AS_LAYER_RESIZE_MODE,
236 	AS_LAYER_SET_CURSOR,
237 	AS_LAYER_BEGIN_RECT_TRACK,
238 	AS_LAYER_END_RECT_TRACK,
239 	AS_LAYER_DRAG_RECT,
240 	AS_LAYER_DRAG_IMAGE,
241 	AS_LAYER_SCROLL,
242 	AS_LAYER_SET_LINE_MODE,
243 	AS_LAYER_GET_LINE_MODE,
244 	AS_LAYER_PUSH_STATE,
245 	AS_LAYER_POP_STATE,
246 	AS_LAYER_SET_SCALE,
247 	AS_LAYER_GET_SCALE,
248 	AS_LAYER_SET_DRAWING_MODE,
249 	AS_LAYER_GET_DRAWING_MODE,
250 	AS_LAYER_SET_BLENDING_MODE,
251 	AS_LAYER_GET_BLENDING_MODE,
252 	AS_LAYER_SET_PEN_LOC,
253 	AS_LAYER_GET_PEN_LOC,
254 	AS_LAYER_SET_PEN_SIZE,
255 	AS_LAYER_GET_PEN_SIZE,
256 	AS_LAYER_SET_HIGH_COLOR,
257 	AS_LAYER_SET_LOW_COLOR,
258 	AS_LAYER_SET_VIEW_COLOR,
259 	AS_LAYER_GET_HIGH_COLOR,
260 	AS_LAYER_GET_LOW_COLOR,
261 	AS_LAYER_GET_VIEW_COLOR,
262 	AS_LAYER_PRINT_ALIASING,
263 	AS_LAYER_CLIP_TO_PICTURE,
264 	AS_LAYER_GET_CLIP_REGION,
265 	AS_LAYER_DRAW_BITMAP,
266 	AS_LAYER_SET_EVENT_MASK,
267 	AS_LAYER_SET_MOUSE_EVENT_MASK,
268 
269 	AS_LAYER_DRAW_STRING,
270 	AS_LAYER_SET_CLIP_REGION,
271 	AS_LAYER_LINE_ARRAY,
272 	AS_LAYER_BEGIN_PICTURE,
273 	AS_LAYER_APPEND_TO_PICTURE,
274 	AS_LAYER_END_PICTURE,
275 	AS_LAYER_COPY_BITS,
276 	AS_LAYER_DRAW_PICTURE,
277 	AS_LAYER_INVALIDATE_RECT,
278 	AS_LAYER_INVALIDATE_REGION,
279 	AS_LAYER_INVERT_RECT,
280 	AS_LAYER_MOVE_TO,
281 	AS_LAYER_RESIZE_TO,
282 	AS_LAYER_SET_STATE,
283 	AS_LAYER_SET_FONT_STATE,
284 	AS_LAYER_GET_STATE,
285 	AS_LAYER_SET_VIEW_BITMAP,
286 	AS_LAYER_SET_PATTERN,
287 	AS_SET_CURRENT_LAYER,
288 
289 	// BDirectWindow codes
290 	AS_DIRECT_WINDOW_GET_SYNC_DATA,
291 	AS_DIRECT_WINDOW_SET_FULLSCREEN,
292 
293 	AS_LAST_CODE
294 };
295 
296 // Cursor types, currently they are all private besides the first two
297 enum cursor_which {
298 	B_CURSOR_DEFAULT = 1,
299 	B_CURSOR_TEXT,
300 	B_CURSOR_MOVE,
301 	B_CURSOR_DRAG,
302 	B_CURSOR_RESIZE,
303 	B_CURSOR_RESIZE_NWSE,
304 	B_CURSOR_RESIZE_NESW,
305 	B_CURSOR_RESIZE_NS,
306 	B_CURSOR_RESIZE_EW,
307 	B_CURSOR_OTHER,
308 	B_CURSOR_APP,
309 	B_CURSOR_INVALID
310 };
311 
312 // bitmap allocation flags
313 enum {
314 	kAllocator			= 0x1,
315 	kFramebuffer		= 0x2,
316 	kHeap				= 0x4,
317 	kNewAllocatorArea	= 0x8,
318 };
319 
320 #endif	// APP_SERVER_PROTOCOL_H
321