summaryrefslogtreecommitdiff
path: root/pango/pangofc-decoder.h
blob: 6268c428d771ecb6bc9df41b73ebd0f3c4b0c847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/* Pango
 * pangofc-decoder.h: Custom encoders/decoders on a per-font basis.
 *
 * Copyright (C) 2004 Red Hat Software
 *
 * This library 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 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef __PANGO_DECODER_H_
#define __PANGO_DECODER_H_

#include <pango/pangofc-font.h>

G_BEGIN_DECLS

#ifdef __GI_SCANNER__
#define PANGO_FC_TYPE_DECODER                   (pango_fc_decoder_get_type())
#define PANGO_FC_DECODER(object)                (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FC_TYPE_DECODER, PangoFcDecoder))
#define PANGO_FC_IS_DECODER(object)             (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FC_TYPE_DECODER))
#define PANGO_FC_DECODER_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_FC_TYPE_DECODER, PangoFcDecoderClass))
#define PANGO_FC_IS_DECODER_CLASS(klass)        (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_FC_TYPE_DECODER))
#define PANGO_FC_DECODER_GET_CLASS(obj)         (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_FC_TYPE_DECODER, PangoFcDecoderClass))
#else
#define PANGO_TYPE_FC_DECODER                   (pango_fc_decoder_get_type())
#define PANGO_FC_DECODER(object)                (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_DECODER, PangoFcDecoder))
#define PANGO_IS_FC_DECODER(object)             (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_DECODER))
#define PANGO_FC_DECODER_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass))
#define PANGO_IS_FC_DECODER_CLASS(klass)        (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_DECODER))
#define PANGO_FC_DECODER_GET_CLASS(obj)         (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass))
#endif

typedef struct _PangoFcDecoder      PangoFcDecoder;
typedef struct _PangoFcDecoderClass PangoFcDecoderClass;

/**
 * PangoFcDecoder:
 *
 * `PangoFcDecoder` is a virtual base class that implementations will
 * inherit from.
 *
 * It's the interface that is used to define a custom encoding for a font.
 * These objects are created in your code from a function callback that was
 * originally registered with [method@PangoFc.FontMap.add_decoder_find_func].
 * Pango requires information about the supported charset for a font as well
 * as the individual character to glyph conversions. Pango gets that
 * information via the #get_charset and #get_glyph callbacks into your
 * object implementation.
 *
 * Since: 1.6
 **/
struct _PangoFcDecoder
{
  /*< private >*/
  GObject parent_instance;
};

/**
 * PangoFcDecoderClass:
 * @get_charset: This returns an `FcCharset` given a `PangoFcFont` that
 *  includes a list of supported characters in the font.  The
 *  #FcCharSet that is returned should be an internal reference to your
 *  code.  Pango will not free this structure.  It is important that
 *  you make this callback fast because this callback is called
 *  separately for each character to determine Unicode coverage.
 * @get_glyph: This returns a single `PangoGlyph` for a given Unicode
 *  code point.
 *
 * Class structure for `PangoFcDecoder`.
 *
 * Since: 1.6
 **/
struct _PangoFcDecoderClass
{
  /*< private >*/
  GObjectClass parent_class;

  /* vtable - not signals */
  /*< public >*/
  FcCharSet  *(*get_charset) (PangoFcDecoder *decoder,
			      PangoFcFont    *fcfont);
  PangoGlyph  (*get_glyph)   (PangoFcDecoder *decoder,
			      PangoFcFont    *fcfont,
			      guint32         wc);

  /*< private >*/

  /* Padding for future expansion */
  void (*_pango_reserved1) (void);
  void (*_pango_reserved2) (void);
  void (*_pango_reserved3) (void);
  void (*_pango_reserved4) (void);
};

PANGO_AVAILABLE_IN_1_6
GType      pango_fc_decoder_get_type    (void) G_GNUC_CONST;

PANGO_AVAILABLE_IN_1_6
FcCharSet *pango_fc_decoder_get_charset (PangoFcDecoder *decoder,
					 PangoFcFont    *fcfont);

PANGO_AVAILABLE_IN_1_6
PangoGlyph pango_fc_decoder_get_glyph   (PangoFcDecoder *decoder,
					 PangoFcFont    *fcfont,
					 guint32         wc);

G_END_DECLS

#endif /* __PANGO_DECODER_H_ */