]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/commands/cmd_show_window.hpp
Do not access vout_thread_t fields when it can be avoided.
[vlc] / modules / gui / skins2 / commands / cmd_show_window.hpp
old mode 100755 (executable)
new mode 100644 (file)
index 8d34f36..18edc42
@@ -1,11 +1,11 @@
 /*****************************************************************************
  * cmd_show_window.hpp
  *****************************************************************************
- * Copyright (C) 2003 VideoLAN
+ * Copyright (C) 2003 the VideoLAN team
  * $Id$
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
- *          Olivier Teulière <ipkiss@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
  *
  * 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.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #ifndef CMD_SHOW_WINDOW_HPP
 #define CMD_SHOW_WINDOW_HPP
 
 #include "cmd_generic.hpp"
+#include "../src/os_factory.hpp"
 #include "../src/top_window.hpp"
 #include "../src/window_manager.hpp"
+#include "../src/popup.hpp"
 
 
 /// Command to show a window
@@ -95,4 +97,30 @@ class CmdRaiseAll: public CmdGeneric
         WindowManager &m_rWinManager;
 };
 
+
+/// Command to show a popup menu
+class CmdShowPopup: public CmdGeneric
+{
+    public:
+        CmdShowPopup( intf_thread_t *pIntf, Popup &rPopup ):
+            CmdGeneric( pIntf ), m_rPopup( rPopup ) {}
+        virtual ~CmdShowPopup() {}
+
+        /// This method does the real job of the command
+        virtual void execute()
+        {
+            int x, y;
+            OSFactory::instance( getIntf() )->getMousePos( x, y );
+            m_rPopup.show( x, y );
+        }
+
+        /// Return the type of the command
+        virtual string getType() const { return "show popup"; }
+
+    private:
+        /// Reference to the popup
+        Popup &m_rPopup;
+};
+
+
 #endif