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_CREATE_CURSOR_BITMAP, 77 AS_REFERENCE_CURSOR, 78 AS_DELETE_CURSOR, 79 80 AS_BEGIN_RECT_TRACKING, 81 AS_END_RECT_TRACKING, 82 83 AS_GET_CURSOR_POSITION, 84 AS_GET_CURSOR_BITMAP, 85 86 // Window definitions 87 AS_SHOW_OR_HIDE_WINDOW, 88 AS_INTERNAL_HIDE_WINDOW, 89 AS_MINIMIZE_WINDOW, 90 AS_QUIT_WINDOW, 91 AS_SEND_BEHIND, 92 AS_SET_LOOK, 93 AS_SET_FEEL, 94 AS_SET_FLAGS, 95 AS_DISABLE_UPDATES, 96 AS_ENABLE_UPDATES, 97 AS_BEGIN_UPDATE, 98 AS_END_UPDATE, 99 AS_NEEDS_UPDATE, 100 AS_SET_WINDOW_TITLE, 101 AS_ADD_TO_SUBSET, 102 AS_REMOVE_FROM_SUBSET, 103 AS_SET_ALIGNMENT, 104 AS_GET_ALIGNMENT, 105 AS_GET_WORKSPACES, 106 AS_SET_WORKSPACES, 107 AS_WINDOW_RESIZE, 108 AS_WINDOW_MOVE, 109 AS_SET_SIZE_LIMITS, 110 AS_ACTIVATE_WINDOW, 111 AS_IS_FRONT_WINDOW, 112 113 // BPicture definitions 114 AS_CREATE_PICTURE, 115 AS_DELETE_PICTURE, 116 AS_CLONE_PICTURE, 117 AS_DOWNLOAD_PICTURE, 118 119 // Font-related server communications 120 AS_SET_SYSTEM_FONT, 121 AS_GET_SYSTEM_FONTS, 122 AS_GET_SYSTEM_DEFAULT_FONT, 123 AS_SYSTEM_FONT_CHANGED, 124 125 AS_GET_FONT_LIST_REVISION, 126 AS_GET_FAMILY_AND_STYLES, 127 128 AS_GET_FAMILY_AND_STYLE, 129 AS_GET_FAMILY_AND_STYLE_IDS, 130 AS_GET_FONT_BOUNDING_BOX, 131 AS_GET_TUNED_COUNT, 132 AS_GET_TUNED_INFO, 133 AS_GET_FONT_HEIGHT, 134 AS_GET_FONT_FILE_FORMAT, 135 AS_GET_EXTRA_FONT_FLAGS, 136 137 AS_GET_STRING_WIDTHS, 138 AS_GET_EDGES, 139 AS_GET_ESCAPEMENTS, 140 AS_GET_ESCAPEMENTS_AS_FLOATS, 141 AS_GET_BOUNDINGBOXES_CHARS, 142 AS_GET_BOUNDINGBOXES_STRING, 143 AS_GET_BOUNDINGBOXES_STRINGS, 144 AS_GET_HAS_GLYPHS, 145 AS_GET_GLYPH_SHAPES, 146 AS_GET_TRUNCATED_STRINGS, 147 AS_GET_UNICODE_BLOCKS, 148 AS_GET_HAS_UNICODE_BLOCK, 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 AS_SCREEN_SET_BRIGHTNESS, 179 AS_SCREEN_GET_BRIGHTNESS, 180 181 // Misc stuff 182 AS_GET_ACCELERANT_PATH, 183 AS_GET_DRIVER_PATH, 184 185 // Global function call defs 186 AS_SET_UI_COLORS, 187 AS_SET_UI_COLOR, 188 AS_SET_DECORATOR, 189 AS_GET_DECORATOR, 190 AS_R5_SET_DECORATOR, 191 AS_COUNT_DECORATORS, 192 AS_GET_DECORATOR_NAME, 193 AS_SET_CONTROL_LOOK, 194 AS_GET_CONTROL_LOOK, 195 196 AS_COUNT_WORKSPACES, 197 AS_CURRENT_WORKSPACE, 198 AS_ACTIVATE_WORKSPACE, 199 AS_SET_WORKSPACE_LAYOUT, 200 AS_GET_WORKSPACE_LAYOUT, 201 AS_GET_SCROLLBAR_INFO, 202 AS_SET_SCROLLBAR_INFO, 203 AS_GET_MENU_INFO, 204 AS_SET_MENU_INFO, 205 AS_IDLE_TIME, 206 AS_SET_MOUSE_MODE, 207 AS_GET_MOUSE_MODE, 208 AS_SET_FOCUS_FOLLOWS_MOUSE_MODE, 209 AS_GET_FOCUS_FOLLOWS_MOUSE_MODE, 210 AS_SET_ACCEPT_FIRST_CLICK, 211 AS_GET_ACCEPT_FIRST_CLICK, 212 AS_GET_MOUSE, 213 AS_SET_DECORATOR_SETTINGS, 214 AS_GET_DECORATOR_SETTINGS, 215 AS_GET_SHOW_ALL_DRAGGERS, 216 AS_SET_SHOW_ALL_DRAGGERS, 217 218 // Subpixel antialiasing & hinting 219 AS_SET_SUBPIXEL_ANTIALIASING, 220 AS_GET_SUBPIXEL_ANTIALIASING, 221 AS_SET_HINTING, 222 AS_GET_HINTING, 223 AS_SET_SUBPIXEL_AVERAGE_WEIGHT, 224 AS_GET_SUBPIXEL_AVERAGE_WEIGHT, 225 AS_SET_SUBPIXEL_ORDERING, 226 AS_GET_SUBPIXEL_ORDERING, 227 228 // Graphics calls 229 AS_SET_HIGH_COLOR, 230 AS_SET_LOW_COLOR, 231 AS_SET_VIEW_COLOR, 232 233 AS_STROKE_ARC, 234 AS_STROKE_BEZIER, 235 AS_STROKE_ELLIPSE, 236 AS_STROKE_LINE, 237 AS_STROKE_LINEARRAY, 238 AS_STROKE_POLYGON, 239 AS_STROKE_RECT, 240 AS_STROKE_ROUNDRECT, 241 AS_STROKE_SHAPE, 242 AS_STROKE_TRIANGLE, 243 244 AS_FILL_ARC, 245 AS_FILL_ARC_GRADIENT, 246 AS_FILL_BEZIER, 247 AS_FILL_BEZIER_GRADIENT, 248 AS_FILL_ELLIPSE, 249 AS_FILL_ELLIPSE_GRADIENT, 250 AS_FILL_POLYGON, 251 AS_FILL_POLYGON_GRADIENT, 252 AS_FILL_RECT, 253 AS_FILL_RECT_GRADIENT, 254 AS_FILL_REGION, 255 AS_FILL_REGION_GRADIENT, 256 AS_FILL_ROUNDRECT, 257 AS_FILL_ROUNDRECT_GRADIENT, 258 AS_FILL_SHAPE, 259 AS_FILL_SHAPE_GRADIENT, 260 AS_FILL_TRIANGLE, 261 AS_FILL_TRIANGLE_GRADIENT, 262 263 AS_DRAW_STRING, 264 AS_DRAW_STRING_WITH_DELTA, 265 AS_DRAW_STRING_WITH_OFFSETS, 266 267 AS_SYNC, 268 269 AS_VIEW_CREATE, 270 AS_VIEW_DELETE, 271 AS_VIEW_CREATE_ROOT, 272 AS_VIEW_SHOW, 273 AS_VIEW_HIDE, 274 AS_VIEW_MOVE, 275 AS_VIEW_RESIZE, 276 AS_VIEW_DRAW, 277 278 // View/Layer definitions 279 AS_VIEW_GET_COORD, 280 AS_VIEW_SET_FLAGS, 281 AS_VIEW_SET_ORIGIN, 282 AS_VIEW_GET_ORIGIN, 283 AS_VIEW_RESIZE_MODE, 284 AS_VIEW_BEGIN_RECT_TRACK, 285 AS_VIEW_END_RECT_TRACK, 286 AS_VIEW_DRAG_RECT, 287 AS_VIEW_DRAG_IMAGE, 288 AS_VIEW_SCROLL, 289 AS_VIEW_SET_LINE_MODE, 290 AS_VIEW_GET_LINE_MODE, 291 AS_VIEW_PUSH_STATE, 292 AS_VIEW_POP_STATE, 293 AS_VIEW_SET_SCALE, 294 AS_VIEW_GET_SCALE, 295 AS_VIEW_SET_DRAWING_MODE, 296 AS_VIEW_GET_DRAWING_MODE, 297 AS_VIEW_SET_BLENDING_MODE, 298 AS_VIEW_GET_BLENDING_MODE, 299 AS_VIEW_SET_PEN_LOC, 300 AS_VIEW_GET_PEN_LOC, 301 AS_VIEW_SET_PEN_SIZE, 302 AS_VIEW_GET_PEN_SIZE, 303 AS_VIEW_SET_HIGH_COLOR, 304 AS_VIEW_SET_HIGH_UI_COLOR, 305 AS_VIEW_SET_LOW_COLOR, 306 AS_VIEW_SET_LOW_UI_COLOR, 307 AS_VIEW_SET_VIEW_COLOR, 308 AS_VIEW_SET_VIEW_UI_COLOR, 309 AS_VIEW_GET_HIGH_COLOR, 310 AS_VIEW_GET_HIGH_UI_COLOR, 311 AS_VIEW_GET_LOW_COLOR, 312 AS_VIEW_GET_LOW_UI_COLOR, 313 AS_VIEW_GET_VIEW_COLOR, 314 AS_VIEW_GET_VIEW_UI_COLOR, 315 316 AS_VIEW_PRINT_ALIASING, 317 AS_VIEW_CLIP_TO_PICTURE, 318 AS_VIEW_GET_CLIP_REGION, 319 AS_VIEW_DRAW_BITMAP, 320 AS_VIEW_SET_EVENT_MASK, 321 AS_VIEW_SET_MOUSE_EVENT_MASK, 322 323 AS_VIEW_DRAW_STRING, 324 AS_VIEW_SET_CLIP_REGION, 325 AS_VIEW_LINE_ARRAY, 326 AS_VIEW_BEGIN_PICTURE, 327 AS_VIEW_APPEND_TO_PICTURE, 328 AS_VIEW_END_PICTURE, 329 AS_VIEW_COPY_BITS, 330 AS_VIEW_DRAW_PICTURE, 331 AS_VIEW_INVALIDATE_RECT, 332 AS_VIEW_DELAYED_INVALIDATE_RECT, 333 AS_VIEW_INVALIDATE_REGION, 334 AS_VIEW_INVERT_RECT, 335 AS_VIEW_MOVE_TO, 336 AS_VIEW_RESIZE_TO, 337 AS_VIEW_SET_STATE, 338 AS_VIEW_SET_FONT_STATE, 339 AS_VIEW_GET_STATE, 340 AS_VIEW_SET_VIEW_BITMAP, 341 AS_VIEW_SET_PATTERN, 342 AS_SET_CURRENT_VIEW, 343 AS_VIEW_BEGIN_LAYER, 344 AS_VIEW_END_LAYER, 345 346 // BDirectWindow/BWindowScreen codes 347 AS_DIRECT_WINDOW_GET_SYNC_DATA, 348 AS_DIRECT_WINDOW_SET_FULLSCREEN, 349 AS_DIRECT_SCREEN_LOCK, 350 351 // desktop listener communications 352 AS_TALK_TO_DESKTOP_LISTENER, 353 354 // debugging helper 355 AS_DUMP_ALLOCATOR, 356 AS_DUMP_BITMAPS, 357 358 // transformation in addition to origin/scale 359 AS_VIEW_SET_TRANSFORM, 360 AS_VIEW_GET_TRANSFORM, 361 362 AS_VIEW_AFFINE_TRANSLATE, 363 AS_VIEW_AFFINE_SCALE, 364 AS_VIEW_AFFINE_ROTATE, 365 366 // Polygon filling rules 367 AS_VIEW_SET_FILL_RULE, 368 AS_VIEW_GET_FILL_RULE, 369 370 // New clipping: cumulative, transformed 371 AS_VIEW_CLIP_TO_RECT, 372 AS_VIEW_CLIP_TO_SHAPE, 373 374 // Internal messages 375 AS_COLOR_MAP_UPDATED, 376 377 AS_LAST_CODE 378 }; 379 380 // TODO: move this into a private app header, together with the rest of the 381 // private message definitions in AppDefs.h 382 enum { 383 kMsgDeleteServerMemoryArea = '_DSA', 384 }; 385 386 // bitmap allocation flags 387 enum { 388 kAllocator = 0x1, 389 kFramebuffer = 0x2, 390 kHeap = 0x4, 391 kNewAllocatorArea = 0x8, 392 }; 393 394 #endif // APP_SERVER_PROTOCOL_H 395