Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/pango-1.0/pango/pango-gravity.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* Pango
0002  * pango-gravity.h: Gravity routines
0003  *
0004  * Copyright (C) 2006, 2007 Red Hat Software
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public
0017  * License along with this library; if not, write to the
0018  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0019  * Boston, MA 02111-1307, USA.
0020  */
0021 
0022 #ifndef __PANGO_GRAVITY_H__
0023 #define __PANGO_GRAVITY_H__
0024 
0025 #include <glib.h>
0026 
0027 G_BEGIN_DECLS
0028 
0029 /**
0030  * PangoGravity:
0031  * @PANGO_GRAVITY_SOUTH: Glyphs stand upright (default) <img align="right" valign="center" src="m-south.png">
0032  * @PANGO_GRAVITY_EAST: Glyphs are rotated 90 degrees counter-clockwise. <img align="right" valign="center" src="m-east.png">
0033  * @PANGO_GRAVITY_NORTH: Glyphs are upside-down. <img align="right" valign="cener" src="m-north.png">
0034  * @PANGO_GRAVITY_WEST: Glyphs are rotated 90 degrees clockwise. <img align="right" valign="center" src="m-west.png">
0035  * @PANGO_GRAVITY_AUTO: Gravity is resolved from the context matrix
0036  *
0037  * `PangoGravity` represents the orientation of glyphs in a segment
0038  * of text.
0039  *
0040  * This is useful when rendering vertical text layouts. In those situations,
0041  * the layout is rotated using a non-identity [struct@Pango.Matrix], and then
0042  * glyph orientation is controlled using `PangoGravity`.
0043  *
0044  * Not every value in this enumeration makes sense for every usage of
0045  * `PangoGravity`; for example, %PANGO_GRAVITY_AUTO only can be passed to
0046  * [method@Pango.Context.set_base_gravity] and can only be returned by
0047  * [method@Pango.Context.get_base_gravity].
0048  *
0049  * See also: [enum@Pango.GravityHint]
0050  *
0051  * Since: 1.16
0052  */
0053 typedef enum {
0054   PANGO_GRAVITY_SOUTH,
0055   PANGO_GRAVITY_EAST,
0056   PANGO_GRAVITY_NORTH,
0057   PANGO_GRAVITY_WEST,
0058   PANGO_GRAVITY_AUTO
0059 } PangoGravity;
0060 
0061 /**
0062  * PangoGravityHint:
0063  * @PANGO_GRAVITY_HINT_NATURAL: scripts will take their natural gravity based
0064  *   on the base gravity and the script.  This is the default.
0065  * @PANGO_GRAVITY_HINT_STRONG: always use the base gravity set, regardless of
0066  *   the script.
0067  * @PANGO_GRAVITY_HINT_LINE: for scripts not in their natural direction (eg.
0068  *   Latin in East gravity), choose per-script gravity such that every script
0069  *   respects the line progression. This means, Latin and Arabic will take
0070  *   opposite gravities and both flow top-to-bottom for example.
0071  *
0072  * `PangoGravityHint` defines how horizontal scripts should behave in a
0073  * vertical context.
0074  *
0075  * That is, English excerpts in a vertical paragraph for example.
0076  *
0077  * See also [enum@Pango.Gravity]
0078  *
0079  * Since: 1.16
0080  */
0081 typedef enum {
0082   PANGO_GRAVITY_HINT_NATURAL,
0083   PANGO_GRAVITY_HINT_STRONG,
0084   PANGO_GRAVITY_HINT_LINE
0085 } PangoGravityHint;
0086 
0087 /**
0088  * PANGO_GRAVITY_IS_VERTICAL:
0089  * @gravity: the `PangoGravity` to check
0090  *
0091  * Whether a `PangoGravity` represents vertical writing directions.
0092  *
0093  * Returns: %TRUE if @gravity is %PANGO_GRAVITY_EAST or %PANGO_GRAVITY_WEST,
0094  *   %FALSE otherwise.
0095  *
0096  * Since: 1.16
0097  */
0098 #define PANGO_GRAVITY_IS_VERTICAL(gravity) \
0099     ((gravity) == PANGO_GRAVITY_EAST || (gravity) == PANGO_GRAVITY_WEST)
0100 
0101 /**
0102  * PANGO_GRAVITY_IS_IMPROPER:
0103  * @gravity: the `PangoGravity` to check
0104  *
0105  * Whether a `PangoGravity` represents a gravity that results in reversal
0106  * of text direction.
0107  *
0108  * Returns: %TRUE if @gravity is %PANGO_GRAVITY_WEST or %PANGO_GRAVITY_NORTH,
0109  *   %FALSE otherwise.
0110  *
0111  * Since: 1.32
0112  */
0113 #define PANGO_GRAVITY_IS_IMPROPER(gravity) \
0114     ((gravity) == PANGO_GRAVITY_WEST || (gravity) == PANGO_GRAVITY_NORTH)
0115 
0116 #include <pango/pango-matrix.h>
0117 #include <pango/pango-script.h>
0118 
0119 PANGO_AVAILABLE_IN_1_16
0120 double       pango_gravity_to_rotation    (PangoGravity       gravity) G_GNUC_CONST;
0121 PANGO_AVAILABLE_IN_1_16
0122 PangoGravity pango_gravity_get_for_matrix (const PangoMatrix *matrix) G_GNUC_PURE;
0123 PANGO_AVAILABLE_IN_1_16
0124 PangoGravity pango_gravity_get_for_script (PangoScript        script,
0125                        PangoGravity       base_gravity,
0126                        PangoGravityHint   hint) G_GNUC_CONST;
0127 PANGO_AVAILABLE_IN_1_26
0128 PangoGravity pango_gravity_get_for_script_and_width
0129                       (PangoScript        script,
0130                        gboolean           wide,
0131                        PangoGravity       base_gravity,
0132                        PangoGravityHint   hint) G_GNUC_CONST;
0133 
0134 
0135 G_END_DECLS
0136 
0137 #endif /* __PANGO_GRAVITY_H__ */