pangofc-decoder.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* Pango
  2. * pangofc-decoder.h: Custom encoders/decoders on a per-font basis.
  3. *
  4. * Copyright (C) 2004 Red Hat Software
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef __PANGO_DECODER_H_
  22. #define __PANGO_DECODER_H_
  23. #include <pango/pangofc-font.h>
  24. G_BEGIN_DECLS
  25. #ifdef __GI_SCANNER__
  26. #define PANGO_FC_TYPE_DECODER (pango_fc_decoder_get_type())
  27. #define PANGO_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FC_TYPE_DECODER, PangoFcDecoder))
  28. #define PANGO_FC_IS_DECODER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FC_TYPE_DECODER))
  29. #define PANGO_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_FC_TYPE_DECODER, PangoFcDecoderClass))
  30. #define PANGO_FC_IS_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_FC_TYPE_DECODER))
  31. #define PANGO_FC_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_FC_TYPE_DECODER, PangoFcDecoderClass))
  32. #else
  33. #define PANGO_TYPE_FC_DECODER (pango_fc_decoder_get_type())
  34. #define PANGO_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_DECODER, PangoFcDecoder))
  35. #define PANGO_IS_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_DECODER))
  36. #define PANGO_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass))
  37. #define PANGO_IS_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_DECODER))
  38. #define PANGO_FC_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass))
  39. #endif
  40. typedef struct _PangoFcDecoder PangoFcDecoder;
  41. typedef struct _PangoFcDecoderClass PangoFcDecoderClass;
  42. /**
  43. * PangoFcDecoder:
  44. *
  45. * `PangoFcDecoder` is a virtual base class that implementations will
  46. * inherit from.
  47. *
  48. * It's the interface that is used to define a custom encoding for a font.
  49. * These objects are created in your code from a function callback that was
  50. * originally registered with [method@PangoFc.FontMap.add_decoder_find_func].
  51. * Pango requires information about the supported charset for a font as well
  52. * as the individual character to glyph conversions. Pango gets that
  53. * information via the #get_charset and #get_glyph callbacks into your
  54. * object implementation.
  55. *
  56. * Since: 1.6
  57. **/
  58. struct _PangoFcDecoder
  59. {
  60. /*< private >*/
  61. GObject parent_instance;
  62. };
  63. /**
  64. * PangoFcDecoderClass:
  65. * @get_charset: This returns an `FcCharset` given a `PangoFcFont` that
  66. * includes a list of supported characters in the font. The
  67. * #FcCharSet that is returned should be an internal reference to your
  68. * code. Pango will not free this structure. It is important that
  69. * you make this callback fast because this callback is called
  70. * separately for each character to determine Unicode coverage.
  71. * @get_glyph: This returns a single `PangoGlyph` for a given Unicode
  72. * code point.
  73. *
  74. * Class structure for `PangoFcDecoder`.
  75. *
  76. * Since: 1.6
  77. **/
  78. struct _PangoFcDecoderClass
  79. {
  80. /*< private >*/
  81. GObjectClass parent_class;
  82. /* vtable - not signals */
  83. /*< public >*/
  84. FcCharSet *(*get_charset) (PangoFcDecoder *decoder,
  85. PangoFcFont *fcfont);
  86. PangoGlyph (*get_glyph) (PangoFcDecoder *decoder,
  87. PangoFcFont *fcfont,
  88. guint32 wc);
  89. /*< private >*/
  90. /* Padding for future expansion */
  91. void (*_pango_reserved1) (void);
  92. void (*_pango_reserved2) (void);
  93. void (*_pango_reserved3) (void);
  94. void (*_pango_reserved4) (void);
  95. };
  96. PANGO_AVAILABLE_IN_1_6
  97. GType pango_fc_decoder_get_type (void) G_GNUC_CONST;
  98. PANGO_AVAILABLE_IN_1_6
  99. FcCharSet *pango_fc_decoder_get_charset (PangoFcDecoder *decoder,
  100. PangoFcFont *fcfont);
  101. PANGO_AVAILABLE_IN_1_6
  102. PangoGlyph pango_fc_decoder_get_glyph (PangoFcDecoder *decoder,
  103. PangoFcFont *fcfont,
  104. guint32 wc);
  105. G_END_DECLS
  106. #endif /* __PANGO_DECODER_H_ */