Changeset 8733 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 9, 2008 8:39:56 AM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h
r8155 r8733 277 277 OSStatus darwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData); 278 278 279 # ifdef DEBUG 280 void darwinDebugPrintEvent (const char *aPrefix, EventRef aEvent); 281 # endif 279 282 #endif /* Q_WS_MAC */ 280 283 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp
r8717 r8733 115 115 EventRef inEvent, void *inUserData) 116 116 { 117 VBoxConsoleView *view = (VBoxConsoleView *)inUserData; 118 UInt32 EventClass = ::GetEventClass (inEvent); 119 if (EventClass == kEventClassKeyboard) 117 VBoxConsoleView *view = static_cast<VBoxConsoleView *> (inUserData); 118 UInt32 eventClass = ::GetEventClass (inEvent); 119 UInt32 eventKind = ::GetEventKind (inEvent); 120 /* For debugging events */ 121 /* 122 if (!(eventClass == 'cute')) 123 ::darwinDebugPrintEvent ("view: ", inEvent); 124 */ 125 126 /* Not sure but this seems an triggered event if the spotlight searchbar is 127 * displayed. So flag that the host key isn't pressed alone. */ 128 if (eventClass == 'cgs ' && eventKind == 0x15 && 129 view->mIsHostkeyPressed) 130 view->mIsHostkeyAlone = false; 131 132 if (eventClass == kEventClassKeyboard) 120 133 { 121 134 if (view->darwinKeyboardEvent (inEvent)) … … 129 142 * get any key down/up events, so these combinations are dead to the guest... 130 143 */ 131 else if ( EventClass == kEventClassCommand)144 else if (eventClass == kEventClassCommand) 132 145 { 133 146 if (view->mKbdCaptured) … … 145 158 bool VBoxConsoleView::macEventFilter (EventRef inEvent, void *inUserData) 146 159 { 147 VBoxConsoleView *view = (VBoxConsoleView *)inUserData; 148 UInt32 EventClass = ::GetEventClass (inEvent); 149 if (EventClass == kEventClassKeyboard) 160 VBoxConsoleView *view = static_cast<VBoxConsoleView *> (inUserData); 161 UInt32 eventClass = ::GetEventClass (inEvent); 162 UInt32 eventKind = ::GetEventKind (inEvent); 163 164 /* For debugging events */ 165 /* 166 if (!(eventClass == 'cute')) 167 ::darwinDebugPrintEvent ("view: ", inEvent); 168 */ 169 170 /* Not sure but this seems an triggered event if the spotlight searchbar is 171 * displayed. So flag that the host key isn't pressed alone. */ 172 if (eventClass == 'cgs ' && eventKind == 0x15 && 173 view->mIsHostkeyPressed) 174 view->mIsHostkeyAlone = false; 175 176 if (eventClass == kEventClassKeyboard) 150 177 { 151 178 if (view->darwinKeyboardEvent (inEvent)) -
trunk/src/VBox/Frontends/VirtualBox4/src/darwin/VBoxUtils-darwin.cpp
r8155 r8733 293 293 } 294 294 295 /* Event debugging stuff. Borrowed from the Knuts Qt patch. */ 296 #ifdef DEBUG 297 298 # define MY_CASE(a) case a: return #a 299 const char * DarwinDebugEventName (UInt32 ekind) 300 { 301 switch (ekind) 302 { 303 MY_CASE(kEventWindowUpdate ); 304 MY_CASE(kEventWindowDrawContent ); 305 MY_CASE(kEventWindowActivated ); 306 MY_CASE(kEventWindowDeactivated ); 307 MY_CASE(kEventWindowHandleActivate ); 308 MY_CASE(kEventWindowHandleDeactivate ); 309 MY_CASE(kEventWindowGetClickActivation ); 310 MY_CASE(kEventWindowGetClickModality ); 311 MY_CASE(kEventWindowShowing ); 312 MY_CASE(kEventWindowHiding ); 313 MY_CASE(kEventWindowShown ); 314 MY_CASE(kEventWindowHidden ); 315 MY_CASE(kEventWindowCollapsing ); 316 MY_CASE(kEventWindowCollapsed ); 317 MY_CASE(kEventWindowExpanding ); 318 MY_CASE(kEventWindowExpanded ); 319 MY_CASE(kEventWindowZoomed ); 320 MY_CASE(kEventWindowBoundsChanging ); 321 MY_CASE(kEventWindowBoundsChanged ); 322 MY_CASE(kEventWindowResizeStarted ); 323 MY_CASE(kEventWindowResizeCompleted ); 324 MY_CASE(kEventWindowDragStarted ); 325 MY_CASE(kEventWindowDragCompleted ); 326 MY_CASE(kEventWindowClosed ); 327 MY_CASE(kEventWindowTransitionStarted ); 328 MY_CASE(kEventWindowTransitionCompleted ); 329 MY_CASE(kEventWindowClickDragRgn ); 330 MY_CASE(kEventWindowClickResizeRgn ); 331 MY_CASE(kEventWindowClickCollapseRgn ); 332 MY_CASE(kEventWindowClickCloseRgn ); 333 MY_CASE(kEventWindowClickZoomRgn ); 334 MY_CASE(kEventWindowClickContentRgn ); 335 MY_CASE(kEventWindowClickProxyIconRgn ); 336 MY_CASE(kEventWindowClickToolbarButtonRgn ); 337 MY_CASE(kEventWindowClickStructureRgn ); 338 MY_CASE(kEventWindowCursorChange ); 339 MY_CASE(kEventWindowCollapse ); 340 MY_CASE(kEventWindowCollapseAll ); 341 MY_CASE(kEventWindowExpand ); 342 MY_CASE(kEventWindowExpandAll ); 343 MY_CASE(kEventWindowClose ); 344 MY_CASE(kEventWindowCloseAll ); 345 MY_CASE(kEventWindowZoom ); 346 MY_CASE(kEventWindowZoomAll ); 347 MY_CASE(kEventWindowContextualMenuSelect ); 348 MY_CASE(kEventWindowPathSelect ); 349 MY_CASE(kEventWindowGetIdealSize ); 350 MY_CASE(kEventWindowGetMinimumSize ); 351 MY_CASE(kEventWindowGetMaximumSize ); 352 MY_CASE(kEventWindowConstrain ); 353 MY_CASE(kEventWindowHandleContentClick ); 354 MY_CASE(kEventWindowGetDockTileMenu ); 355 MY_CASE(kEventWindowProxyBeginDrag ); 356 MY_CASE(kEventWindowProxyEndDrag ); 357 MY_CASE(kEventWindowToolbarSwitchMode ); 358 MY_CASE(kEventWindowFocusAcquired ); 359 MY_CASE(kEventWindowFocusRelinquish ); 360 MY_CASE(kEventWindowFocusContent ); 361 MY_CASE(kEventWindowFocusToolbar ); 362 MY_CASE(kEventWindowFocusDrawer ); 363 MY_CASE(kEventWindowSheetOpening ); 364 MY_CASE(kEventWindowSheetOpened ); 365 MY_CASE(kEventWindowSheetClosing ); 366 MY_CASE(kEventWindowSheetClosed ); 367 MY_CASE(kEventWindowDrawerOpening ); 368 MY_CASE(kEventWindowDrawerOpened ); 369 MY_CASE(kEventWindowDrawerClosing ); 370 MY_CASE(kEventWindowDrawerClosed ); 371 MY_CASE(kEventWindowDrawFrame ); 372 MY_CASE(kEventWindowDrawPart ); 373 MY_CASE(kEventWindowGetRegion ); 374 MY_CASE(kEventWindowHitTest ); 375 MY_CASE(kEventWindowInit ); 376 MY_CASE(kEventWindowDispose ); 377 MY_CASE(kEventWindowDragHilite ); 378 MY_CASE(kEventWindowModified ); 379 MY_CASE(kEventWindowSetupProxyDragImage ); 380 MY_CASE(kEventWindowStateChanged ); 381 MY_CASE(kEventWindowMeasureTitle ); 382 MY_CASE(kEventWindowDrawGrowBox ); 383 MY_CASE(kEventWindowGetGrowImageRegion ); 384 MY_CASE(kEventWindowPaint ); 385 } 386 static char s_sz[64]; 387 sprintf(s_sz, "kind=%u", (uint)ekind); 388 return s_sz; 389 } 390 # undef MY_CASE 391 392 /* Convert a class into the 4 char code defined in 393 * 'Developer/Headers/CFMCarbon/CarbonEvents.h' to 394 * identify the event. */ 395 const char * darwinDebugClassName (UInt32 eclass) 396 { 397 char *pclass = (char*)&eclass; 398 static char s_sz[11]; 399 sprintf(s_sz, "class=%c%c%c%c", pclass[3], 400 pclass[2], 401 pclass[1], 402 pclass[0]); 403 return s_sz; 404 } 405 406 void darwinDebugPrintEvent (const char *psz, EventRef event) 407 { 408 if (!event) 409 return; 410 UInt32 ekind = GetEventKind (event), eclass = GetEventClass (event); 411 if (eclass == kEventClassWindow) 412 { 413 switch (ekind) 414 { 415 case kEventWindowDrawContent: 416 case kEventWindowUpdate: 417 case kEventWindowBoundsChanged: 418 break; 419 default: 420 { 421 WindowRef wid = NULL; 422 GetEventParameter(event, kEventParamDirectObject, typeWindowRef, NULL, sizeof(WindowRef), NULL, &wid); 423 QWidget *widget = QWidget::find((WId)wid); 424 printf("%d %s: (%s) %#x win=%p wid=%p (%s)\n", (int)time(NULL), psz, darwinDebugClassName (eclass), (uint)ekind, wid, widget, DarwinDebugEventName (ekind)); 425 break; 426 } 427 } 428 } 429 else if (eclass == kEventClassCommand) 430 { 431 WindowRef wid = NULL; 432 GetEventParameter(event, kEventParamDirectObject, typeWindowRef, NULL, sizeof(WindowRef), NULL, &wid); 433 QWidget *widget = QWidget::find((WId)wid); 434 const char *name = "Unknown"; 435 switch (ekind) 436 { 437 case kEventCommandProcess: 438 name = "kEventCommandProcess"; 439 break; 440 case kEventCommandUpdateStatus: 441 name = "kEventCommandUpdateStatus"; 442 break; 443 } 444 printf("%d %s: (%s) %#x win=%p wid=%p (%s)\n", (int)time(NULL), psz, darwinDebugClassName (eclass), (uint)ekind, wid, widget, name); 445 } 446 else if (eclass == kEventClassKeyboard) 447 printf("%d %s: %#x(%s) %#x (kEventClassKeyboard)\n", (int)time(NULL), psz, (uint)eclass, darwinDebugClassName (eclass), (uint)ekind); 448 449 else 450 printf("%d %s: %#x(%s) %#x\n", (int)time(NULL), psz, (uint)eclass, darwinDebugClassName (eclass), (uint)ekind); 451 } 452 453 #endif /* DEBUG */
Note:
See TracChangeset
for help on using the changeset viewer.