Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-18 10:28:16

0001 /* Pango
0002  * pangoxft-render.h: Rendering routines for the Xft library
0003  *
0004  * Copyright (C) 2004 Red Hat Software
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public
0017  * License along with this library; if not, write to the
0018  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0019  * Boston, MA 02111-1307, USA.
0020  */
0021 
0022 #ifndef __PANGOXFT_RENDER_H__
0023 #define __PANGOXFT_RENDER_H__
0024 
0025 #include <pango/pango-renderer.h>
0026 
0027 G_BEGIN_DECLS
0028 
0029 #define _XFT_NO_COMPAT_
0030 #include <X11/Xlib.h>
0031 #include <X11/Xft/Xft.h>
0032 #if defined(XftVersion) && XftVersion >= 20000
0033 #else
0034 #error "must have Xft version 2 or newer"
0035 #endif
0036 
0037 typedef struct _PangoXftRenderer        PangoXftRenderer;
0038 typedef struct _PangoXftRendererClass   PangoXftRendererClass;
0039 typedef struct _PangoXftRendererPrivate PangoXftRendererPrivate;
0040 
0041 #ifdef __GI_SCANNER__
0042 #define PANGO_XFT_TYPE_RENDERER            (pango_xft_renderer_get_type())
0043 #define PANGO_XFT_RENDERER(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_XFT_TYPE_RENDERER, PangoXftRenderer))
0044 #define PANGO_XFT_IS_RENDERER(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_XFT_TYPE_RENDERER))
0045 #define PANGO_XFT_RENDERER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_XFT_TYPE_RENDERER, PangoXftRendererClass))
0046 #define PANGO_XFT_IS_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_XFT_TYPE_RENDERER))
0047 #define PANGO_XFT_RENDERER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_XFT_TYPE_RENDERER, PangoXftRendererClass))
0048 #else
0049 #define PANGO_TYPE_XFT_RENDERER            (pango_xft_renderer_get_type())
0050 #define PANGO_XFT_RENDERER(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_RENDERER, PangoXftRenderer))
0051 #define PANGO_IS_XFT_RENDERER(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_XFT_RENDERER))
0052 #define PANGO_XFT_RENDERER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_XFT_RENDERER, PangoXftRendererClass))
0053 #define PANGO_IS_XFT_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_XFT_RENDERER))
0054 #define PANGO_XFT_RENDERER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_XFT_RENDERER, PangoXftRendererClass))
0055 #endif
0056 
0057 /**
0058  * PangoXftRenderer:
0059  *
0060  * `PangoXftRenderer` is a subclass of `PangoRenderer` used for rendering
0061  * with Pango's Xft backend. It can be used directly, or it can be
0062  * further subclassed to modify exactly how drawing of individual
0063  * elements occurs.
0064  *
0065  * Since: 1.8
0066  */
0067 struct _PangoXftRenderer
0068 {
0069   /*< private >*/
0070   PangoRenderer parent_instance;
0071 
0072   Display *display;
0073   int screen;
0074   XftDraw *draw;
0075 
0076   PangoXftRendererPrivate *priv;
0077 };
0078 
0079 /**
0080  * PangoXftRendererClass:
0081  * @composite_trapezoids: draw the specified trapezoids using
0082  *   the current color and other attributes for @part
0083  * @composite_glyphs: draw the specified glyphs using
0084  *   the current foreground color and other foreground
0085  *   attributes
0086  *
0087  * The class structure for `PangoXftRenderer`
0088  *
0089  * Since: 1.8
0090  */
0091 struct _PangoXftRendererClass
0092 {
0093   /*< private >*/
0094   PangoRendererClass parent_class;
0095 
0096   /*< public >*/
0097   void (*composite_trapezoids) (PangoXftRenderer *xftrenderer,
0098                 PangoRenderPart   part,
0099                 XTrapezoid       *trapezoids,
0100                 int               n_trapezoids);
0101   void (*composite_glyphs)     (PangoXftRenderer *xftrenderer,
0102                 XftFont          *xft_font,
0103                 XftGlyphSpec     *glyphs,
0104                 int               n_glyphs);
0105 };
0106 
0107 PANGO_AVAILABLE_IN_1_8
0108 GType pango_xft_renderer_get_type    (void) G_GNUC_CONST;
0109 
0110 PANGO_AVAILABLE_IN_1_8
0111 PangoRenderer *pango_xft_renderer_new                 (Display          *display,
0112                                int               screen);
0113 PANGO_AVAILABLE_IN_1_8
0114 void           pango_xft_renderer_set_draw            (PangoXftRenderer *xftrenderer,
0115                                XftDraw          *draw);
0116 PANGO_AVAILABLE_IN_1_8
0117 void           pango_xft_renderer_set_default_color   (PangoXftRenderer *xftrenderer,
0118                                PangoColor       *default_color);
0119 
0120 PANGO_AVAILABLE_IN_ALL
0121 void pango_xft_render             (XftDraw          *draw,
0122                    XftColor         *color,
0123                    PangoFont        *font,
0124                    PangoGlyphString *glyphs,
0125                    gint              x,
0126                    gint              y);
0127 PANGO_AVAILABLE_IN_ALL
0128 void pango_xft_picture_render     (Display          *display,
0129                    Picture           src_picture,
0130                    Picture           dest_picture,
0131                    PangoFont        *font,
0132                    PangoGlyphString *glyphs,
0133                    gint              x,
0134                    gint              y);
0135 PANGO_AVAILABLE_IN_1_8
0136 void pango_xft_render_transformed (XftDraw          *draw,
0137                    XftColor         *color,
0138                    PangoMatrix      *matrix,
0139                    PangoFont        *font,
0140                    PangoGlyphString *glyphs,
0141                    int               x,
0142                    int               y);
0143 PANGO_AVAILABLE_IN_1_8
0144 void pango_xft_render_layout_line (XftDraw          *draw,
0145                    XftColor         *color,
0146                    PangoLayoutLine  *line,
0147                    int               x,
0148                    int               y);
0149 PANGO_AVAILABLE_IN_1_8
0150 void pango_xft_render_layout      (XftDraw          *draw,
0151                    XftColor         *color,
0152                    PangoLayout      *layout,
0153                    int               x,
0154                    int               y);
0155 
0156 G_END_DECLS
0157 
0158 #endif /* __PANGOXFT_RENDER_H__ */
0159