skins2: cosmetics
[vlc.git] / modules / gui / skins2 / os2 / os2_factory.hpp
blob3f1923bca85ddae6f4c0f4a782e9829f73b68317
1 /*****************************************************************************
2 * os2_factory.hpp
3 *****************************************************************************
4 * Copyright (C) 2003, 2013 the VideoLAN team
6 * Authors: Cyril Deguet <asmax@via.ecp.fr>
7 * Olivier Teulière <ipkiss@via.ecp.fr>
8 * KO Myung-Hun <komh@chollian.net>
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 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 *****************************************************************************/
25 #ifndef OS2_FACTORY_HPP
26 #define OS2_FACTORY_HPP
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
32 #include "../src/os_factory.hpp"
33 #include "../src/generic_window.hpp"
35 #include <map>
38 /// Class used to instanciate OS2 specific objects
39 class OS2Factory: public OSFactory
41 public:
42 OS2Factory( intf_thread_t *pIntf );
43 virtual ~OS2Factory();
45 /// Initialization method
46 virtual bool init();
48 /// Instantiate an object OSGraphics
49 virtual OSGraphics *createOSGraphics( int width, int height );
51 /// Get the instance of the singleton OSLoop
52 virtual OSLoop *getOSLoop();
54 /// Destroy the instance of OSLoop
55 virtual void destroyOSLoop();
57 /// Minimize all the windows
58 virtual void minimize();
60 /// Restore the minimized windows
61 virtual void restore();
63 /// Add an icon in the system tray
64 virtual void addInTray();
66 /// Remove the icon from the system tray
67 virtual void removeFromTray();
69 /// Show the task in the task bar
70 virtual void addInTaskBar();
72 /// Remove the task from the task bar
73 virtual void removeFromTaskBar();
75 /// Instantiate an OSTimer with the given command
76 virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
78 /// Instantiate an OSWindow object
79 virtual OSWindow *createOSWindow( GenericWindow &rWindow,
80 bool dragDrop, bool playOnDrop,
81 OSWindow *pParent,
82 GenericWindow::WindowType_t type );
84 /// Instantiate an object OSTooltip
85 virtual OSTooltip *createOSTooltip();
87 /// Instantiate an object OSPopup
88 virtual OSPopup *createOSPopup();
90 /// Get the directory separator
91 virtual const std::string &getDirSeparator() const { return m_dirSep; }
93 /// Get the resource path
94 virtual const std::list<std::string> &getResourcePath() const
95 { return m_resourcePath; }
97 /// Get the screen size
98 virtual int getScreenWidth() const;
99 virtual int getScreenHeight() const;
101 /// Get Monitor Information
102 virtual void getMonitorInfo( OSWindow* pWindow,
103 int* x, int* y,
104 int* width, int* height ) const;
105 virtual void getMonitorInfo( int numScreen,
106 int* x, int* y,
107 int* width, int* height ) const;
109 /// Get the work area (screen area without taskbars)
110 virtual SkinsRect getWorkArea() const;
112 /// Get the position of the mouse
113 virtual void getMousePos( int &rXPos, int &rYPos ) const;
115 /// Change the cursor
116 virtual void changeCursor( CursorType_t type ) const;
118 /// Delete a directory recursively
119 virtual void rmDir( const std::string &rPath );
121 /// Map to find the GenericWindow associated with a OS2Window
122 std::map<HWND, GenericWindow*> m_windowMap;
124 /// Get the parent window handle
125 HWND getParentWindow() { return m_hParentClientWindow; }
127 /// Get the m_cursorType
128 CursorType_t getCursorType() const { return m_cursorType; }
130 /// Callback function (Windows Procedure)
131 static MRESULT EXPENTRY OS2FrameProc( HWND hwnd, ULONG msg,
132 MPARAM mp1, MPARAM Mp2 );
133 static MRESULT EXPENTRY OS2Proc( HWND hwnd, ULONG msg,
134 MPARAM mp1, MPARAM Mp2 );
136 private:
137 /// Handle of the instance
138 HMODULE m_hInst;
139 /// Handle of anchor-block
140 HAB m_hab;
141 /// Handle of message queue
142 HMQ m_hmq;
143 /// Handle of the parent window
144 HWND m_hParentWindow;
145 /// Handle of the client window of the parent window
146 HWND m_hParentClientWindow;
147 /// Window procedure of the old frame window
148 PFNWP m_pfnwpOldFrameProc;
149 /// Cursor type
150 mutable CursorType_t m_cursorType;
151 /// Directory separator
152 const std::string m_dirSep;
153 /// Resource path
154 std::list<std::string> m_resourcePath;
158 #endif