- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

udisplay.hpp

00001 /*************************************************************************** 00002 LibUFO - UI For OpenGL 00003 copyright : (C) 2001-2005 by Johannes Schmidt 00004 email : schmidtjf at users.sourceforge.net 00005 ------------------- 00006 00007 file : include/ufo/udisplay.hpp 00008 begin : Sat Nov 23 2002 00009 $Id: udisplay.hpp,v 1.10 2005/05/21 15:17:35 schmidtjf Exp $ 00010 ***************************************************************************/ 00011 00012 /*************************************************************************** 00013 * This library is free software; you can redistribute it and/or * 00014 * modify it under the terms of the GNU Lesser General Public * 00015 * License as published by the Free Software Foundation; either * 00016 * version 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00021 * Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 00026 ***************************************************************************/ 00027 00028 #ifndef UDISPLAY_HPP 00029 #define UDISPLAY_HPP 00030 00031 #include "uobject.hpp" 00032 #include "events/uevent.hpp" 00033 #include "events/ukeysym.hpp" 00034 00035 #include <vector> 00036 00037 namespace ufo { 00038 00039 class UContext; 00040 class UImage; 00041 class UImageIO; 00042 class UVolatileData; 00043 00063 class UFO_EXPORT UDisplay : public UObject { 00064 UFO_DECLARE_ABSTRACT_CLASS(UDisplay) 00065 public: // Public methods 00069 virtual std::vector<UContext*> getContexts() const = 0; 00070 00071 virtual UImage * createImage(const std::string fileName) = 0; 00072 virtual UImage * createImage(UImageIO * io) = 0; 00073 00074 virtual void addVolatileData(UVolatileData * vdata) = 0; 00075 virtual void removeVolatileData(UVolatileData * vdata) = 0; 00076 public: // event methods 00079 virtual void pumpEvents() = 0; 00080 00083 virtual void pushEvent(UEvent * e) = 0; 00084 00090 virtual bool dispatchEvent(UEvent * e) = 0; 00091 00097 virtual bool dispatchEvents(unsigned int nevents) = 0; 00098 00102 virtual bool dispatchEvents() = 0; 00103 00107 virtual UEvent * getCurrentEvent() const = 0; 00108 00110 virtual int getEventCount() const = 0; 00111 00112 00114 virtual UEvent * peekEvent() const = 0; 00117 virtual UEvent * peekEvent(UEvent::Type type) const = 0; 00118 00124 virtual UEvent * pollEvent() = 0; 00125 00126 public: 00134 virtual UMod_t getModState() const = 0; 00135 00145 virtual UMod_t getMouseState(int * x, int * y) const = 0; 00146 00147 public: // Public static methods 00149 static UDisplay * getDefault(); 00150 00151 protected: // Protected methods 00153 static void setDefault(UDisplay * defaultDisplay); 00154 00155 private: // Private attributes 00156 static UDisplay * m_default; 00157 }; 00158 00159 // 00160 // inline implementation 00161 // 00162 00163 inline UDisplay * 00164 UDisplay::getDefault() { 00165 return m_default; 00166 } 00167 00168 inline void 00169 UDisplay::setDefault(UDisplay * defaultDisplay) { 00170 m_default = defaultDisplay; 00171 } 00172 00173 } // namespace ufo 00174 00175 #endif // UDISPLAY_HPP

The libUFO Project - written by Johannes Schmidt