GtkVnc.Display

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget Gtk.DrawingArea Gtk.DrawingArea GtkVnc.Display GtkVnc.Display Gtk.DrawingArea->GtkVnc.Display Gtk.Widget->Gtk.DrawingArea

Subclasses:

None

Methods

Inherited:

Gtk.DrawingArea (1), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

get_option_entries ()

class

get_option_group ()

class

new ()

client_cut_text (text)

close ()

force_grab (enable)

get_allow_resize ()

get_connection ()

get_depth ()

get_force_size ()

get_grab_keys ()

get_height ()

get_keep_aspect_ratio ()

get_keyboard_grab ()

get_lossy_encoding ()

get_name ()

get_pixbuf ()

get_pointer_grab ()

get_pointer_local ()

get_read_only ()

get_rotation ()

get_scaling ()

get_shared_flag ()

get_smoothing ()

get_width ()

get_zoom_level ()

is_open ()

is_pointer_absolute ()

open_addr (addr, hostname)

open_fd (fd)

open_fd_with_hostname (fd, hostname)

open_host (host, port)

request_update ()

send_keys (keyvals)

send_keys_ex (keyvals, kind)

send_pointer (x, y, button_mask)

set_allow_resize (enable)

set_credential (type, data)

set_depth (depth)

set_force_size (enable)

set_grab_keys (seq)

set_keep_aspect_ratio (enable)

set_keyboard_grab (enable)

set_lossy_encoding (enable)

set_pointer_grab (enable)

set_pointer_local (enable)

set_read_only (enable)

set_rotation (rotation)

set_scaling (enable)

set_shared_flag (shared)

set_smoothing (enable)

set_zoom_level (zoom)

Virtual Methods

Inherited:

Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

do_vnc_auth_credential (credList)

do_vnc_connected ()

do_vnc_disconnected ()

do_vnc_initialized ()

Properties

Inherited:

Gtk.Widget (39)

Name

Type

Flags

Short Description

allow-resize

bool

r/w/c

Whether we should resize the desktop to match widget size

connection

GVnc.Connection

r

The VNC connection

depth

GtkVnc.DisplayDepthColor

r/w/c

The color depth

force-size

bool

r/w/c

Whether we should define the widget size

grab-keyboard

bool

r/w/c

Whether we should grab the keyboard

grab-keys

GtkVnc.GrabSequence

r/w/c

The key grab sequence

grab-pointer

bool

r/w/c

Whether we should grab the pointer

height

int

r

The height of the remote screen

keep-aspect-ratio

bool

r/w/c

Keep the aspect ratio matching the framebuffer when scaling

local-pointer

bool

r/w/c

Whether we should use the local pointer

lossy-encoding

bool

r/w/c

Whether we should use a lossy encoding

read-only

bool

r/w/c

Whether this connection is read-only mode

rotation

int

r/w/c

Rotate the image of the remote desktop 90° clockwise

scaling

bool

r/w/c

Whether we should use scaling

shared-flag

bool

r/w/c

Whether we should leave other clients connected to the server

smoothing

bool

r/w/c

Whether we should smoothly interpolate when scaling

width

int

r

The width of the remote screen

zoom-level

int

r/w/c

Zoom percentage level

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Widget (69), GObject.Object (1)

Name

Short Description

vnc-auth-credential

vnc-auth-failure

vnc-auth-unsupported

vnc-bell

vnc-connected

vnc-desktop-rename

vnc-desktop-resize

vnc-disconnected

vnc-error

vnc-initialized

vnc-keyboard-grab

vnc-keyboard-ungrab

vnc-pointer-grab

vnc-pointer-ungrab

vnc-power-control-failed

vnc-power-control-initialized

vnc-server-cut-text

Fields

Inherited:

Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

parent

Gtk.DrawingArea

r

Class Details

class GtkVnc.Display(**kwargs)
Bases:

Gtk.DrawingArea

Abstract:

No

Structure:

GtkVnc.DisplayClass

classmethod get_option_entries()
Returns:

the option entries

Return type:

[GLib.OptionEntry]

Get the array of command line option entries containing VNC specific otions

classmethod get_option_group()
Returns:

the option group

Return type:

GLib.OptionGroup

Get a command line option group containing VNC specific options.

classmethod new()
Returns:

the new VNC display widget

Return type:

Gtk.Widget

Create a new widget capable of connecting to a VNC server and displaying its contents

The widget will initially be in a disconnected state

client_cut_text(text)
Parameters:

text (str) –

close()

Request that the connection to the remote display is closed. The actual close will complete asynchronously and the “vnc-disconnected” signal will be emitted once complete.

force_grab(enable)
Parameters:

enable (bool) – True to force pointer grabbing, False otherwise

