儲存庫 vbox 的更動 49779
- 時間撮記:
- 2013-12-4 下午05:20:25 (11 年 以前)
- 位置:
- trunk
- 檔案:
-
- 修改 10 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/include/VBox/usblib-darwin.h
r44529 r49779 5 5 6 6 /* 7 * Copyright (C) 2007-201 0Oracle Corporation7 * Copyright (C) 2007-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 50 50 /** @} */ 51 51 52 USBLIB_DECL(void) USBLibResumeBuiltInKeyboard(void); 53 52 54 /** @} */ 53 55 RT_C_DECLS_END -
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r49596 r49779 183 183 # Necessary for the hdd backend enumeration 184 184 VirtualBox_LIBS = $(LIB_DDU) 185 186 # Necessary for the HID LEDs sync 187 VirtualBox_LIBS.darwin += $(PATH_OUT)/lib/USBLib.a 185 188 186 189 if1of ($(KBUILD_TARGET), linux freebsd netbsd openbsd) … … 1098 1101 tstDarwinKeyboard_LIBS = \ 1099 1102 $(LIB_RUNTIME) 1103 tstDarwinKeyboard_LIBS.darwin += $(PATH_OUT)/lib/USBLib.a 1104 1100 1105 endif 1101 1106 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp
r49698 r49779 79 79 const char* UIDefs::GUI_DefaultCloseAction = "GUI/DefaultCloseAction"; 80 80 const char* UIDefs::GUI_RestrictedStatusBarIndicators = "GUI/RestrictedStatusBarIndicators"; 81 const char* UIDefs::GUI_HidLedsSync = "GUI/HidLedsSync"; 81 82 82 83 /* Settings dialogs stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r49698 r49779 148 148 extern const char* GUI_DefaultCloseAction; 149 149 extern const char* GUI_RestrictedStatusBarIndicators; 150 extern const char* GUI_HidLedsSync; 150 151 151 152 /* Settings dialogs stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp
r49601 r49779 24 24 25 25 #define VBOX_WITH_KBD_LEDS_SYNC 26 //#define VBOX_WITH_KBD_SCROLL_LED_SYNC27 26 //#define VBOX_WITHOUT_KBD_LEDS_SYNC_FILTERING 28 27 … … 40 39 # include <iprt/err.h> 41 40 # include <iprt/semaphore.h> 41 # include <VBox/usblib.h> 42 42 #endif 43 43 … … 1270 1270 IOReturn rc = kIOReturnError; 1271 1271 1272 USBLibResumeBuiltInKeyboard(); 1273 1272 1274 valueRef = IOHIDValueCreateWithIntegerValue(kCFAllocatorDefault, element, 0, (fEnabled) ? 1 : 0); 1273 1275 if (valueRef) … … 1291 1293 IOReturn rc; 1292 1294 CFIndex integerValue; 1295 1296 USBLibResumeBuiltInKeyboard(); 1293 1297 1294 1298 rc = IOHIDDeviceGetValue(hidDevice, element, &valueRef); … … 1342 1346 rc = darwinLedElementSetValue(hidDevice, element, fCapsLockOn); 1343 1347 break; 1344 #ifdef VBOX_WITH_KBD_SCROLL_LED_SYNC1345 1348 case kHIDUsage_LED_ScrollLock: 1346 1349 rc = darwinLedElementSetValue(hidDevice, element, fScrollLockOn); 1347 1350 break; 1348 #endif1349 1351 } 1350 1352 if (rc != 0) … … 1389 1391 rc = darwinLedElementGetValue(hidDevice, element, fCapsLockOn); 1390 1392 break; 1391 #ifdef VBOX_WITH_KBD_SCROLL_LED_SYNC1392 1393 case kHIDUsage_LED_ScrollLock: 1393 1394 rc = darwinLedElementGetValue(hidDevice, element, fScrollLockOn); 1394 1395 break; 1395 #endif1396 1396 } 1397 1397 if (rc != 0) … … 1456 1456 { 1457 1457 if (productId == 0x8001) /* GK-04008/C keyboard */ 1458 fSupported = false;1459 }1460 else if (vendorId == 0x05AC) /* Apple */1461 {1462 if (productId == 0x0263) /* Apple Internal Keyboard */1463 1458 fSupported = false; 1464 1459 } … … 1920 1915 VBoxHidsState_t *pHidState; 1921 1916 1917 USBLibInit(); 1918 1922 1919 pHidState = (VBoxHidsState_t *)malloc(sizeof(VBoxHidsState_t)); 1923 1920 AssertReturn(pHidState, NULL); … … 2061 2058 free(pHidState); 2062 2059 2060 USBLibTerm(); 2061 2063 2062 return rc2; 2064 2063 #else /* !VBOX_WITH_KBD_LEDS_SYNC */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r49596 r49779 511 511 /* Here we have to update host LED lock states using values provided by UISession: 512 512 * [bool] uisession() -> isNumLock(), isCapsLock(), isScrollLock() can be used for that. */ 513 LogRelFlow(("UIMachineLogic::sltKeyboardLedsChanged: Updating host LED lock states (NOT IMPLEMENTED).\n")); 513 514 if (!isHidLedsSyncEnabled()) 515 return; 516 514 517 #ifdef Q_WS_MAC 518 LogRelFlow(("UIMachineLogic::sltKeyboardLedsChanged: Updating host LED lock states.\n")); 515 519 DarwinHidDevicesBroadcastLeds(m_pHostLedsState, uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock()); 516 520 #endif … … 672 676 pAction->setText(gpConverter->toString(pAction->data().value<KDragAndDropMode>())); 673 677 } 678 } 679 680 bool UIMachineLogic::isHidLedsSyncEnabled() 681 { 682 QString strHidLedsSyncSettings = session().GetMachine().GetExtraData(GUI_HidLedsSync); 683 if (strHidLedsSyncSettings == "1") 684 return true; 685 return false; 674 686 } 675 687 … … 2304 2316 * [bool] uisession() -> isNumLock(), isCapsLock(), isScrollLock() can be used for that. */ 2305 2317 2306 LogRelFlow(("UIMachineLogic::sltSwitchKeyboardLedsToGuestLeds: keep host LED lock states and broadcast guest's ones (NOT IMPLEMENTED).\n")); 2318 if (!isHidLedsSyncEnabled()) 2319 return; 2320 2307 2321 #ifdef Q_WS_MAC 2322 LogRelFlow(("UIMachineLogic::sltSwitchKeyboardLedsToGuestLeds: keep host LED lock states and broadcast guest's ones.\n")); 2308 2323 if (m_pHostLedsState == NULL) 2309 2324 m_pHostLedsState = DarwinHidDevicesKeepLedsState(); … … 2320 2335 // session().GetMachine().GetName().toAscii().constData()); 2321 2336 2322 LogRelFlow(("UIMachineLogic::sltSwitchKeyboardLedsToPreviousLeds: restore host LED lock states (NOT IMPLEMENTED).\n")); 2337 if (!isHidLedsSyncEnabled()) 2338 return; 2323 2339 2324 2340 /* Here we have to restore host LED lock states. */ 2325 2341 #ifdef Q_WS_MAC 2342 LogRelFlow(("UIMachineLogic::sltSwitchKeyboardLedsToPreviousLeds: restore host LED lock states.\n")); 2343 2326 2344 if (m_pHostLedsState) 2327 2345 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r49506 r49779 133 133 void addMachineWindow(UIMachineWindow *pMachineWindow); 134 134 void retranslateUi(); 135 bool isHidLedsSyncEnabled(); 135 136 #ifdef Q_WS_MAC 136 137 bool isDockIconPreviewEnabled() const { return m_fIsDockIconEnabled; } -
trunk/src/VBox/HostDrivers/VBoxUSB/darwin/USBLib-darwin.cpp
r44529 r49779 5 5 6 6 /* 7 * Copyright (C) 2007-201 0Oracle Corporation7 * Copyright (C) 2007-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 190 190 } 191 191 192 USBLIB_DECL(void) USBLibResumeBuiltInKeyboard(void) 193 { 194 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 195 kern_return_t kr = IOConnectMethodStructureIStructureO(g_Connection, 196 VBOXUSBMETHOD_RESUME_BUILTIN_KBD, 197 0, 198 NULL, 199 NULL, 200 NULL); 201 #else /* 10.5 and later */ 202 kern_return_t kr = IOConnectCallStructMethod(g_Connection, 203 VBOXUSBMETHOD_RESUME_BUILTIN_KBD, 204 NULL, 0, 205 NULL, NULL); 206 #endif /* 10.5 and later */ 207 AssertMsg(kr == kIOReturnSuccess, ("kr=%#x\n", kr)); 208 NOREF(kr); 209 } -
trunk/src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSB.cpp
r44528 r49779 9 9 10 10 /* 11 * Copyright (C) 2006-201 0Oracle Corporation11 * Copyright (C) 2006-2013 Oracle Corporation 12 12 * 13 13 * This file is part of VirtualBox Open Source Edition (OSE), as … … 60 60 #include <IOKit/usb/IOUSBInterface.h> 61 61 #include <IOKit/usb/IOUSBUserClient.h> 62 #include <IOKit/usb/IOUSBHIDDriver.h> 62 63 63 64 /* private: */ … … 140 141 IOReturn addFilter(PUSBFILTER pFilter, PVBOXUSBADDFILTEROUT pOut, IOByteCount cbFilter, IOByteCount *pcbOut); 141 142 IOReturn removeFilter(uintptr_t *puId, int *prc, IOByteCount cbIn, IOByteCount *pcbOut); 143 IOReturn resumeBuiltInKbd(void *unused1, void *unused2, IOByteCount unused3, IOByteCount *unused4, void *unused5, void *unused6); 142 144 /** @} */ 143 145 … … 788 790 sizeof(int) /* count1 - size of the output (rc) */ 789 791 }, 792 /* [VBOXUSBMETHOD_RESUME_BUILTIN_KBD] = */ 793 { 794 (IOService *)0, /* object */ 795 (IOMethod)&org_virtualbox_VBoxUSBClient::resumeBuiltInKbd, /* func */ 796 kIOUCScalarIScalarO, /* flags - scalar input (count0) and scalar output (count1) */ 797 0, /* count0 - # of input parameters */ 798 0 /* count1 - # of output parameters */ 799 }, 790 800 }; 791 801 … … 893 903 } 894 904 905 IOReturn 906 org_virtualbox_VBoxUSBClient::resumeBuiltInKbd(void *unused1, void *unused2, IOByteCount unused3, IOByteCount *unused4, void *unused5, void *unused6) 907 { 908 (void)unused1; 909 (void)unused2; 910 (void)unused3; 911 (void)unused4; 912 (void)unused5; 913 (void)unused6; 914 915 OSDictionary *pDictionary; 916 917 VBOXUSB_LOCK(); 918 919 pDictionary = IOService::serviceMatching("AppleUSBTCKeyboard"); 920 if (pDictionary) 921 { 922 OSIterator *pIter; 923 IOUSBHIDDriver *pDriver; 924 925 pIter = IOService::getMatchingServices(pDictionary); 926 if (pIter) 927 { 928 while ((pDriver = (IOUSBHIDDriver *)pIter->getNextObject())) 929 pDriver->SuspendPort(false, 0); 930 931 pIter->release(); 932 } 933 934 pDictionary->release(); 935 } 936 937 VBOXUSB_UNLOCK(); 938 939 return kIOReturnSuccess; 940 } 895 941 896 942 /** -
trunk/src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSBInterface.h
r44529 r49779 5 5 6 6 /* 7 * Copyright (C) 2007-201 0Oracle Corporation7 * Copyright (C) 2007-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 30 30 /** org_virtualbox_VBoxUSBClient::removeFilter */ 31 31 VBOXUSBMETHOD_REMOVE_FILTER, 32 /** org_virtualbox_VBoxUSBClient::resumeBuiltInKbd */ 33 VBOXUSBMETHOD_RESUME_BUILTIN_KBD, 32 34 /** End/max. */ 33 35 VBOXUSBMETHOD_END
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器