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