]> git.sesse.net Git - vlc/commitdiff
* commands/cmd_*.hpp: use the DEFINE_COMMAND macro for simple commands
authorCyril Deguet <asmax@videolan.org>
Mon, 5 Jan 2004 22:17:32 +0000 (22:17 +0000)
committerCyril Deguet <asmax@videolan.org>
Mon, 5 Jan 2004 22:17:32 +0000 (22:17 +0000)
* commands/cmd_fullscreen.*, parser/interpreter.cpp: added a
  "vlc.fullscreen()" command

modules/gui/skins2/Modules.am
modules/gui/skins2/commands/cmd_dummy.hpp
modules/gui/skins2/commands/cmd_fullscreen.cpp [new file with mode: 0644]
modules/gui/skins2/commands/cmd_fullscreen.hpp [new file with mode: 0644]
modules/gui/skins2/commands/cmd_notify_playlist.hpp
modules/gui/skins2/commands/cmd_on_top.hpp
modules/gui/skins2/commands/cmd_quit.hpp
modules/gui/skins2/parser/interpreter.cpp
modules/gui/skins2/vars/playlist.cpp
modules/gui/skins2/vars/playlist.hpp

index 7920c0aceb5da45705ad4e1acbb241724c55b183..11d2b652e01d84a1f6e2003ba3ee1c6f0a4cf17a 100644 (file)
@@ -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 \
index 47e18ac23333c67c914a71c2af0dc6d79f40d202..cbdbe06917f371fab14197bba991bf75f3c628f9 100644 (file)
@@ -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 Teulière <ipkiss@via.ecp.fr>
 
 
 /// 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
diff --git a/modules/gui/skins2/commands/cmd_fullscreen.cpp b/modules/gui/skins2/commands/cmd_fullscreen.cpp
new file mode 100644 (file)
index 0000000..4f4fb2c
--- /dev/null
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * 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 Teulière <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 );
+    }
+}
diff --git a/modules/gui/skins2/commands/cmd_fullscreen.hpp b/modules/gui/skins2/commands/cmd_fullscreen.hpp
new file mode 100644 (file)
index 0000000..b132ba1
--- /dev/null
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * 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 Teulière <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
index 576b9e66c9d6c14a9fd8f10051d6b48b1d57cc79..074af4937d96df708234be371b82e4d82c8614a4 100644 (file)
@@ -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 Teulière <ipkiss@via.ecp.fr>
 
 
 /// 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
index 3a17f6cc650b31a18a417b240ebbe53b0b10a612..27c6a8c5f4b691a4c05a72125083f38896d12f04 100644 (file)
@@ -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>
 
 
 /// "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
index 0055bf4fa44214c1e27e12e5ea284d9c6fabfb4c..1a4baa38419f116d7fb3bb53d01e308ea89f1c57 100644 (file)
@@ -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 Teulière <ipkiss@via.ecp.fr>
 
 
 /// "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
index a3a7c70c80c99b307b184f367301cd93f7618ea7..db48e34b074d1711ed789bb77dde6ee354abd54d 100644 (file)
@@ -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 Teulière <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() );
index f94686b07a1442b2189f76ef937956fd50f7565c..d61359252daf9a37bc323ec01ae9976a05506f2b 100644 (file)
@@ -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
index 254eb038bdfe9967156135efe9c58f03697b9e05..058f23b281bafc14e1819e675456899dd4ad820b 100644 (file)
@@ -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();