Merge lp:~darkxst/ubuntu/saucy/gnome-control-center/lp1184812ud into lp:~ubuntu-desktop/gnome-control-center/ubuntu
- Saucy (13.10)
- lp1184812ud
- Merge into ubuntu
Proposed by
Tim Lunn
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 569 | ||||
Proposed branch: | lp:~darkxst/ubuntu/saucy/gnome-control-center/lp1184812ud | ||||
Merge into: | lp:~ubuntu-desktop/gnome-control-center/ubuntu | ||||
Diff against target: |
840 lines (+801/-1) 4 files modified
debian/changelog (+7/-0) debian/control (+2/-1) debian/patches/git_move_rr_labeler.patch (+791/-0) debian/patches/series (+1/-0) |
||||
To merge this branch: | bzr merge lp:~darkxst/ubuntu/saucy/gnome-control-center/lp1184812ud | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeremy Bícha | Approve | ||
Review via email: mp+166011@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2013-05-27 07:53:29 +0000 | |||
3 | +++ debian/changelog 2013-05-28 10:47:25 +0000 | |||
4 | @@ -1,3 +1,10 @@ | |||
5 | 1 | gnome-control-center (1:3.6.3-0ubuntu27) saucy; urgency=low | ||
6 | 2 | |||
7 | 3 | * Rebuild for gnome-desktop 3.8 transition (LP: #1184812) | ||
8 | 4 | - debian/patches/git_move_rr_labeler.patch | ||
9 | 5 | |||
10 | 6 | -- Tim Lunn <tim@feathertop.org> Tue, 28 May 2013 10:23:39 +1000 | ||
11 | 7 | |||
12 | 1 | gnome-control-center (1:3.6.3-0ubuntu26) saucy; urgency=low | 8 | gnome-control-center (1:3.6.3-0ubuntu26) saucy; urgency=low |
13 | 2 | 9 | ||
14 | 3 | * debian/patches/git_no_glxinfo.patch: | 10 | * debian/patches/git_no_glxinfo.patch: |
15 | 4 | 11 | ||
16 | === modified file 'debian/control' | |||
17 | --- debian/control 2013-04-29 17:17:03 +0000 | |||
18 | +++ debian/control 2013-05-28 10:47:25 +0000 | |||
19 | @@ -7,7 +7,7 @@ | |||
20 | 7 | Priority: optional | 7 | Priority: optional |
21 | 8 | Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com> | 8 | Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com> |
22 | 9 | XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> | 9 | XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> |
24 | 10 | Uploaders: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> | 10 | Uploaders: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>, Jeremy Bicha <jbicha@ubuntu.com> |
25 | 11 | Standards-Version: 3.9.3 | 11 | Standards-Version: 3.9.3 |
26 | 12 | Build-Depends: autotools-dev, | 12 | Build-Depends: autotools-dev, |
27 | 13 | cdbs (>= 0.4.41), | 13 | cdbs (>= 0.4.41), |
28 | @@ -81,6 +81,7 @@ | |||
29 | 81 | gsettings-desktop-schemas (>= 3.5.91), | 81 | gsettings-desktop-schemas (>= 3.5.91), |
30 | 82 | Recommends: cups-pk-helper, | 82 | Recommends: cups-pk-helper, |
31 | 83 | gnome-session-bin, | 83 | gnome-session-bin, |
32 | 84 | ubuntu-system-service, | ||
33 | 84 | iso-codes, | 85 | iso-codes, |
34 | 85 | mousetweaks, | 86 | mousetweaks, |
35 | 86 | policykit-1-gnome, | 87 | policykit-1-gnome, |
36 | 87 | 88 | ||
37 | === added file 'debian/patches/git_move_rr_labeler.patch' | |||
38 | --- debian/patches/git_move_rr_labeler.patch 1970-01-01 00:00:00 +0000 | |||
39 | +++ debian/patches/git_move_rr_labeler.patch 2013-05-28 10:47:25 +0000 | |||
40 | @@ -0,0 +1,791 @@ | |||
41 | 1 | From e35a109d299011b800cb085f3d57ad7c012ed6dc Mon Sep 17 00:00:00 2001 | ||
42 | 2 | From: Bastien Nocera <hadess@hadess.net> | ||
43 | 3 | Date: Wed, 21 Nov 2012 21:13:44 +0000 | ||
44 | 4 | Subject: display: Move GnomeRRLabeler here | ||
45 | 5 | |||
46 | 6 | And rename to CcRRLabeler. | ||
47 | 7 | --- | ||
48 | 8 | --- a/panels/display/Makefile.am | ||
49 | 9 | +++ b/panels/display/Makefile.am | ||
50 | 10 | @@ -19,6 +19,8 @@ | ||
51 | 11 | display-module.c \ | ||
52 | 12 | cc-display-panel.c \ | ||
53 | 13 | cc-display-panel.h \ | ||
54 | 14 | + cc-rr-labeler.c \ | ||
55 | 15 | + cc-rr-labeler.h \ | ||
56 | 16 | scrollarea.c \ | ||
57 | 17 | scrollarea.h \ | ||
58 | 18 | $(MARSHALFILES) | ||
59 | 19 | --- a/panels/display/cc-display-panel.c | ||
60 | 20 | +++ b/panels/display/cc-display-panel.c | ||
61 | 21 | @@ -31,12 +31,13 @@ | ||
62 | 22 | #define GNOME_DESKTOP_USE_UNSTABLE_API | ||
63 | 23 | #include <libgnome-desktop/gnome-rr.h> | ||
64 | 24 | #include <libgnome-desktop/gnome-rr-config.h> | ||
65 | 25 | -#include <libgnome-desktop/gnome-rr-labeler.h> | ||
66 | 26 | #include <gdk/gdkx.h> | ||
67 | 27 | #include <X11/Xlib.h> | ||
68 | 28 | #include <glib/gi18n.h> | ||
69 | 29 | #include <gdesktop-enums.h> | ||
70 | 30 | |||
71 | 31 | +#include "cc-rr-labeler.h" | ||
72 | 32 | + | ||
73 | 33 | CC_PANEL_REGISTER (CcDisplayPanel, cc_display_panel) | ||
74 | 34 | |||
75 | 35 | #define DISPLAY_PANEL_PRIVATE(o) \ | ||
76 | 36 | @@ -75,7 +76,7 @@ | ||
77 | 37 | { | ||
78 | 38 | GnomeRRScreen *screen; | ||
79 | 39 | GnomeRRConfig *current_configuration; | ||
80 | 40 | - GnomeRRLabeler *labeler; | ||
81 | 41 | + CcRRLabeler *labeler; | ||
82 | 42 | GnomeRROutputInfo *current_output; | ||
83 | 43 | |||
84 | 44 | GSettings *clock_settings; | ||
85 | 45 | @@ -196,7 +197,7 @@ | ||
86 | 46 | self->priv->focus_id); | ||
87 | 47 | } | ||
88 | 48 | |||
89 | 49 | - gnome_rr_labeler_hide (self->priv->labeler); | ||
90 | 50 | + cc_rr_labeler_hide (self->priv->labeler); | ||
91 | 51 | g_object_unref (self->priv->labeler); | ||
92 | 52 | |||
93 | 53 | G_OBJECT_CLASS (cc_display_panel_parent_class)->finalize (object); | ||
94 | 54 | @@ -289,13 +290,13 @@ | ||
95 | 55 | self->priv->current_output = NULL; | ||
96 | 56 | |||
97 | 57 | if (self->priv->labeler) { | ||
98 | 58 | - gnome_rr_labeler_hide (self->priv->labeler); | ||
99 | 59 | + cc_rr_labeler_hide (self->priv->labeler); | ||
100 | 60 | g_object_unref (self->priv->labeler); | ||
101 | 61 | } | ||
102 | 62 | |||
103 | 63 | - self->priv->labeler = gnome_rr_labeler_new (self->priv->current_configuration); | ||
104 | 64 | + self->priv->labeler = cc_rr_labeler_new (self->priv->current_configuration); | ||
105 | 65 | if (gtk_widget_has_focus (self->priv->panel)) | ||
106 | 66 | - gnome_rr_labeler_show (self->priv->labeler); | ||
107 | 67 | + cc_rr_labeler_show (self->priv->labeler); | ||
108 | 68 | |||
109 | 69 | select_current_output_from_dialog_position (self); | ||
110 | 70 | |||
111 | 71 | @@ -673,7 +674,7 @@ | ||
112 | 72 | tmp = g_strdup (gnome_rr_output_info_get_display_name (self->priv->current_output)); | ||
113 | 73 | |||
114 | 74 | str = g_strdup_printf ("<b>%s</b>", tmp); | ||
115 | 75 | - gnome_rr_labeler_get_rgba_for_output (self->priv->labeler, self->priv->current_output, &color); | ||
116 | 76 | + cc_rr_labeler_get_rgba_for_output (self->priv->labeler, self->priv->current_output, &color); | ||
117 | 77 | use_color = TRUE; | ||
118 | 78 | g_free (tmp); | ||
119 | 79 | } | ||
120 | 80 | @@ -2073,7 +2074,7 @@ | ||
121 | 81 | cairo_rectangle (cr, x, y, w * scale + 0.5, h * scale + 0.5); | ||
122 | 82 | cairo_clip_preserve (cr); | ||
123 | 83 | |||
124 | 84 | - gnome_rr_labeler_get_rgba_for_output (self->priv->labeler, output, &output_color); | ||
125 | 85 | + cc_rr_labeler_get_rgba_for_output (self->priv->labeler, output, &output_color); | ||
126 | 86 | r = output_color.red; | ||
127 | 87 | g = output_color.green; | ||
128 | 88 | b = output_color.blue; | ||
129 | 89 | @@ -2581,9 +2582,9 @@ | ||
130 | 90 | if (self->priv->labeler == NULL) | ||
131 | 91 | return; | ||
132 | 92 | if (gtk_window_has_toplevel_focus (window)) | ||
133 | 93 | - gnome_rr_labeler_show (self->priv->labeler); | ||
134 | 94 | + cc_rr_labeler_show (self->priv->labeler); | ||
135 | 95 | else | ||
136 | 96 | - gnome_rr_labeler_hide (self->priv->labeler); | ||
137 | 97 | + cc_rr_labeler_hide (self->priv->labeler); | ||
138 | 98 | } | ||
139 | 99 | |||
140 | 100 | static void | ||
141 | 101 | @@ -2673,7 +2674,7 @@ | ||
142 | 102 | int monitor_width = 30; | ||
143 | 103 | int monitor_height = 15; | ||
144 | 104 | |||
145 | 105 | - gnome_rr_labeler_get_rgba_for_output (self->priv->labeler, output, &color); | ||
146 | 106 | + cc_rr_labeler_get_rgba_for_output (self->priv->labeler, output, &color); | ||
147 | 107 | |||
148 | 108 | cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, monitor_width, monitor_height); | ||
149 | 109 | cr = cairo_create (cairo_surface); | ||
150 | 110 | --- /dev/null | ||
151 | 111 | +++ b/panels/display/cc-rr-labeler.c | ||
152 | 112 | @@ -0,0 +1,601 @@ | ||
153 | 113 | +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- | ||
154 | 114 | + * | ||
155 | 115 | + * cc-rr-labeler.c - Utility to label monitors to identify them | ||
156 | 116 | + * while they are being configured. | ||
157 | 117 | + * | ||
158 | 118 | + * Copyright 2008, Novell, Inc. | ||
159 | 119 | + * | ||
160 | 120 | + * This file is part of the Gnome Library. | ||
161 | 121 | + * | ||
162 | 122 | + * The Gnome Library is free software; you can redistribute it and/or | ||
163 | 123 | + * modify it under the terms of the GNU Library General Public License as | ||
164 | 124 | + * published by the Free Software Foundation; either version 2 of the | ||
165 | 125 | + * License, or (at your option) any later version. | ||
166 | 126 | + * | ||
167 | 127 | + * The Gnome Library is distributed in the hope that it will be useful, | ||
168 | 128 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
169 | 129 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
170 | 130 | + * Library General Public License for more details. | ||
171 | 131 | + * | ||
172 | 132 | + * You should have received a copy of the GNU Library General Public | ||
173 | 133 | + * License along with the Gnome Library; see the file COPYING.LIB. If not, | ||
174 | 134 | + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
175 | 135 | + * Boston, MA 02110-1301, USA. | ||
176 | 136 | + * | ||
177 | 137 | + * Author: Federico Mena-Quintero <federico@novell.com> | ||
178 | 138 | + */ | ||
179 | 139 | + | ||
180 | 140 | +#include <config.h> | ||
181 | 141 | +#include <glib/gi18n-lib.h> | ||
182 | 142 | +#include <gtk/gtk.h> | ||
183 | 143 | + | ||
184 | 144 | +#include <X11/Xproto.h> | ||
185 | 145 | +#include <X11/Xlib.h> | ||
186 | 146 | +#include <X11/Xutil.h> | ||
187 | 147 | +#include <X11/Xatom.h> | ||
188 | 148 | +#include <gdk/gdkx.h> | ||
189 | 149 | + | ||
190 | 150 | +#include "cc-rr-labeler.h" | ||
191 | 151 | + | ||
192 | 152 | +struct _CcRRLabelerPrivate { | ||
193 | 153 | + GnomeRRConfig *config; | ||
194 | 154 | + | ||
195 | 155 | + int num_outputs; | ||
196 | 156 | + | ||
197 | 157 | + GdkRGBA *palette; | ||
198 | 158 | + GtkWidget **windows; | ||
199 | 159 | + | ||
200 | 160 | + GdkScreen *screen; | ||
201 | 161 | + Atom workarea_atom; | ||
202 | 162 | +}; | ||
203 | 163 | + | ||
204 | 164 | +enum { | ||
205 | 165 | + PROP_0, | ||
206 | 166 | + PROP_CONFIG, | ||
207 | 167 | + PROP_LAST | ||
208 | 168 | +}; | ||
209 | 169 | + | ||
210 | 170 | +G_DEFINE_TYPE (CcRRLabeler, cc_rr_labeler, G_TYPE_OBJECT); | ||
211 | 171 | + | ||
212 | 172 | +static void cc_rr_labeler_finalize (GObject *object); | ||
213 | 173 | +static void setup_from_config (CcRRLabeler *labeler); | ||
214 | 174 | + | ||
215 | 175 | +static GdkFilterReturn | ||
216 | 176 | +screen_xevent_filter (GdkXEvent *xevent, | ||
217 | 177 | + GdkEvent *event, | ||
218 | 178 | + CcRRLabeler *labeler) | ||
219 | 179 | +{ | ||
220 | 180 | + XEvent *xev; | ||
221 | 181 | + | ||
222 | 182 | + xev = (XEvent *) xevent; | ||
223 | 183 | + | ||
224 | 184 | + if (xev->type == PropertyNotify && | ||
225 | 185 | + xev->xproperty.atom == labeler->priv->workarea_atom) { | ||
226 | 186 | + /* update label positions */ | ||
227 | 187 | + if (labeler->priv->windows != NULL) { | ||
228 | 188 | + cc_rr_labeler_hide (labeler); | ||
229 | 189 | + cc_rr_labeler_show (labeler); | ||
230 | 190 | + } | ||
231 | 191 | + } | ||
232 | 192 | + | ||
233 | 193 | + return GDK_FILTER_CONTINUE; | ||
234 | 194 | +} | ||
235 | 195 | + | ||
236 | 196 | +static void | ||
237 | 197 | +cc_rr_labeler_init (CcRRLabeler *labeler) | ||
238 | 198 | +{ | ||
239 | 199 | + GdkWindow *gdkwindow; | ||
240 | 200 | + | ||
241 | 201 | + labeler->priv = G_TYPE_INSTANCE_GET_PRIVATE (labeler, GNOME_TYPE_RR_LABELER, CcRRLabelerPrivate); | ||
242 | 202 | + | ||
243 | 203 | + labeler->priv->workarea_atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), | ||
244 | 204 | + "_NET_WORKAREA", | ||
245 | 205 | + True); | ||
246 | 206 | + | ||
247 | 207 | + labeler->priv->screen = gdk_screen_get_default (); | ||
248 | 208 | + /* code is not really designed to handle multiple screens so *shrug* */ | ||
249 | 209 | + gdkwindow = gdk_screen_get_root_window (labeler->priv->screen); | ||
250 | 210 | + gdk_window_add_filter (gdkwindow, (GdkFilterFunc) screen_xevent_filter, labeler); | ||
251 | 211 | + gdk_window_set_events (gdkwindow, gdk_window_get_events (gdkwindow) | GDK_PROPERTY_CHANGE_MASK); | ||
252 | 212 | +} | ||
253 | 213 | + | ||
254 | 214 | +static void | ||
255 | 215 | +cc_rr_labeler_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *param_spec) | ||
256 | 216 | +{ | ||
257 | 217 | + CcRRLabeler *self = CC_RR_LABELER (gobject); | ||
258 | 218 | + | ||
259 | 219 | + switch (property_id) { | ||
260 | 220 | + case PROP_CONFIG: | ||
261 | 221 | + self->priv->config = GNOME_RR_CONFIG (g_value_dup_object (value)); | ||
262 | 222 | + return; | ||
263 | 223 | + default: | ||
264 | 224 | + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, param_spec); | ||
265 | 225 | + } | ||
266 | 226 | +} | ||
267 | 227 | + | ||
268 | 228 | +static GObject * | ||
269 | 229 | +cc_rr_labeler_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) | ||
270 | 230 | +{ | ||
271 | 231 | + CcRRLabeler *self = (CcRRLabeler*) G_OBJECT_CLASS (cc_rr_labeler_parent_class)->constructor (type, n_construct_properties, construct_properties); | ||
272 | 232 | + | ||
273 | 233 | + setup_from_config (self); | ||
274 | 234 | + | ||
275 | 235 | + return (GObject*) self; | ||
276 | 236 | +} | ||
277 | 237 | + | ||
278 | 238 | +static void | ||
279 | 239 | +cc_rr_labeler_class_init (CcRRLabelerClass *klass) | ||
280 | 240 | +{ | ||
281 | 241 | + GObjectClass *object_class; | ||
282 | 242 | + | ||
283 | 243 | + g_type_class_add_private (klass, sizeof (CcRRLabelerPrivate)); | ||
284 | 244 | + | ||
285 | 245 | + object_class = (GObjectClass *) klass; | ||
286 | 246 | + | ||
287 | 247 | + object_class->set_property = cc_rr_labeler_set_property; | ||
288 | 248 | + object_class->finalize = cc_rr_labeler_finalize; | ||
289 | 249 | + object_class->constructor = cc_rr_labeler_constructor; | ||
290 | 250 | + | ||
291 | 251 | + g_object_class_install_property (object_class, PROP_CONFIG, g_param_spec_object ("config", | ||
292 | 252 | + "Configuration", | ||
293 | 253 | + "RandR configuration to label", | ||
294 | 254 | + GNOME_TYPE_RR_CONFIG, | ||
295 | 255 | + G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | | ||
296 | 256 | + G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); | ||
297 | 257 | +} | ||
298 | 258 | + | ||
299 | 259 | +static void | ||
300 | 260 | +cc_rr_labeler_finalize (GObject *object) | ||
301 | 261 | +{ | ||
302 | 262 | + CcRRLabeler *labeler; | ||
303 | 263 | + GdkWindow *gdkwindow; | ||
304 | 264 | + | ||
305 | 265 | + labeler = CC_RR_LABELER (object); | ||
306 | 266 | + | ||
307 | 267 | + gdkwindow = gdk_screen_get_root_window (labeler->priv->screen); | ||
308 | 268 | + gdk_window_remove_filter (gdkwindow, (GdkFilterFunc) screen_xevent_filter, labeler); | ||
309 | 269 | + | ||
310 | 270 | + if (labeler->priv->config != NULL) { | ||
311 | 271 | + g_object_unref (labeler->priv->config); | ||
312 | 272 | + } | ||
313 | 273 | + | ||
314 | 274 | + if (labeler->priv->windows != NULL) { | ||
315 | 275 | + cc_rr_labeler_hide (labeler); | ||
316 | 276 | + g_free (labeler->priv->windows); | ||
317 | 277 | + } | ||
318 | 278 | + | ||
319 | 279 | + g_free (labeler->priv->palette); | ||
320 | 280 | + | ||
321 | 281 | + G_OBJECT_CLASS (cc_rr_labeler_parent_class)->finalize (object); | ||
322 | 282 | +} | ||
323 | 283 | + | ||
324 | 284 | +static int | ||
325 | 285 | +count_outputs (GnomeRRConfig *config) | ||
326 | 286 | +{ | ||
327 | 287 | + int i; | ||
328 | 288 | + GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (config); | ||
329 | 289 | + | ||
330 | 290 | + for (i = 0; outputs[i] != NULL; i++) | ||
331 | 291 | + ; | ||
332 | 292 | + | ||
333 | 293 | + return i; | ||
334 | 294 | +} | ||
335 | 295 | + | ||
336 | 296 | +static void | ||
337 | 297 | +make_palette (CcRRLabeler *labeler) | ||
338 | 298 | +{ | ||
339 | 299 | + /* The idea is that we go around an hue color wheel. We want to start | ||
340 | 300 | + * at red, go around to green/etc. and stop at blue --- because magenta | ||
341 | 301 | + * is evil. Eeeeek, no magenta, please! | ||
342 | 302 | + * | ||
343 | 303 | + * Purple would be nice, though. Remember that we are watered down | ||
344 | 304 | + * (i.e. low saturation), so that would be like Like berries with cream. | ||
345 | 305 | + * Mmmmm, berries. | ||
346 | 306 | + */ | ||
347 | 307 | + double start_hue; | ||
348 | 308 | + double end_hue; | ||
349 | 309 | + int i; | ||
350 | 310 | + | ||
351 | 311 | + g_assert (labeler->priv->num_outputs > 0); | ||
352 | 312 | + | ||
353 | 313 | + labeler->priv->palette = g_new (GdkRGBA, labeler->priv->num_outputs); | ||
354 | 314 | + | ||
355 | 315 | + start_hue = 0.0; /* red */ | ||
356 | 316 | + end_hue = 2.0/3; /* blue */ | ||
357 | 317 | + | ||
358 | 318 | + for (i = 0; i < labeler->priv->num_outputs; i++) { | ||
359 | 319 | + double h, s, v; | ||
360 | 320 | + double r, g, b; | ||
361 | 321 | + | ||
362 | 322 | + h = start_hue + (end_hue - start_hue) / labeler->priv->num_outputs * i; | ||
363 | 323 | + s = 1.0 / 3; | ||
364 | 324 | + v = 1.0; | ||
365 | 325 | + | ||
366 | 326 | + gtk_hsv_to_rgb (h, s, v, &r, &g, &b); | ||
367 | 327 | + | ||
368 | 328 | + labeler->priv->palette[i].red = r; | ||
369 | 329 | + labeler->priv->palette[i].green = g; | ||
370 | 330 | + labeler->priv->palette[i].blue = b; | ||
371 | 331 | + labeler->priv->palette[i].alpha = 1.0; | ||
372 | 332 | + } | ||
373 | 333 | +} | ||
374 | 334 | + | ||
375 | 335 | +static void | ||
376 | 336 | +rounded_rectangle (cairo_t *cr, | ||
377 | 337 | + gint x, | ||
378 | 338 | + gint y, | ||
379 | 339 | + gint width, | ||
380 | 340 | + gint height, | ||
381 | 341 | + gint x_radius, | ||
382 | 342 | + gint y_radius) | ||
383 | 343 | +{ | ||
384 | 344 | + gint x1, x2; | ||
385 | 345 | + gint y1, y2; | ||
386 | 346 | + gint xr1, xr2; | ||
387 | 347 | + gint yr1, yr2; | ||
388 | 348 | + | ||
389 | 349 | + x1 = x; | ||
390 | 350 | + x2 = x1 + width; | ||
391 | 351 | + y1 = y; | ||
392 | 352 | + y2 = y1 + height; | ||
393 | 353 | + | ||
394 | 354 | + x_radius = MIN (x_radius, width / 2.0); | ||
395 | 355 | + y_radius = MIN (y_radius, width / 2.0); | ||
396 | 356 | + | ||
397 | 357 | + xr1 = x_radius; | ||
398 | 358 | + xr2 = x_radius / 2.0; | ||
399 | 359 | + yr1 = y_radius; | ||
400 | 360 | + yr2 = y_radius / 2.0; | ||
401 | 361 | + | ||
402 | 362 | + cairo_move_to (cr, x1 + xr1, y1); | ||
403 | 363 | + cairo_line_to (cr, x2 - xr1, y1); | ||
404 | 364 | + cairo_curve_to (cr, x2 - xr2, y1, x2, y1 + yr2, x2, y1 + yr1); | ||
405 | 365 | + cairo_line_to (cr, x2, y2 - yr1); | ||
406 | 366 | + cairo_curve_to (cr, x2, y2 - yr2, x2 - xr2, y2, x2 - xr1, y2); | ||
407 | 367 | + cairo_line_to (cr, x1 + xr1, y2); | ||
408 | 368 | + cairo_curve_to (cr, x1 + xr2, y2, x1, y2 - yr2, x1, y2 - yr1); | ||
409 | 369 | + cairo_line_to (cr, x1, y1 + yr1); | ||
410 | 370 | + cairo_curve_to (cr, x1, y1 + yr2, x1 + xr2, y1, x1 + xr1, y1); | ||
411 | 371 | + cairo_close_path (cr); | ||
412 | 372 | +} | ||
413 | 373 | + | ||
414 | 374 | +#define LABEL_WINDOW_EDGE_THICKNESS 2 | ||
415 | 375 | +#define LABEL_WINDOW_PADDING 12 | ||
416 | 376 | +/* Look for panel-corner in: | ||
417 | 377 | + * http://git.gnome.org/browse/gnome-shell/tree/data/theme/gnome-shell.css | ||
418 | 378 | + * to match the corner radius */ | ||
419 | 379 | +#define LABEL_CORNER_RADIUS 6 + LABEL_WINDOW_EDGE_THICKNESS | ||
420 | 380 | + | ||
421 | 381 | +static void | ||
422 | 382 | +label_draw_background_and_frame (GtkWidget *widget, cairo_t *cr, gboolean for_shape) | ||
423 | 383 | +{ | ||
424 | 384 | + GdkRGBA shape_color = { 0, 0, 0, 1 }; | ||
425 | 385 | + GdkRGBA *rgba; | ||
426 | 386 | + GtkAllocation allocation; | ||
427 | 387 | + | ||
428 | 388 | + rgba = g_object_get_data (G_OBJECT (widget), "rgba"); | ||
429 | 389 | + gtk_widget_get_allocation (widget, &allocation); | ||
430 | 390 | + | ||
431 | 391 | + cairo_save (cr); | ||
432 | 392 | + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); | ||
433 | 393 | + | ||
434 | 394 | + /* edge outline */ | ||
435 | 395 | + if (for_shape) | ||
436 | 396 | + gdk_cairo_set_source_rgba (cr, &shape_color); | ||
437 | 397 | + else | ||
438 | 398 | + cairo_set_source_rgba (cr, 0, 0, 0, 0.5); | ||
439 | 399 | + | ||
440 | 400 | + rounded_rectangle (cr, | ||
441 | 401 | + LABEL_WINDOW_EDGE_THICKNESS / 2.0, | ||
442 | 402 | + LABEL_WINDOW_EDGE_THICKNESS / 2.0, | ||
443 | 403 | + allocation.width - LABEL_WINDOW_EDGE_THICKNESS, | ||
444 | 404 | + allocation.height - LABEL_WINDOW_EDGE_THICKNESS, | ||
445 | 405 | + LABEL_CORNER_RADIUS, LABEL_CORNER_RADIUS); | ||
446 | 406 | + cairo_set_line_width (cr, LABEL_WINDOW_EDGE_THICKNESS); | ||
447 | 407 | + cairo_stroke (cr); | ||
448 | 408 | + | ||
449 | 409 | + /* fill */ | ||
450 | 410 | + if (for_shape) { | ||
451 | 411 | + gdk_cairo_set_source_rgba (cr, &shape_color); | ||
452 | 412 | + } else { | ||
453 | 413 | + rgba->alpha = 0.75; | ||
454 | 414 | + gdk_cairo_set_source_rgba (cr, rgba); | ||
455 | 415 | + } | ||
456 | 416 | + | ||
457 | 417 | + rounded_rectangle (cr, | ||
458 | 418 | + LABEL_WINDOW_EDGE_THICKNESS, | ||
459 | 419 | + LABEL_WINDOW_EDGE_THICKNESS, | ||
460 | 420 | + allocation.width - LABEL_WINDOW_EDGE_THICKNESS * 2, | ||
461 | 421 | + allocation.height - LABEL_WINDOW_EDGE_THICKNESS * 2, | ||
462 | 422 | + LABEL_CORNER_RADIUS - LABEL_WINDOW_EDGE_THICKNESS / 2.0, | ||
463 | 423 | + LABEL_CORNER_RADIUS - LABEL_WINDOW_EDGE_THICKNESS / 2.0); | ||
464 | 424 | + cairo_fill (cr); | ||
465 | 425 | + | ||
466 | 426 | + cairo_restore (cr); | ||
467 | 427 | +} | ||
468 | 428 | + | ||
469 | 429 | +static void | ||
470 | 430 | +maybe_update_shape (GtkWidget *widget) | ||
471 | 431 | +{ | ||
472 | 432 | + cairo_t *cr; | ||
473 | 433 | + cairo_surface_t *surface; | ||
474 | 434 | + cairo_region_t *region; | ||
475 | 435 | + | ||
476 | 436 | + /* fallback to XShape only for non-composited clients */ | ||
477 | 437 | + if (gtk_widget_is_composited (widget)) { | ||
478 | 438 | + gtk_widget_shape_combine_region (widget, NULL); | ||
479 | 439 | + return; | ||
480 | 440 | + } | ||
481 | 441 | + | ||
482 | 442 | + surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget), | ||
483 | 443 | + CAIRO_CONTENT_COLOR_ALPHA, | ||
484 | 444 | + gtk_widget_get_allocated_width (widget), | ||
485 | 445 | + gtk_widget_get_allocated_height (widget)); | ||
486 | 446 | + | ||
487 | 447 | + cr = cairo_create (surface); | ||
488 | 448 | + label_draw_background_and_frame (widget, cr, TRUE); | ||
489 | 449 | + cairo_destroy (cr); | ||
490 | 450 | + | ||
491 | 451 | + region = gdk_cairo_region_create_from_surface (surface); | ||
492 | 452 | + gtk_widget_shape_combine_region (widget, region); | ||
493 | 453 | + | ||
494 | 454 | + cairo_surface_destroy (surface); | ||
495 | 455 | + cairo_region_destroy (region); | ||
496 | 456 | +} | ||
497 | 457 | + | ||
498 | 458 | +static gboolean | ||
499 | 459 | +label_window_draw_event_cb (GtkWidget *widget, cairo_t *cr, gpointer data) | ||
500 | 460 | +{ | ||
501 | 461 | + if (gtk_widget_is_composited (widget)) { | ||
502 | 462 | + /* clear any content */ | ||
503 | 463 | + cairo_save (cr); | ||
504 | 464 | + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); | ||
505 | 465 | + cairo_set_source_rgba (cr, 0, 0, 0, 0); | ||
506 | 466 | + cairo_paint (cr); | ||
507 | 467 | + cairo_restore (cr); | ||
508 | 468 | + } | ||
509 | 469 | + | ||
510 | 470 | + maybe_update_shape (widget); | ||
511 | 471 | + label_draw_background_and_frame (widget, cr, FALSE); | ||
512 | 472 | + | ||
513 | 473 | + return FALSE; | ||
514 | 474 | +} | ||
515 | 475 | + | ||
516 | 476 | +static void | ||
517 | 477 | +position_window (CcRRLabeler *labeler, | ||
518 | 478 | + GtkWidget *window, | ||
519 | 479 | + int x, | ||
520 | 480 | + int y) | ||
521 | 481 | +{ | ||
522 | 482 | + GdkRectangle workarea; | ||
523 | 483 | + GdkRectangle monitor; | ||
524 | 484 | + int monitor_num; | ||
525 | 485 | + | ||
526 | 486 | + monitor_num = gdk_screen_get_monitor_at_point (labeler->priv->screen, x, y); | ||
527 | 487 | + gdk_screen_get_monitor_workarea (labeler->priv->screen, monitor_num, &workarea); | ||
528 | 488 | + gdk_screen_get_monitor_geometry (labeler->priv->screen, | ||
529 | 489 | + monitor_num, | ||
530 | 490 | + &monitor); | ||
531 | 491 | + gdk_rectangle_intersect (&monitor, &workarea, &workarea); | ||
532 | 492 | + | ||
533 | 493 | + gtk_window_move (GTK_WINDOW (window), workarea.x, workarea.y); | ||
534 | 494 | +} | ||
535 | 495 | + | ||
536 | 496 | +static void | ||
537 | 497 | +label_window_realize_cb (GtkWidget *widget) | ||
538 | 498 | +{ | ||
539 | 499 | + cairo_region_t *region; | ||
540 | 500 | + | ||
541 | 501 | + /* make the whole window ignore events */ | ||
542 | 502 | + region = cairo_region_create (); | ||
543 | 503 | + gtk_widget_input_shape_combine_region (widget, region); | ||
544 | 504 | + cairo_region_destroy (region); | ||
545 | 505 | + | ||
546 | 506 | + maybe_update_shape (widget); | ||
547 | 507 | +} | ||
548 | 508 | + | ||
549 | 509 | +static void | ||
550 | 510 | +label_window_composited_changed_cb (GtkWidget *widget, CcRRLabeler *labeler) | ||
551 | 511 | +{ | ||
552 | 512 | + if (gtk_widget_get_realized (widget)) | ||
553 | 513 | + maybe_update_shape (widget); | ||
554 | 514 | +} | ||
555 | 515 | + | ||
556 | 516 | +static GtkWidget * | ||
557 | 517 | +create_label_window (CcRRLabeler *labeler, GnomeRROutputInfo *output, GdkRGBA *rgba) | ||
558 | 518 | +{ | ||
559 | 519 | + GtkWidget *window; | ||
560 | 520 | + GtkWidget *widget; | ||
561 | 521 | + char *str; | ||
562 | 522 | + const char *display_name; | ||
563 | 523 | + GdkRGBA black = { 0, 0, 0, 1.0 }; | ||
564 | 524 | + int x, y; | ||
565 | 525 | + GdkScreen *screen; | ||
566 | 526 | + GdkVisual *visual; | ||
567 | 527 | + | ||
568 | 528 | + window = gtk_window_new (GTK_WINDOW_POPUP); | ||
569 | 529 | + gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_TOOLTIP); | ||
570 | 530 | + gtk_window_set_resizable (GTK_WINDOW (window), FALSE); | ||
571 | 531 | + gtk_widget_set_app_paintable (window, TRUE); | ||
572 | 532 | + screen = gtk_widget_get_screen (window); | ||
573 | 533 | + visual = gdk_screen_get_rgba_visual (screen); | ||
574 | 534 | + | ||
575 | 535 | + if (visual != NULL) | ||
576 | 536 | + gtk_widget_set_visual (window, visual); | ||
577 | 537 | + | ||
578 | 538 | + gtk_container_set_border_width (GTK_CONTAINER (window), LABEL_WINDOW_PADDING + LABEL_WINDOW_EDGE_THICKNESS); | ||
579 | 539 | + | ||
580 | 540 | + /* This is semi-dangerous. The color is part of the labeler->palette | ||
581 | 541 | + * array. Note that in cc_rr_labeler_finalize(), we are careful to | ||
582 | 542 | + * free the palette only after we free the windows. | ||
583 | 543 | + */ | ||
584 | 544 | + g_object_set_data (G_OBJECT (window), "rgba", rgba); | ||
585 | 545 | + | ||
586 | 546 | + g_signal_connect (window, "draw", | ||
587 | 547 | + G_CALLBACK (label_window_draw_event_cb), labeler); | ||
588 | 548 | + g_signal_connect (window, "realize", | ||
589 | 549 | + G_CALLBACK (label_window_realize_cb), labeler); | ||
590 | 550 | + g_signal_connect (window, "composited-changed", | ||
591 | 551 | + G_CALLBACK (label_window_composited_changed_cb), labeler); | ||
592 | 552 | + | ||
593 | 553 | + if (gnome_rr_config_get_clone (labeler->priv->config)) { | ||
594 | 554 | + /* Keep this string in sync with gnome-control-center/capplets/display/xrandr-capplet.c:get_display_name() */ | ||
595 | 555 | + | ||
596 | 556 | + /* Translators: this is the feature where what you see on your | ||
597 | 557 | + * laptop's screen is the same as your external projector. | ||
598 | 558 | + * Here, "Mirrored" is being used as an adjective. For example, | ||
599 | 559 | + * the Spanish translation could be "Pantallas en Espejo". | ||
600 | 560 | + */ | ||
601 | 561 | + display_name = _("Mirrored Displays"); | ||
602 | 562 | + } else | ||
603 | 563 | + display_name = gnome_rr_output_info_get_display_name (output); | ||
604 | 564 | + | ||
605 | 565 | + str = g_strdup_printf ("<b>%s</b>", display_name); | ||
606 | 566 | + widget = gtk_label_new (NULL); | ||
607 | 567 | + gtk_label_set_markup (GTK_LABEL (widget), str); | ||
608 | 568 | + g_free (str); | ||
609 | 569 | + | ||
610 | 570 | + /* Make the label explicitly black. We don't want it to follow the | ||
611 | 571 | + * theme's colors, since the label is always shown against a light | ||
612 | 572 | + * pastel background. See bgo#556050 | ||
613 | 573 | + */ | ||
614 | 574 | + gtk_widget_override_color (widget, | ||
615 | 575 | + gtk_widget_get_state_flags (widget), | ||
616 | 576 | + &black); | ||
617 | 577 | + | ||
618 | 578 | + gtk_container_add (GTK_CONTAINER (window), widget); | ||
619 | 579 | + | ||
620 | 580 | + /* Should we center this at the top edge of the monitor, instead of using the upper-left corner? */ | ||
621 | 581 | + gnome_rr_output_info_get_geometry (output, &x, &y, NULL, NULL); | ||
622 | 582 | + position_window (labeler, window, x, y); | ||
623 | 583 | + | ||
624 | 584 | + gtk_widget_show_all (window); | ||
625 | 585 | + | ||
626 | 586 | + return window; | ||
627 | 587 | +} | ||
628 | 588 | + | ||
629 | 589 | +static void | ||
630 | 590 | +setup_from_config (CcRRLabeler *labeler) | ||
631 | 591 | +{ | ||
632 | 592 | + labeler->priv->num_outputs = count_outputs (labeler->priv->config); | ||
633 | 593 | + | ||
634 | 594 | + make_palette (labeler); | ||
635 | 595 | + | ||
636 | 596 | + cc_rr_labeler_show (labeler); | ||
637 | 597 | +} | ||
638 | 598 | + | ||
639 | 599 | +/** | ||
640 | 600 | + * cc_rr_labeler_new: | ||
641 | 601 | + * @config: Configuration of the screens to label | ||
642 | 602 | + * | ||
643 | 603 | + * Create a GUI element that will display colored labels on each connected monitor. | ||
644 | 604 | + * This is useful when users are required to identify which monitor is which, e.g. for | ||
645 | 605 | + * for configuring multiple monitors. | ||
646 | 606 | + * The labels will be shown by default, use cc_rr_labeler_hide to hide them. | ||
647 | 607 | + * | ||
648 | 608 | + * Returns: A new #CcRRLabeler | ||
649 | 609 | + */ | ||
650 | 610 | +CcRRLabeler * | ||
651 | 611 | +cc_rr_labeler_new (GnomeRRConfig *config) | ||
652 | 612 | +{ | ||
653 | 613 | + g_return_val_if_fail (GNOME_IS_RR_CONFIG (config), NULL); | ||
654 | 614 | + | ||
655 | 615 | + return g_object_new (GNOME_TYPE_RR_LABELER, "config", config, NULL); | ||
656 | 616 | +} | ||
657 | 617 | + | ||
658 | 618 | +/** | ||
659 | 619 | + * cc_rr_labeler_show: | ||
660 | 620 | + * @labeler: A #CcRRLabeler | ||
661 | 621 | + * | ||
662 | 622 | + * Show the labels. | ||
663 | 623 | + */ | ||
664 | 624 | +void | ||
665 | 625 | +cc_rr_labeler_show (CcRRLabeler *labeler) | ||
666 | 626 | +{ | ||
667 | 627 | + int i; | ||
668 | 628 | + gboolean created_window_for_clone; | ||
669 | 629 | + GnomeRROutputInfo **outputs; | ||
670 | 630 | + | ||
671 | 631 | + g_return_if_fail (GNOME_IS_RR_LABELER (labeler)); | ||
672 | 632 | + | ||
673 | 633 | + if (labeler->priv->windows != NULL) | ||
674 | 634 | + return; | ||
675 | 635 | + | ||
676 | 636 | + labeler->priv->windows = g_new (GtkWidget *, labeler->priv->num_outputs); | ||
677 | 637 | + | ||
678 | 638 | + created_window_for_clone = FALSE; | ||
679 | 639 | + | ||
680 | 640 | + outputs = gnome_rr_config_get_outputs (labeler->priv->config); | ||
681 | 641 | + | ||
682 | 642 | + for (i = 0; i < labeler->priv->num_outputs; i++) { | ||
683 | 643 | + if (!created_window_for_clone && gnome_rr_output_info_is_active (outputs[i])) { | ||
684 | 644 | + labeler->priv->windows[i] = create_label_window (labeler, outputs[i], labeler->priv->palette + i); | ||
685 | 645 | + | ||
686 | 646 | + if (gnome_rr_config_get_clone (labeler->priv->config)) | ||
687 | 647 | + created_window_for_clone = TRUE; | ||
688 | 648 | + } else | ||
689 | 649 | + labeler->priv->windows[i] = NULL; | ||
690 | 650 | + } | ||
691 | 651 | +} | ||
692 | 652 | + | ||
693 | 653 | +/** | ||
694 | 654 | + * cc_rr_labeler_hide: | ||
695 | 655 | + * @labeler: A #CcRRLabeler | ||
696 | 656 | + * | ||
697 | 657 | + * Hide ouput labels. | ||
698 | 658 | + */ | ||
699 | 659 | +void | ||
700 | 660 | +cc_rr_labeler_hide (CcRRLabeler *labeler) | ||
701 | 661 | +{ | ||
702 | 662 | + int i; | ||
703 | 663 | + CcRRLabelerPrivate *priv; | ||
704 | 664 | + | ||
705 | 665 | + g_return_if_fail (GNOME_IS_RR_LABELER (labeler)); | ||
706 | 666 | + | ||
707 | 667 | + priv = labeler->priv; | ||
708 | 668 | + | ||
709 | 669 | + if (priv->windows == NULL) | ||
710 | 670 | + return; | ||
711 | 671 | + | ||
712 | 672 | + for (i = 0; i < priv->num_outputs; i++) | ||
713 | 673 | + if (priv->windows[i] != NULL) { | ||
714 | 674 | + gtk_widget_destroy (priv->windows[i]); | ||
715 | 675 | + priv->windows[i] = NULL; | ||
716 | 676 | + } | ||
717 | 677 | + g_free (priv->windows); | ||
718 | 678 | + priv->windows = NULL; | ||
719 | 679 | +} | ||
720 | 680 | + | ||
721 | 681 | +/** | ||
722 | 682 | + * cc_rr_labeler_get_rgba_for_output: | ||
723 | 683 | + * @labeler: A #CcRRLabeler | ||
724 | 684 | + * @output: Output device (i.e. monitor) to query | ||
725 | 685 | + * @rgba_out: (out): Color of selected monitor. | ||
726 | 686 | + * | ||
727 | 687 | + * Get the color used for the label on a given output (monitor). | ||
728 | 688 | + */ | ||
729 | 689 | +void | ||
730 | 690 | +cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GnomeRROutputInfo *output, GdkRGBA *rgba_out) | ||
731 | 691 | +{ | ||
732 | 692 | + int i; | ||
733 | 693 | + GnomeRROutputInfo **outputs; | ||
734 | 694 | + | ||
735 | 695 | + g_return_if_fail (GNOME_IS_RR_LABELER (labeler)); | ||
736 | 696 | + g_return_if_fail (GNOME_IS_RR_OUTPUT_INFO (output)); | ||
737 | 697 | + g_return_if_fail (rgba_out != NULL); | ||
738 | 698 | + | ||
739 | 699 | + outputs = gnome_rr_config_get_outputs (labeler->priv->config); | ||
740 | 700 | + | ||
741 | 701 | + for (i = 0; i < labeler->priv->num_outputs; i++) | ||
742 | 702 | + if (outputs[i] == output) { | ||
743 | 703 | + *rgba_out = labeler->priv->palette[i]; | ||
744 | 704 | + return; | ||
745 | 705 | + } | ||
746 | 706 | + | ||
747 | 707 | + g_warning ("trying to get the color for unknown GnomeOutputInfo %p; returning magenta!", output); | ||
748 | 708 | + | ||
749 | 709 | + rgba_out->red = 1.0; | ||
750 | 710 | + rgba_out->green = 0; | ||
751 | 711 | + rgba_out->blue = 1.0; | ||
752 | 712 | + rgba_out->alpha = 1.0; | ||
753 | 713 | +} | ||
754 | 714 | --- /dev/null | ||
755 | 715 | +++ b/panels/display/cc-rr-labeler.h | ||
756 | 716 | @@ -0,0 +1,64 @@ | ||
757 | 717 | +/* gnome-rr-labeler.h - Utility to label monitors to identify them | ||
758 | 718 | + * while they are being configured. | ||
759 | 719 | + * | ||
760 | 720 | + * Copyright 2008, Novell, Inc. | ||
761 | 721 | + * | ||
762 | 722 | + * This file is part of the Gnome Library. | ||
763 | 723 | + * | ||
764 | 724 | + * The Gnome Library is free software; you can redistribute it and/or | ||
765 | 725 | + * modify it under the terms of the GNU Library General Public License as | ||
766 | 726 | + * published by the Free Software Foundation; either version 2 of the | ||
767 | 727 | + * License, or (at your option) any later version. | ||
768 | 728 | + * | ||
769 | 729 | + * The Gnome Library is distributed in the hope that it will be useful, | ||
770 | 730 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
771 | 731 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
772 | 732 | + * Library General Public License for more details. | ||
773 | 733 | + * | ||
774 | 734 | + * You should have received a copy of the GNU Library General Public | ||
775 | 735 | + * License along with the Gnome Library; see the file COPYING.LIB. If not, | ||
776 | 736 | + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
777 | 737 | + * Boston, MA 02110-1301, USA. | ||
778 | 738 | + * | ||
779 | 739 | + * Author: Federico Mena-Quintero <federico@novell.com> | ||
780 | 740 | + */ | ||
781 | 741 | + | ||
782 | 742 | +#ifndef CC_RR_LABELER_H | ||
783 | 743 | +#define CC_RR_LABELER_H | ||
784 | 744 | + | ||
785 | 745 | +#define GNOME_DESKTOP_USE_UNSTABLE_API | ||
786 | 746 | +#include <libgnome-desktop/gnome-rr-config.h> | ||
787 | 747 | + | ||
788 | 748 | +#define GNOME_TYPE_RR_LABELER (cc_rr_labeler_get_type ()) | ||
789 | 749 | +#define CC_RR_LABELER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_RR_LABELER, CcRRLabeler)) | ||
790 | 750 | +#define CC_RR_LABELER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_RR_LABELER, CcRRLabelerClass)) | ||
791 | 751 | +#define GNOME_IS_RR_LABELER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_RR_LABELER)) | ||
792 | 752 | +#define GNOME_IS_RR_LABELER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_RR_LABELER)) | ||
793 | 753 | +#define CC_RR_LABELER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_RR_LABELER, CcRRLabelerClass)) | ||
794 | 754 | + | ||
795 | 755 | +typedef struct _CcRRLabeler CcRRLabeler; | ||
796 | 756 | +typedef struct _CcRRLabelerClass CcRRLabelerClass; | ||
797 | 757 | +typedef struct _CcRRLabelerPrivate CcRRLabelerPrivate; | ||
798 | 758 | + | ||
799 | 759 | +struct _CcRRLabeler { | ||
800 | 760 | + GObject parent; | ||
801 | 761 | + | ||
802 | 762 | + /*< private >*/ | ||
803 | 763 | + CcRRLabelerPrivate *priv; | ||
804 | 764 | +}; | ||
805 | 765 | + | ||
806 | 766 | +struct _CcRRLabelerClass { | ||
807 | 767 | + GObjectClass parent_class; | ||
808 | 768 | +}; | ||
809 | 769 | + | ||
810 | 770 | +GType cc_rr_labeler_get_type (void); | ||
811 | 771 | + | ||
812 | 772 | +CcRRLabeler *cc_rr_labeler_new (GnomeRRConfig *config); | ||
813 | 773 | + | ||
814 | 774 | +void cc_rr_labeler_show (CcRRLabeler *labeler); | ||
815 | 775 | + | ||
816 | 776 | +void cc_rr_labeler_hide (CcRRLabeler *labeler); | ||
817 | 777 | + | ||
818 | 778 | +void cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GnomeRROutputInfo *output, GdkRGBA *rgba_out); | ||
819 | 779 | + | ||
820 | 780 | +#endif | ||
821 | 781 | --- a/configure.ac | ||
822 | 782 | +++ b/configure.ac | ||
823 | 783 | @@ -119,7 +119,7 @@ | ||
824 | 784 | gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION | ||
825 | 785 | polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION | ||
826 | 786 | gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED_VERSION) | ||
827 | 787 | -PKG_CHECK_MODULES(DISPLAY_PANEL, $COMMON_MODULES gnome-desktop-3.0 >= 3.1.0) | ||
828 | 788 | +PKG_CHECK_MODULES(DISPLAY_PANEL, $COMMON_MODULES gnome-desktop-3.0 >= 3.1.0 x11) | ||
829 | 789 | PKG_CHECK_MODULES(INFO_PANEL, $COMMON_MODULES libgtop-2.0 gl x11 | ||
830 | 790 | polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION webkitgtk-3.0) | ||
831 | 791 | PKG_CHECK_MODULES(KEYBOARD_PANEL, $COMMON_MODULES x11) | ||
832 | 0 | 792 | ||
833 | === modified file 'debian/patches/series' | |||
834 | --- debian/patches/series 2013-04-16 14:27:14 +0000 | |||
835 | +++ debian/patches/series 2013-05-28 10:47:25 +0000 | |||
836 | @@ -36,3 +36,4 @@ | |||
837 | 36 | git_no_glxinfo.patch | 36 | git_no_glxinfo.patch |
838 | 37 | unity_notice_info.patch | 37 | unity_notice_info.patch |
839 | 38 | 38 | ||
840 | 39 | git_move_rr_labeler.patch |
Thanks! Uploaded.