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

uxframe.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/ux/uxframe.hpp 00008 begin : Wed Jul 28 2004 00009 $Id: uxframe.hpp,v 1.5 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 UXFRAME_HPP 00029 #define UXFRAME_HPP 00030 00031 #include "../uobject.hpp" 00032 00033 #include "../util/urectangle.hpp" 00034 #include "../signals/ufo_signals.hpp" 00035 00036 namespace ufo { 00037 00038 class UXContext; 00039 class UXDisplay; 00040 class URootPane; 00041 class UWidget; 00042 class UVideoDevice; 00043 00055 class UFO_EXPORT UXFrame : public UObject { 00056 UFO_DECLARE_DYNAMIC_CLASS(UXFrame) 00057 friend class UXDisplay; 00058 protected: 00059 UXFrame(UVideoDevice * device); 00060 public: 00061 virtual ~UXFrame(); 00062 00063 public: // video device specific 00065 void swapBuffers(); 00067 void makeContextCurrent(); 00068 00069 UVideoDevice * getVideoDevice() const; 00070 00071 public: 00072 UXContext * getContext() const; 00073 00074 URootPane * getRootPane() const; 00075 UWidget * getContentPane() const; 00076 00082 virtual void repaint(bool force = false); 00083 00084 public: 00085 void setVisible(bool vis); 00086 bool isVisible(); 00087 00088 void setDepth(int depth); 00089 int getDepth() const; 00090 00091 // 00092 // various window manager attributes 00093 // 00094 00096 void setTitle(std::string title); 00098 std::string getTitle(); 00099 00100 void setFullScreened(bool b); 00101 bool isFullScreened() const; 00102 00106 void setFrameStyle(uint32_t frameStyle); 00107 FrameStyle getFrameStyle() const; 00108 00109 void setResizable(bool b); 00110 bool isResizable() const; 00111 00116 void setInitialFrameState(uint32_t initialState); 00120 FrameState getFrameState() const; 00121 00122 // 00123 // geometry 00124 // 00125 00130 void pack(); 00131 00132 void setSize(int w, int h); 00133 void setSize(const UDimension & d); 00135 UDimension getSize() const; 00136 00137 void setLocation(int x, int y); 00138 void setLocation(const UPoint & d); 00141 UPoint getLocation() const; 00142 00143 void setBounds(int x, int y, int w, int h); 00144 void setBounds(const URectangle & rect); 00146 URectangle getBounds() const; 00147 00152 void makeScreenShot(std::string fileNameA); 00153 00154 public: // Public signals 00155 USignal1<UXFrame*> & sigMoved(); 00156 USignal1<UXFrame*> & sigResized(); 00157 00158 protected: // 00159 void openContext(); 00160 void closeContext(); 00161 00162 private: // Private slots 00163 void deviceMoved(UVideoDevice * videoDevice); 00164 void deviceResized(UVideoDevice * videoDevice); 00165 00166 private: // Private attributes 00167 UVideoDevice * m_videoDevice; 00168 UXContext * m_context; 00169 00170 bool m_isVisible; 00171 private: // Private signals 00172 USignal1<UXFrame*> m_sigMoved; 00173 USignal1<UXFrame*> m_sigResized; 00174 }; 00175 00176 // 00177 // inline implementation 00178 // 00179 00180 inline USignal1<UXFrame*> & 00181 UXFrame::sigMoved() { 00182 return m_sigMoved; 00183 } 00184 00185 inline USignal1<UXFrame*> & 00186 UXFrame::sigResized() { 00187 return m_sigResized; 00188 } 00189 00190 } // namespace ufo 00191 00192 #endif // UXFRAME_HPP

The libUFO Project - written by Johannes Schmidt