Functions

  client_error_quark ()
  display_change_preferred_compression (channel, compression)
  display_change_preferred_video_codec_type (channel, codec_type)
  display_get_gl_scanout (channel)
  display_get_primary (channel, surface_id, primary)
  display_gl_draw_done (channel)
  get_option_group ()
  inputs_button_press (channel, button, button_state)
  inputs_button_release (channel, button, button_state)
  inputs_key_press (channel, scancode)
  inputs_key_press_and_release (channel, scancode)
  inputs_key_release (channel, scancode)
  inputs_motion (channel, dx, dy, button_state)
  inputs_position (channel, x, y, display, button_state)
  inputs_set_key_locks (channel, locks)
  main_agent_test_capability (channel, cap)
  main_clipboard_grab (channel, types, ntypes)
  main_clipboard_notify (channel, type, data, size)
  main_clipboard_release (channel)
  main_clipboard_request (channel, type)
  main_clipboard_selection_grab (channel, selection, types, ntypes)
  main_clipboard_selection_notify (channel, selection, type, data, size)
  main_clipboard_selection_release (channel, selection)
  main_clipboard_selection_request (channel, selection, type)
  main_file_copy_async (channel, sources, flags, cancellable, progress_callback, progress_callback_data, callback, *user_data)
  main_file_copy_finish (channel, result)
  main_request_mouse_mode (channel, mode)
  main_send_monitor_config (channel)
  main_set_display (channel, id, x, y, width, height)
  main_set_display_enabled (channel, id, enabled)
  main_update_display (channel, id, x, y, width, height, update)
  main_update_display_enabled (channel, id, enabled, update)
  port_event (port, event)
  port_write_async (port, buffer, cancellable, callback, *user_data)
  port_write_finish (port, result)
  record_send_data (channel, data, bytes, time)
  set_session_option (session)
  util_get_debug ()
  util_get_version_string ()
  util_set_debug (enabled)
  uuid_to_string (uuid)

Details

SpiceClientGLib.client_error_quark()
Returns:the #GQuark representing the string.
Return type:int

Gets a #GQuark representing the string “spice-client-error-quark”

SpiceClientGLib.display_change_preferred_compression(channel, compression)
Parameters:

Tells the spice server to change the preferred image compression for the channel.

New in version 0.31.

Deprecated since version 0.35: use SpiceClientGLib.DisplayChannel.change_preferred_compression() instead.

SpiceClientGLib.display_change_preferred_video_codec_type(channel, codec_type)
Parameters:

Tells the spice server to change the preferred video codec type for streaming in channel. Application can set only one preferred video codec per display channel.

New in version 0.34.

Deprecated since version 0.35: use SpiceClientGLib.DisplayChannel.change_preferred_video_codec_type() instead.

SpiceClientGLib.display_get_gl_scanout(channel)
Parameters:channel (SpiceClientGLib.DisplayChannel) – a SpiceClientGLib.DisplayChannel
Returns:the current GL scanout, or None if none or not valid
Return type:SpiceClientGLib.GlScanout

Retrieves the GL scanout if available

New in version 0.31.

Deprecated since version 0.35: use SpiceClientGLib.DisplayChannel.get_gl_scanout() instead.

SpiceClientGLib.display_get_primary(channel, surface_id, primary)
Parameters:
Returns:

True if the primary surface was found and its details collected in primary.

Return type:

bool

Retrieve primary display surface surface_id.

Deprecated since version 0.35: use SpiceClientGLib.DisplayChannel.get_primary() instead.

SpiceClientGLib.display_gl_draw_done(channel)
Parameters:channel (SpiceClientGLib.DisplayChannel) – a SpiceClientGLib.DisplayChannel

After a SpiceClientGLib.DisplayChannel ::gl-draw is emitted, the client should draw the current display with the current GL scanout, and must release the GL resource with a call to SpiceClientGLib.display_gl_draw_done() (failing to do so for each gl-draw may result in a frozen display).

New in version 0.31.

Deprecated since version 0.35: use SpiceClientGLib.DisplayChannel.gl_draw_done() instead.

SpiceClientGLib.get_option_group()
Returns:a GLib.OptionGroup for the commandline arguments specific to Spice. You have to call SpiceClientGLib.set_session_option() after to set the options on a SpiceClientGLib.Session.
Return type:GLib.OptionGroup

Gets commandline options.

Bindings for other languages are available since 0.32

