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() ) if( CFGetTypeID(CFTypeRef(value)) != CFDictionaryGetTypeID() )
return; return;
CFDictionaryRef dict = CFDictionaryRef( value ); CFDictionaryRef properties = CFDictionaryRef( value );
HIDDevice *This = (HIDDevice *)context; HIDDevice *This = (HIDDevice *)context;
CFArrayRef elements; CFArrayRef elements;
CFTypeRef object; CFTypeRef object;
@@ -183,16 +183,16 @@ void HIDDevice::AddLogicalDevice( const void *value, void *context )
CFTypeID numID = CFNumberGetTypeID(); CFTypeID numID = CFNumberGetTypeID();
// Get usage page // Get usage page
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementUsagePageKey) ); object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsagePageKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, usagePage) ) if( !object || CFGetTypeID(object) != numID || !IntValue(object, usagePage) )
return; return;
// Get usage // Get usage
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementUsageKey) ); object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsageKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, usage) ) if( !object || CFGetTypeID(object) != numID || !IntValue(object, usage) )
return; return;
if( !(elements = (CFArrayRef)CFDictionaryGetValue( dict, CFSTR(kIOHIDElementKey))) ) if( !(elements = (CFArrayRef)CFDictionaryGetValue( properties, CFSTR(kIOHIDElementKey))) )
return; return;
if( !This->AddLogicalDevice(usagePage, usage) ) if( !This->AddLogicalDevice(usagePage, usage) )
@@ -208,7 +208,7 @@ void HIDDevice::AddElement( const void *value, void *context )
if( CFGetTypeID(CFTypeRef(value)) != CFDictionaryGetTypeID() ) if( CFGetTypeID(CFTypeRef(value)) != CFDictionaryGetTypeID() )
return; return;
CFDictionaryRef dict = CFDictionaryRef( value ); CFDictionaryRef properties = CFDictionaryRef( value );
HIDDevice *This = (HIDDevice *)context; HIDDevice *This = (HIDDevice *)context;
CFTypeRef object; CFTypeRef object;
CFTypeID numID = CFNumberGetTypeID(); CFTypeID numID = CFNumberGetTypeID();
@@ -216,7 +216,7 @@ void HIDDevice::AddElement( const void *value, void *context )
CFArrayRef elements; CFArrayRef elements;
// Recursively add elements // Recursively add elements
if( (elements = (CFArrayRef)CFDictionaryGetValue(dict, CFSTR(kIOHIDElementKey))) ) if( (elements = (CFArrayRef)CFDictionaryGetValue(properties, CFSTR(kIOHIDElementKey))) )
{ {
CFRange r = { 0, CFArrayGetCount(elements) }; CFRange r = { 0, CFArrayGetCount(elements) };
@@ -224,21 +224,21 @@ void HIDDevice::AddElement( const void *value, void *context )
} }
// Get usage page // Get usage page
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementUsagePageKey) ); object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsagePageKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, usagePage) ) if( !object || CFGetTypeID(object) != numID || !IntValue(object, usagePage) )
return; return;
// Get usage // Get usage
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementUsageKey) ); object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsageKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, usage) ) if( !object || CFGetTypeID(object) != numID || !IntValue(object, usage) )
return; return;
// Get cookie // Get cookie
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementCookieKey) ); object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementCookieKey) );
if( !object || CFGetTypeID(object) != numID || !IntValue(object, cookie) ) if( !object || CFGetTypeID(object) != numID || !IntValue(object, cookie) )
return; 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; 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; CFTypeRef object;
CFTypeID numID = CFNumberGetTypeID(); CFTypeID numID = CFNumberGetTypeID();
@@ -48,11 +48,11 @@ void JoystickDevice::AddElement( int usagePage, int usage, int cookie, const CFD
int iMin = 0; int iMin = 0;
int iMax = 0; int iMax = 0;
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementMinKey) ); object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementMinKey) );
if( object && CFGetTypeID(object) == numID ) if( object && CFGetTypeID(object) == numID )
IntValue( object, iMin ); IntValue( object, iMin );
object = CFDictionaryGetValue( dict, CFSTR(kIOHIDElementMaxKey) ); object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementMaxKey) );
if( object && CFGetTypeID(object) == numID ) if( object && CFGetTypeID(object) == numID )
IntValue( object, iMax ); IntValue( object, iMax );
@@ -23,7 +23,7 @@ private:
protected: protected:
bool AddLogicalDevice( int usagePage, int usage ); 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(); void Open();
public: public:
@@ -8,7 +8,7 @@ bool KeyboardDevice::AddLogicalDevice( int usagePage, int usage )
return usagePage == kHIDPage_GenericDesktop && usage == kHIDUsage_GD_Keyboard; 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 ) if( usagePage != kHIDPage_KeyboardOrKeypad )
return; return;
@@ -11,7 +11,7 @@ private:
protected: protected:
bool AddLogicalDevice( int usagePage, int usage ); 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(); void Open();
public: public: