Top | ![]() |
![]() |
![]() |
![]() |
SpiceDisplay * | spice_display_new () |
SpiceDisplay * | spice_display_new_with_monitor () |
void | spice_display_keyboard_ungrab () |
void | spice_display_mouse_ungrab () |
void | spice_display_set_grab_keys () |
SpiceGrabSequence * | spice_display_get_grab_keys () |
void | spice_display_send_keys () |
GdkPixbuf * | spice_display_get_pixbuf () |
SpiceGrabSequence * | spice_grab_sequence_new () |
SpiceGrabSequence * | spice_grab_sequence_new_from_string () |
SpiceGrabSequence * | spice_grab_sequence_copy () |
void | spice_grab_sequence_free () |
gchar * | spice_grab_sequence_as_string () |
int | channel-id | Read / Write / Construct Only |
gboolean | disable-inputs | Read / Write / Construct |
gboolean | grab-keyboard | Read / Write / Construct |
gboolean | grab-mouse | Read / Write / Construct |
guint | keypress-delay | Read / Write / Construct |
int | monitor-id | Read / Write / Construct |
gboolean | only-downscale | Read / Write / Construct |
gboolean | ready | Read |
gboolean | resize-guest | Read / Write / Construct |
gboolean | scaling | Read / Write / Construct |
SpiceSession * | session | Read / Write / Construct Only |
int | zoom-level | Read / Write / Construct |
GBoxed ╰── SpiceGrabSequence GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkEventBox ╰── SpiceDisplay
A GTK widget that displays a SPICE server. It sends keyboard/mouse events and can also share clipboard...
Arbitrary key events can be sent thanks to spice_display_send_keys()
.
The widget will optionally grab the keyboard and the mouse when
focused if the properties “grab-keyboard” and
“grab-mouse” are TRUE respectively. It can be
ungrabbed with spice_display_keyboard_ungrab()
and
spice_display_mouse_ungrab()
, and by setting a key
combination with spice_display_set_grab_keys()
.
Finally, spice_display_get_pixbuf()
will take a screenshot of the
current display and return an GdkPixbuf (that you can then easily
save to disk).
SpiceDisplay * spice_display_new (SpiceSession *session
,int channel_id
);
Creates a new SpiceDisplay widget.
SpiceDisplay * spice_display_new_with_monitor (SpiceSession *session
,gint channel_id
,gint monitor_id
);
Creates a new SpiceDisplay widget associated with the monitor id.
session |
||
channel_id |
the display channel ID to associate with SpiceDisplay |
|
monitor_id |
the monitor id within the display channel |
Since: 0.13
void
spice_display_keyboard_ungrab (SpiceDisplay *display
);
Ungrab the keyboard.
Since: 0.40
void
spice_display_mouse_ungrab (SpiceDisplay *display
);
Ungrab the mouse.
void spice_display_set_grab_keys (SpiceDisplay *display
,SpiceGrabSequence *seq
);
Set the key combination to grab/ungrab the keyboard. The default is "Control L + Alt L".
SpiceGrabSequence *
spice_display_get_grab_keys (SpiceDisplay *display
);
Finds the current grab key combination for the display
.
void spice_display_send_keys (SpiceDisplay *display
,const guint *keyvals
,int nkeyvals
,SpiceDisplayKeyEvent kind
);
Send keyval press/release events to the display.
display |
The SpiceDisplay |
|
keyvals |
Keyval array. |
[array length=nkeyvals] |
nkeyvals |
Length of keyvals |
|
kind |
SpiceDisplayKeyEvent action |
GdkPixbuf *
spice_display_get_pixbuf (SpiceDisplay *display
);
Take a screenshot of the display.
SpiceGrabSequence * spice_grab_sequence_new (guint nkeysyms
,guint *keysyms
);
Creates a new grab sequence from a list of keysym values
SpiceGrabSequence *
spice_grab_sequence_new_from_string (const gchar *str
);
Creates a new SpiceGrabSequence from the string representation.
SpiceGrabSequence *
spice_grab_sequence_copy (SpiceGrabSequence *sequence
);
Creates a copy of the sequence
.
void
spice_grab_sequence_free (SpiceGrabSequence *sequence
);
Free sequence
.
gchar *
spice_grab_sequence_as_string (SpiceGrabSequence *sequence
);
Creates a string representing the sequence
.
typedef struct _SpiceDisplay SpiceDisplay;
The SpiceDisplay struct is opaque and should not be accessed directly.
typedef struct _SpiceDisplayClass SpiceDisplayClass;
Class structure for SpiceDisplay. It is opaque and should not be accessed directly.
“channel-id”
property “channel-id” int
channel-id for this SpiceDisplay
Owner: SpiceDisplay
Flags: Read / Write / Construct Only
Allowed values: [0,255]
Default value: 0
“disable-inputs”
property “disable-inputs” gboolean
Disable all keyboard & mouse inputs.
Owner: SpiceDisplay
Flags: Read / Write / Construct
Default value: FALSE
Since: 0.8
“grab-keyboard”
property “grab-keyboard” gboolean
Whether we should grab the keyboard.
Owner: SpiceDisplay
Flags: Read / Write / Construct
Default value: TRUE
“grab-mouse”
property “grab-mouse” gboolean
Whether we should grab the mouse.
Owner: SpiceDisplay
Flags: Read / Write / Construct
Default value: TRUE
“keypress-delay”
property “keypress-delay” guint
Delay in ms of non-modifiers key press events. If the key is released before this delay, a single press & release event is sent to the server. If the key is pressed longer than the keypress-delay, the server will receive the delayed press event, and a following release event when the key is released.
Owner: SpiceDisplay
Flags: Read / Write / Construct
Default value: 100
Since: 0.13
“monitor-id”
property “monitor-id” int
Select monitor from SpiceDisplay to show. The value -1 means the whole display is shown. By default, the monitor 0 is selected.
Owner: SpiceDisplay
Flags: Read / Write / Construct
Allowed values: >= -1
Default value: 0
Since: 0.13
“only-downscale”
property “only-downscale” gboolean
If scaling, only scale down, never up.
Owner: SpiceDisplay
Flags: Read / Write / Construct
Default value: FALSE
Since: 0.14
“ready”
property “ready” gboolean
Indicate whether the display is ready to be shown. It takes into account several conditions, such as the channel display "mark" state, whether the monitor area is visible..
Owner: SpiceDisplay
Flags: Read
Default value: FALSE
Since: 0.13
“resize-guest”
property “resize-guest” gboolean
Try to adapt guest display on window resize. Requires guest cooperation.
Owner: SpiceDisplay
Flags: Read / Write / Construct
Default value: FALSE
“scaling”
property “scaling” gboolean
Whether we should use scaling.
Owner: SpiceDisplay
Flags: Read / Write / Construct
Default value: TRUE
“session”
property“session” SpiceSession *
SpiceSession for this SpiceDisplay
Owner: SpiceDisplay
Flags: Read / Write / Construct Only
“zoom-level”
property “zoom-level” int
Zoom level in percentage, from 10 to 400. Default to 100. (this option is only supported with cairo backend when scaling is enabled)
Owner: SpiceDisplay
Flags: Read / Write / Construct
Allowed values: [10,400]
Default value: 100
Since: 0.10
“grab-keys-pressed”
signalvoid user_function (SpiceDisplay *display, gpointer user_data)
Notify when the grab keys have been pressed
display |
the SpiceDisplay that emitted the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“keyboard-grab”
signalvoid user_function (SpiceDisplay *display, int status, gpointer user_data)
Notify when the keyboard grab is active or not.
display |
the SpiceDisplay that emitted the signal |
|
status |
1 if grabbed, 0 otherwise. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“mouse-grab”
signalvoid user_function (SpiceDisplay *display, int status, gpointer user_data)
Notify when the mouse grab is active or not.
display |
the SpiceDisplay that emitted the signal |
|
status |
1 if grabbed, 0 otherwise. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First