This file is indexed.

/usr/include/cegui-0.8.7/CEGUI/falagard/Dimensions.h is in libcegui-mk2-dev 0.8.7-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
/***********************************************************************
    created:    Mon Jun 13 2005
    author:     Paul D Turner <paul@cegui.org.uk>
*************************************************************************/
/***************************************************************************
 *   Copyright (C) 2004 - 2012 Paul D Turner & The CEGUI Development Team
 *
 *   Permission is hereby granted, free of charge, to any person obtaining
 *   a copy of this software and associated documentation files (the
 *   "Software"), to deal in the Software without restriction, including
 *   without limitation the rights to use, copy, modify, merge, publish,
 *   distribute, sublicense, and/or sell copies of the Software, and to
 *   permit persons to whom the Software is furnished to do so, subject to
 *   the following conditions:
 *
 *   The above copyright notice and this permission notice shall be
 *   included in all copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *   OTHER DEALINGS IN THE SOFTWARE.
 ***************************************************************************/
#ifndef _CEGUIFalDimensions_h_
#define _CEGUIFalDimensions_h_

#include "./Enums.h"
#include "../String.h"
#include "../UDim.h"
#include "../Rect.h"
#include "../XMLSerializer.h"

// Start of CEGUI namespace section
namespace CEGUI
{
//! Abstract interface for a generic 'dimension' class.
class CEGUIEXPORT BaseDim :
    public AllocatedObject<BaseDim>
{
public:
    BaseDim();

    virtual ~BaseDim();

    /*!
    \brief
        Return a value that represents this dimension as absolute pixels.

    \param wnd
        Window object that may be used by the specialised class to aid in
        calculating the final value.

    \return
        float value which represents, in pixels, the same value as this BaseDim.
    */
    virtual float getValue(const Window& wnd) const = 0;

    /*!
    \brief
        Return a value that represents this dimension as absolute pixels.

    \param wnd
        Window object that may be used by the specialised class to aid in
        calculating the final value (typically would be used to obtain
        window/widget dimensions).

    \param container
        Rect object which describes an area to be considered as the base area
        when calculating the final value.  Basically this means that relative
        values are calculated from the dimensions of this Rect.

    \return
        float value which represents, in pixels, the same value as this BaseDim.
    */
    virtual float getValue(const Window& wnd, const Rectf& container) const = 0;

    /*!
    \brief
        Create an exact copy of the specialised object and return it as a
        pointer to a BaseDim object.

        Since the system needs to be able to copy objects derived from BaseDim,
        but only has knowledge of the BaseDim interface, this clone method is
        provided to prevent slicing issues.
    */
    virtual BaseDim* clone() const = 0;

    /*!
    \brief
        Writes an xml representation of this BaseDim to \a out_stream.

    \param xml_stream
        Stream where xml data should be output.
    */
    virtual void writeXMLToStream(XMLSerializer& xml_stream) const;

    //! perform any processing required due to the given font having changed.
    virtual bool handleFontRenderSizeChange(Window& window,
                                            const Font* font) const;
protected:
    //! Implementataion method to output real xml element name.
    virtual void writeXMLElementName_impl(XMLSerializer& xml_stream) const = 0;

    //! Implementataion method to create the element attributes
    virtual void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const = 0;
};

/*!
\brief
    Dimension type that represents the result of an operation performed on
    two other dimension values. Implements BaseDim interface.
*/
class CEGUIEXPORT OperatorDim : public BaseDim
{
public:
    OperatorDim();
    OperatorDim(DimensionOperator op);
    OperatorDim(DimensionOperator op, BaseDim* left, BaseDim* right);
    ~OperatorDim();

    //! set the left hand side operand (passed object is cloned)
    void setLeftOperand(const BaseDim* operand);

    //! return pointer to the left hand side operand
    BaseDim* getLeftOperand() const;

    //! set the right hand side operand (passed object is cloned)
    void setRightOperand(const BaseDim* operand);

