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
39namespace CEGUI
40{
51class CEGUIEXPORT FrameComponent : public FalagardComponentBase
52{
53public:
55
64
73
82
91
100
109
115 void setLeftEdgeFormattingPropertySource(const String& property_name);
116
123
129 void setTopEdgeFormattingPropertySource(const String& property_name);
130
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
358protected:
360 {
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
Class that holds details of colours for the four corners of a rectangle.
Definition: ColourRect.h:45
Common base class used for renderable components within an ImagerySection.
Definition: ComponentBase.h:39
Class that encapsulates information for a frame with background (9 images in total)
Definition: FrameComponent.h:52
bool isImageFetchedFromProperty(FrameImageComponent part) const
Return whether the given component image is specified via a property.
void setBottomEdgeFormatting(HorizontalFormatting fmt)
Set the formatting to be used for the bottom edge image.
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.
VerticalFormatting getBackgroundVerticalFormatting(const Window &wnd) const
Return the vertical formatting to be used for the background image.
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...
void setImage(FrameImageComponent part, const Image *image)
Set an Image that will be drawn by this FrameComponent.
HorizontalFormatting getBottomEdgeFormatting(const Window &wnd) const
Return the formatting to be used for the bottom edge image.
void setBackgroundVerticalFormatting(VerticalFormatting fmt)
Set the vertical formatting to be used for the background image.
void render_impl(Window &srcWindow, Rectf &destRect, const CEGUI::ColourRect *modColours, const Rectf *clipper, bool clipToDisplay) const
Function to do main render caching work.
void setBackgroundHorizontalFormatting(HorizontalFormatting fmt)
Set the horizontal formatting to be used for the background image.
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...
void writeXMLToStream(XMLSerializer &xml_stream) const
Writes an xml representation of this FrameComponent to out_stream.
VerticalFormatting getRightEdgeFormatting(const Window &wnd) const
Return the formatting to be used for the right edge image.
VerticalFormatting getLeftEdgeFormatting(const Window &wnd) const
Return the formatting to be used for the left edge image.
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.
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.
static const HorizontalFormatting HorizontalFormattingDefault
Default value for the HorzFormat elements of the FrameComponent.
Definition: FrameComponent.h:354
HorizontalFormatting getBackgroundHorizontalFormatting(const Window &wnd) const
Return the horizontal formatting to be used for the background image.
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...
bool isImageSpecified(FrameImageComponent part) const
Return whether the given component image has been specified.
static const VerticalFormatting VerticalFormattingDefault
Default value for the VertFormat elements of the FrameComponent.
Definition: FrameComponent.h:356
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...
void setRightEdgeFormatting(VerticalFormatting fmt)
Set the formatting to be used for the right edge image.
void setTopEdgeFormatting(HorizontalFormatting fmt)
Set the formatting to be used for the top edge image.
HorizontalFormatting getTopEdgeFormatting(const Window &wnd) const
Return the formatting to be used for the top edge image.
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...
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 ...
void setLeftEdgeFormatting(VerticalFormatting fmt)
Set the formatting to be used for the left edge image.
const Image * getImage(FrameImageComponent imageComponent) const
Return a pointer to the Image object that was set for this FrameComponent for a specified frame part.
void setImage(FrameImageComponent part, const String &name)
Set an Image that will be drawn by this FrameComponent.
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
Interface for Image.
Definition: Image.h:161
String class used within the GUI system.
Definition: String.h:64
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
Class used to create XML Document.
Definition: XMLSerializer.h:87
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
FrameImageComponent
Enumeration of values referencing available images forming a frame component.
Definition: Enums.h:136
@ FIC_FRAME_IMAGE_COUNT
Max number of images for a frame.
Definition: Enums.h:146
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.
VerticalFormatting
Enumeration of possible values to indicate the vertical formatting to be used for an image component.
Definition: Enums.h:59
HorizontalFormatting
Enumeration of possible values to indicate the horizontal formatting to be used for an image componen...
Definition: Enums.h:72
Definition: FrameComponent.h:360