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