[gnome-desktop/jjardon/remove_unused_api: 4/4] Remove API that references root



commit 8834bba5ff91442165c85a5210ca1f2245cf1def
Author: Javier Jardón <jjardon gnome org>
Date:   Mon Nov 25 21:13:18 2019 +0900

    Remove API that references root

 libgnome-desktop/gnome-bg.c | 85 +++++----------------------------------------
 libgnome-desktop/gnome-bg.h | 17 ++-------
 2 files changed, 11 insertions(+), 91 deletions(-)
---
diff --git a/libgnome-desktop/gnome-bg.c b/libgnome-desktop/gnome-bg.c
index 6d2ebd8b..0f9548c5 100644
--- a/libgnome-desktop/gnome-bg.c
+++ b/libgnome-desktop/gnome-bg.c
@@ -730,27 +730,6 @@ draw_color (GnomeBG *bg,
        draw_color_area (bg, dest, &rect);
 }
 
-static void
-draw_color_each_monitor (GnomeBG *bg,
-                        GdkPixbuf *dest,
-                        GdkScreen *screen,
-                        gint scale)
-{
-       GdkRectangle rect;
-       gint num_monitors;
-       int monitor;
-
-       num_monitors = gdk_screen_get_n_monitors (screen);
-       for (monitor = 0; monitor < num_monitors; monitor++) {
-               gdk_screen_get_monitor_geometry (screen, monitor, &rect);
-               rect.x *= scale;
-               rect.y *= scale;
-               rect.width *= scale;
-               rect.height *= scale;
-               draw_color_area (bg, dest, &rect);
-       }
-}
-
 static GdkPixbuf *
 pixbuf_clip_to_fit (GdkPixbuf *src,
                    int        max_width,
@@ -927,65 +906,27 @@ draw_once (GnomeBG   *bg,
        }
 }
 
-static void
-draw_each_monitor (GnomeBG   *bg,
-                  GdkPixbuf *dest,
-                  GdkScreen *screen,
-                  gint       scale)
-{
-       GdkRectangle rect;
-       gint num_monitors;
-       int monitor;
-
-       num_monitors = gdk_screen_get_n_monitors (screen);
-       for (monitor = 0; monitor < num_monitors; monitor++) {
-               GdkPixbuf *pixbuf;
-               gdk_screen_get_monitor_geometry (screen, monitor, &rect);
-               rect.x *= scale;
-               rect.y *= scale;
-               rect.width *= scale;
-               rect.height *= scale;
-               pixbuf = get_pixbuf_for_size (bg, monitor, rect.width, rect.height);
-               if (pixbuf) {
-                       draw_image_area (bg,
-                                        monitor,
-                                        pixbuf,
-                                        dest, &rect);
-                       g_object_unref (pixbuf);
-               }
-       }
-}
-
 static void
 gnome_bg_draw_at_scale (GnomeBG   *bg,
                         GdkPixbuf *dest,
                         gint       scale,
-                        GdkScreen *screen,
-                        gboolean   is_root)
+                        GdkScreen *screen)
 {
-       if (is_root && (bg->placement != G_DESKTOP_BACKGROUND_STYLE_SPANNED)) {
-               draw_color_each_monitor (bg, dest, screen, scale);
-               if (bg->placement != G_DESKTOP_BACKGROUND_STYLE_NONE) {
-                       draw_each_monitor (bg, dest, screen, scale);
-               }
-       } else {
-               draw_color (bg, dest);
-               if (bg->placement != G_DESKTOP_BACKGROUND_STYLE_NONE) {
-                       draw_once (bg, dest);
-               }
+       draw_color (bg, dest);
+       if (bg->placement != G_DESKTOP_BACKGROUND_STYLE_NONE) {
+               draw_once (bg, dest);
        }
 }
 
 void
 gnome_bg_draw (GnomeBG *bg,
               GdkPixbuf *dest,
-              GdkScreen *screen,
-              gboolean is_root)
+              GdkScreen *screen)
 {
        if (!bg)
                return;
 
-       gnome_bg_draw_at_scale (bg, dest, 1, screen, is_root);
+       gnome_bg_draw_at_scale (bg, dest, 1, screen);
 }
 
 gboolean
@@ -1047,12 +988,8 @@ gnome_bg_get_pixmap_size (GnomeBG   *bg,
  * @window: 
  * @width: 
  * @height:
- * @root:
  *
- * Create a surface that can be set as background for @window. If @is_root is
- * TRUE, the surface created will be created by a temporary X server connection
- * so that if someone calls XKillClient on it, it won't affect the application
- * who created it.
+ * Create a surface that can be set as background for @window.
  *
  * Returns: %NULL on error (e.g. out of X connections)
  **/
@@ -1060,8 +997,7 @@ cairo_surface_t *
 gnome_bg_create_surface (GnomeBG           *bg,
                         GdkWindow   *window,
                         int         width,
-                        int         height,
-                        gboolean     root)
+                        int         height)
 {
        gint scale;
        int pm_width, pm_height;
@@ -1071,9 +1007,6 @@ gnome_bg_create_surface (GnomeBG      *bg,
        g_return_val_if_fail (bg != NULL, NULL);
        g_return_val_if_fail (window != NULL, NULL);
 
-       if (root)
-               return NULL;
-
        scale = gdk_window_get_scale_factor (window);
 
         if (bg->pixbuf_cache &&
@@ -1102,7 +1035,7 @@ gnome_bg_create_surface (GnomeBG      *bg,
                
                pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8,
                                         scale * width, scale * height);
-               gnome_bg_draw_at_scale (bg, pixbuf, scale, gdk_window_get_screen (window), root);
+               gnome_bg_draw_at_scale (bg, pixbuf, scale, gdk_window_get_screen (window));
 
                pixbuf_surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, 0, window);
                cairo_set_source_surface (cr, pixbuf_surface, 0, 0);
diff --git a/libgnome-desktop/gnome-bg.h b/libgnome-desktop/gnome-bg.h
index f19173d8..18cea5d1 100644
--- a/libgnome-desktop/gnome-bg.h
+++ b/libgnome-desktop/gnome-bg.h
@@ -77,13 +77,11 @@ const gchar *    gnome_bg_get_filename          (GnomeBG               *bg);
 /* Drawing and thumbnailing */
 void             gnome_bg_draw                  (GnomeBG               *bg,
                                                 GdkPixbuf             *dest,
-                                                GdkScreen             *screen,
-                                                 gboolean               is_root);
+                                                GdkScreen             *screen);
 cairo_surface_t *gnome_bg_create_surface        (GnomeBG               *bg,
                                                 GdkWindow             *window,
                                                 int                    width,
-                                                int                    height,
-                                                gboolean               root);
+                                                int                    height);
 gboolean         gnome_bg_get_image_size        (GnomeBG               *bg,
                                                 GnomeDesktopThumbnailFactory *factory,
                                                  int                    best_width,
@@ -107,17 +105,6 @@ GdkPixbuf *      gnome_bg_create_frame_thumbnail (GnomeBG              *bg,
                                                 int                    dest_height,
                                                 int                    frame_num);
 
-/* Set a surface as root - not a GnomeBG method. At some point
- * if we decide to stabilize the API then we may want to make
- * these object methods, drop gnome_bg_create_surface, etc.
- */
-void             gnome_bg_set_surface_as_root   (GdkScreen             *screen,
-                                                cairo_surface_t       *surface);
-
-GnomeBGCrossfade *gnome_bg_set_surface_as_root_with_crossfade (GdkScreen *screen,
-                                                              cairo_surface_t *surface);
-cairo_surface_t *gnome_bg_get_surface_from_root (GdkScreen *screen);
-
 G_END_DECLS
 
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]