Crazy Eddie's GUI System  0.8.7
FrameComponent.h
1 /***********************************************************************
2  created: Mon Jul 18 2005
3  author: Paul D Turner <paul@cegui.org.uk>
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2012 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIFalFrameComponent_h_
28 #define _CEGUIFalFrameComponent_h_
29 
30 #include "CEGUI/falagard/ComponentBase.h"
31 #include "CEGUI/XMLSerializer.h"
32 #include "CEGUI/falagard/FormattingSetting.h"
33 
34 #if defined(_MSC_VER)
35 # pragma warning(push)
36 # pragma warning(disable : 4251)
37 #endif
38 
39 namespace CEGUI
40 {
51 class CEGUIEXPORT FrameComponent : public FalagardComponentBase
52 {
53 public:
55 
64 
73 
82 
91 
100 
109 
115  void setLeftEdgeFormattingPropertySource(const String& property_name);
116 
122  void setRightEdgeFormattingPropertySource(const String& property_name);
123 
129  void setTopEdgeFormattingPropertySource(const String& property_name);
130 
136  void setBottomEdgeFormattingPropertySource(const String& property_name);
137 
144 
151 
160 
169 
178 
187 
196 
205 
224  const Image* getImage(FrameImageComponent imageComponent,
225  const Window& wnd) const;
226 
240  const Image* getImage(FrameImageComponent imageComponent) const;
241 
254  void setImage(FrameImageComponent part, const Image* image);
255 
270  void setImage(FrameImageComponent part, const String& name);
271 
288 
302 
318 
336 
348  void writeXMLToStream(XMLSerializer& xml_stream) const;
349 
350  bool operator==(const FrameComponent& rhs) const;
351 
352 
357 
358 protected:
360  {
361  FrameImageSource() :
362  d_specified(false),
363  d_image(0)
364  {}
365 
366  bool operator==(const FrameImageSource& rhs) const
367  {
368  return d_specified == rhs.d_specified &&
369  d_image == rhs.d_image &&
370  d_propertyName == rhs.d_propertyName;
371  }
372 
373  bool operator!=(const FrameImageSource& rhs) const
374  {
375  return !operator==(rhs);
376  }
377 
378  bool d_specified;
379  const Image* d_image;
380  String d_propertyName;
381  };
382 
383  // implemets abstract from base
384  void render_impl(Window& srcWindow, Rectf& destRect,
385  const CEGUI::ColourRect* modColours,
386  const Rectf* clipper, bool clipToDisplay) const;
387 
388  void renderImage(GeometryBuffer& buffer, const Image* image,
389  VerticalFormatting vertFmt,
390  HorizontalFormatting horzFmt,
391  Rectf& destRect, const ColourRect& colours,
392  const Rectf* clipper, bool clipToDisplay) const;
393 
394  FormattingSetting<VerticalFormatting> d_leftEdgeFormatting;
395  FormattingSetting<VerticalFormatting> d_rightEdgeFormatting;
396  FormattingSetting<HorizontalFormatting> d_topEdgeFormatting;
397  FormattingSetting<HorizontalFormatting> d_bottomEdgeFormatting;
398  FormattingSetting<VerticalFormatting> d_backgroundVertFormatting;
399  FormattingSetting<HorizontalFormatting> d_backgroundHorzFormatting;
400 
403 };
404 
405 }
406 
407 #if defined(_MSC_VER)
408 # pragma warning(pop)
409 #endif
410 
411 #endif
412 
CEGUI::FrameComponent::getBackgroundVerticalFormatting
VerticalFormatting getBackgroundVerticalFormatting(const Window &wnd) const
Return the vertical formatting to be used for the background image.
CEGUI::GeometryBuffer
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
CEGUI::FrameComponent::getBackgroundHorizontalFormatting
HorizontalFormatting getBackgroundHorizontalFormatting(const Window &wnd) const
Return the horizontal formatting to be used for the background image.
CEGUI::FrameComponent::isImageSpecified
bool isImageSpecified(FrameImageComponent part) const
Return whether the given component image has been specified.
CEGUI::FrameComponent
Class that encapsulates information for a frame with background (9 images in total)
Definition: FrameComponent.h:52
CEGUI::FrameComponent::getImagePropertySource
const String & getImagePropertySource(FrameImageComponent part) const
Return the name of the property that will be used to determine the image to use for the given compone...
CEGUI::FormattingSetting< VerticalFormatting >
CEGUI::FrameComponent::setBottomEdgeFormattingPropertySource
void setBottomEdgeFormattingPropertySource(const String &property_name)
Set the name of a property that will be used to obtain the formatting to use for the bottom edge imag...
CEGUI::FrameComponent::setLeftEdgeFormattingPropertySource
void setLeftEdgeFormattingPropertySource(const String &property_name)
Set the name of a property that will be used to obtain the formatting to use for the left edge image.
CEGUI::FrameComponent::setTopEdgeFormatting
void setTopEdgeFormatting(HorizontalFormatting fmt)
Set the formatting to be used for the top edge image.
CEGUI::operator!=
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.
CEGUI::FrameComponent::getRightEdgeFormatting
VerticalFormatting getRightEdgeFormatting(const Window &wnd) const
Return the formatting to be used for the right edge image.
CEGUI::FrameComponent::isImageFetchedFromProperty
bool isImageFetchedFromProperty(FrameImageComponent part) const
Return whether the given component image is specified via a property.
CEGUI::XMLSerializer
Class used to create XML Document.
Definition: XMLSerializer.h:87
CEGUI::FrameComponent::setTopEdgeFormattingPropertySource
void setTopEdgeFormattingPropertySource(const String &property_name)
Set the name of a property that will be used to obtain the formatting to use for the top edge image.
CEGUI::FrameComponent::setImage
void setImage(FrameImageComponent part, const Image *image)
Set an Image that will be drawn by this FrameComponent.
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::ColourRect
Class that holds details of colours for the four corners of a rectangle.
Definition: ColourRect.h:45
CEGUI::FrameComponent::getImage
const Image * getImage(FrameImageComponent imageComponent) const
Return a pointer to the Image object that was set for this FrameComponent for a specified frame part.
CEGUI::FrameComponent::setImage
void setImage(FrameImageComponent part, const String &name)
Set an Image that will be drawn by this FrameComponent.
CEGUI::FrameComponent::setBackgroundVerticalFormattingPropertySource
void setBackgroundVerticalFormattingPropertySource(const String &property_name)
Set the name of a property that will be used to obtain the vertical formatting to use for the backdro...
CEGUI::FrameComponent::setBottomEdgeFormatting
void setBottomEdgeFormatting(HorizontalFormatting fmt)
Set the formatting to be used for the bottom edge image.
CEGUI::FrameComponent::setRightEdgeFormatting
void setRightEdgeFormatting(VerticalFormatting fmt)
Set the formatting to be used for the right edge image.
CEGUI::FrameComponent::HorizontalFormattingDefault
static const HorizontalFormatting HorizontalFormattingDefault
Default value for the HorzFormat elements of the FrameComponent.
Definition: FrameComponent.h:354
CEGUI::FrameComponent::setImagePropertySource
void setImagePropertySource(FrameImageComponent part, const String &name)
Set the name of the Property that will be accesssed on the target Window to determine the Image that ...
CEGUI::HorizontalFormatting
HorizontalFormatting
Enumeration of possible values to indicate the horizontal formatting to be used for an image componen...
Definition: Enums.h:72
CEGUI::FrameComponent::getTopEdgeFormatting
HorizontalFormatting getTopEdgeFormatting(const Window &wnd) const
Return the formatting to be used for the top edge image.
CEGUI::FrameComponent::setLeftEdgeFormatting
void setLeftEdgeFormatting(VerticalFormatting fmt)
Set the formatting to be used for the left edge image.
CEGUI::FrameImageComponent
FrameImageComponent
Enumeration of values referencing available images forming a frame component.
Definition: Enums.h:136
CEGUI::VerticalFormatting
VerticalFormatting
Enumeration of possible values to indicate the vertical formatting to be used for an image component.
Definition: Enums.h:59
CEGUI::FrameComponent::writeXMLToStream
void writeXMLToStream(XMLSerializer &xml_stream) const
Writes an xml representation of this FrameComponent to out_stream.
CEGUI::FrameComponent::VerticalFormattingDefault
static const VerticalFormatting VerticalFormattingDefault
Default value for the VertFormat elements of the FrameComponent.
Definition: FrameComponent.h:356
CEGUI::operator==
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.
CEGUI::FalagardComponentBase
Common base class used for renderable components within an ImagerySection.
Definition: ComponentBase.h:39
CEGUI::Window
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
CEGUI::FrameComponent::getLeftEdgeFormatting
VerticalFormatting getLeftEdgeFormatting(const Window &wnd) const
Return the formatting to be used for the left edge image.
CEGUI::FrameComponent::setBackgroundHorizontalFormattingPropertySource
void setBackgroundHorizontalFormattingPropertySource(const String &property_name)
Set the name of a property that will be used to obtain the horizontal formatting to use for the backd...
CEGUI::FrameComponent::render_impl
void render_impl(Window &srcWindow, Rectf &destRect, const CEGUI::ColourRect *modColours, const Rectf *clipper, bool clipToDisplay) const
Function to do main render caching work.
CEGUI::FrameComponent::getBottomEdgeFormatting
HorizontalFormatting getBottomEdgeFormatting(const Window &wnd) const
Return the formatting to be used for the bottom edge image.
CEGUI::String
String class used within the GUI system.
Definition: String.h:64
CEGUI::FrameComponent::FrameImageSource
Definition: FrameComponent.h:360
CEGUI::FrameComponent::getImage
const Image * getImage(FrameImageComponent imageComponent, const Window &wnd) const
Return the Image object that will be drawn by this FrameComponent for a specified frame part.
CEGUI::FIC_FRAME_IMAGE_COUNT
@ FIC_FRAME_IMAGE_COUNT
Max number of images for a frame.
Definition: Enums.h:146
CEGUI::Rect< float >
CEGUI::FrameComponent::setRightEdgeFormattingPropertySource
void setRightEdgeFormattingPropertySource(const String &property_name)
Set the name of a property that will be used to obtain the formatting to use for the right edge image...
CEGUI::FrameComponent::setBackgroundHorizontalFormatting
void setBackgroundHorizontalFormatting(HorizontalFormatting fmt)
Set the horizontal formatting to be used for the background image.
CEGUI::Image
Interface for Image.
Definition: Image.h:161
CEGUI::FrameComponent::setBackgroundVerticalFormatting
void setBackgroundVerticalFormatting(VerticalFormatting fmt)
Set the vertical formatting to be used for the background image.