GVnc.Connection¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The desktop framebuffer instance |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the cursor is changed. |
|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GVnc.Connection(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
the new connection
- Return type:
Create a new connection object, which is initially in the disconnected state.
- audio_disable()¶
-
Tell the server that it is no longer permitted to send audio. The client may continue to receive audio for a time after this, since packets may already be in flight.
- audio_enable()¶
-
Tell the server that it is permitted to send audio data.
- framebuffer_update_request(incremental, x, y, width, height)¶
- Parameters:
- Returns:
- Return type:
Request that the server send a framebuffer update when the region positioned at (x, y) wth size (width, height) sees damage. The update sent may be a subset of the region requested, if incremental is
False
.
- get_abs_pointer()¶
-
Determine if the remote server supports absolute pointer motion events. This will only be valid once the “vnc-initialized” signal has been emitted.
- get_audio_format()¶
- Returns:
the current audio format
- Return type:
Get the current audio format specification
- get_cursor()¶
- Returns:
the cursor or
None
- Return type:
Get the cursor currently associated with the desktop, if any.
- get_ext_key_event()¶
-
Determine if the remote server supports the extended keyboard event which transmits raw XT scancodes. This will only be valid once the “vnc-initialized” signal has been emitted
- get_height()¶
- Returns:
the desktop height
- Return type:
Get the height of the remote display. The height will only be set once the “vnc-initialized” signal has been emitted
- get_ledstate()¶
- Returns:
the LED state
- Return type:
Get the current LED state bitmap. This is only valid once the “vnc-initialized” signal has been emitted.
- get_name()¶
- Returns:
the remote display name
- Return type:
Get the name of the remote display. A name will only be available once the “vnc-initialized” signal has been emitted
- get_pixel_format()¶
- Returns:
the current pixel format
- Return type:
Get a specification of the current pixel format
- get_power_control()¶
-
Determine if the remote server supports power control. This will only be valid once the “vnc-initialized” signal has been emitted.
-
Get the sharing state for the connection
- get_width()¶
- Returns:
the desktop width
- Return type:
Get the width of the remote display. The width will only be set once the “vnc-initialized” signal has been emitted
- has_error()¶
-
Determine if the current connection is in an error state
- is_initialized()¶
-
Determine if the connection to the remote desktop is fully initialized and thus receiving framebuffer updates.
- is_open()¶
-
Check if the connection is currently open
- key_event(down_flag, key, scancode)¶
- Parameters:
- Returns:
- Return type:
Send a key press/release event to the server. By default the event will be sent with the X11 key code from key. If the extended key event protocol extension is active, the scancode will be sent instead.
- open_addr(addr, hostname)¶
- Parameters:
addr (
Gio.SocketAddress
) – the socket address
- Returns:
- Return type:
Open a socket connection to server identified by addr. addr may refer to either a TCP address (IPv4/6) or a UNIX socket address. The hostname provided should reflect the name of the host that the addr provides a connection to, if it is not already available in addr. For example, if addr points to a proxy server, then hostname can be used to provide the name of the final endpoint. This will be used by some authentication schemes, for example x509 certificate validation against hostname.
- open_fd(fd)¶
- Parameters:
fd (
int
) – file descriptor to use for the connection- Returns:
- Return type:
Open a connection using fd as the transport. If fd refers to a TCP connection, it is recommended to use
GVnc.Connection.open_fd_with_hostname
instead, to provide the remote hostname. This allows use of x509 based authentication which requires a hostname to be available.
- open_fd_with_hostname(fd, hostname)¶
- Parameters:
- Returns:
- Return type:
Open a connection using fd as the transport. The hostname provided should reflect the name of the host that the fd provides a connection to. This will be used by some authentication schemes, for example x509 certificate validation against hostname.
- open_host(host, port)¶
- Parameters:
- Returns:
- Return type:
Open a TCP connection to the remote desktop at host listening on port.
- pointer_event(button_mask, x, y)¶
- Parameters:
- Returns:
- Return type:
Send a pointer event to the server, reflecting either movement of the pointer, or a change in state of its buttons, or both.
- power_control(action)¶
- Parameters:
action (
GVnc.ConnectionPowerAction
) –- Returns:
True
if the action was sent,False
if power control is not supported- Return type:
Perform a power control action on the remote server.
This is only valid if the “vnc-power-control” signal has been emitted with a VNC_CONNECTION_POWER_STATUS_INIT code.
The action should be assumed to be accepted unless “vnc-power-control” signal is emitted with a VNC_CONNECTION_POWER_STATUS_FAIL code.
- set_audio(audio)¶
- Parameters:
audio (
GVnc.Audio
) – the audio sink- Returns:
- Return type:
Set the audio sink to use for playing back audio from the remote session.
- set_audio_format(fmt)¶
- Parameters:
fmt (
GVnc.AudioFormat
) – the audio format- Returns:
- Return type:
Set the audio format specification to use for playback from the remote session. The format should only be set when the audio stream is not active, otherwise it will be impossible to determine when the server has switched to sending data in the new format
- set_auth_subtype(type)¶
- Parameters:
type (
int
) – the auth sub-type- Returns:
- Return type:
If a multi-level authentication scheme was requested, this identifies which auth type to use for the second phase.
- set_auth_type(type)¶
- Parameters:
type (
int
) – the requested auth type- Returns:
- Return type:
Set the authentication type to use to complete the connection.
- set_credential(type, data)¶
- Parameters:
- Returns:
- Return type:
Sets the value of the authentication credential type to the string data.
type is one of the
GVnc.ConnectionCredential
enum vlaues
- set_encodings(encoding)¶
- Parameters:
encoding ([
int
]) – the list of permitted encodings- Returns:
- Return type:
Inform the server of the list of encodings that it is allowed to send. This should be done before requesting any framebuffer updates
- set_framebuffer(fb)¶
- Parameters:
fb (
GVnc.Framebuffer
) – the framebuffer object- Returns:
- Return type:
Set the framebuffer object to which frame buffer updates will be written.
- set_pixel_format(fmt)¶
- Parameters:
fmt (
GVnc.PixelFormat
) – the new pixel format- Returns:
- Return type:
Tell the server what pixel format to use for framebuffer updates. It is only safe to use this when no framebuffer updates are pending, otherwise it is impossible to determine when the server has switched over to using the new format.
- Parameters:
shared (
bool
) – the new sharing state- Returns:
- Return type:
Set the shared state for the connection. A
True
value allow allow this client to co-exist with other existing clients. AFalse
value will cause other clients to be dropped
- set_size(width, height)¶
- Parameters:
- Return type:
- shutdown()¶
Initiate a shutdown of the current connection by closing its socket
- do_vnc_auth_choose_subtype(type, subtypes) virtual¶
- Parameters:
type (
int
) –subtypes (
GObject.ValueArray
) –
- do_vnc_auth_choose_type(types) virtual¶
- Parameters:
types (
GObject.ValueArray
) –
- do_vnc_auth_credential(creds) virtual¶
- Parameters:
creds (
GObject.ValueArray
) –
- do_vnc_bell() virtual¶
- do_vnc_connected() virtual¶
- do_vnc_cursor_changed(cursor) virtual¶
- Parameters:
cursor (
GVnc.Cursor
) –
- do_vnc_disconnected() virtual¶
- do_vnc_framebuffer_update(x, y, width, height) virtual¶
- do_vnc_initialized() virtual¶
- do_vnc_led_state() virtual¶
- do_vnc_pixel_format_changed(format) virtual¶
- Parameters:
format (
GVnc.PixelFormat
) –
- do_vnc_power_control_failed() virtual¶
- do_vnc_power_control_initialized() virtual¶
- do_vnc_server_cut_text(text) virtual¶
- Parameters:
text (
GLib.String
) –
Signal Details¶
- GVnc.Connection.signals.vnc_auth_choose_subtype(connection, object, p0)¶
- Signal Name:
vnc-auth-choose-subtype
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
int
) –p0 (
GObject.ValueArray
) –
- GVnc.Connection.signals.vnc_auth_choose_type(connection, object)¶
- Signal Name:
vnc-auth-choose-type
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
GObject.ValueArray
) –
- GVnc.Connection.signals.vnc_auth_credential(connection, object)¶
- Signal Name:
vnc-auth-credential
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
GObject.ValueArray
) –
- GVnc.Connection.signals.vnc_auth_failure(connection, object)¶
- Signal Name:
vnc-auth-failure
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
str
) –
- GVnc.Connection.signals.vnc_auth_unsupported(connection, object)¶
- Signal Name:
vnc-auth-unsupported
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
int
) –
- GVnc.Connection.signals.vnc_bell(connection)¶
- Signal Name:
vnc-bell
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signal
- GVnc.Connection.signals.vnc_connected(connection)¶
- Signal Name:
vnc-connected
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signal
- GVnc.Connection.signals.vnc_cursor_changed(connection, cursor)¶
- Signal Name:
vnc-cursor-changed
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalcursor (
GVnc.Cursor
orNone
) – the new cursor
Emitted when the cursor is changed.
- GVnc.Connection.signals.vnc_desktop_rename(connection, object)¶
- Signal Name:
vnc-desktop-rename
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
str
) –
- GVnc.Connection.signals.vnc_desktop_resize(connection, object, p0)¶
- Signal Name:
vnc-desktop-resize
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
int
) –p0 (
int
) –
- GVnc.Connection.signals.vnc_disconnected(connection)¶
- Signal Name:
vnc-disconnected
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signal
- GVnc.Connection.signals.vnc_error(connection, object)¶
- Signal Name:
vnc-error
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
str
) –
- GVnc.Connection.signals.vnc_framebuffer_update(connection, object, p0, p1, p2)¶
- GVnc.Connection.signals.vnc_initialized(connection)¶
- Signal Name:
vnc-initialized
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signal
- GVnc.Connection.signals.vnc_led_state(connection)¶
- Signal Name:
vnc-led-state
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signal
- GVnc.Connection.signals.vnc_pixel_format_changed(connection, object)¶
- Signal Name:
vnc-pixel-format-changed
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
GVnc.PixelFormat
) –
- GVnc.Connection.signals.vnc_pointer_mode_changed(connection, object)¶
- Signal Name:
vnc-pointer-mode-changed
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
bool
) –
- GVnc.Connection.signals.vnc_power_control_failed(connection)¶
- Signal Name:
vnc-power-control-failed
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signal
- GVnc.Connection.signals.vnc_power_control_initialized(connection)¶
- Signal Name:
vnc-power-control-initialized
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signal
- GVnc.Connection.signals.vnc_server_cut_text(connection, object)¶
- Signal Name:
vnc-server-cut-text
- Flags:
- Parameters:
connection (
GVnc.Connection
) – The object which received the signalobject (
str
) –
Property Details¶
- GVnc.Connection.props.framebuffer¶
- Name:
framebuffer
- Type:
- Default Value:
- Flags:
The desktop framebuffer instance