]> git.sesse.net Git - vlc/blobdiff - src/osd/osd.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / osd / osd.c
index 0a53bd4b9a7fb03ae98a0a47f51dc99703652583..086abf8c87e3acdbc7c523189aea5e440b64ea62 100644 (file)
@@ -33,6 +33,7 @@
 #include <vlc_keys.h>
 #include <vlc_osd.h>
 #include <vlc_image.h>
+#include <vlc_modules.h>
 
 #include "libvlc.h"
 
@@ -137,10 +138,11 @@ static osd_state_t *osd_StateChange( osd_button_t *p_button, const int i_state )
     return p_button->p_states;
 }
 
+#undef osd_MenuCreate
 /*****************************************************************************
  * OSD menu Funtions
  *****************************************************************************/
-osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
+osd_menu_t *osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
 {
     osd_menu_t  *p_osd = NULL;
     vlc_value_t val;
@@ -152,8 +154,8 @@ osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
     p_lock = osd_GetMutex( p_this );
     vlc_mutex_lock( p_lock );
 
-    var_Create( p_this->p_libvlc, "osd", VLC_VAR_ADDRESS );
-    var_Get( p_this->p_libvlc, "osd", &val );
+    var_Create( p_this->p_libvlc, "osd-object", VLC_VAR_ADDRESS );
+    var_Get( p_this->p_libvlc, "osd-object", &val );
     if( val.p_address == NULL )
     {
         static const char osdmenu_name[] = "osd menu";
@@ -199,7 +201,7 @@ osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
         var_SetBool( p_osd, "osd-menu-visible", false );
 
         val.p_address = p_osd;
-        var_Set( p_this->p_libvlc, "osd", val );
+        var_Set( p_this->p_libvlc, "osd-object", val );
     }
     else
         p_osd = val.p_address;
@@ -209,11 +211,12 @@ osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
 
 error:
     vlc_mutex_unlock( p_lock );
-    __osd_MenuDelete( p_this, p_osd );
+    osd_MenuDelete( p_this, p_osd );
     return NULL;
 }
 
-void __osd_MenuDelete( vlc_object_t *p_this, osd_menu_t *p_osd )
+#undef osd_MenuDelete
+void osd_MenuDelete( vlc_object_t *p_this, osd_menu_t *p_osd )
 {
     vlc_mutex_t *p_lock;
 
@@ -230,7 +233,7 @@ void __osd_MenuDelete( vlc_object_t *p_this, osd_menu_t *p_osd )
         var_Destroy( p_osd, "osd-menu-update" );
         osd_ParserUnload( p_osd );
         val.p_address = NULL;
-        var_Set( p_this->p_libvlc, "osd", val );
+        var_Set( p_this->p_libvlc, "osd-object", val );
     }
 
     vlc_object_release( p_osd );
@@ -241,7 +244,7 @@ static osd_menu_t *osd_Find( vlc_object_t *p_this )
 {
     vlc_value_t val;
 
-    if( var_Get( p_this->p_libvlc, "osd", &val ) )
+    if( var_Get( p_this->p_libvlc, "osd-object", &val ) )
         return NULL;
     return val.p_address;
 }
@@ -277,7 +280,8 @@ static void osd_UpdateState( osd_menu_state_t *p_state, int i_x, int i_y,
     p_state->p_pic = p_pic;
 }
 
-void __osd_MenuShow( vlc_object_t *p_this )
+#undef osd_MenuShow
+void osd_MenuShow( vlc_object_t *p_this )
 {
     osd_menu_t *p_osd;
     osd_button_t *p_button = NULL;
@@ -318,7 +322,8 @@ void __osd_MenuShow( vlc_object_t *p_this )
     vlc_mutex_unlock( p_lock );
 }
 
-void __osd_MenuHide( vlc_object_t *p_this )
+#undef osd_MenuHide
+void osd_MenuHide( vlc_object_t *p_this )
 {
     osd_menu_t *p_osd;
     vlc_mutex_t *p_lock = osd_GetMutex( p_this );
@@ -344,7 +349,8 @@ void __osd_MenuHide( vlc_object_t *p_this )
     vlc_mutex_unlock( p_lock );
 }
 
