this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'master' into update-sources

+1196 -915
+25 -13
cmake/darling_framework.cmake
··· 6 6 FULL_DOCS "Used to make reexporting child frameworks less painful.") 7 7 8 8 function(add_framework name) 9 - cmake_parse_arguments(FRAMEWORK "CURRENT_VERSION;FAT;PRIVATE" "VERSION;LINK_FLAGS;PARENT;PARENT_VERSION" 9 + cmake_parse_arguments(FRAMEWORK "CURRENT_VERSION;FAT;PRIVATE;IOSSUPPORT" "VERSION;LINK_FLAGS;PARENT;PARENT_VERSION" 10 10 "SOURCES;DEPENDENCIES;CIRCULAR_DEPENDENCIES;RESOURCES" ${ARGN}) 11 11 if (FRAMEWORK_CURRENT_VERSION) 12 12 set(my_name "${name}") ··· 19 19 else (FRAMEWORK_PRIVATE) 20 20 set(dir_name "Frameworks") 21 21 endif (FRAMEWORK_PRIVATE) 22 + 23 + if (FRAMEWORK_IOSSUPPORT) 24 + set(sys_library_dir "System/iOSSupport/System/Library") 25 + else (FRAMEWORK_IOSSUPPORT) 26 + set(sys_library_dir "System/Library") 27 + endif (FRAMEWORK_IOSSUPPORT) 22 28 23 29 if(DEFINED FRAMEWORK_PARENT) 24 30 if(NOT DEFINED FRAMEWORK_PARENT_VERSION) ··· 26 32 set(FRAMEWORK_PARENT_VERSION "A") 27 33 endif(NOT DEFINED FRAMEWORK_PARENT_VERSION) 28 34 InstallSymlink(Versions/Current/Frameworks 29 - "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/${dir_name}/${FRAMEWORK_PARENT}.framework/Frameworks") 35 + "${CMAKE_INSTALL_PREFIX}/libexec/darling/${sys_library_dir}/${dir_name}/${FRAMEWORK_PARENT}.framework/Frameworks") 30 36 set(dir_name "${dir_name}/${FRAMEWORK_PARENT}.framework/Versions/${FRAMEWORK_PARENT_VERSION}/Frameworks") 31 37 endif(DEFINED FRAMEWORK_PARENT) 32 38 33 - set(DYLIB_INSTALL_NAME "/System/Library/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/${name}") 39 + set(DYLIB_INSTALL_NAME "/${sys_library_dir}/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/${name}") 34 40 35 41 if (FRAMEWORK_CIRCULAR_DEPENDENCIES) 36 42 if (FRAMEWORK_FAT) ··· 71 77 set_property(TARGET ${my_name} APPEND_STRING PROPERTY LINK_FLAGS " ${FRAMEWORK_LINK_FLAGS}") 72 78 endif (FRAMEWORK_LINK_FLAGS) 73 79 74 - install(TARGETS ${my_name} DESTINATION "libexec/darling/System/Library/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/") 80 + install(TARGETS ${my_name} DESTINATION "libexec/darling/${sys_library_dir}/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/") 75 81 76 82 if (FRAMEWORK_RESOURCES) 77 83 if (FRAMEWORK_CURRENT_VERSION) 78 - InstallSymlink("Versions/Current/Resources" "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/${dir_name}/${name}.framework/Resources") 84 + InstallSymlink("Versions/Current/Resources" "${CMAKE_INSTALL_PREFIX}/libexec/darling/${sys_library_dir}/${dir_name}/${name}.framework/Resources") 79 85 endif (FRAMEWORK_CURRENT_VERSION) 80 86 while (FRAMEWORK_RESOURCES) 81 87 list(GET FRAMEWORK_RESOURCES 0 res_install_path) ··· 83 89 get_filename_component(res_install_dir ${res_install_path} DIRECTORY) 84 90 get_filename_component(res_install_name ${res_install_path} NAME) 85 91 install(FILES ${res_source_path} 86 - DESTINATION libexec/darling/System/Library/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/Resources/${res_install_dir} 92 + DESTINATION libexec/darling/${sys_library_dir}/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/Resources/${res_install_dir} 87 93 RENAME ${res_install_name}) 88 94 list(REMOVE_AT FRAMEWORK_RESOURCES 0 1) 89 95 endwhile (FRAMEWORK_RESOURCES) 90 96 endif (FRAMEWORK_RESOURCES) 91 97 92 98 if (FRAMEWORK_CURRENT_VERSION) 93 - InstallSymlink(${FRAMEWORK_VERSION} "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/${dir_name}/${name}.framework/Versions/Current") 94 - InstallSymlink("Versions/Current/${name}" "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/${dir_name}/${name}.framework/${name}") 99 + InstallSymlink(${FRAMEWORK_VERSION} "${CMAKE_INSTALL_PREFIX}/libexec/darling/${sys_library_dir}/${dir_name}/${name}.framework/Versions/Current") 100 + InstallSymlink("Versions/Current/${name}" "${CMAKE_INSTALL_PREFIX}/libexec/darling/${sys_library_dir}/${dir_name}/${name}.framework/${name}") 95 101 endif (FRAMEWORK_CURRENT_VERSION) 96 102 endfunction(add_framework) 97 103 98 104 function(add_separated_framework name) 99 - cmake_parse_arguments(FRAMEWORK "CURRENT_VERSION;PRIVATE" "VERSION;LINK_FLAGS" "SOURCES;ARCHS;DEPENDENCIES;CIRCULAR_DEPENDENCIES" ${ARGN}) 105 + cmake_parse_arguments(FRAMEWORK "CURRENT_VERSION;PRIVATE;IOSSUPPORT" "VERSION;LINK_FLAGS" "SOURCES;ARCHS;DEPENDENCIES;CIRCULAR_DEPENDENCIES" ${ARGN}) 100 106 if (FRAMEWORK_CURRENT_VERSION) 101 107 set(my_name "${name}") 102 108 else (FRAMEWORK_CURRENT_VERSION) ··· 109 115 set(dir_name "Frameworks") 110 116 endif (FRAMEWORK_PRIVATE) 111 117 112 - set(DYLIB_INSTALL_NAME "/System/Library/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/${name}") 118 + if (FRAMEWORK_IOSSUPPORT) 119 + set(sys_library_dir "System/iOSSupport/System/Library") 120 + else (FRAMEWORK_IOSSUPPORT) 121 + set(sys_library_dir "System/Library") 122 + endif (FRAMEWORK_IOSSUPPORT) 123 + 124 + set(DYLIB_INSTALL_NAME "/${sys_library_dir}/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/${name}") 113 125 114 126 if (TARGET_i386) 115 127 set(DARLING_LIB_i386_ONLY TRUE) ··· 217 229 add_dependencies(${my_name} ${my_name}_x86_64) 218 230 endif (TARGET_i386 AND TARGET_x86_64) 219 231 220 - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${my_name} DESTINATION "libexec/darling/System/Library/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/") 232 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${my_name} DESTINATION "libexec/darling/${sys_library_dir}/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/") 221 233 222 234 if (FRAMEWORK_CURRENT_VERSION) 223 - InstallSymlink(${FRAMEWORK_VERSION} "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/${dir_name}/${name}.framework/Versions/Current") 224 - InstallSymlink("Versions/Current/${name}" "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/${dir_name}/${name}.framework/${name}") 235 + InstallSymlink(${FRAMEWORK_VERSION} "${CMAKE_INSTALL_PREFIX}/libexec/darling/${sys_library_dir}/${dir_name}/${name}.framework/Versions/Current") 236 + InstallSymlink("Versions/Current/${name}" "${CMAKE_INSTALL_PREFIX}/libexec/darling/${sys_library_dir}/${dir_name}/${name}.framework/${name}") 225 237 endif (FRAMEWORK_CURRENT_VERSION) 226 238 endfunction(add_separated_framework)
+3
src/frameworks/Carbon/HIToolbox/TextInputSources.h
··· 9 9 typedef struct __TISInputSource* TISInputSourceRef; 10 10 11 11 extern const CFStringRef kTISPropertyUnicodeKeyLayoutData; 12 + extern const CFStringRef kTISPropertyInputSourceLanguages; 13 + extern const CFStringRef kTISPropertyLocalizedName; 12 14 13 15 extern TISInputSourceRef TISCopyCurrentKeyboardLayoutInputSource(void); 16 + extern TISInputSourceRef TISCopyCurrentKeyboardInputSource(void); 14 17 15 18 extern void* TISGetInputSourceProperty(TISInputSourceRef inputSourceRef, CFStringRef key); 16 19
+14 -3
src/frameworks/Carbon/HIToolbox/TextInputSources.mm
··· 8 8 static int g_lastKeyboardLayoutId = -1; 9 9 static TISInputSourceRef g_lastKeyboardLayout = NULL; 10 10 11 + const CFStringRef kTISPropertyInputSourceLanguages = CFSTR("TISPropertyInputSourceLanguages"); 12 + const CFStringRef kTISPropertyLocalizedName = CFSTR("TISPropertyLocalizedName"); 13 + 14 + TISInputSourceRef TISCopyCurrentKeyboardInputSource(void) 15 + { 16 + return TISCopyCurrentKeyboardLayoutInputSource(); 17 + } 18 + 11 19 TISInputSourceRef TISCopyCurrentKeyboardLayoutInputSource(void) 12 20 { 13 21 NSDisplay* display = [NSClassFromString(@"NSDisplay") currentDisplay]; ··· 35 43 CFDataRef data = CFDataCreate(NULL, (UInt8*) layout, length); 36 44 free(layout); 37 45 38 - const void* keys[1] = { kTISPropertyUnicodeKeyLayoutData }; 39 - const void* values[1] = { data }; 40 - CFDictionaryRef dict = CFDictionaryCreate(NULL, keys, values, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); 46 + NSString *name, *fullName; 47 + [display keyboardLayoutName: &name fullName:&fullName]; 48 + 49 + const void* keys[] = { kTISPropertyUnicodeKeyLayoutData, kTISPropertyLocalizedName, kTISPropertyInputSourceLanguages }; 50 + const void* values[] = { data, fullName, @[name] }; 51 + CFDictionaryRef dict = CFDictionaryCreate(NULL, keys, values, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); 41 52 42 53 CFRelease(data); 43 54
+5 -2
src/frameworks/IOSurface/CMakeLists.txt
··· 9 9 VERSION "A" 10 10 11 11 SOURCES 12 - src/IOSurface.m 13 - src/IOSurface.m 12 + src/stubs.m 13 + src/api.m 14 + src/constants.m 15 + src/IOSurfaceObjC.m 14 16 15 17 DEPENDENCIES 16 18 system 17 19 objc 18 20 Foundation 21 + IOKit 19 22 )
+2 -147
src/frameworks/IOSurface/include/IOSurface/IOSurface.h
··· 21 21 #ifndef _IOSurface_H_ 22 22 #define _IOSurface_H_ 23 23 24 - #import <Foundation/Foundation.h> 25 - 26 - @interface IOSurface : NSObject 27 - 28 - @end 29 - 30 - void* IOSurfaceAlignProperty(void); 31 - void* IOSurfaceAllowsPixelSizeCasting(void); 32 - void* IOSurfaceBindAccel(void); 33 - void* IOSurfaceBindAccelOnPlane(void); 34 - void* IOSurfaceClientAlignProperty(void); 35 - void* IOSurfaceClientAllowsPixelSizeCasting(void); 36 - void* IOSurfaceClientBindAccel(void); 37 - void* IOSurfaceClientCopyAllValues(void); 38 - void* IOSurfaceClientCopyDataValueBytes(void); 39 - void* IOSurfaceClientCopyValue(void); 40 - void* IOSurfaceClientCreate(void); 41 - void* IOSurfaceClientCreateMachPort(void); 42 - void* IOSurfaceClientDecrementUseCount(void); 43 - void* IOSurfaceClientFlushProcessorCaches(void); 44 - void* IOSurfaceClientGetAllocSize(void); 45 - void* IOSurfaceClientGetBaseAddress(void); 46 - void* IOSurfaceClientGetBaseAddressOfPlane(void); 47 - void* IOSurfaceClientGetBitDepthOfComponentOfPlane(void); 48 - void* IOSurfaceClientGetBitOffsetOfComponentOfPlane(void); 49 - void* IOSurfaceClientGetBulkAttachments(void); 50 - void* IOSurfaceClientGetBytesPerElement(void); 51 - void* IOSurfaceClientGetBytesPerElementOfPlane(void); 52 - void* IOSurfaceClientGetBytesPerRow(void); 53 - void* IOSurfaceClientGetBytesPerRowOfPlane(void); 54 - void* IOSurfaceClientGetCacheMode(void); 55 - void* IOSurfaceClientGetElementHeight(void); 56 - void* IOSurfaceClientGetElementHeightOfPlane(void); 57 - void* IOSurfaceClientGetElementWidth(void); 58 - void* IOSurfaceClientGetElementWidthOfPlane(void); 59 - void* IOSurfaceClientGetHeight(void); 60 - void* IOSurfaceClientGetHeightOfPlane(void); 61 - void* IOSurfaceClientGetID(void); 62 - void* IOSurfaceClientGetNameOfComponentOfPlane(void); 63 - void* IOSurfaceClientGetNumberOfComponentsOfPlane(void); 64 - void* IOSurfaceClientGetPixelFormat(void); 65 - void* IOSurfaceClientGetPlaneCount(void); 66 - void* IOSurfaceClientGetPropertyAlignment(void); 67 - void* IOSurfaceClientGetPropertyMaximum(void); 68 - void* IOSurfaceClientGetProtectionOptions(void); 69 - void* IOSurfaceClientGetRangeOfComponentOfPlane(void); 70 - void* IOSurfaceClientGetSeed(void); 71 - void* IOSurfaceClientGetSubsampling(void); 72 - void* IOSurfaceClientGetTypeOfComponentOfPlane(void); 73 - void* IOSurfaceClientGetUseCount(void); 74 - void* IOSurfaceClientGetWidth(void); 75 - void* IOSurfaceClientGetWidthOfPlane(void); 76 - void* IOSurfaceClientGetYCbCrMatrix(void); 77 - void* IOSurfaceClientIncrementUseCount(void); 78 - void* IOSurfaceClientIsDisplayable(void); 79 - void* IOSurfaceClientIsInUse(void); 80 - void* IOSurfaceClientLock(void); 81 - void* IOSurfaceClientLookup(void); 82 - void* IOSurfaceClientLookupFromMachPort(void); 83 - void* IOSurfaceClientNeedsBindAccel(void); 84 - void* IOSurfaceClientRelease(void); 85 - void* IOSurfaceClientRemoveSurfaceNotify(void); 86 - void* IOSurfaceClientRemoveValue(void); 87 - void* IOSurfaceClientRetain(void); 88 - void* IOSurfaceClientSetBulkAttachments(void); 89 - void* IOSurfaceClientSetPurgeable(void); 90 - void* IOSurfaceClientSetSurfaceNotify(void); 91 - void* IOSurfaceClientSetValue(void); 92 - void* IOSurfaceClientSetYCbCrMatrix(void); 93 - void* IOSurfaceClientSupportsProtectionOptions(void); 94 - void* IOSurfaceClientUnlock(void); 95 - void* IOSurfaceCopyAllValues(void); 96 - void* IOSurfaceCopyDataValueBytes(void); 97 - void* IOSurfaceCopyValue(void); 98 - void* IOSurfaceCreate(void); 99 - void* IOSurfaceCreateMachPort(void); 100 - void* IOSurfaceCreateXPCObject(void); 101 - void* IOSurfaceDecrementUseCount(void); 102 - void* IOSurfaceFlushProcessorCaches(void); 103 - void* IOSurfaceGetAllocSize(void); 104 - void* IOSurfaceGetBaseAddress(void); 105 - void* IOSurfaceGetBaseAddressOfPlane(void); 106 - void* IOSurfaceGetBitDepthOfComponentOfPlane(void); 107 - void* IOSurfaceGetBitOffsetOfComponentOfPlane(void); 108 - void* IOSurfaceGetBitsPerBlock(void); 109 - void* IOSurfaceGetBitsPerBlockOfPlane(void); 110 - void* IOSurfaceGetBlockHeightOfPlane(void); 111 - void* IOSurfaceGetBlockWidthOfPlane(void); 112 - void* IOSurfaceGetBulkAttachments(void); 113 - void* IOSurfaceGetBytesPerElement(void); 114 - void* IOSurfaceGetBytesPerElementOfPlane(void); 115 - void* IOSurfaceGetBytesPerRow(void); 116 - void* IOSurfaceGetBytesPerRowOfPlane(void); 117 - void* IOSurfaceGetCacheMode(void); 118 - void* IOSurfaceGetElementHeight(void); 119 - void* IOSurfaceGetElementHeightOfPlane(void); 120 - void* IOSurfaceGetElementWidth(void); 121 - void* IOSurfaceGetElementWidthOfPlane(void); 122 - void* IOSurfaceGetGraphicsCommPageAddress(void); 123 - void* IOSurfaceGetHeight(void); 124 - void* IOSurfaceGetHeightOfPlane(void); 125 - void* IOSurfaceGetID(void); 126 - void* IOSurfaceGetNameOfComponentOfPlane(void); 127 - void* IOSurfaceGetNumberOfComponentsOfPlane(void); 128 - void* IOSurfaceGetPixelFormat(void); 129 - void* IOSurfaceGetPlaneCount(void); 130 - void* IOSurfaceGetPropertyAlignment(void); 131 - void* IOSurfaceGetPropertyMaximum(void); 132 - void* IOSurfaceGetProtectionOptions(void); 133 - void* IOSurfaceGetRangeOfComponentOfPlane(void); 134 - void* IOSurfaceGetSeed(void); 135 - void* IOSurfaceGetSeedOfPlane(void); 136 - void* IOSurfaceGetSubsampling(void); 137 - void* IOSurfaceGetTypeID(void); 138 - void* IOSurfaceGetTypeOfComponentOfPlane(void); 139 - void* IOSurfaceGetUseCount(void); 140 - void* IOSurfaceGetWidth(void); 141 - void* IOSurfaceGetWidthOfPlane(void); 142 - void* IOSurfaceGetYCbCrMatrix(void); 143 - void* IOSurfaceIncrementUseCount(void); 144 - void* IOSurfaceIsDisplayable(void); 145 - void* IOSurfaceIsInUse(void); 146 - void* IOSurfaceLock(void); 147 - void* IOSurfaceLockPlane(void); 148 - void* IOSurfaceLog(void); 149 - void* IOSurfaceLookup(void); 150 - void* IOSurfaceLookupFromMachPort(void); 151 - void* IOSurfaceLookupFromXPCObject(void); 152 - void* IOSurfaceNeedsBindAccel(void); 153 - void* IOSurfaceNeedsBindAccelOnPlane(void); 154 - void* IOSurfaceNotifierCreate(void); 155 - void* IOSurfaceNotifierGetMachPort(void); 156 - void* IOSurfaceNotifierGetRunLoopSource(void); 157 - void* IOSurfaceNotifierGetTypeID(void); 158 - void* IOSurfaceNotifierSetDispatchQueue(void); 159 - void* IOSurfaceRemoveAllValues(void); 160 - void* IOSurfaceRemoveValue(void); 161 - void* IOSurfaceSetBulkAttachments(void); 162 - void* IOSurfaceSetBulkAttachments2(void); 163 - void* IOSurfaceSetPurgeable(void); 164 - void* IOSurfaceSetValue(void); 165 - void* IOSurfaceSetValues(void); 166 - void* IOSurfaceSetYCbCrMatrix(void); 167 - void* IOSurfaceSupportsProtectionOptions(void); 168 - void* IOSurfaceUnlock(void); 169 - void* IOSurfaceUnlockPlane(void); 170 - void* _ioSurfaceAddClientRef(void); 24 + #include <IOSurface/IOSurfaceBase.h> 25 + #include <IOSurface/IOSurfaceAPI.h> 171 26 172 27 #endif
+17
src/frameworks/IOSurface/include/IOSurface/IOSurfaceAPI.h
··· 1 + #ifndef IOSURFACE_API_H 2 + #define IOSURFACE_API_H 3 + 4 + #include <IOKit/IOKitLib.h> 5 + #include <xpc/xpc.h> 6 + #include <IOSurface/IOSurfaceBase.h> 7 + #include <IOSurface/IOSurfaceTypes.h> 8 + #include <IOSurface/IOSurfaceRef.h> 9 + 10 + __BEGIN_DECLS 11 + 12 + xpc_object_t IOSurfaceCreateXPCObject(IOSurfaceRef surface); 13 + IOSurfaceRef IOSurfaceLookupFromXPCObject(xpc_object_t obj); 14 + 15 + __END_DECLS 16 + 17 + #endif
+9
src/frameworks/IOSurface/include/IOSurface/IOSurfaceBase.h
··· 1 + #ifndef IOSURFACE_BASE_H 2 + #define IOSURFACE_BASE_H 3 + 4 + #include <sys/cdefs.h> 5 + #include <mach/kern_return.h> 6 + #include <CoreFoundation/CoreFoundation.h> 7 + #include <xpc/xpc.h> 8 + 9 + #endif
+96
src/frameworks/IOSurface/include/IOSurface/IOSurfaceObjC.h
··· 1 + #ifndef IOSURFACE_OBJC_H 2 + #define IOSURFACE_OBJC_H 3 + 4 + #ifdef __OBJC__ 5 + 6 + #import <IOSurface/IOSurfaceTypes.h> 7 + #import <Foundation/NSObject.h> 8 + #import <Foundation/NSDictionary.h> 9 + 10 + typedef NSString *IOSurfacePropertyKey; 11 + 12 + __BEGIN_DECLS 13 + 14 + 15 + extern IOSurfacePropertyKey IOSurfacePropertyKeyAllocSize; 16 + extern IOSurfacePropertyKey IOSurfacePropertyKeyWidth; 17 + extern IOSurfacePropertyKey IOSurfacePropertyKeyHeight; 18 + extern IOSurfacePropertyKey IOSurfacePropertyKeyBytesPerRow; 19 + extern IOSurfacePropertyKey IOSurfacePropertyKeyBytesPerElement; 20 + extern IOSurfacePropertyKey IOSurfacePropertyKeyElementWidth; 21 + extern IOSurfacePropertyKey IOSurfacePropertyKeyElementHeight; 22 + extern IOSurfacePropertyKey IOSurfacePropertyKeyOffset; 23 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneInfo; 24 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneWidth; 25 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneHeight; 26 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneBytesPerRow; 27 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneOffset; 28 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneSize; 29 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneBase; 30 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneBytesPerElement; 31 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneElementWidth; 32 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPlaneElementHeight; 33 + extern IOSurfacePropertyKey IOSurfacePropertyKeyCacheMode; 34 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPixelFormat; 35 + extern IOSurfacePropertyKey IOSurfacePropertyKeyPixelSizeCastingAllowed; 36 + 37 + 38 + @interface IOSurface : NSObject <NSSecureCoding> 39 + { 40 + @package 41 + void * _impl; 42 + } 43 + 44 + - (nullable instancetype)initWithProperties:(NSDictionary <IOSurfacePropertyKey, id> *)properties; 45 + - (nullable instancetype)initWithMachPort:(mach_port_t)port; 46 + - (nullable instancetype)initWithSurfaceID:(IOSurfaceID)surfaceID; 47 + - (kern_return_t)lockWithOptions:(IOSurfaceLockOptions)options seed:(nullable uint32_t *)seed; 48 + - (kern_return_t)unlockWithOptions:(IOSurfaceLockOptions)options seed:(nullable uint32_t *)seed; 49 + 50 + 51 + @property (readonly) NSInteger allocationSize; 52 + 53 + @property (readonly) NSInteger width; 54 + @property (readonly) NSInteger height; 55 + @property (readonly) void *baseAddress; 56 + @property (readonly) OSType pixelFormat; 57 + 58 + @property (readonly) NSInteger bytesPerRow; 59 + @property (readonly) NSInteger bytesPerElement; 60 + @property (readonly) NSInteger elementWidth; 61 + @property (readonly) NSInteger elementHeight; 62 + @property (readonly) uint32_t seed; 63 + @property (readonly) NSUInteger planeCount; 64 + 65 + - (NSInteger)widthOfPlaneAtIndex:(NSUInteger)planeIndex; 66 + - (NSInteger)heightOfPlaneAtIndex:(NSUInteger)planeIndex; 67 + - (NSInteger)bytesPerRowOfPlaneAtIndex:(NSUInteger)planeIndex; 68 + - (NSInteger)bytesPerElementOfPlaneAtIndex:(NSUInteger)planeIndex; 69 + - (NSInteger)elementWidthOfPlaneAtIndex:(NSUInteger)planeIndex; 70 + - (NSInteger)elementHeightOfPlaneAtIndex:(NSUInteger)planeIndex; 71 + - (void *)baseAddressOfPlaneAtIndex:(NSUInteger)planeIndex; 72 + 73 + - (void)setAttachment:(id)anObject forKey:(NSString *)key; 74 + - (nullable id)attachmentForKey:(NSString *)key; 75 + - (void)removeAttachmentForKey:(NSString *)key; 76 + - (void)setAllAttachments:(NSDictionary<NSString *, id> *)dict; 77 + - (nullable NSDictionary<NSString *, id> *)allAttachments; 78 + - (void)removeAllAttachments; 79 + @property (readonly, getter = isInUse) BOOL inUse; 80 + - (void)incrementUseCount; 81 + - (void)decrementUseCount; 82 + 83 + @property (readonly ) int32_t localUseCount; 84 + @property (readonly) BOOL allowsPixelSizeCasting; 85 + 86 + - (kern_return_t)setPurgeable:(IOSurfacePurgeabilityState)newState oldState:(IOSurfacePurgeabilityState * _Nullable)oldState; 87 + 88 + @end 89 + 90 + 91 + extern IOSurfacePropertyKey IOSurfacePropertyAllocSizeKey; 92 + 93 + __END_DECLS 94 + 95 + #endif // __OBJC__ 96 + #endif
+88
src/frameworks/IOSurface/include/IOSurface/IOSurfacePriv.h
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2020 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #ifndef IOSURFACE_PRIV_H 21 + #define IOSURFACE_PRIV_H 22 + #include <IOSurface/IOSurfaceTypes.h> 23 + #include <stdint.h> 24 + 25 + // Private API definition between IOSurface.framework and iokitd 26 + 27 + // IOSurfaceID is passed in as "input" if it's the only argument 28 + // struct contents as passed in "inputStruct". 29 + // See IOConnectCallMethod(). 30 + 31 + enum 32 + { 33 + // in: dictionary 34 + // out: _IOSurfaceObjectRetval 35 + kIOSurfaceMethodCreate = 0, 36 + // in: IOSurfaceID 37 + kIOSurfaceMethodRelease = 1, 38 + // in: struct _IOSurfaceLockUnlock 39 + kIOSurfaceMethodLock = 2, 40 + // in: struct _IOSurfaceLockUnlock 41 + kIOSurfaceMethodUnlock = 3, 42 + // in: IOSurfaceID 43 + kIOSurfaceMethodLookupByID = 4, 44 + kIOSurfaceMethodSetValue = 9, 45 + // out: data for IOCFUnserializeWithSize() 46 + kIOSurfaceMethodGetValues = 10, 47 + kIOSurfaceMethodRemoveValue = 11, 48 + // in: IOSurfaceID 49 + kIOSurfaceMethodIncrementUseCount = 14, 50 + // in: IOSurfaceID 51 + kIOSurfaceMethodDecrementUseCount = 15, 52 + // in: mach_port_t as a plain value 53 + // out: _IOSurfaceObjectRetval 54 + kIOSurfaceMethodCreateByMachPort = 34, 55 + // in: IOSurfaceID 56 + // out: mach_port_t as a plain value 57 + kIOSurfaceMethodCreateMachPort = 35, 58 + }; 59 + 60 + struct _IOSurfacePlane 61 + { 62 + uint64_t memoryOffset; 63 + 64 + uint32_t bytesPerElement; 65 + uint32_t width; 66 + uint32_t height; 67 + uint32_t bytesPerRow; 68 + }; 69 + 70 + struct _IOSurfaceObjectRetval 71 + { 72 + IOSurfaceID surfaceID; 73 + uint32_t pixelFormat; 74 + 75 + // Where mapped into memory 76 + uint64_t address; 77 + 78 + uint32_t planeCount; 79 + struct _IOSurfacePlane planes[1]; 80 + }; 81 + 82 + struct _IOSurfaceLockUnlock 83 + { 84 + IOSurfaceID surfaceID; 85 + uint32_t options; 86 + }; 87 + 88 + #endif
+184
src/frameworks/IOSurface/include/IOSurface/IOSurfaceRef.h
··· 1 + #ifndef IOSURFACE_REF_H 2 + #define IOSURFACE_REF_H 3 + 4 + #include <CoreFoundation/CoreFoundation.h> 5 + #include <IOSurface/IOSurfaceTypes.h> 6 + 7 + __BEGIN_DECLS 8 + 9 + typedef struct __IOSurface *IOSurfaceRef; 10 + 11 + 12 + extern const CFStringRef kIOSurfaceAllocSize; 13 + extern const CFStringRef kIOSurfaceWidth; 14 + extern const CFStringRef kIOSurfaceHeight; 15 + extern const CFStringRef kIOSurfaceBytesPerRow; 16 + extern const CFStringRef kIOSurfaceBytesPerElement; 17 + extern const CFStringRef kIOSurfaceElementWidth; 18 + extern const CFStringRef kIOSurfaceElementHeight; 19 + extern const CFStringRef kIOSurfaceOffset; 20 + extern const CFStringRef kIOSurfacePlaneInfo; 21 + extern const CFStringRef kIOSurfacePlaneWidth; 22 + extern const CFStringRef kIOSurfacePlaneHeight; 23 + extern const CFStringRef kIOSurfacePlaneBytesPerRow; 24 + extern const CFStringRef kIOSurfacePlaneOffset; 25 + extern const CFStringRef kIOSurfacePlaneSize; 26 + extern const CFStringRef kIOSurfacePlaneBase; 27 + extern const CFStringRef kIOSurfacePlaneBitsPerElement; 28 + extern const CFStringRef kIOSurfacePlaneBytesPerElement; 29 + extern const CFStringRef kIOSurfacePlaneElementWidth; 30 + extern const CFStringRef kIOSurfacePlaneElementHeight; 31 + extern const CFStringRef kIOSurfaceCacheMode; 32 + extern const CFStringRef kIOSurfaceIsGlobal; 33 + extern const CFStringRef kIOSurfacePixelFormat; 34 + extern const CFStringRef kIOSurfacePixelSizeCastingAllowed; 35 + extern const CFStringRef kIOSurfacePlaneComponentBitDepths; 36 + extern const CFStringRef kIOSurfacePlaneComponentBitOffsets; 37 + 38 + typedef int32_t IOSurfaceComponentName; enum { 39 + kIOSurfaceComponentNameUnknown = 0, 40 + kIOSurfaceComponentNameAlpha = 1, 41 + kIOSurfaceComponentNameRed = 2, 42 + kIOSurfaceComponentNameGreen = 3, 43 + kIOSurfaceComponentNameBlue = 4, 44 + kIOSurfaceComponentNameLuma = 5, 45 + kIOSurfaceComponentNameChromaRed = 6, 46 + kIOSurfaceComponentNameChromaBlue = 7, 47 + }; 48 + 49 + 50 + 51 + extern const CFStringRef kIOSurfacePlaneComponentNames; 52 + 53 + typedef int32_t IOSurfaceComponentType; enum { 54 + kIOSurfaceComponentTypeUnknown = 0, 55 + kIOSurfaceComponentTypeUnsignedInteger = 1, 56 + kIOSurfaceComponentTypeSignedInteger = 2, 57 + kIOSurfaceComponentTypeFloat = 3, 58 + }; 59 + 60 + 61 + extern const CFStringRef kIOSurfacePlaneComponentTypes; 62 + 63 + typedef int32_t IOSurfaceComponentRange; enum { 64 + kIOSurfaceComponentRangeUnknown = 0, 65 + kIOSurfaceComponentRangeFullRange = 1, 66 + kIOSurfaceComponentRangeVideoRange = 2, 67 + kIOSurfaceComponentRangeWideRange = 3, 68 + }; 69 + 70 + 71 + extern const CFStringRef kIOSurfacePlaneComponentRanges; 72 + 73 + typedef int32_t IOSurfaceSubsampling; enum { 74 + kIOSurfaceSubsamplingUnknown = 0, 75 + kIOSurfaceSubsamplingNone = 1, 76 + kIOSurfaceSubsampling422 = 2, 77 + kIOSurfaceSubsampling420 = 3, 78 + kIOSurfaceSubsampling411 = 4, 79 + }; 80 + 81 + 82 + extern const CFStringRef kIOSurfaceSubsampling; 83 + 84 + CFTypeID IOSurfaceGetTypeID(void); 85 + 86 + IOSurfaceRef _Nullable IOSurfaceCreate(CFDictionaryRef properties); 87 + 88 + IOSurfaceRef _Nullable IOSurfaceLookup(IOSurfaceID csid); 89 + 90 + IOSurfaceID IOSurfaceGetID(IOSurfaceRef buffer); 91 + kern_return_t IOSurfaceLock(IOSurfaceRef buffer, IOSurfaceLockOptions options, uint32_t * _Nullable seed); 92 + kern_return_t IOSurfaceUnlock(IOSurfaceRef buffer, IOSurfaceLockOptions options, uint32_t * _Nullable seed); 93 + 94 + 95 + size_t IOSurfaceGetAllocSize(IOSurfaceRef buffer); 96 + 97 + size_t IOSurfaceGetWidth(IOSurfaceRef buffer); 98 + 99 + size_t IOSurfaceGetHeight(IOSurfaceRef buffer); 100 + 101 + size_t IOSurfaceGetBytesPerElement(IOSurfaceRef buffer); 102 + 103 + size_t IOSurfaceGetBytesPerRow(IOSurfaceRef buffer); 104 + 105 + void *IOSurfaceGetBaseAddress(IOSurfaceRef buffer); 106 + 107 + size_t IOSurfaceGetElementWidth(IOSurfaceRef buffer); 108 + 109 + size_t IOSurfaceGetElementHeight(IOSurfaceRef buffer); 110 + 111 + OSType IOSurfaceGetPixelFormat(IOSurfaceRef buffer); 112 + 113 + 114 + uint32_t IOSurfaceGetSeed(IOSurfaceRef buffer); 115 + 116 + 117 + size_t IOSurfaceGetPlaneCount(IOSurfaceRef buffer); 118 + size_t IOSurfaceGetWidthOfPlane(IOSurfaceRef buffer, size_t planeIndex); 119 + 120 + size_t IOSurfaceGetHeightOfPlane(IOSurfaceRef buffer, size_t planeIndex); 121 + 122 + size_t IOSurfaceGetBytesPerElementOfPlane(IOSurfaceRef buffer, size_t planeIndex); 123 + 124 + size_t IOSurfaceGetBytesPerRowOfPlane(IOSurfaceRef buffer, size_t planeIndex); 125 + 126 + void *IOSurfaceGetBaseAddressOfPlane(IOSurfaceRef buffer, size_t planeIndex); 127 + 128 + size_t IOSurfaceGetElementWidthOfPlane(IOSurfaceRef buffer, size_t planeIndex); 129 + 130 + size_t IOSurfaceGetElementHeightOfPlane(IOSurfaceRef buffer, size_t planeIndex); 131 + 132 + 133 + size_t IOSurfaceGetNumberOfComponentsOfPlane(IOSurfaceRef buffer, size_t planeIndex); 134 + 135 + IOSurfaceComponentName IOSurfaceGetNameOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex); 136 + 137 + IOSurfaceComponentType IOSurfaceGetTypeOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex); 138 + 139 + IOSurfaceComponentRange IOSurfaceGetRangeOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex); 140 + 141 + size_t IOSurfaceGetBitDepthOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex); 142 + 143 + size_t IOSurfaceGetBitOffsetOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex); 144 + 145 + IOSurfaceSubsampling IOSurfaceGetSubsampling(IOSurfaceRef buffer); 146 + 147 + 148 + void IOSurfaceSetValue(IOSurfaceRef buffer, CFStringRef key, CFTypeRef value); 149 + 150 + CFTypeRef _Nullable IOSurfaceCopyValue(IOSurfaceRef buffer, CFStringRef key); 151 + 152 + void IOSurfaceRemoveValue(IOSurfaceRef buffer, CFStringRef key); 153 + 154 + void IOSurfaceSetValues(IOSurfaceRef buffer, CFDictionaryRef keysAndValues); 155 + 156 + CFDictionaryRef _Nullable IOSurfaceCopyAllValues(IOSurfaceRef buffer); 157 + 158 + void IOSurfaceRemoveAllValues(IOSurfaceRef buffer); 159 + 160 + 161 + mach_port_t IOSurfaceCreateMachPort(IOSurfaceRef buffer); 162 + 163 + 164 + IOSurfaceRef _Nullable IOSurfaceLookupFromMachPort(mach_port_t port); 165 + size_t IOSurfaceGetPropertyMaximum(CFStringRef property); 166 + size_t IOSurfaceGetPropertyAlignment(CFStringRef property); 167 + 168 + 169 + size_t IOSurfaceAlignProperty(CFStringRef property, size_t value); 170 + void IOSurfaceIncrementUseCount(IOSurfaceRef buffer); 171 + 172 + void IOSurfaceDecrementUseCount(IOSurfaceRef buffer); 173 + 174 + int32_t IOSurfaceGetUseCount(IOSurfaceRef buffer); 175 + 176 + Boolean IOSurfaceIsInUse(IOSurfaceRef buffer); 177 + 178 + 179 + Boolean IOSurfaceAllowsPixelSizeCasting(IOSurfaceRef buffer); 180 + kern_return_t IOSurfaceSetPurgeable(IOSurfaceRef buffer, uint32_t newState, uint32_t * _Nullable oldState); 181 + 182 + __END_DECLS 183 + 184 + #endif
+45
src/frameworks/IOSurface/include/IOSurface/IOSurfaceTypes.h
··· 1 + #ifndef IOSURFACE_TYPES_H 2 + #define IOSURFACE_TYPES_H 3 + 4 + #include <IOSurface/IOSurfaceBase.h> 5 + 6 + #define kIOSurfaceSuccess KERN_SUCCESS 7 + 8 + typedef uint32_t IOSurfaceID; 9 + 10 + typedef CF_OPTIONS(uint32_t, IOSurfaceLockOptions) 11 + { 12 + kIOSurfaceLockReadOnly = 1, 13 + kIOSurfaceLockAvoidSync = 2, 14 + }; 15 + 16 + typedef CF_OPTIONS(uint32_t, IOSurfacePurgeabilityState) 17 + { 18 + kIOSurfacePurgeableNonVolatile = 0, 19 + kIOSurfacePurgeableVolatile = 1, 20 + kIOSurfacePurgeableEmpty = 2, 21 + kIOSurfacePurgeableKeepCurrent = 3, 22 + }; 23 + 24 + enum 25 + { 26 + kIOSurfaceDefaultCache = 0, 27 + kIOSurfaceInhibitCache = 1, 28 + kIOSurfaceWriteThruCache = 2, 29 + kIOSurfaceCopybackCache = 3, 30 + kIOSurfaceWriteCombineCache = 4, 31 + kIOSurfaceCopybackInnerCache = 5, 32 + }; 33 + 34 + enum 35 + { 36 + kIOSurfaceMapCacheShift = 8, 37 + kIOSurfaceMapDefaultCache = kIOSurfaceDefaultCache << kIOSurfaceMapCacheShift, 38 + kIOSurfaceMapInhibitCache = kIOSurfaceInhibitCache << kIOSurfaceMapCacheShift, 39 + kIOSurfaceMapWriteThruCache = kIOSurfaceWriteThruCache << kIOSurfaceMapCacheShift, 40 + kIOSurfaceMapCopybackCache = kIOSurfaceCopybackCache << kIOSurfaceMapCacheShift, 41 + kIOSurfaceMapWriteCombineCache = kIOSurfaceWriteCombineCache << kIOSurfaceMapCacheShift, 42 + kIOSurfaceMapCopybackInnerCache = kIOSurfaceCopybackInnerCache << kIOSurfaceMapCacheShift, 43 + }; 44 + 45 + #endif
-749
src/frameworks/IOSurface/src/IOSurface.m
··· 1 - /* 2 - This file is part of Darling. 3 - 4 - Copyright (C) 2017 Lubos Dolezel 5 - 6 - Darling is free software: you can redistribute it and/or modify 7 - it under the terms of the GNU General Public License as published by 8 - the Free Software Foundation, either version 3 of the License, or 9 - (at your option) any later version. 10 - 11 - Darling is distributed in the hope that it will be useful, 12 - but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 - GNU General Public License for more details. 15 - 16 - You should have received a copy of the GNU General Public License 17 - along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 - */ 19 - 20 - #include <stdlib.h> 21 - #include <stdio.h> 22 - #import <IOSurface/IOSurface.h> 23 - 24 - #include <CoreFoundation/CoreFoundation.h> 25 - 26 - const CFStringRef kIOSurfaceBytesPerElement = CFSTR("kIOSurfaceBytesPerElement"); 27 - const CFStringRef kIOSurfaceHeight = CFSTR("kIOSurfaceHeight"); 28 - const CFStringRef kIOSurfaceIsGlobal = CFSTR("kIOSurfaceIsGlobal"); 29 - const CFStringRef kIOSurfacePixelFormat = CFSTR("kIOSurfacePixelFormat"); 30 - const CFStringRef kIOSurfaceWidth = CFSTR("kIOSurfaceWidth"); 31 - 32 - static int verbose = 0; 33 - 34 - __attribute__((constructor)) 35 - static void initme(void) { 36 - verbose = getenv("STUB_VERBOSE") != NULL; 37 - } 38 - 39 - @implementation IOSurface 40 - 41 - - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { 42 - return [NSMethodSignature signatureWithObjCTypes: "v@:"]; 43 - } 44 - 45 - - (void)forwardInvocation:(NSInvocation *)anInvocation { 46 - NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]); 47 - } 48 - 49 - @end 50 - 51 - void* IOSurfaceAllowsPixelSizeCasting(void) { 52 - if (verbose) puts("STUB: IOSurfaceAllowsPixelSizeCasting called"); 53 - return NULL; 54 - } 55 - 56 - void* IOSurfaceBindAccel(void) { 57 - if (verbose) puts("STUB: IOSurfaceBindAccel called"); 58 - return NULL; 59 - } 60 - 61 - void* IOSurfaceBindAccelOnPlane(void) { 62 - if (verbose) puts("STUB: IOSurfaceBindAccelOnPlane called"); 63 - return NULL; 64 - } 65 - 66 - void* IOSurfaceClientAlignProperty(void) { 67 - if (verbose) puts("STUB: IOSurfaceClientAlignProperty called"); 68 - return NULL; 69 - } 70 - 71 - void* IOSurfaceClientAllowsPixelSizeCasting(void) { 72 - if (verbose) puts("STUB: IOSurfaceClientAllowsPixelSizeCasting called"); 73 - return NULL; 74 - } 75 - 76 - void* IOSurfaceClientBindAccel(void) { 77 - if (verbose) puts("STUB: IOSurfaceClientBindAccel called"); 78 - return NULL; 79 - } 80 - 81 - void* IOSurfaceClientCopyAllValues(void) { 82 - if (verbose) puts("STUB: IOSurfaceClientCopyAllValues called"); 83 - return NULL; 84 - } 85 - 86 - void* IOSurfaceClientCopyDataValueBytes(void) { 87 - if (verbose) puts("STUB: IOSurfaceClientCopyDataValueBytes called"); 88 - return NULL; 89 - } 90 - 91 - void* IOSurfaceClientCopyValue(void) { 92 - if (verbose) puts("STUB: IOSurfaceClientCopyValue called"); 93 - return NULL; 94 - } 95 - 96 - void* IOSurfaceClientCreate(void) { 97 - if (verbose) puts("STUB: IOSurfaceClientCreate called"); 98 - return NULL; 99 - } 100 - 101 - void* IOSurfaceClientCreateMachPort(void) { 102 - if (verbose) puts("STUB: IOSurfaceClientCreateMachPort called"); 103 - return NULL; 104 - } 105 - 106 - void* IOSurfaceClientDecrementUseCount(void) { 107 - if (verbose) puts("STUB: IOSurfaceClientDecrementUseCount called"); 108 - return NULL; 109 - } 110 - 111 - void* IOSurfaceClientFlushProcessorCaches(void) { 112 - if (verbose) puts("STUB: IOSurfaceClientFlushProcessorCaches called"); 113 - return NULL; 114 - } 115 - 116 - void* IOSurfaceClientGetAllocSize(void) { 117 - if (verbose) puts("STUB: IOSurfaceClientGetAllocSize called"); 118 - return NULL; 119 - } 120 - 121 - void* IOSurfaceClientGetBaseAddress(void) { 122 - if (verbose) puts("STUB: IOSurfaceClientGetBaseAddress called"); 123 - return NULL; 124 - } 125 - 126 - void* IOSurfaceClientGetBaseAddressOfPlane(void) { 127 - if (verbose) puts("STUB: IOSurfaceClientGetBaseAddressOfPlane called"); 128 - return NULL; 129 - } 130 - 131 - void* IOSurfaceClientGetBitDepthOfComponentOfPlane(void) { 132 - if (verbose) puts("STUB: IOSurfaceClientGetBitDepthOfComponentOfPlane called"); 133 - return NULL; 134 - } 135 - 136 - void* IOSurfaceClientGetBitOffsetOfComponentOfPlane(void) { 137 - if (verbose) puts("STUB: IOSurfaceClientGetBitOffsetOfComponentOfPlane called"); 138 - return NULL; 139 - } 140 - 141 - void* IOSurfaceClientGetBulkAttachments(void) { 142 - if (verbose) puts("STUB: IOSurfaceClientGetBulkAttachments called"); 143 - return NULL; 144 - } 145 - 146 - void* IOSurfaceClientGetBytesPerElement(void) { 147 - if (verbose) puts("STUB: IOSurfaceClientGetBytesPerElement called"); 148 - return NULL; 149 - } 150 - 151 - void* IOSurfaceClientGetBytesPerElementOfPlane(void) { 152 - if (verbose) puts("STUB: IOSurfaceClientGetBytesPerElementOfPlane called"); 153 - return NULL; 154 - } 155 - 156 - void* IOSurfaceClientGetBytesPerRow(void) { 157 - if (verbose) puts("STUB: IOSurfaceClientGetBytesPerRow called"); 158 - return NULL; 159 - } 160 - 161 - void* IOSurfaceClientGetBytesPerRowOfPlane(void) { 162 - if (verbose) puts("STUB: IOSurfaceClientGetBytesPerRowOfPlane called"); 163 - return NULL; 164 - } 165 - 166 - void* IOSurfaceClientGetCacheMode(void) { 167 - if (verbose) puts("STUB: IOSurfaceClientGetCacheMode called"); 168 - return NULL; 169 - } 170 - 171 - void* IOSurfaceClientGetElementHeight(void) { 172 - if (verbose) puts("STUB: IOSurfaceClientGetElementHeight called"); 173 - return NULL; 174 - } 175 - 176 - void* IOSurfaceClientGetElementHeightOfPlane(void) { 177 - if (verbose) puts("STUB: IOSurfaceClientGetElementHeightOfPlane called"); 178 - return NULL; 179 - } 180 - 181 - void* IOSurfaceClientGetElementWidth(void) { 182 - if (verbose) puts("STUB: IOSurfaceClientGetElementWidth called"); 183 - return NULL; 184 - } 185 - 186 - void* IOSurfaceClientGetElementWidthOfPlane(void) { 187 - if (verbose) puts("STUB: IOSurfaceClientGetElementWidthOfPlane called"); 188 - return NULL; 189 - } 190 - 191 - void* IOSurfaceClientGetHeight(void) { 192 - if (verbose) puts("STUB: IOSurfaceClientGetHeight called"); 193 - return NULL; 194 - } 195 - 196 - void* IOSurfaceClientGetHeightOfPlane(void) { 197 - if (verbose) puts("STUB: IOSurfaceClientGetHeightOfPlane called"); 198 - return NULL; 199 - } 200 - 201 - void* IOSurfaceClientGetID(void) { 202 - if (verbose) puts("STUB: IOSurfaceClientGetID called"); 203 - return NULL; 204 - } 205 - 206 - void* IOSurfaceClientGetNameOfComponentOfPlane(void) { 207 - if (verbose) puts("STUB: IOSurfaceClientGetNameOfComponentOfPlane called"); 208 - return NULL; 209 - } 210 - 211 - void* IOSurfaceClientGetNumberOfComponentsOfPlane(void) { 212 - if (verbose) puts("STUB: IOSurfaceClientGetNumberOfComponentsOfPlane called"); 213 - return NULL; 214 - } 215 - 216 - void* IOSurfaceClientGetPixelFormat(void) { 217 - if (verbose) puts("STUB: IOSurfaceClientGetPixelFormat called"); 218 - return NULL; 219 - } 220 - 221 - void* IOSurfaceClientGetPlaneCount(void) { 222 - if (verbose) puts("STUB: IOSurfaceClientGetPlaneCount called"); 223 - return NULL; 224 - } 225 - 226 - void* IOSurfaceClientGetPropertyAlignment(void) { 227 - if (verbose) puts("STUB: IOSurfaceClientGetPropertyAlignment called"); 228 - return NULL; 229 - } 230 - 231 - void* IOSurfaceClientGetPropertyMaximum(void) { 232 - if (verbose) puts("STUB: IOSurfaceClientGetPropertyMaximum called"); 233 - return NULL; 234 - } 235 - 236 - void* IOSurfaceClientGetProtectionOptions(void) { 237 - if (verbose) puts("STUB: IOSurfaceClientGetProtectionOptions called"); 238 - return NULL; 239 - } 240 - 241 - void* IOSurfaceClientGetRangeOfComponentOfPlane(void) { 242 - if (verbose) puts("STUB: IOSurfaceClientGetRangeOfComponentOfPlane called"); 243 - return NULL; 244 - } 245 - 246 - void* IOSurfaceClientGetSeed(void) { 247 - if (verbose) puts("STUB: IOSurfaceClientGetSeed called"); 248 - return NULL; 249 - } 250 - 251 - void* IOSurfaceClientGetSubsampling(void) { 252 - if (verbose) puts("STUB: IOSurfaceClientGetSubsampling called"); 253 - return NULL; 254 - } 255 - 256 - void* IOSurfaceClientGetTypeOfComponentOfPlane(void) { 257 - if (verbose) puts("STUB: IOSurfaceClientGetTypeOfComponentOfPlane called"); 258 - return NULL; 259 - } 260 - 261 - void* IOSurfaceClientGetUseCount(void) { 262 - if (verbose) puts("STUB: IOSurfaceClientGetUseCount called"); 263 - return NULL; 264 - } 265 - 266 - void* IOSurfaceClientGetWidth(void) { 267 - if (verbose) puts("STUB: IOSurfaceClientGetWidth called"); 268 - return NULL; 269 - } 270 - 271 - void* IOSurfaceClientGetWidthOfPlane(void) { 272 - if (verbose) puts("STUB: IOSurfaceClientGetWidthOfPlane called"); 273 - return NULL; 274 - } 275 - 276 - void* IOSurfaceClientGetYCbCrMatrix(void) { 277 - if (verbose) puts("STUB: IOSurfaceClientGetYCbCrMatrix called"); 278 - return NULL; 279 - } 280 - 281 - void* IOSurfaceClientIncrementUseCount(void) { 282 - if (verbose) puts("STUB: IOSurfaceClientIncrementUseCount called"); 283 - return NULL; 284 - } 285 - 286 - void* IOSurfaceClientIsDisplayable(void) { 287 - if (verbose) puts("STUB: IOSurfaceClientIsDisplayable called"); 288 - return NULL; 289 - } 290 - 291 - void* IOSurfaceClientIsInUse(void) { 292 - if (verbose) puts("STUB: IOSurfaceClientIsInUse called"); 293 - return NULL; 294 - } 295 - 296 - void* IOSurfaceClientLock(void) { 297 - if (verbose) puts("STUB: IOSurfaceClientLock called"); 298 - return NULL; 299 - } 300 - 301 - void* IOSurfaceClientLookup(void) { 302 - if (verbose) puts("STUB: IOSurfaceClientLookup called"); 303 - return NULL; 304 - } 305 - 306 - void* IOSurfaceClientLookupFromMachPort(void) { 307 - if (verbose) puts("STUB: IOSurfaceClientLookupFromMachPort called"); 308 - return NULL; 309 - } 310 - 311 - void* IOSurfaceClientNeedsBindAccel(void) { 312 - if (verbose) puts("STUB: IOSurfaceClientNeedsBindAccel called"); 313 - return NULL; 314 - } 315 - 316 - void* IOSurfaceClientRelease(void) { 317 - if (verbose) puts("STUB: IOSurfaceClientRelease called"); 318 - return NULL; 319 - } 320 - 321 - void* IOSurfaceClientRemoveSurfaceNotify(void) { 322 - if (verbose) puts("STUB: IOSurfaceClientRemoveSurfaceNotify called"); 323 - return NULL; 324 - } 325 - 326 - void* IOSurfaceClientRemoveValue(void) { 327 - if (verbose) puts("STUB: IOSurfaceClientRemoveValue called"); 328 - return NULL; 329 - } 330 - 331 - void* IOSurfaceClientRetain(void) { 332 - if (verbose) puts("STUB: IOSurfaceClientRetain called"); 333 - return NULL; 334 - } 335 - 336 - void* IOSurfaceClientSetBulkAttachments(void) { 337 - if (verbose) puts("STUB: IOSurfaceClientSetBulkAttachments called"); 338 - return NULL; 339 - } 340 - 341 - void* IOSurfaceClientSetPurgeable(void) { 342 - if (verbose) puts("STUB: IOSurfaceClientSetPurgeable called"); 343 - return NULL; 344 - } 345 - 346 - void* IOSurfaceClientSetSurfaceNotify(void) { 347 - if (verbose) puts("STUB: IOSurfaceClientSetSurfaceNotify called"); 348 - return NULL; 349 - } 350 - 351 - void* IOSurfaceClientSetValue(void) { 352 - if (verbose) puts("STUB: IOSurfaceClientSetValue called"); 353 - return NULL; 354 - } 355 - 356 - void* IOSurfaceClientSetYCbCrMatrix(void) { 357 - if (verbose) puts("STUB: IOSurfaceClientSetYCbCrMatrix called"); 358 - return NULL; 359 - } 360 - 361 - void* IOSurfaceClientSupportsProtectionOptions(void) { 362 - if (verbose) puts("STUB: IOSurfaceClientSupportsProtectionOptions called"); 363 - return NULL; 364 - } 365 - 366 - void* IOSurfaceClientUnlock(void) { 367 - if (verbose) puts("STUB: IOSurfaceClientUnlock called"); 368 - return NULL; 369 - } 370 - 371 - void* IOSurfaceCopyAllValues(void) { 372 - if (verbose) puts("STUB: IOSurfaceCopyAllValues called"); 373 - return NULL; 374 - } 375 - 376 - void* IOSurfaceCopyDataValueBytes(void) { 377 - if (verbose) puts("STUB: IOSurfaceCopyDataValueBytes called"); 378 - return NULL; 379 - } 380 - 381 - void* IOSurfaceCopyValue(void) { 382 - if (verbose) puts("STUB: IOSurfaceCopyValue called"); 383 - return NULL; 384 - } 385 - 386 - void* IOSurfaceCreate(void) { 387 - if (verbose) puts("STUB: IOSurfaceCreate called"); 388 - return NULL; 389 - } 390 - 391 - void* IOSurfaceCreateMachPort(void) { 392 - if (verbose) puts("STUB: IOSurfaceCreateMachPort called"); 393 - return NULL; 394 - } 395 - 396 - void* IOSurfaceCreateXPCObject(void) { 397 - if (verbose) puts("STUB: IOSurfaceCreateXPCObject called"); 398 - return NULL; 399 - } 400 - 401 - void* IOSurfaceDecrementUseCount(void) { 402 - if (verbose) puts("STUB: IOSurfaceDecrementUseCount called"); 403 - return NULL; 404 - } 405 - 406 - void* IOSurfaceFlushProcessorCaches(void) { 407 - if (verbose) puts("STUB: IOSurfaceFlushProcessorCaches called"); 408 - return NULL; 409 - } 410 - 411 - void* IOSurfaceGetAllocSize(void) { 412 - if (verbose) puts("STUB: IOSurfaceGetAllocSize called"); 413 - return NULL; 414 - } 415 - 416 - void* IOSurfaceGetBaseAddress(void) { 417 - if (verbose) puts("STUB: IOSurfaceGetBaseAddress called"); 418 - return NULL; 419 - } 420 - 421 - void* IOSurfaceGetBaseAddressOfPlane(void) { 422 - if (verbose) puts("STUB: IOSurfaceGetBaseAddressOfPlane called"); 423 - return NULL; 424 - } 425 - 426 - void* IOSurfaceGetBitDepthOfComponentOfPlane(void) { 427 - if (verbose) puts("STUB: IOSurfaceGetBitDepthOfComponentOfPlane called"); 428 - return NULL; 429 - } 430 - 431 - void* IOSurfaceGetBitOffsetOfComponentOfPlane(void) { 432 - if (verbose) puts("STUB: IOSurfaceGetBitOffsetOfComponentOfPlane called"); 433 - return NULL; 434 - } 435 - 436 - void* IOSurfaceGetBitsPerBlock(void) { 437 - if (verbose) puts("STUB: IOSurfaceGetBitsPerBlock called"); 438 - return NULL; 439 - } 440 - 441 - void* IOSurfaceGetBitsPerBlockOfPlane(void) { 442 - if (verbose) puts("STUB: IOSurfaceGetBitsPerBlockOfPlane called"); 443 - return NULL; 444 - } 445 - 446 - void* IOSurfaceGetBlockHeightOfPlane(void) { 447 - if (verbose) puts("STUB: IOSurfaceGetBlockHeightOfPlane called"); 448 - return NULL; 449 - } 450 - 451 - void* IOSurfaceGetBlockWidthOfPlane(void) { 452 - if (verbose) puts("STUB: IOSurfaceGetBlockWidthOfPlane called"); 453 - return NULL; 454 - } 455 - 456 - void* IOSurfaceGetBulkAttachments(void) { 457 - if (verbose) puts("STUB: IOSurfaceGetBulkAttachments called"); 458 - return NULL; 459 - } 460 - 461 - void* IOSurfaceGetBytesPerElement(void) { 462 - if (verbose) puts("STUB: IOSurfaceGetBytesPerElement called"); 463 - return NULL; 464 - } 465 - 466 - void* IOSurfaceGetBytesPerElementOfPlane(void) { 467 - if (verbose) puts("STUB: IOSurfaceGetBytesPerElementOfPlane called"); 468 - return NULL; 469 - } 470 - 471 - void* IOSurfaceGetBytesPerRow(void) { 472 - if (verbose) puts("STUB: IOSurfaceGetBytesPerRow called"); 473 - return NULL; 474 - } 475 - 476 - void* IOSurfaceGetBytesPerRowOfPlane(void) { 477 - if (verbose) puts("STUB: IOSurfaceGetBytesPerRowOfPlane called"); 478 - return NULL; 479 - } 480 - 481 - void* IOSurfaceGetCacheMode(void) { 482 - if (verbose) puts("STUB: IOSurfaceGetCacheMode called"); 483 - return NULL; 484 - } 485 - 486 - void* IOSurfaceGetElementHeight(void) { 487 - if (verbose) puts("STUB: IOSurfaceGetElementHeight called"); 488 - return NULL; 489 - } 490 - 491 - void* IOSurfaceGetElementHeightOfPlane(void) { 492 - if (verbose) puts("STUB: IOSurfaceGetElementHeightOfPlane called"); 493 - return NULL; 494 - } 495 - 496 - void* IOSurfaceGetElementWidth(void) { 497 - if (verbose) puts("STUB: IOSurfaceGetElementWidth called"); 498 - return NULL; 499 - } 500 - 501 - void* IOSurfaceGetElementWidthOfPlane(void) { 502 - if (verbose) puts("STUB: IOSurfaceGetElementWidthOfPlane called"); 503 - return NULL; 504 - } 505 - 506 - void* IOSurfaceGetGraphicsCommPageAddress(void) { 507 - if (verbose) puts("STUB: IOSurfaceGetGraphicsCommPageAddress called"); 508 - return NULL; 509 - } 510 - 511 - void* IOSurfaceGetHeight(void) { 512 - if (verbose) puts("STUB: IOSurfaceGetHeight called"); 513 - return NULL; 514 - } 515 - 516 - void* IOSurfaceGetHeightOfPlane(void) { 517 - if (verbose) puts("STUB: IOSurfaceGetHeightOfPlane called"); 518 - return NULL; 519 - } 520 - 521 - void* IOSurfaceGetID(void) { 522 - if (verbose) puts("STUB: IOSurfaceGetID called"); 523 - return NULL; 524 - } 525 - 526 - void* IOSurfaceGetNameOfComponentOfPlane(void) { 527 - if (verbose) puts("STUB: IOSurfaceGetNameOfComponentOfPlane called"); 528 - return NULL; 529 - } 530 - 531 - void* IOSurfaceGetNumberOfComponentsOfPlane(void) { 532 - if (verbose) puts("STUB: IOSurfaceGetNumberOfComponentsOfPlane called"); 533 - return NULL; 534 - } 535 - 536 - void* IOSurfaceGetPixelFormat(void) { 537 - if (verbose) puts("STUB: IOSurfaceGetPixelFormat called"); 538 - return NULL; 539 - } 540 - 541 - void* IOSurfaceGetPlaneCount(void) { 542 - if (verbose) puts("STUB: IOSurfaceGetPlaneCount called"); 543 - return NULL; 544 - } 545 - 546 - void* IOSurfaceGetPropertyAlignment(void) { 547 - if (verbose) puts("STUB: IOSurfaceGetPropertyAlignment called"); 548 - return NULL; 549 - } 550 - 551 - void* IOSurfaceGetPropertyMaximum(void) { 552 - if (verbose) puts("STUB: IOSurfaceGetPropertyMaximum called"); 553 - return NULL; 554 - } 555 - 556 - void* IOSurfaceGetProtectionOptions(void) { 557 - if (verbose) puts("STUB: IOSurfaceGetProtectionOptions called"); 558 - return NULL; 559 - } 560 - 561 - void* IOSurfaceGetRangeOfComponentOfPlane(void) { 562 - if (verbose) puts("STUB: IOSurfaceGetRangeOfComponentOfPlane called"); 563 - return NULL; 564 - } 565 - 566 - void* IOSurfaceGetSeed(void) { 567 - if (verbose) puts("STUB: IOSurfaceGetSeed called"); 568 - return NULL; 569 - } 570 - 571 - void* IOSurfaceGetSeedOfPlane(void) { 572 - if (verbose) puts("STUB: IOSurfaceGetSeedOfPlane called"); 573 - return NULL; 574 - } 575 - 576 - void* IOSurfaceGetSubsampling(void) { 577 - if (verbose) puts("STUB: IOSurfaceGetSubsampling called"); 578 - return NULL; 579 - } 580 - 581 - void* IOSurfaceGetTypeID(void) { 582 - if (verbose) puts("STUB: IOSurfaceGetTypeID called"); 583 - return NULL; 584 - } 585 - 586 - void* IOSurfaceGetTypeOfComponentOfPlane(void) { 587 - if (verbose) puts("STUB: IOSurfaceGetTypeOfComponentOfPlane called"); 588 - return NULL; 589 - } 590 - 591 - void* IOSurfaceGetUseCount(void) { 592 - if (verbose) puts("STUB: IOSurfaceGetUseCount called"); 593 - return NULL; 594 - } 595 - 596 - void* IOSurfaceGetWidth(void) { 597 - if (verbose) puts("STUB: IOSurfaceGetWidth called"); 598 - return NULL; 599 - } 600 - 601 - void* IOSurfaceGetWidthOfPlane(void) { 602 - if (verbose) puts("STUB: IOSurfaceGetWidthOfPlane called"); 603 - return NULL; 604 - } 605 - 606 - void* IOSurfaceGetYCbCrMatrix(void) { 607 - if (verbose) puts("STUB: IOSurfaceGetYCbCrMatrix called"); 608 - return NULL; 609 - } 610 - 611 - void* IOSurfaceIncrementUseCount(void) { 612 - if (verbose) puts("STUB: IOSurfaceIncrementUseCount called"); 613 - return NULL; 614 - } 615 - 616 - void* IOSurfaceIsDisplayable(void) { 617 - if (verbose) puts("STUB: IOSurfaceIsDisplayable called"); 618 - return NULL; 619 - } 620 - 621 - void* IOSurfaceIsInUse(void) { 622 - if (verbose) puts("STUB: IOSurfaceIsInUse called"); 623 - return NULL; 624 - } 625 - 626 - void* IOSurfaceLock(void) { 627 - if (verbose) puts("STUB: IOSurfaceLock called"); 628 - return NULL; 629 - } 630 - 631 - void* IOSurfaceLockPlane(void) { 632 - if (verbose) puts("STUB: IOSurfaceLockPlane called"); 633 - return NULL; 634 - } 635 - 636 - void* IOSurfaceLog(void) { 637 - if (verbose) puts("STUB: IOSurfaceLog called"); 638 - return NULL; 639 - } 640 - 641 - void* IOSurfaceLookup(void) { 642 - if (verbose) puts("STUB: IOSurfaceLookup called"); 643 - return NULL; 644 - } 645 - 646 - void* IOSurfaceLookupFromMachPort(void) { 647 - if (verbose) puts("STUB: IOSurfaceLookupFromMachPort called"); 648 - return NULL; 649 - } 650 - 651 - void* IOSurfaceLookupFromXPCObject(void) { 652 - if (verbose) puts("STUB: IOSurfaceLookupFromXPCObject called"); 653 - return NULL; 654 - } 655 - 656 - void* IOSurfaceNeedsBindAccel(void) { 657 - if (verbose) puts("STUB: IOSurfaceNeedsBindAccel called"); 658 - return NULL; 659 - } 660 - 661 - void* IOSurfaceNeedsBindAccelOnPlane(void) { 662 - if (verbose) puts("STUB: IOSurfaceNeedsBindAccelOnPlane called"); 663 - return NULL; 664 - } 665 - 666 - void* IOSurfaceNotifierCreate(void) { 667 - if (verbose) puts("STUB: IOSurfaceNotifierCreate called"); 668 - return NULL; 669 - } 670 - 671 - void* IOSurfaceNotifierGetMachPort(void) { 672 - if (verbose) puts("STUB: IOSurfaceNotifierGetMachPort called"); 673 - return NULL; 674 - } 675 - 676 - void* IOSurfaceNotifierGetRunLoopSource(void) { 677 - if (verbose) puts("STUB: IOSurfaceNotifierGetRunLoopSource called"); 678 - return NULL; 679 - } 680 - 681 - void* IOSurfaceNotifierGetTypeID(void) { 682 - if (verbose) puts("STUB: IOSurfaceNotifierGetTypeID called"); 683 - return NULL; 684 - } 685 - 686 - void* IOSurfaceNotifierSetDispatchQueue(void) { 687 - if (verbose) puts("STUB: IOSurfaceNotifierSetDispatchQueue called"); 688 - return NULL; 689 - } 690 - 691 - void* IOSurfaceRemoveAllValues(void) { 692 - if (verbose) puts("STUB: IOSurfaceRemoveAllValues called"); 693 - return NULL; 694 - } 695 - 696 - void* IOSurfaceRemoveValue(void) { 697 - if (verbose) puts("STUB: IOSurfaceRemoveValue called"); 698 - return NULL; 699 - } 700 - 701 - void* IOSurfaceSetBulkAttachments(void) { 702 - if (verbose) puts("STUB: IOSurfaceSetBulkAttachments called"); 703 - return NULL; 704 - } 705 - 706 - void* IOSurfaceSetBulkAttachments2(void) { 707 - if (verbose) puts("STUB: IOSurfaceSetBulkAttachments2 called"); 708 - return NULL; 709 - } 710 - 711 - void* IOSurfaceSetPurgeable(void) { 712 - if (verbose) puts("STUB: IOSurfaceSetPurgeable called"); 713 - return NULL; 714 - } 715 - 716 - void* IOSurfaceSetValue(void) { 717 - if (verbose) puts("STUB: IOSurfaceSetValue called"); 718 - return NULL; 719 - } 720 - 721 - void* IOSurfaceSetValues(void) { 722 - if (verbose) puts("STUB: IOSurfaceSetValues called"); 723 - return NULL; 724 - } 725 - 726 - void* IOSurfaceSetYCbCrMatrix(void) { 727 - if (verbose) puts("STUB: IOSurfaceSetYCbCrMatrix called"); 728 - return NULL; 729 - } 730 - 731 - void* IOSurfaceSupportsProtectionOptions(void) { 732 - if (verbose) puts("STUB: IOSurfaceSupportsProtectionOptions called"); 733 - return NULL; 734 - } 735 - 736 - void* IOSurfaceUnlock(void) { 737 - if (verbose) puts("STUB: IOSurfaceUnlock called"); 738 - return NULL; 739 - } 740 - 741 - void* IOSurfaceUnlockPlane(void) { 742 - if (verbose) puts("STUB: IOSurfaceUnlockPlane called"); 743 - return NULL; 744 - } 745 - 746 - void* _ioSurfaceAddClientRef(void) { 747 - if (verbose) puts("STUB: _ioSurfaceAddClientRef called"); 748 - return NULL; 749 - }
+293
src/frameworks/IOSurface/src/IOSurfaceObjC.m
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2020 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #import <IOSurface/IOSurface.h> 21 + #import <IOSurface/IOSurfaceObjC.h> 22 + #import <IOSurface/IOSurfacePriv.h> 23 + #import <Foundation/Foundation.h> 24 + #import <IOKit/IOCFSerialize.h> 25 + #include <stdatomic.h> 26 + 27 + static io_service_t g_surfaceService; 28 + 29 + typedef struct 30 + { 31 + struct _IOSurfaceObjectRetval* surface; 32 + _Atomic int32_t localUseCount; 33 + } ImplData; 34 + 35 + @implementation IOSurface 36 + 37 + + (void)initialize 38 + { 39 + if (self == [IOSurface self]) 40 + { 41 + CFMutableDictionaryRef matching = IOServiceNameMatching("IOSurfaceRoot"); 42 + 43 + g_surfaceService = IOServiceGetMatchingService(kIOMasterPortDefault, matching); 44 + 45 + CFRelease(matching); 46 + 47 + if (!g_surfaceService) 48 + NSLog(@"Cannot obtain IOSurfaceRoot!\n"); 49 + } 50 + } 51 + 52 + - (nullable instancetype)initWithResponse:(const void*)bytes length:(size_t)length 53 + { 54 + ImplData* idata = (ImplData*) malloc(sizeof(ImplData)); 55 + idata->surface = malloc(length); 56 + memcpy(idata->surface, bytes, length); 57 + 58 + idata->localUseCount = 0; 59 + self->_impl = idata; 60 + 61 + return self; 62 + } 63 + 64 + - (nullable instancetype)initWithProperties:(NSDictionary <IOSurfacePropertyKey, id> *)properties 65 + { 66 + CFDataRef data = IOCFSerialize((CFTypeRef) properties, kIOCFSerializeToBinary); 67 + uint8_t responseBuffer[3500]; 68 + 69 + const void* bytes = CFDataGetBytePtr(data); 70 + size_t length = CFDataGetLength(data); 71 + size_t responseLength = sizeof(responseBuffer); 72 + 73 + kern_return_t ret = IOConnectCallMethod(g_surfaceService, kIOSurfaceMethodCreate, NULL, 0, bytes, length, NULL, 0, responseBuffer, &responseLength); 74 + CFRelease(data); 75 + 76 + if (ret != kIOSurfaceSuccess) 77 + { 78 + [self release]; 79 + return nil; 80 + } 81 + 82 + return [self initWithResponse: responseBuffer length: responseLength]; 83 + } 84 + 85 + - (nullable instancetype)initWithSurfaceID:(IOSurfaceID)surfaceID 86 + { 87 + uint8_t responseBuffer[3500]; 88 + size_t responseLength = sizeof(responseBuffer); 89 + 90 + uint64_t scalar = surfaceID; 91 + kern_return_t ret = IOConnectCallMethod(g_surfaceService, kIOSurfaceMethodLookupByID, &scalar, 1, NULL, 0, NULL, 0, responseBuffer, &responseLength); 92 + 93 + if (ret != kIOSurfaceSuccess) 94 + { 95 + [self release]; 96 + return nil; 97 + } 98 + 99 + return [self initWithResponse: responseBuffer length: responseLength]; 100 + } 101 + 102 + - (void) dealloc 103 + { 104 + ImplData* data = (ImplData*) _impl; 105 + if (data != NULL) 106 + { 107 + if (data->surface != NULL) 108 + { 109 + IOConnectCallMethod(g_surfaceService, kIOSurfaceMethodRelease, NULL, 0, &data->surface->surfaceID, 1, NULL, 0, NULL, 0); 110 + 111 + free(data->surface); 112 + } 113 + 114 + free(data); 115 + } 116 + [super dealloc]; 117 + } 118 + 119 + - (NSUInteger) hash 120 + { 121 + ImplData* data = (ImplData*) _impl; 122 + return data->surface->surfaceID; 123 + } 124 + 125 + - (BOOL)isEqual:(id)object 126 + { 127 + if (![object isKindOfClass: [self class]]) 128 + return NO; 129 + 130 + IOSurface* that = (IOSurface*) object; 131 + return ((ImplData*) self->_impl)->surface->surfaceID == ((ImplData*) that->_impl)->surface->surfaceID; 132 + } 133 + 134 + - (CFTypeID) _cfTypeID 135 + { 136 + return IOSurfaceGetTypeID(); 137 + } 138 + 139 + - (NSInteger) width 140 + { 141 + return [self widthOfPlaneAtIndex: 0]; 142 + } 143 + 144 + - (NSInteger) height 145 + { 146 + return [self heightOfPlaneAtIndex: 0]; 147 + } 148 + 149 + - (void *) baseAddress 150 + { 151 + return [self baseAddressOfPlaneAtIndex: 0]; 152 + } 153 + 154 + - (NSInteger) bytesPerRow 155 + { 156 + return [self bytesPerRowOfPlaneAtIndex: 0]; 157 + } 158 + 159 + - (NSInteger) bytesPerElement 160 + { 161 + return [self bytesPerElementOfPlaneAtIndex: 0]; 162 + } 163 + 164 + - (NSInteger) elementWidth 165 + { 166 + return [self elementWidthOfPlaneAtIndex: 0]; 167 + } 168 + 169 + - (NSInteger) elementHeight 170 + { 171 + return [self elementHeightOfPlaneAtIndex: 0]; 172 + } 173 + 174 + - (OSType) pixelFormat 175 + { 176 + return ((ImplData*) _impl)->surface->pixelFormat; 177 + } 178 + 179 + - (NSUInteger) planeCount 180 + { 181 + return ((ImplData*) _impl)->surface->planeCount; 182 + } 183 + 184 + - (NSInteger)widthOfPlaneAtIndex:(NSUInteger)planeIndex 185 + { 186 + if (planeIndex >= [self planeCount]) 187 + return 0; 188 + 189 + ImplData* data = (ImplData*) _impl; 190 + return data->surface->planes[planeIndex].width; 191 + } 192 + 193 + - (NSInteger)heightOfPlaneAtIndex:(NSUInteger)planeIndex 194 + { 195 + if (planeIndex >= [self planeCount]) 196 + return 0; 197 + 198 + ImplData* data = (ImplData*) _impl; 199 + return data->surface->planes[planeIndex].height; 200 + } 201 + 202 + - (NSInteger)bytesPerRowOfPlaneAtIndex:(NSUInteger)planeIndex 203 + { 204 + if (planeIndex >= [self planeCount]) 205 + return 0; 206 + 207 + ImplData* data = (ImplData*) _impl; 208 + return data->surface->planes[planeIndex].bytesPerRow; 209 + } 210 + 211 + - (NSInteger)bytesPerElementOfPlaneAtIndex:(NSUInteger)planeIndex 212 + { 213 + if (planeIndex >= [self planeCount]) 214 + return 0; 215 + 216 + ImplData* data = (ImplData*) _impl; 217 + return data->surface->planes[planeIndex].bytesPerElement; 218 + } 219 + 220 + - (NSInteger)elementWidthOfPlaneAtIndex:(NSUInteger)planeIndex 221 + { 222 + return 1; 223 + } 224 + 225 + - (NSInteger)elementHeightOfPlaneAtIndex:(NSUInteger)planeIndex 226 + { 227 + return 1; 228 + } 229 + 230 + - (void *)baseAddressOfPlaneAtIndex:(NSUInteger)planeIndex 231 + { 232 + if (planeIndex >= [self planeCount]) 233 + return NULL; 234 + 235 + ImplData* data = (ImplData*) _impl; 236 + return (void*)(data->surface->address + data->surface->planes[planeIndex].memoryOffset); 237 + } 238 + 239 + - (void)incrementUseCount 240 + { 241 + ImplData* data = (ImplData*) _impl; 242 + if ((data->localUseCount++) == 0) 243 + { 244 + uint64_t scalar = data->surface->surfaceID; 245 + IOConnectCallMethod(g_surfaceService, kIOSurfaceMethodIncrementUseCount, &scalar, 1, NULL, 0, NULL, 0, NULL, 0); 246 + } 247 + } 248 + 249 + - (void)decrementUseCount 250 + { 251 + ImplData* data = (ImplData*) _impl; 252 + if (--data->localUseCount == 0) 253 + { 254 + uint64_t scalar = data->surface->surfaceID; 255 + IOConnectCallMethod(g_surfaceService, kIOSurfaceMethodDecrementUseCount, &scalar, 1, NULL, 0, NULL, 0, NULL, 0); 256 + } 257 + } 258 + 259 + - (int32_t) localUseCount 260 + { 261 + ImplData* data = (ImplData*) _impl; 262 + return data->localUseCount; 263 + } 264 + 265 + - (kern_return_t)lockWithOptions:(IOSurfaceLockOptions)options seed:(nullable uint32_t *)seed 266 + { 267 + ImplData* data = (ImplData*) _impl; 268 + struct _IOSurfaceLockUnlock args = { 269 + .surfaceID = data->surface->surfaceID, 270 + .options = options, 271 + }; 272 + return IOConnectCallMethod(g_surfaceService, kIOSurfaceMethodLock, NULL, 0, &args, sizeof(args), NULL, 0, NULL, 0); 273 + } 274 + 275 + - (kern_return_t)unlockWithOptions:(IOSurfaceLockOptions)options seed:(nullable uint32_t *)seed 276 + { 277 + ImplData* data = (ImplData*) _impl; 278 + struct _IOSurfaceLockUnlock args = { 279 + .surfaceID = data->surface->surfaceID, 280 + .options = options, 281 + }; 282 + return IOConnectCallMethod(g_surfaceService, kIOSurfaceMethodUnlock, NULL, 0, &args, sizeof(args), NULL, 0, NULL, 0); 283 + } 284 + 285 + - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { 286 + return [NSMethodSignature signatureWithObjCTypes: "v@:"]; 287 + } 288 + 289 + - (void)forwardInvocation:(NSInvocation *)anInvocation { 290 + NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]); 291 + } 292 + 293 + @end
+218
src/frameworks/IOSurface/src/api.m
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2020 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #import <IOSurface/IOSurface.h> 21 + #import <IOSurface/IOSurfaceObjC.h> 22 + 23 + CFTypeID IOSurfaceGetTypeID(void) 24 + { 25 + return (CFTypeID) [IOSurface self]; 26 + } 27 + 28 + IOSurfaceRef _Nullable IOSurfaceCreate(CFDictionaryRef properties) 29 + { 30 + return (IOSurfaceRef) [[IOSurface alloc] initWithProperties: (NSDictionary*) properties]; 31 + } 32 + 33 + IOSurfaceRef _Nullable IOSurfaceLookupFromMachPort(mach_port_t port) 34 + { 35 + return (IOSurfaceRef) [[IOSurface alloc] initWithMachPort: port]; 36 + } 37 + 38 + xpc_object_t IOSurfaceCreateXPCObject(IOSurfaceRef surface) 39 + { 40 + return 0; 41 + } 42 + 43 + IOSurfaceRef IOSurfaceLookupFromXPCObject(xpc_object_t obj) 44 + { 45 + #if NOTYET 46 + if (xpc_get_type(obj) == _xpc_type_mach_send) 47 + { 48 + mach_port_t port = xpc_mach_send_get_right(obj); 49 + return IOSurfaceLookupFromMachPort(port); 50 + } 51 + #endif 52 + return NULL; 53 + } 54 + 55 + kern_return_t IOSurfaceLock(IOSurfaceRef buffer, IOSurfaceLockOptions options, uint32_t * _Nullable seed) 56 + { 57 + return [(IOSurface*)buffer lockWithOptions: options seed: seed]; 58 + } 59 + 60 + kern_return_t IOSurfaceUnlock(IOSurfaceRef buffer, IOSurfaceLockOptions options, uint32_t * _Nullable seed) 61 + { 62 + return [(IOSurface*)buffer unlockWithOptions: options seed: seed]; 63 + } 64 + 65 + size_t IOSurfaceGetWidth(IOSurfaceRef buffer) 66 + { 67 + return [(IOSurface*)buffer width]; 68 + } 69 + 70 + size_t IOSurfaceGetHeight(IOSurfaceRef buffer) 71 + { 72 + return [(IOSurface*)buffer height]; 73 + } 74 + 75 + void *IOSurfaceGetBaseAddress(IOSurfaceRef buffer) 76 + { 77 + return [(IOSurface*)buffer baseAddress]; 78 + } 79 + 80 + OSType IOSurfaceGetPixelFormat(IOSurfaceRef buffer) 81 + { 82 + return [(IOSurface*)buffer pixelFormat]; 83 + } 84 + 85 + void IOSurfaceSetValue(IOSurfaceRef buffer, CFStringRef key, CFTypeRef value) 86 + { 87 + return [(IOSurface*)buffer setAttachment: (id) value forKey: (NSString*) key]; 88 + } 89 + 90 + 91 + CFTypeRef _Nullable IOSurfaceCopyValue(IOSurfaceRef buffer, CFStringRef key) 92 + { 93 + return (CFTypeRef) [[(IOSurface*) buffer attachmentForKey: (NSString*) key] retain]; 94 + } 95 + 96 + 97 + void IOSurfaceRemoveValue(IOSurfaceRef buffer, CFStringRef key) 98 + { 99 + [(IOSurface*)buffer removeAttachmentForKey: (NSString*) key]; 100 + } 101 + 102 + 103 + void IOSurfaceSetValues(IOSurfaceRef buffer, CFDictionaryRef keysAndValues) 104 + { 105 + [(IOSurface*)buffer setAllAttachments: (NSDictionary*)keysAndValues]; 106 + } 107 + 108 + 109 + CFDictionaryRef _Nullable IOSurfaceCopyAllValues(IOSurfaceRef buffer) 110 + { 111 + return (CFDictionaryRef) [[(IOSurface*)buffer allAttachments] retain]; 112 + } 113 + 114 + 115 + void IOSurfaceRemoveAllValues(IOSurfaceRef buffer) 116 + { 117 + return [(IOSurface*)buffer removeAllAttachments]; 118 + } 119 + 120 + size_t IOSurfaceGetBytesPerRow(IOSurfaceRef buffer) 121 + { 122 + return [(IOSurface*)buffer bytesPerRow]; 123 + } 124 + 125 + void IOSurfaceIncrementUseCount(IOSurfaceRef buffer) 126 + { 127 + [(IOSurface*)buffer incrementUseCount]; 128 + } 129 + 130 + 131 + void IOSurfaceDecrementUseCount(IOSurfaceRef buffer) 132 + { 133 + [(IOSurface*)buffer decrementUseCount]; 134 + } 135 + 136 + 137 + int32_t IOSurfaceGetUseCount(IOSurfaceRef buffer) 138 + { 139 + return [(IOSurface*)buffer localUseCount]; 140 + } 141 + 142 + size_t IOSurfaceGetPlaneCount(IOSurfaceRef buffer) 143 + { 144 + return [(IOSurface*)buffer planeCount]; 145 + } 146 + 147 + uint32_t IOSurfaceGetSeed(IOSurfaceRef buffer) 148 + { 149 + return [(IOSurface*)buffer seed]; 150 + } 151 + 152 + size_t IOSurfaceGetWidthOfPlane(IOSurfaceRef buffer, size_t planeIndex) 153 + { 154 + return [(IOSurface*)buffer widthOfPlaneAtIndex: planeIndex]; 155 + } 156 + 157 + 158 + size_t IOSurfaceGetHeightOfPlane(IOSurfaceRef buffer, size_t planeIndex) 159 + { 160 + return [(IOSurface*)buffer heightOfPlaneAtIndex: planeIndex]; 161 + } 162 + 163 + 164 + size_t IOSurfaceGetBytesPerElementOfPlane(IOSurfaceRef buffer, size_t planeIndex) 165 + { 166 + return [(IOSurface*)buffer bytesPerElementOfPlaneAtIndex: planeIndex]; 167 + } 168 + 169 + 170 + size_t IOSurfaceGetBytesPerRowOfPlane(IOSurfaceRef buffer, size_t planeIndex) 171 + { 172 + return [(IOSurface*)buffer bytesPerRowOfPlaneAtIndex: planeIndex]; 173 + } 174 + 175 + 176 + void *IOSurfaceGetBaseAddressOfPlane(IOSurfaceRef buffer, size_t planeIndex) 177 + { 178 + return [(IOSurface*)buffer baseAddressOfPlaneAtIndex: planeIndex]; 179 + } 180 + 181 + 182 + size_t IOSurfaceGetElementWidthOfPlane(IOSurfaceRef buffer, size_t planeIndex) 183 + { 184 + return [(IOSurface*)buffer elementWidthOfPlaneAtIndex: planeIndex]; 185 + } 186 + 187 + 188 + size_t IOSurfaceGetElementHeightOfPlane(IOSurfaceRef buffer, size_t planeIndex) 189 + { 190 + return [(IOSurface*)buffer elementHeightOfPlaneAtIndex: planeIndex]; 191 + } 192 + 193 + size_t IOSurfaceGetBytesPerElement(IOSurfaceRef buffer) 194 + { 195 + return [(IOSurface*)buffer bytesPerElementOfPlaneAtIndex: 0]; 196 + } 197 + 198 + 199 + size_t IOSurfaceGetElementWidth(IOSurfaceRef buffer) 200 + { 201 + return [(IOSurface*)buffer widthOfPlaneAtIndex: 0]; 202 + } 203 + 204 + 205 + size_t IOSurfaceGetElementHeight(IOSurfaceRef buffer) 206 + { 207 + return [(IOSurface*)buffer heightOfPlaneAtIndex: 0]; 208 + } 209 + 210 + Boolean IOSurfaceIsInUse(IOSurfaceRef buffer) 211 + { 212 + return [(IOSurface*)buffer isInUse]; 213 + } 214 + 215 + kern_return_t IOSurfaceSetPurgeable(IOSurfaceRef buffer, uint32_t newState, uint32_t * _Nullable oldState) 216 + { 217 + return [(IOSurface*)buffer setPurgeable:newState oldState:oldState]; 218 + }
+69
src/frameworks/IOSurface/src/constants.m
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2020 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #import <IOSurface/IOSurfaceRef.h> 20 + #import <IOSurface/IOSurfaceObjC.h> 21 + 22 + const CFStringRef kIOSurfaceAllocSize = CFSTR("IOSurfaceAllocSize"); 23 + const CFStringRef kIOSurfaceWidth = CFSTR("IOSurfaceWidth"); 24 + const CFStringRef kIOSurfaceHeight = CFSTR("IOSurfaceHeight"); 25 + const CFStringRef kIOSurfaceBytesPerRow = CFSTR("IOSurfaceBytesPerRow"); 26 + const CFStringRef kIOSurfaceBytesPerElement = CFSTR("IOSurfaceBytesPerElement"); 27 + const CFStringRef kIOSurfaceElementWidth = CFSTR("IOSurfaceElementWidth"); 28 + const CFStringRef kIOSurfaceElementHeight = CFSTR("IOSurfaceElementHeight"); 29 + const CFStringRef kIOSurfaceOffset = CFSTR("IOSurfaceOffset"); 30 + const CFStringRef kIOSurfacePlaneInfo = CFSTR("IOSurfacePlaneInfo"); 31 + const CFStringRef kIOSurfacePlaneWidth = CFSTR("IOSurfacePlaneWidth"); 32 + const CFStringRef kIOSurfacePlaneHeight = CFSTR("IOSurfacePlaneHeight"); 33 + const CFStringRef kIOSurfacePlaneBytesPerRow = CFSTR("IOSurfacePlaneBytesPerRow"); 34 + const CFStringRef kIOSurfacePlaneOffset = CFSTR("IOSurfacePlaneOffset"); 35 + const CFStringRef kIOSurfacePlaneSize = CFSTR("IOSurfacePlaneSize"); 36 + const CFStringRef kIOSurfacePlaneBase = CFSTR("IOSurfacePlaneBase"); 37 + const CFStringRef kIOSurfacePlaneBitsPerElement = CFSTR("IOSurfacePlaneBitsPerElement"); 38 + const CFStringRef kIOSurfacePlaneBytesPerElement = CFSTR("IOSurfacePlaneBytesPerElement"); 39 + const CFStringRef kIOSurfacePlaneElementWidth = CFSTR("IOSurfacePlaneElementWidth"); 40 + const CFStringRef kIOSurfacePlaneElementHeight = CFSTR("IOSurfacePlaneElementHeight"); 41 + const CFStringRef kIOSurfaceCacheMode = CFSTR("IOSurfaceCacheMode"); 42 + const CFStringRef kIOSurfaceIsGlobal = CFSTR("IOSurfaceIsGlobal"); 43 + const CFStringRef kIOSurfacePixelFormat = CFSTR("IOSurfacePixelFormat"); 44 + const CFStringRef kIOSurfacePixelSizeCastingAllowed = CFSTR("IOSurfacePixelSizeCastingAllowed"); 45 + const CFStringRef kIOSurfacePlaneComponentBitDepths = CFSTR("IOSurfacePlaneComponentBitDepths"); 46 + const CFStringRef kIOSurfacePlaneComponentBitOffsets = CFSTR("IOSurfacePlaneComponentBitOffsets"); 47 + 48 + IOSurfacePropertyKey IOSurfacePropertyKeyAllocSize = @"IOSurfacePropertyKeyAllocSize"; 49 + IOSurfacePropertyKey IOSurfacePropertyKeyWidth = @"IOSurfacePropertyKeyWidth"; 50 + IOSurfacePropertyKey IOSurfacePropertyKeyHeight = @"IOSurfacePropertyKeyHeight"; 51 + IOSurfacePropertyKey IOSurfacePropertyKeyBytesPerRow = @"IOSurfacePropertyKeyBytesPerRow"; 52 + IOSurfacePropertyKey IOSurfacePropertyKeyBytesPerElement = @"IOSurfacePropertyKeyBytesPerElement"; 53 + IOSurfacePropertyKey IOSurfacePropertyKeyElementWidth = @"IOSurfacePropertyKeyElementWidth"; 54 + IOSurfacePropertyKey IOSurfacePropertyKeyElementHeight = @"IOSurfacePropertyKeyElementHeight"; 55 + IOSurfacePropertyKey IOSurfacePropertyKeyOffset = @"IOSurfacePropertyKeyOffset"; 56 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneInfo = @"IOSurfacePropertyKeyPlaneInfo"; 57 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneWidth = @"IOSurfacePropertyKeyPlaneWidth"; 58 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneHeight = @"IOSurfacePropertyKeyPlaneHeight"; 59 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneBytesPerRow = @"IOSurfacePropertyKeyPlaneBytesPerRow"; 60 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneOffset = @"IOSurfacePropertyKeyPlaneOffset"; 61 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneSize = @"IOSurfacePropertyKeyPlaneSize"; 62 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneBase = @"IOSurfacePropertyKeyPlaneBase"; 63 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneBytesPerElement = @"IOSurfacePropertyKeyPlaneBytesPerElement"; 64 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneElementWidth = @"IOSurfacePropertyKeyPlaneElementWidth"; 65 + IOSurfacePropertyKey IOSurfacePropertyKeyPlaneElementHeight = @"IOSurfacePropertyKeyPlaneElementHeight"; 66 + IOSurfacePropertyKey IOSurfacePropertyKeyCacheMode = @"IOSurfacePropertyKeyCacheMode"; 67 + IOSurfacePropertyKey IOSurfacePropertyKeyPixelFormat = @"IOSurfacePropertyKeyPixelFormat"; 68 + IOSurfacePropertyKey IOSurfacePropertyKeyPixelSizeCastingAllowed = @"IOSurfacePropertyKeyPixelSizeCastingAllowed"; 69 +
+126
src/frameworks/IOSurface/src/stubs.m
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2017 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #include <stdlib.h> 21 + #include <stdio.h> 22 + #import <IOSurface/IOSurface.h> 23 + 24 + #include <CoreFoundation/CoreFoundation.h> 25 + 26 + static int verbose = 0; 27 + 28 + __attribute__((constructor)) 29 + static void initme(void) { 30 + verbose = getenv("STUB_VERBOSE") != NULL; 31 + } 32 + 33 + 34 + IOSurfaceRef _Nullable IOSurfaceLookup(IOSurfaceID csid){ 35 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 36 + return 0; 37 + } 38 + 39 + 40 + IOSurfaceID IOSurfaceGetID(IOSurfaceRef buffer){ 41 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 42 + return 0; 43 + } 44 + 45 + 46 + size_t IOSurfaceGetAllocSize(IOSurfaceRef buffer){ 47 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 48 + return 0; 49 + } 50 + 51 + 52 + 53 + size_t IOSurfaceGetNumberOfComponentsOfPlane(IOSurfaceRef buffer, size_t planeIndex){ 54 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 55 + return 0; 56 + } 57 + 58 + 59 + IOSurfaceComponentName IOSurfaceGetNameOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex){ 60 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 61 + return 0; 62 + } 63 + 64 + 65 + IOSurfaceComponentType IOSurfaceGetTypeOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex){ 66 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 67 + return 0; 68 + } 69 + 70 + 71 + IOSurfaceComponentRange IOSurfaceGetRangeOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex){ 72 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 73 + return 0; 74 + } 75 + 76 + 77 + size_t IOSurfaceGetBitDepthOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex){ 78 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 79 + return 0; 80 + } 81 + 82 + 83 + size_t IOSurfaceGetBitOffsetOfComponentOfPlane(IOSurfaceRef buffer, size_t planeIndex, size_t componentIndex){ 84 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 85 + return 0; 86 + } 87 + 88 + 89 + IOSurfaceSubsampling IOSurfaceGetSubsampling(IOSurfaceRef buffer){ 90 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 91 + return 0; 92 + } 93 + 94 + 95 + 96 + mach_port_t IOSurfaceCreateMachPort(IOSurfaceRef buffer){ 97 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 98 + return 0; 99 + } 100 + 101 + 102 + size_t IOSurfaceGetPropertyMaximum(CFStringRef property){ 103 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 104 + return 0; 105 + } 106 + 107 + size_t IOSurfaceGetPropertyAlignment(CFStringRef property){ 108 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 109 + return 0; 110 + } 111 + 112 + 113 + 114 + size_t IOSurfaceAlignProperty(CFStringRef property, size_t value){ 115 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 116 + return 0; 117 + } 118 + 119 + 120 + 121 + Boolean IOSurfaceAllowsPixelSizeCasting(IOSurfaceRef buffer){ 122 + if (verbose) printf("STUB: %s called\n", __FUNCTION__); 123 + return 0; 124 + } 125 + 126 +
+2 -1
src/native/CMakeLists.txt
··· 11 11 wrap_elf(Xext libXext.so) 12 12 wrap_elf(XRandR libXrandr.so) 13 13 wrap_elf(Xcursor libXcursor.so) 14 + wrap_elf(xkbfile libxkbfile.so) 14 15 wrap_elf(cairo libcairo.so) 15 16 wrap_elf(EGL libEGL.so) 16 17 wrap_elf(fontconfig libfontconfig.so) 17 18 wrap_elf(dbus libdbus-1.so) 18 19 wrap_elf(GL libGL.so "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries") 19 - wrap_elf(GLU libGLU.so "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries") 20 + wrap_elf(GLU libGLU.so "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries")