Merge lp:~robert-ancell/unity-control-center/libusd into lp:unity-control-center

Proposed by Robert Ancell on 2014-08-29
Status: Merged
Approved by: Iain Lane on 2014-09-22
Approved revision: 12788
Merged at revision: 12787
Proposed branch: lp:~robert-ancell/unity-control-center/libusd
Merge into: lp:unity-control-center
Diff against target: 1984 lines (+338/-341)
7 files modified
configure.ac (+2/-2)
debian/control (+1/-0)
panels/display/cc-display-panel.c (+232/-233)
panels/display/cc-rr-labeler.c (+19/-19)
panels/display/cc-rr-labeler.h (+3/-4)
panels/wacom/cc-wacom-mapping-panel.c (+14/-15)
panels/wacom/gsd-wacom-device.c (+67/-68)
To merge this branch: bzr merge lp:~robert-ancell/unity-control-center/libusd
Reviewer Review Type Date Requested Status
Iain Lane 2014-08-29 Approve on 2014-09-22
PS Jenkins bot (community) continuous-integration Needs Fixing on 2014-08-29
Review via email: mp+232676@code.launchpad.net

Commit message

Use libunity-settings-daemon to replace functionality that is being changed/removed in libgnome-desktop

Description of the change

Use libunity-settings-daemon to replace functionality that is being changed/removed in libgnome-desktop

To post a comment you must log in.
12786. By Robert Ancell on 2014-08-29

Merge with trunk

12787. By Robert Ancell on 2014-08-29

libunity-settings-daemon was moved into it's own package

12788. By Robert Ancell on 2014-08-29

Build-dep on libunity-settings-daemon-dev

Robert Ancell (robert-ancell) wrote :

Note that Jenkins can't build this because it requires the associated change from lp:~robert-ancell/unity-settings-daemon/xrandr

Iain Lane (laney) wrote :

