git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29424
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
src/mac/carbon/gauge.cpp
src/mac/carbon/gdiobj.cpp
src/mac/carbon/gsockosx.cpp
src/mac/carbon/gauge.cpp
src/mac/carbon/gdiobj.cpp
src/mac/carbon/gsockosx.cpp
src/mac/carbon/icon.cpp
src/mac/carbon/listbox.cpp
src/mac/carbon/mdi.cpp
src/mac/carbon/icon.cpp
src/mac/carbon/listbox.cpp
src/mac/carbon/mdi.cpp
+/////////////////////////////////////////////////////////////////////////////
+// Name: hid.h
+// Purpose: DARWIN HID layer for WX
+// Author: Ryan Norton
+// Modified by:
+// Created: 11/11/2003
+// RCS-ID: $Id$
+// Copyright: (c) Ryan Norton
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#include "wx/defs.h"
+
+#ifdef __DARWIN__
+
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/hid/IOHIDLib.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/hid/IOHIDLib.h>
public:
bool Create();
virtual void BuildCookies(wxCFArray& Array);
public:
bool Create();
virtual void BuildCookies(wxCFArray& Array);
-};
\ No newline at end of file
+};
+
+#endif //__DARWIN__
\ No newline at end of file
+/////////////////////////////////////////////////////////////////////////////
+// Name: hid.cpp
+// Purpose: DARWIN HID layer for WX Implementation
+// Author: Ryan Norton
+// Modified by:
+// Created: 11/11/2003
+// RCS-ID: $Id$
+// Copyright: (c) Ryan Norton
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#include "wx/defs.h"
+
+//DARWIN _ONLY_
+#ifdef __DARWIN__
+
+#include "wx/mac/carbon/private/hid.h"
+#include "wx/string.h"
+#include "wx/log.h"
#define wxFORCECHECK_MSG(arg, msg) \
{\
#define wxFORCECHECK_MSG(arg, msg) \
{\
#define wxKERNCHECK(arg, msg) wxFORCECHECK_MSG(arg != KERN_SUCCESS, msg)
#define wxSCHECK(arg, msg) wxFORCECHECK_MSG(arg != S_OK, msg)
#define wxKERNCHECK(arg, msg) wxFORCECHECK_MSG(arg != KERN_SUCCESS, msg)
#define wxSCHECK(arg, msg) wxFORCECHECK_MSG(arg != S_OK, msg)
+#ifdef __WXDEBUG___
+# define wxVERIFY(arg) wxASSERT(arg)
+#else
+# define wxVERIFY(arg) arg
+#endif
+
+/*
void CFShowTypeIDDescription(CFTypeRef pData)
{
if(!pData)
{
void CFShowTypeIDDescription(CFTypeRef pData)
{
if(!pData)
{
// ============================================================================
// implementation
// ============================================================================
// implementation
//The call to IOServiceMatching filters down the
//the services we want to hid services (and also eats the
//dictionary up for us (consumes one reference))
//The call to IOServiceMatching filters down the
//the services we want to hid services (and also eats the
//dictionary up for us (consumes one reference))
- wxASSERT((pDictionary = IOServiceMatching(kIOHIDDeviceKey)) != NULL );
+ wxVERIFY((pDictionary = IOServiceMatching(kIOHIDDeviceKey)) != NULL );
//Here we'll filter down the services to what we want
if (nType != -1)
//Here we'll filter down the services to what we want
if (nType != -1)
io_object_t pObject;
while ( (pObject = IOIteratorNext(pIterator)) != NULL)
{
io_object_t pObject;
while ( (pObject = IOIteratorNext(pIterator)) != NULL)
{
- wxASSERT(IORegistryEntryCreateCFProperties(pObject, &pDictionary,
+ wxVERIFY(IORegistryEntryCreateCFProperties(pObject, &pDictionary,
kCFAllocatorDefault, kNilOptions) == KERN_SUCCESS);
//Just for sanity :)
kCFAllocatorDefault, kNilOptions) == KERN_SUCCESS);
//Just for sanity :)
- wxASSERT(CFGetTypeID(CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey))) == CFStringGetTypeID());
+ wxVERIFY(CFGetTypeID(CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey))) == CFStringGetTypeID());
//Get [product] name
m_szName = CFStringGetCStringPtr (
//Get [product] name
m_szName = CFStringGetCStringPtr (
wxCFArray CookieArray = CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDElementKey));
BuildCookies(CookieArray);
if (m_ppQueue != NULL)
wxCFArray CookieArray = CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDElementKey));
BuildCookies(CookieArray);
if (m_ppQueue != NULL)
- wxASSERT((*m_ppQueue)->start(m_ppQueue) == S_OK);
+ wxVERIFY((*m_ppQueue)->start(m_ppQueue) == S_OK);
//Create the interface (good grief - long function names!)
SInt32 nScore;
//Create the interface (good grief - long function names!)
SInt32 nScore;
(*ppPlugin)->Release(ppPlugin);
//open the HID interface...
(*ppPlugin)->Release(ppPlugin);
//open the HID interface...
- wxASSERT((*m_ppDevice)->open(m_ppDevice, 0) == S_OK);
+ wxVERIFY((*m_ppDevice)->open(m_ppDevice, 0) == S_OK);
//cleanup
CFRelease(pDictionary);
//cleanup
CFRelease(pDictionary);
void wxHIDDevice::AddCookieInQueue(CFTypeRef Data, const int& i)
{
AddCookie(Data, i);
void wxHIDDevice::AddCookieInQueue(CFTypeRef Data, const int& i)
{
AddCookie(Data, i);
- wxASSERT((*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) == S_OK);//3rd Param flags (none yet)
+ wxVERIFY((*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) == S_OK);//3rd Param flags (none yet)
}
void wxHIDDevice::InitCookies(const size_t& dwSize, bool bQueue)
}
void wxHIDDevice::InitCookies(const size_t& dwSize, bool bQueue)
if (bQueue)
{
wxASSERT( m_ppQueue != NULL);
if (bQueue)
{
wxASSERT( m_ppQueue != NULL);
- wxASSERT( (m_ppQueue = (*m_ppDevice)->allocQueue(m_ppDevice)) != NULL);
- wxASSERT( (*m_ppQueue)->create(m_ppQueue, 0, 512) == S_OK); //Param 2, flags, none yet
+ wxVERIFY( (m_ppQueue = (*m_ppDevice)->allocQueue(m_ppDevice)) != NULL);
+ wxVERIFY( (*m_ppQueue)->create(m_ppQueue, 0, 512) == S_OK); //Param 2, flags, none yet