1 | /************************************************************************
|
---|
2 | filename: CEGUIFalagard_xmlHandler.h
|
---|
3 | created: Fri Jun 17 2005
|
---|
4 | author: Paul D Turner <paul@cegui.org.uk>
|
---|
5 | *************************************************************************/
|
---|
6 | /*************************************************************************
|
---|
7 | Crazy Eddie's GUI System (http://www.cegui.org.uk)
|
---|
8 | Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
|
---|
9 |
|
---|
10 | This library is free software; you can redistribute it and/or
|
---|
11 | modify it under the terms of the GNU Lesser General Public
|
---|
12 | License as published by the Free Software Foundation; either
|
---|
13 | version 2.1 of the License, or (at your option) any later version.
|
---|
14 |
|
---|
15 | This library is distributed in the hope that it will be useful,
|
---|
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
18 | Lesser General Public License for more details.
|
---|
19 |
|
---|
20 | You should have received a copy of the GNU Lesser General Public
|
---|
21 | License along with this library; if not, write to the Free Software
|
---|
22 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
23 | *************************************************************************/
|
---|
24 | #ifndef _CEGUIFalagard_xmlHandler_h_
|
---|
25 | #define _CEGUIFalagard_xmlHandler_h_
|
---|
26 |
|
---|
27 | #include "CEGUIXMLHandler.h"
|
---|
28 | #include "CEGUIcolour.h"
|
---|
29 | #include "falagard/CEGUIFalDimensions.h"
|
---|
30 | #include "CEGUIWindow.h"
|
---|
31 | #include <vector>
|
---|
32 |
|
---|
33 | // Start of CEGUI namespace section
|
---|
34 | namespace CEGUI
|
---|
35 | {
|
---|
36 | // forward refs
|
---|
37 | class WidgetLookManager;
|
---|
38 | class WidgetLookFeel;
|
---|
39 | class WidgetComponent;
|
---|
40 | class ImagerySection;
|
---|
41 | class StateImagery;
|
---|
42 | class LayerSpecification;
|
---|
43 | class SectionSpecification;
|
---|
44 | class ImageryComponent;
|
---|
45 | class ComponentArea;
|
---|
46 | class Dimension;
|
---|
47 | class TextComponent;
|
---|
48 | class NamedArea;
|
---|
49 | class FrameComponent;
|
---|
50 |
|
---|
51 | /*!
|
---|
52 | \brief
|
---|
53 | Handler class used to parse look & feel XML files used by the Falagard system.
|
---|
54 | */
|
---|
55 | class Falagard_xmlHandler : public XMLHandler
|
---|
56 | {
|
---|
57 | public:
|
---|
58 | /*!
|
---|
59 | \brief
|
---|
60 | Constructor for Falagard_xmlHandler objects
|
---|
61 | */
|
---|
62 | Falagard_xmlHandler(WidgetLookManager* mgr);
|
---|
63 |
|
---|
64 | /*!
|
---|
65 | \brief
|
---|
66 | Destructor for Falagard_xmlHandler objects
|
---|
67 | */
|
---|
68 | ~Falagard_xmlHandler();
|
---|
69 |
|
---|
70 | /*************************************************************************
|
---|
71 | XMLHandler base class overrides
|
---|
72 | *************************************************************************/
|
---|
73 | void elementStart(const String& element, const XMLAttributes& attributes);
|
---|
74 | void elementEnd(const String& element);
|
---|
75 |
|
---|
76 | private:
|
---|
77 | /*************************************************************************
|
---|
78 | Implementation Constants
|
---|
79 | *************************************************************************/
|
---|
80 | // element names
|
---|
81 | static const String FalagardElement; //!< Tag name for root Falagard elements.
|
---|
82 | static const String WidgetLookElement; //!< Tag name for WidgetLook elements.
|
---|
83 | static const String ChildElement; //!< Tag name for Child elements.
|
---|
84 | static const String ImagerySectionElement; //!< Tag name for ImagerySection elements.
|
---|
85 | static const String StateImageryElement; //!< Tag name for StateImagery elements.
|
---|
86 | static const String LayerElement; //!< Tag name for Layer elements.
|
---|
87 | static const String SectionElement; //!< Tag name for Section elements.
|
---|
88 | static const String ImageryComponentElement; //!< Tag name for ImageryComponent elements.
|
---|
89 | static const String TextComponentElement; //!< Tag name for TextComponent elements.
|
---|
90 | static const String FrameComponentElement; //!< Tag name for FrameComponent elements.
|
---|
91 | static const String AreaElement; //!< Tag name for Area elements.
|
---|
92 | static const String ImageElement; //!< Tag name for Image elements.
|
---|
93 | static const String ColoursElement; //!< Tag name for Colours elements.
|
---|
94 | static const String VertFormatElement; //!< Tag name for VertFormat elements.
|
---|
95 | static const String HorzFormatElement; //!< Tag name for HorzFormat elements.
|
---|
96 | static const String VertAlignmentElement; //!< Tag name for VertAlignment elements.
|
---|
97 | static const String HorzAlignmentElement; //!< Tag name for HorzAlignment elements.
|
---|
98 | static const String PropertyElement; //!< Tag name for Property elements.
|
---|
99 | static const String DimElement; //!< Tag name for dimension container elements.
|
---|
100 | static const String UnifiedDimElement; //!< Tag name for unified dimension elements.
|
---|
101 | static const String AbsoluteDimElement; //!< Tag name for absolute dimension elements.
|
---|
102 | static const String ImageDimElement; //!< Tag name for image dimension elements.
|
---|
103 | static const String WidgetDimElement; //!< Tag name for widget dimension elements.
|
---|
104 | static const String FontDimElement; //!< Tag name for font dimension elements.
|
---|
105 | static const String PropertyDimElement; //!< Tag name for property dimension elements.
|
---|
106 | static const String TextElement; //!< Tag name for text component text elements
|
---|
107 | static const String ColourPropertyElement; //!< Tag name for property colour elements (fetches cols from a colour property)
|
---|
108 | static const String ColourRectPropertyElement; //!< Tag name for property colour elements (fetches cols from a ColourRect property)
|
---|
109 | static const String NamedAreaElement; //!< Tag name for named area elements.
|
---|
110 | static const String PropertyDefinitionElement; //!< Tag name for property definition elements.
|
---|
111 | static const String DimOperatorElement; //!< Tag name for dimension operator elements.
|
---|
112 | static const String VertFormatPropertyElement; //!< Tag name for element that specifies a vertical formatting property.
|
---|
113 | static const String HorzFormatPropertyElement; //!< Tag name for element that specifies a horizontal formatting property..
|
---|
114 | static const String AreaPropertyElement; //!< Tag name for element that specifies a URect property..
|
---|
115 | static const String ImagePropertyElement; //!< Tag name for element that specifies an Image property..
|
---|
116 | // attribute names
|
---|
117 | static const String TopLeftAttribute; //!< Attribute name that stores colour for top-left corner.
|
---|
118 | static const String TopRightAttribute; //!< Attribute name that stores colour for top-right corner.
|
---|
119 | static const String BottomLeftAttribute; //!< Attribute name that stores colour for bottom-left corner.
|
---|
120 | static const String BottomRightAttribute; //!< Attribute name that stores colour for bottom-right corner.
|
---|
121 | static const String ImagesetAttribute; //!< Attribute name that stores name of an imageset.
|
---|
122 | static const String ImageAttribute; //!< Attribute name that stores name of an image.
|
---|
123 | static const String TypeAttribute; //!< Attribute name that stores a type string.
|
---|
124 | static const String NameAttribute; //!< Attribute name that stores name string
|
---|
125 | static const String PriorityAttribute; //!< Attribute name that stores an integer priority.
|
---|
126 | static const String SectionNameAttribute; //!< Attribute name that stores an imagery section name.
|
---|
127 | static const String NameSuffixAttribute; //!< Attribute name that stores a widget name suffix.
|
---|
128 | static const String LookAttribute; //!< Attribute name that stores the name of a widget look.
|
---|
129 | static const String ScaleAttribute; //!< Attribute name that stores a UDim scale value.
|
---|
130 | static const String OffsetAttribute; //!< Attribute name that stores a UDim offset value.
|
---|
131 | static const String ValueAttribute; //!< Attribute name that stores a property value string.
|
---|
132 | static const String DimensionAttribute; //!< Attribute name that stores a dimension type.
|
---|
133 | static const String WidgetAttribute; //!< Attribute name that stores the name of a widget (suffix).
|
---|
134 | static const String StringAttribute; //!< Attribute name that stores a string of text.
|
---|
135 | static const String FontAttribute; //!< Attribute name that stores the name of a font.
|
---|
136 | static const String InitialValueAttribute; //!< Attribute name that stores the initial default value for a property definition.
|
---|
137 | static const String ClippedAttribute; //!< Attribute name that stores whether some component will be clipped.
|
---|
138 | static const String OperatorAttribute; //!< Attribute name that stores the name of an operator.
|
---|
139 | static const String PaddingAttribute; //!< Attribute name that stores some padding value..
|
---|
140 | static const String LayoutOnWriteAttribute; //!< Attribute name that stores whether to layout on write of a property.
|
---|
141 | static const String RedrawOnWriteAttribute; //!< Attribute name that stores whether to redraw on write of a property.
|
---|
142 |
|
---|
143 | /*************************************************************************
|
---|
144 | helper methods
|
---|
145 | **************************************************************************/
|
---|
146 | static argb_t hexStringToARGB(const String& str);
|
---|
147 |
|
---|
148 | /*************************************************************************
|
---|
149 | implementation methods
|
---|
150 | **************************************************************************/
|
---|
151 | void assignAreaDimension(Dimension& dim);
|
---|
152 |
|
---|
153 | void doBaseDimStart(const BaseDim* dim);
|
---|
154 | void doBaseDimEnd();
|
---|
155 |
|
---|
156 | /*************************************************************************
|
---|
157 | Implementation Data
|
---|
158 | *************************************************************************/
|
---|
159 | WidgetLookManager* d_manager;
|
---|
160 |
|
---|
161 | // these hold pointers to various objects under construction.
|
---|
162 | WidgetLookFeel* d_widgetlook;
|
---|
163 | WidgetComponent* d_childcomponent;
|
---|
164 | ImagerySection* d_imagerysection;
|
---|
165 | StateImagery* d_stateimagery;
|
---|
166 | LayerSpecification* d_layer;
|
---|
167 | SectionSpecification* d_section;
|
---|
168 | ImageryComponent* d_imagerycomponent;
|
---|
169 | ComponentArea* d_area;
|
---|
170 | Dimension d_dimension;
|
---|
171 | TextComponent* d_textcomponent;
|
---|
172 | NamedArea* d_namedArea;
|
---|
173 | FrameComponent* d_framecomponent;
|
---|
174 |
|
---|
175 | std::vector<BaseDim*> d_dimStack;
|
---|
176 | };
|
---|
177 |
|
---|
178 | } // End of CEGUI namespace section
|
---|
179 |
|
---|
180 |
|
---|
181 | #endif // end of guard _CEGUIFalagard_xmlHandler_h_
|
---|