summaryrefslogtreecommitdiff
path: root/pango/pango-types.h
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-02-27 14:48:54 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-02-27 14:48:54 +0000
commit58a45b6a10cf9ca55b3216e233f6b516c75755de (patch)
treee6820c29dec5b9b8051a378a47bf4629bbfcdd47 /pango/pango-types.h
parentf27610770305444fcab90ce651f48265e41dfee2 (diff)
downloadpango-58a45b6a10cf9ca55b3216e233f6b516c75755de.tar.gz
Add some new enum and values and utilities for supporting automatically
Fri Feb 27 09:30:10 2004 Owen Taylor <otaylor@redhat.com> Add some new enum and values and utilities for supporting automatically determined base direction. (#70451, based on changes by Dov Grobgeld) * pango/pango-types.h docs/tmpl/main.sgml: Add PANGO_DIRECTION_WEAK_RTL/LTR, extend the docs for PangoDirection. * pango/pango-types.h pango/pango-utils.h: Move pango_get_mirror_char() to pango-types.h. * pango/mini-fribidi/fribidi.c (pango_log2vis_get_embedding_levels): Handle new values of PangoDirection, handle PANGO_DIRECTION_TTB_LTR/RTL as aliases for PANGO_DIRECTION_RTL/LTR. * pango/mini-fribidi/fribidi.c pango/pango-types.h: Add pango_unichar_direction(). * pango/pango-utils.c pango/pango-types.h: Add pango_find_base_dir()
Diffstat (limited to 'pango/pango-types.h')
-rw-r--r--pango/pango-types.h46
1 files changed, 41 insertions, 5 deletions
diff --git a/pango/pango-types.h b/pango/pango-types.h
index 993402aa..6f515ead 100644
--- a/pango/pango-types.h
+++ b/pango/pango-types.h
@@ -65,15 +65,45 @@ struct _PangoRectangle
#define PANGO_LBEARING(rect) ((rect).x)
#define PANGO_RBEARING(rect) ((rect).x + (rect).width)
-/* Information about a segment of text with a consistent
- * shaping/language engine and bidirectional level
- */
-
+/**
+ * PangoDirection:
+ * @PANGO_DIRECTION_LTR: A strong left-to-right direction
+ * @PANGO_DIRECTION_RTL: A strong right-to-left direction
+ * @PANGO_DIRECTION_TTB_LTR: Deprecated value; treated the
+ * same as %PANGO_DIRECTION_RTL.
+ * @PANGO_DIRECTION_TTB_RTL: Deprecated value; treated the
+ * same as PANGO_DIRECTION_LTR
+ * @PANGO_DIRECTION_WEAK_LTR: A weak left-to-right direction
+ * @PANGO_DIRECTION_WEAK_RTL: A weak right-to-left direction
+ * @PANGO_DIRECTION_NEUTRAL: No direction specified
+ *
+ * The #PangoDirection type represents a direction in the
+ * Unicode bidirectional algorithm; not every value in this
+ * enumeration makes sense for every usage of #PangoDirection;
+ * for example, the return value of pango_unichar_direction()
+ * and pango_find_base_direction() cannot be %PANGO_DIRECTION_WEAK_LTR
+ * or %PANGO_DIRECTION_WEAK_RTL, since every character is either
+ * neutral or has a strong direction; on the other hand
+ * %PANGO_DIRECTION_NEUTRAL doesn't make sense to pass
+ * to pango_log2vis_get_embedding_levels().
+ *
+ * The %PANGO_DIRECTION_TTB_LTR, %PANGO_DIRECTION_TTB_RTL
+ * values come from an earlier interpretation of this
+ * enumeration as the writing direction of a block of
+ * text and are no longer used; See the Text module of the
+ * CSS3 spec for how vertical text is planned to be handled
+ * in a future version of Pango. The explanation of why
+ * %PANGO_DIRECTION_TTB_LTR is treated as %PANGO_DIRECTION_RTL
+ * can be found there as well.
+ **/
typedef enum {
PANGO_DIRECTION_LTR,
PANGO_DIRECTION_RTL,
PANGO_DIRECTION_TTB_LTR,
- PANGO_DIRECTION_TTB_RTL
+ PANGO_DIRECTION_TTB_RTL,
+ PANGO_DIRECTION_WEAK_LTR,
+ PANGO_DIRECTION_WEAK_RTL,
+ PANGO_DIRECTION_NEUTRAL
} PangoDirection;
#define PANGO_TYPE_LANGUAGE (pango_language_get_type ())
@@ -85,6 +115,12 @@ PangoLanguage *pango_language_from_string (const char *language);
gboolean pango_language_matches (PangoLanguage *language,
const char *range_list);
+gboolean pango_get_mirror_char (gunichar ch,
+ gunichar *mirrored_ch);
+PangoDirection pango_unichar_direction (gunichar ch);
+PangoDirection pango_find_base_dir (const gchar *text,
+ gint length);
+
G_END_DECLS
#endif /* __PANGO_TYPES_H__ */