]> git.sesse.net Git - vlc/blob - modules/gui/skins2/x11/x11_factory.hpp
* all: brand new skins interface ( still _experimental_) for x11 and
[vlc] / modules / gui / skins2 / x11 / x11_factory.hpp
1 /*****************************************************************************
2  * x11_factory.hpp
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id: x11_factory.hpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *          Olivier Teulière <ipkiss@via.ecp.fr>
9  *
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.
14  *
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.
19  *
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  *****************************************************************************/
24
25 #ifndef X11_FACTORY_HPP
26 #define X11_FACTORY_HPP
27
28 #include <X11/Xlib.h>
29
30 #include "../src/os_factory.hpp"
31 #include <map>
32
33 class X11Display;
34 class X11TimerLoop;
35
36
37 /// Class used to instanciate X11 specific objects
38 class X11Factory: public OSFactory
39 {
40     public:
41         X11Factory( intf_thread_t *pIntf );
42         virtual ~X11Factory();
43
44         /// Initialization method
45         virtual bool init();
46
47         /// Instantiate an object OSGraphics.
48         virtual OSGraphics *createOSGraphics( int width, int height );
49
50         /// Get the instance of the singleton OSLoop.
51         virtual OSLoop *getOSLoop();
52
53         /// Destroy the instance of OSLoop.
54         virtual void destroyOSLoop();
55
56         /// Instantiate an OSTimer with the given callback
57         virtual OSTimer *createOSTimer( const Callback &rCallback );
58
59         /// Instantiate an OSWindow object
60         virtual OSWindow *createOSWindow( GenericWindow &rWindow,
61                                           bool dragDrop, bool playOnDrop );
62
63         /// Instantiate an object OSTooltip.
64         virtual OSTooltip *createOSTooltip();
65
66         /// Get the directory separator
67         virtual const string getDirSeparator() const;
68
69         /// Get the screen size
70         virtual int getScreenWidth() const;
71         virtual int getScreenHeight() const;
72
73         /// Get the work area (screen area without taskbars)
74         virtual Rect getWorkArea() const;
75
76         /// Get the position of the mouse
77         virtual void getMousePos( int &rXPos, int &rYPos ) const;
78
79         /// Delete a directory recursively
80         virtual void rmDir( const string &rPath );
81
82         /// Get the timer loop
83         X11TimerLoop *getTimerLoop() const { return m_pTimerLoop; }
84
85         /// Map to find the GenericWindow associated with a X11Window
86         map<Window, GenericWindow*> m_windowMap;
87
88     private:
89         /// X11 display
90         X11Display *m_pDisplay;
91         /// Timer loop
92         X11TimerLoop *m_pTimerLoop;
93 };
94
95 #endif