- Timestamp:
- May 31, 2010 4:49:37 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIHotKeyEdit.cpp
r29816 r29921 69 69 # include "DarwinKeyboard.h" 70 70 # include <Carbon/Carbon.h> 71 # ifdef QT_MAC_USE_COCOA 72 # include "darwin/VBoxCocoaApplication.h" 73 # include "VBoxUtils.h" 74 # endif 71 # include "darwin/VBoxCocoaApplication.h" 72 # include "VBoxUtils.h" 75 73 #endif 76 74 … … 653 651 654 652 #elif defined (Q_WS_MAC) 655 # ifdef QT_MAC_USE_COCOA656 653 /* static */ 657 654 bool QIHotKeyEdit::darwinEventHandlerProc (const void *pvCocoaEvent, const void *pvCarbonEvent, void *pvUser) … … 665 662 } 666 663 667 # else /* !QT_MAC_USE_COCOA */668 /* static */669 pascal OSStatus QIHotKeyEdit::darwinEventHandlerProc (EventHandlerCallRef inHandlerCallRef,670 EventRef inEvent, void *inUserData)671 {672 QIHotKeyEdit *edit = (QIHotKeyEdit *) inUserData;673 UInt32 EventClass = ::GetEventClass (inEvent);674 if (EventClass == kEventClassKeyboard)675 {676 if (edit->darwinKeyboardEvent (NULL, inEvent))677 return 0;678 }679 return CallNextEventHandler (inHandlerCallRef, inEvent);680 }681 # endif /* !QT_MAC_USE_COCOA */682 664 683 665 bool QIHotKeyEdit::darwinKeyboardEvent (const void *pvCocoaEvent, EventRef inEvent) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.cpp
r28800 r29921 31 31 mCbCheckTrayIcon->hide(); 32 32 #endif /* VBOX_GUI_WITH_SYSTRAY */ 33 #ifndef QT_MAC_USE_COCOA34 mCbCheckPresentationMode->hide();35 #endif /* QT_MAC_USE_COCOA */36 33 if ( mCbCheckTrayIcon->isHidden() 37 34 && mCbCheckPresentationMode->isHidden()) -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxToolBar.h
r28800 r29921 22 22 #include <QGlobalStatic> /* for Q_WS_MAC */ 23 23 #ifdef Q_WS_MAC 24 # include "VBoxUtils.h"24 # include "VBoxUtils.h" 25 25 #endif 26 26 … … 66 66 { 67 67 if (mMainWindow) 68 {69 68 mMainWindow->setUnifiedTitleAndToolBarOnMac (true); 70 #ifndef QT_MAC_USE_COCOA71 WindowRef window = ::darwinToNativeWindow (this);72 EventHandlerUPP eventHandler = ::NewEventHandlerUPP (VBoxToolBar::macEventFilter);73 EventTypeSpec eventTypes[2];74 eventTypes[0].eventClass = kEventClassMouse;75 eventTypes[0].eventKind = kEventMouseDown;76 eventTypes[1].eventClass = kEventClassMouse;77 eventTypes[1].eventKind = kEventMouseUp;78 InstallWindowEventHandler (window, eventHandler,79 RT_ELEMENTS (eventTypes), eventTypes,80 NULL, NULL);81 #endif /* !QT_MAC_USE_COCOA */82 }83 69 } 84 85 #ifndef QT_MAC_USE_COCOA86 static pascal OSStatus macEventFilter (EventHandlerCallRef aNextHandler,87 EventRef aEvent, void * /* aUserData */)88 {89 UInt32 eclass = GetEventClass (aEvent);90 if (eclass == kEventClassMouse)91 {92 WindowPartCode partCode;93 GetEventParameter (aEvent, kEventParamWindowPartCode, typeWindowPartCode, NULL, sizeof (WindowPartCode), NULL, &partCode);94 UInt32 ekind = GetEventKind (aEvent);95 if (partCode == 15 ||96 partCode == 4)97 if(ekind == kEventMouseDown || ekind == kEventMouseUp)98 {99 EventMouseButton button = 0;100 GetEventParameter (aEvent, kEventParamMouseButton, typeMouseButton, NULL, sizeof (button), NULL, &button);101 if (button != kEventMouseButtonPrimary)102 return noErr;103 }104 }105 return CallNextEventHandler (aNextHandler, aEvent);106 }107 #endif /* !QT_MAC_USE_COCOA */108 70 109 71 void setShowToolBarButton (bool aShow)
Note:
See TracChangeset
for help on using the changeset viewer.