Package org.lwjgl.system.macosx
Class CoreFoundation
- java.lang.Object
-
- org.lwjgl.system.macosx.CoreFoundation
-
public class CoreFoundation extends java.lang.ObjectNative bindings to <CoreFoundation.h>.
-
-
Field Summary
Fields Modifier and Type Field and Description static byteFALSEBoolean values.static longkCFAllocatorDefaultThis is a synonym forNULL, if you'd rather use a named constant.static longkCFAllocatorMallocThis allocator usesmalloc(),realloc(), andfree().static longkCFAllocatorMallocZoneThis allocator explicitly uses the default malloc zone, returned bymalloc_default_zone().static longkCFAllocatorNullNull allocator which does nothing and allocates no memory.static longkCFAllocatorSystemDefaultDefault system allocator; you rarely need to use this.static longkCFAllocatorUseContextSpecial allocator argument to CFAllocatorCreate which means "use the functions given in the context to allocate the allocator itself as well".static intkCFStringEncodingASCII
kCFStringEncodingISOLatin1
kCFStringEncodingMacRoman
kCFStringEncodingNextStepLatin
kCFStringEncodingNonLossyASCII
kCFStringEncodingUnicode
kCFStringEncodingUTF16
kCFStringEncodingUTF16BE
kCFStringEncodingUTF16LE
kCFStringEncodingUTF32
kCFStringEncodingUTF32BE
kCFStringEncodingUTF32LE
kCFStringEncodingUTF8
kCFStringEncodingWindowsLatin1Platform-independent built-in encodings; always available on all platforms.static intkCFURLHFSPathStyle
kCFURLPOSIXPathStyle
kCFURLWindowsPathStyleURL path styles.static byteTRUEBoolean values.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static longCFBundleCreate(long allocator, long bundleURL)Creates aCFBundleobject.static longCFBundleGetFunctionPointerForName(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 voidCFRelease(long cf)Releases a Core Foundation object.static longCFRetain(long cf)Retains a Core Foundation object.static longCFStringCreateWithCString(long allocator, java.nio.ByteBuffer cStr, int encoding)Creates an immutable string from a C string.static longCFStringCreateWithCStringNoCopy(long allocator, java.nio.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 longCFURLCreateWithFileSystemPath(long allocator, long filePath, long pathStyle, boolean isDirectory)Creates aCFURLobject using a local file system path string.
-
-
-
Field Detail
-
TRUE
public static final byte TRUE
Boolean values.- See Also:
- Constant Field Values
-
FALSE
public static final byte FALSE
Boolean values.- See Also:
- Constant Field Values
-
kCFStringEncodingMacRoman
public static final int kCFStringEncodingMacRoman
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingWindowsLatin1
public static final int kCFStringEncodingWindowsLatin1
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingISOLatin1
public static final int kCFStringEncodingISOLatin1
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingNextStepLatin
public static final int kCFStringEncodingNextStepLatin
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingASCII
public static final int kCFStringEncodingASCII
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingUnicode
public static final int kCFStringEncodingUnicode
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingUTF8
public static final int kCFStringEncodingUTF8
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingNonLossyASCII
public static final int kCFStringEncodingNonLossyASCII
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingUTF16
public static final int kCFStringEncodingUTF16
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingUTF16BE
public static final int kCFStringEncodingUTF16BE
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingUTF16LE
public static final int kCFStringEncodingUTF16LE
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingUTF32
public static final int kCFStringEncodingUTF32
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingUTF32BE
public static final int kCFStringEncodingUTF32BE
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFStringEncodingUTF32LE
public static final int kCFStringEncodingUTF32LE
Platform-independent built-in encodings; always available on all platforms.- See Also:
- Constant Field Values
-
kCFURLPOSIXPathStyle
public static final int kCFURLPOSIXPathStyle
URL path styles.- See Also:
- Constant Field Values
-
kCFURLHFSPathStyle
public static final int kCFURLHFSPathStyle
URL path styles.- See Also:
- Constant Field Values
-
kCFURLWindowsPathStyle
public static final int kCFURLWindowsPathStyle
URL path styles.- See Also:
- Constant Field Values
-
kCFAllocatorDefault
public static final long kCFAllocatorDefault
This is a synonym forNULL, if you'd rather use a named constant.
-
kCFAllocatorSystemDefault
public static final long kCFAllocatorSystemDefault
Default system allocator; you rarely need to use this.
-
kCFAllocatorMalloc
public static final long kCFAllocatorMalloc
This allocator usesmalloc(),realloc(), andfree(). This should not be generally used; stick toCoreFoundation.kCFAllocatorDefaultwhenever possible. This allocator is useful as the "bytesDeallocator" inCFDataor "contentsDeallocator" inCFStringwhere the memory was obtained as a result ofmalloc()type functions.
-
kCFAllocatorMallocZone
public static final long kCFAllocatorMallocZone
This 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 kCFAllocatorNull
Null allocator which does nothing and allocates no memory. This allocator is useful as the "bytesDeallocator" inCFDataor "contentsDeallocator" inCFStringwhere the memory should not be freed.
-
kCFAllocatorUseContext
public static final long kCFAllocatorUseContext
Special allocator argument to CFAllocatorCreate which means "use the functions given in the context to allocate the allocator itself as well".
-
-
Method Detail
-
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
-
CFRelease
public static void CFRelease(long cf)
Releases a Core Foundation object.If the retain count of
cfbecomes zero the memory allocated to the object is deallocated and the object is destroyed. If you create, copy, or explicitly retain (see theCoreFoundation.CFRetain(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
-
CFBundleCreate
public static long CFBundleCreate(long allocator, long bundleURL)Creates aCFBundleobject.- Parameters:
allocator- the allocator to use to allocate memory for the new object. PassNULLorkCFAllocatorDefaultto use the current default allocator.bundleURL- the location of the bundle for which to create aCFBundleobject
-
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
-
CFStringCreateWithCString
public static long CFStringCreateWithCString(long allocator, java.nio.ByteBuffer cStr, int encoding)Creates an immutable string from a C string.- Parameters:
allocator- the allocator to use to allocate memory for the new object. PassNULLorkCFAllocatorDefaultto use the current default allocator.cStr- theNULL-terminated C string to be used to create theCFStringobject. 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:
-
CFStringCreateWithCStringNoCopy
public static long CFStringCreateWithCStringNoCopy(long allocator, java.nio.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. PassNULLorkCFAllocatorDefaultto use the current default allocator.cStr- theNULL-terminated C string to be used to create theCFStringobject. 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- theCFAllocatorobject to use to deallocate the external string buffer when it is no longer needed. You can passNULLorkCFAllocatorDefaultto 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 theCFStringobject deallocate it), passkCFAllocatorNull.
-
CFURLCreateWithFileSystemPath
public static long CFURLCreateWithFileSystemPath(long allocator, long filePath, long pathStyle, boolean isDirectory)Creates aCFURLobject using a local file system path string.- Parameters:
allocator- the allocator to use to allocate memory for the new object. PassNULLorkCFAllocatorDefaultto use the current default allocator.filePath- the path string to convert to aCFURLobject. IffilePathis 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:CoreFoundation.kCFURLPOSIXPathStyleCoreFoundation.kCFURLHFSPathStyleCoreFoundation.kCFURLWindowsPathStyleisDirectory- 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.
-
-