[vte] widget: Remove background pixbuf settings



commit 68011996d3910389f1b5cfb0a7e47a20ea67004f
Author: Christian Persch <chpe gnome org>
Date:   Thu Mar 27 16:13:26 2014 +0100

    widget: Remove background pixbuf settings

 doc/reference/Makefile.am      |    1 -
 doc/reference/vte-sections.txt |    3 -
 src/Makefile.am                |    2 -
 src/vte-private.h              |    2 -
 src/vte.c                      |  260 +--------------------------------
 src/vteapp.c                   |   20 +---
 src/vtebg.c                    |  323 ----------------------------------------
 src/vtebg.h                    |   68 ---------
 src/vtedeprecated.h            |    7 -
 src/vtedraw.c                  |   47 ------
 src/vtedraw.h                  |    8 -
 11 files changed, 2 insertions(+), 739 deletions(-)
---
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
index 4fd63fe..808ef8e 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -81,7 +81,6 @@ IGNORE_HFILES = \
        stamp-vtetypebuiltins.h \
        table.h \
        trie.h \
-       vtebg.h \
        vteconv.h \
        vtedraw.h \
        vteint.h \
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index e58bcf4..cfafa50 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -118,9 +118,6 @@ vte_terminal_get_current_file_uri
 
 <SUBSECTION Deprecated>
 vte_terminal_im_append_menuitems
-vte_terminal_set_background_image
-vte_terminal_set_background_image_file
-vte_terminal_set_scroll_background
 
 <SUBSECTION Private>
 VteCharAttributes
diff --git a/src/Makefile.am b/src/Makefile.am
index 43b2105..e94464e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -55,8 +55,6 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_SOURCES = \
        vte-private.h \
        vteaccess.c \
        vteaccess.h \
-       vtebg.c \
-       vtebg.h \
        vteconv.c \
        vteconv.h \
        vtedraw.c \
