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 WIN32_FACTORY_HPP
26 #define WIN32_FACTORY_HPP
29 # define _WIN32_WINNT 0x0500
33 #include "../src/os_factory.hpp"
37 /// Class used to instanciate Win32 specific objects
38 class Win32Factory: public OSFactory
41 Win32Factory( intf_thread_t *pIntf );
42 virtual ~Win32Factory();
44 /// Initialization method
47 /// Instantiate an object OSGraphics
48 virtual OSGraphics *createOSGraphics( int width, int height );
50 /// Get the instance of the singleton OSLoop
51 virtual OSLoop *getOSLoop();
53 /// Destroy the instance of OSLoop
54 virtual void destroyOSLoop();
57 virtual void minimize();
59 /// Instantiate an OSTimer with the given command
60 virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
62 /// Instantiate an OSWindow object
63 virtual OSWindow *createOSWindow( GenericWindow &rWindow,
64 bool dragDrop, bool playOnDrop,
67 /// Instantiate an object OSTooltip
68 virtual OSTooltip *createOSTooltip();
70 /// Instantiate an object OSPopup
71 virtual OSPopup *createOSPopup();
73 /// Get the directory separator
74 virtual const string &getDirSeparator() const { return m_dirSep; }
76 /// Get the resource path
77 virtual const list<string> &getResourcePath() const
78 { return m_resourcePath; }
80 /// Get the screen size
81 virtual int getScreenWidth() const;
82 virtual int getScreenHeight() const;
84 /// Get the work area (screen area without taskbars)
85 virtual Rect getWorkArea() const;
87 /// Get the position of the mouse
88 virtual void getMousePos( int &rXPos, int &rYPos ) const;
91 virtual void changeCursor( CursorType_t type ) const;
93 /// Delete a directory recursively
94 virtual void rmDir( const string &rPath );
96 /// Map to find the GenericWindow associated with a Win32Window
97 map<HWND, GenericWindow*> m_windowMap;
99 /// Functions dynamically loaded from the dll, because they don't exist
101 // We dynamically load msimg32.dll to get a pointer to TransparentBlt()
102 BOOL (WINAPI *TransparentBlt)( HDC, int, int, int, int,
103 HDC, int, int, int, int, UINT );
104 BOOL (WINAPI *AlphaBlend)( HDC, int, int, int, int,
105 HDC, int, int, int, int, BLENDFUNCTION );
107 // Idem for user32.dll and SetLayeredWindowAttributes()
108 BOOL (WINAPI *SetLayeredWindowAttributes)( HWND, COLORREF,
112 /// Handle of the instance
114 /// Handle of the parent window
115 HWND m_hParentWindow;
116 /// Handle on msimg32.dll (for TransparentBlt)
117 HINSTANCE m_hMsimg32;
118 /// Handle on user32.dll (for SetLayeredWindowAttributes)
120 /// Directory separator
121 const string m_dirSep;
123 list<string> m_resourcePath;