[vlc-commits] commit: Splitted out text_style_t and related function to its own header. ( Laurent Aimar )

git at videolan.org git at videolan.org
Tue May 4 22:26:14 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue May  4 20:10:13 2010 +0200| [d6a118bda13ff93686bddf6a8e5be7ee79378439] | committer: Laurent Aimar 

Splitted out text_style_t and related function to its own header.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d6a118bda13ff93686bddf6a8e5be7ee79378439
---

 include/vlc_common.h                               |    1 -
 include/vlc_osd.h                                  |   67 -------------
 include/vlc_subpicture.h                           |    1 +
 include/vlc_text_style.h                           |  104 ++++++++++++++++++++
 .../video_filter/dynamicoverlay/dynamicoverlay.h   |    5 +-
 src/Makefile.am                                    |    1 +
 6 files changed, 109 insertions(+), 70 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index da2b219..e42bba6 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -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;
 
diff --git a/include/vlc_osd.h b/include/vlc_osd.h
index 78292cf..036a852 100644
--- a/include/vlc_osd.h
+++ b/include/vlc_osd.h
@@ -216,73 +216,6 @@ VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *,  picture_t *, const video_fo
 #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
  *
  * Every button has three states, either it is unselected, selected or pressed.
diff --git a/include/vlc_subpicture.h b/include/vlc_subpicture.h
index 7c55001..71a2095 100644
--- a/include/vlc_subpicture.h
+++ b/include/vlc_subpicture.h
@@ -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
index 0000000..c7a4d27
--- /dev/null
+++ b/include/vlc_text_style.h
@@ -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 */
+
diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay.h b/modules/video_filter/dynamicoverlay/dynamicoverlay.h
index e905838..3995ace 100644
--- a/modules/video_filter/dynamicoverlay/dynamicoverlay.h
+++ b/modules/video_filter/dynamicoverlay/dynamicoverlay.h
@@ -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;
diff --git a/src/Makefile.am b/src/Makefile.am
index e8ed0d5..d19dc36 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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 \



More information about the vlc-commits mailing list