Simple Directmedia Layer
fork

Configure Feed

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

uikit: Patched to compile, added to Xcode project.

+43 -32
+7
Xcode/SDL/SDL.xcodeproj/project.pbxproj
··· 530 530 F3FD042E2C9B755700824C4C /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FD042C2C9B755700824C4C /* SDL_hidapi_nintendo.h */; }; 531 531 F3FD042F2C9B755700824C4C /* SDL_hidapi_steam_hori.c in Sources */ = {isa = PBXBuildFile; fileRef = F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */; }; 532 532 FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; platformFilters = (ios, maccatalyst, macos, tvos, watchos, ); }; 533 + 000012E88BE7D71B274A0000 /* SDL_uikitpen.h in Headers */ = {isa = PBXBuildFile; fileRef = 000063D3D80F97ADC7770000 /* SDL_uikitpen.h */; }; 534 + 0000A877C7DB9FA935FC0000 /* SDL_uikitpen.m in Sources */ = {isa = PBXBuildFile; fileRef = 000053D344416737F6050000 /* SDL_uikitpen.m */; }; 533 535 /* End PBXBuildFile section */ 534 536 535 537 /* Begin PBXContainerItemProxy section */ ··· 1092 1094 F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = "<group>"; }; 1093 1095 F5A2EF3900C6A39A01000001 /* BUGS.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = BUGS.txt; path = ../../BUGS.txt; sourceTree = SOURCE_ROOT; }; 1094 1096 FA73671C19A540EF004122E4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; 1097 + 000063D3D80F97ADC7770000 /* SDL_uikitpen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_uikitpen.h; path = SDL_uikitpen.h; sourceTree = "<group>"; }; 1098 + 000053D344416737F6050000 /* SDL_uikitpen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_uikitpen.m; path = SDL_uikitpen.m; sourceTree = "<group>"; }; 1095 1099 /* End PBXFileReference section */ 1096 1100 1097 1101 /* Begin PBXFrameworksBuildPhase section */ ··· 1682 1686 A7D8A62523E2513D00DCD162 /* SDL_uikitvulkan.m */, 1683 1687 A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */, 1684 1688 A7D8A61A23E2513D00DCD162 /* SDL_uikitwindow.m */, 1689 + 000063D3D80F97ADC7770000 /* SDL_uikitpen.h */, 1690 + 000053D344416737F6050000 /* SDL_uikitpen.m */, 1685 1691 ); 1686 1692 path = uikit; 1687 1693 sourceTree = "<group>"; ··· 3020 3026 0000AEB9AE90228CA2D60000 /* SDL_asyncio.c in Sources */, 3021 3027 00004D0B73767647AD550000 /* SDL_asyncio_generic.c in Sources */, 3022 3028 0000A03C0F32C43816F40000 /* SDL_asyncio_windows_ioring.c in Sources */, 3029 + 0000A877C7DB9FA935FC0000 /* SDL_uikitpen.m in Sources */, 3023 3030 ); 3024 3031 runOnlyForDeploymentPostprocessing = 0; 3025 3032 };
+3 -3
src/video/uikit/SDL_uikitview.h
··· 34 34 - (void)setSDLWindow:(SDL_Window *)window; 35 35 - (SDL_Window *)getSDLWindow; 36 36 37 + #if !defined(SDL_PLATFORM_TVOS) 37 38 #if defined(__IPHONE_13_0) 38 39 - (void)pencilHovering:(UIHoverGestureRecognizer *)recognizer API_AVAILABLE(ios(13.0)); 39 40 #endif 40 41 41 - #if !defined(SDL_PLATFORM_TVOS) && defined(__IPHONE_13_4) 42 + #if defined(__IPHONE_13_4) 42 43 - (UIPointerRegion *)pointerInteraction:(UIPointerInteraction *)interaction regionForRequest:(UIPointerRegionRequest *)request defaultRegion:(UIPointerRegion *)defaultRegion API_AVAILABLE(ios(13.4)); 43 44 - (UIPointerStyle *)pointerInteraction:(UIPointerInteraction *)interaction styleForRegion:(UIPointerRegion *)region API_AVAILABLE(ios(13.4)); 44 45 - (void)indirectPointerHovering:(UIHoverGestureRecognizer *)recognizer API_AVAILABLE(ios(13.4)); 45 - - (void)updateIndirectPointerFromTouch:(UITouch *)touch; 46 - - (void)updateIndirectPointerButtonState:(UITouch *)touch fromEvent:(UIEvent *)event; 46 + #endif 47 47 #endif 48 48 49 49 - (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize;
+33 -29
src/video/uikit/SDL_uikitview.m
··· 49 49 SDL_TouchID directTouchId; 50 50 SDL_TouchID indirectTouchId; 51 51 52 - #if defined(__IPHONE_13_4) 52 + #if !defined(SDL_PLATFORM_TVOS) && defined(__IPHONE_13_4) 53 53 UIPointerInteraction *indirectPointerInteraction API_AVAILABLE(ios(13.4)); 54 54 #endif 55 55 } ··· 85 85 #ifndef SDL_PLATFORM_TVOS 86 86 self.multipleTouchEnabled = YES; 87 87 SDL_AddTouch(directTouchId, SDL_TOUCH_DEVICE_DIRECT, ""); 88 - #endif 89 - 88 + 90 89 #if defined(__IPHONE_13_0) 91 90 if (@available(iOS 13.0, *)) { 92 91 UIHoverGestureRecognizer *pencilRecognizer = [[UIHoverGestureRecognizer alloc] initWithTarget:self action:@selector(pencilHovering:)]; ··· 95 94 } 96 95 #endif 97 96 98 - #if !defined(SDL_PLATFORM_TVOS) && defined(__IPHONE_13_4) 97 + #if defined(__IPHONE_13_4) 99 98 if (@available(iOS 13.4, *)) { 100 99 indirectPointerInteraction = [[UIPointerInteraction alloc] initWithDelegate:self]; 101 100 [self addInteraction:indirectPointerInteraction]; ··· 105 104 [self addGestureRecognizer:indirectPointerRecognizer]; 106 105 } 107 106 #endif 107 + #endif // !defined(SDL_PLATFORM_TVOS) 108 108 } 109 109 110 110 return self; ··· 171 171 return sdlwindow; 172 172 } 173 173 174 - #if !defined(SDL_PLATFORM_TVOS) && defined(__IPHONE_13_4) 174 + #if !defined(SDL_PLATFORM_TVOS) 175 + 176 + #if defined(__IPHONE_13_4) 175 177 - (UIPointerRegion *)pointerInteraction:(UIPointerInteraction *)interaction regionForRequest:(UIPointerRegionRequest *)request defaultRegion:(UIPointerRegion *)defaultRegion API_AVAILABLE(ios(13.4)) 176 178 { 177 179 return [UIPointerRegion regionWithRect:self.bounds identifier:nil]; ··· 251 253 } 252 254 } 253 255 254 - #endif // !defined(SDL_PLATFORM_TVOS) && __IPHONE_13_4 256 + #endif // __IPHONE_13_4 255 257 256 258 #if defined(__IPHONE_13_0) 257 259 ··· 293 295 } 294 296 295 297 #endif // defined(__IPHONE_13_0) 298 + #endif // !defined(SDL_PLATFORM_TVOS) 296 299 297 300 - (SDL_TouchDeviceType)touchTypeForTouch:(UITouch *)touch 298 301 { ··· 345 348 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 346 349 { 347 350 for (UITouch *touch in touches) { 348 - BOOL handled = NO; 349 - 351 + #if !defined(SDL_PLATFORM_TVOS) 350 352 #if defined(__IPHONE_13_0) 351 353 if (@available(iOS 13.0, *)) { 352 354 if (touch.type == UITouchTypePencil) { ··· 356 358 } 357 359 #endif 358 360 359 - #if !defined(SDL_PLATFORM_TVOS) && defined(__IPHONE_13_4) 361 + #if defined(__IPHONE_13_4) 360 362 if (@available(iOS 13.4, *)) { 361 363 if (touch.type == UITouchTypeIndirectPointer) { 362 364 [self indirectPointerPressed:touch fromEvent:event]; 363 - handled = YES; 365 + continue; 364 366 } 365 367 } 366 368 #endif 367 - if (!handled) { 368 - SDL_TouchDeviceType touchType = [self touchTypeForTouch:touch]; 369 - SDL_TouchID touchId = [self touchIdForType:touchType]; 370 - float pressure = [self pressureForTouch:touch]; 371 - 372 - if (SDL_AddTouch(touchId, touchType, "") < 0) { 373 - continue; 374 - } 369 + #endif // !defined(SDL_PLATFORM_TVOS) 375 370 376 - // FIXME, need to send: int clicks = (int) touch.tapCount; ? 371 + SDL_TouchDeviceType touchType = [self touchTypeForTouch:touch]; 372 + SDL_TouchID touchId = [self touchIdForType:touchType]; 373 + float pressure = [self pressureForTouch:touch]; 377 374 378 - CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; 379 - SDL_SendTouch(UIKit_GetEventTimestamp([event timestamp]), 380 - touchId, (SDL_FingerID)(uintptr_t)touch, sdlwindow, 381 - true, locationInView.x, locationInView.y, pressure); 375 + if (SDL_AddTouch(touchId, touchType, "") < 0) { 376 + continue; 382 377 } 378 + 379 + // FIXME, need to send: int clicks = (int) touch.tapCount; ? 380 + 381 + CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; 382 + SDL_SendTouch(UIKit_GetEventTimestamp([event timestamp]), 383 + touchId, (SDL_FingerID)(uintptr_t)touch, sdlwindow, 384 + true, locationInView.x, locationInView.y, pressure); 383 385 } 384 386 } 385 387 386 388 - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 387 389 { 388 390 for (UITouch *touch in touches) { 389 - BOOL handled = NO; 390 - 391 + #if !defined(SDL_PLATFORM_TVOS) 391 392 #if defined(__IPHONE_13_0) 392 393 if (@available(iOS 13.0, *)) { 393 394 if (touch.type == UITouchTypePencil) { ··· 397 398 } 398 399 #endif 399 400 400 - #if !defined(SDL_PLATFORM_TVOS) && defined(__IPHONE_13_4) 401 + #if defined(__IPHONE_13_4) 401 402 if (@available(iOS 13.4, *)) { 402 403 if (touch.type == UITouchTypeIndirectPointer) { 403 404 [self indirectPointerReleased:touch fromEvent:event]; ··· 405 406 } 406 407 } 407 408 #endif 409 + #endif // !defined(SDL_PLATFORM_TVOS) 410 + 408 411 SDL_TouchDeviceType touchType = [self touchTypeForTouch:touch]; 409 412 SDL_TouchID touchId = [self touchIdForType:touchType]; 410 413 float pressure = [self pressureForTouch:touch]; ··· 430 433 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 431 434 { 432 435 for (UITouch *touch in touches) { 433 - BOOL handled = NO; 434 - 436 + #if !defined(SDL_PLATFORM_TVOS) 435 437 #if defined(__IPHONE_13_0) 436 438 if (@available(iOS 13.0, *)) { 437 439 if (touch.type == UITouchTypePencil) { ··· 441 443 } 442 444 #endif 443 445 444 - #if !defined(SDL_PLATFORM_TVOS) && defined(__IPHONE_13_4) 446 + #if defined(__IPHONE_13_4) 445 447 if (@available(iOS 13.4, *)) { 446 448 if (touch.type == UITouchTypeIndirectPointer) { 447 449 [self indirectPointerMoving:touch]; ··· 449 451 } 450 452 } 451 453 #endif 454 + #endif // !defined(SDL_PLATFORM_TVOS) 455 + 452 456 SDL_TouchDeviceType touchType = [self touchTypeForTouch:touch]; 453 457 SDL_TouchID touchId = [self touchIdForType:touchType]; 454 458 float pressure = [self pressureForTouch:touch];