diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-08-15 05:52:24 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-08-15 05:52:24 +0000 |
commit | 1abc8682d3a0ff9850ee5dcf3e42cc586d08ee2e (patch) | |
tree | 1413d6b818451a643c9524974ecede92706b48cf /pango/pango-context.c | |
parent | b46553c08c77cadc6ee6fc593386e5249217371d (diff) | |
download | pango-1abc8682d3a0ff9850ee5dcf3e42cc586d08ee2e.tar.gz |
Add enum PangoGravity.
2006-08-15 Behdad Esfahbod <behdad@gnome.org>
* pango/pango-types.h: Add enum PangoGravity.
* pango/pango-context.h:
* pango/pango-context.c (pango_context_set_base_gravity),
(pango_context_get_base_gravity): New functions.
* pango/pango.def:
* docs/pango-sections.txt: Hook new API.
Diffstat (limited to 'pango/pango-context.c')
-rw-r--r-- | pango/pango-context.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c index 2e0c2bb4..827b877f 100644 --- a/pango/pango-context.c +++ b/pango/pango-context.c @@ -36,6 +36,8 @@ struct _PangoContext PangoLanguage *language; PangoDirection base_dir; + PangoGravity base_gravity; + PangoFontDescription *font_desc; PangoMatrix *matrix; @@ -57,6 +59,7 @@ static void pango_context_init (PangoContext *context) { context->base_dir = PANGO_DIRECTION_WEAK_LTR; + context->base_gravity = PANGO_GRAVITY_NORTH; context->language = NULL; context->font_map = NULL; @@ -402,6 +405,41 @@ pango_context_get_base_dir (PangoContext *context) return context->base_dir; } +/** + * pango_context_set_base_gravity: + * @context: a #PangoContext + * @gravity: the new base gravity + * + * Sets the base gravity for the context. + * + * The base gravity is used in laying vertical text out. + **/ +void +pango_context_set_base_gravity (PangoContext *context, + PangoGravity gravity) +{ + g_return_if_fail (context != NULL); + + context->base_gravity = gravity; +} + +/** + * pango_context_get_base_gravity: + * @context: a #PangoContext + * + * Retrieves the base gravity for the context. See + * pango_context_set_base_gravity(). + * + * Return value: the base gravity for the context. + **/ +PangoGravity +pango_context_get_base_gravity (PangoContext *context) +{ + g_return_val_if_fail (context != NULL, PANGO_GRAVITY_NORTH); + + return context->base_gravity; +} + /**********************************************************************/ static gboolean |