diff options
Diffstat (limited to 'src/vtedraw.h')
-rw-r--r-- | src/vtedraw.h | 72 |
1 files changed, 34 insertions, 38 deletions
diff --git a/src/vtedraw.h b/src/vtedraw.h index 4f651838..3f75e390 100644 --- a/src/vtedraw.h +++ b/src/vtedraw.h @@ -1,19 +1,19 @@ /* * Copyright (C) 2003 Red Hat, Inc. * - * This is free software; you can redistribute it and/or modify it under - * the terms of the GNU Library General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* The interfaces in this file are subject to change at any time. */ @@ -24,10 +24,9 @@ #include <glib.h> #include <gtk/gtk.h> -#include "vtebg.h" +#include <cairo.h> #include "vte.h" #include "vteunistr.h" -#include "vte-gtk-compat.h" G_BEGIN_DECLS @@ -49,6 +48,10 @@ G_BEGIN_DECLS #define VTE_DRAW_OPAQUE 0xff #define VTE_DRAW_MAX_LENGTH 1024 +#define VTE_DRAW_NORMAL 0 +#define VTE_DRAW_BOLD 1 +#define VTE_DRAW_ITALIC 2 + struct _vte_draw; /* A request to draw a particular character spanning a given number of columns @@ -60,49 +63,39 @@ struct _vte_draw_text_request { gshort x, y, columns; }; +guint _vte_draw_get_style(gboolean bold, gboolean italic); + /* Create and destroy a draw structure. */ -struct _vte_draw *_vte_draw_new(GtkWidget *widget); +struct _vte_draw *_vte_draw_new(void); void _vte_draw_free(struct _vte_draw *draw); -/* Begin and end a drawing operation. If anything is buffered locally, it is - flushed to the window system when _end() is called. */ -void _vte_draw_start(struct _vte_draw *draw); -void _vte_draw_end(struct _vte_draw *draw); +cairo_t *_vte_draw_get_context (struct _vte_draw *draw); + +void _vte_draw_set_cairo(struct _vte_draw *draw, + cairo_t *cr); void _vte_draw_set_background_solid(struct _vte_draw *draw, - double red, - double green, - double blue, - double opacity); -void _vte_draw_set_background_image(struct _vte_draw *draw, - VteBgSourceType type, - GdkPixbuf *pixbuf, - const char *file, - const PangoColor *color, - double saturation); -void _vte_draw_set_background_scroll(struct _vte_draw *draw, - gint x, gint y); - -void _vte_draw_clip(struct _vte_draw *draw, GdkRegion *region); + const GdkRGBA *color); + void _vte_draw_clear(struct _vte_draw *draw, gint x, gint y, gint width, gint height); void _vte_draw_set_text_font(struct _vte_draw *draw, - const PangoFontDescription *fontdesc, - VteTerminalAntiAlias anti_alias); + GtkWidget *widget, + const PangoFontDescription *fontdesc); void _vte_draw_get_text_metrics(struct _vte_draw *draw, gint *width, gint *height, gint *ascent); int _vte_draw_get_char_width(struct _vte_draw *draw, vteunistr c, int columns, - gboolean bold); + guint style); +gboolean _vte_draw_has_bold (struct _vte_draw *draw, guint style); void _vte_draw_text(struct _vte_draw *draw, struct _vte_draw_text_request *requests, gsize n_requests, - const PangoColor *color, guchar alpha, gboolean); + const PangoColor *color, guchar alpha, guint style); gboolean _vte_draw_char(struct _vte_draw *draw, struct _vte_draw_text_request *request, - const PangoColor *color, guchar alpha, gboolean bold); -gboolean _vte_draw_has_char(struct _vte_draw *draw, vteunistr c, gboolean bold); - + const PangoColor *color, guchar alpha, guint style); +gboolean _vte_draw_has_char(struct _vte_draw *draw, vteunistr c, guint style); void _vte_draw_fill_rectangle(struct _vte_draw *draw, gint x, gint y, gint width, gint height, @@ -110,6 +103,9 @@ void _vte_draw_fill_rectangle(struct _vte_draw *draw, void _vte_draw_draw_rectangle(struct _vte_draw *draw, gint x, gint y, gint width, gint height, const PangoColor *color, guchar alpha); +void _vte_draw_set_source_color_alpha (struct _vte_draw *draw, + const PangoColor *color, + guchar alpha); G_END_DECLS |