If enable is True, immediately grab the pointer. If enable is False, immediately ungrab the pointer. This overrides any automatic grabs that may have been done.

get_allow_resize()
Returns:

True if allow resize is enabled, False otherwise

Return type:

bool

Determine whether widget size is used to request rsize of the remote desktop

get_connection()
Returns:

the connection object

Return type:

GVnc.Connection

Get the VNC connection object associated with the display

get_depth()
Returns:

the color depth

Return type:

GtkVnc.DisplayDepthColor

Get the desired colour depth

get_force_size()
Returns:

True if force size is enabled, False otherwise

Return type:

bool

Determine whether the widget size is being forced to match the desktop size

get_grab_keys()
Returns:

the current grab keys

Return type:

GtkVnc.GrabSequence

Get the current grab key sequence

get_height()
Returns:

the remote desktop height

Return type:

int

Get the height of the remote desktop. This is only valid after the “vnc-initialized” signal has been emitted

get_keep_aspect_ratio()
Returns:

True if aspect ratio is preserved, False otherwise

Return type:

bool

Determine whether the framebuffer aspect ratio is preserved when scaling.

get_keyboard_grab()
Returns:

True if the keyboard will be grabbed, False otherwise

Return type:

bool

Determine if the keyboard will be grabbed when the widget has input focus.

get_lossy_encoding()
Returns:

True if lossy encodings are permitted, False otherwie

Return type:

bool

Determine whether lossy framebuffer update encodings are permitted

get_name()
Returns:

the remote desktop name

Return type:

str

Get the name of the remote desktop. This is only valid after the “vnc-initialized” signal has been emitted

get_pixbuf()
Returns:

a GdkPixbuf.Pixbuf with the screenshot image buffer

Return type:

GdkPixbuf.Pixbuf

Take a screenshot of the display.

get_pointer_grab()
Returns:

True if the pointer will be grabbed, False otherwise

Return type:

bool

Determine if the mouse pointer will be grabbed on first click

get_pointer_local()
Returns:

True if a local pointer is shown, False otherwise

Return type:

bool

Determine if a local pointer will be shown

get_read_only()
Returns:

True if in read-only mode, False otherwise

Return type:

bool

Determine if the widget will operate in read-only mode, denying keyboard/mouse inputs

get_rotation()
Returns:

the rotation angle in clockwise direction

Return type:

int

Determine the current rotation angle of the remote desktop.

get_scaling()
Returns:

True if scaling is permitted, False otherwise

Return type:

bool

Determine whether the widget is permitted to scale the remote desktop to fit the current widget size.

get_shared_flag()
Returns:

True if sharing is permittted, False otherwise

Return type:

bool

Determine if other clients are permitted to share the VNC connection

get_smoothing()
Returns:

True if smoothing is enabled, False otherwise

Return type:

bool

Determine whether pixels are smoothly interpolated when scaling.

get_width()
Returns:

the remote desktop width

Return type:

int

Get the width of the remote desktop. This is only valid after the “vnc-initialized” signal has been emitted

get_zoom_level()
Returns:

the zoom percentage level between 10-400

Return type:

int

Determine the current constant scaling factor.

is_open()
Returns:

True if open, False if closing/closed

Return type:

bool

Check if the connection for the display is currently open

is_pointer_absolute()
Returns:

True if in absolute mode, False for relative mode

Return type:

bool

Determine if the pointer is operating in absolute mode. This is only valid after the “vnc-initialized” signal has been emitted

open_addr(addr, hostname)
Parameters:
Returns:

True if a connection was opened, False if already open

Return type:

bool

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:

True if a connection was opened, False if already open

Return type:

bool

Open a connection using fd as the transport. If fd refers to a TCP connection, it is recommended to use GtkVnc.Display.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:
  • fd (int) – file descriptor to use for the connection

  • hostname (str or None) – the host associated with the connection

Returns:

True if a connection was opened, False if already open

Return type:

bool

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:
  • host (str) – the host name or IP address

  • port (str) – the service name or port number

Returns:

True if a connection was opened, False if already open

Return type:

bool

Open a TCP connection to the remote desktop at host listening on port.

request_update()
Return type:

bool

send_keys(keyvals)
Parameters:

keyvals ([int]) – Keyval array

Send keyval click events to the display. Al the key press events will be sent first and then all the key release events.

keyvals should contain the X11 key value constants

send_keys_ex(keyvals, kind)
Parameters:

Sends key events to the remote server. keyvals should contain X11 key code values. These will be automatically converted to XT scancodes if needed

If kind is GtkVnc.DisplayKeyEvent.CLICK then all the key press events will be sent first, followed by all the key release events.

