pango-item.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* Pango
  2. * pango-item.h: Structure for storing run information
  3. *
  4. * Copyright (C) 2000 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_ITEM_H__
  22. #define __PANGO_ITEM_H__
  23. #include <pango/pango-types.h>
  24. G_BEGIN_DECLS
  25. typedef struct _PangoAnalysis PangoAnalysis;
  26. typedef struct _PangoItem PangoItem;
  27. /**
  28. * PANGO_ANALYSIS_FLAG_CENTERED_BASELINE:
  29. *
  30. * Whether the segment should be shifted to center around the baseline.
  31. * Used in vertical writing directions mostly.
  32. *
  33. * Since: 1.16
  34. */
  35. #define PANGO_ANALYSIS_FLAG_CENTERED_BASELINE (1 << 0)
  36. /**
  37. * PANGO_ANALYSIS_FLAG_IS_ELLIPSIS:
  38. *
  39. * This flag is used to mark runs that hold ellipsized text,
  40. * in an ellipsized layout.
  41. *
  42. * Since: 1.36.7
  43. */
  44. #define PANGO_ANALYSIS_FLAG_IS_ELLIPSIS (1 << 1)
  45. /**
  46. * PangoAnalysis:
  47. * @shape_engine: the engine for doing rendering-system-dependent processing.
  48. * @lang_engine: the engine for doing rendering-system-independent processing.
  49. * @font: the font for this segment.
  50. * @level: the bidirectional level for this segment.
  51. * @gravity: the glyph orientation for this segment (A #PangoGravity).
  52. * @flags: boolean flags for this segment (currently only one) (Since: 1.16).
  53. * @script: the detected script for this segment (A #PangoScript) (Since: 1.18).
  54. * @language: the detected language for this segment.
  55. * @extra_attrs: extra attributes for this segment.
  56. *
  57. * The #PangoAnalysis structure stores information about
  58. * the properties of a segment of text.
  59. */
  60. struct _PangoAnalysis
  61. {
  62. PangoEngineShape *shape_engine;
  63. PangoEngineLang *lang_engine;
  64. PangoFont *font;
  65. guint8 level;
  66. guint8 gravity; /* PangoGravity */
  67. guint8 flags;
  68. guint8 script; /* PangoScript */
  69. PangoLanguage *language;
  70. GSList *extra_attrs;
  71. };
  72. /**
  73. * PangoItem:
  74. * @offset: byte offset of the start of this item in text.
  75. * @length: length of this item in bytes.
  76. * @num_chars: number of Unicode characters in the item.
  77. * @analysis: analysis results for the item.
  78. *
  79. * The #PangoItem structure stores information about a segment of text.
  80. */
  81. struct _PangoItem
  82. {
  83. gint offset;
  84. gint length;
  85. gint num_chars;
  86. PangoAnalysis analysis;
  87. };
  88. #define PANGO_TYPE_ITEM (pango_item_get_type ())
  89. GType pango_item_get_type (void) G_GNUC_CONST;
  90. PangoItem *pango_item_new (void);
  91. PangoItem *pango_item_copy (PangoItem *item);
  92. void pango_item_free (PangoItem *item);
  93. PangoItem *pango_item_split (PangoItem *orig,
  94. int split_index,
  95. int split_offset);
  96. G_END_DECLS
  97. #endif /* __PANGO_ITEM_H__ */