    //! return pointer to the right hand side operand
    BaseDim* getRightOperand() const;

    //! Set the operation to be performed
    void setOperator(DimensionOperator op);

    //! Get the current operation that will be performed
    DimensionOperator getOperator() const;

    //! helper to set the next free operand, will throw after 2 are set
    void setNextOperand(const BaseDim* operand);

    // Implementation of the base class interface
    float getValue(const Window& wnd) const;
    float getValue(const Window& wnd, const Rectf& container) const;
    BaseDim* clone() const;

protected:
    float getValueImpl(const float lval, const float rval) const;
    // Implementation of the base class interface
    void writeXMLToStream(XMLSerializer& xml_stream) const;
    void writeXMLElementName_impl(XMLSerializer& xml_stream) const;
    void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const;

    BaseDim* d_left;
    BaseDim* d_right;
    DimensionOperator d_op;
};

/*!
\brief
    Dimension type that represents an absolute pixel value.
    Implements BaseDim interface.
*/
class CEGUIEXPORT AbsoluteDim : public BaseDim
{
public:
    AbsoluteDim() {};
    AbsoluteDim(float val);

    //! Get the current value of the AbsoluteDim.
    float getBaseValue() const;

    //! Set the current value of the AbsoluteDim.
    void setBaseValue(float val);

    // Implementation of the base class interface
    float getValue(const Window& wnd) const;
    float getValue(const Window& wnd, const Rectf& container) const;
    BaseDim* clone() const;

protected:
    // Implementation of the base class interface
    void writeXMLElementName_impl(XMLSerializer& xml_stream) const;
    void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const;

private:
    //! holds pixel value for the AbsoluteDim.
    float d_val;
};

/*!
\brief
    Dimension type that represents some dimension of an Image.
    Implements BaseDim interface.
*/
class CEGUIEXPORT ImageDimBase : public BaseDim
{
public:
    ImageDimBase() {};

    /*!
    \brief
        Constructor.

    \param dim
        DimensionType value indicating which dimension of an Image that
        this ImageDim is to represent.
    */
    ImageDimBase(DimensionType dim);

    /*!
    \brief
        Gets the source dimension type for this WidgetDim.

    \return
        DimensionType value indicating which dimension of the described
        image that this WidgetDim is to represent.
    */
    DimensionType getSourceDimension() const;

    /*!
    \brief
        Sets the source dimension type for this ImageDim.

    \param dim
        DimensionType value indicating which dimension of the described
        image that this ImageDim is to represent.
    */
    void setSourceDimension(DimensionType dim);

    // Implementation of the base class interface
    float getValue(const Window& wnd) const;
    float getValue(const Window& wnd, const Rectf& container) const;

protected:
    //! return the image instance to access
    virtual const Image* getSourceImage(const Window& wnd) const = 0;

    // Implementation of the base class interface
    void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const;

    //! the dimension of the image that we are to represent.
    DimensionType d_what;
};

//! ImageDimBase subclass that accesses an image by its name.
class CEGUIEXPORT ImageDim : public ImageDimBase
{
public:
    ImageDim() {};
    ImageDim(const String& image_name, DimensionType dim);

    //! return the name of the image accessed by this ImageDim.
    const String& getSourceImage() const;
    //! set the name of the image accessed by this ImageDim.
    void setSourceImage(const String& image_name);

    // Implementation of the base class interface
    BaseDim* clone() const;

protected:
    // Implementation / overrides of functions in superclasses
    const Image* getSourceImage(const Window& wnd) const;
    void writeXMLElementName_impl(XMLSerializer& xml_stream) const;
    void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const;

    //! name of the Image.
    String d_imageName;
};

//! ImageDimBase subclass that accesses an image fetched via a property.
class CEGUIEXPORT ImagePropertyDim : public ImageDimBase
{
public:
    ImagePropertyDim() {};