send_pointer(x, y, button_mask)
Parameters:
  • x (int) – the desired horizontal position

  • y (int) – the desired vertical position

  • button_mask (int) – the state of the buttons

Move the remote pointer to position (x, y) and set the button state to button_mask. This method will only work if the desktop is using absolute pointer mode. It will be a no-op if in relative pointer mode.

set_allow_resize(enable)
Parameters:

enable (bool) – True to allow the desktop resize, False otherwise

Set whether changes in the widget size will be translated into requests to resize the remote desktop. Resizing of the remote desktop is not guaranteed to be honoured by servers, but when it is, it will avoid the need to do scaling.

set_credential(type, data)
Parameters:
  • type (int) – the authentication credential type

  • data (str) – the value associated with the credential

Returns:

True if an error occurs, False otherwise

Return type:

bool

Sets the value of the authentication credential type to the string data.

type is one of the GVnc.ConnectionCredential enum vlaues

set_depth(depth)
Parameters:

depth (GtkVnc.DisplayDepthColor) – the desired colour depth

Set the desired colour depth. Higher quality colour depths will require greater network bandwidth. The colour depth must be set prior to connecting to the remote server

set_force_size(enable)
Parameters:

enable (bool) – True to force the widget size, False otherwise

Set whether the widget size will be forced to match the remote desktop size. If the widget size does not match the remote desktop size, and scaling is disabled, some of the remote desktop may be hidden, or black borders may be drawn.

set_grab_keys(seq)
Parameters:

seq (GtkVnc.GrabSequence) – the new grab sequence

Set the sequence of keys that must be pressed to activate keyborad and pointer grab

set_keep_aspect_ratio(enable)
Parameters:

enable (bool) – True to keep aspect ratio, False otherwise

Set whether the aspect ratio of the framebuffer is preserved when scaling.

set_keyboard_grab(enable)
Parameters:

enable (bool) – True to enable keyboard grab, False otherwise

Set whether the widget will grab the keyboard when it has focus. Grabbing the keyboard allows it to intercept special key sequences, ensuring they get sent to the remote desktop, rather than intepreted locally.

set_lossy_encoding(enable)
Parameters:

enable (bool) – True to permit lossy encodings, False otherwise

Set whether the client is willing to accept lossy framebuffer update encodings. Lossy encodings can improve performance by lowering network bandwidth requirements, with a cost that the display received by the client will not be pixel perfect

set_pointer_grab(enable)
Parameters:

enable (bool) – True to enable automatic pointer grab, False otherwise

Set whether the widget will automatically grab the mouse pointer upon a button click

set_pointer_local(enable)
Parameters:

enable (bool) – True to show a local cursor, False otherwise

If enable is True, then a local mouse cursor will be made visible. If enable is False, the local mouse cursor will be hidden.

set_read_only(enable)
Parameters:

enable (bool) – True to enable read-only mode, False otherwise

Set whether the widget is running in read-only mode. In read-only mode, keyboard and mouse events will not be sent to the remote desktop server. The widget will merely display activity from the server.

set_rotation(rotation)
Parameters:

rotation (int) – The angle of rotation, degrees clockwise.

Set the rotation angle to view the display of the remote desktop, in clockwise direction.

set_scaling(enable)
Parameters:

enable (bool) – True to allow scaling the desktop to fit, False otherwise

Returns:

True always

Return type:

bool

Set whether the remote desktop contents is automatically scaled to fit the available widget size, or whether it will be rendered at 1:1 size

set_shared_flag(shared)
Parameters:

shared (bool) – the new sharing state

Set the shared state for the connection. A True value allow allow this client to co-exist with other existing clients. A False value will cause other clients to be dropped

set_smoothing(enable)
Parameters:

enable (bool) – True to enable smooth scaling, False otherwise

Set whether pixels are smoothly interpolated when scaling, to avoid aliasing.

set_zoom_level(zoom)
Parameters:

zoom (int) – the zoom percentage level

Requests a constant scaling factor to be applied to the remote desktop. The zoom value is a percentage in the range 10-400.

If scaling mode is not active, then this results in the remote desktop always being rendered at the requested zoom level.

If scaling mode is active, then the remote desktop will be scaled to fit the widget regardless of the zoom level.

In both cases, when the remote desktop size changes, the widget preferred size will reflect the zoom level.

do_vnc_auth_credential(credList) virtual
Parameters:

credList (GObject.ValueArray) –

do_vnc_connected() virtual
do_vnc_disconnected() virtual
do_vnc_initialized() virtual

Signal Details

GtkVnc.Display.signals.vnc_auth_credential(display, object)
Signal Name:

vnc-auth-credential

Flags:

RUN_FIRST

Parameters:
GtkVnc.Display.signals.vnc_auth_failure(display, object)
Signal Name:

