cmd_show_window.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * cmd_show_window.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: 6617e010d479edec6c0802d4b5493e8e8df2ee98 $
00006  *
00007  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
00008  *          Olivier Teulière <ipkiss@via.ecp.fr>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License along
00021  * with this program; if not, write to the Free Software Foundation, Inc.,
00022  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef CMD_SHOW_WINDOW_HPP
00026 #define CMD_SHOW_WINDOW_HPP
00027 
00028 #include "cmd_generic.hpp"
00029 #include "../src/os_factory.hpp"
00030 #include "../src/top_window.hpp"
00031 #include "../src/window_manager.hpp"
00032 #include "../src/popup.hpp"
00033 
00034 
00035 /// Command to show a window
00036 class CmdShowWindow: public CmdGeneric
00037 {
00038 public:
00039     CmdShowWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
00040                    TopWindow &rWin ):
00041         CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) { }
00042     virtual ~CmdShowWindow() { }
00043     virtual void execute() { m_rWinManager.show( m_rWin ); }
00044     virtual string getType() const { return "show window"; }
00045 
00046 private:
00047     /// Reference to the window manager
00048     WindowManager &m_rWinManager;
00049     /// Reference to the window
00050     TopWindow &m_rWin;
00051 };
00052 
00053 
00054 /// Command to hide a window
00055 class CmdHideWindow: public CmdGeneric
00056 {
00057 public:
00058     CmdHideWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
00059                    TopWindow &rWin ):
00060         CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) { }
00061     virtual ~CmdHideWindow() { }
00062     virtual void execute() { m_rWinManager.hide( m_rWin ); }
00063     virtual string getType() const { return "hide window"; }
00064 
00065 private:
00066     /// Reference to the window manager
00067     WindowManager &m_rWinManager;
00068     /// Reference to the window
00069     TopWindow &m_rWin;
00070 };
00071 
00072 
00073 /// Command to raise all windows
00074 class CmdRaiseAll: public CmdGeneric
00075 {
00076 public:
00077     CmdRaiseAll( intf_thread_t *pIntf, WindowManager &rWinManager ):
00078         CmdGeneric( pIntf ), m_rWinManager( rWinManager ) { }
00079     virtual ~CmdRaiseAll() { }
00080     virtual void execute() { m_rWinManager.raiseAll(); }
00081     virtual string getType() const { return "raise all windows"; }
00082 
00083 private:
00084     /// Reference to the window manager
00085     WindowManager &m_rWinManager;
00086 };
00087 
00088 
00089 /// Command to show a popup menu
00090 class CmdShowPopup: public CmdGeneric
00091 {
00092 public:
00093     CmdShowPopup( intf_thread_t *pIntf, Popup &rPopup ):
00094         CmdGeneric( pIntf ), m_rPopup( rPopup ) { }
00095     virtual ~CmdShowPopup() { }
00096 
00097     virtual void execute()
00098     {
00099         int x, y;
00100         OSFactory::instance( getIntf() )->getMousePos( x, y );
00101         m_rPopup.show( x, y );
00102     }
00103 
00104     virtual string getType() const { return "show popup"; }
00105 
00106 private:
00107     /// Reference to the popup
00108     Popup &m_rPopup;
00109 };
00110 
00111 
00112 #endif

Generated on Tue May 25 08:04:58 2010 for VLC by  doxygen 1.5.6