this repo has no description
1
fork

Configure Feed

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

Merge pull request #1593 from Lazerbeak12345/move-carbon-events-core-stubs

fix(Carbon): move carbon events core stubs

authored by

CuriousTommy and committed by
GitHub
994ad6e4 968a4336

+116 -86
+1
src/frameworks/Carbon/HIToolbox/CMakeLists.txt
··· 20 20 SOURCES 21 21 src/Keyboards.cpp 22 22 src/Events.cpp 23 + src/CarbonEventsCore.c 23 24 src/MacWindows.cpp 24 25 src/TextInputSources.mm 25 26 src/IBCarbonRuntime.c
+8 -8
src/frameworks/Carbon/HIToolbox/include/HIToolbox/CarbonEventsCore.h
··· 40 40 41 41 42 42 OSStatus CallNextEventHandler(EventHandlerCallRef a, EventRef b); 43 - OSStatus CreateEvent(CFAllocatorRef a, UInt32 b, UInt32 c, EventTime d, EventAttributes e, EventRef * f); 44 - UInt32 GetEventClass(EventRef a); 43 + OSStatus CreateEvent(CFAllocatorRef a, OSType b, UInt32 c, EventTime d, EventAttributes e, EventRef* f); 44 + OSType GetEventClass(EventRef a); 45 45 UInt32 GetEventKind(EventRef a); 46 - OSStatus GetEventParameter(EventRef a, EventParamName b, EventParamType c, EventParamType * d, UInt32 e, UInt32 * f, void * g); 46 + OSStatus GetEventParameter(EventRef a, EventParamName b, EventParamType c, EventParamType* d, ByteCount e, ByteCount* f, void* g); 47 47 48 - OSStatus GetMainEventQueue(); 49 - OSStatus InstallEventHandler(EventTargetRef a, EventHandlerUPP b, UInt32 c, const EventTypeSpec * d, void * e, EventHandlerRef * f); 48 + EventQueueRef GetMainEventQueue(); 49 + OSStatus InstallEventHandler(EventTargetRef a, EventHandlerUPP b, ItemCount c, const EventTypeSpec* d, void* e, EventHandlerRef* f); 50 50 51 51 52 - EventHandlerUPP NewEventHandlerUPP(EventHandlerProcPtr a); 52 + EventHandlerUPP NewEventHandlerUPP(EventHandlerProcPtr a); 53 53 OSStatus PostEventToQueue(EventQueueRef a, EventRef b, EventPriority c); 54 54 55 - OSStatus ReceiveNextEvent(UInt32 a, const EventTypeSpec * b, EventTimeout c, Boolean d, EventRef * e); 55 + OSStatus ReceiveNextEvent(ItemCount a, const EventTypeSpec* b, EventTimeout c, Boolean d, EventRef* e); 56 56 57 - OSStatus ReleaseEvent(EventRef a); 57 + void ReleaseEvent(EventRef a); 58 58 OSStatus RemoveEventHandler(EventHandlerRef a); 59 59 60 60 OSStatus SendEventToEventTarget(EventRef a, EventTargetRef b);
+107
src/frameworks/Carbon/HIToolbox/src/CarbonEventsCore.c
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2025 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 <HIToolbox/CarbonEventsCore.h> 21 + 22 + #include <stdlib.h> 23 + #include <stdio.h> 24 + 25 + static int verbose = 0; 26 + 27 + __attribute__((constructor)) 28 + static void initme(void) { 29 + verbose = getenv("STUB_VERBOSE") != NULL; 30 + } 31 + 32 + OSStatus CallNextEventHandler(EventHandlerCallRef a, EventRef b) 33 + { 34 + if (verbose) puts("STUB: CallNextEventHandler called"); 35 + return 0; 36 + } 37 + 38 + OSStatus CreateEvent(CFAllocatorRef a, OSType b, UInt32 c, EventTime d, EventAttributes e, EventRef* f) 39 + { 40 + if (verbose) puts("STUB: CreateEvent called"); 41 + return 0; 42 + } 43 + 44 + OSType GetEventClass(EventRef a) 45 + { 46 + if (verbose) puts("STUB: GetEventClass called"); 47 + return 0; 48 + } 49 + 50 + UInt32 GetEventKind(EventRef a) 51 + { 52 + if (verbose) puts("STUB: GetEventKind called"); 53 + return 0; 54 + } 55 + 56 + OSStatus GetEventParameter(EventRef a, EventParamName b, EventParamType c, EventParamType* d, ByteCount e, ByteCount* f, void* g) 57 + { 58 + if (verbose) puts("STUB: GetEventParameter called"); 59 + return 0; 60 + } 61 + 62 + EventQueueRef GetMainEventQueue() 63 + { 64 + if (verbose) puts("STUB: GetMainEventQueue called"); 65 + return 0; 66 + } 67 + 68 + OSStatus InstallEventHandler(EventTargetRef a, EventHandlerUPP b, ItemCount c, const EventTypeSpec* d, void* e, EventHandlerRef* f) 69 + { 70 + if (verbose) puts("STUB: InstallEventHandler called"); 71 + return 0; 72 + } 73 + 74 + EventHandlerUPP NewEventHandlerUPP(EventHandlerProcPtr a) 75 + { 76 + if (verbose) puts("STUB: NewEventHandlerUPP called"); 77 + return (EventHandlerUPP)0; 78 + } 79 + 80 + OSStatus PostEventToQueue(EventQueueRef a, EventRef b, EventPriority c) 81 + { 82 + if (verbose) puts("STUB: PostEventToQueue called"); 83 + return 0; 84 + } 85 + 86 + OSStatus ReceiveNextEvent(ItemCount a, const EventTypeSpec* b, EventTimeout c, Boolean d, EventRef* e) 87 + { 88 + if (verbose) puts("STUB: ReceiveNextEvent called"); 89 + return 0; 90 + } 91 + 92 + void ReleaseEvent(EventRef a) 93 + { 94 + if (verbose) puts("STUB: ReleaseEvent called"); 95 + } 96 + 97 + OSStatus RemoveEventHandler(EventHandlerRef a) 98 + { 99 + if (verbose) puts("STUB: RemoveEventHandler called"); 100 + return 0; 101 + } 102 + 103 + OSStatus SendEventToEventTarget(EventRef a, EventTargetRef b) 104 + { 105 + if (verbose) puts("STUB: SendEventToEventTarget called"); 106 + return 0; 107 + }
-78
src/frameworks/Carbon/src/Carbon.c
··· 45 45 return 0; 46 46 } 47 47 48 - OSStatus CallNextEventHandler(EventHandlerCallRef a, EventRef b) 49 - { 50 - if (verbose) puts("STUB: CallNextEventHandler called"); 51 - return 0; 52 - } 53 - 54 - OSStatus CreateEvent(CFAllocatorRef a, UInt32 b, UInt32 c, EventTime d, EventAttributes e, EventRef * f) 55 - { 56 - if (verbose) puts("STUB: CreateEvent called"); 57 - return 0; 58 - } 59 - 60 48 OSStatus CreateStandardAlert(AlertType a, CFStringRef b, CFStringRef c, const AlertStdCFStringAlertParamRec * d, DialogRef * e) 61 49 { 62 50 if (verbose) puts("STUB: CreateStandardAlert called"); ··· 80 68 return (EventTargetRef)0; 81 69 } 82 70 83 - UInt32 GetEventClass(EventRef a) 84 - { 85 - if (verbose) puts("STUB: GetEventClass called"); 86 - return 0; 87 - } 88 - 89 71 OSStatus GetEventDispatcherTarget() 90 72 { 91 73 if (verbose) puts("STUB: GetEventDispatcherTarget called"); 92 74 return 0; 93 75 } 94 76 95 - UInt32 GetEventKind(EventRef a) 96 - { 97 - if (verbose) puts("STUB: GetEventKind called"); 98 - return 0; 99 - } 100 - 101 - OSStatus GetEventParameter(EventRef a, EventParamName b, EventParamType c, EventParamType * d, UInt32 e, UInt32 * f, void * g) 102 - { 103 - if (verbose) puts("STUB: GetEventParameter called"); 104 - return 0; 105 - } 106 - 107 - OSStatus GetMainEventQueue() 108 - { 109 - if (verbose) puts("STUB: GetMainEventQueue called"); 110 - return 0; 111 - } 112 - 113 77 OSStatus GetScrapByName(CFStringRef a, OptionBits b, ScrapRef * c) 114 78 { 115 79 if (verbose) puts("STUB: GetScrapByName called"); ··· 140 104 141 105 } 142 106 143 - OSStatus InstallEventHandler(EventTargetRef a, EventHandlerUPP b, UInt32 c, const EventTypeSpec * d, void * e, EventHandlerRef * f) 144 - { 145 - if (verbose) puts("STUB: InstallEventHandler called"); 146 - return 0; 147 - } 148 - 149 107 OSErr NMInstall(NMRecPtr a) 150 108 { 151 109 if (verbose) puts("STUB: NMInstall called"); 152 110 return 0; 153 111 } 154 112 155 - EventHandlerUPP NewEventHandlerUPP(EventHandlerProcPtr a) 156 - { 157 - if (verbose) puts("STUB: NewEventHandlerUPP called"); 158 - return (EventHandlerUPP)0; 159 - } 160 - 161 113 OSErr NewTSMDocument(short a, InterfaceTypeList b, TSMDocumentID * c, long d) 162 114 { 163 115 if (verbose) puts("STUB: NewTSMDocument called"); 164 116 return 0; 165 117 } 166 118 167 - OSStatus PostEventToQueue(EventQueueRef a, EventRef b, EventPriority c) 168 - { 169 - if (verbose) puts("STUB: PostEventToQueue called"); 170 - return 0; 171 - } 172 - 173 119 OSStatus ProcessHICommand(const HICommand * a) 174 120 { 175 121 if (verbose) puts("STUB: ProcessHICommand called"); ··· 182 128 return 0; 183 129 } 184 130 185 - OSStatus ReceiveNextEvent(UInt32 a, const EventTypeSpec * b, EventTimeout c, Boolean d, EventRef * e) 186 - { 187 - if (verbose) puts("STUB: ReceiveNextEvent called"); 188 - return 0; 189 - } 190 - 191 - OSStatus ReleaseEvent(EventRef a) 192 - { 193 - if (verbose) puts("STUB: ReleaseEvent called"); 194 - return 0; 195 - } 196 - 197 - OSStatus RemoveEventHandler(EventHandlerRef a) 198 - { 199 - if (verbose) puts("STUB: RemoveEventHandler called"); 200 - return 0; 201 - } 202 - 203 131 void RunApplicationEventLoop(void) 204 132 { 205 133 if (verbose) puts("STUB: RunApplicationEventLoop called"); ··· 209 137 OSStatus RunStandardAlert(DialogRef a, ModalFilterUPP b, DialogItemIndex * c) 210 138 { 211 139 if (verbose) puts("STUB: RunStandardAlert called"); 212 - return 0; 213 - } 214 - 215 - OSStatus SendEventToEventTarget(EventRef a, EventTargetRef b) 216 - { 217 - if (verbose) puts("STUB: SendEventToEventTarget called"); 218 140 return 0; 219 141 } 220 142