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