1 /* 2 * Copyright 2007-2008, 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 case AS_GET_DESKTOP: string = "AS_GET_DESKTOP"; break; 22 case AS_REGISTER_INPUT_SERVER: string = "AS_REGISTER_INPUT_SERVER"; break; 23 case AS_EVENT_STREAM_CLOSED: string = "AS_EVENT_STREAM_CLOSED"; break; 24 25 // Desktop definitions (through the ServerApp, though) 26 case AS_GET_WINDOW_LIST: string = "AS_GET_WINDOW_LIST"; break; 27 case AS_GET_WINDOW_INFO: string = "AS_GET_WINDOW_INFO"; break; 28 case AS_MINIMIZE_TEAM: string = "AS_MINIMIZE_TEAM"; break; 29 case AS_BRING_TEAM_TO_FRONT: string = "AS_BRING_TEAM_TO_FRONT"; break; 30 case AS_WINDOW_ACTION: string = "AS_WINDOW_ACTION"; break; 31 32 // Application definitions 33 case AS_CREATE_APP: string = "AS_CREATE_APP"; break; 34 case AS_DELETE_APP: string = "AS_DELETE_APP"; break; 35 case AS_QUIT_APP: string = "AS_QUIT_APP"; break; 36 case AS_ACTIVATE_APP: string = "AS_ACTIVATE_APP"; break; 37 case AS_APP_CRASHED: string = "AS_APP_CRASHED"; break; 38 39 case AS_CREATE_WINDOW: string = "AS_CREATE_WINDOW"; break; 40 case AS_CREATE_OFFSCREEN_WINDOW: string = "AS_CREATE_OFFSCREEN_WINDOW"; break; 41 case AS_DELETE_WINDOW: string = "AS_DELETE_WINDOW"; break; 42 case AS_CREATE_BITMAP: string = "AS_CREATE_BITMAP"; break; 43 case AS_DELETE_BITMAP: string = "AS_DELETE_BITMAP"; break; 44 case AS_GET_BITMAP_OVERLAY_RESTRICTIONS: string = "AS_GET_BITMAP_OVERLAY_RESTRICTIONS"; break; 45 46 // Cursor commands 47 case AS_SET_CURSOR: string = "AS_SET_CURSOR"; break; 48 49 case AS_SHOW_CURSOR: string = "AS_SHOW_CURSOR"; break; 50 case AS_HIDE_CURSOR: string = "AS_HIDE_CURSOR"; break; 51 case AS_OBSCURE_CURSOR: string = "AS_OBSCURE_CURSOR"; break; 52 case AS_QUERY_CURSOR_HIDDEN: string = "AS_QUERY_CURSOR_HIDDEN"; break; 53 54 case AS_CREATE_CURSOR: string = "AS_CREATE_CURSOR"; break; 55 case AS_DELETE_CURSOR: string = "AS_DELETE_CURSOR"; break; 56 57 case AS_BEGIN_RECT_TRACKING: string = "AS_BEGIN_RECT_TRACKING"; break; 58 case AS_END_RECT_TRACKING: string = "AS_END_RECT_TRACKING"; break; 59 60 // Window definitions 61 case AS_SHOW_WINDOW: string = "AS_SHOW_WINDOW"; break; 62 case AS_HIDE_WINDOW: string = "AS_HIDE_WINDOW"; break; 63 case AS_MINIMIZE_WINDOW: string = "AS_MINIMIZE_WINDOW"; break; 64 case AS_QUIT_WINDOW: string = "AS_QUIT_WINDOW"; break; 65 case AS_SEND_BEHIND: string = "AS_SEND_BEHIND"; break; 66 case AS_SET_LOOK: string = "AS_SET_LOOK"; break; 67 case AS_SET_FEEL: string = "AS_SET_FEEL"; break; 68 case AS_SET_FLAGS: string = "AS_SET_FLAGS"; break; 69 case AS_DISABLE_UPDATES: string = "AS_DISABLE_UPDATES"; break; 70 case AS_ENABLE_UPDATES: string = "AS_ENABLE_UPDATES"; break; 71 case AS_BEGIN_UPDATE: string = "AS_BEGIN_UPDATE"; break; 72 case AS_END_UPDATE: string = "AS_END_UPDATE"; break; 73 case AS_NEEDS_UPDATE: string = "AS_NEEDS_UPDATE"; break; 74 case AS_SET_WINDOW_TITLE: string = "AS_SET_WINDOW_TITLE"; break; 75 case AS_ADD_TO_SUBSET: string = "AS_ADD_TO_SUBSET"; break; 76 case AS_REMOVE_FROM_SUBSET: string = "AS_REMOVE_FROM_SUBSET"; break; 77 case AS_SET_ALIGNMENT: string = "AS_SET_ALIGNMENT"; break; 78 case AS_GET_ALIGNMENT: string = "AS_GET_ALIGNMENT"; break; 79 case AS_GET_WORKSPACES: string = "AS_GET_WORKSPACES"; break; 80 case AS_SET_WORKSPACES: string = "AS_SET_WORKSPACES"; break; 81 case AS_WINDOW_RESIZE: string = "AS_WINDOW_RESIZE"; break; 82 case AS_WINDOW_MOVE: string = "AS_WINDOW_MOVE"; break; 83 case AS_SET_SIZE_LIMITS: string = "AS_SET_SIZE_LIMITS"; break; 84 case AS_ACTIVATE_WINDOW: string = "AS_ACTIVATE_WINDOW"; break; 85 case AS_IS_FRONT_WINDOW: string = "AS_IS_FRONT_WINDOW"; break; 86 87 // BPicture definitions 88 case AS_CREATE_PICTURE: string = "AS_CREATE_PICTURE"; break; 89 case AS_DELETE_PICTURE: string = "AS_DELETE_PICTURE"; break; 90 case AS_CLONE_PICTURE: string = "AS_CLONE_PICTURE"; break; 91 case AS_DOWNLOAD_PICTURE: string = "AS_DOWNLOAD_PICTURE"; break; 92 93 // Font-related server communications 94 case AS_SET_SYSTEM_FONT: string = "AS_SET_SYSTEM_FONT"; break; 95 case AS_GET_SYSTEM_FONTS: string = "AS_GET_SYSTEM_FONTS"; break; 96 case AS_GET_SYSTEM_DEFAULT_FONT: string = "AS_GET_SYSTEM_DEFAULT_FONT"; break; 97 98 case AS_GET_FONT_LIST_REVISION: string = "AS_GET_FONT_LIST_REVISION"; break; 99 case AS_GET_FAMILY_AND_STYLES: string = "AS_GET_FAMILY_AND_STYLES"; break; 100 101 case AS_GET_FAMILY_AND_STYLE: string = "AS_GET_FAMILY_AND_STYLE"; break; 102 case AS_GET_FAMILY_AND_STYLE_IDS: string = "AS_GET_FAMILY_AND_STYLE_IDS"; break; 103 case AS_GET_FONT_BOUNDING_BOX: string = "AS_GET_FONT_BOUNDING_BOX"; break; 104 case AS_GET_TUNED_COUNT: string = "AS_GET_TUNED_COUNT"; break; 105 case AS_GET_TUNED_INFO: string = "AS_GET_TUNED_INFO"; break; 106 case AS_GET_FONT_HEIGHT: string = "AS_GET_FONT_HEIGHT"; break; 107 case AS_GET_FONT_FILE_FORMAT: string = "AS_GET_FONT_FILE_FORMAT"; break; 108 case AS_GET_EXTRA_FONT_FLAGS: string = "AS_GET_EXTRA_FONT_FLAGS"; break; 109 110 case AS_GET_STRING_WIDTHS: string = "AS_GET_STRING_WIDTHS"; break; 111 case AS_GET_EDGES: string = "AS_GET_EDGES"; break; 112 case AS_GET_ESCAPEMENTS: string = "AS_GET_ESCAPEMENTS"; break; 113 case AS_GET_ESCAPEMENTS_AS_FLOATS: string = "AS_GET_ESCAPEMENTS_AS_FLOATS"; break; 114 case AS_GET_BOUNDINGBOXES_CHARS: string = "AS_GET_BOUNDINGBOXES_CHARS"; break; 115 case AS_GET_BOUNDINGBOXES_STRING: string = "AS_GET_BOUNDINGBOXES_STRING"; break; 116 case AS_GET_BOUNDINGBOXES_STRINGS: string = "AS_GET_BOUNDINGBOXES_STRINGS"; break; 117 case AS_GET_HAS_GLYPHS: string = "AS_GET_HAS_GLYPHS"; break; 118 case AS_GET_GLYPH_SHAPES: string = "AS_GET_GLYPH_SHAPES"; break; 119 case AS_GET_TRUNCATED_STRINGS: string = "AS_GET_TRUNCATED_STRINGS"; break; 120 121 // Screen methods 122 case AS_VALID_SCREEN_ID: string = "AS_VALID_SCREEN_ID"; break; 123 case AS_GET_NEXT_SCREEN_ID: string = "AS_GET_NEXT_SCREEN_ID"; break; 124 case AS_SCREEN_GET_MODE: string = "AS_SCREEN_GET_MODE"; break; 125 case AS_SCREEN_SET_MODE: string = "AS_SCREEN_SET_MODE"; break; 126 case AS_PROPOSE_MODE: string = "AS_PROPOSE_MODE"; break; 127 case AS_GET_MODE_LIST: string = "AS_GET_MODE_LIST"; break; 128 129 case AS_GET_PIXEL_CLOCK_LIMITS: string = "AS_GET_PIXEL_CLOCK_LIMITS"; break; 130 case AS_GET_TIMING_CONSTRAINTS: string = "AS_GET_TIMING_CONSTRAINTS"; break; 131 132 case AS_SCREEN_GET_COLORMAP: string = "AS_SCREEN_GET_COLORMAP"; break; 133 case AS_GET_DESKTOP_COLOR: string = "AS_GET_DESKTOP_COLOR"; break; 134 case AS_SET_DESKTOP_COLOR: string = "AS_SET_DESKTOP_COLOR"; break; 135 case AS_GET_SCREEN_ID_FROM_WINDOW: string = "AS_GET_SCREEN_ID_FROM_WINDOW"; break; 136 137 case AS_READ_BITMAP: string = "AS_READ_BITMAP"; break; 138 139 case AS_GET_RETRACE_SEMAPHORE: string = "AS_GET_RETRACE_SEMAPHORE"; break; 140 case AS_GET_ACCELERANT_INFO: string = "AS_GET_ACCELERANT_INFO"; break; 141 case AS_GET_MONITOR_INFO: string = "AS_GET_MONITOR_INFO"; break; 142 case AS_GET_FRAME_BUFFER_CONFIG: string = "AS_GET_FRAME_BUFFER_CONFIG"; break; 143 144 case AS_SET_DPMS: string = "AS_SET_DPMS"; break; 145 case AS_GET_DPMS_STATE: string = "AS_GET_DPMS_STATE"; break; 146 case AS_GET_DPMS_CAPABILITIES: string = "AS_GET_DPMS_CAPABILITIES"; break; 147 148 // Misc stuff 149 case AS_GET_ACCELERANT_PATH: string = "AS_GET_ACCELERANT_PATH"; break; 150 case AS_GET_DRIVER_PATH: string = "AS_GET_DRIVER_PATH"; break; 151 152 // Global function call defs 153 case AS_SET_UI_COLORS: string = "AS_SET_UI_COLORS"; break; 154 case AS_SET_UI_COLOR: string = "AS_SET_UI_COLOR"; break; 155 case AS_SET_DECORATOR: string = "AS_SET_DECORATOR"; break; 156 case AS_GET_DECORATOR: string = "AS_GET_DECORATOR"; break; 157 case AS_R5_SET_DECORATOR: string = "AS_R5_SET_DECORATOR"; break; 158 case AS_COUNT_DECORATORS: string = "AS_COUNT_DECORATORS"; break; 159 case AS_GET_DECORATOR_NAME: string = "AS_GET_DECORATOR_NAME"; break; 160 161 case AS_COUNT_WORKSPACES: string = "AS_COUNT_WORKSPACES"; break; 162 case AS_SET_WORKSPACE_COUNT: string = "AS_SET_WORKSPACE_COUNT"; break; 163 case AS_CURRENT_WORKSPACE: string = "AS_CURRENT_WORKSPACE"; break; 164 case AS_ACTIVATE_WORKSPACE: string = "AS_ACTIVATE_WORKSPACE"; break; 165 case AS_GET_SCROLLBAR_INFO: string = "AS_GET_SCROLLBAR_INFO"; break; 166 case AS_SET_SCROLLBAR_INFO: string = "AS_SET_SCROLLBAR_INFO"; break; 167 case AS_GET_MENU_INFO: string = "AS_GET_MENU_INFO"; break; 168 case AS_SET_MENU_INFO: string = "AS_SET_MENU_INFO"; break; 169 case AS_IDLE_TIME: string = "AS_IDLE_TIME"; break; 170 case AS_SET_MOUSE_MODE: string = "AS_SET_MOUSE_MODE"; break; 171 case AS_GET_MOUSE_MODE: string = "AS_GET_MOUSE_MODE"; break; 172 case AS_GET_MOUSE: string = "AS_GET_MOUSE"; break; 173 case AS_SET_DECORATOR_SETTINGS: string = "AS_SET_DECORATOR_SETTINGS"; break; 174 case AS_GET_DECORATOR_SETTINGS: string = "AS_GET_DECORATOR_SETTINGS"; break; 175 case AS_GET_SHOW_ALL_DRAGGERS: string = "AS_GET_SHOW_ALL_DRAGGERS"; break; 176 case AS_SET_SHOW_ALL_DRAGGERS: string = "AS_SET_SHOW_ALL_DRAGGERS"; break; 177 178 // Graphics calls 179 case AS_SET_HIGH_COLOR: string = "AS_SET_HIGH_COLOR"; break; 180 case AS_SET_LOW_COLOR: string = "AS_SET_LOW_COLOR"; break; 181 case AS_SET_VIEW_COLOR: string = "AS_SET_VIEW_COLOR"; break; 182 183 case AS_STROKE_ARC: string = "AS_STROKE_ARC"; break; 184 case AS_STROKE_BEZIER: string = "AS_STROKE_BEZIER"; break; 185 case AS_STROKE_ELLIPSE: string = "AS_STROKE_ELLIPSE"; break; 186 case AS_STROKE_LINE: string = "AS_STROKE_LINE"; break; 187 case AS_STROKE_LINEARRAY: string = "AS_STROKE_LINEARRAY"; break; 188 case AS_STROKE_POLYGON: string = "AS_STROKE_POLYGON"; break; 189 case AS_STROKE_RECT: string = "AS_STROKE_RECT"; break; 190 case AS_STROKE_ROUNDRECT: string = "AS_STROKE_ROUNDRECT"; break; 191 case AS_STROKE_SHAPE: string = "AS_STROKE_SHAPE"; break; 192 case AS_STROKE_TRIANGLE: string = "AS_STROKE_TRIANGLE"; break; 193 194 case AS_FILL_ARC: string = "AS_FILL_ARC"; break; 195 case AS_FILL_BEZIER: string = "AS_FILL_BEZIER"; break; 196 case AS_FILL_ELLIPSE: string = "AS_FILL_ELLIPSE"; break; 197 case AS_FILL_POLYGON: string = "AS_FILL_POLYGON"; break; 198 case AS_FILL_RECT: string = "AS_FILL_RECT"; break; 199 case AS_FILL_REGION: string = "AS_FILL_REGION"; break; 200 case AS_FILL_ROUNDRECT: string = "AS_FILL_ROUNDRECT"; break; 201 case AS_FILL_SHAPE: string = "AS_FILL_SHAPE"; break; 202 case AS_FILL_TRIANGLE: string = "AS_FILL_TRIANGLE"; break; 203 204 case AS_DRAW_STRING: string = "AS_DRAW_STRING"; break; 205 case AS_DRAW_STRING_WITH_DELTA: string = "AS_DRAW_STRING_WITH_DELTA"; break; 206 207 case AS_SYNC: string = "AS_SYNC"; break; 208 209 case AS_VIEW_CREATE: string = "AS_VIEW_CREATE"; break; 210 case AS_VIEW_DELETE: string = "AS_VIEW_DELETE"; break; 211 case AS_VIEW_CREATE_ROOT: string = "AS_VIEW_CREATE_ROOT"; break; 212 case AS_VIEW_SHOW: string = "AS_VIEW_SHOW"; break; 213 case AS_VIEW_HIDE: string = "AS_VIEW_HIDE"; break; 214 case AS_VIEW_MOVE: string = "AS_VIEW_MOVE"; break; 215 case AS_VIEW_RESIZE: string = "AS_VIEW_RESIZE"; break; 216 case AS_VIEW_DRAW: string = "AS_VIEW_DRAW"; break; 217 218 // View definitions 219 case AS_VIEW_GET_COORD: string = "AS_VIEW_GET_COORD"; break; 220 case AS_VIEW_SET_FLAGS: string = "AS_VIEW_SET_FLAGS"; break; 221 case AS_VIEW_SET_ORIGIN: string = "AS_VIEW_SET_ORIGIN"; break; 222 case AS_VIEW_GET_ORIGIN: string = "AS_VIEW_GET_ORIGIN"; break; 223 case AS_VIEW_RESIZE_MODE: string = "AS_VIEW_RESIZE_MODE"; break; 224 case AS_VIEW_SET_CURSOR: string = "AS_VIEW_SET_CURSOR"; break; 225 case AS_VIEW_BEGIN_RECT_TRACK: string = "AS_VIEW_BEGIN_RECT_TRACK"; break; 226 case AS_VIEW_END_RECT_TRACK: string = "AS_VIEW_END_RECT_TRACK"; break; 227 case AS_VIEW_DRAG_RECT: string = "AS_VIEW_DRAG_RECT"; break; 228 case AS_VIEW_DRAG_IMAGE: string = "AS_VIEW_DRAG_IMAGE"; break; 229 case AS_VIEW_SCROLL: string = "AS_VIEW_SCROLL"; break; 230 case AS_VIEW_SET_LINE_MODE: string = "AS_VIEW_SET_LINE_MODE"; break; 231 case AS_VIEW_GET_LINE_MODE: string = "AS_VIEW_GET_LINE_MODE"; break; 232 case AS_VIEW_PUSH_STATE: string = "AS_VIEW_PUSH_STATE"; break; 233 case AS_VIEW_POP_STATE: string = "AS_VIEW_POP_STATE"; break; 234 case AS_VIEW_SET_SCALE: string = "AS_VIEW_SET_SCALE"; break; 235 case AS_VIEW_GET_SCALE: string = "AS_VIEW_GET_SCALE"; break; 236 case AS_VIEW_SET_DRAWING_MODE: string = "AS_VIEW_SET_DRAWING_MODE"; break; 237 case AS_VIEW_GET_DRAWING_MODE: string = "AS_VIEW_GET_DRAWING_MODE"; break; 238 case AS_VIEW_SET_BLENDING_MODE: string = "AS_VIEW_SET_BLENDING_MODE"; break; 239 case AS_VIEW_GET_BLENDING_MODE: string = "AS_VIEW_GET_BLENDING_MODE"; break; 240 case AS_VIEW_SET_PEN_LOC: string = "AS_VIEW_SET_PEN_LOC"; break; 241 case AS_VIEW_GET_PEN_LOC: string = "AS_VIEW_GET_PEN_LOC"; break; 242 case AS_VIEW_SET_PEN_SIZE: string = "AS_VIEW_SET_PEN_SIZE"; break; 243 case AS_VIEW_GET_PEN_SIZE: string = "AS_VIEW_GET_PEN_SIZE"; break; 244 case AS_VIEW_SET_HIGH_COLOR: string = "AS_VIEW_SET_HIGH_COLOR"; break; 245 case AS_VIEW_SET_LOW_COLOR: string = "AS_VIEW_SET_LOW_COLOR"; break; 246 case AS_VIEW_SET_VIEW_COLOR: string = "AS_VIEW_SET_VIEW_COLOR"; break; 247 case AS_VIEW_GET_HIGH_COLOR: string = "AS_VIEW_GET_HIGH_COLOR"; break; 248 case AS_VIEW_GET_LOW_COLOR: string = "AS_VIEW_GET_LOW_COLOR"; break; 249 case AS_VIEW_GET_VIEW_COLOR: string = "AS_VIEW_GET_VIEW_COLOR"; break; 250 case AS_VIEW_PRINT_ALIASING: string = "AS_VIEW_PRINT_ALIASING"; break; 251 case AS_VIEW_CLIP_TO_PICTURE: string = "AS_VIEW_CLIP_TO_PICTURE"; break; 252 case AS_VIEW_GET_CLIP_REGION: string = "AS_VIEW_GET_CLIP_REGION"; break; 253 case AS_VIEW_DRAW_BITMAP: string = "AS_VIEW_DRAW_BITMAP"; break; 254 case AS_VIEW_SET_EVENT_MASK: string = "AS_VIEW_SET_EVENT_MASK"; break; 255 case AS_VIEW_SET_MOUSE_EVENT_MASK: string = "AS_VIEW_SET_MOUSE_EVENT_MASK"; break; 256 257 case AS_VIEW_DRAW_STRING: string = "AS_VIEW_DRAW_STRING"; break; 258 case AS_VIEW_SET_CLIP_REGION: string = "AS_VIEW_SET_CLIP_REGION"; break; 259 case AS_VIEW_LINE_ARRAY: string = "AS_VIEW_LINE_ARRAY"; break; 260 case AS_VIEW_BEGIN_PICTURE: string = "AS_VIEW_BEGIN_PICTURE"; break; 261 case AS_VIEW_APPEND_TO_PICTURE: string = "AS_VIEW_APPEND_TO_PICTURE"; break; 262 case AS_VIEW_END_PICTURE: string = "AS_VIEW_END_PICTURE"; break; 263 case AS_VIEW_COPY_BITS: string = "AS_VIEW_COPY_BITS"; break; 264 case AS_VIEW_DRAW_PICTURE: string = "AS_VIEW_DRAW_PICTURE"; break; 265 case AS_VIEW_INVALIDATE_RECT: string = "AS_VIEW_INVALIDATE_RECT"; break; 266 case AS_VIEW_INVALIDATE_REGION: string = "AS_VIEW_INVALIDATE_REGION"; break; 267 case AS_VIEW_INVERT_RECT: string = "AS_VIEW_INVERT_RECT"; break; 268 case AS_VIEW_MOVE_TO: string = "AS_VIEW_MOVE_TO"; break; 269 case AS_VIEW_RESIZE_TO: string = "AS_VIEW_RESIZE_TO"; break; 270 case AS_VIEW_SET_STATE: string = "AS_VIEW_SET_STATE"; break; 271 case AS_VIEW_SET_FONT_STATE: string = "AS_VIEW_SET_FONT_STATE"; break; 272 case AS_VIEW_GET_STATE: string = "AS_VIEW_GET_STATE"; break; 273 case AS_VIEW_SET_VIEW_BITMAP: string = "AS_VIEW_SET_VIEW_BITMAP"; break; 274 case AS_VIEW_SET_PATTERN: string = "AS_VIEW_SET_PATTERN"; break; 275 case AS_SET_CURRENT_VIEW: string = "AS_SET_CURRENT_VIEW"; break; 276 277 // BDirectWindow codes 278 case AS_DIRECT_WINDOW_GET_SYNC_DATA: string = "AS_DIRECT_WINDOW_GET_SYNC_DATA"; break; 279 case AS_DIRECT_WINDOW_SET_FULLSCREEN: string = "AS_DIRECT_WINDOW_SET_FULLSCREEN"; break; 280 281 default: 282 string << "unkown code: " << code; 283 break; 284 } 285 } 286 287 288