1 /* 2 * Copyright 2001-2015, 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 147 // Screen methods 148 AS_VALID_SCREEN_ID, 149 AS_GET_NEXT_SCREEN_ID, 150 AS_SCREEN_GET_MODE, 151 AS_SCREEN_SET_MODE, 152 AS_PROPOSE_MODE, 153 AS_GET_MODE_LIST, 154 AS_GET_SCREEN_FRAME, 155 156 AS_GET_PIXEL_CLOCK_LIMITS, 157 AS_GET_TIMING_CONSTRAINTS, 158 159 AS_SCREEN_GET_COLORMAP, 160 AS_GET_DESKTOP_COLOR, 161 AS_SET_DESKTOP_COLOR, 162 AS_GET_SCREEN_ID_FROM_WINDOW, 163 164 AS_READ_BITMAP, 165 166 AS_GET_RETRACE_SEMAPHORE, 167 AS_GET_ACCELERANT_INFO, 168 AS_GET_MONITOR_INFO, 169 AS_GET_FRAME_BUFFER_CONFIG, 170 171 AS_SET_DPMS, 172 AS_GET_DPMS_STATE, 173 AS_GET_DPMS_CAPABILITIES, 174 175 // Misc stuff 176 AS_GET_ACCELERANT_PATH, 177 AS_GET_DRIVER_PATH, 178 179 // Global function call defs 180 AS_SET_UI_COLORS, 181 AS_SET_UI_COLOR, 182 AS_SET_DECORATOR, 183 AS_GET_DECORATOR, 184 AS_R5_SET_DECORATOR, 185 AS_COUNT_DECORATORS, 186 AS_GET_DECORATOR_NAME, 187 188 AS_COUNT_WORKSPACES, 189 AS_CURRENT_WORKSPACE, 190 AS_ACTIVATE_WORKSPACE, 191 AS_SET_WORKSPACE_LAYOUT, 192 AS_GET_WORKSPACE_LAYOUT, 193 AS_GET_SCROLLBAR_INFO, 194 AS_SET_SCROLLBAR_INFO, 195 AS_GET_MENU_INFO, 196 AS_SET_MENU_INFO, 197 AS_IDLE_TIME, 198 AS_SET_MOUSE_MODE, 199 AS_GET_MOUSE_MODE, 200 AS_SET_FOCUS_FOLLOWS_MOUSE_MODE, 201 AS_GET_FOCUS_FOLLOWS_MOUSE_MODE, 202 AS_SET_ACCEPT_FIRST_CLICK, 203 AS_GET_ACCEPT_FIRST_CLICK, 204 AS_GET_MOUSE, 205 AS_SET_DECORATOR_SETTINGS, 206 AS_GET_DECORATOR_SETTINGS, 207 AS_GET_SHOW_ALL_DRAGGERS, 208 AS_SET_SHOW_ALL_DRAGGERS, 209 210 // Subpixel antialiasing & hinting 211 AS_SET_SUBPIXEL_ANTIALIASING, 212 AS_GET_SUBPIXEL_ANTIALIASING, 213 AS_SET_HINTING, 214 AS_GET_HINTING, 215 AS_SET_SUBPIXEL_AVERAGE_WEIGHT, 216 AS_GET_SUBPIXEL_AVERAGE_WEIGHT, 217 AS_SET_SUBPIXEL_ORDERING, 218 AS_GET_SUBPIXEL_ORDERING, 219 220 // Graphics calls 221 AS_SET_HIGH_COLOR, 222 AS_SET_LOW_COLOR, 223 AS_SET_VIEW_COLOR, 224 225 AS_STROKE_ARC, 226 AS_STROKE_BEZIER, 227 AS_STROKE_ELLIPSE, 228 AS_STROKE_LINE, 229 AS_STROKE_LINEARRAY, 230 AS_STROKE_POLYGON, 231 AS_STROKE_RECT, 232 AS_STROKE_ROUNDRECT, 233 AS_STROKE_SHAPE, 234 AS_STROKE_TRIANGLE, 235 236 AS_FILL_ARC, 237 AS_FILL_ARC_GRADIENT, 238 AS_FILL_BEZIER, 239 AS_FILL_BEZIER_GRADIENT, 240 AS_FILL_ELLIPSE, 241 AS_FILL_ELLIPSE_GRADIENT, 242 AS_FILL_POLYGON, 243 AS_FILL_POLYGON_GRADIENT, 244 AS_FILL_RECT, 245 AS_FILL_RECT_GRADIENT, 246 AS_FILL_REGION, 247 AS_FILL_REGION_GRADIENT, 248 AS_FILL_ROUNDRECT, 249 AS_FILL_ROUNDRECT_GRADIENT, 250 AS_FILL_SHAPE, 251 AS_FILL_SHAPE_GRADIENT, 252 AS_FILL_TRIANGLE, 253 AS_FILL_TRIANGLE_GRADIENT, 254 255 AS_DRAW_STRING, 256 AS_DRAW_STRING_WITH_DELTA, 257 AS_DRAW_STRING_WITH_OFFSETS, 258 259 AS_SYNC, 260 261 AS_VIEW_CREATE, 262 AS_VIEW_DELETE, 263 AS_VIEW_CREATE_ROOT, 264 AS_VIEW_SHOW, 265 AS_VIEW_HIDE, 266 AS_VIEW_MOVE, 267 AS_VIEW_RESIZE, 268 AS_VIEW_DRAW, 269 270 // View/Layer definitions 271 AS_VIEW_GET_COORD, 272 AS_VIEW_SET_FLAGS, 273 AS_VIEW_SET_ORIGIN, 274 AS_VIEW_GET_ORIGIN, 275 AS_VIEW_RESIZE_MODE, 276 AS_VIEW_BEGIN_RECT_TRACK, 277 AS_VIEW_END_RECT_TRACK, 278 AS_VIEW_DRAG_RECT, 279 AS_VIEW_DRAG_IMAGE, 280 AS_VIEW_SCROLL, 281 AS_VIEW_SET_LINE_MODE, 282 AS_VIEW_GET_LINE_MODE, 283 AS_VIEW_PUSH_STATE, 284 AS_VIEW_POP_STATE, 285 AS_VIEW_SET_SCALE, 286 AS_VIEW_GET_SCALE, 287 AS_VIEW_SET_DRAWING_MODE, 288 AS_VIEW_GET_DRAWING_MODE, 289 AS_VIEW_SET_BLENDING_MODE, 290 AS_VIEW_GET_BLENDING_MODE, 291 AS_VIEW_SET_PEN_LOC, 292 AS_VIEW_GET_PEN_LOC, 293 AS_VIEW_SET_PEN_SIZE, 294 AS_VIEW_GET_PEN_SIZE, 295 AS_VIEW_SET_HIGH_COLOR, 296 AS_VIEW_SET_HIGH_UI_COLOR, 297 AS_VIEW_SET_LOW_COLOR, 298 AS_VIEW_SET_LOW_UI_COLOR, 299 AS_VIEW_SET_VIEW_COLOR, 300 AS_VIEW_SET_VIEW_UI_COLOR, 301 AS_VIEW_GET_HIGH_COLOR, 302 AS_VIEW_GET_HIGH_UI_COLOR, 303 AS_VIEW_GET_LOW_COLOR, 304 AS_VIEW_GET_LOW_UI_COLOR, 305 AS_VIEW_GET_VIEW_COLOR, 306 AS_VIEW_GET_VIEW_UI_COLOR, 307 308 AS_VIEW_PRINT_ALIASING, 309 AS_VIEW_CLIP_TO_PICTURE, 310 AS_VIEW_GET_CLIP_REGION, 311 AS_VIEW_DRAW_BITMAP, 312 AS_VIEW_SET_EVENT_MASK, 313 AS_VIEW_SET_MOUSE_EVENT_MASK, 314 315 AS_VIEW_DRAW_STRING, 316 AS_VIEW_SET_CLIP_REGION, 317 AS_VIEW_LINE_ARRAY, 318 AS_VIEW_BEGIN_PICTURE, 319 AS_VIEW_APPEND_TO_PICTURE, 320 AS_VIEW_END_PICTURE, 321 AS_VIEW_COPY_BITS, 322 AS_VIEW_DRAW_PICTURE, 323 AS_VIEW_INVALIDATE_RECT, 324 AS_VIEW_DELAYED_INVALIDATE_RECT, 325 AS_VIEW_INVALIDATE_REGION, 326 AS_VIEW_INVERT_RECT, 327 AS_VIEW_MOVE_TO, 328 AS_VIEW_RESIZE_TO, 329 AS_VIEW_SET_STATE, 330 AS_VIEW_SET_FONT_STATE, 331 AS_VIEW_GET_STATE, 332 AS_VIEW_SET_VIEW_BITMAP, 333 AS_VIEW_SET_PATTERN, 334 AS_SET_CURRENT_VIEW, 335 AS_VIEW_BEGIN_LAYER, 336 AS_VIEW_END_LAYER, 337 338 // BDirectWindow/BWindowScreen codes 339 AS_DIRECT_WINDOW_GET_SYNC_DATA, 340 AS_DIRECT_WINDOW_SET_FULLSCREEN, 341 AS_DIRECT_SCREEN_LOCK, 342 343 // desktop listener communications 344 AS_TALK_TO_DESKTOP_LISTENER, 345 346 // debugging helper 347 AS_DUMP_ALLOCATOR, 348 AS_DUMP_BITMAPS, 349 350 // transformation in addition to origin/scale 351 AS_VIEW_SET_TRANSFORM, 352 AS_VIEW_GET_TRANSFORM, 353 354 AS_VIEW_AFFINE_TRANSLATE, 355 AS_VIEW_AFFINE_SCALE, 356 AS_VIEW_AFFINE_ROTATE, 357 358 // Polygon filling rules 359 AS_VIEW_SET_FILL_RULE, 360 AS_VIEW_GET_FILL_RULE, 361 362 // New clipping: cumulative, transformed 363 AS_VIEW_CLIP_TO_RECT, 364 AS_VIEW_CLIP_TO_SHAPE, 365 366 // Internal messages 367 AS_COLOR_MAP_UPDATED, 368 369 AS_LAST_CODE 370 }; 371 372 // TODO: move this into a private app header, together with the rest of the 373 // private message definitions in AppDefs.h 374 enum { 375 kMsgDeleteServerMemoryArea = '_DSA', 376 }; 377 378 // bitmap allocation flags 379 enum { 380 kAllocator = 0x1, 381 kFramebuffer = 0x2, 382 kHeap = 0x4, 383 kNewAllocatorArea = 0x8, 384 }; 385 386 #endif // APP_SERVER_PROTOCOL_H 387