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