Commit d6a118bd authored by Laurent Aimar's avatar Laurent Aimar

Splitted out text_style_t and related function to its own header.

parent 8f0d6292
...@@ -257,7 +257,6 @@ typedef struct spu_t spu_t; ...@@ -257,7 +257,6 @@ typedef struct spu_t spu_t;
typedef struct subpicture_t subpicture_t; typedef struct subpicture_t subpicture_t;
typedef struct subpicture_sys_t subpicture_sys_t; typedef struct subpicture_sys_t subpicture_sys_t;
typedef struct subpicture_region_t subpicture_region_t; typedef struct subpicture_region_t subpicture_region_t;
typedef struct text_style_t text_style_t;
typedef struct image_handler_t image_handler_t; typedef struct image_handler_t image_handler_t;
......
...@@ -215,73 +215,6 @@ VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *, picture_t *, const video_fo ...@@ -215,73 +215,6 @@ VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *, picture_t *, const video_fo
#define OSD_SPEAKER_ICON 3 #define OSD_SPEAKER_ICON 3
#define OSD_MUTE_ICON 4 #define OSD_MUTE_ICON 4
/**
* Text style
*
* A text style is used to specify the formatting of text.
* A font renderer can use the supplied information to render the
* text specified.
*/
struct text_style_t
{
char * psz_fontname; /**< The name of the font */
int i_font_size; /**< The font size in pixels */
int i_font_color; /**< The color of the text 0xRRGGBB
(native endianness) */
int i_font_alpha; /**< The transparency of the text.
0x00 is fully opaque,
0xFF fully transparent */
int i_style_flags; /**< Formatting style flags */
int i_outline_color; /**< The color of the outline 0xRRGGBB */
int i_outline_alpha; /**< The transparency of the outline.
0x00 is fully opaque,
0xFF fully transparent */
int i_shadow_color; /**< The color of the shadow 0xRRGGBB */
int i_shadow_alpha; /**< The transparency of the shadow.
0x00 is fully opaque,
0xFF fully transparent */
int i_background_color;/**< The color of the background 0xRRGGBB */
int i_background_alpha;/**< The transparency of the background.
0x00 is fully opaque,
0xFF fully transparent */
int i_karaoke_background_color;/**< Background color for karaoke 0xRRGGBB */
int i_karaoke_background_alpha;/**< The transparency of the karaoke bg.
0x00 is fully opaque,
0xFF fully transparent */
int i_outline_width; /**< The width of the outline in pixels */
int i_shadow_width; /**< The width of the shadow in pixels */
int i_spacing; /**< The spaceing between glyphs in pixels */
};
/* Style flags for \ref text_style_t */
#define STYLE_BOLD 1
#define STYLE_ITALIC 2
#define STYLE_OUTLINE 4
#define STYLE_SHADOW 8
#define STYLE_BACKGROUND 16
#define STYLE_UNDERLINE 32
#define STYLE_STRIKEOUT 64
/**
* Create a default text style
*/
VLC_EXPORT( text_style_t *, text_style_New, ( void ) );
/**
* Copy a text style into another
*/
VLC_EXPORT( text_style_t *, text_style_Copy, ( text_style_t *, const text_style_t * ) );
/**
* Duplicate a text style
*/
VLC_EXPORT( text_style_t *, text_style_Duplicate, ( const text_style_t * ) );
/**
* Delete a text style created by text_style_New or text_style_Duplicate
*/
VLC_EXPORT( void, text_style_Delete, ( text_style_t * ) );
/** /**
* OSD menu button states * OSD menu button states
* *
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
*/ */
#include <vlc_picture.h> #include <vlc_picture.h>
#include <vlc_text_style.h>
/** /**
* \defgroup subpicture Video Subpictures * \defgroup subpicture Video Subpictures
......
/*****************************************************************************
* vlc_text_style.h: text_style_t definition and helpers.
*****************************************************************************
* Copyright (C) 1999-2010 the VideoLAN team
* $Id$
*
* Authors: Derk-Jan Hartman <hartman _AT_ videolan _DOT_ org>
* basOS G <noxelia 4t gmail , com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_TEXT_STYLE_H
#define VLC_TEXT_STYLE_H 1
#ifdef __cplusplus
extern "C" {
#endif
/**
* Text style
*
* A text style is used to specify the formatting of text.
* A font renderer can use the supplied information to render the
* text specified.
*/
typedef struct
{
char * psz_fontname; /**< The name of the font */
int i_font_size; /**< The font size in pixels */
int i_font_color; /**< The color of the text 0xRRGGBB
(native endianness) */
int i_font_alpha; /**< The transparency of the text.
0x00 is fully opaque,
0xFF fully transparent */
int i_style_flags; /**< Formatting style flags */
int i_outline_color; /**< The color of the outline 0xRRGGBB */
int i_outline_alpha; /**< The transparency of the outline.
0x00 is fully opaque,
0xFF fully transparent */
int i_shadow_color; /**< The color of the shadow 0xRRGGBB */
int i_shadow_alpha; /**< The transparency of the shadow.
0x00 is fully opaque,
0xFF fully transparent */
int i_background_color;/**< The color of the background 0xRRGGBB */
int i_background_alpha;/**< The transparency of the background.
0x00 is fully opaque,
0xFF fully transparent */
int i_karaoke_background_color;/**< Background color for karaoke 0xRRGGBB */
int i_karaoke_background_alpha;/**< The transparency of the karaoke bg.
0x00 is fully opaque,
0xFF fully transparent */
int i_outline_width; /**< The width of the outline in pixels */
int i_shadow_width; /**< The width of the shadow in pixels */
int i_spacing; /**< The spaceing between glyphs in pixels */
} text_style_t;
/* Style flags for \ref text_style_t */
#define STYLE_BOLD 1
#define STYLE_ITALIC 2
#define STYLE_OUTLINE 4
#define STYLE_SHADOW 8
#define STYLE_BACKGROUND 16
#define STYLE_UNDERLINE 32
#define STYLE_STRIKEOUT 64
/**
* Create a default text style
*/
VLC_EXPORT( text_style_t *, text_style_New, ( void ) );
/**
* Copy a text style into another
*/
VLC_EXPORT( text_style_t *, text_style_Copy, ( text_style_t *, const text_style_t * ) );
/**
* Duplicate a text style
*/
VLC_EXPORT( text_style_t *, text_style_Duplicate, ( const text_style_t * ) );
/**
* Delete a text style created by text_style_New or text_style_Duplicate
*/
VLC_EXPORT( void, text_style_Delete, ( text_style_t * ) );
#ifdef __cplusplus
}
#endif
#endif /* VLC_TEXT_STYLE_H */
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_text_style.h>
/***************************************************************************** /*****************************************************************************
* buffer_t: Command and response buffer * buffer_t: Command and response buffer
...@@ -66,7 +67,7 @@ typedef struct commandparams_t ...@@ -66,7 +67,7 @@ typedef struct commandparams_t
int32_t i_alpha; /*< alpha value of overlay */ int32_t i_alpha; /*< alpha value of overlay */
struct text_style_t fontstyle; /*< text style */ text_style_t fontstyle; /*< text style */
bool b_visible; /*< visibility flag of overlay */ bool b_visible; /*< visibility flag of overlay */
} commandparams_t; } commandparams_t;
...@@ -133,7 +134,7 @@ typedef struct overlay_t ...@@ -133,7 +134,7 @@ typedef struct overlay_t
bool b_active; bool b_active;
video_format_t format; video_format_t format;
struct text_style_t *p_fontstyle; text_style_t *p_fontstyle;
union { union {
picture_t *p_pic; picture_t *p_pic;
char *p_text; char *p_text;
......
...@@ -94,6 +94,7 @@ pluginsinclude_HEADERS = \ ...@@ -94,6 +94,7 @@ pluginsinclude_HEADERS = \
../include/vlc_stream.h \ ../include/vlc_stream.h \
../include/vlc_strings.h \ ../include/vlc_strings.h \
../include/vlc_subpicture.h \ ../include/vlc_subpicture.h \
../include/vlc_text_style.h \
../include/vlc_threads.h \ ../include/vlc_threads.h \
../include/vlc_url.h \ ../include/vlc_url.h \
../include/vlc_variables.h \ ../include/vlc_variables.h \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment