![]() |
![]() |
![]() |
Spice-GTK Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <spice-client-gtk.h> enum SpiceDisplayKeyEvent; SpiceDisplay * spice_display_new (SpiceSession *session
,int channel_id
); SpiceDisplay * spice_display_new_with_monitor (SpiceSession *session
,gint channel_id
,gint monitor_id
); void spice_display_mouse_ungrab (SpiceDisplay *display
); void spice_display_set_grab_keys (SpiceDisplay *display
,SpiceGrabSequence *seq
); SpiceGrabSequence * spice_display_get_grab_keys (SpiceDisplay *display
); void spice_display_send_keys (SpiceDisplay *display
,const guint *keyvals
,int nkeyvals
,SpiceDisplayKeyEvent kind
); GdkPixbuf * spice_display_get_pixbuf (SpiceDisplay *display
); SpiceGrabSequence; SpiceGrabSequence * spice_grab_sequence_new (guint nkeysyms
,guint *keysyms
); SpiceGrabSequence * spice_grab_sequence_new_from_string (const gchar *str
); SpiceGrabSequence * spice_grab_sequence_copy (SpiceGrabSequence *sequence
); void spice_grab_sequence_free (SpiceGrabSequence *sequence
); gchar * spice_grab_sequence_as_string (SpiceGrabSequence *sequence
);
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_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).
typedef enum { SPICE_DISPLAY_KEY_EVENT_PRESS = 1, SPICE_DISPLAY_KEY_EVENT_RELEASE = 2, SPICE_DISPLAY_KEY_EVENT_CLICK = 3, } SpiceDisplayKeyEvent;
Constants for key events.
SpiceDisplay * spice_display_new (SpiceSession *session
,int channel_id
);
Creates a new SpiceDisplay widget.
|
a SpiceSession |
|
the display channel ID to associate with SpiceDisplay |
Returns : |
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.
|
a SpiceSession |
|
the display channel ID to associate with SpiceDisplay |
|
the monitor id within the display channel |
Returns : |
a new SpiceDisplay widget. |
Since 0.13
void spice_display_mouse_ungrab (SpiceDisplay *display
);
Ungrab the mouse.
|
a SpiceDisplay |
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".
|
the display widget |
|
key sequence. [transfer none] |
SpiceGrabSequence * spice_display_get_grab_keys (SpiceDisplay *display
);
Finds the current grab key combination for the display
.
|
the display widget |
Returns : |
the current grab key combination. [transfer none] |
void spice_display_send_keys (SpiceDisplay *display
,const guint *keyvals
,int nkeyvals
,SpiceDisplayKeyEvent kind
);
Send keyval press/release events to the display.
|
The SpiceDisplay |
|
Keyval array. [array length=nkeyvals] |
|
Length of keyvals |
|
SpiceDisplayKeyEvent action |
GdkPixbuf * spice_display_get_pixbuf (SpiceDisplay *display
);
Take a screenshot of the display.
|
a SpiceDisplay |
Returns : |
a GdkPixbuf with the screenshot image buffer. [transfer full] |
typedef struct { } SpiceGrabSequence;
An opaque type that represents a grab sequence.
SpiceGrabSequence * spice_grab_sequence_new (guint nkeysyms
,guint *keysyms
);
Creates a new grab sequence from a list of keysym values
|
length of keysyms
|
|
the keysym values. [array length=nkeysyms] |
Returns : |
a new grab sequence object. [transfer full] |
SpiceGrabSequence * spice_grab_sequence_new_from_string (const gchar *str
);
Creates a new SpiceGrabSequence from the string representation.
|
a string of '+' separated key names (ex: "Control_L+Alt_L") |
Returns : |
a new SpiceGrabSequence. |
SpiceGrabSequence * spice_grab_sequence_copy (SpiceGrabSequence *sequence
);
Creates a copy of the sequence
.
|
sequence to copy |
Returns : |
a copy of sequence . [transfer full]
|
void spice_grab_sequence_free (SpiceGrabSequence *sequence
);
Free sequence
.
|
a SpiceGrabSequence |
gchar * spice_grab_sequence_as_string (SpiceGrabSequence *sequence
);
Creates a string representing the sequence
.
|
a SpiceGrabSequence |
Returns : |
a newly allocated string representing the key sequence. [transfer full] |