Equalizer  1.6.1
windowSystem.h
1 
2 /* Copyright (c) 2006-2011, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2011, Daniel Pfeifer <daniel@pfeifer-mail.de>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQ_WINDOWSYSTEM_H
20 #define EQ_WINDOWSYSTEM_H
21 
22 #include <eq/client/api.h>
23 #include <eq/client/types.h>
24 
25 namespace eq
26 {
27 
30 {
31 protected:
32  EQ_API WindowSystemIF();
33  virtual ~WindowSystemIF() {}
34 
35 private:
36  virtual std::string getName() const = 0;
37 
38  virtual SystemWindow* createWindow(Window* window) const = 0;
39  virtual SystemPipe* createPipe(Pipe* pipe) const = 0;
40  virtual MessagePump* createMessagePump() const = 0;
41  virtual bool setupFont( ObjectManager& gl, const void* key,
42  const std::string& name, const uint32_t size ) const = 0;
43 
44  virtual void configInit( Node* /*node*/ ) {}
45  virtual void configExit( Node* /*node*/ ) {}
46 
47 protected:
48  static uint32_t _setupLists( ObjectManager& gl, const void* key,
49  const int num );
50 
51 private:
52  WindowSystemIF* _next;
53  friend class WindowSystem;
54 };
55 
56 #ifndef EQ_2_0_API
58 {
59  WINDOW_SYSTEM_NONE = 0, // must be first
63  WINDOW_SYSTEM_ALL // must be last
64 };
65 #endif
66 
69 {
70 public:
71  EQ_API WindowSystem();
72  EQ_API WindowSystem( std::string const& type );
73 #ifndef EQ_2_0_API
74  EQ_API WindowSystem( const WindowSystemEnum type );
75  ~WindowSystem() {}
76 
77  EQ_API bool operator == ( const WindowSystemEnum other ) const;
78  EQ_API bool operator != ( const WindowSystemEnum other ) const;
79  EQ_API operator WindowSystemEnum() const;
80 #endif
81 
82  static bool supports( std::string const& type );
83 
84  static void configInit( Node* node );
85  static void configExit( Node* node );
86 
87  EQ_API std::string getName() const;
88 
89  EQ_API SystemWindow* createWindow( Window* window ) const;
90  EQ_API SystemPipe* createPipe( Pipe* pipe ) const;
91  EQ_API MessagePump* createMessagePump() const;
92  EQ_API bool setupFont( ObjectManager& gl, const void* key,
93  const std::string& name, const uint32_t size ) const;
94 
95  EQ_API bool operator == ( const WindowSystem& other ) const;
96  EQ_API bool operator != ( const WindowSystem& other ) const;
97 
98 private:
99  const WindowSystemIF* _impl;
100  void _chooseImpl( const std::string& name );
101 };
102 
104 EQ_API std::ostream& operator << ( std::ostream& os, const WindowSystem& );
105 
107 EQ_API co::DataOStream& operator << ( co::DataOStream& os, const WindowSystem& );
108 
110 EQ_API co::DataIStream& operator >> ( co::DataIStream& is, WindowSystem& ws );
111 
112 } // namespace eq
113 
114 #endif // EQ_WINDOWSYSTEM_H
co::DataIStream & operator>>(co::DataIStream &is, WindowSystem &ws)
WindowSystem deserializer.
A Window represents an on-screen or off-screen drawable.
The interface for windowing toolkits.
Definition: windowSystem.h:29
A Node represents a single computer in the cluster.
std::ostream & operator<<(std::ostream &os, const ConfigEvent *event)
Print the config event to the given output stream.
A facility class to manage OpenGL objects across shared contexts.
A Pipe represents a graphics card (GPU) on a Node.
WindowSystemEnum
Definition: windowSystem.h:57
The interface definition for system-specific GPU handling.
Definition: systemPipe.h:37
The interface definition for system-specific windowing code.
Definition: systemWindow.h:35
An interface to process system messages or events.
Definition: messagePump.h:26
The list of possible window systems.
Definition: windowSystem.h:68