1 /***************************************************************************** 2 * cmd_show_window.hpp 3 ***************************************************************************** 4 * Copyright (C) 2003 the VideoLAN team 5 * $Id: e2523b8fc98e52eda26769df8a3c3039347522ef $ 6 * 7 * Authors: Cyril Deguet <asmax@via.ecp.fr> 8 * Olivier Teulière <ipkiss@via.ecp.fr> 9 * 10 * This program is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License as published by 12 * the Free Software Foundation; either version 2 of the License, or 13 * (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 * 20 * You should have received a copy of the GNU General Public License along 21 * with this program; if not, write to the Free Software Foundation, Inc., 22 * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 23 *****************************************************************************/ 24 25 #ifndef CMD_SHOW_WINDOW_HPP 26 #define CMD_SHOW_WINDOW_HPP 27 28 #include "cmd_generic.hpp" 29 #include "../src/os_factory.hpp" 30 #include "../src/top_window.hpp" 31 #include "../src/window_manager.hpp" 32 #include "../src/popup.hpp" 33 34 35 /// Command to show a window 36 class CmdShowWindow: public CmdGeneric 37 { 38 public: CmdShowWindow(intf_thread_t * pIntf,WindowManager & rWinManager,TopWindow & rWin)39 CmdShowWindow( intf_thread_t *pIntf, WindowManager &rWinManager, 40 TopWindow &rWin ): 41 CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) { } ~CmdShowWindow()42 virtual ~CmdShowWindow() { } execute()43 virtual void execute() { m_rWinManager.show( m_rWin ); } getType() const44 virtual std::string getType() const { return "show window"; } 45 46 private: 47 /// Reference to the window manager 48 WindowManager &m_rWinManager; 49 /// Reference to the window 50 TopWindow &m_rWin; 51 }; 52 53 54 /// Command to hide a window 55 class CmdHideWindow: public CmdGeneric 56 { 57 public: CmdHideWindow(intf_thread_t * pIntf,WindowManager & rWinManager,TopWindow & rWin)58 CmdHideWindow( intf_thread_t *pIntf, WindowManager &rWinManager, 59 TopWindow &rWin ): 60 CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) { } ~CmdHideWindow()61 virtual ~CmdHideWindow() { } execute()62 virtual void execute() { m_rWinManager.hide( m_rWin ); } getType() const63 virtual std::string getType() const { return "hide window"; } 64 65 private: 66 /// Reference to the window manager 67 WindowManager &m_rWinManager; 68 /// Reference to the window 69 TopWindow &m_rWin; 70 }; 71 72 73 /// Command to raise all windows 74 class CmdRaiseAll: public CmdGeneric 75 { 76 public: CmdRaiseAll(intf_thread_t * pIntf,WindowManager & rWinManager)77 CmdRaiseAll( intf_thread_t *pIntf, WindowManager &rWinManager ): 78 CmdGeneric( pIntf ), m_rWinManager( rWinManager ) { } ~CmdRaiseAll()79 virtual ~CmdRaiseAll() { } execute()80 virtual void execute() { m_rWinManager.raiseAll(); } getType() const81 virtual std::string getType() const { return "raise all windows"; } 82 83 private: 84 /// Reference to the window manager 85 WindowManager &m_rWinManager; 86 }; 87 88 89 /// Command to show a popup menu 90 class CmdShowPopup: public CmdGeneric 91 { 92 public: CmdShowPopup(intf_thread_t * pIntf,Popup & rPopup)93 CmdShowPopup( intf_thread_t *pIntf, Popup &rPopup ): 94 CmdGeneric( pIntf ), m_rPopup( rPopup ) { } ~CmdShowPopup()95 virtual ~CmdShowPopup() { } 96 execute()97 virtual void execute() 98 { 99 int x, y; 100 OSFactory::instance( getIntf() )->getMousePos( x, y ); 101 m_rPopup.show( x, y ); 102 } 103 getType() const104 virtual std::string getType() const { return "show popup"; } 105 106 private: 107 /// Reference to the popup 108 Popup &m_rPopup; 109 }; 110 111 112 #endif 113