Commit edc9c954 authored by Cyril Deguet's avatar Cyril Deguet

* commands/cmd_*.hpp: use the DEFINE_COMMAND macro for simple commands

* commands/cmd_fullscreen.*, parser/interpreter.cpp: added a
  "vlc.fullscreen()" command
parent 1d07e63d
......@@ -7,6 +7,8 @@ SOURCES_skins2 = \
commands/cmd_change_skin.cpp \
commands/cmd_change_skin.hpp \
commands/cmd_dialogs.hpp \
commands/cmd_fullscreen.cpp \
commands/cmd_fullscreen.hpp \
commands/cmd_input.cpp \
commands/cmd_input.hpp \
commands/cmd_layout.cpp \
......
......@@ -2,7 +2,7 @@
* cmd_dummy.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cmd_dummy.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: cmd_dummy.hpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -29,17 +29,8 @@
/// Dummy command
class CmdDummy: public CmdGeneric
{
public:
CmdDummy( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
virtual ~CmdDummy() {}
DEFINE_COMMAND( Dummy, "dummy" )
/// This method does the real job of the command
virtual void execute() {}
/// Return the type of the command
virtual string getType() const { return "dummy"; }
};
void CmdDummy::execute() {}
#endif
/*****************************************************************************
* cmd_fullscreen.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cmd_fullscreen.cpp,v 1.1 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "cmd_fullscreen.hpp"
#include <vlc/vout.h>
void CmdFullscreen::execute()
{
vout_thread_t *pVout;
if( getIntf()->p_sys->p_input == NULL )
{
return;
}
pVout = (vout_thread_t *)vlc_object_find( getIntf()->p_sys->p_input,
VLC_OBJECT_VOUT, FIND_CHILD );
if( pVout )
{
// Switch to fullscreen
pVout->i_changes |= VOUT_FULLSCREEN_CHANGE;
vlc_object_release( pVout );
}
}
/*****************************************************************************
* cmd_fullscreen.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cmd_fullscreen.hpp,v 1.1 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef CMD_FULLSCREEN_HPP
#define CMD_FULLSCREEN_HPP
#include "cmd_generic.hpp"
/// Command to switch the vout to fullscreen
DEFINE_COMMAND( Fullscreen, "fullscreen" )
#endif
......@@ -2,7 +2,7 @@
* cmd_notify_playlist.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cmd_notify_playlist.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: cmd_notify_playlist.hpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -29,17 +29,6 @@
/// Command to notify the playlist of a change
class CmdNotifyPlaylist: public CmdGeneric
{
public:
CmdNotifyPlaylist( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
virtual ~CmdNotifyPlaylist() {}
/// This method does the real job of the command
virtual void execute();
/// Return the type of the command
virtual string getType() const { return "notify playlist"; }
};
DEFINE_COMMAND( NotifyPlaylist, "notify playlist" )
#endif
......@@ -2,7 +2,7 @@
* cmd_on_top.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cmd_on_top.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: cmd_on_top.hpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
......@@ -29,17 +29,6 @@
/// "Always on top" command
class CmdOnTop: public CmdGeneric
{
public:
CmdOnTop( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
virtual ~CmdOnTop() {}
/// This method does the real job of the command
virtual void execute();
/// Return the type of the command
virtual string getType() const { return "always on top"; }
};
DEFINE_COMMAND( OnTop, "always on top" )
#endif
......@@ -2,7 +2,7 @@
* cmd_quit.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cmd_quit.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: cmd_quit.hpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -29,17 +29,6 @@
/// "Quit" command
class CmdQuit: public CmdGeneric
{
public:
CmdQuit( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
virtual ~CmdQuit() {}
/// This method does the real job of the command
virtual void execute();
/// Return the type of the command
virtual string getType() const { return "quit"; }
};
DEFINE_COMMAND( Quit, "quit" )
#endif
......@@ -2,7 +2,7 @@
* interpreter.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: interpreter.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: interpreter.cpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -29,6 +29,7 @@
#include "../commands/cmd_layout.hpp"
#include "../commands/cmd_quit.hpp"
#include "../commands/cmd_input.hpp"
#include "../commands/cmd_fullscreen.hpp"
#include "../src/theme.hpp"
#include "../src/vlcproc.hpp"
#include "../vars/playlist.hpp"
......@@ -107,6 +108,10 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
{
pCommand = new CmdPlaylistSort( getIntf() );
}
else if( rAction == "vlc.fullscreen()" )
{
pCommand = new CmdFullscreen( getIntf() );
}
else if( rAction == "vlc.quit()" )
{
pCommand = new CmdQuit( getIntf() );
......
......@@ -2,7 +2,7 @@
* playlist.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: playlist.cpp,v 1.5 2004/01/05 20:02:21 gbazin Exp $
* $Id: playlist.cpp,v 1.6 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
*
......@@ -68,13 +68,6 @@ Playlist::~Playlist()
}
void Playlist::add( const UStringPtr &rcString )
{
VarList::add( rcString );
//XXX
}
void Playlist::delSelected()
{
// Remove the items from the VLC playlist
......
......@@ -2,7 +2,7 @@
* playlist.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: playlist.hpp,v 1.2 2004/01/04 22:38:49 gbazin Exp $
* $Id: playlist.hpp,v 1.3 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
......@@ -39,9 +39,6 @@ class Playlist: public VarList
Playlist( intf_thread_t *pIntf );
virtual ~Playlist();
/// Add a pointer on a string in the list
virtual void add( const UStringPtr &rcString );
/// Remove the selected elements from the list
virtual void delSelected();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment