Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- SpiceClientGLib.client_error_quark()¶
- Returns:
the #GQuark representing the string.
- Return type:
Gets a #GQuark representing the string “spice-client-error-quark”
- SpiceClientGLib.display_get_gl_scanout(channel)¶
- Parameters:
channel (
SpiceClientGLib.DisplayChannel
) – aSpiceClientGLib.DisplayChannel
- Returns:
the current GL scanout, or
None
if none or not valid- Return type:
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_gl_draw_done(channel)¶
- Parameters:
channel (
SpiceClientGLib.DisplayChannel
) – aSpiceClientGLib.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 toSpiceClientGLib.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 callSpiceClientGLib.set_session_option
() after to set the options on aSpiceClientGLib.Session
.- Return type:
Gets commandline options.
Bindings for other languages are available since 0.32
- SpiceClientGLib.inputs_button_press(channel, button, button_state)¶
- Parameters:
channel (
SpiceClientGLib.InputsChannel
) – aSpiceClientGLib.InputsChannel
button (
int
) – a SPICE_MOUSE_BUTTONbutton_state (
int
) – SPICE_MOUSE_BUTTON_MASK flags
Press a mouse button.
Deprecated since version 0.35: use
SpiceClientGLib.InputsChannel.button_press
() instead.
- SpiceClientGLib.inputs_button_release(channel, button, button_state)¶
- Parameters:
channel (
SpiceClientGLib.InputsChannel
) – aSpiceClientGLib.InputsChannel
button (
int
) – a SPICE_MOUSE_BUTTONbutton_state (
int
) – SPICE_MOUSE_BUTTON_MASK flags
Release a button.
Deprecated since version 0.35: use
SpiceClientGLib.InputsChannel.button_release
() instead.
- SpiceClientGLib.inputs_key_press(channel, scancode)¶
- Parameters:
channel (
SpiceClientGLib.InputsChannel
) – aSpiceClientGLib.InputsChannel
scancode (
int
) – a PC XT (set 1) key scancode. For scancodes with an \%0xe0 prefix, drop the prefix and OR the scancode with \%0x100.
Press a key.
Deprecated since version 0.35: use
SpiceClientGLib.InputsChannel.key_press
() instead.
- SpiceClientGLib.inputs_key_press_and_release(channel, scancode)¶
- Parameters:
channel (
SpiceClientGLib.InputsChannel
) – aSpiceClientGLib.InputsChannel
scancode (
int
) – a PC XT (set 1) key scancode. For scancodes with an \%0xe0 prefix, drop the prefix and OR the scancode with \%0x100.
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:
channel (
SpiceClientGLib.InputsChannel
) – aSpiceClientGLib.InputsChannel
scancode (
int
) – a PC XT (set 1) key scancode. For scancodes with an \%0xe0 prefix, drop the prefix and OR the scancode with \%0x100.
Release a key.
Deprecated since version 0.35: use
SpiceClientGLib.InputsChannel.key_release
() instead.
- SpiceClientGLib.inputs_motion(channel, dx, dy, button_state)¶
- Parameters:
channel (
SpiceClientGLib.InputsChannel
) – aSpiceClientGLib.InputsChannel
dx (
int
) – delta X mouse coordinatesdy (
int
) – delta Y mouse coordinatesbutton_state (
int
) – SPICE_MOUSE_BUTTON_MASK flags
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:
channel (
SpiceClientGLib.InputsChannel
) – aSpiceClientGLib.InputsChannel
x (
int
) – X mouse coordinatesy (
int
) – Y mouse coordinatesdisplay (
int
) – display channel idbutton_state (
int
) – SPICE_MOUSE_BUTTON_MASK flags
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:
channel (
SpiceClientGLib.InputsChannel
) – aSpiceClientGLib.InputsChannel
locks (
int
) –SpiceClientGLib.InputsLock
modifiers flags
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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
cap (
int
) – an agent capability identifier
- Returns:
True
if cap (channel kind capability) is available.- Return type:
Test capability of a remote agent.
Deprecated since version 0.35: use
SpiceClientGLib.MainChannel.agent_test_capability
() instead.
- SpiceClientGLib.main_clipboard_grab(channel, types)¶
- Parameters:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
types ([
int
]) – an array of #VD_AGENT_CLIPBOARD types available in the clipboard
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)¶
- Parameters:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
type (
int
) – a #VD_AGENT_CLIPBOARD typedata (
bytes
) – clipboard data
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
) – aSpiceClientGLib.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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
type (
int
) – a #VD_AGENT_CLIPBOARD type
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)¶
- Parameters:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
selection (
int
) – one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_*types ([
int
]) – an array of #VD_AGENT_CLIPBOARD types available in the clipboard
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)¶
- Parameters:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
selection (
int
) – one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_*type (
int
) – a #VD_AGENT_CLIPBOARD typedata (
bytes
) – clipboard data
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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
selection (
int
) – one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_*
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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
selection (
int
) – one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_*type (
int
) – a #VD_AGENT_CLIPBOARD type
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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
sources ([
Gio.File
]) – aNone
-terminated array ofGio.File
objects to be transferredflags (
Gio.FileCopyFlags
) – set ofGio.FileCopyFlags
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignoreprogress_callback (
Gio.FileProgressCallback
orNone
) – function to callback with progress information, orNone
if progress information is not neededprogress_callback_data (
object
orNone
) – user data to pass to progress_callbackcallback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
result (
Gio.AsyncResult
) – aGio.AsyncResult
.
- Raises:
- Returns:
- Return type:
Finishes copying the file started with
SpiceClientGLib.main_file_copy_async
().
- SpiceClientGLib.main_request_mouse_mode(channel, mode)¶
- Parameters:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
mode (
int
) – a SPICE_MOUSE_MODE
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
) – aSpiceClientGLib.MainChannel
- Returns:
True
on success.- Return type:
Send monitors configuration previously set with
SpiceClientGLib.main_set_display
() andSpiceClientGLib.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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
id (
int
) – display IDx (
int
) – x positiony (
int
) – y positionwidth (
int
) – display widthheight (
int
) – display height
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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
id (
int
) – display ID (if -1: set all displays)enabled (
bool
) – wether display id is enabled
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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
id (
int
) – display IDx (
int
) – x positiony (
int
) – y positionwidth (
int
) – display widthheight (
int
) – display heightupdate (
bool
) – ifTrue
, update guest resolution after 1sec.
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 withSpiceClientGLib.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:
channel (
SpiceClientGLib.MainChannel
) – aSpiceClientGLib.MainChannel
id (
int
) – display ID (if -1: set all displays)enabled (
bool
) – wether display id is enabledupdate (
bool
) – ifTrue
, update guest display state after 1sec.
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 isTrue
, 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:
port (
SpiceClientGLib.PortChannel
) – aSpiceClientGLib.PortChannel
event (
int
) – a SPICE_PORT_EVENT value
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:
port (
SpiceClientGLib.PortChannel
) – ASpiceClientGLib.PortChannel
buffer (
bytes
) – the buffer containing the data to writecancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignorecallback (
Gio.AsyncReadyCallback
orNone
) – callback to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
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:
port (
SpiceClientGLib.PortChannel
) – aSpiceClientGLib.PortChannel
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
a #gssize containing the number of bytes written to the stream.
- Return type:
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:
channel (
SpiceClientGLib.RecordChannel
) – aSpiceClientGLib.RecordChannel
bytes (
int
) – size of datatime (
int
) – stream timestamp
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
) – aSpiceClientGLib.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_version_string()¶
- Returns:
Spice-GTK version as a const string.
- Return type:
Gets the version string
- SpiceClientGLib.util_set_debug(enabled)¶
-
Enable or disable Spice-GTK debugging messages.