X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec8bd3921c6ad85dd8101306d920e19e32541680..05d8deda209e232835c7de64b821f569c9711df8:/src/mac/carbon/hid.cpp diff --git a/src/mac/carbon/hid.cpp b/src/mac/carbon/hid.cpp index 7b337c9340..3dec1a481e 100644 --- a/src/mac/carbon/hid.cpp +++ b/src/mac/carbon/hid.cpp @@ -9,7 +9,24 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#include "wx/defs.h" +// =========================================================================== +// declarations +// =========================================================================== + +// --------------------------------------------------------------------------- +// headers +// --------------------------------------------------------------------------- + +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) +#pragma implementation "hid.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif //DARWIN _ONLY_ #ifdef __DARWIN__ @@ -18,6 +35,11 @@ #include "wx/string.h" #include "wx/log.h" + +// --------------------------------------------------------------------------- +// assertion macros +// --------------------------------------------------------------------------- + #define wxFORCECHECK_MSG(arg, msg) \ {\ if (arg) \ @@ -57,6 +79,9 @@ void CFShowTypeIDDescription(CFTypeRef pData) // implementation // ============================================================================ +// --------------------------------------------------------------------------- +// wxHIDDevice +// --------------------------------------------------------------------------- bool wxHIDDevice::Create (const int& nClass, const int& nType) { @@ -93,17 +118,17 @@ bool wxHIDDevice::Create (const int& nClass, const int& nType) //Now get the maching services io_iterator_t pIterator; wxIOCHECK(IOServiceGetMatchingServices(m_pPort, pDictionary, &pIterator), "No Matching HID Services"); - wxASSERT(pIterator != NULL); + wxASSERT(pIterator != 0); //Now we iterate through them io_object_t pObject; - while ( (pObject = IOIteratorNext(pIterator)) != NULL) + while ( (pObject = IOIteratorNext(pIterator)) != 0) { wxVERIFY(IORegistryEntryCreateCFProperties(pObject, &pDictionary, kCFAllocatorDefault, kNilOptions) == KERN_SUCCESS); //Just for sanity :) - wxVERIFY(CFGetTypeID(CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey))) == CFStringGetTypeID()); + wxASSERT(CFGetTypeID(CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey))) == CFStringGetTypeID()); //Get [product] name m_szName = CFStringGetCStringPtr ( @@ -207,112 +232,11 @@ wxHIDDevice::~wxHIDDevice() } } } -/* -enum -{ - kHIDUsage_KeyboardHyphen = 0x2D, - kHIDUsage_KeyboardEqualSign = 0x2E, - kHIDUsage_KeyboardOpenBracket = 0x2F, - kHIDUsage_KeyboardCloseBracket = 0x30, - kHIDUsage_KeyboardBackslash = 0x31, //* \ or | * - kHIDUsage_KeyboardNonUSPound = 0x32, /* Non-US # or _ * - kHIDUsage_KeyboardSemicolon = 0x33, /* ; or : * - kHIDUsage_KeyboardQuote = 0x34, /* ' or " * - kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, /* Grave Accent and Tilde * - kHIDUsage_KeyboardComma = 0x36, /* , or < * - kHIDUsage_KeyboardPeriod = 0x37, /* . or > * - kHIDUsage_KeyboardSlash = 0x38, /* / or ? * - kHIDUsage_KeyboardCapsLock = 0x39, /* Caps Lock * - - kHIDUsage_KeyboardPrintScreen = 0x46, /* Print Screen * - kHIDUsage_KeyboardScrollLock = 0x47, /* Scroll Lock * - kHIDUsage_KeyboardPause = 0x48, /* Pause * - kHIDUsage_KeyboardInsert = 0x49, /* Insert * - kHIDUsage_KeyboardHome = 0x4A, /* Home * - kHIDUsage_KeyboardDeleteForward = 0x4C, /* Delete Forward * - - kHIDUsage_KeyboardUpArrow - kHIDUsage_KeypadNumLock - kHIDUsage_KeypadSlash - kHIDUsage_KeypadAsterisk - kHIDUsage_KeypadHyphen - kHIDUsage_KeypadPlus - kHIDUsage_KeypadEnter - kHIDUsage_KeypadPeriod - kHIDUsage_KeyboardNonUSBackslash - kHIDUsage_KeyboardApplication - kHIDUsage_KeyboardPower - kHIDUsage_KeypadEqualSign -}; -/* - enum wxKeyCode - { - - WXK_START = 300, - WXK_LBUTTON, - WXK_RBUTTON, - WXK_CANCEL, - WXK_MBUTTON, - WXK_CLEAR, - WXK_SHIFT, - WXK_ALT, - WXK_CONTROL, - WXK_MENU, - WXK_PAUSE, - WXK_PRIOR, * Page up * - WXK_NEXT, * Page down * - WXK_END, - WXK_HOME, - WXK_LEFT, - WXK_UP, - WXK_RIGHT, - WXK_DOWN, - WXK_SELECT, - WXK_PRINT, - WXK_EXECUTE, - WXK_SNAPSHOT, - WXK_INSERT, - WXK_HELP, - WXK_MULTIPLY, - WXK_ADD, - WXK_SEPARATOR, - WXK_SUBTRACT, - WXK_DECIMAL, - WXK_DIVIDE, - WXK_PAGEUP, - WXK_PAGEDOWN, - - WXK_NUMPAD_SPACE, - WXK_NUMPAD_TAB, - WXK_NUMPAD_ENTER, - WXK_NUMPAD_HOME, - WXK_NUMPAD_LEFT, - WXK_NUMPAD_UP, - WXK_NUMPAD_RIGHT, - WXK_NUMPAD_DOWN, - WXK_NUMPAD_PRIOR, - WXK_NUMPAD_PAGEUP, - WXK_NUMPAD_NEXT, - WXK_NUMPAD_PAGEDOWN, - WXK_NUMPAD_END, - WXK_NUMPAD_BEGIN, - WXK_NUMPAD_INSERT, - WXK_NUMPAD_DELETE, - WXK_NUMPAD_EQUAL, - WXK_NUMPAD_MULTIPLY, - WXK_NUMPAD_ADD, - WXK_NUMPAD_SEPARATOR, - WXK_NUMPAD_SUBTRACT, - WXK_NUMPAD_DECIMAL, - WXK_NUMPAD_DIVIDE, - WXK_WINDOWS_LEFT, - WXK_WINDOWS_RIGHT, - WXK_WINDOWS_MENU , - WXK_COMMAND - }; +// --------------------------------------------------------------------------- +// wxHIDKeyboard +// --------------------------------------------------------------------------- - */ enum { WXK_RSHIFT = 400,