/binding/pango/gravity.d

http://github.com/wilkie/djehuty · D · 115 lines · 21 code · 13 blank · 81 comment · 0 complexity · aa98d2cf74d75f5502c8ce16657c8add MD5 · raw file

  1. /*
  2. * gravity.d
  3. *
  4. * This file holds bindings to pango's pango-gravity.h. The original
  5. * copyright is displayed below, but does not pertain to this file.
  6. *
  7. * Author: Dave Wilkinson
  8. *
  9. */
  10. module binding.pango.gravity;
  11. /* Pango
  12. * pango-gravity.h: Gravity routines
  13. *
  14. * Copyright (C) 2006, 2007 Red Hat Software
  15. *
  16. * This library is free software; you can redistribute it and/or
  17. * modify it under the terms of the GNU Library General Public
  18. * License as published by the Free Software Foundation; either
  19. * version 2 of the License, or (at your option) any later version.
  20. *
  21. * This library is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  24. * Library General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Library General Public
  27. * License along with this library; if not, write to the
  28. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  29. * Boston, MA 02111-1307, USA.
  30. */
  31. /**
  32. * PangoGravity:
  33. * @PANGO_GRAVITY_SOUTH: Glyphs stand upright (default)
  34. * @PANGO_GRAVITY_EAST: Glyphs are rotated 90 degrees clockwise
  35. * @PANGO_GRAVITY_NORTH: Glyphs are upside-down
  36. * @PANGO_GRAVITY_WEST: Glyphs are rotated 90 degrees counter-clockwise
  37. * @PANGO_GRAVITY_AUTO: Gravity is resolved from the context matrix
  38. *
  39. * The #PangoGravity type represents the orientation of glyphs in a segment
  40. * of text. This is useful when rendering vertical text layouts. In
  41. * those situations, the layout is rotated using a non-identity PangoMatrix,
  42. * and then glyph orientation is controlled using #PangoGravity.
  43. * Not every value in this enumeration makes sense for every usage of
  44. * #PangoGravity; for example, %PANGO_GRAVITY_AUTO only can be passed to
  45. * pango_context_set_base_gravity() and can only be returned by
  46. * pango_context_get_base_gravity().
  47. *
  48. * See also: #PangoGravityHint
  49. *
  50. * Since: 1.16
  51. **/
  52. enum PangoGravity {
  53. PANGO_GRAVITY_SOUTH,
  54. PANGO_GRAVITY_EAST,
  55. PANGO_GRAVITY_NORTH,
  56. PANGO_GRAVITY_WEST,
  57. PANGO_GRAVITY_AUTO
  58. }
  59. /**
  60. * PangoGravityHint:
  61. * @PANGO_GRAVITY_HINT_NATURAL: scripts will take their natural gravity based
  62. * on the base gravity and the script. This is the default.
  63. * @PANGO_GRAVITY_HINT_STRONG: always use the base gravity set, regardless of
  64. * the script.
  65. * @PANGO_GRAVITY_HINT_LINE: for scripts not in their natural direction (eg.
  66. * Latin in East gravity), choose per-script gravity such that every script
  67. * respects the line progression. This means, Latin and Arabic will take
  68. * opposite gravities and both flow top-to-bottom for example.
  69. *
  70. * The #PangoGravityHint defines how horizontal scripts should behave in a
  71. * vertical context. That is, English excerpt in a vertical paragraph for
  72. * example.
  73. *
  74. * See #PangoGravity.
  75. *
  76. * Since: 1.16
  77. **/
  78. enum PangoGravityHint {
  79. PANGO_GRAVITY_HINT_NATURAL,
  80. PANGO_GRAVITY_HINT_STRONG,
  81. PANGO_GRAVITY_HINT_LINE
  82. }
  83. /**
  84. * PANGO_GRAVITY_IS_VERTICAL:
  85. * @gravity: the #PangoGravity to check
  86. *
  87. * Whether a #PangoGravity represents vertical writing directions.
  88. *
  89. * Returns: %TRUE if @gravity is %PANGO_GRAVITY_EAST or %PANGO_GRAVITY_WEST,
  90. * %FALSE otherwise.
  91. *
  92. * Since: 1.16
  93. **/
  94. //#define PANGO_GRAVITY_IS_VERTICAL(gravity) ((gravity) == PANGO_GRAVITY_EAST || (gravity) == PANGO_GRAVITY_WEST)
  95. import binding.pango.matrix;
  96. import binding.pango.script;
  97. extern(C):
  98. double pango_gravity_to_rotation (PangoGravity gravity);
  99. PangoGravity pango_gravity_get_for_matrix (PangoMatrix *matrix);
  100. PangoGravity pango_gravity_get_for_script (PangoScript script,
  101. PangoGravity base_gravity,
  102. PangoGravityHint hint);