29#ifndef _CEGUIPropertyHelper_h_
30#define _CEGUIPropertyHelper_h_
32#include "CEGUI/String.h"
33#include "CEGUI/Size.h"
34#include "CEGUI/Vector.h"
35#include "CEGUI/Quaternion.h"
36#include "CEGUI/Colour.h"
37#include "CEGUI/ColourRect.h"
38#include "CEGUI/UDim.h"
39#include "CEGUI/Rect.h"
48# pragma warning(disable : 4996)
52 #define snprintf _snprintf
57 #if __USE_MINGW_ANSI_STDIO != 1
58 #warning __USE_MINGW_ANSI_STDIO must be set to 1 for sscanf and snprintf to work with 64bit integers
61 #pragma GCC diagnostic push
65 #pragma GCC diagnostic ignored "-Wformat"
66 #pragma GCC diagnostic ignored "-Wformat-extra-args"
96 static inline const String& getDataTypeName()
101 static inline return_type fromString(
const String&
str)
106 static inline String toString(pass_type
val)
122 static inline const String& getDataTypeName()
127 static inline return_type fromString(
const String&
str)
132 static inline String toString(pass_type
val)
148 static inline const String& getDataTypeName()
153 static inline return_type fromString(
const String&
str)
158 static inline String toString(pass_type
val)
173 static const String& getDataTypeName()
175 static String type(
"String");
200 static const String& getDataTypeName()
202 static String type(
"float");
232 static const String& getDataTypeName()
234 static String type(
"double");
265 static const String& getDataTypeName()
267 static String type(
"int");
298 static const String& getDataTypeName()
300 static String type(
"uint");
331 static const String& getDataTypeName()
333 static String type(
"uint64");
355#if CEGUI_STRING_CLASS != CEGUI_STRING_CLASS_UNICODE
362 typedef return_type safe_method_return_type;
364 typedef String string_return_type;
366 static const String& getDataTypeName()
368 static String type(
"char");
373 static return_type fromString(
const String& str)
378 static string_return_type toString(pass_type val)
380 return String(
"") + val;
395 static const String& getDataTypeName()
397 static String type(
"unsigned long");
404 unsigned long val = 0;
428 static const String& getDataTypeName()
430 static String type(
"bool");
437 return (
str == True ||
str ==
"True");
442 return val ? True : False;
461 static const String& getDataTypeName()
463 static String type(
"AspectMode");
474 else if (
str == Expand)
500 assert(
false &&
"Invalid aspect mode");
520 static const String& getDataTypeName()
522 static String type(
"Sizef");
553 static const String& getDataTypeName()
555 static String type(
"Vector2f");
586 static const String& getDataTypeName()
588 static String type(
"Vector3f");
619 static const String& getDataTypeName()
621 static String type(
"Quaternion");
638 sscanf(
str.c_str(),
" x:%g y:%g z:%g", &x, &y, &z);
661 static const String& getDataTypeName()
663 static String type(
"Rectf");
671 sscanf(
str.c_str(),
" l:%g t:%g r:%g b:%g", &
val.d_min.d_x, &
val.d_min.d_y, &
val.d_max.d_x, &
val.d_max.d_y);
680 val.d_min.d_x,
val.d_min.d_y,
val.d_max.d_x,
val.d_max.d_y);
695 static const String& getDataTypeName()
697 static String type(
"Image");
716 static const String& getDataTypeName()
718 static String type(
"Colour");
749 static const String& getDataTypeName()
751 static String type(
"ColourRect");
758 if (
str.length() == 8)
774 sprintf(
buff,
"tl:%.8X tr:%.8X bl:%.8X br:%.8X",
val.d_top_left.getARGB(),
val.d_top_right.getARGB(),
val.d_bottom_left.getARGB(),
val.d_bottom_right.getARGB());
789 static const String& getDataTypeName()
791 static String type(
"UDim");
799 sscanf(
str.c_str(),
" { %g , %g }", &
ud.d_scale, &
ud.d_offset);
822 static const String& getDataTypeName()
824 static String type(
"UVector2");
832 sscanf(
str.c_str(),
" { { %g , %g } , { %g , %g } }",
833 &
uv.d_x.d_scale, &
uv.d_x.d_offset,
834 &
uv.d_y.d_scale, &
uv.d_y.d_offset);
843 val.d_x.d_scale,
val.d_x.d_offset,
val.d_y.d_scale,
val.d_y.d_offset);
858 static const String& getDataTypeName()
860 static String type(
"USize");
868 sscanf(
str.c_str(),
" { { %g , %g } , { %g , %g } }",
869 &
uv.d_width.d_scale, &
uv.d_width.d_offset,
870 &
uv.d_height.d_scale, &
uv.d_height.d_offset);
879 val.d_width.d_scale,
val.d_width.d_offset,
val.d_height.d_scale,
val.d_height.d_offset);
894 static const String& getDataTypeName()
896 static String type(
"URect");
906 " { { %g , %g } , { %g , %g } , { %g , %g } , { %g , %g } }",
907 &
ur.d_min.d_x.d_scale, &
ur.d_min.d_x.d_offset,
908 &
ur.d_min.d_y.d_scale, &
ur.d_min.d_y.d_offset,
909 &
ur.d_max.d_x.d_scale, &
ur.d_max.d_x.d_offset,
910 &
ur.d_max.d_y.d_scale, &
ur.d_max.d_y.d_offset
919 snprintf(
buff,
sizeof(
buff),
"{{%g,%g},{%g,%g},{%g,%g},{%g,%g}}",
920 val.d_min.d_x.d_scale,
val.d_min.d_x.d_offset,
921 val.d_min.d_y.d_scale,
val.d_min.d_y.d_offset,
922 val.d_max.d_x.d_scale,
val.d_max.d_x.d_offset,
923 val.d_max.d_y.d_scale,
val.d_max.d_y.d_offset);
938 static const String& getDataTypeName()
940 static String type(
"UBox");
950 " { top: { %g , %g } , left: { %g , %g } , bottom: { %g , %g } , right: { %g , %g } }",
951 &
ret.d_top.d_scale, &
ret.d_top.d_offset,
952 &
ret.d_left.d_scale, &
ret.d_left.d_offset,
953 &
ret.d_bottom.d_scale, &
ret.d_bottom.d_offset,
954 &
ret.d_right.d_scale, &
ret.d_right.d_offset
963 snprintf(
buff,
sizeof(
buff),
"{top:{%g,%g},left:{%g,%g},bottom:{%g,%g},right:{%g,%g}}",
964 val.d_top.d_scale,
val.d_top.d_offset,
965 val.d_left.d_scale,
val.d_left.d_offset,
966 val.d_bottom.d_scale,
val.d_bottom.d_offset,
967 val.d_right.d_scale,
val.d_right.d_offset);
983 static const String& getDataTypeName()
985 static String type(
"Font");
997 #pragma GCC diagnostic pop
1000#if defined(_MSC_VER)
1001 #pragma warning(pop)
Class that holds details of colours for the four corners of a rectangle.
Definition ColourRect.h:45
Class representing colour values within the system.
Definition Colour.h:46
Class that encapsulates a typeface.
Definition Font.h:62
Interface for Image.
Definition Image.h:161
static const CEGUI::String Shrink
Definitions of the possible values represented as Strings.
Definition PropertyHelper.h:506
static const CEGUI::String True
Definitions of the possible values represented as Strings.
Definition PropertyHelper.h:446
Helper class used to convert various data types to and from the format expected in Property strings.
Definition ForwardRefs.h:84
Class to represent rotation, avoids Gimbal lock.
Definition Quaternion.h:69
static Quaternion eulerAnglesDegrees(float x, float y, float z)
constructs a quaternion from euler angles in degrees
String class used within the GUI system.
Definition String.h:64
base class for properties able to do native set/get
Definition TypedProperty.h:50
Class encapsulating the 'Unified Box' - this is usually used for margin.
Definition UDim.h:251
Dimension that has both a relative 'scale' portion and and absolute 'offset' portion.
Definition UDim.h:94
Main namespace for Crazy Eddie's GUI Library.
Definition arch_overview.dox:1
AspectMode
How aspect ratio should be maintained.
Definition Size.h:46
@ AM_SHRINK
Definition Size.h:53
@ AM_EXPAND
Definition Size.h:58
@ AM_IGNORE
Ignores the target aspect (default)
Definition Size.h:48