]> git.sesse.net Git - vlc/commitdiff
Splitted out text_style_t and related function to its own header.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 4 May 2010 18:10:13 +0000 (20:10 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 4 May 2010 20:25:33 +0000 (22:25 +0200)
include/vlc_common.h
include/vlc_osd.h
include/vlc_subpicture.h
include/vlc_text_style.h [new file with mode: 0644]
modules/video_filter/dynamicoverlay/dynamicoverlay.h
src/Makefile.am

index da2b219c837a76df34f73cc3e429c2d198b7f3be..e42bba64329b02b32ed529209d665627800524e6 100644 (file)
@@ -257,7 +257,6 @@ typedef struct spu_t spu_t;
 typedef struct subpicture_t subpicture_t;
 typedef struct subpicture_sys_t subpicture_sys_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;
 
index 78292cf014b6d02dc42130a948370f59c49a3c13..036a8525e5176eb5c5b9aa183ea826534e377406 100644 (file)
@@ -215,73 +215,6 @@ VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *,  picture_t *, const video_fo
 #define OSD_SPEAKER_ICON 3
 #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
  *
index 7c5500144e6fac244bf9816b8a9e4167c8eb7930..71a209504c52ee62f7d52760a08d178c995b5a8d 100644 (file)
@@ -32,6 +32,7 @@
  */
 
 #include <vlc_picture.h>
+#include <vlc_text_style.h>
 
 /**
  * \defgroup subpicture Video Subpictures
diff --git a/include/vlc_text_style.h b/include/vlc_text_style.h
new file mode 100644 (file)
index 0000000..c7a4d27
--- /dev/null
@@ -0,0 +1,104 @@
+/*****************************************************************************
+ * 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 */
+
index e9058381fa4c33cc505a0959c3597be6522dc68b..3995acec9e96f5837222a3ea150a3199c8106a0c 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <vlc_common.h>
 #include <vlc_filter.h>
+#include <vlc_text_style.h>
 
 /*****************************************************************************
  * buffer_t: Command and response buffer
@@ -66,7 +67,7 @@ typedef struct commandparams_t
 
     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 */
 } commandparams_t;
@@ -133,7 +134,7 @@ typedef struct overlay_t
     bool b_active;
 
     video_format_t format;
-    struct text_style_t *p_fontstyle;
+    text_style_t *p_fontstyle;
     union {
         picture_t *p_pic;
         char *p_text;
index e8ed0d5e91c5b0bddf11b0322a06391f0c41e172..d19dc36e7ed693032c06bd31e10b491262227a00 100644 (file)
@@ -94,6 +94,7 @@ pluginsinclude_HEADERS = \
        ../include/vlc_stream.h \
        ../include/vlc_strings.h \
        ../include/vlc_subpicture.h \
+       ../include/vlc_text_style.h \
        ../include/vlc_threads.h \
        ../include/vlc_url.h \
        ../include/vlc_variables.h \