    /*!
    \brief
        Constructor.

    \param property_name
        String holding the name of the property on the target that will be
        accessed to retrieve the name of the image to be accessed by the
        ImageDim.

    \param dim
        DimensionType value indicating which dimension of an Image that
        this ImageDim is to represent.
    */
    ImagePropertyDim(const String& property_name, DimensionType dim);

    //! return the name of the property accessed by this ImagePropertyDim.
    const String& getSourceProperty() const;
    //! set the name of the property accessed by this ImagePropertyDim.
    void setSourceProperty(const String& property_name);

    // Implementation of the base class interface
    BaseDim* clone() const;

protected:
    // Implementation / overrides of functions in superclasses
    const Image* getSourceImage(const Window& wnd) const;
    void writeXMLElementName_impl(XMLSerializer& xml_stream) const;
    void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const;

    //! name of the property from which to fetch the image name.
    String d_propertyName;
};

/*!
\brief
    Dimension type that represents some dimension of a Window/widget.
    Implements BaseDim interface.

    When calculating the final pixel value for the dimension, a target widget
    name is built by appending the name specified in the WidgetDim to the name
    path of the window passed to getValue, we then use the window/widget with
    that name to obtain the value for the dimension.
*/
class CEGUIEXPORT WidgetDim : public BaseDim
{
public:
    WidgetDim() {};
    /*!
    \brief
        Constructor.

    \param name
        String object holding the name suffix for a window/widget.

    \param dim
        DimensionType value indicating which dimension of the described image that this ImageDim
        is to represent.
    */
    WidgetDim(const String& name, DimensionType dim);

    /*!
    \brief
        Get the name suffix to use for this WidgetDim.

    \return
        String object holding the name suffix for a window/widget.
    */
    const String& getWidgetName() const;

    /*!
    \brief
        Set the name suffix to use for this WidgetDim.

    \param name
        String object holding the name suffix for a window/widget.

    \return
        Nothing.
    */
    void setWidgetName(const String& name);

    /*!
    \brief
        Gets the source dimension type for this WidgetDim.

    \return
        DimensionType value indicating which dimension of the described image
        that this WidgetDim is to represent.
    */
    DimensionType getSourceDimension() const;

    /*!
    \brief
        Sets the source dimension type for this WidgetDim.

    \param dim
        DimensionType value indicating which dimension of the described image
        that this WidgetDim is to represent.
    */
    void setSourceDimension(DimensionType dim);

    // Implementation of the base class interface
    float getValue(const Window& wnd) const;
    float getValue(const Window& wnd, const Rectf& container) const;
    BaseDim* clone() const;

protected:
    // Implementation of the base class interface
    void writeXMLElementName_impl(XMLSerializer& xml_stream) const;
    void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const;

private:
    //! Holds target window name suffix.
    String d_widgetName;
    //! the dimension of the target window that we are to represent.
    DimensionType d_what;
};

/*!
\brief
    Dimension type that represents an Unified dimension.
    Implements BaseDim interface.
*/
class CEGUIEXPORT UnifiedDim : public BaseDim
{
public:
    UnifiedDim(){};
    /*!
    \brief
        Constructor.

    \param value
        UDim holding the value to assign to this UnifiedDim.

    \param dim
        DimensionType value indicating what this UnifiedDim is to represent.  This is required
        because we need to know what part of the base Window that the UDim scale component is
        to operate against.
    */
    UnifiedDim(const UDim& value, DimensionType dim);

    //! Get the current value of the UnifiedDim.
    const UDim& getBaseValue() const;

    //! Set the current value of the UnifiedDim.
    void setBaseValue(const UDim& val);

    /*!
    \brief
        Gets the source dimension type for this WidgetDim.

    \return
        DimensionType value indicating which dimension should be used as the
        scale reference / base value when calculating the pixel value of this
        dimension.
    */
    DimensionType getSourceDimension() const;

