mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
ext/pango/gsttextoverlay.c: Revert API/ABI break from March 1. Keep 'halign' and 'valign' as string type properties, ...
Original commit message from CVS: * ext/pango/gsttextoverlay.c: (gst_text_overlay_class_init), (gst_text_overlay_init), (gst_text_overlay_set_property), (gst_text_overlay_get_property): Revert API/ABI break from March 1. Keep 'halign' and 'valign' as string type properties, but mark them deprecated. Add 'halignment' and 'valignment' properties that use enums instead of strings.
This commit is contained in:
parent
c12d7735ac
commit
9a76cd88c1
2 changed files with 67 additions and 17 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2006-03-08 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* ext/pango/gsttextoverlay.c: (gst_text_overlay_class_init),
|
||||
(gst_text_overlay_init), (gst_text_overlay_set_property),
|
||||
(gst_text_overlay_get_property):
|
||||
Revert API/ABI break from March 1. Keep 'halign' and 'valign'
|
||||
as string type properties, but mark them deprecated. Add
|
||||
'halignment' and 'valignment' properties that use enums
|
||||
instead of strings.
|
||||
|
||||
2006-03-08 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
|
||||
|
|
|
@ -103,8 +103,10 @@ static GstElementDetails text_overlay_details = {
|
|||
|
||||
#define DEFAULT_PROP_TEXT ""
|
||||
#define DEFAULT_PROP_SHADING FALSE
|
||||
#define DEFAULT_PROP_VALIGN GST_TEXT_OVERLAY_VALIGN_BASELINE
|
||||
#define DEFAULT_PROP_HALIGN GST_TEXT_OVERLAY_HALIGN_CENTER
|
||||
#define DEFAULT_PROP_VALIGNMENT GST_TEXT_OVERLAY_VALIGN_BASELINE
|
||||
#define DEFAULT_PROP_HALIGNMENT GST_TEXT_OVERLAY_HALIGN_CENTER
|
||||
#define DEFAULT_PROP_VALIGN "baseline"
|
||||
#define DEFAULT_PROP_HALIGN "center"
|
||||
#define DEFAULT_PROP_XPAD 25
|
||||
#define DEFAULT_PROP_YPAD 25
|
||||
#define DEFAULT_PROP_DELTAX 0
|
||||
|
@ -120,8 +122,10 @@ enum
|
|||
PROP_0,
|
||||
PROP_TEXT,
|
||||
PROP_SHADING,
|
||||
PROP_VALIGN,
|
||||
PROP_HALIGN,
|
||||
PROP_VALIGN, /* deprecated */
|
||||
PROP_HALIGN, /* deprecated */
|
||||
PROP_HALIGNMENT,
|
||||
PROP_VALIGNMENT,
|
||||
PROP_XPAD,
|
||||
PROP_YPAD,
|
||||
PROP_DELTAX,
|
||||
|
@ -308,15 +312,23 @@ gst_text_overlay_class_init (GstTextOverlayClass * klass)
|
|||
g_param_spec_boolean ("shaded-background", "shaded background",
|
||||
"Whether to shade the background under the text area",
|
||||
DEFAULT_PROP_SHADING, G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_VALIGN,
|
||||
g_param_spec_enum ("valign", "vertical alignment",
|
||||
"Vertical alignment of the text. ",
|
||||
GST_TYPE_TEXT_OVERLAY_VALIGN, DEFAULT_PROP_VALIGN,
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_VALIGNMENT,
|
||||
g_param_spec_enum ("valignment", "vertical alignment",
|
||||
"Vertical alignment of the text",
|
||||
GST_TYPE_TEXT_OVERLAY_VALIGN, DEFAULT_PROP_VALIGNMENT,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HALIGNMENT,
|
||||
g_param_spec_enum ("halignment", "horizontal alignment",
|
||||
"Horizontal alignment of the text", GST_TYPE_TEXT_OVERLAY_HALIGN,
|
||||
DEFAULT_PROP_HALIGNMENT, G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_VALIGN,
|
||||
g_param_spec_string ("valign", "vertical alignment",
|
||||
"Vertical alignment of the text (deprecated; use valignment)",
|
||||
DEFAULT_PROP_VALIGN, G_PARAM_WRITABLE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HALIGN,
|
||||
g_param_spec_enum ("halign", "horizontal alignment",
|
||||
"Horizontal alignment of the text. ", GST_TYPE_TEXT_OVERLAY_HALIGN,
|
||||
DEFAULT_PROP_HALIGN, G_PARAM_READWRITE));
|
||||
g_param_spec_string ("halign", "horizontal alignment",
|
||||
"Horizontal alignment of the text (deprecated; use halignment)",
|
||||
DEFAULT_PROP_HALIGN, G_PARAM_WRITABLE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_XPAD,
|
||||
g_param_spec_int ("xpad", "horizontal paddding",
|
||||
"Horizontal paddding when using left/right alignment", 0, G_MAXINT,
|
||||
|
@ -425,8 +437,8 @@ gst_text_overlay_init (GstTextOverlay * overlay, GstTextOverlayClass * klass)
|
|||
pango_layout_new (GST_TEXT_OVERLAY_GET_CLASS (overlay)->pango_context);
|
||||
memset (&overlay->bitmap, 0, sizeof (overlay->bitmap));
|
||||
|
||||
overlay->halign = DEFAULT_PROP_HALIGN;
|
||||
overlay->valign = DEFAULT_PROP_VALIGN;
|
||||
overlay->halign = DEFAULT_PROP_HALIGNMENT;
|
||||
overlay->valign = DEFAULT_PROP_VALIGNMENT;
|
||||
overlay->xpad = DEFAULT_PROP_XPAD;
|
||||
overlay->ypad = DEFAULT_PROP_YPAD;
|
||||
overlay->deltax = DEFAULT_PROP_DELTAX;
|
||||
|
@ -558,10 +570,38 @@ gst_text_overlay_set_property (GObject * object, guint prop_id,
|
|||
case PROP_DELTAY:
|
||||
overlay->deltay = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_VALIGN:
|
||||
case PROP_HALIGN:{
|
||||
const gchar *s = g_value_get_string (value);
|
||||
|
||||
if (s && g_ascii_strcasecmp (s, "left") == 0)
|
||||
overlay->valign = GST_TEXT_OVERLAY_HALIGN_LEFT;
|
||||
else if (s && g_ascii_strcasecmp (s, "center") == 0)
|
||||
overlay->valign = GST_TEXT_OVERLAY_HALIGN_CENTER;
|
||||
else if (s && g_ascii_strcasecmp (s, "right") == 0)
|
||||
overlay->valign = GST_TEXT_OVERLAY_HALIGN_RIGHT;
|
||||
else
|
||||
g_warning ("Invalid value '%s' for textoverlay property 'halign'",
|
||||
GST_STR_NULL (s));
|
||||
break;
|
||||
}
|
||||
case PROP_VALIGN:{
|
||||
const gchar *s = g_value_get_string (value);
|
||||
|
||||
if (s && g_ascii_strcasecmp (s, "baseline") == 0)
|
||||
overlay->valign = GST_TEXT_OVERLAY_VALIGN_BASELINE;
|
||||
else if (s && g_ascii_strcasecmp (s, "bottom") == 0)
|
||||
overlay->valign = GST_TEXT_OVERLAY_VALIGN_BOTTOM;
|
||||
else if (s && g_ascii_strcasecmp (s, "top") == 0)
|
||||
overlay->valign = GST_TEXT_OVERLAY_VALIGN_TOP;
|
||||
else
|
||||
g_warning ("Invalid value '%s' for textoverlay property 'valign'",
|
||||
GST_STR_NULL (s));
|
||||
break;
|
||||
}
|
||||
case PROP_VALIGNMENT:
|
||||
overlay->valign = g_value_get_enum (value);
|
||||
break;
|
||||
case PROP_HALIGN:
|
||||
case PROP_HALIGNMENT:
|
||||
overlay->halign = g_value_get_enum (value);
|
||||
break;
|
||||
case PROP_WRAP_MODE:
|
||||
|
@ -620,10 +660,10 @@ gst_text_overlay_get_property (GObject * object, guint prop_id,
|
|||
case PROP_DELTAY:
|
||||
g_value_set_int (value, overlay->deltay);
|
||||
break;
|
||||
case PROP_VALIGN:
|
||||
case PROP_VALIGNMENT:
|
||||
g_value_set_enum (value, overlay->valign);
|
||||
break;
|
||||
case PROP_HALIGN:
|
||||
case PROP_HALIGNMENT:
|
||||
g_value_set_enum (value, overlay->halign);
|
||||
break;
|
||||
case PROP_WRAP_MODE:
|
||||
|
|
Loading…
Reference in a new issue