From 1d4ae9496e88cc5fb86b9953b9a80e96bd92422b Mon Sep 17 00:00:00 2001 From: Felix Deimel Date: Wed, 30 Oct 2024 10:17:39 +0100 Subject: [PATCH 1/6] Make demos compatible with updates in RoyalVNC try-windows branch --- .swiftlint.yml | 2 +- .../Connection/ConnectionViewController.swift | 18 +++++++------ .../Connection/ConnectionViewController.m | 15 ++++++----- .../ConfigurationViewController.swift | 16 ++++++----- .../CAFramebufferViewController.swift | 27 ++++++++++--------- .../FramebufferViewController.swift | 5 ++-- royalvnc | 2 +- 7 files changed, 47 insertions(+), 38 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index cd59e7d..e88eaf4 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -44,7 +44,7 @@ function_parameter_count: 8 cyclomatic_complexity: 16 identifier_name: - min_length: 2 + min_length: 1 max_length: 60 allowed_symbols: [ _ diff --git a/RoyalVNCDemo/Source/Connection/ConnectionViewController.swift b/RoyalVNCDemo/Source/Connection/ConnectionViewController.swift index 2f12287..93c24a2 100644 --- a/RoyalVNCDemo/Source/Connection/ConnectionViewController.swift +++ b/RoyalVNCDemo/Source/Connection/ConnectionViewController.swift @@ -299,14 +299,16 @@ extension ConnectionViewController: VNCConnectionDelegate { framebuffer: framebuffer) } } - - func connection(_ connection: VNCConnection, - framebuffer: VNCFramebuffer, - didUpdateRegion updatedRegion: CGRect) { - framebufferView?.connection(connection, - framebuffer: framebuffer, - didUpdateRegion: updatedRegion) - } + + func connection(_ connection: VNCConnection, + didUpdateFramebuffer framebuffer: VNCFramebuffer, + x: UInt16, y: UInt16, + width: UInt16, height: UInt16) { + framebufferView?.connection(connection, + didUpdateFramebuffer: framebuffer, + x: x, y: y, + width: width, height: height) + } func connection(_ connection: VNCConnection, didUpdateCursor cursor: VNCCursor) { diff --git a/RoyalVNCObjCDemo/Source/Connection/ConnectionViewController.m b/RoyalVNCObjCDemo/Source/Connection/ConnectionViewController.m index e8b175d..262c556 100644 --- a/RoyalVNCObjCDemo/Source/Connection/ConnectionViewController.m +++ b/RoyalVNCObjCDemo/Source/Connection/ConnectionViewController.m @@ -312,12 +312,15 @@ - (void)connection:(VNCConnection*)connection didResizeFramebuffer:(VNCFramebuff }); } -- (void)connection:(VNCConnection*)connection - framebuffer:(VNCFramebuffer*)framebuffer - didUpdateRegion:(CGRect)updatedRegion { - [self.framebufferView connection:connection - framebuffer:framebuffer - didUpdateRegion:updatedRegion]; +- (void)connection:(VNCConnection *)connection didUpdateFramebuffer:(VNCFramebuffer *)framebuffer + x:(uint16_t)x y:(uint16_t)y + width:(uint16_t)width height:(uint16_t)height { + [self.framebufferView connection:connection + didUpdateFramebuffer:framebuffer + x:x + y:y + width:width + height:height]; } - (void)connection:(VNCConnection*)connection diff --git a/RoyalVNCiOSDemo/Source/Configuration/ConfigurationViewController.swift b/RoyalVNCiOSDemo/Source/Configuration/ConfigurationViewController.swift index 4265849..10c4df7 100644 --- a/RoyalVNCiOSDemo/Source/Configuration/ConfigurationViewController.swift +++ b/RoyalVNCiOSDemo/Source/Configuration/ConfigurationViewController.swift @@ -386,13 +386,15 @@ extension ConfigurationViewController: VNCConnectionDelegate { didResizeFramebuffer framebuffer: VNCFramebuffer) { // TODO } - - func connection(_ connection: VNCConnection, - framebuffer: VNCFramebuffer, - didUpdateRegion updatedRegion: CGRect) { - framebufferViewController?.framebuffer(framebuffer, - didUpdateRegion: updatedRegion) - } + + func connection(_ connection: VNCConnection, + didUpdateFramebuffer framebuffer: VNCFramebuffer, + x: UInt16, y: UInt16, + width: UInt16, height: UInt16) { + framebufferViewController?.framebufferDidUpdate(framebuffer, + x: x, y: y, + width: width, height: height) + } func connection(_ connection: VNCConnection, didUpdateCursor cursor: VNCCursor) { diff --git a/RoyalVNCiOSDemo/Source/Framebuffer/CAFramebufferViewController.swift b/RoyalVNCiOSDemo/Source/Framebuffer/CAFramebufferViewController.swift index fa9c0f8..5f405a3 100644 --- a/RoyalVNCiOSDemo/Source/Framebuffer/CAFramebufferViewController.swift +++ b/RoyalVNCiOSDemo/Source/Framebuffer/CAFramebufferViewController.swift @@ -108,19 +108,20 @@ extension CAFramebufferViewController { view.layer.contentsGravity = .resizeAspect } } - - func framebuffer(_ framebuffer: VNCFramebuffer, - didUpdateRegion updatedRegion: CGRect) { - let cgImage = framebuffer.cgImage - - DispatchQueue.main.async { [weak self] in - guard let self else { return } - - let layer = self.view.layer - - layer.contents = cgImage - } - } + + func framebufferDidUpdate(_ framebuffer: VNCFramebuffer, + x: UInt16, y: UInt16, + width: UInt16, height: UInt16) { + let cgImage = framebuffer.cgImage + + DispatchQueue.main.async { [weak self] in + guard let self else { return } + + let layer = self.view.layer + + layer.contents = cgImage + } + } } extension CAFramebufferViewController: UITextFieldDelegate { diff --git a/RoyalVNCiOSDemo/Source/Framebuffer/FramebufferViewController.swift b/RoyalVNCiOSDemo/Source/Framebuffer/FramebufferViewController.swift index 1575508..2d27ce6 100644 --- a/RoyalVNCiOSDemo/Source/Framebuffer/FramebufferViewController.swift +++ b/RoyalVNCiOSDemo/Source/Framebuffer/FramebufferViewController.swift @@ -13,8 +13,9 @@ protocol FramebufferViewController: UIViewController { var framebufferViewControllerDelegate: FramebufferViewControllerDelegate? { get set } - func framebuffer(_ framebuffer: VNCFramebuffer, - didUpdateRegion updatedRegion: CGRect) + func framebufferDidUpdate(_ framebuffer: VNCFramebuffer, + x: UInt16, y: UInt16, + width: UInt16, height: UInt16) } extension FramebufferViewController { diff --git a/royalvnc b/royalvnc index 23474f9..0bdfeea 160000 --- a/royalvnc +++ b/royalvnc @@ -1 +1 @@ -Subproject commit 23474f985a7853686191a675cdc0f4f485409f95 +Subproject commit 0bdfeeab1b0ce10842dff97203d9787f9c484c29 From fd6585dcf2dd3e5f88f5e21a51474eaf136e56ff Mon Sep 17 00:00:00 2001 From: Felix Deimel Date: Wed, 30 Oct 2024 11:15:48 +0100 Subject: [PATCH 2/6] Update submodule --- royalvnc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/royalvnc b/royalvnc index 0bdfeea..323786d 160000 --- a/royalvnc +++ b/royalvnc @@ -1 +1 @@ -Subproject commit 0bdfeeab1b0ce10842dff97203d9787f9c484c29 +Subproject commit 323786d5c5eb512f23f98fe6a157848390c65a68 From 976fa4a17619badaadfda4815fd0eb3aba490e69 Mon Sep 17 00:00:00 2001 From: Felix Deimel Date: Wed, 30 Oct 2024 14:58:56 +0100 Subject: [PATCH 3/6] Update submodule --- royalvnc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/royalvnc b/royalvnc index 323786d..c88b4d4 160000 --- a/royalvnc +++ b/royalvnc @@ -1 +1 @@ -Subproject commit 323786d5c5eb512f23f98fe6a157848390c65a68 +Subproject commit c88b4d4a594871d4bc75ce7029bb3285546998a8 From e5520a72bd8eb7c2d16ae7ee9ad18e74e01bf82c Mon Sep 17 00:00:00 2001 From: Felix Deimel Date: Wed, 30 Oct 2024 15:28:36 +0100 Subject: [PATCH 4/6] Update submodule --- royalvnc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/royalvnc b/royalvnc index c88b4d4..849adb7 160000 --- a/royalvnc +++ b/royalvnc @@ -1 +1 @@ -Subproject commit c88b4d4a594871d4bc75ce7029bb3285546998a8 +Subproject commit 849adb72b751e8fe2d7e835e70d8e235bd4e86cb From 5c1fca6f76d830ba8c69b686d7396d58ad04219c Mon Sep 17 00:00:00 2001 From: Felix Deimel Date: Wed, 30 Oct 2024 15:40:34 +0100 Subject: [PATCH 5/6] Update submodule --- royalvnc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/royalvnc b/royalvnc index 849adb7..7aeae91 160000 --- a/royalvnc +++ b/royalvnc @@ -1 +1 @@ -Subproject commit 849adb72b751e8fe2d7e835e70d8e235bd4e86cb +Subproject commit 7aeae91967c7fb95b1a3e293fd23776392a0a2d9 From 586983c852f1ce875e32a1d64d27d2cc4b48e7e0 Mon Sep 17 00:00:00 2001 From: Felix Deimel Date: Wed, 6 Nov 2024 10:36:29 +0100 Subject: [PATCH 6/6] Switch to RoyalVNC main branch --- royalvnc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/royalvnc b/royalvnc index 7aeae91..dd13140 160000 --- a/royalvnc +++ b/royalvnc @@ -1 +1 @@ -Subproject commit 7aeae91967c7fb95b1a3e293fd23776392a0a2d9 +Subproject commit dd131400e1f10db4e99dbcf0c1464eb660e33641