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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef X11_FACTORY_HPP
26 #define X11_FACTORY_HPP
30 #include "../src/os_factory.hpp"
38 /// Class used to instanciate X11 specific objects
39 class X11Factory: public OSFactory
42 /// Map to find the GenericWindow associated to a X11Window
43 map<Window, GenericWindow*> m_windowMap;
44 /// Map to find the Dnd object associated to a X11Window
45 map<Window, X11DragDrop*> m_dndMap;
47 X11Factory( intf_thread_t *pIntf );
48 virtual ~X11Factory();
50 /// Initialization method
53 /// Instantiate an object OSGraphics
54 virtual OSGraphics *createOSGraphics( int width, int height );
56 /// Get the instance of the singleton OSLoop
57 virtual OSLoop *getOSLoop();
59 /// Destroy the instance of OSLoop
60 virtual void destroyOSLoop();
62 /// Instantiate an OSTimer with the given command
63 virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
65 /// Minimize all the windows
66 virtual void minimize();
68 /// Restore the minimized windows
69 virtual void restore();
71 /// Add an icon in the system tray
72 virtual void addInTray();
74 /// Remove the icon from the system tray
75 virtual void removeFromTray();
77 /// Show the task in the task bar
78 virtual void addInTaskBar();
80 /// Remove the task from the task bar
81 virtual void removeFromTaskBar();
83 /// Instantiate an OSWindow object
84 virtual OSWindow *createOSWindow( GenericWindow &rWindow,
85 bool dragDrop, bool playOnDrop,
88 /// Instantiate an object OSTooltip
89 virtual OSTooltip *createOSTooltip();
91 /// Instantiate an object OSPopup
92 virtual OSPopup *createOSPopup();
94 /// Get the directory separator
95 virtual const string &getDirSeparator() const { return m_dirSep; }
97 /// Get the resource path
98 virtual const list<string> &getResourcePath() const
99 { return m_resourcePath; }
101 /// Get the screen size
102 virtual int getScreenWidth() const;
103 virtual int getScreenHeight() const;
105 /// Get the work area (screen area without taskbars)
106 virtual SkinsRect getWorkArea() const;
108 /// Get the position of the mouse
109 virtual void getMousePos( int &rXPos, int &rYPos ) const;
111 /// Change the cursor
112 virtual void changeCursor( CursorType_t type ) const { /*TODO*/ }
114 /// Delete a directory recursively
115 virtual void rmDir( const string &rPath );
117 /// Get the timer loop
118 X11TimerLoop *getTimerLoop() const { return m_pTimerLoop; }
122 X11Display *m_pDisplay;
124 X11TimerLoop *m_pTimerLoop;
125 /// Directory separator
126 const string m_dirSep;
128 list<string> m_resourcePath;