works for me, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2014-02-26 20:00:59 +0000
3+++ configure.ac 2014-08-29 10:31:11 +0000
4@@ -121,7 +121,7 @@
5 gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED_VERSION)
6 PKG_CHECK_MODULES(DATETIME_PANEL, $COMMON_MODULES timezonemap
7 polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION)
8-PKG_CHECK_MODULES(DISPLAY_PANEL, $COMMON_MODULES gnome-desktop-3.0 >= 3.1.0 x11)
9+PKG_CHECK_MODULES(DISPLAY_PANEL, $COMMON_MODULES libunity-settings-daemon x11)
10 PKG_CHECK_MODULES(INFO_PANEL, $COMMON_MODULES libgtop-2.0 gl x11
11 polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION webkitgtk-3.0)
12 PKG_CHECK_MODULES(KEYBOARD_PANEL, $COMMON_MODULES
13@@ -236,7 +236,7 @@
14 PKG_CHECK_MODULES(WACOM_PANEL, $COMMON_MODULES
15 unity-settings-daemon
16 xi >= 1.2 x11 libwacom >= $LIBWACOM_REQUIRED_VERSION
17- gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION)
18+ libunity-settings-daemon)
19 AC_DEFINE(BUILD_WACOM, 1, [Define to 1 to build the Wacom panel])
20 have_wacom=yes
21 fi
22
23=== modified file 'debian/control'
24--- debian/control 2014-05-30 09:34:24 +0000
25+++ debian/control 2014-08-29 10:31:11 +0000
26@@ -12,6 +12,7 @@
27 gnome-common,
28 gnome-pkg-tools (>= 0.10),
29 unity-settings-daemon-dev,
30+ libunity-settings-daemon-dev,
31 gsettings-desktop-schemas-dev (>= 3.7.2.2),
32 hardening-wrapper,
33 intltool (>= 0.37.1),
34
35=== modified file 'panels/display/cc-display-panel.c'
36--- panels/display/cc-display-panel.c 2014-04-04 08:48:39 +0000
37+++ panels/display/cc-display-panel.c 2014-08-29 10:31:11 +0000
38@@ -30,9 +30,8 @@
39 #include <gtk/gtk.h>
40 #include <glib.h>
41 #include "scrollarea.h"
42-#define GNOME_DESKTOP_USE_UNSTABLE_API
43-#include <libgnome-desktop/gnome-rr.h>
44-#include <libgnome-desktop/gnome-rr-config.h>
45+#include <libunity-settings-daemon/gsd-rr.h>
46+#include <libunity-settings-daemon/gsd-rr-config.h>
47 #include <gdk/gdkx.h>
48 #include <X11/Xlib.h>
49 #include <glib/gi18n.h>
50@@ -86,10 +85,10 @@
51
52 struct _CcDisplayPanelPrivate
53 {
54- GnomeRRScreen *screen;
55- GnomeRRConfig *current_configuration;
56+ GsdRRScreen *screen;
57+ GsdRRConfig *current_configuration;
58 CcRRLabeler *labeler;
59- GnomeRROutputInfo *current_output;
60+ GsdRROutputInfo *current_output;
61
62 GSettings *clock_settings;
63 GSettings *unity_settings;
64@@ -134,18 +133,18 @@
65
66 static void rebuild_gui (CcDisplayPanel *self);
67 static void on_clone_changed (GtkWidget *box, gpointer data);
68-static gboolean output_overlaps (GnomeRROutputInfo *output, GnomeRRConfig *config);
69+static gboolean output_overlaps (GsdRROutputInfo *output, GsdRRConfig *config);
70 static void select_current_output_from_dialog_position (CcDisplayPanel *self);
71 static void monitor_switch_active_cb (GObject *object, GParamSpec *pspec, gpointer data);
72-static void get_geometry (GnomeRROutputInfo *output, int *w, int *h);
73+static void get_geometry (GsdRROutputInfo *output, int *w, int *h);
74 static void apply_configuration_returned_cb (GObject *proxy, GAsyncResult *res, gpointer data);
75-static gboolean get_clone_size (GnomeRRScreen *screen, int *width, int *height);
76-static gboolean output_info_supports_mode (CcDisplayPanel *self, GnomeRROutputInfo *info, int width, int height);
77+static gboolean get_clone_size (GsdRRScreen *screen, int *width, int *height);
78+static gboolean output_info_supports_mode (CcDisplayPanel *self, GsdRROutputInfo *info, int width, int height);
79 static char *make_resolution_string (int width, int height);
80 static GObject *cc_display_panel_constructor (GType gtype,
81 guint n_properties,
82 GObjectConstructParam *properties);
83-static void on_screen_changed (GnomeRRScreen *scr, gpointer data);
84+static void on_screen_changed (GsdRRScreen *scr, gpointer data);
85 static void refresh_unity_launcher_placement (CcDisplayPanel *self);
86 static void refresh_unity_monitor_scale (CcDisplayPanel *self);
87 static gboolean unity_launcher_on_all_monitors (GSettings *settings);
88@@ -295,14 +294,14 @@
89 }
90
91 static void
92-on_screen_changed (GnomeRRScreen *scr,
93+on_screen_changed (GsdRRScreen *scr,
94 gpointer data)
95 {
96- GnomeRRConfig *current;
97+ GsdRRConfig *current;
98 CcDisplayPanel *self = data;
99
100- current = gnome_rr_config_new_current (self->priv->screen, NULL);
101- gnome_rr_config_ensure_primary (current);
102+ current = gsd_rr_config_new_current (self->priv->screen, NULL);
103+ gsd_rr_config_ensure_primary (current);
104
105 if (self->priv->current_configuration)
106 g_object_unref (self->priv->current_configuration);
107@@ -399,7 +398,7 @@
108 const char *text,
109 gboolean preferred,
110 int width, int height, int rate,
111- GnomeRRRotation rotation)
112+ GsdRRRotation rotation)
113 {
114 ForeachInfo info;
115
116@@ -456,23 +455,23 @@
117
118 static void
119 add_mode (CcDisplayPanel *self,
120- GnomeRRMode *mode,
121+ GsdRRMode *mode,
122 gint output_width,
123 gint output_height,
124 guint preferred_id)
125 {
126 int width, height, rate;
127
128- width = gnome_rr_mode_get_width (mode);
129- height = gnome_rr_mode_get_height (mode);
130- rate = gnome_rr_mode_get_freq (mode);
131+ width = gsd_rr_mode_get_width (mode);
132+ height = gsd_rr_mode_get_height (mode);
133+ rate = gsd_rr_mode_get_freq (mode);
134
135 if (should_show_resolution (output_width, output_height, width, height))
136 {
137 char *text;
138 gboolean preferred;
139
140- preferred = (gnome_rr_mode_get_id (mode) == preferred_id);
141+ preferred = (gsd_rr_mode_get_id (mode) == preferred_id);
142 text = make_resolution_string (width, height);
143 add_key (gtk_combo_box_get_model (GTK_COMBO_BOX (self->priv->resolution_combo)),
144 text, preferred, width, height, rate, -1);
145@@ -501,27 +500,27 @@
146 return TRUE;
147 }
148
149-static GnomeRRMode **
150+static GsdRRMode **
151 get_current_modes (CcDisplayPanel *self)
152 {
153- GnomeRROutput *output;
154+ GsdRROutput *output;
155
156- if (gnome_rr_config_get_clone (self->priv->current_configuration))
157+ if (gsd_rr_config_get_clone (self->priv->current_configuration))
158 {
159- return gnome_rr_screen_list_clone_modes (self->priv->screen);
160+ return gsd_rr_screen_list_clone_modes (self->priv->screen);
161 }
162 else
163 {
164 if (!self->priv->current_output)
165 return NULL;
166
167- output = gnome_rr_screen_get_output_by_name (self->priv->screen,
168- gnome_rr_output_info_get_name (self->priv->current_output));
169+ output = gsd_rr_screen_get_output_by_name (self->priv->screen,
170+ gsd_rr_output_info_get_name (self->priv->current_output));
171
172 if (!output)
173 return NULL;
174
175- return gnome_rr_output_list_modes (output);
176+ return gsd_rr_output_list_modes (output);
177 }
178 }
179
180@@ -530,38 +529,38 @@
181 {
182 typedef struct
183 {
184- GnomeRRRotation rotation;
185+ GsdRRRotation rotation;
186 const char * name;
187 } RotationInfo;
188 static const RotationInfo rotations[] = {
189- { GNOME_RR_ROTATION_0, NC_("display panel, rotation", "Normal") },
190- { GNOME_RR_ROTATION_90, NC_("display panel, rotation", "Counterclockwise") },
191- { GNOME_RR_ROTATION_270, NC_("display panel, rotation", "Clockwise") },
192- { GNOME_RR_ROTATION_180, NC_("display panel, rotation", "180 Degrees") },
193+ { GSD_RR_ROTATION_0, NC_("display panel, rotation", "Normal") },
194+ { GSD_RR_ROTATION_90, NC_("display panel, rotation", "Counterclockwise") },
195+ { GSD_RR_ROTATION_270, NC_("display panel, rotation", "Clockwise") },
196+ { GSD_RR_ROTATION_180, NC_("display panel, rotation", "180 Degrees") },
197 };
198 const char *selection;
199- GnomeRRRotation current;
200+ GsdRRRotation current;
201 int i;
202
203 clear_combo (self->priv->rotation_combo);
204
205 gtk_widget_set_sensitive (self->priv->rotation_combo,
206- self->priv->current_output && gnome_rr_output_info_is_active (self->priv->current_output));
207+ self->priv->current_output && gsd_rr_output_info_is_active (self->priv->current_output));
208
209 if (!self->priv->current_output)
210 return;
211
212- current = gnome_rr_output_info_get_rotation (self->priv->current_output);
213+ current = gsd_rr_output_info_get_rotation (self->priv->current_output);
214
215 selection = NULL;
216 for (i = 0; i < G_N_ELEMENTS (rotations); ++i)
217 {
218 const RotationInfo *info = &(rotations[i]);
219
220- gnome_rr_output_info_set_rotation (self->priv->current_output, info->rotation);
221+ gsd_rr_output_info_set_rotation (self->priv->current_output, info->rotation);
222
223 /* NULL-GError --- FIXME: we should say why this rotation is not available! */
224- if (gnome_rr_config_applicable (self->priv->current_configuration, self->priv->screen, NULL))
225+ if (gsd_rr_config_applicable (self->priv->current_configuration, self->priv->screen, NULL))
226 {
227 add_key (gtk_combo_box_get_model (GTK_COMBO_BOX (self->priv->rotation_combo)), g_dpgettext2 (NULL, "display panel, rotation", info->name), FALSE, 0, 0, 0, info->rotation);
228
229@@ -570,7 +569,7 @@
230 }
231 }
232
233- gnome_rr_output_info_set_rotation (self->priv->current_output, current);
234+ gsd_rr_output_info_set_rotation (self->priv->current_output, current);
235
236 if (!(selection && combo_select (self->priv->rotation_combo, selection)))
237 gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->rotation_combo), 0);
238@@ -618,8 +617,8 @@
239 int output_width, output_height;
240 float max_scale;
241
242- GnomeRROutputInfo *output = self->priv->current_output;
243- const char *monitor_name = gnome_rr_output_info_get_name (output);
244+ GsdRROutputInfo *output = self->priv->current_output;
245+ const char *monitor_name = gsd_rr_output_info_get_name (output);
246 int current_ui_scale = get_ui_scale_from_monitor (self, monitor_name);
247 float current_scale_factor = (float)current_ui_scale / 8.0;
248 float win_scale_factor = current_scale_factor > 1 ? floor (current_scale_factor) : 1;
249@@ -644,7 +643,7 @@
250 GVariant *new_dict;
251
252 GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE(self->priv->ui_scale));
253- const char *monitor_name = gnome_rr_output_info_get_name (self->priv->current_output);
254+ const char *monitor_name = gsd_rr_output_info_get_name (self->priv->current_output);
255 if (!monitor_name)
256 {
257 g_warning("Failed to get monitor name.");
258@@ -673,11 +672,11 @@
259 count_active_outputs (CcDisplayPanel *self)
260 {
261 int i, count = 0;
262- GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration);
263+ GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration);
264
265 for (i = 0; outputs[i] != NULL; ++i)
266 {
267- if (gnome_rr_output_info_is_active (outputs[i]))
268+ if (gsd_rr_output_info_is_active (outputs[i]))
269 count++;
270 }
271
272@@ -686,10 +685,10 @@
273
274 #if 0
275 static int
276-count_all_outputs (GnomeRRConfig *config)
277+count_all_outputs (GsdRRConfig *config)
278 {
279 int i;
280- GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (config);
281+ GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (config);
282
283 for (i = 0; outputs[i] != NULL; i++)
284 ;
285@@ -718,7 +717,7 @@
286 if (have_clone_size) {
287 int i;
288 int num_outputs_with_clone_size;
289- GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration);
290+ GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration);
291
292 num_outputs_with_clone_size = 0;
293
294@@ -728,7 +727,7 @@
295 * doesn't matter if those outputs aren't actually On currently; we
296 * will turn them on in on_clone_changed().
297 */
298- if (gnome_rr_output_info_is_connected (outputs[i]) && output_info_supports_mode (self, outputs[i], clone_width, clone_height))
299+ if (gsd_rr_output_info_is_connected (outputs[i]) && output_info_supports_mode (self, outputs[i], clone_width, clone_height))
300 num_outputs_with_clone_size++;
301 }
302
303@@ -747,7 +746,7 @@
304
305 g_signal_handlers_block_by_func (self->priv->clone_checkbox, G_CALLBACK (on_clone_changed), self);
306
307- mirror_is_active = self->priv->current_configuration && gnome_rr_config_get_clone (self->priv->current_configuration);
308+ mirror_is_active = self->priv->current_configuration && gsd_rr_config_get_clone (self->priv->current_configuration);
309
310 /* If mirror_is_active, then it *must* be possible to turn mirroring off */
311 mirror_is_supported = mirror_is_active || mirror_screens_is_supported (self);
312@@ -786,7 +785,7 @@
313
314 if (self->priv->current_output)
315 {
316- if (gnome_rr_config_get_clone (self->priv->current_configuration))
317+ if (gsd_rr_config_get_clone (self->priv->current_configuration))
318 {
319 gchar *str = mirror_monitor_name ();
320 gtk_label_set_text (GTK_LABEL (self->priv->current_monitor_label), str);
321@@ -794,7 +793,7 @@
322 }
323 else
324 {
325- str = gnome_rr_output_info_get_display_name (self->priv->current_output);
326+ str = gsd_rr_output_info_get_display_name (self->priv->current_output);
327 gtk_label_set_text (GTK_LABEL (self->priv->current_monitor_label), str);
328 }
329
330@@ -845,14 +844,14 @@
331 sensitive = FALSE;
332 on_active = FALSE;
333
334- if (!gnome_rr_config_get_clone (self->priv->current_configuration) && self->priv->current_output)
335+ if (!gsd_rr_config_get_clone (self->priv->current_configuration) && self->priv->current_output)
336 {
337- if (count_active_outputs (self) > 1 || !gnome_rr_output_info_is_active (self->priv->current_output))
338+ if (count_active_outputs (self) > 1 || !gsd_rr_output_info_is_active (self->priv->current_output))
339 sensitive = TRUE;
340 else
341 sensitive = FALSE;
342
343- on_active = gnome_rr_output_info_is_active (self->priv->current_output);
344+ on_active = gsd_rr_output_info_is_active (self->priv->current_output);
345 }
346
347 gtk_widget_set_sensitive (self->priv->monitor_switch, sensitive);
348@@ -910,7 +909,7 @@
349 }
350
351 static void
352-find_best_mode (GnomeRRMode **modes, int *out_width, int *out_height)
353+find_best_mode (GsdRRMode **modes, int *out_width, int *out_height)
354 {
355 int i;
356
357@@ -921,8 +920,8 @@
358 {
359 int w, h;
360
361- w = gnome_rr_mode_get_width (modes[i]);
362- h = gnome_rr_mode_get_height (modes[i]);
363+ w = gsd_rr_mode_get_width (modes[i]);
364+ h = gsd_rr_mode_get_height (modes[i]);
365
366 if (w * h > *out_width * *out_height)
367 {
368@@ -936,18 +935,18 @@
369 rebuild_resolution_combo (CcDisplayPanel *self)
370 {
371 int i;
372- GnomeRRMode **modes;
373- GnomeRRMode *mode;
374+ GsdRRMode **modes;
375+ GsdRRMode *mode;
376 char *current;
377 int output_width, output_height;
378 guint32 preferred_id;
379- GnomeRROutput *output;
380+ GsdRROutput *output;
381
382 clear_combo (self->priv->resolution_combo);
383
384 if (!(modes = get_current_modes (self))
385 || !self->priv->current_output
386- || !gnome_rr_output_info_is_active (self->priv->current_output))
387+ || !gsd_rr_output_info_is_active (self->priv->current_output))
388 {
389 gtk_widget_set_sensitive (self->priv->resolution_combo, FALSE);
390 return;
391@@ -955,22 +954,22 @@
392
393 g_assert (self->priv->current_output != NULL);
394
395- gnome_rr_output_info_get_geometry (self->priv->current_output, NULL, NULL, &output_width, &output_height);
396+ gsd_rr_output_info_get_geometry (self->priv->current_output, NULL, NULL, &output_width, &output_height);
397 g_assert (output_width != 0 && output_height != 0);
398
399 gtk_widget_set_sensitive (self->priv->resolution_combo, TRUE);
400
401- output = gnome_rr_screen_get_output_by_name (self->priv->screen,
402- gnome_rr_output_info_get_name (self->priv->current_output));
403- mode = gnome_rr_output_get_preferred_mode (output);
404- preferred_id = gnome_rr_mode_get_id (mode);
405+ output = gsd_rr_screen_get_output_by_name (self->priv->screen,
406+ gsd_rr_output_info_get_name (self->priv->current_output));
407+ mode = gsd_rr_output_get_preferred_mode (output);
408+ preferred_id = gsd_rr_mode_get_id (mode);
409
410 for (i = 0; modes[i] != NULL; ++i)
411 add_mode (self, modes[i], output_width, output_height, preferred_id);
412
413 /* And force the preferred mode in the drop-down (when not in clone mode)
414 * https://bugzilla.gnome.org/show_bug.cgi?id=680969 */
415- if (!gnome_rr_config_get_clone (self->priv->current_configuration))
416+ if (!gsd_rr_config_get_clone (self->priv->current_configuration))
417 add_mode (self, mode, output_width, output_height, preferred_id);
418
419 current = make_resolution_string (output_width, output_height);
420@@ -1012,7 +1011,7 @@
421 }
422
423 static gboolean
424-get_mode (GtkWidget *widget, int *width, int *height, int *rate, GnomeRRRotation *rot)
425+get_mode (GtkWidget *widget, int *width, int *height, int *rate, GsdRRRotation *rot)
426 {
427 GtkTreeIter iter;
428 GtkTreeModel *model;
429@@ -1032,7 +1031,7 @@
430 rate = &dummy;
431
432 if (!rot)
433- rot = (GnomeRRRotation *)&dummy;
434+ rot = (GsdRRRotation *)&dummy;
435
436 model = gtk_combo_box_get_model (box);
437 gtk_tree_model_get (model, &iter,
438@@ -1050,13 +1049,13 @@
439 on_rotation_changed (GtkComboBox *box, gpointer data)
440 {
441 CcDisplayPanel *self = data;
442- GnomeRRRotation rotation;
443+ GsdRRRotation rotation;
444
445 if (!self->priv->current_output)
446 return;
447
448 if (get_mode (self->priv->rotation_combo, NULL, NULL, NULL, &rotation))
449- gnome_rr_output_info_set_rotation (self->priv->current_output, rotation);
450+ gsd_rr_output_info_set_rotation (self->priv->current_output, rotation);
451
452 foo_scroll_area_invalidate (FOO_SCROLL_AREA (self->priv->area));
453 }
454@@ -1082,7 +1081,7 @@
455 GVariant *dict;
456 GVariant *new_dict;
457
458- monitor_name = gnome_rr_output_info_get_name (self->priv->current_output);
459+ monitor_name = gsd_rr_output_info_get_name (self->priv->current_output);
460 if (!monitor_name)
461 {
462 g_warning("Failed to get monitor name.");
463@@ -1107,17 +1106,17 @@
464 static void
465 select_resolution_for_current_output (CcDisplayPanel *self)
466 {
467- GnomeRRMode **modes;
468+ GsdRRMode **modes;
469 int width, height;
470 int x,y;
471- gnome_rr_output_info_get_geometry (self->priv->current_output, &x, &y, NULL, NULL);
472+ gsd_rr_output_info_get_geometry (self->priv->current_output, &x, &y, NULL, NULL);
473
474- width = gnome_rr_output_info_get_preferred_width (self->priv->current_output);
475- height = gnome_rr_output_info_get_preferred_height (self->priv->current_output);
476+ width = gsd_rr_output_info_get_preferred_width (self->priv->current_output);
477+ height = gsd_rr_output_info_get_preferred_height (self->priv->current_output);
478
479 if (width != 0 && height != 0)
480 {
481- gnome_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height);
482+ gsd_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height);
483 return;
484 }
485
486@@ -1127,7 +1126,7 @@
487
488 find_best_mode (modes, &width, &height);
489
490- gnome_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height);
491+ gsd_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height);
492 }
493
494 static void
495@@ -1145,13 +1144,13 @@
496
497 if (value)
498 {
499- gnome_rr_output_info_set_active (self->priv->current_output, TRUE);
500+ gsd_rr_output_info_set_active (self->priv->current_output, TRUE);
501 select_resolution_for_current_output (self);
502 }
503 else
504 {
505- gnome_rr_output_info_set_active (self->priv->current_output, FALSE);
506- gnome_rr_config_ensure_primary (self->priv->current_configuration);
507+ gsd_rr_output_info_set_active (self->priv->current_output, FALSE);
508+ gsd_rr_config_ensure_primary (self->priv->current_configuration);
509 }
510
511 rebuild_gui (self);
512@@ -1159,7 +1158,7 @@
513 }
514
515 static void
516-realign_outputs_after_resolution_change (CcDisplayPanel *self, GnomeRROutputInfo *output_that_changed, int old_width, int old_height)
517+realign_outputs_after_resolution_change (CcDisplayPanel *self, GsdRROutputInfo *output_that_changed, int old_width, int old_height)
518 {
519 /* We find the outputs that were below or to the right of the output that
520 * changed, and realign them; we also do that for outputs that shared the
521@@ -1171,11 +1170,11 @@
522 int old_right_edge, old_bottom_edge;
523 int dx, dy;
524 int x, y, width, height;
525- GnomeRROutputInfo **outputs;
526+ GsdRROutputInfo **outputs;
527
528 g_assert (self->priv->current_configuration != NULL);
529
530- gnome_rr_output_info_get_geometry (output_that_changed, &x, &y, &width, &height);
531+ gsd_rr_output_info_get_geometry (output_that_changed, &x, &y, &width, &height);
532
533 if (width == old_width && height == old_height)
534 return;
535@@ -1186,17 +1185,17 @@
536 dx = width - old_width;
537 dy = height - old_height;
538
539- outputs = gnome_rr_config_get_outputs (self->priv->current_configuration);
540+ outputs = gsd_rr_config_get_outputs (self->priv->current_configuration);
541
542 for (i = 0; outputs[i] != NULL; i++)
543 {
544 int output_x, output_y;
545 int output_width, output_height;
546
547- if (outputs[i] == output_that_changed || !gnome_rr_output_info_is_connected (outputs[i]))
548+ if (outputs[i] == output_that_changed || !gsd_rr_output_info_is_connected (outputs[i]))
549 continue;
550
551- gnome_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
552+ gsd_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
553
554 if (output_x >= old_right_edge)
555 output_x += dx;
556@@ -1208,7 +1207,7 @@
557 else if (output_y + output_height == old_bottom_edge)
558 output_y = y + height - output_height;
559
560- gnome_rr_output_info_set_geometry (outputs[i], output_x, output_y, output_width, output_height);
561+ gsd_rr_output_info_set_geometry (outputs[i], output_x, output_y, output_width, output_height);
562 }
563 }
564
565@@ -1224,16 +1223,16 @@
566 if (!self->priv->current_output)
567 return;
568
569- gnome_rr_output_info_get_geometry (self->priv->current_output, &x, &y, &old_width, &old_height);
570+ gsd_rr_output_info_get_geometry (self->priv->current_output, &x, &y, &old_width, &old_height);
571
572 if (get_mode (self->priv->resolution_combo, &width, &height, NULL, NULL))
573 {
574- gnome_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height);
575+ gsd_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height);
576
577 if (width == 0 || height == 0)
578- gnome_rr_output_info_set_active (self->priv->current_output, FALSE);
579+ gsd_rr_output_info_set_active (self->priv->current_output, FALSE);
580 else
581- gnome_rr_output_info_set_active (self->priv->current_output, TRUE);
582+ gsd_rr_output_info_set_active (self->priv->current_output, TRUE);
583 }
584
585 realign_outputs_after_resolution_change (self, self->priv->current_output, old_width, old_height);
586@@ -1248,7 +1247,7 @@
587 {
588 int i;
589 int x;
590- GnomeRROutputInfo **outputs;
591+ GsdRROutputInfo **outputs;
592
593 /* Lay out all the monitors horizontally when "mirror screens" is turned
594 * off, to avoid having all of them overlapped initially. We put the
595@@ -1258,15 +1257,15 @@
596 x = 0;
597
598 /* First pass, all "on" outputs */
599- outputs = gnome_rr_config_get_outputs (self->priv->current_configuration);
600+ outputs = gsd_rr_config_get_outputs (self->priv->current_configuration);
601
602 for (i = 0; outputs[i]; ++i)
603 {
604 int width, height;
605- if (gnome_rr_output_info_is_connected (outputs[i]) && gnome_rr_output_info_is_active (outputs[i]))
606+ if (gsd_rr_output_info_is_connected (outputs[i]) && gsd_rr_output_info_is_active (outputs[i]))
607 {
608- gnome_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height);
609- gnome_rr_output_info_set_geometry (outputs[i], x, 0, width, height);
610+ gsd_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height);
611+ gsd_rr_output_info_set_geometry (outputs[i], x, 0, width, height);
612 x += width;
613 }
614 }
615@@ -1276,10 +1275,10 @@
616 for (i = 0; outputs[i]; ++i)
617 {
618 int width, height;
619- if (!(gnome_rr_output_info_is_connected (outputs[i]) && gnome_rr_output_info_is_active (outputs[i])))
620+ if (!(gsd_rr_output_info_is_connected (outputs[i]) && gsd_rr_output_info_is_active (outputs[i])))
621 {
622- gnome_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height);
623- gnome_rr_output_info_set_geometry (outputs[i], x, 0, width, height);
624+ gsd_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height);
625+ gsd_rr_output_info_set_geometry (outputs[i], x, 0, width, height);
626 x += width;
627 }
628 }
629@@ -1290,9 +1289,9 @@
630 * Do we need to put this function in gnome-desktop for public use?
631 */
632 static gboolean
633-get_clone_size (GnomeRRScreen *screen, int *width, int *height)
634+get_clone_size (GsdRRScreen *screen, int *width, int *height)
635 {
636- GnomeRRMode **modes = gnome_rr_screen_list_clone_modes (screen);
637+ GsdRRMode **modes = gsd_rr_screen_list_clone_modes (screen);
638 int best_w, best_h;
639 int i;
640
641@@ -1300,11 +1299,11 @@
642 best_h = 0;
643
644 for (i = 0; modes[i] != NULL; ++i) {
645- GnomeRRMode *mode = modes[i];
646+ GsdRRMode *mode = modes[i];
647 int w, h;
648
649- w = gnome_rr_mode_get_width (mode);
650- h = gnome_rr_mode_get_height (mode);
651+ w = gsd_rr_mode_get_width (mode);
652+ h = gsd_rr_mode_get_height (mode);
653
654 if (w * h > best_w * best_h) {
655 best_w = w;
656@@ -1325,24 +1324,24 @@
657 }
658
659 static gboolean
660-output_info_supports_mode (CcDisplayPanel *self, GnomeRROutputInfo *info, int width, int height)
661+output_info_supports_mode (CcDisplayPanel *self, GsdRROutputInfo *info, int width, int height)
662 {
663- GnomeRROutput *output;
664- GnomeRRMode **modes;
665+ GsdRROutput *output;
666+ GsdRRMode **modes;
667 int i;
668
669- if (!gnome_rr_output_info_is_connected (info))
670+ if (!gsd_rr_output_info_is_connected (info))
671 return FALSE;
672
673- output = gnome_rr_screen_get_output_by_name (self->priv->screen, gnome_rr_output_info_get_name (info));
674+ output = gsd_rr_screen_get_output_by_name (self->priv->screen, gsd_rr_output_info_get_name (info));
675 if (!output)
676 return FALSE;
677
678- modes = gnome_rr_output_list_modes (output);
679+ modes = gsd_rr_output_list_modes (output);
680
681 for (i = 0; modes[i]; i++) {
682- if (gnome_rr_mode_get_width (modes[i]) == width
683- && gnome_rr_mode_get_height (modes[i]) == height)
684+ if (gsd_rr_mode_get_width (modes[i]) == width
685+ && gsd_rr_mode_get_height (modes[i]) == height)
686 return TRUE;
687 }
688
689@@ -1354,17 +1353,17 @@
690 {
691 CcDisplayPanel *self = data;
692
693- gnome_rr_config_set_clone (self->priv->current_configuration, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->priv->clone_checkbox)));
694+ gsd_rr_config_set_clone (self->priv->current_configuration, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->priv->clone_checkbox)));
695
696- if (gnome_rr_config_get_clone (self->priv->current_configuration))
697+ if (gsd_rr_config_get_clone (self->priv->current_configuration))
698 {
699 int i;
700 int width, height;
701- GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration);
702+ GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration);
703
704 for (i = 0; outputs[i]; ++i)
705 {
706- if (gnome_rr_output_info_is_connected (outputs[i]))
707+ if (gsd_rr_output_info_is_connected (outputs[i]))
708 {
709 self->priv->current_output = outputs[i];
710 break;
711@@ -1381,9 +1380,9 @@
712 for (i = 0; outputs[i]; i++) {
713 int x, y;
714 if (output_info_supports_mode (self, outputs[i], width, height)) {
715- gnome_rr_output_info_set_active (outputs[i], TRUE);
716- gnome_rr_output_info_get_geometry (outputs[i], &x, &y, NULL, NULL);
717- gnome_rr_output_info_set_geometry (outputs[i], x, y, width, height);
718+ gsd_rr_output_info_set_active (outputs[i], TRUE);
719+ gsd_rr_output_info_get_geometry (outputs[i], &x, &y, NULL, NULL);
720+ gsd_rr_output_info_set_geometry (outputs[i], x, y, width, height);
721 }
722 }
723 }
724@@ -1397,12 +1396,12 @@
725 }
726
727 static void
728-apply_rotation_to_geometry (GnomeRROutputInfo *output, int *w, int *h)
729+apply_rotation_to_geometry (GsdRROutputInfo *output, int *w, int *h)
730 {
731- GnomeRRRotation rotation;
732+ GsdRRRotation rotation;
733
734- rotation = gnome_rr_output_info_get_rotation (output);
735- if ((rotation & GNOME_RR_ROTATION_90) || (rotation & GNOME_RR_ROTATION_270))
736+ rotation = gsd_rr_output_info_get_rotation (output);
737+ if ((rotation & GSD_RR_ROTATION_90) || (rotation & GSD_RR_ROTATION_270))
738 {
739 int tmp;
740 tmp = *h;
741@@ -1412,16 +1411,16 @@
742 }
743
744 static void
745-get_geometry (GnomeRROutputInfo *output, int *w, int *h)
746+get_geometry (GsdRROutputInfo *output, int *w, int *h)
747 {
748- if (gnome_rr_output_info_is_active (output))
749+ if (gsd_rr_output_info_is_active (output))
750 {
751- gnome_rr_output_info_get_geometry (output, NULL, NULL, w, h);
752+ gsd_rr_output_info_get_geometry (output, NULL, NULL, w, h);
753 }
754 else
755 {
756- *h = gnome_rr_output_info_get_preferred_height (output);
757- *w = gnome_rr_output_info_get_preferred_width (output);
758+ *h = gsd_rr_output_info_get_preferred_height (output);
759+ *w = gsd_rr_output_info_get_preferred_width (output);
760 }
761
762 apply_rotation_to_geometry (output, w, h);
763@@ -1435,7 +1434,7 @@
764 {
765 int i, dummy;
766 GList *result = NULL;
767- GnomeRROutputInfo **outputs;
768+ GsdRROutputInfo **outputs;
769
770 if (!total_w)
771 total_w = &dummy;
772@@ -1445,10 +1444,10 @@
773 *total_w = 0;
774 *total_h = 0;
775
776- outputs = gnome_rr_config_get_outputs (self->priv->current_configuration);
777+ outputs = gsd_rr_config_get_outputs (self->priv->current_configuration);
778 for (i = 0; outputs[i] != NULL; ++i)
779 {
780- if (gnome_rr_output_info_is_connected (outputs[i]))
781+ if (gsd_rr_output_info_is_connected (outputs[i]))
782 {
783 int w, h;
784
785@@ -1500,7 +1499,7 @@
786
787 typedef struct Edge
788 {
789- GnomeRROutputInfo *output;
790+ GsdRROutputInfo *output;
791 int x1, y1;
792 int x2, y2;
793 } Edge;
794@@ -1513,7 +1512,7 @@
795 } Snap;
796
797 static void
798-add_edge (GnomeRROutputInfo *output, int x1, int y1, int x2, int y2, GArray *edges)
799+add_edge (GsdRROutputInfo *output, int x1, int y1, int x2, int y2, GArray *edges)
800 {
801 Edge e;
802
803@@ -1527,11 +1526,11 @@
804 }
805
806 static void
807-list_edges_for_output (GnomeRROutputInfo *output, GArray *edges)
808+list_edges_for_output (GsdRROutputInfo *output, GArray *edges)
809 {
810 int x, y, w, h;
811
812- gnome_rr_output_info_get_geometry (output, &x, &y, &w, &h);
813+ gsd_rr_output_info_get_geometry (output, &x, &y, &w, &h);
814
815 apply_rotation_to_geometry (output, &w, &h);
816
817@@ -1543,14 +1542,14 @@
818 }
819
820 static void
821-list_edges (GnomeRRConfig *config, GArray *edges)
822+list_edges (GsdRRConfig *config, GArray *edges)
823 {
824 int i;
825- GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (config);
826+ GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (config);
827
828 for (i = 0; outputs[i]; ++i)
829 {
830- if (gnome_rr_output_info_is_connected (outputs[i]))
831+ if (gsd_rr_output_info_is_connected (outputs[i]))
832 list_edges_for_output (outputs[i], edges);
833 }
834 }
835@@ -1636,7 +1635,7 @@
836 }
837
838 static void
839-list_snaps (GnomeRROutputInfo *output, GArray *edges, GArray *snaps)
840+list_snaps (GsdRROutputInfo *output, GArray *edges, GArray *snaps)
841 {
842 int i;
843
844@@ -1692,7 +1691,7 @@
845 }
846
847 static gboolean
848-output_is_aligned (GnomeRROutputInfo *output, GArray *edges)
849+output_is_aligned (GsdRROutputInfo *output, GArray *edges)
850 {
851 gboolean result = FALSE;
852 int i;
853@@ -1729,28 +1728,28 @@
854 }
855
856 static void
857-get_output_rect (GnomeRROutputInfo *output, GdkRectangle *rect)
858+get_output_rect (GsdRROutputInfo *output, GdkRectangle *rect)
859 {
860- gnome_rr_output_info_get_geometry (output, &rect->x, &rect->y, &rect->width, &rect->height);
861+ gsd_rr_output_info_get_geometry (output, &rect->x, &rect->y, &rect->width, &rect->height);
862
863 apply_rotation_to_geometry (output, &rect->width, &rect->height);
864 }
865
866 static gboolean
867-output_overlaps (GnomeRROutputInfo *output, GnomeRRConfig *config)
868+output_overlaps (GsdRROutputInfo *output, GsdRRConfig *config)
869 {
870 int i;
871 GdkRectangle output_rect;
872- GnomeRROutputInfo **outputs;
873+ GsdRROutputInfo **outputs;
874
875 g_assert (output != NULL);
876
877 get_output_rect (output, &output_rect);
878
879- outputs = gnome_rr_config_get_outputs (config);
880+ outputs = gsd_rr_config_get_outputs (config);
881 for (i = 0; outputs[i]; ++i)
882 {
883- if (outputs[i] != output && gnome_rr_output_info_is_connected (outputs[i]))
884+ if (outputs[i] != output && gsd_rr_output_info_is_connected (outputs[i]))
885 {
886 GdkRectangle other_rect;
887
888@@ -1764,16 +1763,16 @@
889 }
890
891 static gboolean
892-gnome_rr_config_is_aligned (GnomeRRConfig *config, GArray *edges)
893+gsd_rr_config_is_aligned (GsdRRConfig *config, GArray *edges)
894 {
895 int i;
896 gboolean result = TRUE;
897- GnomeRROutputInfo **outputs;
898+ GsdRROutputInfo **outputs;
899
900- outputs = gnome_rr_config_get_outputs (config);
901+ outputs = gsd_rr_config_get_outputs (config);
902 for (i = 0; outputs[i]; ++i)
903 {
904- if (gnome_rr_output_info_is_connected (outputs[i]))
905+ if (gsd_rr_output_info_is_connected (outputs[i]))
906 {
907 if (!output_is_aligned (outputs[i], edges))
908 return FALSE;
909@@ -1879,7 +1878,7 @@
910 * on_canvas_event() for where we reset the cursor to the default if it
911 * exits the outputs' area.
912 */
913- if (!gnome_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1)
914+ if (!gsd_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1)
915 set_cursor (GTK_WIDGET (area), GDK_HAND1);
916
917 if (event->type == FOO_BUTTON_PRESS)
918@@ -1887,7 +1886,7 @@
919 rebuild_gui (self);
920 set_top_bar_tooltip (self, TRUE);
921
922- if (!gnome_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1)
923+ if (!gsd_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1)
924 {
925 self->priv->dragging_top_bar = TRUE;
926 foo_scroll_area_begin_grab (area, (FooScrollAreaEventFunc) on_top_bar_event, self);
927@@ -1926,14 +1925,14 @@
928
929 static void
930 set_primary_output (CcDisplayPanel *self,
931- GnomeRROutputInfo *output)
932+ GsdRROutputInfo *output)
933 {
934 int i;
935- GnomeRROutputInfo **outputs;
936+ GsdRROutputInfo **outputs;
937
938- outputs = gnome_rr_config_get_outputs (self->priv->current_configuration);
939+ outputs = gsd_rr_config_get_outputs (self->priv->current_configuration);
940 for (i = 0; outputs[i] != NULL; ++i)
941- gnome_rr_output_info_set_primary (outputs[i], outputs[i] == output);
942+ gsd_rr_output_info_set_primary (outputs[i], outputs[i] == output);
943
944 gtk_widget_queue_draw (WID ("self->priv->area"));
945 /* refresh the combobox */
946@@ -1945,12 +1944,12 @@
947 FooScrollAreaEvent *event,
948 gpointer data)
949 {
950- GnomeRROutputInfo *output = data;
951+ GsdRROutputInfo *output = data;
952 CcDisplayPanel *self = g_object_get_data (G_OBJECT (area), "panel");
953
954 if (event->type == FOO_DRAG_HOVER)
955 {
956- if (gnome_rr_output_info_is_active (output) && self->priv->dragging_top_bar)
957+ if (gsd_rr_output_info_is_active (output) && self->priv->dragging_top_bar)
958 set_primary_output (self, output);
959 return;
960 }
961@@ -1964,7 +1963,7 @@
962 * on_canvas_event() for where we reset the cursor to the default if it
963 * exits the outputs' area.
964 */
965- if (!gnome_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1)
966+ if (!gsd_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1)
967 set_cursor (GTK_WIDGET (area), GDK_FLEUR);
968
969 if (event->type == FOO_BUTTON_PRESS)
970@@ -1976,10 +1975,10 @@
971 rebuild_gui (self);
972 set_monitors_tooltip (self, TRUE);
973
974- if (!gnome_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1)
975+ if (!gsd_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1)
976 {
977 int output_x, output_y;
978- gnome_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL);
979+ gsd_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL);
980
981 foo_scroll_area_begin_grab (area, on_output_event, data);
982
983@@ -2005,11 +2004,11 @@
984 int i;
985 GArray *edges, *snaps, *new_edges;
986
987- gnome_rr_output_info_get_geometry (output, &old_x, &old_y, &width, &height);
988+ gsd_rr_output_info_get_geometry (output, &old_x, &old_y, &width, &height);
989 new_x = info->output_x + (event->x - info->grab_x) / scale;
990 new_y = info->output_y + (event->y - info->grab_y) / scale;
991
992- gnome_rr_output_info_set_geometry (output, new_x, new_y, width, height);
993+ gsd_rr_output_info_set_geometry (output, new_x, new_y, width, height);
994
995 edges = g_array_new (TRUE, TRUE, sizeof (Edge));
996 snaps = g_array_new (TRUE, TRUE, sizeof (Snap));
997@@ -2020,26 +2019,26 @@
998
999 g_array_sort (snaps, compare_snaps);
1000
1001- gnome_rr_output_info_set_geometry (output, new_x, new_y, width, height);
1002+ gsd_rr_output_info_set_geometry (output, new_x, new_y, width, height);
1003
1004 for (i = 0; i < snaps->len; ++i)
1005 {
1006 Snap *snap = &(g_array_index (snaps, Snap, i));
1007 GArray *new_edges = g_array_new (TRUE, TRUE, sizeof (Edge));
1008
1009- gnome_rr_output_info_set_geometry (output, new_x + snap->dx, new_y + snap->dy, width, height);
1010+ gsd_rr_output_info_set_geometry (output, new_x + snap->dx, new_y + snap->dy, width, height);
1011
1012 g_array_set_size (new_edges, 0);
1013 list_edges (self->priv->current_configuration, new_edges);
1014
1015- if (gnome_rr_config_is_aligned (self->priv->current_configuration, new_edges))
1016+ if (gsd_rr_config_is_aligned (self->priv->current_configuration, new_edges))
1017 {
1018 g_array_free (new_edges, TRUE);
1019 break;
1020 }
1021 else
1022 {
1023- gnome_rr_output_info_set_geometry (output, info->output_x, info->output_y, width, height);
1024+ gsd_rr_output_info_set_geometry (output, info->output_x, info->output_y, width, height);
1025 }
1026 }
1027
1028@@ -2079,15 +2078,15 @@
1029
1030 static PangoLayout *
1031 get_display_name (CcDisplayPanel *self,
1032- GnomeRROutputInfo *output)
1033+ GsdRROutputInfo *output)
1034 {
1035 PangoLayout *layout;
1036 char *text;
1037
1038- if (gnome_rr_config_get_clone (self->priv->current_configuration))
1039+ if (gsd_rr_config_get_clone (self->priv->current_configuration))
1040 text = mirror_monitor_name ();
1041 else
1042- text = g_strdup (gnome_rr_output_info_get_display_name (output));
1043+ text = g_strdup (gsd_rr_output_info_get_display_name (output));
1044
1045 layout = gtk_widget_create_pango_layout (GTK_WIDGET (self->priv->area), text);
1046 g_free (text);
1047@@ -2167,10 +2166,10 @@
1048 double scale = compute_scale (self);
1049 double x, y;
1050 int output_x, output_y;
1051- GnomeRRRotation rotation;
1052+ GsdRRRotation rotation;
1053 int total_w, total_h;
1054 GList *connected_outputs = list_connected_outputs (self, &total_w, &total_h);
1055- GnomeRROutputInfo *output = g_list_nth (connected_outputs, i)->data;
1056+ GsdRROutputInfo *output = g_list_nth (connected_outputs, i)->data;
1057 PangoLayout *layout = get_display_name (self, output);
1058 PangoRectangle ink_extent, log_extent;
1059 GdkRectangle viewport;
1060@@ -2192,7 +2191,7 @@
1061 viewport.height -= 2 * MARGIN;
1062 viewport.width -= 2 * MARGIN;
1063
1064- gnome_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL);
1065+ gsd_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL);
1066 x = output_x * scale + MARGIN + (viewport.width - total_w * scale) / 2.0;
1067 y = output_y * scale + MARGIN + (viewport.height - total_h * scale) / 2.0;
1068
1069@@ -2210,11 +2209,11 @@
1070
1071 /* rotation is already applied in get_geometry */
1072
1073- rotation = gnome_rr_output_info_get_rotation (output);
1074- if (rotation & GNOME_RR_REFLECT_X)
1075+ rotation = gsd_rr_output_info_get_rotation (output);
1076+ if (rotation & GSD_RR_REFLECT_X)
1077 cairo_scale (cr, -1, 1);
1078
1079- if (rotation & GNOME_RR_REFLECT_Y)
1080+ if (rotation & GSD_RR_REFLECT_Y)
1081 cairo_scale (cr, 1, -1);
1082
1083 cairo_translate (cr,
1084@@ -2244,7 +2243,7 @@
1085 g = output_color.green;
1086 b = output_color.blue;
1087
1088- if (!gnome_rr_output_info_is_active (output))
1089+ if (!gsd_rr_output_info_is_active (output))
1090 {
1091 /* If the output is turned off, just darken the selected color */
1092 color_shade (&r, &g, &b, 0.4);
1093@@ -2280,7 +2279,7 @@
1094 y + ((h * scale + 0.5) - factor * log_extent.height) / 2);
1095
1096 cairo_scale (cr, factor, factor);
1097- if (gnome_rr_output_info_is_active (output))
1098+ if (gsd_rr_output_info_is_active (output))
1099 cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
1100 else
1101 cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
1102@@ -2292,7 +2291,7 @@
1103 /* Only display a launcher on all or primary monitor */
1104 if (is_unity_session ())
1105 {
1106- if (gnome_rr_output_info_is_active (output) && (unity_launcher_on_all_monitors (self->priv->unity_settings) || gnome_rr_output_info_get_primary (output)))
1107+ if (gsd_rr_output_info_is_active (output) && (unity_launcher_on_all_monitors (self->priv->unity_settings) || gsd_rr_output_info_get_primary (output)))
1108 {
1109 cairo_rectangle (cr, x, y, 10, h * scale + 0.5);
1110 cairo_set_source_rgb (cr, 0, 0, 0);
1111@@ -2312,7 +2311,7 @@
1112 }
1113 }
1114
1115- if (gnome_rr_output_info_get_primary (output) && !is_unity_session ())
1116+ if (gsd_rr_output_info_get_primary (output) && !is_unity_session ())
1117 {
1118 const char *clock_format;
1119 char *text;
1120@@ -2389,7 +2388,7 @@
1121 {
1122 paint_output (self, cr, g_list_position (connected_outputs, list));
1123
1124- if (gnome_rr_config_get_clone (self->priv->current_configuration))
1125+ if (gsd_rr_config_get_clone (self->priv->current_configuration))
1126 break;
1127 }
1128 }
1129@@ -2428,21 +2427,21 @@
1130 }
1131
1132 static void
1133-compute_virtual_size_for_configuration (GnomeRRConfig *config, int *ret_width, int *ret_height)
1134+compute_virtual_size_for_configuration (GsdRRConfig *config, int *ret_width, int *ret_height)
1135 {
1136 int i;
1137 int width, height;
1138 int output_x, output_y, output_width, output_height;
1139- GnomeRROutputInfo **outputs;
1140+ GsdRROutputInfo **outputs;
1141
1142 width = height = 0;
1143
1144- outputs = gnome_rr_config_get_outputs (config);
1145+ outputs = gsd_rr_config_get_outputs (config);
1146 for (i = 0; outputs[i] != NULL; i++)
1147 {
1148- if (gnome_rr_output_info_is_active (outputs[i]))
1149+ if (gsd_rr_output_info_is_active (outputs[i]))
1150 {
1151- gnome_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
1152+ gsd_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
1153 width = MAX (width, output_x + output_width);
1154 height = MAX (height, output_y + output_height);
1155 }
1156@@ -2461,7 +2460,7 @@
1157
1158 compute_virtual_size_for_configuration (self->priv->current_configuration, &req_width, &req_height);
1159
1160- gnome_rr_screen_get_ranges (self->priv->screen, &min_width, &max_width, &min_height, &max_height);
1161+ gsd_rr_screen_get_ranges (self->priv->screen, &min_width, &max_width, &min_height, &max_height);
1162
1163 #if 0
1164 g_debug ("X Server supports:");
1165@@ -2516,24 +2515,24 @@
1166 static void
1167 ensure_current_configuration_is_saved (void)
1168 {
1169- GnomeRRScreen *rr_screen;
1170- GnomeRRConfig *rr_config;
1171+ GsdRRScreen *rr_screen;
1172+ GsdRRConfig *rr_config;
1173
1174- /* Normally, gnome_rr_config_save() creates a backup file based on the
1175+ /* Normally, gsd_rr_config_save() creates a backup file based on the
1176 * old monitors.xml. However, if *that* file didn't exist, there is
1177 * nothing from which to create a backup. So, here we'll save the
1178 * current/unchanged configuration and then let our caller call
1179- * gnome_rr_config_save() again with the new/changed configuration, so
1180+ * gsd_rr_config_save() again with the new/changed configuration, so
1181 * that there *will* be a backup file in the end.
1182 */
1183
1184- rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), NULL); /* NULL-GError */
1185+ rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), NULL); /* NULL-GError */
1186 if (!rr_screen)
1187 return;
1188
1189- rr_config = gnome_rr_config_new_current (rr_screen, NULL);
1190- gnome_rr_config_ensure_primary (rr_config);
1191- gnome_rr_config_save (rr_config, NULL); /* NULL-GError */
1192+ rr_config = gsd_rr_config_new_current (rr_screen, NULL);
1193+ gsd_rr_config_ensure_primary (rr_config);
1194+ gsd_rr_config_save (rr_config, NULL); /* NULL-GError */
1195
1196 g_object_unref (rr_config);
1197 g_object_unref (rr_screen);
1198@@ -2566,8 +2565,8 @@
1199 {
1200 GError *error;
1201
1202- gnome_rr_config_sanitize (self->priv->current_configuration);
1203- gnome_rr_config_ensure_primary (self->priv->current_configuration);
1204+ gsd_rr_config_sanitize (self->priv->current_configuration);
1205+ gsd_rr_config_ensure_primary (self->priv->current_configuration);
1206
1207 check_required_virtual_size (self);
1208
1209@@ -2576,7 +2575,7 @@
1210 ensure_current_configuration_is_saved ();
1211
1212 error = NULL;
1213- if (!gnome_rr_config_save (self->priv->current_configuration, &error))
1214+ if (!gsd_rr_config_save (self->priv->current_configuration, &error))
1215 {
1216 error_message (self, _("Could not save the monitor configuration"), error->message);
1217 g_error_free (error);
1218@@ -2609,7 +2608,7 @@
1219 #if 0
1220 /* Returns whether the graphics driver doesn't advertise RANDR 1.2 features, and just 1.0 */
1221 static gboolean
1222-driver_is_randr_10 (GnomeRRConfig *config)
1223+driver_is_randr_10 (GsdRRConfig *config)
1224 {
1225 /* In the Xorg code, see xserver/randr/rrinfo.c:RRScanOldConfig(). It gets
1226 * called when the graphics driver doesn't support RANDR 1.2 yet, just 1.0.
1227@@ -2622,10 +2621,10 @@
1228 *
1229 * FIXME: however, we don't even check for XRRQueryVersion() returning 1.2, neither
1230 * here nor in gnome-desktop/libgnomedesktop*.c. Do we need to check for that,
1231- * or is gnome_rr_screen_new()'s return value sufficient?
1232+ * or is gsd_rr_screen_new()'s return value sufficient?
1233 */
1234
1235- return (count_all_outputs (config) == 1 && strcmp (gnome_rr_output_info_get_name (gnome_rr_config_get_outputs (config)[0]), "default") == 0);
1236+ return (count_all_outputs (config) == 1 && strcmp (gsd_rr_output_info_get_name (gsd_rr_config_get_outputs (config)[0]), "default") == 0);
1237 }
1238 #endif
1239
1240@@ -2636,7 +2635,7 @@
1241 GError *error;
1242
1243 error = NULL;
1244- if (!gnome_rr_screen_refresh (self->priv->screen, &error)) {
1245+ if (!gsd_rr_screen_refresh (self->priv->screen, &error)) {
1246 if (error) {
1247 error_message (self, _("Could not detect displays"), error->message);
1248 g_error_free (error);
1249@@ -2644,27 +2643,27 @@
1250 }
1251 }
1252
1253-static GnomeRROutputInfo *
1254-get_nearest_output (GnomeRRConfig *configuration, int x, int y)
1255+static GsdRROutputInfo *
1256+get_nearest_output (GsdRRConfig *configuration, int x, int y)
1257 {
1258 int i;
1259 int nearest_index;
1260 int nearest_dist;
1261- GnomeRROutputInfo **outputs;
1262+ GsdRROutputInfo **outputs;
1263
1264 nearest_index = -1;
1265 nearest_dist = G_MAXINT;
1266
1267- outputs = gnome_rr_config_get_outputs (configuration);
1268+ outputs = gsd_rr_config_get_outputs (configuration);
1269 for (i = 0; outputs[i] != NULL; i++)
1270 {
1271 int dist_x, dist_y;
1272 int output_x, output_y, output_width, output_height;
1273
1274- if (!(gnome_rr_output_info_is_connected (outputs[i]) && gnome_rr_output_info_is_active (outputs[i])))
1275+ if (!(gsd_rr_output_info_is_connected (outputs[i]) && gsd_rr_output_info_is_active (outputs[i])))
1276 continue;
1277
1278- gnome_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
1279+ gsd_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
1280
1281 if (x < output_x)
1282 dist_x = output_x - x;
1283@@ -2696,14 +2695,14 @@
1284 /* Gets the output that contains the largest intersection with the window.
1285 * Logic stolen from gdk_screen_get_monitor_at_window().
1286 */
1287-static GnomeRROutputInfo *
1288-get_output_for_window (GnomeRRConfig *configuration, GdkWindow *window)
1289+static GsdRROutputInfo *
1290+get_output_for_window (GsdRRConfig *configuration, GdkWindow *window)
1291 {
1292 GdkRectangle win_rect;
1293 int i;
1294 int largest_area;
1295 int largest_index;
1296- GnomeRROutputInfo **outputs;
1297+ GsdRROutputInfo **outputs;
1298
1299 gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height);
1300 gdk_window_get_origin (window, &win_rect.x, &win_rect.y);
1301@@ -2711,14 +2710,14 @@
1302 largest_area = 0;
1303 largest_index = -1;
1304
1305- outputs = gnome_rr_config_get_outputs (configuration);
1306+ outputs = gsd_rr_config_get_outputs (configuration);
1307 for (i = 0; outputs[i] != NULL; i++)
1308 {
1309 GdkRectangle output_rect, intersection;
1310
1311- gnome_rr_output_info_get_geometry (outputs[i], &output_rect.x, &output_rect.y, &output_rect.width, &output_rect.height);
1312+ gsd_rr_output_info_get_geometry (outputs[i], &output_rect.x, &output_rect.y, &output_rect.width, &output_rect.height);
1313
1314- if (gnome_rr_output_info_is_connected (outputs[i]) && gdk_rectangle_intersect (&win_rect, &output_rect, &intersection))
1315+ if (gsd_rr_output_info_is_connected (outputs[i]) && gdk_rectangle_intersect (&win_rect, &output_rect, &intersection))
1316 {
1317 int area;
1318
1319@@ -2831,7 +2830,7 @@
1320 }
1321
1322 static GdkPixbuf*
1323-get_monitor_pixbuf (CcDisplayPanel *self, GnomeRROutputInfo *output)
1324+get_monitor_pixbuf (CcDisplayPanel *self, GsdRROutputInfo *output)
1325 {
1326 GdkRGBA color;
1327 cairo_surface_t *cairo_surface;
1328@@ -2880,19 +2879,19 @@
1329 {
1330 char *monitor_name;
1331 GdkPixbuf *monitor_pixbuf;
1332- GnomeRROutputInfo *output = list->data;
1333+ GsdRROutputInfo *output = list->data;
1334
1335- if (!gnome_rr_output_info_is_active (output))
1336+ if (!gsd_rr_output_info_is_active (output))
1337 continue;
1338
1339 gtk_list_store_append (liststore, &iter);
1340- monitor_name = g_strdup (gnome_rr_output_info_get_display_name (output));
1341+ monitor_name = g_strdup (gsd_rr_output_info_get_display_name (output));
1342 monitor_pixbuf = get_monitor_pixbuf (self, output);
1343
1344 gtk_list_store_set (liststore, &iter, 0, monitor_pixbuf, 1, monitor_name, -1);
1345
1346 /* select it if primary and only one launcher */
1347- if (gnome_rr_output_info_get_primary (output) && (!launcher_on_all_monitors))
1348+ if (gsd_rr_output_info_get_primary (output) && (!launcher_on_all_monitors))
1349 index_of_primary_screen = i;
1350 i++;
1351
1352@@ -2930,19 +2929,19 @@
1353 {
1354 gchar *monitor_name;
1355 GdkPixbuf *monitor_pixbuf;
1356- GnomeRROutputInfo *output = list->data;
1357+ GsdRROutputInfo *output = list->data;
1358
1359- if (!gnome_rr_output_info_is_active (output))
1360+ if (!gsd_rr_output_info_is_active (output))
1361 continue;
1362
1363 gtk_list_store_append (liststore, &iter);
1364- monitor_name = g_strdup (gnome_rr_output_info_get_display_name (output));
1365+ monitor_name = g_strdup (gsd_rr_output_info_get_display_name (output));
1366 monitor_pixbuf = get_monitor_pixbuf (self, output);
1367
1368 gtk_list_store_set (liststore, &iter, 0, monitor_pixbuf, 1, monitor_name, -1);
1369
1370 /* select it if primary and only one launcher */
1371- if (g_strcmp0 (gnome_rr_output_info_get_name (output), target_monitor) == 0)
1372+ if (g_strcmp0 (gsd_rr_output_info_get_name (output), target_monitor) == 0)
1373 target_monitor_idx = i;
1374 i++;
1375
1376@@ -3011,15 +3010,15 @@
1377 if (!on_all_monitors) {
1378 value = 1;
1379 // set the primary output if needed
1380- GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration);
1381+ GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration);
1382
1383 for (i = 0; outputs[i] != NULL; ++i)
1384 {
1385- GnomeRROutputInfo *output = outputs[i];
1386- if (!gnome_rr_output_info_is_active (output))
1387+ GsdRROutputInfo *output = outputs[i];
1388+ if (!gsd_rr_output_info_is_active (output))
1389 continue;
1390
1391- if ((active == index_on_combo) && !gnome_rr_output_info_get_primary (output))
1392+ if ((active == index_on_combo) && !gsd_rr_output_info_get_primary (output))
1393 {
1394 set_primary_output (self, output);
1395 break;
1396@@ -3055,17 +3054,17 @@
1397 if (active < 0)
1398 return;
1399
1400- GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration);
1401+ GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration);
1402
1403 for (i = 0; outputs[i] != NULL; ++i)
1404 {
1405- GnomeRROutputInfo *output = outputs[i];
1406- if (!gnome_rr_output_info_is_active (output))
1407+ GsdRROutputInfo *output = outputs[i];
1408+ if (!gsd_rr_output_info_is_active (output))
1409 continue;
1410
1411 if (active == index_on_combo)
1412 {
1413- scale_monitor = g_strdup (gnome_rr_output_info_get_name (output));
1414+ scale_monitor = g_strdup (gsd_rr_output_info_get_name (output));
1415 break;
1416 }
1417 index_on_combo++;
1418@@ -3179,7 +3178,7 @@
1419 return obj;
1420 }
1421
1422- self->priv->screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
1423+ self->priv->screen = gsd_rr_screen_new (gdk_screen_get_default (), &error);
1424 g_signal_connect (self->priv->screen, "changed", G_CALLBACK (on_screen_changed), self);
1425 if (!self->priv->screen)
1426 {
1427
1428=== modified file 'panels/display/cc-rr-labeler.c'
1429--- panels/display/cc-rr-labeler.c 2013-11-28 05:57:59 +0000
1430+++ panels/display/cc-rr-labeler.c 2014-08-29 10:31:11 +0000
1431@@ -38,7 +38,7 @@
1432 #include "cc-rr-labeler.h"
1433
1434 struct _CcRRLabelerPrivate {
1435- GnomeRRConfig *config;
1436+ GsdRRConfig *config;
1437
1438 int num_outputs;
1439
1440@@ -106,7 +106,7 @@
1441
1442 switch (property_id) {
1443 case PROP_CONFIG:
1444- self->priv->config = GNOME_RR_CONFIG (g_value_dup_object (value));
1445+ self->priv->config = GSD_RR_CONFIG (g_value_dup_object (value));
1446 return;
1447 default:
1448 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, param_spec);
1449@@ -139,7 +139,7 @@
1450 g_object_class_install_property (object_class, PROP_CONFIG, g_param_spec_object ("config",
1451 "Configuration",
1452 "RandR configuration to label",
1453- GNOME_TYPE_RR_CONFIG,
1454+ GSD_TYPE_RR_CONFIG,
1455 G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
1456 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
1457 }
1458@@ -170,10 +170,10 @@
1459 }
1460
1461 static int
1462-count_outputs (GnomeRRConfig *config)
1463+count_outputs (GsdRRConfig *config)
1464 {
1465 int i;
1466- GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (config);
1467+ GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (config);
1468
1469 for (i = 0; outputs[i] != NULL; i++)
1470 ;
1471@@ -402,7 +402,7 @@
1472 }
1473
1474 static GtkWidget *
1475-create_label_window (CcRRLabeler *labeler, GnomeRROutputInfo *output, GdkRGBA *rgba)
1476+create_label_window (CcRRLabeler *labeler, GsdRROutputInfo *output, GdkRGBA *rgba)
1477 {
1478 GtkWidget *window;
1479 GtkWidget *widget;
1480@@ -438,7 +438,7 @@
1481 g_signal_connect (window, "composited-changed",
1482 G_CALLBACK (label_window_composited_changed_cb), labeler);
1483
1484- if (gnome_rr_config_get_clone (labeler->priv->config)) {
1485+ if (gsd_rr_config_get_clone (labeler->priv->config)) {
1486 /* Keep this string in sync with gnome-control-center/capplets/display/xrandr-capplet.c:get_display_name() */
1487
1488 /* Translators: this is the feature where what you see on your
1489@@ -448,7 +448,7 @@
1490 */
1491 display_name = _("Mirrored Displays");
1492 } else
1493- display_name = gnome_rr_output_info_get_display_name (output);
1494+ display_name = gsd_rr_output_info_get_display_name (output);
1495
1496 str = g_strdup_printf ("<b>%s</b>", display_name);
1497 widget = gtk_label_new (NULL);
1498@@ -466,7 +466,7 @@
1499 gtk_container_add (GTK_CONTAINER (window), widget);
1500
1501 /* Should we center this at the top edge of the monitor, instead of using the upper-left corner? */
1502- gnome_rr_output_info_get_geometry (output, &x, &y, NULL, NULL);
1503+ gsd_rr_output_info_get_geometry (output, &x, &y, NULL, NULL);
1504 position_window (labeler, window, x, y);
1505
1506 gtk_widget_show_all (window);
1507@@ -496,9 +496,9 @@
1508 * Returns: A new #CcRRLabeler
1509 */
1510 CcRRLabeler *
1511-cc_rr_labeler_new (GnomeRRConfig *config)
1512+cc_rr_labeler_new (GsdRRConfig *config)
1513 {
1514- g_return_val_if_fail (GNOME_IS_RR_CONFIG (config), NULL);
1515+ g_return_val_if_fail (GSD_IS_RR_CONFIG (config), NULL);
1516
1517 return g_object_new (GNOME_TYPE_RR_LABELER, "config", config, NULL);
1518 }
1519@@ -514,7 +514,7 @@
1520 {
1521 int i;
1522 gboolean created_window_for_clone;
1523- GnomeRROutputInfo **outputs;
1524+ GsdRROutputInfo **outputs;
1525
1526 g_return_if_fail (GNOME_IS_RR_LABELER (labeler));
1527
1528@@ -525,13 +525,13 @@
1529
1530 created_window_for_clone = FALSE;
1531
1532- outputs = gnome_rr_config_get_outputs (labeler->priv->config);
1533+ outputs = gsd_rr_config_get_outputs (labeler->priv->config);
1534
1535 for (i = 0; i < labeler->priv->num_outputs; i++) {
1536- if (!created_window_for_clone && gnome_rr_output_info_is_active (outputs[i])) {
1537+ if (!created_window_for_clone && gsd_rr_output_info_is_active (outputs[i])) {
1538 labeler->priv->windows[i] = create_label_window (labeler, outputs[i], labeler->priv->palette + i);
1539
1540- if (gnome_rr_config_get_clone (labeler->priv->config))
1541+ if (gsd_rr_config_get_clone (labeler->priv->config))
1542 created_window_for_clone = TRUE;
1543 } else
1544 labeler->priv->windows[i] = NULL;
1545@@ -575,16 +575,16 @@
1546 * Get the color used for the label on a given output (monitor).
1547 */
1548 void
1549-cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GnomeRROutputInfo *output, GdkRGBA *rgba_out)
1550+cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GsdRROutputInfo *output, GdkRGBA *rgba_out)
1551 {
1552 int i;
1553- GnomeRROutputInfo **outputs;
1554+ GsdRROutputInfo **outputs;
1555
1556 g_return_if_fail (GNOME_IS_RR_LABELER (labeler));
1557- g_return_if_fail (GNOME_IS_RR_OUTPUT_INFO (output));
1558+ g_return_if_fail (GSD_IS_RR_OUTPUT_INFO (output));
1559 g_return_if_fail (rgba_out != NULL);
1560
1561- outputs = gnome_rr_config_get_outputs (labeler->priv->config);
1562+ outputs = gsd_rr_config_get_outputs (labeler->priv->config);
1563
1564 for (i = 0; i < labeler->priv->num_outputs; i++)
1565 if (outputs[i] == output) {
1566
1567=== modified file 'panels/display/cc-rr-labeler.h'
1568--- panels/display/cc-rr-labeler.h 2013-11-28 05:57:59 +0000
1569+++ panels/display/cc-rr-labeler.h 2014-08-29 10:31:11 +0000
1570@@ -26,8 +26,7 @@
1571 #ifndef CC_RR_LABELER_H
1572 #define CC_RR_LABELER_H
1573
1574-#define GNOME_DESKTOP_USE_UNSTABLE_API
1575-#include <libgnome-desktop/gnome-rr-config.h>
1576+#include <libunity-settings-daemon/gsd-rr-config.h>
1577
1578 #define GNOME_TYPE_RR_LABELER (cc_rr_labeler_get_type ())
1579 #define CC_RR_LABELER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_RR_LABELER, CcRRLabeler))
1580@@ -53,12 +52,12 @@
1581
1582 GType cc_rr_labeler_get_type (void);
1583
1584-CcRRLabeler *cc_rr_labeler_new (GnomeRRConfig *config);
1585+CcRRLabeler *cc_rr_labeler_new (GsdRRConfig *config);
1586
1587 void cc_rr_labeler_show (CcRRLabeler *labeler);
1588
1589 void cc_rr_labeler_hide (CcRRLabeler *labeler);
1590
1591-void cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GnomeRROutputInfo *output, GdkRGBA *rgba_out);
1592+void cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GsdRROutputInfo *output, GdkRGBA *rgba_out);
1593
1594 #endif
1595
1596=== modified file 'panels/wacom/cc-wacom-mapping-panel.c'
1597--- panels/wacom/cc-wacom-mapping-panel.c 2012-08-21 16:00:22 +0000
1598+++ panels/wacom/cc-wacom-mapping-panel.c 2014-08-29 10:31:11 +0000
1599@@ -23,9 +23,8 @@
1600
1601 #include <gtk/gtk.h>
1602 #include <glib/gi18n.h>
1603-#define GNOME_DESKTOP_USE_UNSTABLE_API
1604-#include <libgnome-desktop/gnome-rr.h>
1605-#include <libgnome-desktop/gnome-rr-config.h>
1606+#include <libunity-settings-daemon/gsd-rr.h>
1607+#include <libunity-settings-daemon/gsd-rr-config.h>
1608
1609 #include <string.h>
1610
1611@@ -57,17 +56,17 @@
1612 static void checkbutton_toggled_cb (GtkWidget *widget, CcWacomMappingPanel *self);
1613 static void aspectswitch_toggled_cb (GtkWidget *widget, GParamSpec *pspec, CcWacomMappingPanel *self);
1614
1615-static GnomeRROutputInfo**
1616+static GsdRROutputInfo**
1617 get_rr_outputs (void)
1618 {
1619 GError *error = NULL;
1620- GnomeRRScreen *rr_screen;
1621- GnomeRRConfig *rr_config;
1622+ GsdRRScreen *rr_screen;
1623+ GsdRRConfig *rr_config;
1624
1625 /* TODO: Check the value of 'error' */
1626- rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
1627- rr_config = gnome_rr_config_new_current (rr_screen, &error);
1628- return gnome_rr_config_get_outputs (rr_config);
1629+ rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), &error);
1630+ rr_config = gsd_rr_config_new_current (rr_screen, &error);
1631+ return gsd_rr_config_get_outputs (rr_config);
1632 }
1633
1634 static void
1635@@ -91,7 +90,7 @@
1636 update_monitor_chooser (CcWacomMappingPanel *self)
1637 {
1638 GtkListStore *store;
1639- GnomeRROutputInfo **outputs;
1640+ GsdRROutputInfo **outputs;
1641 GdkRectangle geom;
1642 GSettings *settings;
1643 gint monitor;
1644@@ -130,19 +129,19 @@
1645 goto bail;
1646
1647 for (i = 0; outputs[i] != NULL; i++) {
1648- GnomeRROutputInfo *output = outputs[i];
1649+ GsdRROutputInfo *output = outputs[i];
1650
1651- if (gnome_rr_output_info_is_active (output)) {
1652+ if (gsd_rr_output_info_is_active (output)) {
1653 GtkTreeIter iter;
1654 gchar *name, *disp_name, *text;
1655 int x, y, w, h;
1656 int mon_at_point;
1657
1658- name = gnome_rr_output_info_get_name (output);
1659- disp_name = gnome_rr_output_info_get_display_name (output);
1660+ name = gsd_rr_output_info_get_name (output);
1661+ disp_name = gsd_rr_output_info_get_display_name (output);
1662 text = g_strdup_printf ("%s (%s)", name, disp_name);
1663
1664- gnome_rr_output_info_get_geometry (output, &x, &y, &w, &h);
1665+ gsd_rr_output_info_get_geometry (output, &x, &y, &w, &h);
1666 mon_at_point = gdk_screen_get_monitor_at_point (gdk_screen_get_default (), x, y);
1667 gtk_list_store_append (store, &iter);
1668 gtk_list_store_set (store, &iter, MONITOR_NAME_COLUMN, text, MONITOR_NUM_COLUMN, mon_at_point, -1);
1669
1670=== modified file 'panels/wacom/gsd-wacom-device.c'
1671--- panels/wacom/gsd-wacom-device.c 2014-02-19 02:24:52 +0000
1672+++ panels/wacom/gsd-wacom-device.c 2014-08-29 10:31:11 +0000
1673@@ -27,8 +27,7 @@
1674 #include <gdk/gdk.h>
1675 #include <gdk/gdkx.h>
1676 #include <X11/Xatom.h>
1677-#define GNOME_DESKTOP_USE_UNSTABLE_API
1678-#include <libgnome-desktop/gnome-rr.h>
1679+#include <libunity-settings-daemon/gsd-rr.h>
1680
1681 #include <libwacom/libwacom.h>
1682 #include <X11/extensions/XInput.h>
1683@@ -48,14 +47,14 @@
1684 #define WACOM_BUTTON_SCHEMA "org.gnome.settings-daemon.peripherals.wacom.tablet-button"
1685
1686 static struct {
1687- GnomeRRRotation rotation;
1688+ GsdRRRotation rotation;
1689 GsdWacomRotation rotation_wacom;
1690 const gchar *rotation_string;
1691 } rotation_table[] = {
1692- { GNOME_RR_ROTATION_0, GSD_WACOM_ROTATION_NONE, "none" },
1693- { GNOME_RR_ROTATION_90, GSD_WACOM_ROTATION_CCW, "ccw" },
1694- { GNOME_RR_ROTATION_180, GSD_WACOM_ROTATION_HALF, "half" },
1695- { GNOME_RR_ROTATION_270, GSD_WACOM_ROTATION_CW, "cw" }
1696+ { GSD_RR_ROTATION_0, GSD_WACOM_ROTATION_NONE, "none" },
1697+ { GSD_RR_ROTATION_90, GSD_WACOM_ROTATION_CCW, "ccw" },
1698+ { GSD_RR_ROTATION_180, GSD_WACOM_ROTATION_HALF, "half" },
1699+ { GSD_RR_ROTATION_270, GSD_WACOM_ROTATION_CW, "cw" }
1700 };
1701
1702 static WacomDeviceDatabase *db = NULL;
1703@@ -511,14 +510,14 @@
1704
1705 /* Finds an output which matches the given EDID information. Any NULL
1706 * parameter will be interpreted to match any value. */
1707-static GnomeRROutput *
1708-find_output_by_edid (GnomeRRScreen *rr_screen, const gchar *vendor, const gchar *product, const gchar *serial)
1709+static GsdRROutput *
1710+find_output_by_edid (GsdRRScreen *rr_screen, const gchar *vendor, const gchar *product, const gchar *serial)
1711 {
1712- GnomeRROutput **rr_outputs;
1713- GnomeRROutput *retval = NULL;
1714+ GsdRROutput **rr_outputs;
1715+ GsdRROutput *retval = NULL;
1716 guint i;
1717
1718- rr_outputs = gnome_rr_screen_list_outputs (rr_screen);
1719+ rr_outputs = gsd_rr_screen_list_outputs (rr_screen);
1720
1721 for (i = 0; rr_outputs[i] != NULL; i++) {
1722 gchar *o_vendor_s;
1723@@ -528,10 +527,10 @@
1724 int o_serial;
1725 gboolean match;
1726
1727- if (!gnome_rr_output_is_connected (rr_outputs[i]))
1728+ if (!gsd_rr_output_is_connected (rr_outputs[i]))
1729 continue;
1730
1731- if (!gnome_rr_output_get_ids_from_edid (rr_outputs[i],
1732+ if (!gsd_rr_output_get_ids_from_edid (rr_outputs[i],
1733 &o_vendor_s,
1734 &o_product,
1735 &o_serial))
1736@@ -564,19 +563,19 @@
1737 return retval;
1738 }
1739
1740-static GnomeRROutput*
1741-find_builtin_output (GnomeRRScreen *rr_screen)
1742+static GsdRROutput*
1743+find_builtin_output (GsdRRScreen *rr_screen)
1744 {
1745- GnomeRROutput **rr_outputs;
1746- GnomeRROutput *retval = NULL;
1747+ GsdRROutput **rr_outputs;
1748+ GsdRROutput *retval = NULL;
1749 guint i;
1750
1751- rr_outputs = gnome_rr_screen_list_outputs (rr_screen);
1752+ rr_outputs = gsd_rr_screen_list_outputs (rr_screen);
1753 for (i = 0; rr_outputs[i] != NULL; i++) {
1754- if (!gnome_rr_output_is_connected (rr_outputs[i]))
1755+ if (!gsd_rr_output_is_connected (rr_outputs[i]))
1756 continue;
1757
1758- if (gnome_rr_output_is_laptop(rr_outputs[i])) {
1759+ if (gsd_rr_output_is_laptop(rr_outputs[i])) {
1760 retval = rr_outputs[i];
1761 break;
1762 }
1763@@ -588,10 +587,10 @@
1764 return retval;
1765 }
1766
1767-static GnomeRROutput *
1768-find_output_by_heuristic (GnomeRRScreen *rr_screen, GsdWacomDevice *device)
1769+static GsdRROutput *
1770+find_output_by_heuristic (GsdRRScreen *rr_screen, GsdWacomDevice *device)
1771 {
1772- GnomeRROutput *rr_output;
1773+ GsdRROutput *rr_output;
1774
1775 /* TODO: This heuristic will fail for non-Wacom display
1776 * tablets and may give the wrong result if multiple Wacom
1777@@ -605,14 +604,14 @@
1778 return rr_output;
1779 }
1780
1781-static GnomeRROutput *
1782-find_output_by_display (GnomeRRScreen *rr_screen, GsdWacomDevice *device)
1783+static GsdRROutput *
1784+find_output_by_display (GsdRRScreen *rr_screen, GsdWacomDevice *device)
1785 {
1786 gsize n;
1787 GSettings *tablet;
1788 GVariant *display;
1789 const gchar **edid;
1790- GnomeRROutput *ret;
1791+ GsdRROutput *ret;
1792
1793 if (device == NULL)
1794 return NULL;
1795@@ -640,32 +639,32 @@
1796 }
1797
1798 static gboolean
1799-is_on (GnomeRROutput *output)
1800+is_on (GsdRROutput *output)
1801 {
1802- GnomeRRCrtc *crtc;
1803+ GsdRRCrtc *crtc;
1804
1805- crtc = gnome_rr_output_get_crtc (output);
1806+ crtc = gsd_rr_output_get_crtc (output);
1807 if (!crtc)
1808 return FALSE;
1809- return gnome_rr_crtc_get_current_mode (crtc) != NULL;
1810+ return gsd_rr_crtc_get_current_mode (crtc) != NULL;
1811 }
1812
1813-static GnomeRROutput *
1814-find_output_by_monitor (GnomeRRScreen *rr_screen,
1815+static GsdRROutput *
1816+find_output_by_monitor (GsdRRScreen *rr_screen,
1817 GdkScreen *screen,
1818 int monitor)
1819 {
1820- GnomeRROutput **rr_outputs;
1821- GnomeRROutput *ret;
1822+ GsdRROutput **rr_outputs;
1823+ GsdRROutput *ret;
1824 guint i;
1825
1826 ret = NULL;
1827
1828- rr_outputs = gnome_rr_screen_list_outputs (rr_screen);
1829+ rr_outputs = gsd_rr_screen_list_outputs (rr_screen);
1830
1831 for (i = 0; rr_outputs[i] != NULL; i++) {
1832- GnomeRROutput *rr_output;
1833- GnomeRRCrtc *crtc;
1834+ GsdRROutput *rr_output;
1835+ GsdRRCrtc *crtc;
1836 int x, y;
1837
1838 rr_output = rr_outputs[i];
1839@@ -673,11 +672,11 @@
1840 if (!is_on (rr_output))
1841 continue;
1842
1843- crtc = gnome_rr_output_get_crtc (rr_output);
1844+ crtc = gsd_rr_output_get_crtc (rr_output);
1845 if (!crtc)
1846 continue;
1847
1848- gnome_rr_crtc_get_position (crtc, &x, &y);
1849+ gsd_rr_crtc_get_position (crtc, &x, &y);
1850
1851 if (monitor == gdk_screen_get_monitor_at_point (screen, x, y)) {
1852 ret = rr_output;
1853@@ -693,7 +692,7 @@
1854
1855 static void
1856 set_display_by_output (GsdWacomDevice *device,
1857- GnomeRROutput *rr_output)
1858+ GsdRROutput *rr_output)
1859 {
1860 GSettings *tablet;
1861 GVariant *c_array;
1862@@ -712,7 +711,7 @@
1863 }
1864
1865 if (rr_output == NULL ||
1866- !gnome_rr_output_get_ids_from_edid (rr_output,
1867+ !gsd_rr_output_get_ids_from_edid (rr_output,
1868 &o_vendor_s,
1869 &o_product,
1870 &o_serial)) {
1871@@ -736,7 +735,7 @@
1872 }
1873
1874 static GsdWacomRotation
1875-get_rotation_wacom (GnomeRRRotation rotation)
1876+get_rotation_wacom (GsdRRRotation rotation)
1877 {
1878 guint i;
1879
1880@@ -752,14 +751,14 @@
1881 int monitor)
1882 {
1883 GError *error = NULL;
1884- GnomeRRScreen *rr_screen;
1885- GnomeRROutput *output = NULL;
1886+ GsdRRScreen *rr_screen;
1887+ GsdRROutput *output = NULL;
1888
1889 g_return_if_fail (GSD_IS_WACOM_DEVICE (device));
1890
1891- rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
1892+ rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), &error);
1893 if (rr_screen == NULL) {
1894- g_warning ("Failed to create GnomeRRScreen: %s", error->message);
1895+ g_warning ("Failed to create GsdRRScreen: %s", error->message);
1896 g_error_free (error);
1897 return;
1898 }
1899@@ -771,11 +770,11 @@
1900 g_object_unref (rr_screen);
1901 }
1902
1903-static GnomeRROutput *
1904-find_output (GnomeRRScreen *rr_screen,
1905+static GsdRROutput *
1906+find_output (GsdRRScreen *rr_screen,
1907 GsdWacomDevice *device)
1908 {
1909- GnomeRROutput *rr_output;
1910+ GsdRROutput *rr_output;
1911 rr_output = find_output_by_display (rr_screen, device);
1912
1913 if (rr_output == NULL) {
1914@@ -823,17 +822,17 @@
1915 gsd_wacom_device_get_display_monitor (GsdWacomDevice *device)
1916 {
1917 GError *error = NULL;
1918- GnomeRRScreen *rr_screen;
1919- GnomeRROutput *rr_output;
1920- GnomeRRMode *mode;
1921- GnomeRRCrtc *crtc;
1922+ GsdRRScreen *rr_screen;
1923+ GsdRROutput *rr_output;
1924+ GsdRRMode *mode;
1925+ GsdRRCrtc *crtc;
1926 gint area[4];
1927
1928 g_return_val_if_fail (GSD_IS_WACOM_DEVICE (device), GSD_WACOM_SET_ALL_MONITORS);
1929
1930- rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
1931+ rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), &error);
1932 if (rr_screen == NULL) {
1933- g_warning ("Failed to create GnomeRRScreen: %s", error->message);
1934+ g_warning ("Failed to create GsdRRScreen: %s", error->message);
1935 g_error_free (error);
1936 return GSD_WACOM_SET_ALL_MONITORS;
1937 }
1938@@ -850,12 +849,12 @@
1939 return GSD_WACOM_SET_ALL_MONITORS;
1940 }
1941
1942- crtc = gnome_rr_output_get_crtc (rr_output);
1943- gnome_rr_crtc_get_position (crtc, &area[0], &area[1]);
1944+ crtc = gsd_rr_output_get_crtc (rr_output);
1945+ gsd_rr_crtc_get_position (crtc, &area[0], &area[1]);
1946
1947- mode = gnome_rr_crtc_get_current_mode (crtc);
1948- area[2] = gnome_rr_mode_get_width (mode);
1949- area[3] = gnome_rr_mode_get_height (mode);
1950+ mode = gsd_rr_crtc_get_current_mode (crtc);
1951+ area[2] = gsd_rr_mode_get_width (mode);
1952+ area[3] = gsd_rr_mode_get_height (mode);
1953
1954 g_object_unref (rr_screen);
1955
1956@@ -904,22 +903,22 @@
1957 gsd_wacom_device_get_display_rotation (GsdWacomDevice *device)
1958 {
1959 GError *error = NULL;
1960- GnomeRRScreen *rr_screen;
1961- GnomeRROutput *rr_output;
1962- GnomeRRRotation rotation = GNOME_RR_ROTATION_0;
1963+ GsdRRScreen *rr_screen;
1964+ GsdRROutput *rr_output;
1965+ GsdRRRotation rotation = GSD_RR_ROTATION_0;
1966
1967- rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
1968+ rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), &error);
1969 if (rr_screen == NULL) {
1970- g_warning ("Failed to create GnomeRRScreen: %s", error->message);
1971+ g_warning ("Failed to create GsdRRScreen: %s", error->message);
1972 g_error_free (error);
1973 return GSD_WACOM_ROTATION_NONE;
1974 }
1975
1976 rr_output = find_output (rr_screen, device);
1977 if (rr_output) {
1978- GnomeRRCrtc *crtc = gnome_rr_output_get_crtc (rr_output);
1979+ GsdRRCrtc *crtc = gsd_rr_output_get_crtc (rr_output);
1980 if (crtc)
1981- rotation = gnome_rr_crtc_get_current_rotation (crtc);
1982+ rotation = gsd_rr_crtc_get_current_rotation (crtc);
1983 }
1984 g_object_unref (rr_screen);
1985

Subscribers

People subscribed via source and target branches