Display Channel

Display Channel — remote display area

Stability Level

Stable, unless otherwise indicated

Functions

Properties

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── SpiceChannel
        ╰── SpiceDisplayChannel

Includes

#include <spice-client.h>

Description

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.

Functions

spice_display_get_primary ()

gboolean
spice_display_get_primary (SpiceChannel *channel,
                           guint32 surface_id,
                           SpiceDisplayPrimary *primary);

Retrieve primary display surface surface_id .

Parameters

channel

a SpiceDisplayChannel

 

surface_id

a surface id

 

primary

a SpiceDisplayPrimary

 

Returns

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

Types and Values

struct SpiceDisplayChannel

struct SpiceDisplayChannel;

The SpiceDisplayChannel struct is opaque and should not be accessed directly.


struct SpiceDisplayChannelClass

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.

Members

SpiceChannelClass parent_class;

Parent class.

 

display_primary_create ()

Signal class handler for the “display-primary-create” signal.

 

display_primary_destroy ()

Signal class handler for the “display-primary-destroy” signal.

 

display_invalidate ()

Signal class handler for the “display-invalidate” signal.

 

display_mark ()

Signal class handler for the “display-mark” signal.

 

Property Details

The “height” property

  “height”                   guint

The primary surface height.

Flags: Read

Default value: 0


The “monitors” property

  “monitors”                 GArray *

Current monitors configuration.

Flags: Read

Since: 0.13


The “monitors-max” property

  “monitors-max”             guint

The maximum number of monitors the server or guest supports. May change during client lifetime, for instance guest may reboot or dynamically adjust this.

Flags: Read

Allowed values: [1,256]

Default value: 1

Since: 0.13


The “width” property

  “width”                    guint

The primary surface width.

Flags: Read

Default value: 0

Signal Details

The “display-invalidate” signal

void
user_function (SpiceDisplayChannel *display,
               gint                 x,
               gint                 y,
               gint                 width,
               gint                 height,
               gpointer             user_data)

The “display-invalidate” signal is emitted when the rectangular region x/y/w/h of the primary buffer is updated.

Parameters

display

the SpiceDisplayChannel that emitted the signal

 

x

x position

 

y

y position

 

width

width

 

height

height

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “display-mark” signal

void
user_function (SpiceDisplayChannel *display,
               gint                 mark,
               gpointer             user_data)

The “display-mark” signal is emitted when the RED_DISPLAY_MARK command is received, and the display should be exposed.

Parameters

display

the SpiceDisplayChannel that emitted the signal

 

mark

TRUE when the display mark has been received

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “display-primary-create” signal

void
user_function (SpiceDisplayChannel *display,
               gint                 format,
               gint                 width,
               gint                 height,
               gint                 stride,
               gint                 shmid,
               gpointer             imgdata,
               gpointer             user_data)

The “display-primary-create” signal provides main display buffer data.

Parameters

display

the SpiceDisplayChannel that emitted the signal

 

format

SPICE_SURFACE_FMT_32_xRGB or SPICE_SURFACE_FMT_16_555;

 

width

width resolution

 

height

height resolution

 

stride

the buffer stride ("width" padding)

 

shmid

identifier of the shared memory segment associated with the imgdata , or -1 if not shm

 

imgdata

pointer to surface buffer

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “display-primary-destroy” signal

void
user_function (SpiceDisplayChannel *display,
               gpointer             user_data)

The “display-primary-destroy” signal is emitted when the primary surface is freed and should not be accessed anymore.

Parameters

display

the SpiceDisplayChannel that emitted the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First

See Also

SpiceChannel, and the GTK widget SpiceDisplay