diff options
author | Nalin Dahyabhai <nalin@src.gnome.org> | 2003-04-09 20:01:50 +0000 |
---|---|---|
committer | Nalin Dahyabhai <nalin@src.gnome.org> | 2003-04-09 20:01:50 +0000 |
commit | 26307a1dfd36f7b9af30ebd28805cd59e48e3694 (patch) | |
tree | c230315b871193dda69a4bcc882e47c820db6ba2 /src/vteglyph.h | |
parent | f947682ae7c91de10542d69217496828122bd976 (diff) |
add specific checks for PangoX and glX. add drawing method using freetype
* configure.in: add specific checks for PangoX and glX.
* src/vteft2.c, src/vteft2.h: add drawing method using freetype and GdkRGB.
* src/vteglyph.c, src/vteglyph.h: add.
* src/vtepangox.c, src/vtepangox.h: add drawing method using PangoX.
* src/vtergb.c, src/vtergb.h: add.
* src/vtegl.c, src/vtegl.h: add placeholder drawing method using freetype and
glX.
* src/Makefile.am: add newly-added source files to libvte.la target.
* src/vtedraw.c, src/vtedraw.h: add get_visual and get_colormap methods so that
drawing methods can override the default visual and colormap. Rename
get_text_base() to get_text_ascent(), which is more correct. Remove
scroll(), which would just wrap gdk_window_scroll().
* src/vte.c: fix logic for choosing alternate render methods when VTE_USE_XFT
is "0".
* src/vteapp.c: add -- option to stop parsing options with getopt.
* src/vtefc.c: fix incorrect DPI read due to type mismatch (#109513).
Diffstat (limited to 'src/vteglyph.h')
-rw-r--r-- | src/vteglyph.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/vteglyph.h b/src/vteglyph.h new file mode 100644 index 0000000..6629a9c --- /dev/null +++ b/src/vteglyph.h @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2002,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 program 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. + * + * 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. + */ + +#ifndef vte_vteglyph_h_included +#define vte_vteglyph_h_included + +#ident "$Id$" + +#include <glib.h> +#include "vtergb.h" + +#include <fontconfig/fontconfig.h> + +#include <ft2build.h> +#include FT_FREETYPE_H + +enum vte_glyph_flags { + vte_glyph_bold = 1 << 0, + vte_glyph_dim = 1 << 1, + vte_glyph_underline = 1 << 2, + vte_glyph_underline2 = 1 << 3, + vte_glyph_strikethrough = 1 << 4, + vte_glyph_boxed = 1 << 5, +}; + +#define vte_glyph_double_underline \ + (vte_glyph_underline | vte_glyph_underline2) +#define vte_glyph_all \ + (vte_glyph_bold | vte_glyph_dim | \ + vte_glyph_underline | vte_glyph_underline2 | \ + vte_glyph_strikethrough | vte_glyph_boxed) + +struct _vte_glyph { + glong width; + glong height; + glong skip; + guchar bytes_per_pixel; + guchar bytes[1]; +}; + +struct _vte_glyph_cache { + GArray *patterns; + GList *faces; + GTree *cache; + gint ft_load_flags; + gint ft_render_flags; + glong width, height, ascent; + FT_Library ft_library; +}; + +struct _vte_glyph_cache *_vte_glyph_cache_new(void); +void _vte_glyph_cache_free(struct _vte_glyph_cache *cache); +const FcPattern *_vte_glyph_cache_get_pattern(struct _vte_glyph_cache *cache); +void _vte_glyph_cache_set_description(FcConfig *config, + struct _vte_glyph_cache *cache, + const PangoFontDescription *fontdesc); +gboolean _vte_glyph_cache_has_char(struct _vte_glyph_cache *cache, gunichar c); +const struct _vte_glyph *_vte_glyph_get(struct _vte_glyph_cache *cache, + gunichar c); +void _vte_glyph_draw(struct _vte_glyph_cache *cache, + gunichar c, GdkColor *color, + gint x, gint y, gint columns, + enum vte_glyph_flags flags, + struct _vte_rgb_buffer *buffer); +void _vte_glyph_draw_string(struct _vte_glyph_cache *cache, + const char *s, GdkColor *color, + gint x, gint y, + enum vte_glyph_flags flags, + struct _vte_rgb_buffer *buffer); + +#endif |