1 /* 2 * Copyright 2007-2016, Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 10 #include "ProfileMessageSupport.h" 11 12 #include <ServerProtocol.h> 13 14 15 void 16 string_for_message_code(uint32 code, BString& string) 17 { 18 string = ""; 19 20 switch (code) { 21 // Return the exact name for each constant 22 #define CODE(x) case x: string = #x; break 23 24 CODE(AS_GET_DESKTOP); 25 CODE(AS_REGISTER_INPUT_SERVER); 26 CODE(AS_EVENT_STREAM_CLOSED); 27 28 // Desktop definitions (through the ServerApp, though) 29 CODE(AS_GET_WINDOW_LIST); 30 CODE(AS_GET_WINDOW_INFO); 31 CODE(AS_MINIMIZE_TEAM); 32 CODE(AS_BRING_TEAM_TO_FRONT); 33 CODE(AS_WINDOW_ACTION); 34 35 // Application definitions 36 CODE(AS_CREATE_APP); 37 CODE(AS_DELETE_APP); 38 CODE(AS_QUIT_APP); 39 CODE(AS_ACTIVATE_APP); 40 CODE(AS_APP_CRASHED); 41 42 CODE(AS_CREATE_WINDOW); 43 CODE(AS_CREATE_OFFSCREEN_WINDOW); 44 CODE(AS_DELETE_WINDOW); 45 CODE(AS_CREATE_BITMAP); 46 CODE(AS_DELETE_BITMAP); 47 CODE(AS_GET_BITMAP_OVERLAY_RESTRICTIONS); 48 49 // Cursor commands 50 CODE(AS_SET_CURSOR); 51 CODE(AS_SET_VIEW_CURSOR); 52 53 CODE(AS_SHOW_CURSOR); 54 CODE(AS_HIDE_CURSOR); 55 CODE(AS_OBSCURE_CURSOR); 56 CODE(AS_QUERY_CURSOR_HIDDEN); 57 58 CODE(AS_CREATE_CURSOR); 59 CODE(AS_REFERENCE_CURSOR); 60 CODE(AS_DELETE_CURSOR); 61 62 CODE(AS_BEGIN_RECT_TRACKING); 63 CODE(AS_END_RECT_TRACKING); 64 65 CODE(AS_GET_CURSOR_POSITION); 66 CODE(AS_GET_CURSOR_BITMAP); 67 68 // Window definitions 69 CODE(AS_SHOW_OR_HIDE_WINDOW); 70 CODE(AS_INTERNAL_HIDE_WINDOW); 71 CODE(AS_MINIMIZE_WINDOW); 72 CODE(AS_QUIT_WINDOW); 73 CODE(AS_SEND_BEHIND); 74 CODE(AS_SET_LOOK); 75 CODE(AS_SET_FEEL); 76 CODE(AS_SET_FLAGS); 77 CODE(AS_DISABLE_UPDATES); 78 CODE(AS_ENABLE_UPDATES); 79 CODE(AS_BEGIN_UPDATE); 80 CODE(AS_END_UPDATE); 81 CODE(AS_NEEDS_UPDATE); 82 CODE(AS_SET_WINDOW_TITLE); 83 CODE(AS_ADD_TO_SUBSET); 84 CODE(AS_REMOVE_FROM_SUBSET); 85 CODE(AS_SET_ALIGNMENT); 86 CODE(AS_GET_ALIGNMENT); 87 CODE(AS_GET_WORKSPACES); 88 CODE(AS_SET_WORKSPACES); 89 CODE(AS_WINDOW_RESIZE); 90 CODE(AS_WINDOW_MOVE); 91 CODE(AS_SET_SIZE_LIMITS); 92 CODE(AS_ACTIVATE_WINDOW); 93 CODE(AS_IS_FRONT_WINDOW); 94 95 // BPicture definitions 96 CODE(AS_CREATE_PICTURE); 97 CODE(AS_DELETE_PICTURE); 98 CODE(AS_CLONE_PICTURE); 99 CODE(AS_DOWNLOAD_PICTURE); 100 101 // Font-related server communications 102 CODE(AS_SET_SYSTEM_FONT); 103 CODE(AS_GET_SYSTEM_FONTS); 104 CODE(AS_GET_SYSTEM_DEFAULT_FONT); 105 106 CODE(AS_GET_FONT_LIST_REVISION); 107 CODE(AS_GET_FAMILY_AND_STYLES); 108 109 CODE(AS_GET_FAMILY_AND_STYLE); 110 CODE(AS_GET_FAMILY_AND_STYLE_IDS); 111 CODE(AS_GET_FONT_BOUNDING_BOX); 112 CODE(AS_GET_TUNED_COUNT); 113 CODE(AS_GET_TUNED_INFO); 114 CODE(AS_GET_FONT_HEIGHT); 115 CODE(AS_GET_FONT_FILE_FORMAT); 116 CODE(AS_GET_EXTRA_FONT_FLAGS); 117 118 CODE(AS_GET_STRING_WIDTHS); 119 CODE(AS_GET_EDGES); 120 CODE(AS_GET_ESCAPEMENTS); 121 CODE(AS_GET_ESCAPEMENTS_AS_FLOATS); 122 CODE(AS_GET_BOUNDINGBOXES_CHARS); 123 CODE(AS_GET_BOUNDINGBOXES_STRING); 124 CODE(AS_GET_BOUNDINGBOXES_STRINGS); 125 CODE(AS_GET_HAS_GLYPHS); 126 CODE(AS_GET_GLYPH_SHAPES); 127 CODE(AS_GET_TRUNCATED_STRINGS); 128 CODE(AS_GET_UNICODE_BLOCKS); 129 CODE(AS_GET_HAS_UNICODE_BLOCK); 130 131 // Screen methods 132 CODE(AS_VALID_SCREEN_ID); 133 CODE(AS_GET_NEXT_SCREEN_ID); 134 CODE(AS_SCREEN_GET_MODE); 135 CODE(AS_SCREEN_SET_MODE); 136 CODE(AS_PROPOSE_MODE); 137 CODE(AS_GET_MODE_LIST); 138 139 CODE(AS_GET_PIXEL_CLOCK_LIMITS); 140 CODE(AS_GET_TIMING_CONSTRAINTS); 141 142 CODE(AS_SCREEN_GET_COLORMAP); 143 CODE(AS_GET_DESKTOP_COLOR); 144 CODE(AS_SET_DESKTOP_COLOR); 145 CODE(AS_GET_SCREEN_ID_FROM_WINDOW); 146 147 CODE(AS_READ_BITMAP); 148 149 CODE(AS_GET_RETRACE_SEMAPHORE); 150 CODE(AS_GET_ACCELERANT_INFO); 151 CODE(AS_GET_MONITOR_INFO); 152 CODE(AS_GET_FRAME_BUFFER_CONFIG); 153 154 CODE(AS_SET_DPMS); 155 CODE(AS_GET_DPMS_STATE); 156 CODE(AS_GET_DPMS_CAPABILITIES); 157 158 CODE(AS_SCREEN_SET_BRIGHTNESS); 159 CODE(AS_SCREEN_GET_BRIGHTNESS); 160 161 // Misc stuff 162 CODE(AS_GET_ACCELERANT_PATH); 163 CODE(AS_GET_DRIVER_PATH); 164 165 // Global function call defs 166 CODE(AS_SET_UI_COLORS); 167 CODE(AS_SET_UI_COLOR); 168 CODE(AS_SET_DECORATOR); 169 CODE(AS_GET_DECORATOR); 170 171 CODE(AS_SET_WORKSPACE_LAYOUT); 172 CODE(AS_GET_WORKSPACE_LAYOUT); 173 CODE(AS_CURRENT_WORKSPACE); 174 CODE(AS_ACTIVATE_WORKSPACE); 175 CODE(AS_GET_SCROLLBAR_INFO); 176 CODE(AS_SET_SCROLLBAR_INFO); 177 CODE(AS_GET_MENU_INFO); 178 CODE(AS_SET_MENU_INFO); 179 CODE(AS_IDLE_TIME); 180 CODE(AS_SET_MOUSE_MODE); 181 CODE(AS_GET_MOUSE_MODE); 182 CODE(AS_SET_FOCUS_FOLLOWS_MOUSE_MODE); 183 CODE(AS_GET_FOCUS_FOLLOWS_MOUSE_MODE); 184 CODE(AS_SET_ACCEPT_FIRST_CLICK); 185 CODE(AS_GET_ACCEPT_FIRST_CLICK); 186 CODE(AS_GET_MOUSE); 187 CODE(AS_SET_DECORATOR_SETTINGS); 188 CODE(AS_GET_DECORATOR_SETTINGS); 189 CODE(AS_GET_SHOW_ALL_DRAGGERS); 190 CODE(AS_SET_SHOW_ALL_DRAGGERS); 191 192 // Subpixel antialiasing & hinting 193 CODE(AS_SET_SUBPIXEL_ANTIALIASING); 194 CODE(AS_GET_SUBPIXEL_ANTIALIASING); 195 CODE(AS_SET_HINTING); 196 CODE(AS_GET_HINTING); 197 CODE(AS_SET_SUBPIXEL_AVERAGE_WEIGHT); 198 CODE(AS_GET_SUBPIXEL_AVERAGE_WEIGHT); 199 CODE(AS_SET_SUBPIXEL_ORDERING); 200 CODE(AS_GET_SUBPIXEL_ORDERING); 201 202 // Graphics calls 203 CODE(AS_SET_HIGH_COLOR); 204 CODE(AS_SET_LOW_COLOR); 205 CODE(AS_SET_VIEW_COLOR); 206 207 CODE(AS_STROKE_ARC); 208 CODE(AS_STROKE_BEZIER); 209 CODE(AS_STROKE_ELLIPSE); 210 CODE(AS_STROKE_LINE); 211 CODE(AS_STROKE_LINEARRAY); 212 CODE(AS_STROKE_POLYGON); 213 CODE(AS_STROKE_RECT); 214 CODE(AS_STROKE_ROUNDRECT); 215 CODE(AS_STROKE_SHAPE); 216 CODE(AS_STROKE_TRIANGLE); 217 218 CODE(AS_FILL_ARC); 219 CODE(AS_FILL_ARC_GRADIENT); 220 CODE(AS_FILL_BEZIER); 221 CODE(AS_FILL_BEZIER_GRADIENT); 222 CODE(AS_FILL_ELLIPSE); 223 CODE(AS_FILL_ELLIPSE_GRADIENT); 224 CODE(AS_FILL_POLYGON); 225 CODE(AS_FILL_POLYGON_GRADIENT); 226 CODE(AS_FILL_RECT); 227 CODE(AS_FILL_RECT_GRADIENT); 228 CODE(AS_FILL_REGION); 229 CODE(AS_FILL_REGION_GRADIENT); 230 CODE(AS_FILL_ROUNDRECT); 231 CODE(AS_FILL_ROUNDRECT_GRADIENT); 232 CODE(AS_FILL_SHAPE); 233 CODE(AS_FILL_SHAPE_GRADIENT); 234 CODE(AS_FILL_TRIANGLE); 235 CODE(AS_FILL_TRIANGLE_GRADIENT); 236 237 CODE(AS_DRAW_STRING); 238 CODE(AS_DRAW_STRING_WITH_DELTA); 239 240 CODE(AS_SYNC); 241 242 CODE(AS_VIEW_CREATE); 243 CODE(AS_VIEW_DELETE); 244 CODE(AS_VIEW_CREATE_ROOT); 245 CODE(AS_VIEW_SHOW); 246 CODE(AS_VIEW_HIDE); 247 CODE(AS_VIEW_MOVE); 248 CODE(AS_VIEW_RESIZE); 249 CODE(AS_VIEW_DRAW); 250 251 // View definitions 252 CODE(AS_VIEW_GET_COORD); 253 CODE(AS_VIEW_SET_FLAGS); 254 CODE(AS_VIEW_SET_ORIGIN); 255 CODE(AS_VIEW_GET_ORIGIN); 256 CODE(AS_VIEW_RESIZE_MODE); 257 CODE(AS_VIEW_BEGIN_RECT_TRACK); 258 CODE(AS_VIEW_END_RECT_TRACK); 259 CODE(AS_VIEW_DRAG_RECT); 260 CODE(AS_VIEW_DRAG_IMAGE); 261 CODE(AS_VIEW_SCROLL); 262 CODE(AS_VIEW_SET_LINE_MODE); 263 CODE(AS_VIEW_GET_LINE_MODE); 264 CODE(AS_VIEW_SET_FILL_RULE); 265 CODE(AS_VIEW_GET_FILL_RULE); 266 CODE(AS_VIEW_PUSH_STATE); 267 CODE(AS_VIEW_POP_STATE); 268 CODE(AS_VIEW_SET_SCALE); 269 CODE(AS_VIEW_GET_SCALE); 270 CODE(AS_VIEW_SET_DRAWING_MODE); 271 CODE(AS_VIEW_GET_DRAWING_MODE); 272 CODE(AS_VIEW_SET_BLENDING_MODE); 273 CODE(AS_VIEW_GET_BLENDING_MODE); 274 CODE(AS_VIEW_SET_PEN_LOC); 275 CODE(AS_VIEW_GET_PEN_LOC); 276 CODE(AS_VIEW_SET_PEN_SIZE); 277 CODE(AS_VIEW_GET_PEN_SIZE); 278 CODE(AS_VIEW_SET_HIGH_COLOR); 279 CODE(AS_VIEW_SET_HIGH_UI_COLOR); 280 CODE(AS_VIEW_SET_LOW_COLOR); 281 CODE(AS_VIEW_SET_LOW_UI_COLOR); 282 CODE(AS_VIEW_SET_VIEW_COLOR); 283 CODE(AS_VIEW_SET_VIEW_UI_COLOR); 284 CODE(AS_VIEW_GET_HIGH_COLOR); 285 CODE(AS_VIEW_GET_HIGH_UI_COLOR); 286 CODE(AS_VIEW_GET_LOW_COLOR); 287 CODE(AS_VIEW_GET_LOW_UI_COLOR); 288 CODE(AS_VIEW_GET_VIEW_COLOR); 289 CODE(AS_VIEW_GET_VIEW_UI_COLOR); 290 CODE(AS_VIEW_PRINT_ALIASING); 291 CODE(AS_VIEW_CLIP_TO_PICTURE); 292 CODE(AS_VIEW_GET_CLIP_REGION); 293 CODE(AS_VIEW_DRAW_BITMAP); 294 CODE(AS_VIEW_SET_EVENT_MASK); 295 CODE(AS_VIEW_SET_MOUSE_EVENT_MASK); 296 297 CODE(AS_VIEW_DRAW_STRING); 298 CODE(AS_VIEW_SET_CLIP_REGION); 299 CODE(AS_VIEW_LINE_ARRAY); 300 CODE(AS_VIEW_BEGIN_PICTURE); 301 CODE(AS_VIEW_APPEND_TO_PICTURE); 302 CODE(AS_VIEW_END_PICTURE); 303 CODE(AS_VIEW_COPY_BITS); 304 CODE(AS_VIEW_DRAW_PICTURE); 305 CODE(AS_VIEW_INVALIDATE_RECT); 306 CODE(AS_VIEW_DELAYED_INVALIDATE_RECT); 307 CODE(AS_VIEW_INVALIDATE_REGION); 308 CODE(AS_VIEW_INVERT_RECT); 309 CODE(AS_VIEW_MOVE_TO); 310 CODE(AS_VIEW_RESIZE_TO); 311 CODE(AS_VIEW_SET_STATE); 312 CODE(AS_VIEW_SET_FONT_STATE); 313 CODE(AS_VIEW_GET_STATE); 314 CODE(AS_VIEW_SET_VIEW_BITMAP); 315 CODE(AS_VIEW_SET_PATTERN); 316 CODE(AS_SET_CURRENT_VIEW); 317 318 // BDirectWindow codes 319 CODE(AS_DIRECT_WINDOW_GET_SYNC_DATA); 320 CODE(AS_DIRECT_WINDOW_SET_FULLSCREEN); 321 322 // Internal messages 323 CODE(AS_COLOR_MAP_UPDATED); 324 325 default: 326 string << "unkown code: " << code; 327 break; 328 } 329 } 330 331 332