diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2012-06-16 15:39:21 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2012-07-16 17:46:41 +0200 |
commit | 66deab923d168509988f472c9275d27ae6f2530d (patch) | |
tree | 5574609f260c861cfc286c689926e5f27ad21a89 | |
parent | 230125032d848878ff2ee85d2829b9b62133a8c4 (diff) |
widget: add monitor property with ctor
-rw-r--r-- | doc/reference/spice-gtk-sections.txt | 1 | ||||
-rw-r--r-- | gtk/map-file | 1 | ||||
-rw-r--r-- | gtk/spice-widget-priv.h | 1 | ||||
-rw-r--r-- | gtk/spice-widget.c | 48 | ||||
-rw-r--r-- | gtk/spice-widget.h | 4 |
5 files changed, 52 insertions, 3 deletions
diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt index a339d32..daf575c 100644 --- a/doc/reference/spice-gtk-sections.txt +++ b/doc/reference/spice-gtk-sections.txt @@ -336,6 +336,7 @@ SpiceDisplay SpiceDisplayClass SpiceDisplayKeyEvent spice_display_new +spice_display_new_with_monitor spice_display_mouse_ungrab spice_display_copy_to_guest spice_display_paste_from_guest diff --git a/gtk/map-file b/gtk/map-file index c58bab5..0d48bb3 100644 --- a/gtk/map-file +++ b/gtk/map-file @@ -25,6 +25,7 @@ spice_display_get_type; spice_display_key_event_get_type; spice_display_mouse_ungrab; spice_display_new; +spice_display_new_with_monitor; spice_display_paste_from_guest; spice_display_send_keys; spice_display_set_grab_keys; diff --git a/gtk/spice-widget-priv.h b/gtk/spice-widget-priv.h index a94db68..a44e5fe 100644 --- a/gtk/spice-widget-priv.h +++ b/gtk/spice-widget-priv.h @@ -43,6 +43,7 @@ G_BEGIN_DECLS struct _SpiceDisplayPrivate { gint channel_id; + gint monitor_id; /* options */ bool keyboard_grab_enable; diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c index 4d0f9be..7f7f17a 100644 --- a/gtk/spice-widget.c +++ b/gtk/spice-widget.c @@ -101,7 +101,8 @@ enum { PROP_AUTO_CLIPBOARD, PROP_SCALING, PROP_DISABLE_INPUTS, - PROP_ZOOM_LEVEL + PROP_ZOOM_LEVEL, + PROP_MONITOR_ID }; /* Signals */ @@ -151,6 +152,9 @@ static void spice_display_get_property(GObject *object, case PROP_CHANNEL_ID: g_value_set_int(value, d->channel_id); break; + case PROP_MONITOR_ID: + g_value_set_int(value, d->monitor_id); + break; case PROP_KEYBOARD_GRAB: g_value_set_boolean(value, d->keyboard_grab_enable); break; @@ -242,6 +246,9 @@ static void spice_display_set_property(GObject *object, case PROP_CHANNEL_ID: d->channel_id = g_value_get_int(value); break; + case PROP_MONITOR_ID: + d->monitor_id = g_value_get_int(value); + break; case PROP_KEYBOARD_GRAB: d->keyboard_grab_enable = g_value_get_boolean(value); update_keyboard_grab(display); @@ -1492,6 +1499,25 @@ static void spice_display_class_init(SpiceDisplayClass *klass) G_PARAM_STATIC_STRINGS)); /** + * SpiceDisplay:monitor-id: + * + * Select monitor from #SpiceDisplay to show. + * The value -1 means the whole display is shown. + * By default, the monitor 0 is selected. + * + * Since: 0.13 + **/ + g_object_class_install_property + (gobject_class, PROP_MONITOR_ID, + g_param_spec_int("monitor-id", + "Monitor ID", + "Select monitor ID", + -1, G_MAXINT, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + /** * SpiceDisplay::mouse-grab: * @display: the #SpiceDisplay that emitted the signal * @status: 1 if grabbed, 0 otherwise. @@ -1969,7 +1995,7 @@ static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer dat /** * spice_display_new: * @session: a #SpiceSession - * @id: the display channel ID to associate with #SpiceDisplay + * @channel_id: the display channel ID to associate with #SpiceDisplay * * Returns: a new #SpiceDisplay widget. **/ @@ -1980,6 +2006,24 @@ SpiceDisplay *spice_display_new(SpiceSession *session, int id) } /** + * spice_display_new_with_monitor: + * @session: a #SpiceSession + * @channel_id: the display channel ID to associate with #SpiceDisplay + * @monitor_id: the monitor id within the display channel + * + * Since: 0.13 + * Returns: a new #SpiceDisplay widget. + **/ +SpiceDisplay* spice_display_new_with_monitor(SpiceSession *session, gint channel_id, gint monitor_id) +{ + return g_object_new(SPICE_TYPE_DISPLAY, + "session", session, + "channel-id", channel_id, + "monitor-id", monitor_id, + NULL); +} + +/** * spice_display_mouse_ungrab: * @display: * diff --git a/gtk/spice-widget.h b/gtk/spice-widget.h index 3f6a785..d239ed2 100644 --- a/gtk/spice-widget.h +++ b/gtk/spice-widget.h @@ -70,7 +70,9 @@ typedef enum GType spice_display_get_type(void); -SpiceDisplay* spice_display_new(SpiceSession *session, int id); +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); |