Package org.lwjgl.system.macosx
Class CoreFoundation
java.lang.Object
org.lwjgl.system.macosx.CoreFoundation
Native bindings to <CoreFoundation.h>.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
Boolean values.static final long
This is a synonym forNULL
, if you'd rather use a named constant.static final long
This allocator usesmalloc()
,realloc()
, andfree()
.static final long
This allocator explicitly uses the default malloc zone, returned bymalloc_default_zone()
.static final long
Null allocator which does nothing and allocates no memory.static final long
Default system allocator; you rarely need to use this.static final long
Special allocator argument to CFAllocatorCreate which means "use the functions given in the context to allocate the allocator itself as well".static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
Platform-independent built-in encodings; always available on all platforms.static final int
URL path styles.static final int
URL path styles.static final int
URL path styles.static final byte
Boolean values. -
Method Summary
Modifier and TypeMethodDescriptionstatic long
CFBundleCreate
(long allocator, long bundleURL) Creates aCFBundle
object.static long
CFBundleGetBundleWithIdentifier
(long bundleID) Locates a bundle given its program-defined identifier.static long
CFBundleGetFunctionPointerForName
(long bundle, long functionName) Returns a pointer to a function in a bundle’s executable code using the function name as the search key.static void
CFRelease
(long cf) Releases a Core Foundation object.static long
CFRetain
(long cf) Retains a Core Foundation object.static long
CFStringCreateWithCString
(long allocator, ByteBuffer cStr, int encoding) Creates an immutable string from a C string.static long
CFStringCreateWithCStringNoCopy
(long allocator, ByteBuffer cStr, int encoding, long contentsDeallocator) Creates a CFString object from an external C string buffer that might serve as the backing store for the object.static long
CFURLCreateWithFileSystemPath
(long allocator, long filePath, long pathStyle, boolean isDirectory) Creates aCFURL
object using a local file system path string.static long
nCFBundleCreate
(long allocator, long bundleURL) Unsafe version of:CFBundleCreate(long, long)
static long
nCFBundleGetBundleWithIdentifier
(long bundleID) Unsafe version of:CFBundleGetBundleWithIdentifier(long)
static long
nCFBundleGetFunctionPointerForName
(long bundle, long functionName) Unsafe version of:CFBundleGetFunctionPointerForName(long, long)
static void
nCFRelease
(long cf) Unsafe version of:CFRelease(long)
static long
nCFRetain
(long cf) Unsafe version of:CFRetain(long)
static long
nCFStringCreateWithCString
(long allocator, long cStr, int encoding) Unsafe version of:CFStringCreateWithCString(long, java.nio.ByteBuffer, int)
static long
nCFStringCreateWithCStringNoCopy
(long allocator, long cStr, int encoding, long contentsDeallocator) Unsafe version of:CFStringCreateWithCStringNoCopy(long, java.nio.ByteBuffer, int, long)
static long
nCFURLCreateWithFileSystemPath
(long allocator, long filePath, long pathStyle, boolean isDirectory) Unsafe version of:CFURLCreateWithFileSystemPath(long, long, long, boolean)
-
Field Details
-
TRUE
public static final byte TRUEBoolean values.- See Also:
-
FALSE
public static final byte FALSEBoolean values.- See Also:
-
kCFStringEncodingMacRoman
public static final int kCFStringEncodingMacRomanPlatform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingWindowsLatin1
public static final int kCFStringEncodingWindowsLatin1Platform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingISOLatin1
public static final int kCFStringEncodingISOLatin1Platform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingNextStepLatin
public static final int kCFStringEncodingNextStepLatinPlatform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingASCII
public static final int kCFStringEncodingASCIIPlatform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingUnicode
public static final int kCFStringEncodingUnicodePlatform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingUTF8
public static final int kCFStringEncodingUTF8Platform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingNonLossyASCII
public static final int kCFStringEncodingNonLossyASCIIPlatform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingUTF16
public static final int kCFStringEncodingUTF16Platform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingUTF16BE
public static final int kCFStringEncodingUTF16BEPlatform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingUTF16LE
public static final int kCFStringEncodingUTF16LEPlatform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingUTF32
public static final int kCFStringEncodingUTF32Platform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingUTF32BE
public static final int kCFStringEncodingUTF32BEPlatform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFStringEncodingUTF32LE
public static final int kCFStringEncodingUTF32LEPlatform-independent built-in encodings; always available on all platforms.- See Also:
-
kCFURLPOSIXPathStyle
public static final int kCFURLPOSIXPathStyleURL path styles.- See Also:
-
kCFURLHFSPathStyle
public static final int kCFURLHFSPathStyleURL path styles.- See Also:
-
kCFURLWindowsPathStyle
public static final int kCFURLWindowsPathStyleURL path styles.- See Also:
-
kCFAllocatorDefault
public static final long kCFAllocatorDefaultThis is a synonym forNULL
, if you'd rather use a named constant. -
kCFAllocatorSystemDefault
public static final long kCFAllocatorSystemDefaultDefault system allocator; you rarely need to use this. -
kCFAllocatorMalloc
public static final long kCFAllocatorMallocThis allocator usesmalloc()
,realloc()
, andfree()
. This should not be generally used; stick tokCFAllocatorDefault
whenever possible. This allocator is useful as the "bytesDeallocator" inCFData
or "contentsDeallocator" inCFString
where the memory was obtained as a result ofmalloc()
type functions. -
kCFAllocatorMallocZone
public static final long kCFAllocatorMallocZoneThis allocator explicitly uses the default malloc zone, returned bymalloc_default_zone()
. It should only be used when an object is safe to be allocated in non-scanned memory. -
kCFAllocatorNull
public static final long kCFAllocatorNullNull allocator which does nothing and allocates no memory. This allocator is useful as the "bytesDeallocator" inCFData
or "contentsDeallocator" inCFString
where the memory should not be freed. -
kCFAllocatorUseContext
public static final long kCFAllocatorUseContextSpecial allocator argument to CFAllocatorCreate which means "use the functions given in the context to allocate the allocator itself as well".
-
-
Method Details
-
nCFRetain
public static long nCFRetain(long cf) Unsafe version of:CFRetain(long)
-
CFRetain
public static long CFRetain(long cf) Retains a Core Foundation object.You should retain a Core Foundation object when you receive it from elsewhere (that is, you did not create or copy it) and you want it to persist. If you retain a Core Foundation object you are responsible for releasing it.
- Parameters:
cf
- the CFType object to retain
-
nCFRelease
public static void nCFRelease(long cf) Unsafe version of:CFRelease(long)
-
CFRelease
public static void CFRelease(long cf) Releases a Core Foundation object.If the retain count of
cf
becomes zero the memory allocated to the object is deallocated and the object is destroyed. If you create, copy, or explicitly retain (see theCFRetain(long)
function) a Core Foundation object, you are responsible for releasing it when you no longer need it.- Parameters:
cf
- the CFType object to release
-
nCFBundleCreate
public static long nCFBundleCreate(long allocator, long bundleURL) Unsafe version of:CFBundleCreate(long, long)
-
CFBundleCreate
public static long CFBundleCreate(long allocator, long bundleURL) Creates aCFBundle
object.- Parameters:
allocator
- the allocator to use to allocate memory for the new object. PassNULL
orkCFAllocatorDefault
to use the current default allocator.bundleURL
- the location of the bundle for which to create aCFBundle
object
-
nCFBundleGetBundleWithIdentifier
public static long nCFBundleGetBundleWithIdentifier(long bundleID) Unsafe version of:CFBundleGetBundleWithIdentifier(long)
-
CFBundleGetBundleWithIdentifier
public static long CFBundleGetBundleWithIdentifier(long bundleID) Locates a bundle given its program-defined identifier.- Parameters:
bundleID
- the identifier of the bundle to locate. Note that identifier names are case-sensitive.
-
nCFBundleGetFunctionPointerForName
public static long nCFBundleGetFunctionPointerForName(long bundle, long functionName) Unsafe version of:CFBundleGetFunctionPointerForName(long, long)
-
CFBundleGetFunctionPointerForName
public static long CFBundleGetFunctionPointerForName(long bundle, long functionName) Returns a pointer to a function in a bundle’s executable code using the function name as the search key.- Parameters:
bundle
- the bundle to examinefunctionName
- the name of the function to locate
-
nCFStringCreateWithCString
public static long nCFStringCreateWithCString(long allocator, long cStr, int encoding) Unsafe version of:CFStringCreateWithCString(long, java.nio.ByteBuffer, int)
-
CFStringCreateWithCString
Creates an immutable string from a C string.- Parameters:
allocator
- the allocator to use to allocate memory for the new object. PassNULL
orkCFAllocatorDefault
to use the current default allocator.cStr
- theNULL
-terminated C string to be used to create theCFString
object. The string must use an 8-bit encoding.encoding
- the encoding of the characters in the C string. The encoding must specify an 8-bit encoding. One of:
-
nCFStringCreateWithCStringNoCopy
public static long nCFStringCreateWithCStringNoCopy(long allocator, long cStr, int encoding, long contentsDeallocator) Unsafe version of:CFStringCreateWithCStringNoCopy(long, java.nio.ByteBuffer, int, long)
-
CFStringCreateWithCStringNoCopy
public static long CFStringCreateWithCStringNoCopy(long allocator, ByteBuffer cStr, int encoding, long contentsDeallocator) Creates a CFString object from an external C string buffer that might serve as the backing store for the object.- Parameters:
allocator
- the allocator to use to allocate memory for the new object. PassNULL
orkCFAllocatorDefault
to use the current default allocator.cStr
- theNULL
-terminated C string to be used to create theCFString
object. The string must use an 8-bit encoding.encoding
- the encoding of the characters in the C string. The encoding must specify an 8-bit encoding. One of:contentsDeallocator
- theCFAllocator
object to use to deallocate the external string buffer when it is no longer needed. You can passNULL
orkCFAllocatorDefault
to request the default allocator for this purpose. If the buffer does not need to be deallocated, or if you want to assume responsibility for deallocating the buffer (and not have theCFString
object deallocate it), passkCFAllocatorNull
.
-
nCFURLCreateWithFileSystemPath
public static long nCFURLCreateWithFileSystemPath(long allocator, long filePath, long pathStyle, boolean isDirectory) Unsafe version of:CFURLCreateWithFileSystemPath(long, long, long, boolean)
-
CFURLCreateWithFileSystemPath
public static long CFURLCreateWithFileSystemPath(long allocator, long filePath, long pathStyle, boolean isDirectory) Creates aCFURL
object using a local file system path string.- Parameters:
allocator
- the allocator to use to allocate memory for the new object. PassNULL
orkCFAllocatorDefault
to use the current default allocator.filePath
- the path string to convert to aCFURL
object. IffilePath
is not absolute, the resulting URL will be considered relative to the current working directory (evaluated when this function is being invoked).pathStyle
- the operating system path style used infilePath
. One of:kCFURLPOSIXPathStyle
kCFURLHFSPathStyle
kCFURLWindowsPathStyle
isDirectory
- a Boolean value that specifies whether filePath is treated as a directory path when resolving against relative path components. Pass true if the pathname indicates a directory, false otherwise.
-