]> git.sesse.net Git - vlc/commitdiff
added a function to minimize VLC (check win32 compilation)
authorMohammed Adnène Trojette <adn@videolan.org>
Sun, 4 Jul 2004 22:22:10 +0000 (22:22 +0000)
committerMohammed Adnène Trojette <adn@videolan.org>
Sun, 4 Jul 2004 22:22:10 +0000 (22:22 +0000)
modules/gui/skins2/Modules.am
modules/gui/skins2/commands/cmd_minimize.cpp [new file with mode: 0644]
modules/gui/skins2/commands/cmd_minimize.hpp [new file with mode: 0644]
modules/gui/skins2/parser/interpreter.cpp
modules/gui/skins2/src/os_factory.hpp
modules/gui/skins2/win32/win32_factory.cpp
modules/gui/skins2/win32/win32_factory.hpp
modules/gui/skins2/x11/x11_factory.cpp
modules/gui/skins2/x11/x11_factory.hpp

index be82cccc311e9c212b6777fbb664f89e8b11b255..cf782a081f39a44dea204c0ab2f785bf40f5d672 100644 (file)
@@ -18,6 +18,8 @@ SOURCES_skins2 = \
        commands/cmd_on_top.hpp \
        commands/cmd_playlist.cpp \
        commands/cmd_playlist.hpp \
+       commands/cmd_minimize.cpp \
+       commands/cmd_minimize.hpp \
        commands/cmd_quit.cpp \
        commands/cmd_quit.hpp \
        commands/cmd_resize.cpp \
diff --git a/modules/gui/skins2/commands/cmd_minimize.cpp b/modules/gui/skins2/commands/cmd_minimize.cpp
new file mode 100644 (file)
index 0000000..61d396f
--- /dev/null
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * cmd_minimize.cpp
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: cmd_fullscreen.cpp 6961 2004-03-05 17:34:23Z sam $
+ *
+ * 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_minimize.hpp"
+#include "../src/os_factory.hpp"
+
+void CmdMinimize::execute()
+{
+    // Get the instance of OSFactory
+    OSFactory *pOsFactory = OSFactory::instance( getIntf() );
+    pOsFactory->minimize();
+}
+
diff --git a/modules/gui/skins2/commands/cmd_minimize.hpp b/modules/gui/skins2/commands/cmd_minimize.hpp
new file mode 100644 (file)
index 0000000..92362e7
--- /dev/null
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * cmd_minimize.hpp
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: cmd_fullscreen.hpp 6961 2004-03-05 17:34:23Z sam $
+ *
+ * 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_MINIMIZE_HPP
+#define CMD_MINIMIZE_HPP
+
+#include "cmd_generic.hpp"
+
+
+/// Command to minimize VLC
+DEFINE_COMMAND(Minimize, "minimize" )
+
+#endif
index 9d1f37e497234c7e10f04ee8cd3413c7ca697b38..3acc27d9cbed8b156e7aeba0b6100c194331cd00 100644 (file)
@@ -29,6 +29,7 @@
 #include "../commands/cmd_dummy.hpp"
 #include "../commands/cmd_layout.hpp"
 #include "../commands/cmd_quit.hpp"
+#include "../commands/cmd_minimize.hpp"
 #include "../commands/cmd_input.hpp"
 #include "../commands/cmd_fullscreen.hpp"
 #include "../commands/cmd_show_window.hpp"
@@ -75,6 +76,7 @@ Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf )
     REGISTER_CMD( "vlc.faster()", CmdFaster )
     REGISTER_CMD( "vlc.slower()", CmdSlower )
     REGISTER_CMD( "vlc.mute()", CmdMute )
+    REGISTER_CMD( "vlc.minimize()", CmdMinimize )
     REGISTER_CMD( "vlc.quit()", CmdQuit )
 
     // Register the constant bool variables in the var manager
index 2009339aa0ea5bbe99922dced79484cd1e9b0ad4..ebbf326c632f1b2af75418f6171d7e8c0f3947bf 100644 (file)
@@ -72,6 +72,9 @@ class OSFactory: public SkinObject
         /// Destroy the instance of OSLoop.
         virtual void destroyOSLoop() = 0;
 
+        ///
+        virtual void minimize() = 0;
+
         /// Instantiate an OSTimer with the given callback
         virtual OSTimer *createOSTimer( const Callback &rCallback ) = 0;
 
index dbcea954451e48e0da1ba3abdfd95b54ef9b9a89..e28f86ee43ca5c83659ab2e61623278847bf28bd 100644 (file)
@@ -223,6 +223,9 @@ void Win32Factory::destroyOSLoop()
     Win32Loop::destroy( getIntf() );
 }
 
+void Win32Factory::minimize()
+{
+}
 
 OSTimer *Win32Factory::createOSTimer( const Callback &rCallback )
 {
index c856acb6c5d9a788cebcab5878b8ac9e8519ae2c..86f2c1792f42eb5eec4b86aa5832fd5210587ea4 100644 (file)
@@ -53,6 +53,9 @@ class Win32Factory: public OSFactory
         /// Destroy the instance of OSLoop.
         virtual void destroyOSLoop();
 
+        ///
+        virtual void minimize();
+
         /// Instantiate an OSTimer with the given callback
         virtual OSTimer *createOSTimer( const Callback &rCallback );
 
index 3af788335d22a0ed17b6038c790ea0bad201e544..0e91b0707555ddf90d6641f17de96b9406c0decc 100644 (file)
@@ -96,6 +96,11 @@ void X11Factory::destroyOSLoop()
     X11Loop::destroy( getIntf() );
 }
 
+void X11Factory::minimize()
+{
+    XIconifyWindow( m_pDisplay->getDisplay(), m_pDisplay->getMainWindow(),
+                    DefaultScreen( m_pDisplay->getDisplay() ) );
+}
 
 OSTimer *X11Factory::createOSTimer( const Callback &rCallback )
 {
index c3f351d60c8632260c8ec28bc02dd8c5a07fe6e8..35344bef1e609c33664ba318673fc8da4a9ddb1e 100644 (file)
@@ -62,6 +62,9 @@ class X11Factory: public OSFactory
         /// Instantiate an OSTimer with the given callback
         virtual OSTimer *createOSTimer( const Callback &rCallback );
 
+        ///
+        virtual void minimize();
+
         /// Instantiate an OSWindow object
         virtual OSWindow *createOSWindow( GenericWindow &rWindow,
                                           bool dragDrop, bool playOnDrop,