diff --git a/src/vte-private.h b/src/vte-private.h
index d1b1a92..035a7c5 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -401,8 +401,6 @@ struct _VteTerminalPrivate {
 
        /* Background images/"transparency". */
        gboolean bg_update_pending;
-       GdkPixbuf *bg_pixbuf;
-       char *bg_file;
         GdkRGBA bg_tint_color;
 
        /* Key modifiers. */
diff --git a/src/vte.c b/src/vte.c
index 37480a6..ddf0d4b 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -152,8 +152,6 @@ enum {
         PROP_VSCROLL_POLICY,
         PROP_ALLOW_BOLD,
         PROP_AUDIBLE_BELL,
-        PROP_BACKGROUND_IMAGE_FILE,
-        PROP_BACKGROUND_IMAGE_PIXBUF,
         PROP_BACKGROUND_TINT_COLOR,
         PROP_BACKSPACE_BINDING,
         PROP_CURSOR_BLINK_MODE,
@@ -168,7 +166,6 @@ enum {
         PROP_MOUSE_POINTER_AUTOHIDE,
         PROP_PTY_OBJECT,
         PROP_REWRAP_ON_RESIZE,
-        PROP_SCROLL_BACKGROUND,
         PROP_SCROLLBACK_LINES,
         PROP_SCROLL_ON_KEYSTROKE,
         PROP_SCROLL_ON_OUTPUT,
@@ -519,7 +516,7 @@ _vte_terminal_scroll_region (VteTerminal *terminal,
                return;
        }
 
-       if (terminal->pvt->scroll_background || count >= terminal->pvt->row_count) {
+       if (count >= terminal->pvt->row_count) {
                /* We have to repaint the entire window. */
                _vte_invalidate_all(terminal);
        } else {
@@ -8389,9 +8386,6 @@ vte_terminal_finalize(GObject *object)
        /* The NLS maps. */
        _vte_iso2022_state_free(terminal->pvt->iso2022);
 
-       /* Free background info. */
-       g_free(terminal->pvt->bg_file);
-
        /* Free the font description. */
        if (terminal->pvt->fontdesc != NULL) {
                pango_font_description_free(terminal->pvt->fontdesc);
@@ -10306,16 +10300,6 @@ vte_terminal_paint(GtkWidget *widget, cairo_region_t *region)
 
        /* Designate the start of the drawing operation and clear the area. */
        _vte_draw_start(terminal->pvt->draw);
-        {
-               if (terminal->pvt->scroll_background) {
-                       _vte_draw_set_background_scroll(terminal->pvt->draw,
-                                                       0,
-                                                       terminal->pvt->screen->scroll_delta *
-                                                       terminal->pvt->char_height);
-               } else {
-                       _vte_draw_set_background_scroll(terminal->pvt->draw, 0, 0);
-               }
-       }
 
        _VTE_DEBUG_IF (VTE_DEBUG_UPDATES) {
                cairo_rectangle_int_t clip;
@@ -10622,12 +10606,6 @@ vte_terminal_get_property (GObject *object,
                 case PROP_AUDIBLE_BELL:
                         g_value_set_boolean (value, vte_terminal_get_audible_bell (terminal));
                         break;
-                case PROP_BACKGROUND_IMAGE_FILE:
-                        g_value_set_string (value, pvt->bg_file);
-                        break;
-                case PROP_BACKGROUND_IMAGE_PIXBUF:
-                        g_value_set_object (value, pvt->bg_pixbuf);
-                        break;
                 case PROP_BACKGROUND_TINT_COLOR:
                         g_value_set_boxed (value, &pvt->bg_tint_color);
                         break;
@@ -10670,9 +10648,6 @@ vte_terminal_get_property (GObject *object,
                 case PROP_REWRAP_ON_RESIZE:
                         g_value_set_boolean (value, vte_terminal_get_rewrap_on_resize (terminal));
                         break;
-                case PROP_SCROLL_BACKGROUND:
-                        g_value_set_boolean (value, pvt->scroll_background);
-                        break;
                 case PROP_SCROLLBACK_LINES:
                         g_value_set_uint (value, pvt->scrollback_lines);
                         break;
@@ -10729,16 +10704,6 @@ vte_terminal_set_property (GObject *object,
                 case PROP_AUDIBLE_BELL:
                         vte_terminal_set_audible_bell (terminal, g_value_get_boolean (value));
                         break;
-                case PROP_BACKGROUND_IMAGE_FILE:
-                        G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-                        vte_terminal_set_background_image_file (terminal, g_value_get_string (value));
-                        G_GNUC_END_IGNORE_DEPRECATIONS;
-                        break;
-                case PROP_BACKGROUND_IMAGE_PIXBUF:
-                        G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-                        vte_terminal_set_background_image (terminal, g_value_get_object (value));
-                        G_GNUC_END_IGNORE_DEPRECATIONS;
-                        break;
                 case PROP_BACKGROUND_TINT_COLOR:
                         vte_terminal_set_background_tint_color_rgba (terminal, g_value_get_boxed (value));
                         break;
@@ -10772,11 +10737,6 @@ vte_terminal_set_property (GObject *object,
                 case PROP_REWRAP_ON_RESIZE:
                         vte_terminal_set_rewrap_on_resize (terminal, g_value_get_boolean (value));
                         break;
-                case PROP_SCROLL_BACKGROUND:
-                        G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-                        vte_terminal_set_scroll_background (terminal, g_value_get_boolean (value));
-                        G_GNUC_END_IGNORE_DEPRECATIONS;
-                        break;
                 case PROP_SCROLLBACK_LINES:
                         vte_terminal_set_scrollback_lines (terminal, g_value_get_uint (value));
                         break;
@@ -11466,45 +11426,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
                  g_param_spec_boolean ("audible-bell", NULL, NULL,
                                        TRUE,
                                        G_PARAM_READWRITE | STATIC_PARAMS));
-     
-        /**
-         * VteTerminal:background-image-file: (type filename):
-         *
-         * Sets a background image file for the widget.  If specified by
-         * #VteTerminal:background-tint-color:, the terminal will tint its
-         * in-memory copy of the image before applying it to the terminal.
-         * 
-         * Since: 0.20
-         *
-         * Deprecated: 0.34.8
-         */
-        g_object_class_install_property
-                (gobject_class,
-                 PROP_BACKGROUND_IMAGE_FILE,
-                 g_param_spec_string ("background-image-file", NULL, NULL,
-                                      NULL,
-                                      G_PARAM_READWRITE | STATIC_PARAMS));
-
-        /**
-         * VteTerminal:background-image-pixbuf:
-         *
-         * Sets a background image for the widget.  Text which would otherwise be
-         * drawn using the default background color will instead be drawn over the
-         * specified image.  If necessary, the image will be tiled to cover the
-         * widget's entire visible area. If specified by
-         * #VteTerminal:background-tint-color:, the terminal will tint its
-         * in-memory copy of the image before applying it to the terminal.
-         * 
-         * Since: 0.20
-         *
-         * Deprecated: 0.34.8
-         */
-        g_object_class_install_property
-                (gobject_class,
-                 PROP_BACKGROUND_IMAGE_PIXBUF,
-                 g_param_spec_object ("background-image-pixbuf", NULL, NULL,
-                                      GDK_TYPE_PIXBUF,
-                                      G_PARAM_READWRITE | STATIC_PARAMS));
 
         /**
          * VteTerminal:background-tint-color:
@@ -11704,21 +11625,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
                                        G_PARAM_READWRITE | STATIC_PARAMS));
 
         /**
-         * VteTerminal:scroll-background:
-         *
-         * Controls whether or not the terminal will scroll the background image (if
-         * one is set) when the text in the window must be scrolled.
-         * 
-         * Since: 0.20
-         */
-        g_object_class_install_property
-                (gobject_class,
-                 PROP_SCROLL_BACKGROUND,
-                 g_param_spec_boolean ("scroll-background", NULL, NULL,
-                                       FALSE,
-                                       G_PARAM_READWRITE | STATIC_PARAMS));
-     
-        /**
          * VteTerminal:scrollback-lines:
          *
          * The length of the scrollback buffer used by the terminal.  The size of
@@ -12020,39 +11926,6 @@ vte_terminal_get_allow_bold(VteTerminal *terminal)
 }
 
 /**
- * vte_terminal_set_scroll_background:
- * @terminal: a #VteTerminal
- * @scroll: whether the terminal should scroll the background image along with
- *   the text
- *
- * Controls whether or not the terminal will scroll the background image (if
- * one is set) when the text in the window must be scrolled.
- *
- * Since: 0.11
- *
- * Deprecated: 0.34.8
- */
-void
-vte_terminal_set_scroll_background(VteTerminal *terminal, gboolean scroll)
-{
-        VteTerminalPrivate *pvt;
-
-       g_return_if_fail(VTE_IS_TERMINAL(terminal));
-
-        pvt = terminal->pvt;
-
-        scroll = scroll != FALSE;
-        if (scroll == pvt->scroll_background)
-                return;
-
-       pvt->scroll_background = scroll;
-
-        g_object_notify (G_OBJECT (terminal), "scroll-background");
-
-        vte_terminal_queue_background_update(terminal);
-}
-
-/**
  * vte_terminal_set_scroll_on_output:
  * @terminal: a #VteTerminal
  * @scroll: whether the terminal should scroll on output
@@ -12287,27 +12160,6 @@ vte_terminal_background_update(VteTerminal *terminal)
 
         _vte_draw_set_background_solid (terminal->pvt->draw, &color);
 
-       if (terminal->pvt->bg_file) {
-               _vte_draw_set_background_image(terminal->pvt->draw,
-                                              VTE_BG_SOURCE_FILE,
-                                              NULL,
-                                              terminal->pvt->bg_file,
-                                              &terminal->pvt->bg_tint_color);
-       } else
-       if (GDK_IS_PIXBUF(terminal->pvt->bg_pixbuf)) {
-               _vte_draw_set_background_image(terminal->pvt->draw,
-                                              VTE_BG_SOURCE_PIXBUF,
-                                              terminal->pvt->bg_pixbuf,
-                                              NULL,
-                                              &terminal->pvt->bg_tint_color);
-       } else {
-               _vte_draw_set_background_image(terminal->pvt->draw,
-                                              VTE_BG_SOURCE_NONE,
-                                              NULL,
-                                              NULL,
-                                              &terminal->pvt->bg_tint_color);
-       }
-
        /* Note that the update has finished. */
        terminal->pvt->bg_update_pending = FALSE;
 
@@ -12373,116 +12225,6 @@ vte_terminal_set_background_tint_color_rgba(VteTerminal *terminal,
 }
 
 /**
- * vte_terminal_set_background_image:
- * @terminal: a #VteTerminal
- * @image: (allow-none): a #GdkPixbuf to use, or %NULL to unset the background
- *
- * Sets a background image for the widget.  Text which would otherwise be
- * drawn using the default background color will instead be drawn over the
- * specified image.  If necessary, the image will be tiled to cover the
- * widget's entire visible area. If specified by
- * vte_terminal_set_background_tint_color_rgba(), the terminal will tint its
- * in-memory copy of the image before applying it to the terminal.
- *
- * Deprecated: 0.34.8
- */
-void
-vte_terminal_set_background_image(VteTerminal *terminal, GdkPixbuf *image)
-{
-        VteTerminalPrivate *pvt;
-        GObject *object;
-
-       g_return_if_fail(VTE_IS_TERMINAL(terminal));
-       g_return_if_fail(image==NULL || GDK_IS_PIXBUF(image));
-
-        object = G_OBJECT(terminal);
-        pvt = terminal->pvt;
-
-        if (image && image == pvt->bg_pixbuf)
-                return;
-
-       _vte_debug_print(VTE_DEBUG_MISC,
-                       "%s background image.\n",
-                       GDK_IS_PIXBUF(image) ? "Setting" : "Clearing");
-
-        g_object_freeze_notify(object);
-
-       /* Get a ref to the new image if there is one.  Do it here just in
-        * case we're actually given the same one we're already using. */
-       if (image != NULL) {
-               g_object_ref(image);
-       }
-
-       /* Unref the previous background image. */
-       if (pvt->bg_pixbuf != NULL) {
-               g_object_unref(pvt->bg_pixbuf);
-       }
-
-       /* Clear a background file name, if one was set. */
-        if (pvt->bg_file) {
-                g_free(pvt->bg_file);
-                pvt->bg_file = NULL;
-
-                g_object_notify(object, "background-image-file");
-        }
-
-       /* Set the new background. */
-       pvt->bg_pixbuf = image;
-
-        g_object_notify(object, "background-image-pixbuf");
-
-       vte_terminal_queue_background_update(terminal);
-
-        g_object_thaw_notify(object);
-}
-
-/**
- * vte_terminal_set_background_image_file:
- * @terminal: a #VteTerminal
- * @path: (type filename): path to an image file
- *
- * Sets a background image for the widget.  If specified by
- * vte_terminal_set_background_tint_color_rgba(), the terminal will tint its
- * in-memory copy of the image before applying it to the terminal.
- *
- * Deprecated: 0.34.8
- */
-void
-vte_terminal_set_background_image_file(VteTerminal *terminal, const char *path)
-{
-        VteTerminalPrivate *pvt;
-        GObject *object;
-
-       g_return_if_fail(VTE_IS_TERMINAL(terminal));
-
-        object = G_OBJECT(terminal);
-        pvt = terminal->pvt;
-
-       _vte_debug_print(VTE_DEBUG_MISC,
-                       "Loading background image from `%s'.\n", path);
-
-        g_object_freeze_notify(G_OBJECT(terminal));
-
-       /* Save this background type. */
-       g_free(pvt->bg_file);
-       pvt->bg_file = g_strdup(path);
-
-       /* Turn off other background types. */
-       if (pvt->bg_pixbuf != NULL) {
-               g_object_unref(pvt->bg_pixbuf);
-               pvt->bg_pixbuf = NULL;
-
-                g_object_notify(object, "background-image-pixbuf");
-       }
-
-        g_object_notify(object, "background-image-file");
-
-       vte_terminal_queue_background_update(terminal);
-
-        g_object_thaw_notify(G_OBJECT(terminal));
-}
-
-/**
  * vte_terminal_get_has_selection:
  * @terminal: a #VteTerminal
  *
diff --git a/src/vteapp.c b/src/vteapp.c
index 109edb6..f1a2db1 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -547,11 +547,10 @@ main(int argc, char **argv)
                (char *) "FOO=BAR", (char *) "BOO=BIZ",
 #endif
                NULL};
-       const char *background = NULL;
         char *transparent = NULL;
        gboolean audible = TRUE,
                 debug = FALSE, dingus = FALSE, dbuffer = TRUE,
-                console = FALSE, scroll = FALSE, keep = FALSE,
+                console = FALSE, keep = FALSE,
                 icon_title = FALSE, shell = TRUE, highlight_set = FALSE,
                 cursor_set = FALSE, reverse = FALSE, use_geometry_hints = TRUE,
                 use_scrolled_window = FALSE,
@@ -571,11 +570,6 @@ main(int argc, char **argv)
        GdkRGBA fore, back, highlight, cursor, tint;
        const GOptionEntry options[]={
                {
-                       "background", 'B', 0,
-                       G_OPTION_ARG_FILENAME, &background,
-                       "Specify a background image", NULL
-               },
-               {
                        "console", 'C', 0,
                        G_OPTION_ARG_NONE, &console,
                        "Watch /dev/console", NULL
@@ -667,11 +661,6 @@ main(int argc, char **argv)
                        "Set cursor shape (block|underline|ibeam)", NULL
                },
                {
-                       "scroll-background", 's', 0,
-                       G_OPTION_ARG_NONE, &scroll,
-                       "Enable a scrolling background", NULL
-               },
-               {
                        "termcap", 't', 0,
                        G_OPTION_ARG_STRING, &termcap,
                        "Specify the terminal emulation to use", NULL
@@ -886,18 +875,11 @@ main(int argc, char **argv)
        vte_terminal_set_scrollback_lines(terminal, lines);
        vte_terminal_set_mouse_autohide(terminal, TRUE);
 
-        G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-       vte_terminal_set_scroll_background(terminal, scroll);
-       if (background != NULL) {
-               vte_terminal_set_background_image_file(terminal,
-                                                      background);
-       }
        if (transparent != NULL) {
                 tint.alpha = g_ascii_strtod (transparent, NULL);
                 g_free (transparent);
                 vte_terminal_set_background_tint_color_rgba(terminal, &tint);
         }
-        G_GNUC_END_IGNORE_DEPRECATIONS;
 
        vte_terminal_set_colors_rgba(terminal, &fore, &back, NULL, 0);
        if (highlight_set) {
diff --git a/src/vtedeprecated.h b/src/vtedeprecated.h
index a0584ec..1688c6f 100644
--- a/src/vtedeprecated.h
+++ b/src/vtedeprecated.h
@@ -32,13 +32,6 @@ G_BEGIN_DECLS
 void vte_terminal_im_append_menuitems(VteTerminal *terminal,
                                      GtkMenuShell *menushell) G_GNUC_DEPRECATED;
 
-/* Background effects. */
-void vte_terminal_set_scroll_background(VteTerminal *terminal, gboolean scroll) G_GNUC_DEPRECATED;
-void vte_terminal_set_background_image(VteTerminal *terminal, GdkPixbuf *image) G_GNUC_DEPRECATED;
-void vte_terminal_set_background_image_file(VteTerminal *terminal,
-                                           const char *path) G_GNUC_DEPRECATED;
-void vte_terminal_set_opacity(VteTerminal *terminal, guint16 opacity) G_GNUC_DEPRECATED;
-
 G_END_DECLS
 
 void vte_terminal_set_alternate_screen_scroll(VteTerminal *terminal,
diff --git a/src/vtedraw.c b/src/vtedraw.c
index bbf971c..02f3d52 100644
--- a/src/vtedraw.c
+++ b/src/vtedraw.c
@@ -24,7 +24,6 @@
 #include <gtk/gtk.h>
 #include <glib.h>
 #include "debug.h"
-#include "vtebg.h"
 #include "vtedraw.h"
 #include "vte-private.h"
 
@@ -837,52 +836,6 @@ _vte_draw_set_background_solid(struct _vte_draw *draw,
 }
 
 void
-_vte_draw_set_background_image (struct _vte_draw *draw,
-                               VteBgSourceType type,
-                               GdkPixbuf *pixbuf,
-                               const char *filename,
-                               const GdkRGBA *color)
-{
-       cairo_surface_t *surface;
-
-       /* Need a valid draw->cr for cairo_get_target () */
-       _vte_draw_start (draw);
-
-       surface = vte_bg_get_surface (vte_bg_get_for_screen (gtk_widget_get_screen (draw->widget)),
-                                    type, pixbuf, filename,
-                                    color,
-                                    cairo_get_target(draw->cr));
-
-       _vte_draw_end (draw);
-
-       if (!surface)
-               return;
-
-       if (draw->bg_pattern)
-               cairo_pattern_destroy (draw->bg_pattern);
-
-       draw->bg_pattern = cairo_pattern_create_for_surface (surface);
-       cairo_surface_destroy (surface);
-       cairo_pattern_set_extend (draw->bg_pattern, CAIRO_EXTEND_REPEAT);
-}
-
-void
-_vte_draw_set_background_scroll (struct _vte_draw *draw,
-                                gint x, gint y)
-{
-       cairo_matrix_t matrix;
-
-       _vte_debug_print (VTE_DEBUG_DRAW,
-                       "draw_set_scroll (%d, %d)\n",
-                       x, y);
-
-       g_return_if_fail (draw->bg_pattern != NULL);
-
-       cairo_matrix_init_translate (&matrix, x, y);
-       cairo_pattern_set_matrix (draw->bg_pattern, &matrix);
-}
-
-void
 _vte_draw_clip (struct _vte_draw *draw, cairo_region_t *region)
 {
        _vte_debug_print (VTE_DEBUG_DRAW, "draw_clip\n");
diff --git a/src/vtedraw.h b/src/vtedraw.h
index fc442e9..2d03e33 100644
--- a/src/vtedraw.h
+++ b/src/vtedraw.h
@@ -25,7 +25,6 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <cairo.h>
-#include "vtebg.h"
 #include "vte.h"
 #include "vteunistr.h"
 
@@ -79,13 +78,6 @@ void _vte_draw_end(struct _vte_draw *draw);
 
 void _vte_draw_set_background_solid(struct _vte_draw *draw,
                                     const GdkRGBA *color);
-void _vte_draw_set_background_image(struct _vte_draw *draw,
-                                   VteBgSourceType type,
-                                   GdkPixbuf *pixbuf,
-                                   const char *file,
-                                   const GdkRGBA *color);
-void _vte_draw_set_background_scroll(struct _vte_draw *draw,
-                                    gint x, gint y);
 
 void _vte_draw_clip(struct _vte_draw *draw, cairo_region_t *region);
 void _vte_draw_clear(struct _vte_draw *draw,


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