this repo has no description
1
fork

Configure Feed

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

feat(Carbon): add IBCarbonRuntime.h and stubs

closes https://github.com/darlinghq/darling/issues/1587

+106
+1
src/frameworks/Carbon/HIToolbox/CMakeLists.txt
··· 22 22 src/Events.cpp 23 23 src/MacWindows.cpp 24 24 src/TextInputSources.mm 25 + src/IBCarbonRuntime.c 25 26 src/constants.c 26 27 27 28 DEPENDENCIES
+36
src/frameworks/Carbon/HIToolbox/include/HIToolbox/IBCarbonRuntime.h
··· 1 + #ifndef _CARBON_IB_CARBON_RUNTIME_H_ 2 + #define _CARBON_IB_CARBON_RUNTIME_H_ 3 + 4 + #include <CoreFoundation/CoreFoundation.h> 5 + #include <CarbonCore/MacErrors.h> 6 + #include <CoreFoundation/CFBase.h> 7 + #include <HIToolbox/Menus.h> 8 + #include "../../src/MacWindows.h" // TODO: put WindowRef where it actually goes 9 + 10 + #ifdef __cplusplus 11 + extern "C" { 12 + #endif 13 + 14 + enum { 15 + kIBCarbonRuntimeCantFindNibFile = -10960, 16 + kIBCarbonRuntimeObjectNotOfRequestedType = -10961, 17 + kIBCarbonRuntimeCantFindObject = -10962 18 + }; 19 + 20 + typedef struct OpaqueIBNibRef * IBNibRef; 21 + 22 + OSStatus CreateMenuBarFromNib(IBNibRef inNibRef, CFStringRef inName, Handle *outMenuBar); 23 + OSStatus CreateMenuFromNib(IBNibRef inNibRef, CFStringRef inName, MenuRef *outMenuRef); 24 + OSStatus CreateNibReference(CFStringRef inNibName, IBNibRef *outNibRef); 25 + OSStatus CreateNibReferenceWithCFBundle(CFBundleRef inBundle, CFStringRef inNibName, IBNibRef *outNibRef); 26 + OSStatus CreateWindowFromNib(IBNibRef inNibRef, CFStringRef inName, WindowRef *outWindow); 27 + 28 + void DisposeNibReference(IBNibRef inNibRef); 29 + 30 + OSStatus SetMenuBarFromNib(IBNibRef inNibRef, CFStringRef inName); 31 + 32 + #ifdef __cplusplus 33 + } 34 + #endif 35 + 36 + #endif // _CARBON_IB_CARBON_RUNTIME_H_
+68
src/frameworks/Carbon/HIToolbox/src/IBCarbonRuntime.c
··· 1 + #include <HIToolbox/IBCarbonRuntime.h> 2 + #include <stdlib.h> 3 + #include <stdio.h> 4 + 5 + static int verbose = 0; 6 + 7 + __attribute__((constructor)) 8 + static void initme(void) { 9 + verbose = getenv("STUB_VERBOSE") != NULL; 10 + } 11 + 12 + 13 + OSStatus CreateMenuBarFromNib(IBNibRef inNibRef, CFStringRef inName, Handle *outMenuBar) 14 + { 15 + if (verbose) { 16 + puts("STUB: CreateMenuBarFromNib"); 17 + } 18 + 19 + return noErr; 20 + } 21 + OSStatus CreateMenuFromNib(IBNibRef inNibRef, CFStringRef inName, MenuRef *outMenuRef) 22 + { 23 + if (verbose) { 24 + puts("STUB: CreateMenuFromNib"); 25 + } 26 + 27 + return noErr; 28 + } 29 + OSStatus CreateNibReference(CFStringRef inNibName, IBNibRef *outNibRef) 30 + { 31 + if (verbose) { 32 + puts("STUB: CreateNibReference"); 33 + } 34 + 35 + return noErr; 36 + } 37 + OSStatus CreateNibReferenceWithCFBundle(CFBundleRef inBundle, CFStringRef inNibName, IBNibRef *outNibRef) 38 + { 39 + if (verbose) { 40 + puts("STUB: CreateNibReferenceWithCFBundle"); 41 + } 42 + 43 + return noErr; 44 + } 45 + OSStatus CreateWindowFromNib(IBNibRef inNibRef, CFStringRef inName, WindowRef *outWindow) 46 + { 47 + if (verbose) { 48 + puts("STUB: CreateWindowFromNib"); 49 + } 50 + 51 + return noErr; 52 + } 53 + 54 + void DisposeNibReference(IBNibRef inNibRef) 55 + { 56 + if (verbose) { 57 + puts("STUB: DisposeNibReference"); 58 + } 59 + } 60 + 61 + OSStatus SetMenuBarFromNib(IBNibRef inNibRef, CFStringRef inName) 62 + { 63 + if (verbose) { 64 + puts("STUB: SetMenuBarFromNib"); 65 + } 66 + 67 + return noErr; 68 + }
+1
src/frameworks/Carbon/include/Carbon/Carbon.h
··· 33 33 #include <HIToolbox/HIObject.h> 34 34 #include <HIToolbox/Lists.h> 35 35 #include <HIToolbox/Menus.h> 36 + #include <HIToolbox/IBCarbonRuntime.h> 36 37 #include <HIToolbox/Notification.h> 37 38 #include <HIToolbox/Scrap.h> 38 39 #include <HIToolbox/TextEdit.h>