vnc-auth-failure

Flags:

RUN_LAST, NO_HOOKS

Parameters:
GtkVnc.Display.signals.vnc_auth_unsupported(display, object)
Signal Name:

vnc-auth-unsupported

Flags:

RUN_LAST, NO_HOOKS

Parameters:
GtkVnc.Display.signals.vnc_bell(display)
Signal Name:

vnc-bell

Flags:

RUN_LAST, NO_HOOKS

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_connected(display)
Signal Name:

vnc-connected

Flags:

RUN_FIRST

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_desktop_rename(display, object)
Signal Name:

vnc-desktop-rename

Flags:

RUN_LAST, NO_HOOKS

Parameters:
GtkVnc.Display.signals.vnc_desktop_resize(display, object, p0)
Signal Name:

vnc-desktop-resize

Flags:

RUN_LAST, NO_HOOKS

Parameters:
GtkVnc.Display.signals.vnc_disconnected(display)
Signal Name:

vnc-disconnected

Flags:

RUN_FIRST

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_error(display, object)
Signal Name:

vnc-error

Flags:

RUN_FIRST

Parameters:
GtkVnc.Display.signals.vnc_initialized(display)
Signal Name:

vnc-initialized

Flags:

RUN_FIRST

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_keyboard_grab(display)
Signal Name:

vnc-keyboard-grab

Flags:

RUN_LAST, NO_HOOKS

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_keyboard_ungrab(display)
Signal Name:

vnc-keyboard-ungrab

Flags:

RUN_LAST, NO_HOOKS

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_pointer_grab(display)
Signal Name:

vnc-pointer-grab

Flags:

RUN_LAST, NO_HOOKS

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_pointer_ungrab(display)
Signal Name:

vnc-pointer-ungrab

Flags:

RUN_LAST, NO_HOOKS

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_power_control_failed(display)
Signal Name:

vnc-power-control-failed

Flags:

RUN_LAST, NO_HOOKS

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_power_control_initialized(display)
Signal Name:

vnc-power-control-initialized

Flags:

RUN_LAST, NO_HOOKS

Parameters:

display (GtkVnc.Display) – The object which received the signal

GtkVnc.Display.signals.vnc_server_cut_text(display, object)
Signal Name:

vnc-server-cut-text

Flags:

RUN_LAST, NO_HOOKS

Parameters:

Property Details

GtkVnc.Display.props.allow_resize
Name:

allow-resize

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether we should resize the desktop to match widget size

GtkVnc.Display.props.connection
Name:

connection

Type:

GVnc.Connection

Default Value:

None

Flags:

READABLE

The VNC connection

GtkVnc.Display.props.depth
Name:

depth

Type:

GtkVnc.DisplayDepthColor

Default Value:

GtkVnc.DisplayDepthColor.DEFAULT

Flags:

READABLE, WRITABLE, CONSTRUCT

The color depth

GtkVnc.Display.props.force_size
Name:

force-size

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether we should define the widget size

GtkVnc.Display.props.grab_keyboard
Name:

grab-keyboard

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether we should grab the keyboard

GtkVnc.Display.props.grab_keys
Name:

grab-keys

Type:

GtkVnc.GrabSequence

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The key grab sequence

GtkVnc.Display.props.grab_pointer
Name:

grab-pointer

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether we should grab the pointer

GtkVnc.Display.props.height
Name:

height

Type:

int

Default Value:

0

Flags:

READABLE

The height of the remote screen

GtkVnc.Display.props.keep_aspect_ratio
Name:

keep-aspect-ratio

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Keep the aspect ratio matching the framebuffer when scaling

GtkVnc.Display.props.local_pointer
Name:

local-pointer

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether we should use the local pointer

GtkVnc.Display.props.lossy_encoding
Name:

lossy-encoding

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether we should use a lossy encoding

GtkVnc.Display.props.read_only
Name:

read-only

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether this connection is read-only mode

GtkVnc.Display.props.rotation
Name:

rotation

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT

Rotate the image of the remote desktop 90° clockwise

GtkVnc.Display.props.scaling
Name:

scaling

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether we should use scaling

GtkVnc.Display.props.shared_flag
Name:

shared-flag

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether we should leave other clients connected to the server

GtkVnc.Display.props.smoothing
Name:

smoothing

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether we should smoothly interpolate when scaling

GtkVnc.Display.props.width
Name:

width

Type:

int

Default Value:

0

Flags:

READABLE

The width of the remote screen

GtkVnc.Display.props.zoom_level
Name:

zoom-level

Type:

int

Default Value:

100

Flags:

READABLE, WRITABLE, CONSTRUCT

Zoom percentage level