Changeset 1339 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 8, 2007 5:13:23 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile
r1317 r1339 135 135 VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT 136 136 VirtualBox_DEFS.win = UNICODE QT_DLL 137 VirtualBox_DEFS.darwin = VBOX_WITH_HACKED_QT 137 138 ifeq ($(BUILD_TYPE),release) 138 139 VirtualBox_DEFS.win += VBOX_GUI_USE_QIMAGE 139 140 VirtualBox_DEFS.linux += VBOX_GUI_USE_SDL 140 VirtualBox_DEFS.darwin += VBOX_GUI_USE_ SDL141 VirtualBox_DEFS.darwin += VBOX_GUI_USE_QIMAGE 141 142 else 142 143 VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h
r1285 r1339 239 239 WPARAM wParam, LPARAM lParam); 240 240 #elif defined (Q_WS_MAC) 241 # ifndef VBOX_WITH_HACKED_QT 241 242 static pascal OSStatus darwinEventHandlerProc (EventHandlerCallRef inHandlerCallRef, 242 243 EventRef inEvent, void *inUserData); 244 # else /* VBOX_WITH_HACKED_QT */ 245 static bool macEventFilter (EventRef inEvent, void *inUserData); 246 # endif /* VBOX_WITH_HACKED_QT */ 243 247 #endif 244 248 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r1320 r1339 80 80 #if defined (Q_WS_MAC) 81 81 # include "DarwinKeyboard.h" 82 # ifdef VBOX_WITH_HACKED_QT 83 # include "QIApplication.h" 84 # endif 82 85 #endif /* defined (Q_WS_MAC) */ 83 86 … … 106 109 #if defined (Q_WS_MAC) 107 110 111 # ifndef VBOX_WITH_HACKED_QT 108 112 /** 109 113 * Event handler callback for Mac OS X. 110 114 */ 111 115 /* static */ 112 pascal OSStatus VBoxConsoleView::darwinEventHandlerProc (EventHandlerCallRef inHandlerCallRef,113 EventRef inEvent, void *inUserData)116 pascal OSStatus VBoxConsoleView::darwinEventHandlerProc (EventHandlerCallRef inHandlerCallRef, 117 EventRef inEvent, void *inUserData) 114 118 { 115 119 VBoxConsoleView *view = (VBoxConsoleView *)inUserData; … … 134 138 return ::CallNextEventHandler (inHandlerCallRef, inEvent); 135 139 } 140 141 # else /* VBOX_WITH_HACKED_QT */ 142 143 /** 144 * Event handler callback for Mac OS X. 145 */ 146 /* static */ 147 bool VBoxConsoleView::macEventFilter (EventRef inEvent, void *inUserData) 148 { 149 VBoxConsoleView *view = (VBoxConsoleView *)inUserData; 150 UInt32 EventClass = ::GetEventClass (inEvent); 151 if (EventClass == kEventClassKeyboard) 152 { 153 if (view->darwinKeyboardEvent (inEvent)) 154 return true; 155 } 156 return false; 157 } 158 # endif /* VBOX_WITH_HACKED_QT */ 136 159 137 160 #endif /* Q_WS_MAC */ … … 1344 1367 1345 1368 /** 1346 * Invoked by VBoxConsoleView::darwinEventHandlerProc when it gets a raw keyboard event. 1369 * Invoked by VBoxConsoleView::darwinEventHandlerProc / VBoxConsoleView::macEventFilter when 1370 * it receives a raw keyboard event. 1347 1371 * 1348 1372 * @param inEvent The keyboard event. … … 1401 1425 newMask = ::DarwinAdjustModifierMask (newMask); 1402 1426 UInt32 changed = newMask ^ m_darwinKeyModifiers; 1427 ret = kbd_captured; 1403 1428 if (changed) 1404 1429 { … … 1419 1444 scanCode &= ~0x80; 1420 1445 } 1421 keyEvent (keyCode, scanCode, flags);1446 ret |= keyEvent (keyCode, scanCode, flags); 1422 1447 } 1423 1448 } 1424 1449 1425 1450 m_darwinKeyModifiers = newMask; 1426 1427 ret = kbd_captured; //??1428 1451 } 1429 1452 … … 1443 1466 ::SetMouseCoalescingEnabled (false, NULL); //?? 1444 1467 ::CGSetLocalEventsSuppressionInterval (0.0); //?? 1468 1469 #ifndef VBOX_WITH_HACKED_QT 1445 1470 1446 1471 EventTypeSpec eventTypes[6]; … … 1454 1479 eventTypes[3].eventKind = kEventRawKeyModifiersChanged; 1455 1480 /* For ignorning Command-H and Command-Q which aren't affected by the 1456 * global hotkey stuff : */1481 * global hotkey stuff (doesn't work well): */ 1457 1482 eventTypes[4].eventClass = kEventClassCommand; 1458 1483 eventTypes[4].eventKind = kEventCommandProcess; … … 1467 1492 ::DisposeEventHandlerUPP (eventHandler); 1468 1493 1494 #else /* VBOX_WITH_HACKED_QT */ 1495 ((QIApplication *)qApp)->setEventFilter (VBoxConsoleView::macEventFilter, this); 1496 #endif /* VBOX_WITH_HACKED_QT */ 1497 1469 1498 ::DarwinGrabKeyboard (false); 1470 1499 } … … 1477 1506 m_darwinEventHandlerRef = NULL; 1478 1507 } 1508 #ifdef VBOX_WITH_HACKED_QT 1509 ((QIApplication *)qApp)->setEventFilter (NULL, NULL); 1510 #endif 1479 1511 } 1480 1512 } -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r967 r1339 24 24 #include "VBoxSelectorWnd.h" 25 25 #include "VBoxConsoleWnd.h" 26 #ifdef Q_WS_MAC 27 # include "QIApplication.h" 28 #else 29 # define QIApplication 30 #endif 26 31 27 32 #include <qmessagebox.h> … … 136 141 /** @todo automatically start VBoxSVC. */ 137 142 } 138 #endif 143 144 #endif 145 139 146 140 147 int main( int argc, char ** argv ) … … 162 169 qInstallMsgHandler (QtMessageOutput); 163 170 164 Q Application a (argc, argv);171 QIApplication a (argc, argv); 165 172 166 173 #ifdef Q_WS_X11
Note:
See TracChangeset
for help on using the changeset viewer.