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

ucontext.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/ucontext.hpp 00008 begin : Mon Oct 29 2001 00009 $Id: ucontext.hpp,v 1.15 2005/05/21 15:17:23 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 UCONTEXT_HPP 00029 #define UCONTEXT_HPP 00030 00031 #include "uobject.hpp" 00032 00033 #include "signals/usignal.hpp" 00034 00035 #include "util/urectangle.hpp" 00036 #include <list> 00037 00038 namespace ufo { 00039 00040 class UWidget; 00041 class URootPane; 00042 class UContextGroup; 00043 00044 class UUIManager; 00045 class UGraphics; 00046 class URepaintManager; 00047 class UImage; 00048 class UImageIO; 00049 class UInputMap; 00050 00051 class UEvent; 00052 00053 struct USystemInfo; 00054 00068 class UFO_EXPORT UContext : public UObject { 00069 UFO_DECLARE_ABSTRACT_CLASS(UContext) 00070 public: // Public types 00071 enum { 00072 ShareNothing = 0, 00073 ShareGL = 1, 00074 ShareLAF = 3, 00075 ShareAll = ShareLAF 00076 }; 00077 public: // Pure virtual functions 00081 virtual UContextGroup * getContextGroup() const = 0; 00082 00089 virtual UContext * getParent() const = 0; 00090 00095 virtual UUIManager * getUIManager() const = 0; 00096 00098 virtual UGraphics * getGraphics() const = 0; 00099 00101 virtual URepaintManager * getRepaintManager() const = 0; 00102 00110 virtual bool getSystemInfo(USystemInfo * info) const = 0; 00111 00112 00124 //virtual uint32_t getSharedBits() const = 0; 00125 00129 virtual URootPane * getRootPane() const = 0; 00130 00133 virtual void setRootPane(URootPane * paneA) = 0; 00134 00138 virtual UImage * createImage(UImageIO * imageIO) = 0; 00139 00143 virtual UImage * createImage(const std::string & fileName) = 0; 00144 00146 virtual void lock() = 0; 00150 virtual void unlock() = 0; 00151 00152 00153 public: // virtual event functions 00158 virtual void dispatchEvent(UEvent * e) = 0; 00159 00165 virtual void setEventGrabber(const USlot1<UEvent*> & slot) = 0; 00166 virtual void releaseEventGrabber() = 0; 00167 virtual USlot1<UEvent*> * getEventGrabber() const = 0; 00168 00172 virtual void connectListener(const USlot1<UEvent*> & slot) = 0; 00173 virtual void disconnectListener(const USlot1<UEvent*> & slot) = 0; 00174 virtual std::list<USlot1<UEvent*> > getListeners() const = 0; 00175 00176 virtual UInputMap * getInputMap() = 0; 00177 virtual void setInputMap(UInputMap * newMap) = 0; 00178 public: // virtual geometry methods 00180 virtual void setDeviceBounds(const URectangle & rect) = 0; 00181 virtual URectangle getDeviceBounds() const = 0; 00182 00183 00187 virtual void setContextBounds(const URectangle & rect) = 0; 00188 virtual URectangle getContextBounds() const = 0; 00189 00190 public: // Public 00194 virtual void init() = 0; 00196 virtual void refresh() = 0; 00200 virtual void dispose() = 0; 00201 00202 public: // Public signals 00206 USignal0 & sigRefresh(); 00207 private: 00208 USignal0 m_sigRefresh; 00209 }; 00210 00211 // 00212 // inline implementation 00213 // 00214 00215 inline USignal0 & 00216 UContext::sigRefresh() { 00217 return m_sigRefresh; 00218 } 00219 00220 } // namespace ufo 00221 00222 #endif // UCONTEXT_HPP

The libUFO Project - written by Johannes Schmidt