Merge lp:~unity-team/unity/unity.fix-594232 into lp:unity

Proposed by Mirco Müller
Status: Merged
Merged at revision: 375
Proposed branch: lp:~unity-team/unity/unity.fix-594232
Merge into: lp:unity
Diff against target: 794 lines (+621/-88)
5 files modified
configure.ac (+2/-0)
unity-private/Makefile.am (+2/-0)
unity-private/testing/background.vala (+373/-87)
vapi/Makefile.am (+2/-1)
vapi/gnome-bg-2.0.vapi (+242/-0)
To merge this branch: bzr merge lp:~unity-team/unity/unity.fix-594232
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+29959@code.launchpad.net

Description of the change

This branch monitors GNOME's desktop-background settings (wallpaper and gradient). Upon startup of unity the correct image or gradient (or solid color) is rendered. Changes to those settings after unity was started are also taken into account.

Remaining features to be implemented are filed as bugs LP: #605788 (support all picture-options) and LP: #605442 (wallpaper-slideshows).

To post a comment you must log in.
Neil J. Patel (njpatel) wrote :

Nice stuff!

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 2010-07-13 15:04:53 +0000
3+++ configure.ac 2010-07-15 08:32:44 +0000
4@@ -105,8 +105,10 @@
5 gio-2.0 >= $GTK_REQUIRED
6 gee-1.0
7 gconf-2.0
8+ gnome-desktop-2.0
9 indicator
10 libbamf >= 0.2
11+ libgnomeui-2.0
12 unique-1.0
13 unity-misc
14 x11)
15
16=== modified file 'unity-private/Makefile.am'
17--- unity-private/Makefile.am 2010-06-21 10:10:30 +0000
18+++ unity-private/Makefile.am 2010-07-15 08:32:44 +0000
19@@ -22,6 +22,7 @@
20 -DINDICATORICONSDIR=\""$(INDICATORICONSDIR)"\" \
21 -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
22 -DG_LOG_DOMAIN=\"libunity-private\" \
23+ -DGNOME_DESKTOP_USE_UNSTABLE_API \
24 $(BASE_CFLAGS) \
25 $(MAINTAINER_CFLAGS) \
26 -I$(top_srcdir)/unity/ \
27@@ -51,6 +52,7 @@
28 --pkg gee-1.0 \
29 --pkg gio-unix-2.0 \
30 --pkg gtk+-2.0 \
31+ --pkg gnome-bg-2.0 \
32 --pkg indicator \
33 --pkg Bamf-0.2 \
34 --pkg libwnck-1.0 \
35
36=== modified file 'unity-private/testing/background.vala'
37--- unity-private/testing/background.vala 2010-04-07 15:39:23 +0000
38+++ unity-private/testing/background.vala 2010-07-15 08:32:44 +0000
39@@ -15,115 +15,219 @@
40 *
41 * Authored by Neil Jagdish Patel <neil.patel@canonical.com>
42 *
43+ * FIXME: wallpaper-slideshows are not yet supported by this class
44 */
45
46 namespace Unity.Testing
47 {
48 public class Background : Ctk.Bin
49 {
50- /* Gnome Desktop background gconf keys */
51- private string BG_DIR = "/desktop/gnome/background";
52- private string BG_FILE = "/desktop/gnome/background/picture_filename";
53- private string BG_OPTION = "/desktop/gnome/background/picture_options";
54-
55+ private string BG_DIR = "/desktop/gnome/background";
56+ private string BG_PIC_OPTS = "/desktop/gnome/background/picture_options";
57+ private string BG_SHADE_TYPE = "/desktop/gnome/background/color_shading_type";
58+ private string BG_PRIM_COL = "/desktop/gnome/background/primary_color";
59+ private string BG_SEC_COL = "/desktop/gnome/background/secondary_color";
60+ private string BG_FILENAME = "/desktop/gnome/background/picture_filename";
61+
62+ private string DEFAULT_PIC_OPTS = "none";
63+ private string DEFAULT_SHADE_TYPE = "solid";
64+ private string DEFAULT_AMBIANCE_COL = "#2C2C00001E1E"; // Ubuntu Dark Purple
65+ private string DEFAULT_RADIANCE_COL = "#AEAEA7A79F9F"; // Ubuntu Grey
66+ private string DEFAULT_FILENAME = "/usr/share/backgrounds/warty-final.png";
67+
68+ private Clutter.CairoTexture bg_gradient;
69+ private Clutter.Texture bg_image;
70+ private Gnome.BG gbg;
71+ private GConf.Client client;
72+
73+ private string pic_opts;
74+ private string shade_type;
75+ private string prim_col;
76+ private string sec_col;
77 private string filename;
78- private string option;
79-
80- private Clutter.Texture bg;
81
82 construct
83 {
84 START_FUNCTION ();
85- var client = GConf.Client.get_default ();
86-
87- /* Setup the initial properties and notifies */
88+
89+ this.gbg = new Gnome.BG ();
90+ this.client = GConf.Client.get_default ();
91+
92+ /* register monitoring background-directory with gconf */
93 try
94 {
95- client.add_dir (this.BG_DIR, GConf.ClientPreloadType.NONE);
96+ this.client.add_dir (this.BG_DIR, GConf.ClientPreloadType.NONE);
97 }
98 catch (GLib.Error e)
99 {
100+ warning ("Background: Unable to monitor background-settings: %s",
101+ e.message);
102+ }
103+
104+ /* load values from gconf */
105+ try
106+ {
107+ this.pic_opts = this.client.get_string (this.BG_PIC_OPTS);
108+ }
109+ catch (Error e)
110+ {
111+ this.pic_opts = DEFAULT_PIC_OPTS;
112+ }
113+
114+ try
115+ {
116+ this.shade_type = this.client.get_string (this.BG_SHADE_TYPE);
117+ }
118+ catch (Error e)
119+ {
120+ this.shade_type = DEFAULT_SHADE_TYPE;
121+ }
122+
123+ try
124+ {
125+ this.prim_col = this.client.get_string (this.BG_PRIM_COL);
126+ }
127+ catch (Error e)
128+ {
129+ this.prim_col = DEFAULT_AMBIANCE_COL;
130+ }
131+
132+ try
133+ {
134+ this.sec_col = this.client.get_string (this.BG_SEC_COL);
135+ }
136+ catch (Error e)
137+ {
138+ this.sec_col = DEFAULT_AMBIANCE_COL;
139+ }
140+
141+ try
142+ {
143+ this.filename = this.client.get_string (this.BG_FILENAME);
144+ }
145+ catch (Error e)
146+ {
147+ this.filename = DEFAULT_FILENAME;
148+ }
149+
150+ /* register monitor */
151+ try
152+ {
153+ this.client.notify_add (this.BG_DIR, this._on_gconf_changed);
154+ }
155+ catch (Error e)
156+ {
157 warning ("Background: Unable to monitor background: %s", e.message);
158 }
159
160- try
161- {
162- this.filename = client.get_string (this.BG_FILE);
163- }
164- catch (Error e)
165- {
166- this.filename = "/usr/share/backgrounds/warty-final.png";
167- }
168-
169- try
170- {
171- client.notify_add (this.BG_FILE, this.on_filename_changed);
172- }
173- catch (Error e)
174- {
175- warning ("Background: Unable to monitor background filename: %s",
176- e.message);
177- }
178- try
179- {
180- this.option = client.get_string (this.BG_OPTION);
181- }
182- catch (Error e)
183- {
184- this.option = "wallpaper";
185- }
186- try
187- {
188- client.notify_add (this.BG_OPTION, this.on_option_changed);
189- }
190- catch (Error e)
191- {
192- warning ("Background: Unable to monitor background options: %s",
193- e.message);
194- }
195-
196- /* The texture that will show the background */
197- this.bg = new Clutter.Texture ();
198- this.bg.set_load_async (true);
199- this.add_actor (this.bg);
200- this.bg.show ();
201-
202- /* Load the texture */
203- this.ensure_layout ();
204+ this.bg_gradient = new Clutter.CairoTexture (1, 1);
205+ this.bg_gradient.name = "bg_gradient";
206+ this.bg_image = new Clutter.Texture ();
207+ this.bg_image.name = "bg_image";
208+
209+ // setting async. loading to TRUE here, requires hooking up to
210+ // "allocation-changed" for the texture-image, otherwise we cannot get
211+ // valid values for a texture-images base-size, which is needed to
212+ // correctly handle image-placement... this sucks balls!!!
213+ this.bg_image.set_load_async (true);
214+ this.bg_image.load_finished.connect (_handle_image_placement);
215+
216+ this.gbg.load_from_preferences (client);
217+
218+ // this is needed for the bg_gradient to have the correct size
219+ this.allocation_changed.connect (_on_allocation_changed);
220+
221 END_FUNCTION ();
222 }
223
224- private void on_filename_changed (GConf.Client client,
225- uint cxnid,
226- GConf.Entry entry)
227- {
228- var new_filename = entry.get_value ().get_string ();
229-
230- if (new_filename == this.filename)
231- return;
232-
233- this.filename = new_filename;
234- this.ensure_layout ();
235- }
236-
237- private void on_option_changed (GConf.Client client,
238- uint cxnid,
239- GConf.Entry entry)
240- {
241- var new_option = entry.get_value ().get_string ();
242-
243- if (new_option == this.option)
244- return;
245-
246- this.option = new_option;
247- this.ensure_layout ();
248- }
249-
250- private void ensure_layout ()
251- {
252+ private void
253+ _handle_image_placement ()
254+ {
255+ Gnome.BGPlacement placement = this.gbg.get_placement ();
256+
257+ switch (placement)
258+ {
259+ case Gnome.BGPlacement.TILED:
260+ {
261+ this.bg_image.set_repeat (true, true);
262+ this.bg_image.set_sync_size (true);
263+ this.x = 0.0f;
264+ this.y = 0.0f;
265+ }
266+ break;
267+
268+ case Gnome.BGPlacement.ZOOMED:
269+ {
270+ this.bg_image.set_repeat (false, false);
271+ this.bg_image.set_sync_size (false);
272+ this.bg_image.set_keep_aspect_ratio (true);
273+ this.x = 0.0f;
274+ this.y = 0.0f;
275+ }
276+ break;
277+
278+ case Gnome.BGPlacement.CENTERED:
279+ {
280+ this.bg_image.set_repeat (false, false);
281+ this.bg_image.set_sync_size (false);
282+ this.bg_image.set_keep_aspect_ratio (false);
283+ this.x = 0.0f;
284+ this.y = 0.0f;
285+ }
286+ break;
287+
288+ case Gnome.BGPlacement.SCALED:
289+ {
290+ this.bg_image.set_keep_aspect_ratio (true);
291+ this.bg_image.set_sync_size (false);
292+ this.x = 0.0f;
293+ this.y = 0.0f;
294+ }
295+ break;
296+
297+ case Gnome.BGPlacement.FILL_SCREEN:
298+ {
299+ this.bg_image.set_keep_aspect_ratio (false);
300+ this.x = 0.0f;
301+ this.y = 0.0f;
302+ }
303+ break;
304+
305+ case Gnome.BGPlacement.SPANNED:
306+ {
307+ this.bg_image.set_repeat (false, false);
308+ this.bg_image.set_sync_size (true);
309+ this.bg_image.set_keep_aspect_ratio (true);
310+ this.x = 0.0f;
311+ this.y = 0.0f;
312+ }
313+ break;
314+ }
315+ }
316+
317+ private void
318+ _on_allocation_changed ()
319+ {
320+ if (this.filename != "")
321+ _update_image ();
322+ else
323+ _update_gradient ();
324+ }
325+
326+ private void
327+ _update_image ()
328+ {
329+
330+ if (this.find_child_by_name ("bg_image") != this.bg_image)
331+ {
332+ this.remove_actor (this.bg_gradient);
333+ this.add_actor (this.bg_image);
334+ this.bg_image.show ();
335+ }
336+
337 try
338 {
339- this.bg.set_from_file (this.filename);
340+ this.bg_image.set_from_file (this.filename);
341 }
342 catch (Error e)
343 {
344@@ -131,8 +235,190 @@
345 this.filename,
346 e.message);
347 }
348-
349- this.queue_relayout ();
350+ }
351+
352+ private void
353+ _update_gradient ()
354+ {
355+ Gnome.BGColorType type;
356+ Gdk.Color primary;
357+ Gdk.Color secondary;
358+
359+ if (this.find_child_by_name ("bg_gradient") != this.bg_gradient)
360+ {
361+ this.remove_actor (this.bg_image);
362+ this.add_actor (this.bg_gradient);
363+ this.bg_gradient.show ();
364+ }
365+
366+ this.x = 0.0f;
367+ this.y = 0.0f;
368+
369+ this.gbg.get_color (out type, out primary, out secondary);
370+
371+ this.bg_gradient.set_surface_size ((uint) this.width,
372+ (uint) this.height);
373+
374+ switch (type)
375+ {
376+ case Gnome.BGColorType.SOLID:
377+ {
378+
379+ Cairo.Context cr = this.bg_gradient.create ();
380+ cr.set_operator (Cairo.Operator.OVER);
381+ cr.scale (1.0f, 1.0f);
382+ cr.set_source_rgb ((double) primary.red / (double) 0xffff,
383+ (double) primary.green / (double) 0xffff,
384+ (double) primary.blue / (double) 0xffff);
385+ cr.rectangle (0.0f,
386+ 0.0f,
387+ (double) this.width,
388+ (double) this.height);
389+ cr.fill ();
390+ }
391+ break;
392+
393+ case Gnome.BGColorType.V_GRADIENT:
394+ {
395+ Cairo.Context cr = this.bg_gradient.create ();
396+ Cairo.Pattern pat = new Cairo.Pattern.linear (0.0f,
397+ 0.0f,
398+ 0.0f,
399+ (double) this.height);
400+ cr.set_operator (Cairo.Operator.OVER);
401+ cr.scale (1.0f, 1.0f);
402+ pat.add_color_stop_rgb (0.0f,
403+ (double) primary.red / (double) 0xffff,
404+ (double) primary.green / (double) 0xffff,
405+ (double) primary.blue / (double) 0xffff);
406+ pat.add_color_stop_rgb (1.0f,
407+ (double) secondary.red / (double) 0xffff,
408+ (double) secondary.green / (double) 0xffff,
409+ (double) secondary.blue / (double) 0xffff);
410+ cr.set_source (pat);
411+ cr.rectangle (0.0f,
412+ 0.0f,
413+ (double) this.width,
414+ (double) this.height);
415+ cr.fill ();
416+ }
417+ break;
418+
419+ case Gnome.BGColorType.H_GRADIENT:
420+ {
421+ Cairo.Context cr = this.bg_gradient.create ();
422+ Cairo.Pattern pat = new Cairo.Pattern.linear (0.0f,
423+ 0.0f,
424+ (double) this.width,
425+ 0.0f);
426+ cr.set_operator (Cairo.Operator.OVER);
427+ cr.scale (1.0f, 1.0f);
428+ pat.add_color_stop_rgb (0.0f,
429+ (double) primary.red / (double) 0xffff,
430+ (double) primary.green / (double) 0xffff,
431+ (double) primary.blue / (double) 0xffff);
432+ pat.add_color_stop_rgb (1.0f,
433+ (double) secondary.red / (double) 0xffff,
434+ (double) secondary.green / (double) 0xffff,
435+ (double) secondary.blue / (double) 0xffff);
436+ cr.set_source (pat);
437+ cr.rectangle (0.0f,
438+ 0.0f,
439+ (double) this.width,
440+ (double) this.height);
441+ cr.fill ();
442+ }
443+ break;
444+ }
445+ }
446+
447+ private void
448+ _on_gconf_changed (GConf.Client client,
449+ uint cxnid,
450+ GConf.Entry entry)
451+ {
452+ bool needs_update = false;
453+ string new_value;
454+
455+ this.gbg.load_from_preferences (client);
456+
457+ try
458+ {
459+ new_value = this.client.get_string (this.BG_PIC_OPTS);
460+ }
461+ catch (Error e)
462+ {
463+ new_value = DEFAULT_PIC_OPTS;
464+ }
465+ if (new_value != this.pic_opts)
466+ {
467+ this.pic_opts = new_value;
468+ needs_update = true;
469+ }
470+
471+ try
472+ {
473+ new_value = this.client.get_string (this.BG_SHADE_TYPE);
474+ }
475+ catch (Error e)
476+ {
477+ new_value = DEFAULT_SHADE_TYPE;
478+ }
479+ if (new_value != this.shade_type)
480+ {
481+ this.shade_type = new_value;
482+ needs_update = true;
483+ }
484+
485+ try
486+ {
487+ new_value = this.client.get_string (this.BG_PRIM_COL);
488+ }
489+ catch (Error e)
490+ {
491+ new_value = DEFAULT_AMBIANCE_COL;
492+ }
493+ if (new_value != this.prim_col)
494+ {
495+ this.prim_col = new_value;
496+ needs_update = true;
497+ }
498+
499+ try
500+ {
501+ new_value = this.client.get_string (this.BG_SEC_COL);
502+ }
503+ catch (Error e)
504+ {
505+ new_value = DEFAULT_AMBIANCE_COL;
506+ }
507+ if (new_value != this.sec_col)
508+ {
509+ this.sec_col = new_value;
510+ needs_update = true;
511+ }
512+
513+ try
514+ {
515+ new_value = this.client.get_string (this.BG_FILENAME);
516+ }
517+ catch (Error e)
518+ {
519+ new_value = DEFAULT_FILENAME;
520+ }
521+ if (new_value != this.filename)
522+ {
523+ this.filename = new_value;
524+ needs_update = true;
525+ }
526+
527+ if (needs_update)
528+ {
529+ if (this.filename != "")
530+ _update_image ();
531+ else
532+ _update_gradient ();
533+ }
534 }
535 }
536 }
537
538=== modified file 'vapi/Makefile.am'
539--- vapi/Makefile.am 2010-06-02 12:05:59 +0000
540+++ vapi/Makefile.am 2010-07-15 08:32:44 +0000
541@@ -14,4 +14,5 @@
542 mutter-2.28.vapi \
543 mutter-2.28.deps \
544 unity-const.vapi \
545- unity-misc.vapi
546+ unity-misc.vapi \
547+ gnome-bg-2.0.vapi
548
549=== added file 'vapi/gnome-bg-2.0.vapi'
550--- vapi/gnome-bg-2.0.vapi 1970-01-01 00:00:00 +0000
551+++ vapi/gnome-bg-2.0.vapi 2010-07-15 08:32:44 +0000
552@@ -0,0 +1,242 @@
553+/* gnome-desktop-2.0.vapi generated by vapigen, do not modify. */
554+
555+[CCode (cprefix = "Gnome", lower_case_cprefix = "gnome_")]
556+namespace Gnome {
557+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
558+ public class BG : GLib.Object {
559+ [CCode (has_construct_function = false)]
560+ public BG ();
561+ public bool changes_with_time ();
562+ public unowned Gdk.Pixbuf create_frame_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height, int frame_num);
563+ public unowned Gdk.Pixmap create_pixmap (Gdk.Window window, int width, int height, bool root);
564+ public unowned Gdk.Pixbuf create_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height);
565+ public void draw (Gdk.Pixbuf dest, Gdk.Screen screen, bool is_root);
566+ public void get_color (out Gnome.BGColorType type, out Gdk.Color primary, out Gdk.Color secondary);
567+ public unowned string get_filename ();
568+ public bool get_image_size (Gnome.DesktopThumbnailFactory factory, int best_width, int best_height, int width, int height);
569+ public static unowned Gdk.Pixmap get_pixmap_from_root (Gdk.Screen screen);
570+ public Gnome.BGPlacement get_placement ();
571+ public bool has_multiple_sizes ();
572+ public bool is_dark (int dest_width, int dest_height);
573+ public void load_from_preferences (GConf.Client client);
574+ public void save_to_preferences (GConf.Client client);
575+ public void set_color (Gnome.BGColorType type, Gdk.Color primary, Gdk.Color secondary);
576+ public void set_filename (string filename);
577+ public static void set_pixmap_as_root (Gdk.Screen screen, Gdk.Pixmap pixmap);
578+ public static unowned Gnome.BGCrossfade set_pixmap_as_root_with_crossfade (Gdk.Screen screen, Gdk.Pixmap pixmap);
579+ public void set_placement (Gnome.BGPlacement placement);
580+ public virtual signal void changed ();
581+ public virtual signal void transitioned ();
582+ }
583+ [Compact]
584+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
585+ public class BGClass {
586+ }
587+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
588+ public class BGCrossfade : GLib.Object {
589+ [CCode (has_construct_function = false)]
590+ public BGCrossfade (int width, int height);
591+ public bool is_started ();
592+ public bool set_end_pixmap (Gdk.Pixmap pixmap);
593+ public bool set_start_pixmap (Gdk.Pixmap pixmap);
594+ public void start (Gdk.Window window);
595+ public void stop ();
596+ [NoAccessorMethod]
597+ public int height { get; construct; }
598+ [NoAccessorMethod]
599+ public int width { get; construct; }
600+ public virtual signal void finished (GLib.Object window);
601+ }
602+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
603+ public class DesktopThumbnailFactory : GLib.Object {
604+ [CCode (has_construct_function = false)]
605+ public DesktopThumbnailFactory (Gnome.DesktopThumbnailSize size);
606+ public bool can_thumbnail (string uri, string mime_type, ulong mtime);
607+ public void create_failed_thumbnail (string uri, ulong mtime);
608+ public unowned Gdk.Pixbuf generate_thumbnail (string uri, string mime_type);
609+ public bool has_valid_failed_thumbnail (string uri, ulong mtime);
610+ public unowned string lookup (string uri, ulong mtime);
611+ public void save_thumbnail (Gdk.Pixbuf thumbnail, string uri, ulong original_mtime);
612+ }
613+ [Compact]
614+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
615+ public class OutputInfo {
616+ public double aspect;
617+ public bool connected;
618+ public weak string display_name;
619+ public int height;
620+ public weak string name;
621+ public bool on;
622+ public int pref_height;
623+ public int pref_width;
624+ public bool primary;
625+ public uint product;
626+ public int rate;
627+ public Gnome.RRRotation rotation;
628+ public uint serial;
629+ public void* user_data;
630+ [CCode (array_length = false)]
631+ public weak string[] vendor;
632+ public int width;
633+ public int x;
634+ public int y;
635+ }
636+ [Compact]
637+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
638+ public class RRConfig {
639+ public bool clone;
640+ public weak Gnome.OutputInfo outputs;
641+ public bool applicable (Gnome.RRScreen screen) throws GLib.Error;
642+ public bool apply (Gnome.RRScreen screen) throws GLib.Error;
643+ public static bool apply_from_filename (Gnome.RRScreen screen, string filename) throws GLib.Error;
644+ public static bool apply_from_filename_with_time (Gnome.RRScreen screen, string filename, uint32 timestamp) throws GLib.Error;
645+ public static bool apply_stored (Gnome.RRScreen screen) throws GLib.Error;
646+ public bool apply_with_time (Gnome.RRScreen screen, uint32 timestamp) throws GLib.Error;
647+ [CCode (has_construct_function = false)]
648+ public RRConfig.current (Gnome.RRScreen screen);
649+ public bool equal (Gnome.RRConfig config2);
650+ public static unowned string get_backup_filename ();
651+ public static unowned string get_intended_filename ();
652+ public bool match (Gnome.RRConfig config2);
653+ public void sanitize ();
654+ public bool save () throws GLib.Error;
655+ [CCode (has_construct_function = false)]
656+ public RRConfig.stored (Gnome.RRScreen screen) throws GLib.Error;
657+ }
658+ [Compact]
659+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
660+ public class RRCrtc {
661+ public bool can_drive_output (Gnome.RROutput output);
662+ public unowned Gnome.RRMode get_current_mode ();
663+ public Gnome.RRRotation get_current_rotation ();
664+ public bool get_gamma (int size, uint red, uint green, uint blue);
665+ public uint32 get_id ();
666+ public void get_position (int x, int y);
667+ public Gnome.RRRotation get_rotations ();
668+ public bool set_config (int x, int y, Gnome.RRMode mode, Gnome.RRRotation rotation, Gnome.RROutput[] outputs) throws GLib.Error;
669+ public bool set_config_with_time (uint32 timestamp, int x, int y, Gnome.RRMode mode, Gnome.RRRotation rotation, Gnome.RROutput[] outputs) throws GLib.Error;
670+ public void set_gamma (int size, uint red, uint green, uint blue);
671+ public bool supports_rotation (Gnome.RRRotation rotation);
672+ }
673+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
674+ public class RRLabeler : GLib.Object {
675+ [CCode (has_construct_function = false)]
676+ public RRLabeler (Gnome.RRConfig config);
677+ public void get_color_for_output (Gnome.OutputInfo output, Gdk.Color color_out);
678+ public void hide ();
679+ }
680+ [Compact]
681+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
682+ public class RRLabelerClass {
683+ }
684+ [Compact]
685+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
686+ public class RRMode {
687+ public int get_freq ();
688+ public uint get_height ();
689+ public uint32 get_id ();
690+ public uint get_width ();
691+ }
692+ [Compact]
693+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
694+ public class RROutput {
695+ public bool can_clone (Gnome.RROutput clone);
696+ public unowned string get_connector_type ();
697+ public unowned Gnome.RRCrtc get_crtc ();
698+ public unowned Gnome.RRMode get_current_mode ();
699+ public uchar get_edid_data ();
700+ public int get_height_mm ();
701+ public uint32 get_id ();
702+ public bool get_is_primary ();
703+ public unowned string get_name ();
704+ public void get_position (int x, int y);
705+ public unowned Gnome.RRCrtc get_possible_crtcs ();
706+ public unowned Gnome.RRMode get_preferred_mode ();
707+ public int get_size_inches ();
708+ public int get_width_mm ();
709+ public bool is_connected ();
710+ public bool is_laptop ();
711+ public unowned Gnome.RRMode list_modes ();
712+ public bool supports_mode (Gnome.RRMode mode);
713+ }
714+ [Compact]
715+ [CCode (free_function = "gnome_rr_screen_destroy", cheader_filename = "libgnomeui/gnome-bg.h")]
716+ public class RRScreen {
717+ [CCode (has_construct_function = false)]
718+ public RRScreen (Gdk.Screen screen, Gnome.RRScreenChanged callback, void* data) throws GLib.Error;
719+ public unowned Gnome.RRCrtc get_crtc_by_id (uint32 id);
720+ public unowned Gnome.RROutput get_output_by_id (uint32 id);
721+ public unowned Gnome.RROutput get_output_by_name (string name);
722+ public void get_ranges (int min_width, int max_width, int min_height, int max_height);
723+ public void get_timestamps (uint32 change_timestamp_ret, uint32 config_timestamp_ret);
724+ public unowned Gnome.RRMode list_clone_modes ();
725+ public unowned Gnome.RRCrtc list_crtcs ();
726+ public unowned Gnome.RRMode list_modes ();
727+ public unowned Gnome.RROutput list_outputs ();
728+ public bool refresh () throws GLib.Error;
729+ public void set_primary_output (Gnome.RROutput output);
730+ public void set_size (int width, int height, int mm_width, int mm_height);
731+ }
732+ [CCode (cprefix = "GNOME_BG_COLOR_", has_type_id = false, cheader_filename = "libgnomeui/gnome-bg.h")]
733+ public enum BGColorType {
734+ SOLID,
735+ H_GRADIENT,
736+ V_GRADIENT
737+ }
738+ [CCode (cprefix = "GNOME_BG_PLACEMENT_", has_type_id = false, cheader_filename = "libgnomeui/gnome-bg.h")]
739+ public enum BGPlacement {
740+ TILED,
741+ ZOOMED,
742+ CENTERED,
743+ SCALED,
744+ FILL_SCREEN,
745+ SPANNED
746+ }
747+ [CCode (cprefix = "GNOME_DESKTOP_THUMBNAIL_SIZE_", has_type_id = false, cheader_filename = "libgnomeui/gnome-bg.h")]
748+ public enum DesktopThumbnailSize {
749+ NORMAL,
750+ LARGE
751+ }
752+ [CCode (cprefix = "GNOME_RR_ERROR_", has_type_id = false, cheader_filename = "libgnomeui/gnome-bg.h")]
753+ public enum RRError {
754+ UNKNOWN,
755+ NO_RANDR_EXTENSION,
756+ RANDR_ERROR,
757+ BOUNDS_ERROR,
758+ CRTC_ASSIGNMENT,
759+ NO_MATCHING_CONFIG
760+ }
761+ [CCode (cprefix = "GNOME_RR_", has_type_id = false, cheader_filename = "libgnomeui/gnome-bg.h")]
762+ public enum RRRotation {
763+ ROTATION_0,
764+ ROTATION_90,
765+ ROTATION_180,
766+ ROTATION_270,
767+ REFLECT_X,
768+ REFLECT_Y
769+ }
770+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
771+ public delegate void RRScreenChanged (Gnome.RRScreen screen);
772+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
773+ public const string BG_KEY_DIR;
774+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
775+ public const string RR_CONNECTOR_TYPE_PANEL;
776+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
777+ public static bool desktop_thumbnail_has_uri (Gdk.Pixbuf pixbuf, string uri);
778+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
779+ public static bool desktop_thumbnail_is_valid (Gdk.Pixbuf pixbuf, string uri, ulong mtime);
780+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
781+ public static unowned string desktop_thumbnail_md5 (string uri);
782+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
783+ public static unowned string desktop_thumbnail_path_for_uri (string uri, Gnome.DesktopThumbnailSize size);
784+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
785+ public static unowned Gdk.Pixbuf desktop_thumbnail_scale_down_pixbuf (Gdk.Pixbuf pixbuf, int dest_width, int dest_height);
786+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
787+ public static unowned Gnome.RRMode rr_create_clone_modes (Gnome.RRScreen screen);
788+ [CCode (cheader_filename = "libgnomeui/gnome-bg.h")]
789+ public static GLib.Quark rr_error_quark ();
790+ [CCode (cname = "ubuntu_compute_virtual_size_for_configuration", cheader_filename = "libgnomeui/gnome-bg.h")]
791+ public static void ubuntu_compute_virtual_size_for_configuration (Gnome.RRConfig config, int ret_width, int ret_height);
792+ [CCode (cname = "ubuntu_gnome_rr_config_save_desired", cheader_filename = "libgnomeui/gnome-bg.h")]
793+ public static bool ubuntu_gnome_rr_config_save_desired (Gnome.RRConfig configuration) throws GLib.Error;
794+}