    /*!
    \brief
        Sets the source dimension type for this WidgetDim.

    \param dim
        DimensionType value indicating which dimension should be used as the
        scale reference / base value when calculating the pixel value of this
        dimension.
    */
    void setSourceDimension(DimensionType dim);

    // Implementation of the base class interface
    float getValue(const Window& wnd) const;
    float getValue(const Window& wnd, const Rectf& container) const;
    BaseDim* clone() const;

protected:
    // Implementation of the base class interface
    void writeXMLElementName_impl(XMLSerializer& xml_stream) const;
    void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const;

private:
    //! The UDim value.
    UDim d_value;
    //! what to use as the base / reference for scale.
    DimensionType d_what;
};

/*!
\brief
    Dimension type that represents some metric of a Font.
    Implements BaseDim interface.
*/
class CEGUIEXPORT FontDim : public BaseDim
{
public:
    FontDim() {};
    /*!
    \brief
        Constructor.

    \param name
        String holding the name suffix of the window to be accessed to obtain
        the font and / or text strings to be used when these items are not
        explicitly given.

    \param font
        String holding the name of the font to use for this dimension.  If the
        string is empty, the font assigned to the window passed to getValue will
        be used.

    \param text
        String holding the text to be measured for horizontal extent. If this
        is empty, the text from the window passed to getValue will be used.

    \param metric
        One of the FontMetricType values indicating what we should represent.

    \param padding
        constant pixel padding value to be added.
    */
    FontDim(const String& name, const String& font, const String& text,
            FontMetricType metric, float padding = 0);

    //! Get the current name of the FontDim.
    const String& getName() const;

    //! Set the current name of the FontDim.
    void setName(const String& name);

    //! Get the current font of the FontDim.
    const String& getFont() const;

    //! Set the current font of the FontDim.
    void setFont(const String& font);

    //! Get the current text of the FontDim.
    const String& getText() const;

    //! Set the current text of the FontDim.
    void setText(const String& text);

    //! Get the current metric of the FontDim.
    FontMetricType getMetric() const;

    //! Set the current metric of the FontDim.
    void setMetric(FontMetricType metric);

    //! Get the current padding of the FontDim.
    float getPadding() const;

    //! Set the current padding of the FontDim.
    void setPadding(float padding);

    // overridden from BaseDim.
    bool handleFontRenderSizeChange(Window& window,
                                    const Font* font) const;

    // Implementation of the base class interface
    float getValue(const Window& wnd) const;
    float getValue(const Window& wnd, const Rectf& container) const;
    BaseDim* clone() const;

protected:
    // Implementation of the base class interface
    void writeXMLElementName_impl(XMLSerializer& xml_stream) const;
    void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const;

    const Font* getFontObject(const Window& window) const;

private:
    //! Name of Font.  If empty font will be taken from Window.
    String d_font;
    //! String to measure for extents, if empty will use window text.
    String d_text;
    //! String to hold the name of the window to use for fetching missing font and/or text.
    String d_childName;
    //! what metric we represent.
    FontMetricType d_metric;
    //! padding value to be added.
    float d_padding;
};

/*!
\brief
    Dimension type that represents the value of a Window property.
    Implements BaseDim interface.
*/
class CEGUIEXPORT PropertyDim : public BaseDim
{
public:
    PropertyDim() {};
    /*!
    \brief
        Constructor.

    \param name
        String holding the name suffix of the window on which the property
        is to be accessed.

    \param property
        String object holding the name of the property this PropertyDim
        represents the value of.  The property named should represent either
        a UDim value or a simple float value - dependning upon what \a type
        is specified as.

    \param type
        DimensionType value indicating what dimension named property
        represents.  The possible DimensionType values are as follows:
        - DT_INVALID the property should represent a simple float value.
        - DT_WIDTH the property should represent a UDim value where the
        scale is relative to the targetted Window's width.
        - DT_HEIGHT the property should represent a UDim value where the
        scale is relative to the targetted Window's height.
        - All other values will cause an InvalidRequestException exception
        to be thrown.
    */
    PropertyDim(const String& name, const String& property, DimensionType type);
    /*!
    \brief
        Get the name suffix to use for this WidgetDim.

    \return
        String object holding the name suffix for a window/widget.
    */
    const String& getWidgetName() const;