SpiceClientGLib.inputs_button_press(channel, button, button_state)
Parameters:

Press a mouse button.

Deprecated since version 0.35: use SpiceClientGLib.InputsChannel.button_press() instead.

SpiceClientGLib.inputs_button_release(channel, button, button_state)
Parameters:

Release a button.

Deprecated since version 0.35: use SpiceClientGLib.InputsChannel.button_release() instead.

SpiceClientGLib.inputs_key_press(channel, scancode)
Parameters:

Press a key.

Deprecated since version 0.35: use SpiceClientGLib.InputsChannel.key_press() instead.

SpiceClientGLib.inputs_key_press_and_release(channel, scancode)
Parameters:

Press and release a key event atomically (in the same message).

New in version 0.13.

Deprecated since version 0.35.

SpiceClientGLib.inputs_key_release(channel, scancode)
Parameters:

Release a key.

Deprecated since version 0.35: use SpiceClientGLib.InputsChannel.key_release() instead.

SpiceClientGLib.inputs_motion(channel, dx, dy, button_state)
Parameters:

Change mouse position (used in SPICE_MOUSE_MODE_SERVER).

Deprecated since version 0.35: use SpiceClientGLib.InputsChannel.motion() instead.

SpiceClientGLib.inputs_position(channel, x, y, display, button_state)
Parameters:

Change mouse position (used in SPICE_MOUSE_MODE_CLIENT).

Deprecated since version 0.35: use SpiceClientGLib.InputsChannel.position() instead.

SpiceClientGLib.inputs_set_key_locks(channel, locks)
Parameters:

Set the keyboard locks on the guest (Caps, Num, Scroll..)

Deprecated since version 0.35: use SpiceClientGLib.InputsChannel.set_key_locks() instead.

SpiceClientGLib.main_agent_test_capability(channel, cap)
Parameters:
Returns:

True if cap (channel kind capability) is available.

Return type:

bool

Test capability of a remote agent.

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.agent_test_capability() instead.

SpiceClientGLib.main_clipboard_grab(channel, types, ntypes)
Parameters:

Grab the guest clipboard, with #VD_AGENT_CLIPBOARD types.

Deprecated since version 0.6: use SpiceClientGLib.MainChannel.clipboard_selection_grab() instead.

SpiceClientGLib.main_clipboard_notify(channel, type, data, size)
Parameters:

Send the clipboard data to the guest.

Deprecated since version 0.6: use SpiceClientGLib.MainChannel.clipboard_selection_notify() instead.

SpiceClientGLib.main_clipboard_release(channel)
Parameters:channel (SpiceClientGLib.MainChannel) – a SpiceClientGLib.MainChannel

Release the clipboard (for example, when the client loses the clipboard grab): Inform the guest no clipboard data is available.

Deprecated since version 0.6: use SpiceClientGLib.MainChannel.clipboard_selection_release() instead.

SpiceClientGLib.main_clipboard_request(channel, type)
Parameters:

Request clipboard data of type from the guest. The reply is sent through the SpiceClientGLib.MainChannel ::main-clipboard signal.

Deprecated since version 0.6: use SpiceClientGLib.MainChannel.clipboard_selection_request() instead.

SpiceClientGLib.main_clipboard_selection_grab(channel, selection, types, ntypes)
Parameters:

Grab the guest clipboard, with #VD_AGENT_CLIPBOARD types.

New in version 0.6.

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.clipboard_selection_grab() instead.

SpiceClientGLib.main_clipboard_selection_notify(channel, selection, type, data, size)
Parameters:

Send the clipboard data to the guest.

New in version 0.6.

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.clipboard_selection_notify() instead.

SpiceClientGLib.main_clipboard_selection_release(channel, selection)
Parameters:

Release the clipboard (for example, when the client loses the clipboard grab): Inform the guest no clipboard data is available.

New in version 0.6.

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.clipboard_selection_release() instead.

SpiceClientGLib.main_clipboard_selection_request(channel, selection, type)
Parameters:

Request clipboard data of type from the guest. The reply is sent through the SpiceClientGLib.MainChannel ::main-clipboard-selection signal.

New in version 0.6.

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.clipboard_selection_request() instead.

SpiceClientGLib.main_file_copy_async(channel, sources, flags, cancellable, progress_callback, progress_callback_data, callback, *user_data)
Parameters:

See: SpiceClientGLib.MainChannel.file_copy_async()

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.file_copy_async() instead.

