![]() |
![]() |
![]() |
Spice-GTK Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <spice-client.h> struct SpiceDisplayChannel; struct SpiceDisplayChannelClass; struct SpiceDisplayMonitorConfig; struct SpiceDisplayPrimary; struct SpiceGlScanout; const SpiceGlScanout * spice_display_get_gl_scanout (SpiceDisplayChannel *channel
); void spice_display_gl_draw_done (SpiceDisplayChannel *channel
); gboolean spice_display_get_primary (SpiceChannel *channel
,guint32 surface_id
,SpiceDisplayPrimary *primary
); void spice_display_change_preferred_compression (SpiceChannel *channel
,gint compression
); void spice_gl_scanout_free (SpiceGlScanout *scanout
);
"gl-scanout" SpiceGlScanout* : Read "height" guint : Read "monitors" GArray* : Read "monitors-max" guint : Read "width" guint : Read
"display-invalidate" :Run First
"display-mark" :Run First
"display-primary-create" :Run First
"display-primary-destroy" :Run First
"gl-draw"
A class that handles the rendering of the remote display and inform of its updates.
The creation of the main graphic buffer is signaled with "display-primary-create".
The update of regions is notified by "display-invalidate" signals.
struct SpiceDisplayChannel;
The SpiceDisplayChannel struct is opaque and should not be accessed directly.
struct SpiceDisplayChannelClass { SpiceChannelClass parent_class; /* signals */ void (*display_primary_create)(SpiceChannel *channel, gint format, gint width, gint height, gint stride, gint shmid, gpointer data); void (*display_primary_destroy)(SpiceChannel *channel); void (*display_invalidate)(SpiceChannel *channel, gint x, gint y, gint w, gint h); void (*display_mark)(SpiceChannel *channel, gboolean mark); };
Class structure for SpiceDisplayChannel.
SpiceChannelClass |
Parent class. |
Signal class handler for the "display-primary-create" signal. | |
Signal class handler for the "display-primary-destroy" signal. | |
Signal class handler for the "display-invalidate" signal. | |
Signal class handler for the "display-mark" signal. |
struct SpiceDisplayMonitorConfig { guint id; guint surface_id; guint x; guint y; guint width; guint height; };
Holds a monitor configuration.
struct SpiceDisplayPrimary { enum SpiceSurfaceFmt format; gint width; gint height; gint stride; gint shmid; guint8 *data; gboolean marked; };
Holds the information necessary to use the primary surface.
primary buffer format | |
width of the primary | |
height of the primary | |
stride of the primary | |
identifier of the shared memory segment associated with
the data , or -1 if not shm |
|
pointer to primary buffer | |
whether the display is marked ready |
struct SpiceGlScanout { gint fd; guint32 width; guint32 height; guint32 stride; guint32 format; gboolean y0top; };
Holds the information necessary for using the GL display scanout.
const SpiceGlScanout * spice_display_get_gl_scanout (SpiceDisplayChannel *channel
);
Retrieves the GL scanout if available
|
a SpiceDisplayChannel |
Returns : |
the current GL scanout, or NULL if none or not valid |
Since 0.31
void spice_display_gl_draw_done (SpiceDisplayChannel *channel
);
After a SpiceDisplayChannel::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 spice_display_gl_draw_done()
(failing to do so for each gl-draw may result in a frozen display).
|
a SpiceDisplayChannel |
Since 0.31
gboolean spice_display_get_primary (SpiceChannel *channel
,guint32 surface_id
,SpiceDisplayPrimary *primary
);
Retrieve primary display surface surface_id
.
|
a SpiceDisplayChannel |
|
a surface id |
|
a SpiceDisplayPrimary |
Returns : |
TRUE if the primary surface was found and its details
collected in primary . |
void spice_display_change_preferred_compression (SpiceChannel *channel
,gint compression
);
Tells the spice server to change the preferred image compression
for the channel
.
|
a SpiceDisplayChannel |
|
a SpiceImageCompression |
Since 0.31
"gl-scanout"
property"gl-scanout" SpiceGlScanout* : Read
The last SpiceGlScanout received.
Since 0.31
"monitors-max"
property "monitors-max" guint : Read
The maximum number of monitors the server or guest supports. May change during client lifetime, for instance guest may reboot or dynamically adjust this.
Allowed values: [1,256]
Default value: 1
Since 0.13
"display-invalidate"
signalvoid user_function (SpiceDisplayChannel *display,
gint x,
gint y,
gint width,
gint height,
gpointer user_data) : Run First
The "display-invalidate" signal is emitted when the rectangular region x/y/w/h of the primary buffer is updated.
|
the SpiceDisplayChannel that emitted the signal |
|
x position |
|
y position |
|
width |
|
height |
|
user data set when the signal handler was connected. |
"display-mark"
signalvoid user_function (SpiceDisplayChannel *display,
gint mark,
gpointer user_data) : Run First
The "display-mark" signal is emitted when
the RED_DISPLAY_MARK
command is received, and the display
should be exposed.
|
the SpiceDisplayChannel that emitted the signal |
|
TRUE when the display mark has been received |
|
user data set when the signal handler was connected. |
"display-primary-create"
signalvoid user_function (SpiceDisplayChannel *display,
gint format,
gint width,
gint height,
gint stride,
gint shmid,
gpointer imgdata,
gpointer user_data) : Run First
The "display-primary-create" signal provides main display buffer data.
|
the SpiceDisplayChannel that emitted the signal |
|
SPICE_SURFACE_FMT_32_xRGB or SPICE_SURFACE_FMT_16_555 ; |
|
width resolution |
|
height resolution |
|
the buffer stride ("width" padding) |
|
identifier of the shared memory segment associated with
the imgdata , or -1 if not shm |
|
pointer to surface buffer |
|
user data set when the signal handler was connected. |
"display-primary-destroy"
signalvoid user_function (SpiceDisplayChannel *display,
gpointer user_data) : Run First
The "display-primary-destroy" signal is emitted when the primary surface is freed and should not be accessed anymore.
|
the SpiceDisplayChannel that emitted the signal |
|
user data set when the signal handler was connected. |
"gl-draw"
signalvoid user_function (SpiceDisplayChannel *display, guint x, guint y, guint width, guint height, gpointer user_data)
The "draw" signal is emitted when the
rectangular region x/y/w/h of the GL scanout is updated and
must be drawn. When the draw is finished, you must call
spice_display_gl_draw_done()
in order to release the GL
resources.
|
the SpiceDisplayChannel that emitted the signal |
|
x position |
|
y position |
|
width |
|
height |
|
user data set when the signal handler was connected. |
Since 0.31