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