00001 /************************************************************************ 00002 filename: CEGUIRenderableFrame.h 00003 created: 14/4/2004 00004 author: Paul D Turner 00005 00006 purpose: Interface to RenderableFrame UI construct 00007 *************************************************************************/ 00008 /************************************************************************* 00009 Crazy Eddie's GUI System (http://www.cegui.org.uk) 00010 Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk) 00011 00012 This library is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU Lesser General Public 00014 License as published by the Free Software Foundation; either 00015 version 2.1 of the License, or (at your option) any later version. 00016 00017 This library is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 Lesser General Public License for more details. 00021 00022 You should have received a copy of the GNU Lesser General Public 00023 License along with this library; if not, write to the Free Software 00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 *************************************************************************/ 00026 #ifndef _CEGUIRenderableFrame_h_ 00027 #define _CEGUIRenderableFrame_h_ 00028 00029 #include "CEGUIBase.h" 00030 #include "CEGUIRenderableElement.h" 00031 00032 00033 // Start of CEGUI namespace section 00034 namespace CEGUI 00035 { 00040 enum FrameLocation 00041 { 00042 Invalid, // Value reserved to indicate some invalid or unknown location. 00043 TopLeftCorner, // Top-Left corner of a frame / rectangle. 00044 TopRightCorner, // Top-Right corner of a frame / rectangle. 00045 BottomLeftCorner, // Bottom-Left corner of a frame / rectangle. 00046 BottomRightCorner, // Bottom-Right corner of a frame / rectangle. 00047 LeftEdge, // Left edge of a frame / rectangle. 00048 TopEdge, // Top edge of a frame / rectangle. 00049 RightEdge, // Right edge of a frame / rectangle. 00050 BottomEdge // Bottom edge of a frame / rectangle. 00051 }; 00052 00053 00065 class CEGUIEXPORT RenderableFrame : public RenderableElement 00066 { 00067 public: 00068 /************************************************************************* 00069 Construction / Destruction 00070 *************************************************************************/ 00075 RenderableFrame(void); 00076 00077 00082 virtual ~RenderableFrame(void); 00083 00084 00116 void setImages(const Image* topleft, const Image* topright, const Image* bottomleft, const Image* bottomright, const Image* left, const Image* top, const Image* right, const Image* bottom); 00117 00118 00133 void setImageForLocation(FrameLocation location, const Image* image); 00134 00135 00136 00148 const Image* getImageForLocation(FrameLocation location) const; 00149 00150 00151 protected: 00152 /************************************************************************* 00153 Implementation functions 00154 *************************************************************************/ 00168 void draw_impl(const Vector3& position, const Rect& clip_rect) const; 00169 00170 // implements abstract method 00171 void draw_impl(RenderCache& renderCache) const; 00172 00173 /************************************************************************* 00174 Implementation Data 00175 *************************************************************************/ 00176 // image pointers 00177 const Image* d_topleft; 00178 const Image* d_topright; 00179 const Image* d_bottomleft; 00180 const Image* d_bottomright; 00181 const Image* d_left; 00182 const Image* d_right; 00183 const Image* d_top; 00184 const Image* d_bottom; 00185 }; 00186 00187 } // End of CEGUI namespace section 00188 00189 00190 #endif // end of guard _CEGUIRenderableFrame_h_