00001 /***************************************************************************** 00002 * x11_factory.hpp 00003 ***************************************************************************** 00004 * Copyright (C) 2003 the VideoLAN team 00005 * $Id$ 00006 * 00007 * Authors: Cyril Deguet <asmax@via.ecp.fr> 00008 * Olivier Teulière <ipkiss@via.ecp.fr> 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 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 <map> 00032 00033 class X11Display; 00034 class X11DragDrop; 00035 class X11TimerLoop; 00036 00037 00038 /// Class used to instanciate X11 specific objects 00039 class X11Factory: public OSFactory 00040 { 00041 public: 00042 /// Map to find the GenericWindow associated to a X11Window 00043 map<Window, GenericWindow*> m_windowMap; 00044 /// Map to find the Dnd object associated to a X11Window 00045 map<Window, X11DragDrop*> m_dndMap; 00046 00047 X11Factory( intf_thread_t *pIntf ); 00048 virtual ~X11Factory(); 00049 00050 /// Initialization method 00051 virtual bool init(); 00052 00053 /// Instantiate an object OSGraphics 00054 virtual OSGraphics *createOSGraphics( int width, int height ); 00055 00056 /// Get the instance of the singleton OSLoop 00057 virtual OSLoop *getOSLoop(); 00058 00059 /// Destroy the instance of OSLoop 00060 virtual void destroyOSLoop(); 00061 00062 /// Instantiate an OSTimer with the given command 00063 virtual OSTimer *createOSTimer( CmdGeneric &rCmd ); 00064 00065 /// Minimize all the windows 00066 virtual void minimize(); 00067 00068 /// Restore the minimized windows 00069 virtual void restore(); 00070 00071 /// Add an icon in the system tray 00072 virtual void addInTray(); 00073 00074 /// Remove the icon from the system tray 00075 virtual void removeFromTray(); 00076 00077 /// Show the task in the task bar 00078 virtual void addInTaskBar(); 00079 00080 /// Remove the task from the task bar 00081 virtual void removeFromTaskBar(); 00082 00083 /// Instantiate an OSWindow object 00084 virtual OSWindow *createOSWindow( GenericWindow &rWindow, 00085 bool dragDrop, bool playOnDrop, 00086 OSWindow *pParent ); 00087 00088 /// Instantiate an object OSTooltip 00089 virtual OSTooltip *createOSTooltip(); 00090 00091 /// Instantiate an object OSPopup 00092 virtual OSPopup *createOSPopup(); 00093 00094 /// Get the directory separator 00095 virtual const string &getDirSeparator() const { return m_dirSep; } 00096 00097 /// Get the resource path 00098 virtual const list<string> &getResourcePath() const 00099 { return m_resourcePath; } 00100 00101 /// Get the screen size 00102 virtual int getScreenWidth() const; 00103 virtual int getScreenHeight() const; 00104 00105 /// Get the work area (screen area without taskbars) 00106 virtual SkinsRect getWorkArea() const; 00107 00108 /// Get the position of the mouse 00109 virtual void getMousePos( int &rXPos, int &rYPos ) const; 00110 00111 /// Change the cursor 00112 virtual void changeCursor( CursorType_t type ) const { /*TODO*/ } 00113 00114 /// Delete a directory recursively 00115 virtual void rmDir( const string &rPath ); 00116 00117 /// Get the timer loop 00118 X11TimerLoop *getTimerLoop() const { return m_pTimerLoop; } 00119 00120 private: 00121 /// X11 display 00122 X11Display *m_pDisplay; 00123 /// Timer loop 00124 X11TimerLoop *m_pTimerLoop; 00125 /// Directory separator 00126 const string m_dirSep; 00127 /// Resource path 00128 list<string> m_resourcePath; 00129 }; 00130 00131 #endif
1.5.1