view dstep/corefoundation/CFBag.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.CFBag;

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

struct __CFBag;
alias __CFBag* CFBagRef;
alias __CFBag* CFMutableBagRef;

extern (C)
{
	alias ubyte function (void*, void*) CFBagEqualCallBack;
	alias void* function (CFAllocatorRef, void*) CFBagRetainCallBack;
	alias uint function (void*) CFBagHashCallBack;
	alias CFStringRef function (void*) CFBagCopyDescriptionCallBack;
	alias void function (CFAllocatorRef, void*) CFBagReleaseCallBack;
	alias void function (void*, void*) CFBagApplierFunction;
}

extern (C)
{
	extern
	{
		const CFBagCallBacks kCFTypeBagCallBacks;
		const CFBagCallBacks kCFCopyStringBagCallBacks;
	}
}

struct CFBagCallBacks
{
	int version_;
	CFBagRetainCallBack* retain;
	CFBagReleaseCallBack* release;
	CFBagCopyDescriptionCallBack* copyDescription;
	CFBagEqualCallBack* equal;
	CFBagHashCallBack* hash;
}

extern (C)
{
	uint CFBagGetTypeID ();
	CFBagRef CFBagCreate (CFAllocatorRef allocator, void** values, int numValues, CFBagCallBacks* callBacks);
	CFBagRef CFBagCreateCopy (CFAllocatorRef allocator, CFBagRef theBag);
	CFMutableBagRef CFBagCreateMutable (CFAllocatorRef allocator, int capacity, CFBagCallBacks* callBacks);
	CFMutableBagRef CFBagCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFBagRef theBag);
	int CFBagGetCount (CFBagRef theBag);
	int CFBagGetCountOfValue (CFBagRef theBag, void* value);
	ubyte CFBagContainsValue (CFBagRef theBag, void* value);
	void* CFBagGetValue (CFBagRef theBag, void* value);
	ubyte CFBagGetValueIfPresent (CFBagRef theBag, void* candidate, void** value);
	void CFBagGetValues (CFBagRef theBag, void** values);
	void CFBagApplyFunction (CFBagRef theBag, CFBagApplierFunction* applier, void* context);
	void CFBagAddValue (CFMutableBagRef theBag, void* value);
	void CFBagReplaceValue (CFMutableBagRef theBag, void* value);
	void CFBagSetValue (CFMutableBagRef theBag, void* value);
	void CFBagRemoveValue (CFMutableBagRef theBag, void* value);
	void CFBagRemoveAllValues (CFMutableBagRef theBag);
}