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

uabstractdisplay.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/uabstractdisplay.hpp 00008 begin : Sat Nov 23 2002 00009 $Id: uabstractdisplay.hpp,v 1.12 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 UABSTRACTDISPLAY_HPP 00029 #define UABSTRACTDISPLAY_HPP 00030 00031 #include "udisplay.hpp" 00032 00033 #include <list> 00034 #include "ufo/util/upoint.hpp" 00035 00036 namespace ufo { 00037 00038 class UTimerEvent; 00039 class UKeyEvent; 00040 class UMouseEvent; 00041 00052 class UFO_EXPORT UAbstractDisplay : public UDisplay { 00053 UFO_DECLARE_ABSTRACT_CLASS(UAbstractDisplay) 00054 public: 00055 UAbstractDisplay(); 00056 virtual ~UAbstractDisplay(); 00057 00058 public: // Implements UDisplay 00059 virtual UImage * createImage(const std::string fileName); 00060 virtual UImage * createImage(UImageIO * io); 00061 virtual void addVolatileData(UVolatileData * vdata); 00062 virtual void removeVolatileData(UVolatileData * vdata); 00063 virtual void pushEvent(UEvent * e); 00064 virtual bool dispatchEvent(UEvent * e); 00065 virtual bool dispatchEvents(unsigned int nevents); 00066 virtual bool dispatchEvents(); 00067 virtual UEvent * getCurrentEvent() const; 00068 00069 virtual int getEventCount() const; 00070 00071 00072 virtual UEvent * peekEvent() const; 00073 virtual UEvent * peekEvent(UEvent::Type type) const; 00074 00075 virtual UEvent * pollEvent(); 00076 00077 public: 00078 virtual UMod_t getModState() const; 00079 virtual UMod_t getMouseState(int * x, int * y) const; 00080 00081 protected: // 00083 void setModState(UMod_t modifiers); 00084 void checkTimerEvents(); 00085 00086 private: // Private methods 00087 bool privateDispatchEvent(UEvent * e); 00088 void preprocessEvent(UEvent * e); 00089 void processKeyModChange(UKeyEvent * keyEvent); 00090 void processMouseModChange(UMouseEvent * mouseEvent); 00091 00092 private: // Private attributes 00093 enum { 00094 NUM_PRIORITIES = 3 00095 }; 00096 std::list<UEvent*> m_queues[NUM_PRIORITIES]; 00097 std::list<UTimerEvent*> m_timerQueue; 00098 UMod_t m_keyModState; 00099 UMod_t m_mouseModState; 00100 UPoint m_mouseLocation; 00101 UEvent * m_currentEvent; 00102 std::list<UVolatileData*> m_volatileData; 00103 }; 00104 00105 } // namespace ufo 00106 00107 #endif // UABSTRACTDISPLAY_HPP

The libUFO Project - written by Johannes Schmidt