dict -> properties

This commit is contained in:
Steve Checkoway
2006-02-10 09:21:39 +00:00
parent 7f097a9946
commit dfa720254d
5 changed files with 16 additions and 16 deletions
+10 -10
View File
@@ -175,7 +175,7 @@ void HIDDevice::AddLogicalDevice( const void *value, void *context )
if( CFGetTypeID(CFTypeRef(value)) != CFDictionaryGetTypeID() )
return;
CFDictionaryRef dict = CFDictionaryRef( value );
CFDictionaryRef properties = CFDictionaryRef( value );
HIDDevice *This = (HIDDevice *)context;
CFArrayRef elements;
CFTypeRef object;
@@ -183,16 +183,16 @@ void HIDDevice::AddLogicalDevice( const void *value, void *context )
CFTypeID numID = CFNumberGetTypeID();
// Get usage page
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementUsagePageKey) );
object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsagePageKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, usagePage) )
return;
// Get usage
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementUsageKey) );
object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsageKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, usage) )
return;
if( !(elements = (CFArrayRef)CFDictionaryGetValue( dict, CFSTR(kIOHIDElementKey))) )
if( !(elements = (CFArrayRef)CFDictionaryGetValue( properties, CFSTR(kIOHIDElementKey))) )
return;
if( !This->AddLogicalDevice(usagePage, usage) )
@@ -208,7 +208,7 @@ void HIDDevice::AddElement( const void *value, void *context )
if( CFGetTypeID(CFTypeRef(value)) != CFDictionaryGetTypeID() )
return;
CFDictionaryRef dict = CFDictionaryRef( value );
CFDictionaryRef properties = CFDictionaryRef( value );
HIDDevice *This = (HIDDevice *)context;
CFTypeRef object;
CFTypeID numID = CFNumberGetTypeID();
@@ -216,7 +216,7 @@ void HIDDevice::AddElement( const void *value, void *context )
CFArrayRef elements;
// Recursively add elements
if( (elements = (CFArrayRef)CFDictionaryGetValue(dict, CFSTR(kIOHIDElementKey))) )
if( (elements = (CFArrayRef)CFDictionaryGetValue(properties, CFSTR(kIOHIDElementKey))) )
{
CFRange r = { 0, CFArrayGetCount(elements) };
@@ -224,21 +224,21 @@ void HIDDevice::AddElement( const void *value, void *context )
}
// Get usage page
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementUsagePageKey) );
object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsagePageKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, usagePage) )
return;
// Get usage
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementUsageKey) );
object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsageKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, usage) )
return;
// Get cookie
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementCookieKey) );
object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementCookieKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, cookie) )
return;
This->AddElement( usagePage, usage, cookie, dict );
This->AddElement( usagePage, usage, cookie, properties );
}
/*
@@ -33,7 +33,7 @@ bool JoystickDevice::AddLogicalDevice( int usagePage, int usage )
return true;
}
void JoystickDevice::AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef dict )
void JoystickDevice::AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef properties )
{
CFTypeRef object;
CFTypeID numID = CFNumberGetTypeID();
@@ -48,11 +48,11 @@ void JoystickDevice::AddElement( int usagePage, int usage, int cookie, const CFD
int iMin = 0;
int iMax = 0;
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementMinKey) );
object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementMinKey) );
if( object && CFGetTypeID(object) == numID )
IntValue( object, iMin );
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementMaxKey) );
object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementMaxKey) );
if( object && CFGetTypeID(object) == numID )
IntValue( object, iMax );
@@ -23,7 +23,7 @@ private:
protected:
bool AddLogicalDevice( int usagePage, int usage );
void AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef dict );
void AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef properties );
void Open();
public:
@@ -8,7 +8,7 @@ bool KeyboardDevice::AddLogicalDevice( int usagePage, int usage )
return usagePage == kHIDPage_GenericDesktop && usage == kHIDUsage_GD_Keyboard;
}
void KeyboardDevice::AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef dict )
void KeyboardDevice::AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef properties )
{
if( usagePage != kHIDPage_KeyboardOrKeypad )
return;
@@ -11,7 +11,7 @@ private:
protected:
bool AddLogicalDevice( int usagePage, int usage );
void AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef dict );
void AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef properties );
void Open();
public: