Changeset 14397 in vbox
- Timestamp:
- Nov 20, 2008 11:01:52 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39625
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h
r13580 r14397 302 302 WPARAM wParam, LPARAM lParam); 303 303 #elif defined (Q_WS_MAC) 304 EventHandlerRef mDarwinWindowOverlayHandlerRef; 304 305 # ifndef VBOX_WITH_HACKED_QT 305 306 static pascal OSStatus darwinEventHandlerProc (EventHandlerCallRef inHandlerCallRef, -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h
r13631 r14397 220 220 OSStatus darwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData); 221 221 222 /* Handler for the OpenGL overlay window stuff & the possible messages. */ 223 enum 224 { 225 /* Event classes */ 226 kEventClassVBox = 'vbox', 227 /* Event kinds */ 228 kEventVBoxShowWindow = 'swin', 229 kEventVBoxMoveWindow = 'mwin', 230 kEventVBoxResizeWindow = 'rwin', 231 }; 232 OSStatus darwinOverlayWindowHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData); 233 222 234 # ifdef DEBUG 223 235 void darwinDebugPrintEvent (const char *aPrefix, EventRef aEvent); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp
r14295 r14397 680 680 /* Overlay logo for the dock icon */ 681 681 mVirtualBoxLogo = ::darwinToCGImageRef ("VirtualBox_cube_42px.png"); 682 683 /* Install the event handler which will proceed external window handling */ 684 EventHandlerUPP eventHandler = ::NewEventHandlerUPP (::darwinOverlayWindowHandler); 685 EventTypeSpec eventTypes[] = 686 { 687 { kEventClassVBox, kEventVBoxShowWindow }, 688 { kEventClassVBox, kEventVBoxMoveWindow }, 689 { kEventClassVBox, kEventVBoxResizeWindow } 690 }; 691 692 mDarwinWindowOverlayHandlerRef = NULL; 693 ::InstallApplicationEventHandler (eventHandler, RT_ELEMENTS (eventTypes), &eventTypes[0], 694 this, &mDarwinWindowOverlayHandlerRef); 695 ::DisposeEventHandlerUPP (eventHandler); 682 696 #endif 683 697 … … 855 869 856 870 #ifdef Q_WS_MAC 871 if (mDarwinWindowOverlayHandlerRef) 872 { 873 ::RemoveEventHandler (mDarwinWindowOverlayHandlerRef); 874 mDarwinWindowOverlayHandlerRef = NULL; 875 } 857 876 CGImageRelease (mVirtualBoxLogo); 858 877 #endif -
trunk/src/VBox/Frontends/VirtualBox4/src/darwin/VBoxUtils-darwin.cpp
r12857 r14397 373 373 return status; 374 374 } 375 376 OSStatus darwinOverlayWindowHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData) 377 { 378 if (aInUserData) 379 return ::CallNextEventHandler (aInHandlerCallRef, aInEvent); 380 381 UInt32 eventClass = ::GetEventClass (aInEvent); 382 UInt32 eventKind = ::GetEventKind (aInEvent); 383 /* For debugging events */ 384 /* 385 if (!(eventClass == 'cute')) 386 ::darwinDebugPrintEvent ("view: ", aInEvent); 387 */ 388 QWidget *view = static_cast<QWidget *> (aInUserData); 389 390 if (eventClass == kEventClassVBox) 391 { 392 if (eventKind == kEventVBoxShowWindow) 393 { 394 // printf ("ShowWindow requested\n"); 395 WindowRef w; 396 if (GetEventParameter (aInEvent, kEventParamWindowRef, typeWindowRef, NULL, sizeof (w), NULL, &w) != noErr) 397 return noErr; 398 ShowWindow (w); 399 SelectWindow (w); 400 return noErr; 401 } 402 if (eventKind == kEventVBoxMoveWindow) 403 { 404 // printf ("MoveWindow requested\n"); 405 WindowPtr w; 406 if (GetEventParameter (aInEvent, kEventParamWindowRef, typeWindowRef, NULL, sizeof (w), NULL, &w) != noErr) 407 return noErr; 408 HIPoint p; 409 if (GetEventParameter (aInEvent, kEventParamOrigin, typeHIPoint, NULL, sizeof (p), NULL, &p) != noErr) 410 return noErr; 411 ChangeWindowGroupAttributes (GetWindowGroup (w), 0, kWindowGroupAttrMoveTogether); 412 QPoint p1 = view->mapToGlobal (QPoint (p.x, p.y)); 413 MoveWindow (w, p1.x(), p1.y(), true); 414 ChangeWindowGroupAttributes (GetWindowGroup (w), kWindowGroupAttrMoveTogether, 0); 415 return noErr; 416 } 417 if (eventKind == kEventVBoxResizeWindow) 418 { 419 // printf ("ResizeWindow requested\n"); 420 WindowPtr w; 421 if (GetEventParameter (aInEvent, kEventParamWindowRef, typeWindowRef, NULL, sizeof (w), NULL, &w) != noErr) 422 return noErr; 423 HISize s; 424 if (GetEventParameter (aInEvent, kEventParamDimensions, typeHISize, NULL, sizeof (s), NULL, &s) != noErr) 425 return noErr; 426 SizeWindow (w, s.width, s.height, true); 427 return noErr; 428 } 429 } 430 431 return ::CallNextEventHandler (aInHandlerCallRef, aInEvent); 432 } 433 434 375 435 376 436 /* Event debugging stuff. Borrowed from the Knuts Qt patch. */
Note:
See TracChangeset
for help on using the changeset viewer.