vlc_text_style.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vlc_text_style.h: text_style_t definition and helpers.
00003  *****************************************************************************
00004  * Copyright (C) 1999-2010 VLC authors and VideoLAN
00005  * $Id: 531411ae607308ad632cd90c63bd70756ebb51df $
00006  *
00007  * Authors: Derk-Jan Hartman <hartman _AT_ videolan _DOT_ org>
00008  *          basOS G <noxelia 4t gmail , com>
00009  *
00010  * This program is free software; you can redistribute it and/or modify it
00011  * under the terms of the GNU Lesser General Public License as published by
00012  * the Free Software Foundation; either version 2.1 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00018  * GNU Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public License
00021  * along with this program; if not, write to the Free Software Foundation,
00022  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef VLC_TEXT_STYLE_H
00026 #define VLC_TEXT_STYLE_H 1
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 /**
00033  * Text style
00034  *
00035  * A text style is used to specify the formatting of text.
00036  * A font renderer can use the supplied information to render the
00037  * text specified.
00038  */
00039 typedef struct
00040 {
00041     char *     psz_fontname;      /**< The name of the font */
00042     int        i_font_size;       /**< The font size in pixels */
00043     int        i_font_color;      /**< The color of the text 0xRRGGBB
00044                                        (native endianness) */
00045     int        i_font_alpha;      /**< The transparency of the text.
00046                                        0x00 is fully opaque,
00047                                        0xFF fully transparent */
00048     int        i_style_flags;     /**< Formatting style flags */
00049     int        i_outline_color;   /**< The color of the outline 0xRRGGBB */
00050     int        i_outline_alpha;   /**< The transparency of the outline.
00051                                        0x00 is fully opaque,
00052                                        0xFF fully transparent */
00053     int        i_shadow_color;    /**< The color of the shadow 0xRRGGBB */
00054     int        i_shadow_alpha;    /**< The transparency of the shadow.
00055                                         0x00 is fully opaque,
00056                                         0xFF fully transparent */
00057     int        i_background_color;/**< The color of the background 0xRRGGBB */
00058     int        i_background_alpha;/**< The transparency of the background.
00059                                        0x00 is fully opaque,
00060                                        0xFF fully transparent */
00061     int        i_karaoke_background_color;/**< Background color for karaoke 0xRRGGBB */
00062     int        i_karaoke_background_alpha;/**< The transparency of the karaoke bg.
00063                                        0x00 is fully opaque,
00064                                        0xFF fully transparent */
00065     int        i_outline_width;   /**< The width of the outline in pixels */
00066     int        i_shadow_width;    /**< The width of the shadow in pixels */
00067     int        i_spacing;         /**< The spaceing between glyphs in pixels */
00068 } text_style_t;
00069 
00070 /* Style flags for \ref text_style_t */
00071 #define STYLE_BOLD        1
00072 #define STYLE_ITALIC      2
00073 #define STYLE_OUTLINE     4
00074 #define STYLE_SHADOW      8
00075 #define STYLE_BACKGROUND  16
00076 #define STYLE_UNDERLINE   32
00077 #define STYLE_STRIKEOUT   64
00078 
00079 /**
00080  * Create a default text style
00081  */
00082 VLC_API text_style_t * text_style_New( void );
00083 
00084 /**
00085  * Copy a text style into another
00086  */
00087 VLC_API text_style_t * text_style_Copy( text_style_t *, const text_style_t * );
00088 
00089 /**
00090  * Duplicate a text style
00091  */
00092 VLC_API text_style_t * text_style_Duplicate( const text_style_t * );
00093 
00094 /**
00095  * Delete a text style created by text_style_New or text_style_Duplicate
00096  */
00097 VLC_API void text_style_Delete( text_style_t * );
00098 
00099 #ifdef __cplusplus
00100 }
00101 #endif
00102 
00103 #endif /* VLC_TEXT_STYLE_H */
00104 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines