]> git.sesse.net Git - vlc/blobdiff - src/osd/osd_widgets.c
Don't clutter REGISTRY on windows...
[vlc] / src / osd / osd_widgets.c
index 2a508c1bcc84b4c9f7aaceeb70a86d140ae67e32..5d8fafd988c75c5ae827aca0cbaa7a5a3992e744 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * osd_widgets.c : OSD widgets manipulation functions
  *****************************************************************************
- * Copyright (C) 2004-2005 the VideoLAN team
+ * Copyright (C) 2004-2007 the VideoLAN team
  * $Id$
  *
  * Author: Yoann Peronneau <yoann@videolan.org>
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                                /* free() */
-#include <vlc/vout.h>
-#include <vlc_osd.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include <vlc_video.h>
+#include <vlc_common.h>
+#include <vlc_osd.h>
+#include <vlc_vout.h>
 #include <vlc_filter.h>
 
 #define STYLE_EMPTY 0
@@ -201,8 +203,8 @@ subpicture_t *osd_CreateWidget( spu_t *p_spu, int i_channel )
     p_subpic->i_channel = i_channel;
     p_subpic->i_start = i_now;
     p_subpic->i_stop = i_now + 1200000;
-    p_subpic->b_ephemer = VLC_TRUE;
-    p_subpic->b_fade = VLC_TRUE;
+    p_subpic->b_ephemer = true;
+    p_subpic->b_fade = true;
 
     return p_subpic;
 }
@@ -213,10 +215,12 @@ subpicture_t *osd_CreateWidget( spu_t *p_spu, int i_channel )
  *****************************************************************************/
 int osd_Slider( vlc_object_t *p_this, spu_t *p_spu,
     int i_render_width, int i_render_height,
+    int i_margin_left, int i_margin_bottom,
     int i_channel, int i_position, short i_type )
 {
     subpicture_t *p_subpic;
     int i_x_margin, i_y_margin, i_x, i_y, i_width, i_height;
+    (void)p_this;
 
     p_subpic = osd_CreateWidget( p_spu, i_channel );
     if( p_subpic == NULL )
@@ -225,7 +229,9 @@ int osd_Slider( vlc_object_t *p_this, spu_t *p_spu,
     }
 
     i_y_margin = i_render_height / 10;
-    i_x_margin = i_y_margin;
+    i_x_margin = i_y_margin + i_margin_left;
+    i_y_margin += i_margin_bottom;
+
     if( i_type == OSD_HOR_SLIDER )
     {
         i_width = i_render_width - 2 * i_x_margin;
@@ -272,10 +278,12 @@ int osd_Slider( vlc_object_t *p_this, spu_t *p_spu,
  * Types are: OSD_PLAY_ICON, OSD_PAUSE_ICON, OSD_SPEAKER_ICON, OSD_MUTE_ICON
  *****************************************************************************/
 int osd_Icon( vlc_object_t *p_this, spu_t *p_spu,
-    int i_render_width, int i_render_height, int i_channel, short i_type )
+    int i_render_width, int i_render_height, int i_margin_right,
+    int i_margin_top, int i_channel, short i_type )
 {
     subpicture_t *p_subpic;
     int i_x_margin, i_y_margin, i_x, i_y, i_width, i_height;
+    (void)p_this;
 
     p_subpic = osd_CreateWidget( p_spu, i_channel );
     if( p_subpic == NULL )
@@ -284,7 +292,8 @@ int osd_Icon( vlc_object_t *p_this, spu_t *p_spu,
     }
 
     i_y_margin = i_render_height / 15;
-    i_x_margin = i_y_margin;
+    i_x_margin = i_y_margin + i_margin_right;
+    i_y_margin += i_margin_top;
     i_width = i_render_width / 20;
     i_height = i_width;
     i_x = i_render_width - i_x_margin - i_width;