From 52bec51bff97bd54e16e585c6faf26f9c7186d91 Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Fri, 2 Jul 2010 12:12:30 +0200 Subject: [PATCH] add text positioning enums --- docs/libs/ges-sections.txt | 8 ++++++++ ges/ges-enums.c | 42 ++++++++++++++++++++++++++++++++++++++++++ ges/ges-enums.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) diff --git a/docs/libs/ges-sections.txt b/docs/libs/ges-sections.txt index 70e0289..974124b 100644 --- a/docs/libs/ges-sections.txt +++ b/docs/libs/ges-sections.txt @@ -21,6 +21,14 @@ ges_video_transition_type_get_type GESTrackType GES_TYPE_TRACK_TYPE ges_track_type_get_type +GESTextHAlign +DEFAULT_HALIGNMENT +GES_TEXT_HALIGN_TYPE +ges_text_halign_get_type +GESTextVAlign +DEFAULT_VALIGNMENT +GES_TEXT_VALIGN_TYPE +ges_text_valign_get_type
diff --git a/ges/ges-enums.c b/ges/ges-enums.c index f811b11..5cb7153 100644 --- a/ges/ges-enums.c +++ b/ges/ges-enums.c @@ -421,3 +421,45 @@ ges_video_transition_type_get_type (void) return the_type; } + +GType +ges_text_valign_get_type (void) +{ + static GType text_overlay_valign_type = 0; + static gsize initialized = 0; + static const GEnumValue text_overlay_valign[] = { + {GES_TEXT_VALIGN_BASELINE, "baseline", "baseline"}, + {GES_TEXT_VALIGN_BOTTOM, "bottom", "bottom"}, + {GES_TEXT_VALIGN_TOP, "top", "top"}, + {0, NULL, NULL}, + }; + + if (g_once_init_enter (&initialized)) { + text_overlay_valign_type = + g_enum_register_static ("GESTimelineTextOverlayVAlign", + text_overlay_valign); + g_once_init_leave (&initialized, 1); + } + return text_overlay_valign_type; +} + +GType +ges_text_halign_get_type (void) +{ + static GType text_overlay_halign_type = 0; + static gsize initialized = 0; + static const GEnumValue text_overlay_halign[] = { + {GES_TEXT_HALIGN_LEFT, "left", "left"}, + {GES_TEXT_HALIGN_CENTER, "center", "center"}, + {GES_TEXT_HALIGN_RIGHT, "right", "right"}, + {0, NULL, NULL}, + }; + + if (g_once_init_enter (&initialized)) { + text_overlay_halign_type = + g_enum_register_static ("GESTimelineTextOverlayHAlign", + text_overlay_halign); + g_once_init_leave (&initialized, 1); + } + return text_overlay_halign_type; +} diff --git a/ges/ges-enums.h b/ges/ges-enums.h index 00a563d..ef8e1b2 100644 --- a/ges/ges-enums.h +++ b/ges/ges-enums.h @@ -209,6 +209,48 @@ extern GEnumValue transition_types[]; GType ges_video_transition_type_get_type (void); +/** + * GESTextVAlign: + * @GES_TEXT_VALIGN_BASELINE: draw text on the baseline + * @GES_TEXT_VALIGN_BOTTOM: draw text on the bottom + * @GES_TEXT_VALIGN_TOP: draw test on top + * + * Vertical alignment of the text. + */ +typedef enum { + GES_TEXT_VALIGN_BASELINE, + GES_TEXT_VALIGN_BOTTOM, + GES_TEXT_VALIGN_TOP +} GESTextVAlign; + +#define DEFAULT_VALIGNMENT GES_TEXT_VALIGN_BASELINE + +#define GES_TEXT_VALIGN_TYPE\ + (ges_text_valign_get_type ()) + +GType ges_text_valign_get_type (void); + +/** + * GESTextHAlign: + * @GES_TEXT_HALIGN_LEFT: align text left + * @GES_TEXT_HALIGN_CENTER: align text center + * @GES_TEXT_HALIGN_RIGHT: align text right + * + * Horizontal alignment of the text. + */ +typedef enum { + GES_TEXT_HALIGN_LEFT, + GES_TEXT_HALIGN_CENTER, + GES_TEXT_HALIGN_RIGHT +} GESTextHAlign; + +#define DEFAULT_HALIGNMENT GES_TEXT_HALIGN_CENTER + +#define GES_TEXT_HALIGN_TYPE\ + (ges_text_halign_get_type ()) + +GType ges_text_halign_get_type (void); + G_END_DECLS #endif /* __GES_ENUMS_H__ */ -- 2.7.4