x11_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 X11_FACTORY_HPP
00026 #define X11_FACTORY_HPP
00027
00028 #include <X11/Xlib.h>
00029
00030 #include "../src/os_factory.hpp"
00031 #include "../src/generic_window.hpp"
00032 #include <map>
00033
00034 class X11Display;
00035 class X11DragDrop;
00036 class X11TimerLoop;
00037
00038
00039
00040 class X11Factory: public OSFactory
00041 {
00042 private:
00043
00044
00045
00046
00047
00048 template<class K, class V> class ptrmap {
00049 private:
00050 typedef V *value_type;
00051 typedef std::map<K,value_type> map_t;
00052 map_t m_map;
00053 ptrmap &operator=(const ptrmap &);
00054 ptrmap(const ptrmap &);
00055 public:
00056 ptrmap() { }
00057 value_type &operator[](K k) { return m_map.operator[](k); }
00058 value_type operator[](K k) const
00059 {
00060 typename map_t::const_iterator i=m_map.find(k);
00061 return i!=m_map.end() ? i->second : NULL;
00062 }
00063 };
00064 public:
00065
00066 ptrmap<Window, GenericWindow> m_windowMap;
00067
00068 ptrmap<Window, X11DragDrop> m_dndMap;
00069
00070 X11Factory( intf_thread_t *pIntf );
00071 virtual ~X11Factory();
00072
00073
00074 virtual bool init();
00075
00076
00077 virtual OSGraphics *createOSGraphics( int width, int height );
00078
00079
00080 virtual OSLoop *getOSLoop();
00081
00082
00083 virtual void destroyOSLoop();
00084
00085
00086 virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
00087
00088
00089 virtual void minimize();
00090
00091
00092 virtual void restore();
00093
00094
00095 virtual void addInTray();
00096
00097
00098 virtual void removeFromTray();
00099
00100
00101 virtual void addInTaskBar();
00102
00103
00104 virtual void removeFromTaskBar();
00105
00106
00107 virtual OSWindow *createOSWindow( GenericWindow &rWindow,
00108 bool dragDrop, bool playOnDrop,
00109 OSWindow *pParent,
00110 GenericWindow::WindowType_t type );
00111
00112
00113 virtual OSTooltip *createOSTooltip();
00114
00115
00116 virtual OSPopup *createOSPopup();
00117
00118
00119 virtual const string &getDirSeparator() const { return m_dirSep; }
00120
00121
00122 virtual const list<string> &getResourcePath() const
00123 { return m_resourcePath; }
00124
00125
00126 virtual int getScreenWidth() const;
00127 virtual int getScreenHeight() const;
00128
00129
00130 virtual SkinsRect getWorkArea() const;
00131
00132
00133 virtual void getMousePos( int &rXPos, int &rYPos ) const;
00134
00135
00136 virtual void changeCursor( CursorType_t type ) const { }
00137
00138
00139 virtual void rmDir( const string &rPath );
00140
00141
00142 X11TimerLoop *getTimerLoop() const { return m_pTimerLoop; }
00143
00144 private:
00145
00146 X11Display *m_pDisplay;
00147
00148 X11TimerLoop *m_pTimerLoop;
00149
00150 const string m_dirSep;
00151
00152 list<string> m_resourcePath;
00153 };
00154
00155 #endif