SpiceClientGLib.main_file_copy_finish(channel, result)
Parameters:
Raises:

GLib.Error

Returns:

a True on success, False on error.

Return type:

bool

Finishes copying the file started with SpiceClientGLib.main_file_copy_async().

SpiceClientGLib.main_request_mouse_mode(channel, mode)
Parameters:

Request a mouse mode to the server. The server may not be able to change the mouse mode, but spice-gtk will try to request it when possible.

New in version 0.32.

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.request_mouse_mode() instead.

SpiceClientGLib.main_send_monitor_config(channel)
Parameters:channel (SpiceClientGLib.MainChannel) – a SpiceClientGLib.MainChannel
Returns:True on success.
Return type:bool

Send monitors configuration previously set with SpiceClientGLib.main_set_display() and SpiceClientGLib.main_set_display_enabled()

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.send_monitor_config() instead.

SpiceClientGLib.main_set_display(channel, id, x, y, width, height)
Parameters:

Notify the guest of screen resolution change. The notification is sent 1 second later, if no further changes happen.

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.update_display() instead.

SpiceClientGLib.main_set_display_enabled(channel, id, enabled)
Parameters:

When sending monitor configuration to agent guest, don’t set display id, which the agent translates to disabling the display id. Note: this will take effect next time the monitor configuration is sent.

New in version 0.6.

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.update_display_enabled() instead.

SpiceClientGLib.main_update_display(channel, id, x, y, width, height, update)
Parameters:

Update the display id resolution.

If update is True, the remote configuration will be updated too after 1 second without further changes. You can send when you want without delay the new configuration to the remote with SpiceClientGLib.main_send_monitor_config()

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.update_display() instead.

SpiceClientGLib.main_update_display_enabled(channel, id, enabled, update)
Parameters:

When sending monitor configuration to agent guest, if enabled is False, don’t set display id, which the agent translates to disabling the display id. If enabled is True, the monitor will be included in the next monitor update. Note: this will take effect next time the monitor configuration is sent.

If update is False, no server update will be triggered by this call, but the value will be saved and used in the next configuration update.

New in version 0.30.

Deprecated since version 0.35: use SpiceClientGLib.MainChannel.update_display_enabled() instead.

SpiceClientGLib.port_event(port, event)
Parameters:

Send an event to the port.

Note: The values SPICE_PORT_EVENT_CLOSED and SPICE_PORT_EVENT_OPENED are managed by the channel connection state.

New in version 0.15.

Deprecated since version 0.35: use SpiceClientGLib.PortChannel.event() instead.

SpiceClientGLib.port_write_async(port, buffer, cancellable, callback, *user_data)
Parameters:

Request an asynchronous write of count bytes from buffer into the port. When the operation is finished callback will be called. You can then call SpiceClientGLib.port_write_finish() to get the result of the operation.

New in version 0.15.

Deprecated since version 0.35: use SpiceClientGLib.PortChannel.write_async() instead.

SpiceClientGLib.port_write_finish(port, result)
Parameters:
Raises:

GLib.Error

Returns:

a #gssize containing the number of bytes written to the stream.

Return type:

int

Finishes a port write operation.

New in version 0.15.

Deprecated since version 0.35: use SpiceClientGLib.PortChannel.write_finish() instead.

SpiceClientGLib.record_send_data(channel, data, bytes, time)
Parameters:

Send recorded PCM data to the guest.

Deprecated since version 0.35: use SpiceClientGLib.RecordChannel.send_data() instead.

SpiceClientGLib.set_session_option(session)
Parameters:session (SpiceClientGLib.Session) – a SpiceClientGLib.Session to set option upon

Set various properties on session, according to the commandline arguments given to SpiceClientGLib.get_option_group() option group.

SpiceClientGLib.util_get_debug()
Return type:bool
SpiceClientGLib.util_get_version_string()
Returns:Spice-GTK version as a const string.
Return type:str

Gets the version string

SpiceClientGLib.util_set_debug(enabled)
Parameters:enabled (bool) – True or False

Enable or disable Spice-GTK debugging messages.

SpiceClientGLib.uuid_to_string(uuid)
Parameters:uuid (int) – UUID byte array
Returns:A string that should be freed with GLib.free().
Return type:str

Creates a string representation of uuid, of the form “06e023d5-86d8-420e-8103-383e4566087a”

New in version 0.22.