Equalizer 1.0
|
00001 00002 /* Copyright (c) 2011 Daniel Pfeifer <daniel@pfeifer-mail.de> 00003 * 2011 Stefan Eilemann <eile@eyescale.ch> 00004 * 00005 * This library is free software; you can redistribute it and/or modify it under 00006 * the terms of the GNU Lesser General Public License version 2.1 as published 00007 * by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, but WITHOUT 00010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00012 * details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public License 00015 * along with this library; if not, write to the Free Software Foundation, Inc., 00016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00017 */ 00018 00019 #ifndef EQ_UI_FACTORY_H 00020 #define EQ_UI_FACTORY_H 00021 00022 #include <eq/types.h> 00023 #include <eq/windowSystem.h> 00024 00025 namespace eq 00026 { 00027 class UIFactory 00028 { 00029 public: 00030 static bool supports( WindowSystem type ); 00031 00032 static SystemWindow* createSystemWindow( WindowSystem type, 00033 Window* window ); 00034 00035 static SystemPipe* createSystemPipe( WindowSystem type, Pipe* pipe); 00036 00037 static MessagePump* createMessagePump( WindowSystem type ); 00038 00039 static void configInit( Node* node ); 00040 static void configExit( Node* node ); 00041 00042 protected: 00043 UIFactory( WindowSystem type ); 00044 virtual ~UIFactory() {} 00045 00046 private: 00047 virtual SystemWindow* _createSystemWindow( Window* window ) const = 0; 00048 virtual SystemPipe* _createSystemPipe( Pipe* pipe ) const = 0; 00049 virtual MessagePump* _createMessagePump() const = 0; 00050 00051 virtual void _configInit( Node* node ) const {} 00052 virtual void _configExit( Node* node ) const {} 00053 00054 private: 00055 WindowSystem _type; 00056 UIFactory* _next; 00057 }; 00058 00059 template< WindowSystem WindowSystem > struct UIFactoryImpl : UIFactory 00060 { 00061 UIFactoryImpl() : UIFactory( WindowSystem ) {} 00062 }; 00063 00064 } // namespace eq 00065 00066 #endif /* EQ_UI_FACTORY_H */