    /*!
    \brief
        Set the name suffix to use for this WidgetDim.

    \param name
        String object holding the name suffix for a window/widget.

    \return
        Nothing.
    */
    void setWidgetName(const String& name);

    /*!
    \brief
        Get the name of the property to use for this WidgetDim.

    \return
        String object holding the name of the property.
    */
    const String& getPropertyName() const;

    /*!
    \brief
        Set the name of the property to use for this WidgetDim.

    \param property
        String object holding the name of the property.

    \return
        Nothing.
    */
    void setPropertyName(const String& property);

    /*!
    \brief
        Gets the source dimension type for this WidgetDim.

    \return
        DimensionType value indicating which dimension of the target window to
        use as the reference / base value when accessing a property that
        represents a unified dimension:
            - DT_INVALID if the property does not represent a unified dim.
            - DT_WIDTH to use target width as reference value.
            - DT_HEIGHT to use target hight as reference value.
    */
    DimensionType getSourceDimension() const;

    /*!
    \brief
        Sets the source dimension type for this WidgetDim.

    \param dim
        DimensionType value indicating which dimension of the target window to
        use as the reference / base value when accessing a property that
        represents a unified dimension:
            - DT_INVALID if the property does not represent a unified dim.
            - DT_WIDTH to use target width as reference value.
            - DT_HEIGHT to use target hight as reference value.
    */
    void setSourceDimension(DimensionType dim);

