void availabilityUpdateCallback( CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { CFNumberRef number = (CFNumberRef)CFDictionaryGetValue(userInfo, CFSTR("SKYPE_API_AVAILABILITY")); isavailable = CFNumberToCInt(number); }
void attachResponseCallback( CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { CFNumberRef responseNumber = (CFNumberRef)CFDictionaryGetValue(userInfo, CFSTR("SKYPE_API_ATTACH_RESPONSE")); int response = CFNumberToCInt(responseNumber); client_id = response; if (delegate && delegate->SkypeAttachResponse) { delegate->SkypeAttachResponse(response?1:0); } }
void apiNotificationCallback( CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { CFNumberRef number = (CFNumberRef) CFDictionaryGetValue(userInfo, CFSTR("SKYPE_API_CLIENT_ID")); int client_number = CFNumberToCInt(number); if (client_number != 999 && (!client_id || client_id != client_number)) { return; } CFStringRef string = (CFStringRef) CFDictionaryGetValue(userInfo, CFSTR("SKYPE_API_NOTIFICATION_STRING")); if (string && delegate && delegate->SkypeNotificationReceived) { delegate->SkypeNotificationReceived(string); } }
int get_exif_rot (CGDataProviderRef image_source) { int val; // Create a source to read the exif from CGImageSourceRef image_exif_source = CGImageSourceCreateWithDataProvider (image_source, NULL); // Check for a NULL value in the CGImageSourceRef if (NULL == image_exif_source) { // Could not create the CGImageSoureRef printf ("Could not create CGImageSourceRef for image.\n"); } // NSDictionary to hold the exif from the file. CFDictionaryRef exif; // create an NSDictionary and populate it with the EXIF exif = (CFDictionaryRef) CGImageSourceCopyPropertiesAtIndex (image_exif_source, 0, NULL); // Check for a NULL value for the exif CFDict if (NULL == exif) { // there was no EXIF printf ("This file has no EXIF.\n"); // Release the exif source provider CFRelease (image_exif_source); image_exif_source = NULL; // Release the CFDictionary CFRelease (exif); exif = NULL; // set the orientation to Normal. return 1; } else { val = CFNumberToCInt (CFDictionaryGetValue (exif, kCGImagePropertyOrientation)); // Release the exif source provider CFRelease (image_exif_source); image_exif_source = NULL; // Release the CFDictionary CFRelease (exif); exif = NULL; // get the value at the "Orientation" tag return val; } // Release the exif source provider CFRelease (image_exif_source); image_exif_source = NULL; // Release the CFDictionary CFRelease (exif); exif = NULL; return 1; } // get_exif ()