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

import dstep.corefoundation.CFArray;
import dstep.corefoundation.CFBase;
import dstep.corefoundation.CFDictionary;
import dstep.corefoundation.CFError;
import dstep.corefoundation.CFString;
import dstep.corefoundation.CFURL;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc : id;

struct __CFBundle;
alias __CFBundle* CFBundleRef;
alias __CFBundle* CFPlugInRef;
alias int CFBundleRefNum;

extern (C)
{
	extern
	{
		const CFStringRef kCFBundleInfoDictionaryVersionKey;
		const CFStringRef kCFBundleExecutableKey;
		const CFStringRef kCFBundleIdentifierKey;
		const CFStringRef kCFBundleVersionKey;
		const CFStringRef kCFBundleDevelopmentRegionKey;
		const CFStringRef kCFBundleNameKey;
		const CFStringRef kCFBundleLocalizationsKey;
	}
}

enum
{
	kCFBundleExecutableArchitectureI386 = 0x00000007,
	kCFBundleExecutableArchitecturePPC = 0x00000012,
	kCFBundleExecutableArchitectureX86_64 = 0x01000007,
	kCFBundleExecutableArchitecturePPC64 = 0x01000012
}

extern (C)
{
	CFBundleRef CFBundleGetMainBundle ();
	CFBundleRef CFBundleGetBundleWithIdentifier (CFStringRef bundleID);
	CFArrayRef CFBundleGetAllBundles ();
	uint CFBundleGetTypeID ();
	CFBundleRef CFBundleCreate (CFAllocatorRef allocator, CFURLRef bundleURL);
	CFArrayRef CFBundleCreateBundlesFromDirectory (CFAllocatorRef allocator, CFURLRef directoryURL, CFStringRef bundleType);
	CFURLRef CFBundleCopyBundleURL (CFBundleRef bundle);
	void* CFBundleGetValueForInfoDictionaryKey (CFBundleRef bundle, CFStringRef key);
	CFDictionaryRef CFBundleGetInfoDictionary (CFBundleRef bundle);
	CFDictionaryRef CFBundleGetLocalInfoDictionary (CFBundleRef bundle);
	void CFBundleGetPackageInfo (CFBundleRef bundle, uint* packageType, uint* packageCreator);
	CFStringRef CFBundleGetIdentifier (CFBundleRef bundle);
	uint CFBundleGetVersionNumber (CFBundleRef bundle);
	CFStringRef CFBundleGetDevelopmentRegion (CFBundleRef bundle);
	CFURLRef CFBundleCopySupportFilesDirectoryURL (CFBundleRef bundle);
	CFURLRef CFBundleCopyResourcesDirectoryURL (CFBundleRef bundle);
	CFURLRef CFBundleCopyPrivateFrameworksURL (CFBundleRef bundle);
	CFURLRef CFBundleCopySharedFrameworksURL (CFBundleRef bundle);
	CFURLRef CFBundleCopySharedSupportURL (CFBundleRef bundle);
	CFURLRef CFBundleCopyBuiltInPlugInsURL (CFBundleRef bundle);
	CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory (CFURLRef bundleURL);
	ubyte CFBundleGetPackageInfoInDirectory (CFURLRef url, uint* packageType, uint* packageCreator);
	CFURLRef CFBundleCopyResourceURL (CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
	CFArrayRef CFBundleCopyResourceURLsOfType (CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName);
	CFStringRef CFBundleCopyLocalizedString (CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName);
	CFURLRef CFBundleCopyResourceURLInDirectory (CFURLRef bundleURL, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
	CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory (CFURLRef bundleURL, CFStringRef resourceType, CFStringRef subDirName);
	CFArrayRef CFBundleCopyBundleLocalizations (CFBundleRef bundle);
	CFArrayRef CFBundleCopyPreferredLocalizationsFromArray (CFArrayRef locArray);
	CFArrayRef CFBundleCopyLocalizationsForPreferences (CFArrayRef locArray, CFArrayRef prefArray);
	CFURLRef CFBundleCopyResourceURLForLocalization (CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
	CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization (CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
	CFDictionaryRef CFBundleCopyInfoDictionaryForURL (CFURLRef url);
	CFArrayRef CFBundleCopyLocalizationsForURL (CFURLRef url);
	CFArrayRef CFBundleCopyExecutableArchitecturesForURL (CFURLRef url);
	CFURLRef CFBundleCopyExecutableURL (CFBundleRef bundle);
	CFArrayRef CFBundleCopyExecutableArchitectures (CFBundleRef bundle);
	ubyte CFBundlePreflightExecutable (CFBundleRef bundle, CFErrorRef* error);
	ubyte CFBundleLoadExecutableAndReturnError (CFBundleRef bundle, CFErrorRef* error);
	ubyte CFBundleLoadExecutable (CFBundleRef bundle);
	ubyte CFBundleIsExecutableLoaded (CFBundleRef bundle);
	void CFBundleUnloadExecutable (CFBundleRef bundle);
	void* CFBundleGetFunctionPointerForName (CFBundleRef bundle, CFStringRef functionName);
	void CFBundleGetFunctionPointersForNames (CFBundleRef bundle, CFArrayRef functionNames, void** ftbl);
	void* CFBundleGetDataPointerForName (CFBundleRef bundle, CFStringRef symbolName);
	void CFBundleGetDataPointersForNames (CFBundleRef bundle, CFArrayRef symbolNames, void** stbl);
	CFURLRef CFBundleCopyAuxiliaryExecutableURL (CFBundleRef bundle, CFStringRef executableName);
	CFPlugInRef CFBundleGetPlugIn (CFBundleRef bundle);
	short CFBundleOpenBundleResourceMap (CFBundleRef bundle);
	int CFBundleOpenBundleResourceFiles (CFBundleRef bundle, short* refNum, short* localizedRefNum);
	void CFBundleCloseBundleResourceMap (CFBundleRef bundle, short refNum);
}