    // Implementation of the base class interface
    float getValue(const Window& wnd) const;
    float getValue(const Window& wnd, const Rectf& container) const;
    BaseDim* clone() const;

protected:
    // Implementation of the base class interface
    void writeXMLElementName_impl(XMLSerializer& xml_stream) const;
    void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const;

private:
    //! Propery that this object represents.
    String d_property;
    //! String to hold the name of the child to access the property form.
    String d_childName;
    //! String to hold the type of dimension
    DimensionType d_type;
};

/*!
\brief
    Class representing some kind of dimension.

    The key thing to understand about Dimension is that it contains not just a
    dimensional value, but also a record of what the dimension value is supposed
    to represent. (e.g. a co-ordinate on the x axis, or the height of something).
*/
class CEGUIEXPORT Dimension :
    public AllocatedObject<Dimension>
{
public:
    Dimension();
    ~Dimension();
    Dimension(const Dimension& other);
    Dimension& operator=(const Dimension& other);

    /*!
    \brief
        Constructor

    \param dim
        object based on subclass of BaseDim which holds the dimensional value.

    \param type
        DimensionType value indicating what dimension this object is to represent.
    */
    Dimension(const BaseDim& dim, DimensionType type);

    /*!
    \brief
        return the BaseDim object currently used as the value for this Dimension.

    \return
        const reference to the BaseDim sub-class object which contains the value
        for this Dimension.
    */
    const BaseDim& getBaseDimension() const;

    /*!
    \brief
        set the current value for this Dimension.

    \param dim
        object based on a subclass of BaseDim which holds the dimensional value.
    */
    void setBaseDimension(const BaseDim& dim);

    /*!
    \brief
        Return a DimensionType value indicating what this Dimension represents.

    \return
        one of the DimensionType enumerated values.
    */
    DimensionType getDimensionType() const;

    /*!
    \brief
        Sets what this Dimension represents.

    \param type
        one of the DimensionType enumerated values.
    */
    void setDimensionType(DimensionType type);

    /*!
    \brief
        Writes an xml representation of this Dimension to \a out_stream.

    \param xml_stream
        Stream where xml data should be output.
    */
    void writeXMLToStream(XMLSerializer& xml_stream) const;

    //! perform any processing required due to the given font having changed.
    bool handleFontRenderSizeChange(Window& window,
                                    const Font* font) const;

private:
    //! Pointer to the value for this Dimension.
    BaseDim* d_value;
    //! What we represent.
    DimensionType d_type;
};

/*!
\brief
    Class that represents a target area for a widget or imagery component.

    This is essentially a Rect built out of Dimension objects.  Of note is that
    what would normally be the 'right' and 'bottom' edges may alternatively
    represent width and height depending upon what the assigned Dimension(s)
    represent.
*/
class CEGUIEXPORT ComponentArea :
    public AllocatedObject<ComponentArea>
{
public:
    ComponentArea();

    /*!
    \brief
        Return a Rect describing the absolute pixel area represented by this
        ComponentArea.

    \param wnd
        Window object to be used when calculating final pixel area.

    \return
        Rectf object describing the pixels area represented by this ComponentArea
        when using \a wnd as a reference for calculating the final pixel
        dimensions.
    */
    Rectf getPixelRect(const Window& wnd) const;

    /*!
    \brief
        Return a Rectd describing the absolute pixel area represented by this
        ComponentArea.

    \param wnd
        Window object to be used when calculating final pixel area.

    \param container
        Rect object to be used as a base or container when converting relative
        dimensions.

    \return
        Rectf object describing the pixels area represented by this
        ComponentArea when using \a wnd and \a container as a reference for
        calculating the final pixel dimensions.
    */
    Rectf getPixelRect(const Window& wnd, const Rectf& container) const;

    /*!
    \brief
        Writes an xml representation of this ComponentArea to \a out_stream.

    \param xml_stream
        XMLSerializer where xml data should be output.
    */
    void writeXMLToStream(XMLSerializer& xml_stream) const;

    /*!
    \brief
        Return whether this ComponentArea fetches it's area via a property on
        the target window.

    \return
        - true if the area comes via a Propery.
        - false if the area is not sourced from a Property.
    */
    bool isAreaFetchedFromProperty() const;

    /*!
    \brief
        Return the name of the property that will be used to determine the pixel
        area for this ComponentArea.

    \return
        String object holding the name of a Propery.
    */
    const String& getAreaPropertySource() const;

    /*!
    \brief
        Set the name of the property that will be used to determine the pixel
        area for this ComponentArea.

    \note
        Calling this will replace any existing souce, such as a named area.

    \param property
        String object holding the name of a Propery.  The property should access
        a URect type property.
    */
    void setAreaPropertySource(const String& property);

    /*!
    \brief
        Return the name of the look to which the NamedArea, which is defined as source, belongs to.

    \return
        A string containing the name of the look.
    */
    const String& getNamedAreaSourceLook() const;

    //! Set the named area source of the ComponentArea.
    void setNamedAreaSouce(const String& widget_look, const String& area_name);

    /*!
    \brief
        Return whether this ComponentArea fetches it's area via a named area
        defined.

    \return
        - true if the area comes via a named area defined in a WidgetLook.
        - false if the area is not sourced from a named area.
    */
    bool isAreaFetchedFromNamedArea() const;

    //! perform any processing required due to the given font having changed.
    bool handleFontRenderSizeChange(Window& window, const Font* font) const;

    //! Left edge of the area.
    Dimension d_left;
    //! Top edge of the area.
    Dimension d_top;
    //! Either the right edge or the width of the area.
    Dimension d_right_or_width;
    //! Either the bototm edge or the height of the area.
    Dimension d_bottom_or_height;

private:
    //! name of property or named area: must access a URect style value.
    String d_namedSource;
    //! name of widget look holding the named area to fetch
    String d_namedAreaSourceLook;
};

} // End of  CEGUI namespace section


#endif  // end of guard _CEGUIFalDimensions_h_