win32_factory.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef WIN32_FACTORY_HPP
00026 #define WIN32_FACTORY_HPP
00027
00028 #ifndef _WIN32_WINNT
00029 # define _WIN32_WINNT 0x0500
00030 #endif
00031
00032 #include <windows.h>
00033 #include <shellapi.h>
00034
00035 #include "../src/os_factory.hpp"
00036 #include "../src/generic_window.hpp"
00037
00038 #include <map>
00039
00040
00041
00042 class Win32Factory: public OSFactory
00043 {
00044 public:
00045 Win32Factory( intf_thread_t *pIntf );
00046 virtual ~Win32Factory();
00047
00048
00049 virtual bool init();
00050
00051
00052 virtual OSGraphics *createOSGraphics( int width, int height );
00053
00054
00055 virtual OSLoop *getOSLoop();
00056
00057
00058 virtual void destroyOSLoop();
00059
00060
00061 virtual void minimize();
00062
00063
00064 virtual void restore();
00065
00066
00067 virtual void addInTray();
00068
00069
00070 virtual void removeFromTray();
00071
00072
00073 virtual void addInTaskBar();
00074
00075
00076 virtual void removeFromTaskBar();
00077
00078
00079 virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
00080
00081
00082 virtual OSWindow *createOSWindow( GenericWindow &rWindow,
00083 bool dragDrop, bool playOnDrop,
00084 OSWindow *pParent,
00085 GenericWindow::WindowType_t type );
00086
00087
00088 virtual OSTooltip *createOSTooltip();
00089
00090
00091 virtual OSPopup *createOSPopup();
00092
00093
00094 virtual const string &getDirSeparator() const { return m_dirSep; }
00095
00096
00097 virtual const list<string> &getResourcePath() const
00098 { return m_resourcePath; }
00099
00100
00101 virtual int getScreenWidth() const;
00102 virtual int getScreenHeight() const;
00103
00104
00105 virtual SkinsRect getWorkArea() const;
00106
00107
00108 virtual void getMousePos( int &rXPos, int &rYPos ) const;
00109
00110
00111 virtual void changeCursor( CursorType_t type ) const;
00112
00113
00114 virtual void rmDir( const string &rPath );
00115
00116
00117 map<HWND, GenericWindow*> m_windowMap;
00118
00119
00120
00121
00122 BOOL (WINAPI *TransparentBlt)( HDC, int, int, int, int,
00123 HDC, int, int, int, int, UINT );
00124 BOOL (WINAPI *AlphaBlend)( HDC, int, int, int, int,
00125 HDC, int, int, int, int, BLENDFUNCTION );
00126
00127
00128 BOOL (WINAPI *SetLayeredWindowAttributes)( HWND, COLORREF,
00129 BYTE, DWORD );
00130
00131 HWND getParentWindow() { return m_hParentWindow; }
00132
00133 private:
00134
00135 HINSTANCE m_hInst;
00136
00137 HWND m_hParentWindow;
00138
00139 NOTIFYICONDATA m_trayIcon;
00140
00141 HINSTANCE m_hMsimg32;
00142
00143 HINSTANCE m_hUser32;
00144
00145 const string m_dirSep;
00146
00147 list<string> m_resourcePath;
00148 };
00149
00150
00151 #endif