REPLY_SEND;
}
+DBUS_METHOD( Raise )
+{/* shows vlc's main window */
+ REPLY_INIT;
+ var_ToggleBool( INTF->p_libvlc, "intf-show" );
+ REPLY_SEND;
+}
+
#define PROPERTY_MAPPING_BEGIN if( 0 ) {}
#define PROPERTY_FUNC( interface, property, function ) \
else if( !strcmp( psz_interface_name, interface ) && \
METHOD_MAPPING_BEGIN
METHOD_FUNC( DBUS_INTERFACE_PROPERTIES, "Get", GetProperty );
METHOD_FUNC( DBUS_MPRIS_ROOT_INTERFACE, "Quit", Quit );
+ METHOD_FUNC( DBUS_MPRIS_ROOT_INTERFACE, "Raise", Raise );
METHOD_MAPPING_END
}
vlc_value_t old_val, vlc_value_t new_val, void *param );
static int IntfBossCB( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param );
+static int IntfRaiseMainCB( vlc_object_t *p_this, const char *psz_variable,
+ vlc_value_t old_val, vlc_value_t new_val,
+ void *param );
MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
{
CONNECT( this, askToQuit(), THEDP, quit() );
CONNECT( this, askBoss(), this, setBoss() );
+ CONNECT( this, askRaise(), this, setRaise() );
/** END of CONNECTS**/
************/
var_AddCallback( p_intf->p_libvlc, "intf-toggle-fscontrol", IntfShowCB, p_intf );
var_AddCallback( p_intf->p_libvlc, "intf-boss", IntfBossCB, p_intf );
+ var_AddCallback( p_intf->p_libvlc,"intf-show", IntfRaiseMainCB, p_intf );
/* Register callback for the intf-popupmenu variable */
var_AddCallback( p_intf->p_libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
}
}
+void MainInterface::emitRaise()
+{
+ emit askRaise();
+}
+void MainInterface::setRaise()
+{
+ activateWindow();
+ raise();
+}
+
/*****************************************************************************
* PopupMenuCB: callback triggered by the intf-popupmenu playlist variable.
* We don't show the menu directly here because we don't want the
return VLC_SUCCESS;
}
+/*****************************************************************************
+ * IntfRaiseMainCB: callback triggered by the intf-show-main libvlc variable.
+ *****************************************************************************/
+static int IntfRaiseMainCB( vlc_object_t *p_this, const char *psz_variable,
+ vlc_value_t old_val, vlc_value_t new_val, void *param )
+{
+ VLC_UNUSED( p_this ); VLC_UNUSED( psz_variable ); VLC_UNUSED( old_val );
+ VLC_UNUSED( new_val );
+
+ intf_thread_t *p_intf = (intf_thread_t *)param;
+ p_intf->p_sys->p_mi->emitRaise();
+
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
* IntfBossCB: callback triggered by the intf-boss libvlc variable.
*****************************************************************************/
/* Create a variable for the Boss Key */
var_Create( p_libvlc, "intf-boss", VLC_VAR_VOID );
+ /* Create a variable for showing the main interface */
+ var_Create( p_libvlc, "intf-show", VLC_VAR_BOOL );
+
/* Create a variable for showing the right click menu */
var_Create( p_libvlc, "intf-popupmenu", VLC_VAR_BOOL );