view dstep/corefoundation/CFDictionary.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Jul 12, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.corefoundation.CFDictionary;

import dstep.corefoundation.CFBase;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc : id;

struct __CFDictionary;
alias __CFDictionary* CFDictionaryRef;
alias __CFDictionary* CFMutableDictionaryRef;

extern (C)
{
	alias ubyte function (void*, void*) CFDictionaryEqualCallBack;
	alias uint function (void*) CFDictionaryHashCallBack;
	alias void* function (CFAllocatorRef, void*) CFDictionaryRetainCallBack;
	alias CFStringRef function (void*) CFDictionaryCopyDescriptionCallBack;
	alias void function (CFAllocatorRef, void*) CFDictionaryReleaseCallBack;
	alias void function (void*, void*, void*) CFDictionaryApplierFunction;
}

extern (C)
{
	extern
	{
		const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
		const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks;
		const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
	}
}

struct CFDictionaryKeyCallBacks
{
	int version_;
	CFDictionaryRetainCallBack* retain;
	CFDictionaryReleaseCallBack* release;
	CFDictionaryCopyDescriptionCallBack* copyDescription;
	CFDictionaryEqualCallBack* equal;
	CFDictionaryHashCallBack* hash;
}


struct CFDictionaryValueCallBacks
{
	int version_;
	CFDictionaryRetainCallBack* retain;
	CFDictionaryReleaseCallBack* release;
	CFDictionaryCopyDescriptionCallBack* copyDescription;
	CFDictionaryEqualCallBack* equal;
}

extern (C)
{
	uint CFDictionaryGetTypeID ();
	CFDictionaryRef CFDictionaryCreate (CFAllocatorRef allocator, void** keys, void** values, int numValues, CFDictionaryKeyCallBacks* keyCallBacks, CFDictionaryValueCallBacks* valueCallBacks);
	CFDictionaryRef CFDictionaryCreateCopy (CFAllocatorRef allocator, CFDictionaryRef theDict);
	CFMutableDictionaryRef CFDictionaryCreateMutable (CFAllocatorRef allocator, int capacity, CFDictionaryKeyCallBacks* keyCallBacks, CFDictionaryValueCallBacks* valueCallBacks);
	CFMutableDictionaryRef CFDictionaryCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFDictionaryRef theDict);
	int CFDictionaryGetCount (CFDictionaryRef theDict);
	int CFDictionaryGetCountOfKey (CFDictionaryRef theDict, void* key);
	int CFDictionaryGetCountOfValue (CFDictionaryRef theDict, void* value);
	ubyte CFDictionaryContainsKey (CFDictionaryRef theDict, void* key);
	ubyte CFDictionaryContainsValue (CFDictionaryRef theDict, void* value);
	void* CFDictionaryGetValue (CFDictionaryRef theDict, void* key);
	ubyte CFDictionaryGetValueIfPresent (CFDictionaryRef theDict, void* key, void** value);
	void CFDictionaryGetKeysAndValues (CFDictionaryRef theDict, void** keys, void** values);
	void CFDictionaryApplyFunction (CFDictionaryRef theDict, CFDictionaryApplierFunction* applier, void* context);
	void CFDictionaryAddValue (CFMutableDictionaryRef theDict, void* key, void* value);
	void CFDictionarySetValue (CFMutableDictionaryRef theDict, void* key, void* value);
	void CFDictionaryReplaceValue (CFMutableDictionaryRef theDict, void* key, void* value);
	void CFDictionaryRemoveValue (CFMutableDictionaryRef theDict, void* key);
	void CFDictionaryRemoveAllValues (CFMutableDictionaryRef theDict);
}