Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compatible with recent RoyalVNC changes #1

Merged
merged 6 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function_parameter_count: 8
cyclomatic_complexity: 16

identifier_name:
min_length: 2
min_length: 1
max_length: 60
allowed_symbols: [
_
Expand Down
18 changes: 10 additions & 8 deletions RoyalVNCDemo/Source/Connection/ConnectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
15 changes: 9 additions & 6 deletions RoyalVNCObjCDemo/Source/Connection/ConnectionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion royalvnc
Submodule royalvnc updated 770 files