Learn how to evaluate and integrate the VNC SDK
Viewer¶
-
class
vncsdk.Viewer¶ A VNC-compatible Viewer showing the screen of and controlling a remote computer.
Nested Classes¶
vncsdk.Viewer.AuthenticationCallbackvncsdk.Viewer.ConnectionCallbackvncsdk.Viewer.FramebufferCallbackvncsdk.Viewer.PeerVerificationCallbackvncsdk.Viewer.ServerEventCallbackvncsdk.Viewer.ConnectionStatusvncsdk.Viewer.DisconnectFlagsvncsdk.Viewer.EncryptionLevelvncsdk.Viewer.MouseButtonvncsdk.Viewer.MouseWheelvncsdk.Viewer.PictureQuality
Constructor Summary¶
| Modifier and Type | Method and Description |
|---|---|
__init__() Creates and returns a new viewer. |
Method Summary¶
| Modifier and Type | Method and Description |
|---|---|
| bytes |
Returns the viewer framebuffer data for the given rectangle. |
Sets the viewer framebuffer. |
|
Destroys the viewer. |
|
|
Disconnects this viewer from the server. |
|
vncsdk.AnnotationManager |
Obtains the Viewer’s |
vncsdk.ConnectionHandler |
Returns the viewer’s |
vncsdk.Viewer.ConnectionStatus |
Returns the status of the viewer’s connection. |
| str or None |
Returns a human-readable message sent by the server for the last disconnection, or |
| str or None |
Returns a string ID representing the reason for the last viewer disconnection. |
vncsdk.Viewer.EncryptionLevel |
Returns the Viewer’s current encryption level. |
vncsdk.MessagingManager |
Obtains the Viewer’s Messaging Manager for handling messaging For more information, see |
| str |
Returns the address of the viewer’s server. |
vncsdk.Viewer.PictureQuality |
Returns the viewer’s current picture quality. |
| int |
Gets the height of the viewer framebuffer. |
vncsdk.PixelFormat |
Gets the pixel format of the viewer framebuffer. |
| int |
Returns the stride of the viewer framebuffer data in pixels, that is, the number of pixels from the start of each row until the start of the next. |
| int |
Gets the width of the viewer framebuffer. |
|
Send key up events for all currently pressed keys. |
|
Provides the SDK with the result of a username/password request. |
|
Copies the given text to the server’s clipboard. |
|
Sends a key down (press) event to the server. |
|
Sends a key up (release) event to the server. |
|
Provides the SDK with the response to the |
|
Sends a pointer event to the server. |
|
Sends a scroll wheel event to the server. |
|
Sets the callback to be called when a username and/or password is required. |
|
Sets the callbacks for the Viewer to call when various events occur during its lifetime. |
|
Sets the desired encryption level of the session from the range of options enumerated by |
|
Sets the framebuffer callback for this viewer. |
|
Sets the callbacks to be called to verify the identity of the peer (server). |
|
Sets the desired picture quality of the session from the range of options enumerated by |
|
Sets the server event callback for this viewer. |
Constructor¶
-
vncsdk.Viewer.__init__()¶ Creates and returns a new viewer.
For more information, see
vnc_Viewer_create().
Methods¶
-
Viewer.get_viewer_fb_data(x, y, w, h)¶ Returns the viewer framebuffer data for the given rectangle.
Parameters: - x (int) –
- y (int) –
- w (int) –
- h (int) –
Return type: bytes
-
Viewer.set_viewer_fb(pixels, pf, width, height, stride)¶ Sets the viewer framebuffer. Note: The viewer does not keep a strong reference to any user-allocated framebuffer passed in via the pixels parameter, therefore users must keep their own reference to the framebuffer to prevent it from being garbage collected while it is being used by the viewer.
Parameters: - pixels (undefined) –
- pf (vncsdk.PixelFormat) –
- width (int) –
- height (int) –
-
Viewer.destroy()¶ Destroys the viewer.
For more information, see
vnc_Viewer_destroy().
-
Viewer.disconnect()¶ Disconnects this viewer from the server.
For more information, see
vnc_Viewer_disconnect().
-
Viewer.get_annotation_manager()¶ Obtains the Viewer’s
vncsdk.AnnotationManagerfor handling annotation operations.For more information, see
vnc_Viewer_getAnnotationManager().Return type: vncsdk.AnnotationManager
-
Viewer.get_connection_handler()¶ Returns the viewer’s
vncsdk.ConnectionHandlerfor accepting connections.For more information, see
vnc_Viewer_getConnectionHandler().Return type: vncsdk.ConnectionHandler
-
Viewer.get_connection_status()¶ Returns the status of the viewer’s connection.
For more information, see
vnc_Viewer_getConnectionStatus().Return type: vncsdk.Viewer.ConnectionStatus
-
Viewer.get_disconnect_message()¶ Returns a human-readable message sent by the server for the last disconnection, or
Noneif the last disconnection was not initiated by the server.For more information, see
vnc_Viewer_getDisconnectMessage().Return type: str or None
-
Viewer.get_disconnect_reason()¶ Returns a string ID representing the reason for the last viewer disconnection.
For more information, see
vnc_Viewer_getDisconnectReason().Return type: str or None
-
Viewer.get_encryption_level()¶ Returns the Viewer’s current encryption level.
For more information, see
vnc_Viewer_getEncryptionLevel().Return type: vncsdk.Viewer.EncryptionLevel
-
Viewer.get_messaging_manager()¶ Obtains the Viewer’s Messaging Manager for handling messaging
For more information, see
vnc_Viewer_getMessagingManager().Return type: vncsdk.MessagingManager
-
Viewer.get_peer_address()¶ Returns the address of the viewer’s server.
For more information, see
vnc_Viewer_getPeerAddress().Return type: str
-
Viewer.get_picture_quality()¶ Returns the viewer’s current picture quality.
For more information, see
vnc_Viewer_getPictureQuality().Return type: vncsdk.Viewer.PictureQuality
-
Viewer.get_viewer_fb_height()¶ Gets the height of the viewer framebuffer.
For more information, see
vnc_Viewer_getViewerFbHeight().Return type: int
-
Viewer.get_viewer_fb_pixel_format()¶ Gets the pixel format of the viewer framebuffer.
For more information, see
vnc_Viewer_getViewerFbPixelFormat().Return type: vncsdk.PixelFormat
-
Viewer.get_viewer_fb_stride()¶ Returns the stride of the viewer framebuffer data in pixels, that is, the number of pixels from the start of each row until the start of the next.
For more information, see
vnc_Viewer_getViewerFbStride().Return type: int
-
Viewer.get_viewer_fb_width()¶ Gets the width of the viewer framebuffer.
For more information, see
vnc_Viewer_getViewerFbWidth().Return type: int
-
Viewer.release_all_keys()¶ Send key up events for all currently pressed keys.
For more information, see
vnc_Viewer_releaseAllKeys().
-
Viewer.send_authentication_response(ok, user, passwd)¶ Provides the SDK with the result of a username/password request.
For more information, see
vnc_Viewer_sendAuthenticationResponse().Parameters: - ok (bool) –
- user (str or None) –
- passwd (str or None) –
-
Viewer.send_clipboard_text(text)¶ Copies the given text to the server’s clipboard.
For more information, see
vnc_Viewer_sendClipboardText().Parameters: text (str) –
-
Viewer.send_key_down(keysym, key_code)¶ Sends a key down (press) event to the server.
For more information, see
vnc_Viewer_sendKeyDown().Parameters: - keysym (int) –
- key_code (int) –
-
Viewer.send_key_up(key_code)¶ Sends a key up (release) event to the server.
For more information, see
vnc_Viewer_sendKeyUp().Parameters: key_code (int) –
-
Viewer.send_peer_verification_response(ok)¶ Provides the SDK with the response to the
Viewer.PeerVerificationCallbackverifyPeer()request.For more information, see
vnc_Viewer_sendPeerVerificationResponse().Parameters: ok (bool) –
-
Viewer.send_pointer_event(x, y, button_state, rel)¶ Sends a pointer event to the server.
For more information, see
vnc_Viewer_sendPointerEvent().Parameters: - x (int) –
- y (int) –
- button_state ({
vncsdk.Viewer.MouseButton}) – - rel (bool) –
-
Viewer.send_scroll_event(delta, axis)¶ Sends a scroll wheel event to the server.
For more information, see
vnc_Viewer_sendScrollEvent().Parameters: - delta (int) –
- axis (
vncsdk.Viewer.MouseWheel) –
-
Viewer.set_authentication_callback(callback)¶ Sets the callback to be called when a username and/or password is required.
For more information, see
vnc_Viewer_setAuthenticationCallback().Parameters: callback ( vncsdk.Viewer.AuthenticationCallbackor None) –
-
Viewer.set_connection_callback(callback)¶ Sets the callbacks for the Viewer to call when various events occur during its lifetime.
For more information, see
vnc_Viewer_setConnectionCallback().Parameters: callback ( vncsdk.Viewer.ConnectionCallbackor None) –
-
Viewer.set_encryption_level(level)¶ Sets the desired encryption level of the session from the range of options enumerated by
ENCRYPTION_LEVEL.For more information, see
vnc_Viewer_setEncryptionLevel().Parameters: level ( vncsdk.Viewer.EncryptionLevel) –
-
Viewer.set_framebuffer_callback(callback)¶ Sets the framebuffer callback for this viewer.
For more information, see
vnc_Viewer_setFramebufferCallback().Parameters: callback ( vncsdk.Viewer.FramebufferCallbackor None) –
-
Viewer.set_peer_verification_callback(callback)¶ Sets the callbacks to be called to verify the identity of the peer (server).
For more information, see
vnc_Viewer_setPeerVerificationCallback().Parameters: callback ( vncsdk.Viewer.PeerVerificationCallbackor None) –
-
Viewer.set_picture_quality(quality)¶ Sets the desired picture quality of the session from the range of options enumerated by
PICTURE_QUALITY.For more information, see
vnc_Viewer_setPictureQuality().Parameters: quality ( vncsdk.Viewer.PictureQuality) –
-
Viewer.set_server_event_callback(callback)¶ Sets the server event callback for this viewer.
For more information, see
vnc_Viewer_setServerEventCallback().Parameters: callback ( vncsdk.Viewer.ServerEventCallbackor None) –