-void __osd_MenuActivate( vlc_object_t *p_this )
+#undef osd_MenuActivate
+void osd_MenuActivate( vlc_object_t *p_this )
 {
     osd_menu_t *p_osd;
     osd_button_t *p_button = NULL;
@@ -370,13 +376,13 @@ void __osd_MenuActivate( vlc_object_t *p_this )
     if( p_button && p_button->p_up )
     {
         vlc_mutex_unlock( p_lock );
-        __osd_MenuUp( p_this );   /* "menu select" means go to menu item above. */
+        osd_MenuUp( p_this );   /* "menu select" means go to menu item above. */
         return;
     }
     if( p_button && p_button->p_down )
     {
         vlc_mutex_unlock( p_lock );
-        __osd_MenuDown( p_this ); /* "menu select" means go to menu item below. */
+        osd_MenuDown( p_this ); /* "menu select" means go to menu item below. */
         return;
     }
 
@@ -394,14 +400,15 @@ void __osd_MenuActivate( vlc_object_t *p_this )
                            var_InheritInteger( p_osd, p_button->psz_action ) );
 #if defined(OSD_MENU_DEBUG)
         msg_Dbg( p_osd, "select (%d, %s)",
-                 var_InheritInteger( p_osd, p_button->psz_action ),
+                 (int)var_InheritInteger( p_osd, p_button->psz_action ),
                  p_button->psz_action );
 #endif
     }
     vlc_mutex_unlock( p_lock );
 }
 
-void __osd_MenuNext( vlc_object_t *p_this )
+#undef osd_MenuNext
+void osd_MenuNext( vlc_object_t *p_this )
 {
     osd_menu_t *p_osd;
     osd_button_t *p_button = NULL;
@@ -445,7 +452,8 @@ void __osd_MenuNext( vlc_object_t *p_this )
     vlc_mutex_unlock( p_lock );
 }
 
-void __osd_MenuPrev( vlc_object_t *p_this )
+#undef osd_MenuPrev
+void osd_MenuPrev( vlc_object_t *p_this )
 {
     osd_menu_t *p_osd;
     osd_button_t *p_button = NULL;
@@ -488,7 +496,8 @@ void __osd_MenuPrev( vlc_object_t *p_this )
     vlc_mutex_unlock( p_lock );
 }
 
-void __osd_MenuUp( vlc_object_t *p_this )
+#undef osd_MenuUp
+void osd_MenuUp( vlc_object_t *p_this )
 {
     osd_menu_t *p_osd;
     osd_button_t *p_button = NULL;
@@ -542,7 +551,7 @@ void __osd_MenuUp( vlc_object_t *p_this )
             osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc),
                                var_InheritInteger(p_osd, p_button->psz_action) );
 #if defined(OSD_MENU_DEBUG)
-            msg_Dbg( p_osd, "select (%d, %s)", val.i_int, p_button->psz_action );
+            msg_Dbg( p_osd, "select (%"PRId64", %s)", val.i_int, p_button->psz_action );
 #endif
         }
     }
@@ -553,7 +562,8 @@ void __osd_MenuUp( vlc_object_t *p_this )
     vlc_mutex_unlock( p_lock );
 }
 
-void __osd_MenuDown( vlc_object_t *p_this )
+#undef osd_MenuDown
+void osd_MenuDown( vlc_object_t *p_this )
 {
     osd_menu_t *p_osd;
     osd_button_t *p_button = NULL;
@@ -608,7 +618,7 @@ void __osd_MenuDown( vlc_object_t *p_this )
             osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc),
                                var_InheritInteger(p_osd, p_button->psz_action_down) );
 #if defined(OSD_MENU_DEBUG)
-            msg_Dbg( p_osd, "select (%d, %s)", val.i_int, p_button->psz_action_down );
+            msg_Dbg( p_osd, "select (%"PRId64", %s)", val.i_int, p_button->psz_action_down );
 #endif
         }
     }
@@ -628,13 +638,14 @@ static int osd_VolumeStep( vlc_object_t *p_this, int i_volume, int i_steps )
     return (i_volume/i_volume_step);
 }
 
+#undef osd_Volume
 /**
  * Display current audio volume bitmap
  *
  * The OSD Menu audio volume bar is updated to reflect the new audio volume. Call this function
  * when the audio volume is updated outside the OSD menu command "menu up", "menu down" or "menu select".
  */
-void __osd_Volume( vlc_object_t *p_this )
+void osd_Volume( vlc_object_t *p_this )
 {
     osd_menu_t *p_osd;
     osd_button_t *p_button = NULL;
@@ -677,7 +688,8 @@ void __osd_Volume( vlc_object_t *p_this )
     vlc_mutex_unlock( p_lock );
 }
 
-osd_button_t *__osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y,
+#undef osd_ButtonFind
+osd_button_t *osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y,
     int i_window_height, int i_window_width,
     int i_scale_width, int i_scale_height )
 {
@@ -750,10 +762,11 @@ osd_button_t *__osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y,
     return NULL;
 }
 
+#undef osd_ButtonSelect
 /**
  * Select the button provided as the new active button
  */
-void __osd_ButtonSelect( vlc_object_t *p_this, osd_button_t *p_button )
+void osd_ButtonSelect( vlc_object_t *p_this, osd_button_t *p_button )
 {
     osd_menu_t *p_osd;
     osd_button_t *p_old;