From 7df364001e2b4cf53e7e9ca223b9c91b319fafeb Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Sun, 2 Oct 2011 22:44:58 +0200 Subject: [PATCH] Change the "intf-show" variable into a toggle. At some point in the past, this might have meant something else, but now, it is implemented as a "Show Fullscreen Controller", in Qt4, skins2 and OSX. This change reflects this fact. --- include/vlc_keys.h | 2 +- modules/control/hotkeys.c | 7 ++----- modules/gui/macosx/intf.m | 2 +- modules/gui/qt4/main_interface.cpp | 6 +++--- modules/gui/skins2/src/vlcproc.cpp | 6 +++--- src/config/keys.c | 3 +-- src/libvlc-module.c | 15 +++++++-------- src/libvlc.c | 4 ++-- src/video_output/event.h | 2 +- 9 files changed, 21 insertions(+), 26 deletions(-) diff --git a/include/vlc_keys.h b/include/vlc_keys.h index b95b8c8e01..0a28db3f0f 100644 --- a/include/vlc_keys.h +++ b/include/vlc_keys.h @@ -147,7 +147,7 @@ typedef enum vlc_action { ACTIONID_SUBPOS_DOWN, ACTIONID_AUDIO_TRACK, ACTIONID_SUBTITLE_TRACK, - ACTIONID_INTF_SHOW, + ACTIONID_INTF_TOGGLE_FSC, ACTIONID_INTF_HIDE, ACTIONID_INTF_BOSS, /* chapter and title navigation */ diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c index 9919bbaca5..d90c32dc81 100644 --- a/modules/control/hotkeys.c +++ b/modules/control/hotkeys.c @@ -218,12 +218,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) } /* Interface showing */ - case ACTIONID_INTF_SHOW: - var_SetBool( p_intf->p_libvlc, "intf-show", true ); - break; - + case ACTIONID_INTF_TOGGLE_FSC: case ACTIONID_INTF_HIDE: - var_SetBool( p_intf->p_libvlc, "intf-show", false ); + var_TriggerCallback( p_intf->p_libvlc, "intf-toggle-fscontrol" ); break; case ACTIONID_INTF_BOSS: diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 772e6cd12b..2626729d34 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -558,7 +558,7 @@ static VLCMain *_o_sharedMainInstance = nil; val.b_bool = false; var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self); - var_AddCallback( p_intf->p_libvlc, "intf-show", ShowController, self); + var_AddCallback( p_intf->p_libvlc, "intf-toggle-fscontrol", ShowController, self); // var_AddCallback(p_playlist, "item-change", PLItemChanged, self); var_AddCallback(p_playlist, "item-current", PLItemChanged, self); var_AddCallback(p_playlist, "activity", PLItemChanged, self); diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index 47be4735bf..1c2948856d 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -228,7 +228,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) /************ * Callbacks ************/ - var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf ); + var_AddCallback( p_intf->p_libvlc, "intf-toggle-fscontrol", IntfShowCB, p_intf ); var_AddCallback( p_intf->p_libvlc, "intf-boss", IntfBossCB, p_intf ); /* Register callback for the intf-popupmenu variable */ @@ -315,7 +315,7 @@ MainInterface::~MainInterface() /* Unregister callbacks */ var_DelCallback( p_intf->p_libvlc, "intf-boss", IntfBossCB, p_intf ); - var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf ); + var_DelCallback( p_intf->p_libvlc, "intf-toggle-fscontrol", IntfShowCB, p_intf ); var_DelCallback( p_intf->p_libvlc, "intf-popupmenu", PopupMenuCB, p_intf ); p_intf->p_sys->p_mi = NULL; @@ -1321,7 +1321,7 @@ static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable, } /***************************************************************************** - * IntfShowCB: callback triggered by the intf-show libvlc variable. + * IntfShowCB: callback triggered by the intf-toggle-fscontrol libvlc variable. *****************************************************************************/ static int IntfShowCB( vlc_object_t *p_this, const char *psz_variable, vlc_value_t old_val, vlc_value_t new_val, void *param ) diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp index df0ba84459..37fb708d40 100644 --- a/modules/gui/skins2/src/vlcproc.cpp +++ b/modules/gui/skins2/src/vlcproc.cpp @@ -153,7 +153,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ), var_AddCallback( p_object, var, onGenericCallback, this ); ADD_CALLBACK( pIntf->p_sys->p_playlist, "volume" ) - ADD_CALLBACK( pIntf->p_libvlc, "intf-show" ) + ADD_CALLBACK( pIntf->p_libvlc, "intf-toggle-fscontrol" ) ADD_CALLBACK( pIntf->p_sys->p_playlist, "item-current" ) ADD_CALLBACK( pIntf->p_sys->p_playlist, "random" ) @@ -205,7 +205,7 @@ VlcProc::~VlcProc() var_DelCallback( getIntf()->p_sys->p_playlist, "volume", onGenericCallback, this ); - var_DelCallback( getIntf()->p_libvlc, "intf-show", + var_DelCallback( getIntf()->p_libvlc, "intf-toggle-fscontrol", onGenericCallback, this ); var_DelCallback( getIntf()->p_sys->p_playlist, "item-current", @@ -405,7 +405,7 @@ int VlcProc::onGenericCallback( vlc_object_t *pObj, const char *pVariable, ADD_CALLBACK_ENTRY( "audio-filter", on_audio_filter_changed, false ) - ADD_CALLBACK_ENTRY( "intf-show", on_intf_show_changed, false ) + ADD_CALLBACK_ENTRY( "intf-toggle-fscontrol", on_intf_show_changed, false ) ADD_CALLBACK_ENTRY( "mouse-moved", on_mouse_moved_changed, false ) diff --git a/src/config/keys.c b/src/config/keys.c index dd91d5150f..b07215ccbe 100644 --- a/src/config/keys.c +++ b/src/config/keys.c @@ -255,8 +255,7 @@ static const struct action actions[] = { "frame-next", ACTIONID_FRAME_NEXT, }, { "incr-scalefactor", ACTIONID_SCALE_UP, }, { "intf-boss", ACTIONID_INTF_BOSS, }, - { "intf-hide", ACTIONID_INTF_HIDE, }, - { "intf-show", ACTIONID_INTF_SHOW, }, + { "intf-show", ACTIONID_INTF_TOGGLE_FSC, }, { "jump+extrashort", ACTIONID_JUMP_FORWARD_EXTRASHORT, }, { "jump+long", ACTIONID_JUMP_FORWARD_LONG, }, { "jump+medium", ACTIONID_JUMP_FORWARD_MEDIUM, }, diff --git a/src/libvlc-module.c b/src/libvlc-module.c index 3724bbc655..896187ccb1 100644 --- a/src/libvlc-module.c +++ b/src/libvlc-module.c @@ -1483,6 +1483,7 @@ static const char *const ppsz_albumart_descriptions[] = #define SCALE_DOWN_KEY_LONGTEXT N_("Decrease scale factor.") #define DEINTERLACE_KEY_TEXT N_("Cycle deinterlace modes") #define DEINTERLACE_KEY_LONGTEXT N_("Cycle through deinterlace modes.") +#define INTF_TOGGLE_FSC_KEY_TEXT N_("Show controller in fullscreen") #define INTF_SHOW_KEY_TEXT N_("Show interface") #define INTF_SHOW_KEY_LONGTEXT N_("Raise the interface above all other windows.") #define INTF_HIDE_KEY_TEXT N_("Hide interface") @@ -2311,8 +2312,7 @@ vlc_module_begin () # define KEY_SCALE_UP "Alt+o" # define KEY_SCALE_DOWN "Shift+Alt+o" # define KEY_DEINTERLACE "d" -# define KEY_INTF_SHOW "i" -# define KEY_INTF_HIDE "Shift+i" +# define KEY_INTF_TOGGLE_FSC "i" # define KEY_INTF_BOSS NULL # define KEY_DISC_MENU "Ctrl+m" # define KEY_TITLE_PREV "Ctrl+p" @@ -2429,8 +2429,7 @@ vlc_module_begin () # define KEY_SCALE_UP "Alt+o" # define KEY_SCALE_DOWN "Alt+Shift+o" # define KEY_DEINTERLACE "d" -# define KEY_INTF_SHOW "i" -# define KEY_INTF_HIDE "Shift+i" +# define KEY_INTF_TOGGLE_FSC "i" # define KEY_INTF_BOSS NULL # define KEY_DISC_MENU "Shift+m" # define KEY_TITLE_PREV "Shift+o" @@ -2600,10 +2599,10 @@ vlc_module_begin () SCALE_DOWN_KEY_TEXT, SCALE_DOWN_KEY_LONGTEXT, false ) add_key( "key-deinterlace", KEY_DEINTERLACE, DEINTERLACE_KEY_TEXT, DEINTERLACE_KEY_LONGTEXT, false ) - add_key( "key-intf-show", KEY_INTF_SHOW, - INTF_SHOW_KEY_TEXT, INTF_SHOW_KEY_LONGTEXT, true ) - add_key( "key-intf-hide", KEY_INTF_HIDE, - INTF_HIDE_KEY_TEXT, INTF_HIDE_KEY_LONGTEXT, true ) + add_key( "key-intf-show", KEY_INTF_TOGGLE_FSC, + INTF_TOGGLE_FSC_KEY_TEXT, INTF_TOGGLE_FSC_KEY_TEXT, false ) + add_obsolete_inner( "key-intf-hide", CONFIG_ITEM_KEY ) + add_key( "key-intf-boss", KEY_INTF_BOSS, INTF_BOSS_KEY_TEXT, INTF_BOSS_KEY_LONGTEXT, true ) add_key( "key-snapshot", KEY_SNAPSHOT, diff --git a/src/libvlc.c b/src/libvlc.c index fc0e65cf3b..e615f058bd 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -530,8 +530,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, priv->actions = vlc_InitActions( p_libvlc ); /* Create a variable for showing the fullscreen interface */ - var_Create( p_libvlc, "intf-show", VLC_VAR_BOOL ); - var_SetBool( p_libvlc, "intf-show", true ); + var_Create( p_libvlc, "intf-toggle-fscontrol", VLC_VAR_BOOL ); + var_SetBool( p_libvlc, "intf-toggle-fscontrol", true ); /* Create a variable for the Boss Key */ var_Create( p_libvlc, "intf-boss", VLC_VAR_VOID ); diff --git a/src/video_output/event.h b/src/video_output/event.h index a6397a3fb0..da9212c939 100644 --- a/src/video_output/event.h +++ b/src/video_output/event.h @@ -71,7 +71,7 @@ static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button) return; } case MOUSE_BUTTON_CENTER: - var_ToggleBool(vout->p_libvlc, "intf-show"); + var_ToggleBool(vout->p_libvlc, "intf-toggle-fscontrol"); return; case MOUSE_BUTTON_RIGHT: var_SetBool(vout->p_libvlc, "intf-popupmenu", true); -- 2.11.4.GIT