1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2003 the VideoLAN team
7 * Authors: Cyril Deguet <asmax@via.ecp.fr>
8 * Olivier Teulière <ipkiss@via.ecp.fr>
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.
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.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 #ifndef CMD_SHOW_WINDOW_HPP
26 #define CMD_SHOW_WINDOW_HPP
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"
35 /// Command to show a window
36 class CmdShowWindow: public CmdGeneric
39 CmdShowWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
41 CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) {}
42 virtual ~CmdShowWindow() {}
44 /// This method does the real job of the command
45 virtual void execute() { m_rWinManager.show( m_rWin ); }
47 /// Return the type of the command
48 virtual string getType() const { return "show window"; }
51 /// Reference to the window manager
52 WindowManager &m_rWinManager;
53 /// Reference to the window
58 /// Command to hide a window
59 class CmdHideWindow: public CmdGeneric
62 CmdHideWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
64 CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) {}
65 virtual ~CmdHideWindow() {}
67 /// This method does the real job of the command
68 virtual void execute() { m_rWinManager.hide( m_rWin ); }
70 /// Return the type of the command
71 virtual string getType() const { return "hide window"; }
74 /// Reference to the window manager
75 WindowManager &m_rWinManager;
76 /// Reference to the window
81 /// Command to raise all windows
82 class CmdRaiseAll: public CmdGeneric
85 CmdRaiseAll( intf_thread_t *pIntf, WindowManager &rWinManager ):
86 CmdGeneric( pIntf ), m_rWinManager( rWinManager ) {}
87 virtual ~CmdRaiseAll() {}
89 /// This method does the real job of the command
90 virtual void execute() { m_rWinManager.raiseAll(); }
92 /// Return the type of the command
93 virtual string getType() const { return "raise all windows"; }
96 /// Reference to the window manager
97 WindowManager &m_rWinManager;
101 /// Command to show a popup menu
102 class CmdShowPopup: public CmdGeneric
105 CmdShowPopup( intf_thread_t *pIntf, Popup &rPopup ):
106 CmdGeneric( pIntf ), m_rPopup( rPopup ) {}
107 virtual ~CmdShowPopup() {}
109 /// This method does the real job of the command
110 virtual void execute()
113 OSFactory::instance( getIntf() )->getMousePos( x, y );
114 m_rPopup.show( x, y );
117 /// Return the type of the command
118 virtual string getType() const { return "show popup"; }
121 /// Reference to the popup