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