1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2003 VideoLAN
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();
56 /// Instantiate an OSTimer with the given callback
57 virtual OSTimer *createOSTimer( const Callback &rCallback );
59 /// Instantiate an OSWindow object
60 virtual OSWindow *createOSWindow( GenericWindow &rWindow,
61 bool dragDrop, bool playOnDrop );
63 /// Instantiate an object OSTooltip.
64 virtual OSTooltip *createOSTooltip();
66 /// Get the directory separator
67 virtual const string getDirSeparator() const;
69 /// Get the screen size
70 virtual int getScreenWidth() const;
71 virtual int getScreenHeight() const;
73 /// Get the work area (screen area without taskbars)
74 virtual Rect getWorkArea() const;
76 /// Get the position of the mouse
77 virtual void getMousePos( int &rXPos, int &rYPos ) const;
80 virtual void changeCursor( CursorType_t type ) const;
82 /// Delete a directory recursively
83 virtual void rmDir( const string &rPath );
85 /// Map to find the GenericWindow associated with a Win32Window
86 map<HWND, GenericWindow*> m_windowMap;
89 /// Functions dynamically loaded from the dll, because they don't exist
91 // We dynamically load msimg32.dll to get a pointer to TransparentBlt()
92 BOOL (WINAPI *TransparentBlt)( HDC, int, int, int, int,
93 HDC, int, int, int, int, UINT );
94 BOOL (WINAPI *AlphaBlend)( HDC, int, int, int, int,
95 HDC, int, int, int, int, BLENDFUNCTION );
97 // Idem for user32.dll and SetLayeredWindowAttributes()
98 BOOL (WINAPI *SetLayeredWindowAttributes)( HWND, COLORREF,
102 /// Handle of the instance
104 /// Handle of the parent window
105 HWND m_hParentWindow;
106 /// Handle on msimg32.dll (for TransparentBlt)
107 HINSTANCE m_hMsimg32;
108 /// Handle on user32.dll (for SetLayeredWindowAttributes)