mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-08 14:32:06 +08:00
6adb63b915
date: 2026-06-04T09:49:56 master commit: c0ab3550eca2e9daf197c46b7e4b24aa9637cf2e
313 lines
25 KiB
Python
313 lines
25 KiB
Python
# mypy: disable-error-code="empty-body"
|
|
from __future__ import annotations
|
|
import ctypes
|
|
from typing import Literal, TypeAlias
|
|
from tinygrad.runtime.support.c import _IO, _IOW, _IOR, _IOWR
|
|
from tinygrad.runtime.support import c
|
|
dll = c.DLL('corefoundation', 'CoreFoundation')
|
|
CFStringEncoding: TypeAlias = ctypes.c_uint32
|
|
CFStringBuiltInEncodings: TypeAlias = ctypes.c_uint32
|
|
_anonenum0: dict[int, str] = {(kCFStringEncodingMacRoman:=0): 'kCFStringEncodingMacRoman', (kCFStringEncodingWindowsLatin1:=1280): 'kCFStringEncodingWindowsLatin1', (kCFStringEncodingISOLatin1:=513): 'kCFStringEncodingISOLatin1', (kCFStringEncodingNextStepLatin:=2817): 'kCFStringEncodingNextStepLatin', (kCFStringEncodingASCII:=1536): 'kCFStringEncodingASCII', (kCFStringEncodingUnicode:=256): 'kCFStringEncodingUnicode', (kCFStringEncodingUTF8:=134217984): 'kCFStringEncodingUTF8', (kCFStringEncodingNonLossyASCII:=3071): 'kCFStringEncodingNonLossyASCII', (kCFStringEncodingUTF16:=256): 'kCFStringEncodingUTF16', (kCFStringEncodingUTF16BE:=268435712): 'kCFStringEncodingUTF16BE', (kCFStringEncodingUTF16LE:=335544576): 'kCFStringEncodingUTF16LE', (kCFStringEncodingUTF32:=201326848): 'kCFStringEncodingUTF32', (kCFStringEncodingUTF32BE:=402653440): 'kCFStringEncodingUTF32BE', (kCFStringEncodingUTF32LE:=469762304): 'kCFStringEncodingUTF32LE'}
|
|
CFTypeID: TypeAlias = ctypes.c_uint64
|
|
@dll.bind(CFTypeID)
|
|
def CFStringGetTypeID() -> CFTypeID: ...
|
|
class struct___CFString(c.Struct): pass
|
|
CFStringRef: TypeAlias = c.POINTER[struct___CFString]
|
|
class struct___CFAllocator(c.Struct): pass
|
|
CFAllocatorRef: TypeAlias = c.POINTER[struct___CFAllocator]
|
|
ConstStr255Param: TypeAlias = c.POINTER[ctypes.c_ubyte]
|
|
@dll.bind(CFStringRef, CFAllocatorRef, ConstStr255Param, CFStringEncoding)
|
|
def CFStringCreateWithPascalString(alloc:CFAllocatorRef, pStr:ConstStr255Param, encoding:CFStringEncoding) -> CFStringRef: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, c.POINTER[ctypes.c_char], CFStringEncoding)
|
|
def CFStringCreateWithCString(alloc:CFAllocatorRef, cStr:c.POINTER[ctypes.c_char], encoding:CFStringEncoding) -> CFStringRef: ...
|
|
UInt8: TypeAlias = ctypes.c_ubyte
|
|
CFIndex: TypeAlias = ctypes.c_int64
|
|
Boolean: TypeAlias = ctypes.c_ubyte
|
|
@dll.bind(CFStringRef, CFAllocatorRef, c.POINTER[UInt8], CFIndex, CFStringEncoding, Boolean)
|
|
def CFStringCreateWithBytes(alloc:CFAllocatorRef, bytes:c.POINTER[UInt8], numBytes:CFIndex, encoding:CFStringEncoding, isExternalRepresentation:Boolean) -> CFStringRef: ...
|
|
UniChar: TypeAlias = ctypes.c_uint16
|
|
@dll.bind(CFStringRef, CFAllocatorRef, c.POINTER[UniChar], CFIndex)
|
|
def CFStringCreateWithCharacters(alloc:CFAllocatorRef, chars:c.POINTER[UniChar], numChars:CFIndex) -> CFStringRef: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, ConstStr255Param, CFStringEncoding, CFAllocatorRef)
|
|
def CFStringCreateWithPascalStringNoCopy(alloc:CFAllocatorRef, pStr:ConstStr255Param, encoding:CFStringEncoding, contentsDeallocator:CFAllocatorRef) -> CFStringRef: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, c.POINTER[ctypes.c_char], CFStringEncoding, CFAllocatorRef)
|
|
def CFStringCreateWithCStringNoCopy(alloc:CFAllocatorRef, cStr:c.POINTER[ctypes.c_char], encoding:CFStringEncoding, contentsDeallocator:CFAllocatorRef) -> CFStringRef: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, c.POINTER[UInt8], CFIndex, CFStringEncoding, Boolean, CFAllocatorRef)
|
|
def CFStringCreateWithBytesNoCopy(alloc:CFAllocatorRef, bytes:c.POINTER[UInt8], numBytes:CFIndex, encoding:CFStringEncoding, isExternalRepresentation:Boolean, contentsDeallocator:CFAllocatorRef) -> CFStringRef: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, c.POINTER[UniChar], CFIndex, CFAllocatorRef)
|
|
def CFStringCreateWithCharactersNoCopy(alloc:CFAllocatorRef, chars:c.POINTER[UniChar], numChars:CFIndex, contentsDeallocator:CFAllocatorRef) -> CFStringRef: ...
|
|
@c.record
|
|
class CFRange(c.Struct):
|
|
SIZE = 16
|
|
location: int
|
|
length: int
|
|
CFRange.register_fields([('location', CFIndex, 0), ('length', CFIndex, 8)])
|
|
@dll.bind(CFStringRef, CFAllocatorRef, CFStringRef, CFRange)
|
|
def CFStringCreateWithSubstring(alloc:CFAllocatorRef, str:CFStringRef, range:CFRange) -> CFStringRef: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, CFStringRef)
|
|
def CFStringCreateCopy(alloc:CFAllocatorRef, theString:CFStringRef) -> CFStringRef: ...
|
|
class struct___CFDictionary(c.Struct): pass
|
|
CFDictionaryRef: TypeAlias = c.POINTER[struct___CFDictionary]
|
|
@dll.bind(CFStringRef, CFAllocatorRef, CFDictionaryRef, CFStringRef)
|
|
def CFStringCreateWithFormat(alloc:CFAllocatorRef, formatOptions:CFDictionaryRef, format:CFStringRef) -> CFStringRef: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, CFDictionaryRef, CFStringRef, ctypes.c_int32)
|
|
def CFStringCreateWithFormatAndArguments(alloc:CFAllocatorRef, formatOptions:CFDictionaryRef, format:CFStringRef, arguments:int) -> CFStringRef: ...
|
|
class struct___CFError(c.Struct): pass
|
|
CFErrorRef: TypeAlias = c.POINTER[struct___CFError]
|
|
@dll.bind(CFStringRef, CFAllocatorRef, CFDictionaryRef, CFStringRef, CFStringRef, c.POINTER[CFErrorRef])
|
|
def CFStringCreateStringWithValidatedFormat(alloc:CFAllocatorRef, formatOptions:CFDictionaryRef, validFormatSpecifiers:CFStringRef, format:CFStringRef, errorPtr:c.POINTER[CFErrorRef]) -> CFStringRef: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, CFDictionaryRef, CFStringRef, CFStringRef, ctypes.c_int32, c.POINTER[CFErrorRef])
|
|
def CFStringCreateStringWithValidatedFormatAndArguments(alloc:CFAllocatorRef, formatOptions:CFDictionaryRef, validFormatSpecifiers:CFStringRef, format:CFStringRef, arguments:int, errorPtr:c.POINTER[CFErrorRef]) -> CFStringRef: ...
|
|
CFMutableStringRef: TypeAlias = c.POINTER[struct___CFString]
|
|
@dll.bind(CFMutableStringRef, CFAllocatorRef, CFIndex)
|
|
def CFStringCreateMutable(alloc:CFAllocatorRef, maxLength:CFIndex) -> CFMutableStringRef: ...
|
|
@dll.bind(CFMutableStringRef, CFAllocatorRef, CFIndex, CFStringRef)
|
|
def CFStringCreateMutableCopy(alloc:CFAllocatorRef, maxLength:CFIndex, theString:CFStringRef) -> CFMutableStringRef: ...
|
|
@dll.bind(CFMutableStringRef, CFAllocatorRef, c.POINTER[UniChar], CFIndex, CFIndex, CFAllocatorRef)
|
|
def CFStringCreateMutableWithExternalCharactersNoCopy(alloc:CFAllocatorRef, chars:c.POINTER[UniChar], numChars:CFIndex, capacity:CFIndex, externalCharactersAllocator:CFAllocatorRef) -> CFMutableStringRef: ...
|
|
@dll.bind(CFIndex, CFStringRef)
|
|
def CFStringGetLength(theString:CFStringRef) -> CFIndex: ...
|
|
@dll.bind(UniChar, CFStringRef, CFIndex)
|
|
def CFStringGetCharacterAtIndex(theString:CFStringRef, idx:CFIndex) -> UniChar: ...
|
|
@dll.bind(None, CFStringRef, CFRange, c.POINTER[UniChar])
|
|
def CFStringGetCharacters(theString:CFStringRef, range:CFRange, buffer:c.POINTER[UniChar]) -> None: ...
|
|
StringPtr: TypeAlias = c.POINTER[ctypes.c_ubyte]
|
|
@dll.bind(Boolean, CFStringRef, StringPtr, CFIndex, CFStringEncoding)
|
|
def CFStringGetPascalString(theString:CFStringRef, buffer:StringPtr, bufferSize:CFIndex, encoding:CFStringEncoding) -> Boolean: ...
|
|
@dll.bind(Boolean, CFStringRef, c.POINTER[ctypes.c_char], CFIndex, CFStringEncoding)
|
|
def CFStringGetCString(theString:CFStringRef, buffer:c.POINTER[ctypes.c_char], bufferSize:CFIndex, encoding:CFStringEncoding) -> Boolean: ...
|
|
ConstStringPtr: TypeAlias = c.POINTER[ctypes.c_ubyte]
|
|
@dll.bind(ConstStringPtr, CFStringRef, CFStringEncoding)
|
|
def CFStringGetPascalStringPtr(theString:CFStringRef, encoding:CFStringEncoding) -> ConstStringPtr: ...
|
|
@dll.bind(c.POINTER[ctypes.c_char], CFStringRef, CFStringEncoding)
|
|
def CFStringGetCStringPtr(theString:CFStringRef, encoding:CFStringEncoding) -> c.POINTER[ctypes.c_char]: ...
|
|
@dll.bind(c.POINTER[UniChar], CFStringRef)
|
|
def CFStringGetCharactersPtr(theString:CFStringRef) -> c.POINTER[UniChar]: ...
|
|
@dll.bind(CFIndex, CFStringRef, CFRange, CFStringEncoding, UInt8, Boolean, c.POINTER[UInt8], CFIndex, c.POINTER[CFIndex])
|
|
def CFStringGetBytes(theString:CFStringRef, range:CFRange, encoding:CFStringEncoding, lossByte:UInt8, isExternalRepresentation:Boolean, buffer:c.POINTER[UInt8], maxBufLen:CFIndex, usedBufLen:c.POINTER[CFIndex]) -> CFIndex: ...
|
|
class struct___CFData(c.Struct): pass
|
|
CFDataRef: TypeAlias = c.POINTER[struct___CFData]
|
|
@dll.bind(CFStringRef, CFAllocatorRef, CFDataRef, CFStringEncoding)
|
|
def CFStringCreateFromExternalRepresentation(alloc:CFAllocatorRef, data:CFDataRef, encoding:CFStringEncoding) -> CFStringRef: ...
|
|
@dll.bind(CFDataRef, CFAllocatorRef, CFStringRef, CFStringEncoding, UInt8)
|
|
def CFStringCreateExternalRepresentation(alloc:CFAllocatorRef, theString:CFStringRef, encoding:CFStringEncoding, lossByte:UInt8) -> CFDataRef: ...
|
|
@dll.bind(CFStringEncoding, CFStringRef)
|
|
def CFStringGetSmallestEncoding(theString:CFStringRef) -> CFStringEncoding: ...
|
|
@dll.bind(CFStringEncoding, CFStringRef)
|
|
def CFStringGetFastestEncoding(theString:CFStringRef) -> CFStringEncoding: ...
|
|
@dll.bind(CFStringEncoding)
|
|
def CFStringGetSystemEncoding() -> CFStringEncoding: ...
|
|
@dll.bind(CFIndex, CFIndex, CFStringEncoding)
|
|
def CFStringGetMaximumSizeForEncoding(length:CFIndex, encoding:CFStringEncoding) -> CFIndex: ...
|
|
@dll.bind(Boolean, CFStringRef, c.POINTER[ctypes.c_char], CFIndex)
|
|
def CFStringGetFileSystemRepresentation(string:CFStringRef, buffer:c.POINTER[ctypes.c_char], maxBufLen:CFIndex) -> Boolean: ...
|
|
@dll.bind(CFIndex, CFStringRef)
|
|
def CFStringGetMaximumSizeOfFileSystemRepresentation(string:CFStringRef) -> CFIndex: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, c.POINTER[ctypes.c_char])
|
|
def CFStringCreateWithFileSystemRepresentation(alloc:CFAllocatorRef, buffer:c.POINTER[ctypes.c_char]) -> CFStringRef: ...
|
|
CFStringCompareFlags: TypeAlias = ctypes.c_uint64
|
|
_anonenum1: dict[int, str] = {(kCFCompareCaseInsensitive:=1): 'kCFCompareCaseInsensitive', (kCFCompareBackwards:=4): 'kCFCompareBackwards', (kCFCompareAnchored:=8): 'kCFCompareAnchored', (kCFCompareNonliteral:=16): 'kCFCompareNonliteral', (kCFCompareLocalized:=32): 'kCFCompareLocalized', (kCFCompareNumerically:=64): 'kCFCompareNumerically', (kCFCompareDiacriticInsensitive:=128): 'kCFCompareDiacriticInsensitive', (kCFCompareWidthInsensitive:=256): 'kCFCompareWidthInsensitive', (kCFCompareForcedOrdering:=512): 'kCFCompareForcedOrdering'}
|
|
CFComparisonResult: TypeAlias = ctypes.c_int64
|
|
class struct___CFLocale(c.Struct): pass
|
|
CFLocaleRef: TypeAlias = c.POINTER[struct___CFLocale]
|
|
@dll.bind(CFComparisonResult, CFStringRef, CFStringRef, CFRange, CFStringCompareFlags, CFLocaleRef)
|
|
def CFStringCompareWithOptionsAndLocale(theString1:CFStringRef, theString2:CFStringRef, rangeToCompare:CFRange, compareOptions:CFStringCompareFlags, locale:CFLocaleRef) -> CFComparisonResult: ...
|
|
@dll.bind(CFComparisonResult, CFStringRef, CFStringRef, CFRange, CFStringCompareFlags)
|
|
def CFStringCompareWithOptions(theString1:CFStringRef, theString2:CFStringRef, rangeToCompare:CFRange, compareOptions:CFStringCompareFlags) -> CFComparisonResult: ...
|
|
@dll.bind(CFComparisonResult, CFStringRef, CFStringRef, CFStringCompareFlags)
|
|
def CFStringCompare(theString1:CFStringRef, theString2:CFStringRef, compareOptions:CFStringCompareFlags) -> CFComparisonResult: ...
|
|
@dll.bind(Boolean, CFStringRef, CFStringRef, CFRange, CFStringCompareFlags, CFLocaleRef, c.POINTER[CFRange])
|
|
def CFStringFindWithOptionsAndLocale(theString:CFStringRef, stringToFind:CFStringRef, rangeToSearch:CFRange, searchOptions:CFStringCompareFlags, locale:CFLocaleRef, result:c.POINTER[CFRange]) -> Boolean: ...
|
|
@dll.bind(Boolean, CFStringRef, CFStringRef, CFRange, CFStringCompareFlags, c.POINTER[CFRange])
|
|
def CFStringFindWithOptions(theString:CFStringRef, stringToFind:CFStringRef, rangeToSearch:CFRange, searchOptions:CFStringCompareFlags, result:c.POINTER[CFRange]) -> Boolean: ...
|
|
class struct___CFArray(c.Struct): pass
|
|
CFArrayRef: TypeAlias = c.POINTER[struct___CFArray]
|
|
@dll.bind(CFArrayRef, CFAllocatorRef, CFStringRef, CFStringRef, CFRange, CFStringCompareFlags)
|
|
def CFStringCreateArrayWithFindResults(alloc:CFAllocatorRef, theString:CFStringRef, stringToFind:CFStringRef, rangeToSearch:CFRange, compareOptions:CFStringCompareFlags) -> CFArrayRef: ...
|
|
@dll.bind(CFRange, CFStringRef, CFStringRef, CFStringCompareFlags)
|
|
def CFStringFind(theString:CFStringRef, stringToFind:CFStringRef, compareOptions:CFStringCompareFlags) -> CFRange: ...
|
|
@dll.bind(Boolean, CFStringRef, CFStringRef)
|
|
def CFStringHasPrefix(theString:CFStringRef, prefix:CFStringRef) -> Boolean: ...
|
|
@dll.bind(Boolean, CFStringRef, CFStringRef)
|
|
def CFStringHasSuffix(theString:CFStringRef, suffix:CFStringRef) -> Boolean: ...
|
|
@dll.bind(CFRange, CFStringRef, CFIndex)
|
|
def CFStringGetRangeOfComposedCharactersAtIndex(theString:CFStringRef, theIndex:CFIndex) -> CFRange: ...
|
|
class struct___CFCharacterSet(c.Struct): pass
|
|
CFCharacterSetRef: TypeAlias = c.POINTER[struct___CFCharacterSet]
|
|
@dll.bind(Boolean, CFStringRef, CFCharacterSetRef, CFRange, CFStringCompareFlags, c.POINTER[CFRange])
|
|
def CFStringFindCharacterFromSet(theString:CFStringRef, theSet:CFCharacterSetRef, rangeToSearch:CFRange, searchOptions:CFStringCompareFlags, result:c.POINTER[CFRange]) -> Boolean: ...
|
|
@dll.bind(None, CFStringRef, CFRange, c.POINTER[CFIndex], c.POINTER[CFIndex], c.POINTER[CFIndex])
|
|
def CFStringGetLineBounds(theString:CFStringRef, range:CFRange, lineBeginIndex:c.POINTER[CFIndex], lineEndIndex:c.POINTER[CFIndex], contentsEndIndex:c.POINTER[CFIndex]) -> None: ...
|
|
@dll.bind(None, CFStringRef, CFRange, c.POINTER[CFIndex], c.POINTER[CFIndex], c.POINTER[CFIndex])
|
|
def CFStringGetParagraphBounds(string:CFStringRef, range:CFRange, parBeginIndex:c.POINTER[CFIndex], parEndIndex:c.POINTER[CFIndex], contentsEndIndex:c.POINTER[CFIndex]) -> None: ...
|
|
CFOptionFlags: TypeAlias = ctypes.c_uint64
|
|
UTF32Char: TypeAlias = ctypes.c_uint32
|
|
@dll.bind(CFIndex, CFStringRef, CFIndex, CFRange, CFOptionFlags, CFLocaleRef, c.POINTER[UTF32Char])
|
|
def CFStringGetHyphenationLocationBeforeIndex(string:CFStringRef, location:CFIndex, limitRange:CFRange, options:CFOptionFlags, locale:CFLocaleRef, character:c.POINTER[UTF32Char]) -> CFIndex: ...
|
|
@dll.bind(Boolean, CFLocaleRef)
|
|
def CFStringIsHyphenationAvailableForLocale(locale:CFLocaleRef) -> Boolean: ...
|
|
@dll.bind(CFStringRef, CFAllocatorRef, CFArrayRef, CFStringRef)
|
|
def CFStringCreateByCombiningStrings(alloc:CFAllocatorRef, theArray:CFArrayRef, separatorString:CFStringRef) -> CFStringRef: ...
|
|
@dll.bind(CFArrayRef, CFAllocatorRef, CFStringRef, CFStringRef)
|
|
def CFStringCreateArrayBySeparatingStrings(alloc:CFAllocatorRef, theString:CFStringRef, separatorString:CFStringRef) -> CFArrayRef: ...
|
|
SInt32: TypeAlias = ctypes.c_int32
|
|
@dll.bind(SInt32, CFStringRef)
|
|
def CFStringGetIntValue(str:CFStringRef) -> SInt32: ...
|
|
@dll.bind(ctypes.c_double, CFStringRef)
|
|
def CFStringGetDoubleValue(str:CFStringRef) -> float: ...
|
|
@dll.bind(None, CFMutableStringRef, CFStringRef)
|
|
def CFStringAppend(theString:CFMutableStringRef, appendedString:CFStringRef) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, c.POINTER[UniChar], CFIndex)
|
|
def CFStringAppendCharacters(theString:CFMutableStringRef, chars:c.POINTER[UniChar], numChars:CFIndex) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, ConstStr255Param, CFStringEncoding)
|
|
def CFStringAppendPascalString(theString:CFMutableStringRef, pStr:ConstStr255Param, encoding:CFStringEncoding) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, c.POINTER[ctypes.c_char], CFStringEncoding)
|
|
def CFStringAppendCString(theString:CFMutableStringRef, cStr:c.POINTER[ctypes.c_char], encoding:CFStringEncoding) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFDictionaryRef, CFStringRef)
|
|
def CFStringAppendFormat(theString:CFMutableStringRef, formatOptions:CFDictionaryRef, format:CFStringRef) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFDictionaryRef, CFStringRef, ctypes.c_int32)
|
|
def CFStringAppendFormatAndArguments(theString:CFMutableStringRef, formatOptions:CFDictionaryRef, format:CFStringRef, arguments:int) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFIndex, CFStringRef)
|
|
def CFStringInsert(str:CFMutableStringRef, idx:CFIndex, insertedStr:CFStringRef) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFRange)
|
|
def CFStringDelete(theString:CFMutableStringRef, range:CFRange) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFRange, CFStringRef)
|
|
def CFStringReplace(theString:CFMutableStringRef, range:CFRange, replacement:CFStringRef) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFStringRef)
|
|
def CFStringReplaceAll(theString:CFMutableStringRef, replacement:CFStringRef) -> None: ...
|
|
@dll.bind(CFIndex, CFMutableStringRef, CFStringRef, CFStringRef, CFRange, CFStringCompareFlags)
|
|
def CFStringFindAndReplace(theString:CFMutableStringRef, stringToFind:CFStringRef, replacementString:CFStringRef, rangeToSearch:CFRange, compareOptions:CFStringCompareFlags) -> CFIndex: ...
|
|
@dll.bind(None, CFMutableStringRef, c.POINTER[UniChar], CFIndex, CFIndex)
|
|
def CFStringSetExternalCharactersNoCopy(theString:CFMutableStringRef, chars:c.POINTER[UniChar], length:CFIndex, capacity:CFIndex) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFStringRef, CFIndex, CFIndex)
|
|
def CFStringPad(theString:CFMutableStringRef, padString:CFStringRef, length:CFIndex, indexIntoPad:CFIndex) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFStringRef)
|
|
def CFStringTrim(theString:CFMutableStringRef, trimString:CFStringRef) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef)
|
|
def CFStringTrimWhitespace(theString:CFMutableStringRef) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFLocaleRef)
|
|
def CFStringLowercase(theString:CFMutableStringRef, locale:CFLocaleRef) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFLocaleRef)
|
|
def CFStringUppercase(theString:CFMutableStringRef, locale:CFLocaleRef) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFLocaleRef)
|
|
def CFStringCapitalize(theString:CFMutableStringRef, locale:CFLocaleRef) -> None: ...
|
|
CFStringNormalizationForm: TypeAlias = ctypes.c_int64
|
|
_anonenum2: dict[int, str] = {(kCFStringNormalizationFormD:=0): 'kCFStringNormalizationFormD', (kCFStringNormalizationFormKD:=1): 'kCFStringNormalizationFormKD', (kCFStringNormalizationFormC:=2): 'kCFStringNormalizationFormC', (kCFStringNormalizationFormKC:=3): 'kCFStringNormalizationFormKC'}
|
|
@dll.bind(None, CFMutableStringRef, CFStringNormalizationForm)
|
|
def CFStringNormalize(theString:CFMutableStringRef, theForm:CFStringNormalizationForm) -> None: ...
|
|
@dll.bind(None, CFMutableStringRef, CFStringCompareFlags, CFLocaleRef)
|
|
def CFStringFold(theString:CFMutableStringRef, theFlags:CFStringCompareFlags, theLocale:CFLocaleRef) -> None: ...
|
|
@dll.bind(Boolean, CFMutableStringRef, c.POINTER[CFRange], CFStringRef, Boolean)
|
|
def CFStringTransform(string:CFMutableStringRef, range:c.POINTER[CFRange], transform:CFStringRef, reverse:Boolean) -> Boolean: ...
|
|
try: kCFStringTransformStripCombiningMarks = CFStringRef.in_dll(dll, 'kCFStringTransformStripCombiningMarks') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformToLatin = CFStringRef.in_dll(dll, 'kCFStringTransformToLatin') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformFullwidthHalfwidth = CFStringRef.in_dll(dll, 'kCFStringTransformFullwidthHalfwidth') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformLatinKatakana = CFStringRef.in_dll(dll, 'kCFStringTransformLatinKatakana') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformLatinHiragana = CFStringRef.in_dll(dll, 'kCFStringTransformLatinHiragana') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformHiraganaKatakana = CFStringRef.in_dll(dll, 'kCFStringTransformHiraganaKatakana') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformMandarinLatin = CFStringRef.in_dll(dll, 'kCFStringTransformMandarinLatin') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformLatinHangul = CFStringRef.in_dll(dll, 'kCFStringTransformLatinHangul') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformLatinArabic = CFStringRef.in_dll(dll, 'kCFStringTransformLatinArabic') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformLatinHebrew = CFStringRef.in_dll(dll, 'kCFStringTransformLatinHebrew') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformLatinThai = CFStringRef.in_dll(dll, 'kCFStringTransformLatinThai') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformLatinCyrillic = CFStringRef.in_dll(dll, 'kCFStringTransformLatinCyrillic') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformLatinGreek = CFStringRef.in_dll(dll, 'kCFStringTransformLatinGreek') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformToXMLHex = CFStringRef.in_dll(dll, 'kCFStringTransformToXMLHex') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformToUnicodeName = CFStringRef.in_dll(dll, 'kCFStringTransformToUnicodeName') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
try: kCFStringTransformStripDiacritics = CFStringRef.in_dll(dll, 'kCFStringTransformStripDiacritics') # type: ignore
|
|
except (ValueError,AttributeError): pass
|
|
@dll.bind(Boolean, CFStringEncoding)
|
|
def CFStringIsEncodingAvailable(encoding:CFStringEncoding) -> Boolean: ...
|
|
@dll.bind(c.POINTER[CFStringEncoding])
|
|
def CFStringGetListOfAvailableEncodings() -> c.POINTER[CFStringEncoding]: ...
|
|
@dll.bind(CFStringRef, CFStringEncoding)
|
|
def CFStringGetNameOfEncoding(encoding:CFStringEncoding) -> CFStringRef: ...
|
|
@dll.bind(ctypes.c_uint64, CFStringEncoding)
|
|
def CFStringConvertEncodingToNSStringEncoding(encoding:CFStringEncoding) -> int: ...
|
|
@dll.bind(CFStringEncoding, ctypes.c_uint64)
|
|
def CFStringConvertNSStringEncodingToEncoding(encoding:int) -> CFStringEncoding: ...
|
|
UInt32: TypeAlias = ctypes.c_uint32
|
|
@dll.bind(UInt32, CFStringEncoding)
|
|
def CFStringConvertEncodingToWindowsCodepage(encoding:CFStringEncoding) -> UInt32: ...
|
|
@dll.bind(CFStringEncoding, UInt32)
|
|
def CFStringConvertWindowsCodepageToEncoding(codepage:UInt32) -> CFStringEncoding: ...
|
|
@dll.bind(CFStringEncoding, CFStringRef)
|
|
def CFStringConvertIANACharSetNameToEncoding(theString:CFStringRef) -> CFStringEncoding: ...
|
|
@dll.bind(CFStringRef, CFStringEncoding)
|
|
def CFStringConvertEncodingToIANACharSetName(encoding:CFStringEncoding) -> CFStringRef: ...
|
|
@dll.bind(CFStringEncoding, CFStringEncoding)
|
|
def CFStringGetMostCompatibleMacStringEncoding(encoding:CFStringEncoding) -> CFStringEncoding: ...
|
|
@c.record
|
|
class CFStringInlineBuffer(c.Struct):
|
|
SIZE = 184
|
|
buffer: c.Array[ctypes.c_uint16, Literal[64]]
|
|
theString: c.POINTER[struct___CFString]
|
|
directUniCharBuffer: c.POINTER[ctypes.c_uint16]
|
|
directCStringBuffer: c.POINTER[ctypes.c_char]
|
|
rangeToBuffer: CFRange
|
|
bufferedRangeStart: int
|
|
bufferedRangeEnd: int
|
|
CFStringInlineBuffer.register_fields([('buffer', c.Array[UniChar, Literal[64]], 0), ('theString', CFStringRef, 128), ('directUniCharBuffer', c.POINTER[UniChar], 136), ('directCStringBuffer', c.POINTER[ctypes.c_char], 144), ('rangeToBuffer', CFRange, 152), ('bufferedRangeStart', CFIndex, 168), ('bufferedRangeEnd', CFIndex, 176)])
|
|
CFTypeRef: TypeAlias = ctypes.c_void_p
|
|
@dll.bind(None, CFTypeRef)
|
|
def CFShow(obj:CFTypeRef) -> None: ...
|
|
@dll.bind(None, CFStringRef)
|
|
def CFShowStr(str:CFStringRef) -> None: ...
|
|
@dll.bind(CFStringRef, c.POINTER[ctypes.c_char])
|
|
def __CFStringMakeConstantString(cStr:c.POINTER[ctypes.c_char]) -> CFStringRef: ...
|
|
CFMutableDataRef: TypeAlias = c.POINTER[struct___CFData]
|
|
@dll.bind(CFTypeID)
|
|
def CFDataGetTypeID() -> CFTypeID: ...
|
|
@dll.bind(CFDataRef, CFAllocatorRef, c.POINTER[UInt8], CFIndex)
|
|
def CFDataCreate(allocator:CFAllocatorRef, bytes:c.POINTER[UInt8], length:CFIndex) -> CFDataRef: ...
|
|
@dll.bind(CFDataRef, CFAllocatorRef, c.POINTER[UInt8], CFIndex, CFAllocatorRef)
|
|
def CFDataCreateWithBytesNoCopy(allocator:CFAllocatorRef, bytes:c.POINTER[UInt8], length:CFIndex, bytesDeallocator:CFAllocatorRef) -> CFDataRef: ...
|
|
@dll.bind(CFDataRef, CFAllocatorRef, CFDataRef)
|
|
def CFDataCreateCopy(allocator:CFAllocatorRef, theData:CFDataRef) -> CFDataRef: ...
|
|
@dll.bind(CFMutableDataRef, CFAllocatorRef, CFIndex)
|
|
def CFDataCreateMutable(allocator:CFAllocatorRef, capacity:CFIndex) -> CFMutableDataRef: ...
|
|
@dll.bind(CFMutableDataRef, CFAllocatorRef, CFIndex, CFDataRef)
|
|
def CFDataCreateMutableCopy(allocator:CFAllocatorRef, capacity:CFIndex, theData:CFDataRef) -> CFMutableDataRef: ...
|
|
@dll.bind(CFIndex, CFDataRef)
|
|
def CFDataGetLength(theData:CFDataRef) -> CFIndex: ...
|
|
@dll.bind(c.POINTER[UInt8], CFDataRef)
|
|
def CFDataGetBytePtr(theData:CFDataRef) -> c.POINTER[UInt8]: ...
|
|
@dll.bind(c.POINTER[UInt8], CFMutableDataRef)
|
|
def CFDataGetMutableBytePtr(theData:CFMutableDataRef) -> c.POINTER[UInt8]: ...
|
|
@dll.bind(None, CFDataRef, CFRange, c.POINTER[UInt8])
|
|
def CFDataGetBytes(theData:CFDataRef, range:CFRange, buffer:c.POINTER[UInt8]) -> None: ...
|
|
@dll.bind(None, CFMutableDataRef, CFIndex)
|
|
def CFDataSetLength(theData:CFMutableDataRef, length:CFIndex) -> None: ...
|
|
@dll.bind(None, CFMutableDataRef, CFIndex)
|
|
def CFDataIncreaseLength(theData:CFMutableDataRef, extraLength:CFIndex) -> None: ...
|
|
@dll.bind(None, CFMutableDataRef, c.POINTER[UInt8], CFIndex)
|
|
def CFDataAppendBytes(theData:CFMutableDataRef, bytes:c.POINTER[UInt8], length:CFIndex) -> None: ...
|
|
@dll.bind(None, CFMutableDataRef, CFRange, c.POINTER[UInt8], CFIndex)
|
|
def CFDataReplaceBytes(theData:CFMutableDataRef, range:CFRange, newBytes:c.POINTER[UInt8], newLength:CFIndex) -> None: ...
|
|
@dll.bind(None, CFMutableDataRef, CFRange)
|
|
def CFDataDeleteBytes(theData:CFMutableDataRef, range:CFRange) -> None: ...
|
|
CFDataSearchFlags: TypeAlias = ctypes.c_uint64
|
|
_anonenum3: dict[int, str] = {(kCFDataSearchBackwards:=1): 'kCFDataSearchBackwards', (kCFDataSearchAnchored:=2): 'kCFDataSearchAnchored'}
|
|
@dll.bind(CFRange, CFDataRef, CFDataRef, CFRange, CFDataSearchFlags)
|
|
def CFDataFind(theData:CFDataRef, dataToFind:CFDataRef, searchRange:CFRange, compareOptions:CFDataSearchFlags) -> CFRange: ...
|
|
__COREFOUNDATION_CFSTRING__ = 1
|
|
kCFStringEncodingInvalidId = (0xffffffff)
|
|
CF_FORMAT_FUNCTION = lambda F,A: __attribute__((format(CFString, F, A))) # type: ignore
|
|
CF_FORMAT_ARGUMENT = lambda A: __attribute__((format_arg(A))) # type: ignore
|
|
__kCFStringInlineBufferLength = 64
|
|
__COREFOUNDATION_CFDATA__ = 1 |