[vte/vte-next: 212/223] Remove background pattern
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 212/223] Remove background pattern
- Date: Wed, 22 Jun 2011 21:06:24 +0000 (UTC)
commit 0d9f4a96c66686988da729b066d0dbe95c75cfcb
Author: Christian Persch <chpe gnome org>
Date: Wed Jun 22 19:37:54 2011 +0200
Remove background pattern
src/vte-private.h | 1 -
src/vte.c | 55 -----------------------------------------------------
src/vteapp.c | 11 ----------
src/vtedraw.c | 37 +----------------------------------
src/vtedraw.h | 2 -
5 files changed, 1 insertions(+), 105 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 3b0c205..9af68ba 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -413,7 +413,6 @@ struct _VteViewPrivate {
gboolean adjustment_value_changed_pending;
/* Background pattern */
- cairo_pattern_t *bg_pattern;
gboolean bg_update_pending;
/* Key modifiers. */
diff --git a/src/vte.c b/src/vte.c
index c932f75..2a1cb9e 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -69,8 +69,6 @@ typedef gunichar wint_t;
#define howmany(x, y) (((x) + ((y) - 1)) / (y))
#endif
-#define CAIRO_GOBJECT_TYPE_PATTERN (g_type_from_name("CairoPattern"))
-
static void vte_view_emit_copy_clipboard(VteView *terminal);
static void vte_view_emit_paste_clipboard(VteView *terminal);
static void vte_view_emit_copy_primary(VteView *terminal);
@@ -4541,33 +4539,6 @@ vte_view_update_cursor_style(VteView *terminal)
}
static void
-vte_view_update_background_style(VteView *terminal)
-{
- VteViewPrivate *pvt = terminal->pvt;
- cairo_pattern_t *pattern;
-
- gtk_widget_style_get(&terminal->widget, "background-pattern", &pattern, NULL);
- g_return_if_fail (pattern == NULL || cairo_pattern_get_extend(pattern) != CAIRO_EXTEND_NONE);
-
- _vte_debug_print(VTE_DEBUG_MISC | VTE_DEBUG_STYLE,
- "%s background pattern.\n",
- pattern ? "Setting" : "Clearing");
-
- if (pattern == pvt->bg_pattern) {
- if (pattern)
- cairo_pattern_destroy(pattern);
- return;
- }
-
- if (pvt->bg_pattern) {
- cairo_pattern_destroy (pvt->bg_pattern);
- }
- pvt->bg_pattern = pattern /* adopted */;
-
- vte_view_queue_background_update(terminal);
-}
-
-static void
vte_view_update_style(VteView *terminal)
{
VteViewPrivate *pvt = terminal->pvt;
@@ -4578,7 +4549,6 @@ vte_view_update_style(VteView *terminal)
vte_view_set_padding(terminal);
vte_view_update_style_colors(terminal, FALSE);
vte_view_update_cursor_style(terminal);
- vte_view_update_background_style(terminal);
gtk_widget_style_get(widget,
"allow-bold", &allow_bold,
@@ -8025,9 +7995,6 @@ vte_view_init(VteView *terminal)
/* Rendering data. Try everything. */
pvt->draw = _vte_draw_new();
- /* Set up background information. */
- pvt->bg_pattern = NULL;
-
pvt->selection_block_mode = FALSE;
pvt->unscaled_font_desc = pvt->fontdesc = NULL;
pvt->font_scale = 1.;
@@ -8386,11 +8353,6 @@ vte_view_finalize(GObject *object)
/* The NLS maps. */
_vte_iso2022_state_free(buffer->pvt->iso2022);
- /* Free background info. */
- if (pvt->bg_pattern) {
- cairo_pattern_destroy (pvt->bg_pattern);
- }
-
/* Free the font description. */
if (pvt->unscaled_font_desc != NULL) {
pango_font_description_free(pvt->unscaled_font_desc);
@@ -11393,20 +11355,6 @@ vte_view_class_init(VteViewClass *klass)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
- * VteView:background-pattern:
- *
- * A #cairo_pattern_t to use as background.
- * Must not have extends %CAIRO_EXTEND_NONE.
- *
- * Since: 0.30
- */
- gtk_widget_class_install_style_property
- (widget_class,
- g_param_spec_boxed ("background-pattern", NULL, NULL,
- CAIRO_GOBJECT_TYPE_PATTERN,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
* VteView:cursor-blink-mode:
*
* Sets whether or not the cursor will blink. Using %VTE_CURSOR_BLINK_SYSTEM
@@ -11756,9 +11704,6 @@ vte_view_background_update(VteView *terminal)
_vte_debug_print(VTE_DEBUG_MISC|VTE_DEBUG_EVENTS,
"Updating background image.\n");
- _vte_draw_set_background_pattern(terminal->pvt->draw,
- terminal->pvt->bg_pattern);
-
/* Note that the update has finished. */
terminal->pvt->bg_update_pending = FALSE;
diff --git a/src/vteapp.c b/src/vteapp.c
index 5588d40..33b47a9 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -552,7 +552,6 @@ main(int argc, char **argv)
(char *) "FOO=BAR", (char *) "BOO=BIZ",
#endif
NULL};
- char *background = NULL;
gboolean audible = TRUE,
debug = FALSE, use_builtin_dingus = FALSE, dbuffer = TRUE,
console = FALSE, scroll = FALSE, keep = FALSE,
@@ -581,11 +580,6 @@ main(int argc, char **argv)
char *word_chars = NULL;
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
@@ -807,11 +801,6 @@ main(int argc, char **argv)
}
g_string_append (css_string, "VteView {\n");
- if (background) {
- g_string_append_printf (css_string, "background-image: url(\"%s\");\n",
- background);
- g_free(background);
- }
if (cursor_color_string) {
g_string_append_printf (css_string, "-VteView-cursor-background-color: %s;\n"
"-VteView-cursor-effect: color;\n",
diff --git a/src/vtedraw.c b/src/vtedraw.c
index 9f30f89..6b917c6 100644
--- a/src/vtedraw.c
+++ b/src/vtedraw.c
@@ -722,7 +722,6 @@ font_info_get_unistr_info (struct font_info *info,
struct _vte_draw {
struct font_info *font;
struct font_info *font_bold;
- cairo_pattern_t *bg_pattern;
cairo_t *cr;
};
@@ -745,11 +744,6 @@ _vte_draw_free (struct _vte_draw *draw)
{
_vte_debug_print (VTE_DEBUG_DRAW, "draw_free\n");
- if (draw->bg_pattern != NULL) {
- cairo_pattern_destroy (draw->bg_pattern);
- draw->bg_pattern = NULL;
- }
-
if (draw->font != NULL) {
font_info_destroy (draw->font);
draw->font = NULL;
@@ -774,31 +768,12 @@ _vte_draw_set_cairo(struct _vte_draw *draw,
}
void
-_vte_draw_set_background_pattern (struct _vte_draw *draw,
- cairo_pattern_t *pattern)
-{
- if (draw->bg_pattern)
- cairo_pattern_destroy (draw->bg_pattern);
- if (pattern)
- cairo_pattern_reference (pattern);
- draw->bg_pattern = pattern;
-}
-
-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);
-
- if (draw->bg_pattern == NULL)
- return;
-
- cairo_matrix_init_translate (&matrix, x, y);
- cairo_pattern_set_matrix (draw->bg_pattern, &matrix);
}
void
@@ -816,20 +791,10 @@ _vte_draw_clear (struct _vte_draw *draw,
cairo_save (draw->cr);
- if (draw->bg_pattern != NULL) {
- cairo_rectangle (draw->cr, x, y, width, height);
-
- cairo_set_operator (draw->cr, CAIRO_OPERATOR_SOURCE);
- cairo_set_source (draw->cr, draw->bg_pattern);
- cairo_fill (draw->cr);
- }
-
if (background) {
cairo_rectangle (draw->cr, x, y, width, height);
- cairo_set_operator (draw->cr,
- draw->bg_pattern ? CAIRO_OPERATOR_OVER
- : CAIRO_OPERATOR_SOURCE);
+ cairo_set_operator (draw->cr, CAIRO_OPERATOR_SOURCE);
gdk_cairo_set_source_rgba (draw->cr, background);
cairo_fill (draw->cr);
}
diff --git a/src/vtedraw.h b/src/vtedraw.h
index 8aff72d..4092d8a 100644
--- a/src/vtedraw.h
+++ b/src/vtedraw.h
@@ -64,8 +64,6 @@ void _vte_draw_free(struct _vte_draw *draw);
void _vte_draw_set_cairo(struct _vte_draw *draw,
cairo_t *cr);
-void _vte_draw_set_background_pattern (struct _vte_draw *draw,
- cairo_pattern_t *pattern);
void _vte_draw_set_background_scroll(struct _vte_draw *draw,
gint x, gint y);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]