1 /*****************************************************************************
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
32 #include "../src/os_factory.hpp"
33 #include "../src/generic_window.hpp"
38 /// Class used to instanciate OS2 specific objects
39 class OS2Factory
: public OSFactory
42 OS2Factory( intf_thread_t
*pIntf
);
43 virtual ~OS2Factory();
45 /// Initialization method
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
,
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 string
&getDirSeparator() const { return m_dirSep
; }
93 /// Get the resource path
94 virtual const list
<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( const GenericWindow
&rWindow
,
104 int* width
, int* height
) const;
105 virtual void getMonitorInfo( int numScreen
,
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 string
&rPath
);
121 /// Map to find the GenericWindow associated with a OS2Window
122 map
<HWND
, GenericWindow
*> m_windowMap
;
124 HWND
getParentWindow() { return m_hParentClientWindow
; }
126 /// Callback function (Windows Procedure)
127 static MRESULT EXPENTRY
OS2FrameProc( HWND hwnd
, ULONG msg
,
128 MPARAM mp1
, MPARAM Mp2
);
129 static MRESULT EXPENTRY
OS2Proc( HWND hwnd
, ULONG msg
,
130 MPARAM mp1
, MPARAM Mp2
);
133 /// Handle of the instance
135 /// Handle of anchor-block
137 /// Handle of message queue
139 /// Window procedure of the old frame window
140 PFNWP m_pfnwpOldFrameProc
;
141 /// Handle of the parent window
142 HWND m_hParentWindow
;
143 /// Handle of the client window of the parent window
144 HWND m_hParentClientWindow
;
145 /// Directory separator
146 const string m_dirSep
;
148 list
<string
> m_resourcePath
;