From 777c825cca2bb48ee0443ff6f1cf110bf6b01b16 Mon Sep 17 00:00:00 2001 From: TrueZhuangjia Date: Fri, 22 Nov 2024 21:23:33 +0800 Subject: [PATCH] swift call obj-c test --- Limelight/Input/OnScreenButtonView.swift | 3 +++ Limelight/Input/OnScreenControls.h | 1 + Limelight/Input/OnScreenControls.m | 4 ++++ Limelight/Input/RelativeTouchHandler.h | 1 + Limelight/Input/RelativeTouchHandler.m | 4 ++++ Limelight/Moonlight-Bridging-Header.h | 2 ++ 6 files changed, 15 insertions(+) diff --git a/Limelight/Input/OnScreenButtonView.swift b/Limelight/Input/OnScreenButtonView.swift index 6154c0c2..fa78e9cd 100644 --- a/Limelight/Input/OnScreenButtonView.swift +++ b/Limelight/Input/OnScreenButtonView.swift @@ -209,6 +209,9 @@ import UIKit super.touchesBegan(touches, with: event) //self.backgroundColor = UIColor(red: 0.0, green: 0.0, blue: 1.0, alpha: 0.7) + OnScreenControls.testMethod(); + RelativeTouchHandler.testMethod(); + if !OnScreenButtonView.editMode { // self.backgroundColor = UIColor.systemBlue.withAlphaComponent(0.7) self.buttonDownVisualEffect() diff --git a/Limelight/Input/OnScreenControls.h b/Limelight/Input/OnScreenControls.h index 8e2711dd..0f0f7392 100644 --- a/Limelight/Input/OnScreenControls.h +++ b/Limelight/Input/OnScreenControls.h @@ -93,6 +93,7 @@ typedef NS_ENUM(NSInteger, OnScreenControlsLevel) { + (NSMutableSet* )touchAddrsCapturedByOnScreenControls; ++ (void) testMethod; - (id) initWithView:(UIView*)view controllerSup:(ControllerSupport*)controllerSupport streamConfig:(StreamConfiguration*)streamConfig; - (BOOL) handleTouchDownEvent:(NSSet*)touches; - (BOOL) handleTouchUpEvent:(NSSet*)touches; diff --git a/Limelight/Input/OnScreenControls.m b/Limelight/Input/OnScreenControls.m index 209c3212..4cdd58cc 100644 --- a/Limelight/Input/OnScreenControls.m +++ b/Limelight/Input/OnScreenControls.m @@ -142,6 +142,10 @@ static float L3_Y; return touchAddrsCapturedByOnScreenControls; } ++ (void) testMethod{ + NSLog(@"swift calling test"); +} + - (id) initWithView:(UIView*)view controllerSup:(ControllerSupport*)controllerSupport streamConfig:(StreamConfiguration*)streamConfig { self = [self init]; diff --git a/Limelight/Input/RelativeTouchHandler.h b/Limelight/Input/RelativeTouchHandler.h index 6d0832bb..e299c851 100644 --- a/Limelight/Input/RelativeTouchHandler.h +++ b/Limelight/Input/RelativeTouchHandler.h @@ -18,6 +18,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) CustomTapGestureRecognizer* mouseRightClickTapRecognizer; // this object will be passed to onscreencontrol class for areVirtualControllerTaps flag setting ++ (void) testMethod; - (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings; @end diff --git a/Limelight/Input/RelativeTouchHandler.m b/Limelight/Input/RelativeTouchHandler.m index 5ef674c0..cc5b6392 100644 --- a/Limelight/Input/RelativeTouchHandler.m +++ b/Limelight/Input/RelativeTouchHandler.m @@ -42,6 +42,10 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2; StreamView* streamView; } ++ (void) testMethod{ + NSLog(@"swift calling test 666"); +} + - (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings { self = [self init]; self->streamView = view; diff --git a/Limelight/Moonlight-Bridging-Header.h b/Limelight/Moonlight-Bridging-Header.h index 05482595..40222c8b 100644 --- a/Limelight/Moonlight-Bridging-Header.h +++ b/Limelight/Moonlight-Bridging-Header.h @@ -3,3 +3,5 @@ // #include +#import "OnScreenControls.h" +#import "RelativeTouchHandler.h"