PageRenderTime 67ms CodeModel.GetById 24ms app.highlight 39ms RepoModel.GetById 1ms app.codeStats 1ms

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