VirtualBox

Changeset 29921 in vbox for trunk/src


Ignore:
Timestamp:
May 31, 2010 4:49:37 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: more cleanup

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  
    6969# include "DarwinKeyboard.h"
    7070# 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"
    7573#endif
    7674
     
    653651
    654652#elif defined (Q_WS_MAC)
    655 # ifdef QT_MAC_USE_COCOA
    656653/* static */
    657654bool QIHotKeyEdit::darwinEventHandlerProc (const void *pvCocoaEvent, const void *pvCarbonEvent, void *pvUser)
     
    665662}
    666663
    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 */
    682664
    683665bool QIHotKeyEdit::darwinKeyboardEvent (const void *pvCocoaEvent, EventRef inEvent)
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.cpp

    r28800 r29921  
    3131    mCbCheckTrayIcon->hide();
    3232#endif /* VBOX_GUI_WITH_SYSTRAY */
    33 #ifndef QT_MAC_USE_COCOA
    34     mCbCheckPresentationMode->hide();
    35 #endif /* QT_MAC_USE_COCOA */
    3633    if (   mCbCheckTrayIcon->isHidden()
    3734        && mCbCheckPresentationMode->isHidden())
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxToolBar.h

    r28800 r29921  
    2222#include <QGlobalStatic> /* for Q_WS_MAC */
    2323#ifdef Q_WS_MAC
    24 #include "VBoxUtils.h"
     24# include "VBoxUtils.h"
    2525#endif
    2626
     
    6666    {
    6767        if (mMainWindow)
    68         {
    6968            mMainWindow->setUnifiedTitleAndToolBarOnMac (true);
    70 #ifndef QT_MAC_USE_COCOA
    71             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         }
    8369    }
    84 
    85 #ifndef QT_MAC_USE_COCOA
    86     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 */
    10870
    10971    void setShowToolBarButton (bool aShow)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette