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