/usr/include/cegui-0.8.7/CEGUI/falagard/XMLEnumHelper.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 | /***********************************************************************
created: Mon Jul 18 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 _CEGUIFalXMLEnumHelper_h_
#define _CEGUIFalXMLEnumHelper_h_
#include "../String.h"
#include "../Window.h"
#include "CEGUI/falagard/Enums.h"
namespace CEGUI
{
template<typename T>
class FalagardXMLHelper;
template<>
class CEGUIEXPORT FalagardXMLHelper<VerticalFormatting>
{
public:
typedef VerticalFormatting return_type;
typedef VerticalFormatting pass_type;
static String toString(pass_type val)
{
switch (val)
{
case VF_BOTTOM_ALIGNED:
return BottomAligned;
case VF_CENTRE_ALIGNED:
return CentreAligned;
case VF_TILED:
return Tiled;
case VF_STRETCHED:
return Stretched;
default:
return TopAligned;
}
}
static return_type fromString(const String& str)
{
if (str == CentreAligned)
return VF_CENTRE_ALIGNED;
else if (str == BottomAligned)
return VF_BOTTOM_ALIGNED;
else if (str == Tiled)
return VF_TILED;
else if (str == Stretched)
return VF_STRETCHED;
else
return VF_TOP_ALIGNED;
}
//! Definitions of the possible values represented as Strings
static const CEGUI::String TopAligned;
static const CEGUI::String CentreAligned;
static const CEGUI::String BottomAligned;
static const CEGUI::String Stretched;
static const CEGUI::String Tiled;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<HorizontalFormatting>
{
public:
typedef HorizontalFormatting return_type;
typedef HorizontalFormatting pass_type;
static String toString(pass_type val)
{
switch (val)
{
case HF_RIGHT_ALIGNED:
return RightAligned;
case HF_CENTRE_ALIGNED:
return CentreAligned;
case HF_TILED:
return Tiled;
case HF_STRETCHED:
return Stretched;
default:
return LeftAligned;
}
}
static return_type fromString(const String& str)
{
if (str == CentreAligned)
return HF_CENTRE_ALIGNED;
else if (str == RightAligned)
return HF_RIGHT_ALIGNED;
else if (str == Tiled)
return HF_TILED;
else if (str == Stretched)
return HF_STRETCHED;
else
return HF_LEFT_ALIGNED;
}
//! Definitions of the possible values represented as Strings
static const CEGUI::String LeftAligned;
static const CEGUI::String CentreAligned;
static const CEGUI::String RightAligned;
static const CEGUI::String Stretched;
static const CEGUI::String Tiled;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<VerticalAlignment>
{
public:
typedef VerticalAlignment return_type;
typedef VerticalAlignment pass_type;
static String toString(pass_type val)
{
switch (val)
{
case VA_BOTTOM:
return BottomAligned;
case VA_CENTRE:
return CentreAligned;
default:
return TopAligned;
}
}
static return_type fromString(const String& str)
{
if (str == CentreAligned)
return VA_CENTRE;
else if (str == BottomAligned)
return VA_BOTTOM;
else
return VA_TOP;
}
//! Definitions of the possible values represented as Strings
static const CEGUI::String TopAligned;
static const CEGUI::String CentreAligned;
static const CEGUI::String BottomAligned;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<HorizontalAlignment>
{
public:
typedef HorizontalAlignment return_type;
typedef HorizontalAlignment pass_type;
static String toString(pass_type val)
{
switch (val)
{
case HA_RIGHT:
return RightAligned;
case HA_CENTRE:
return CentreAligned;
default:
return LeftAligned;
}
}
static return_type fromString(const String& str)
{
if (str == CentreAligned)
return HA_CENTRE;
else if (str == RightAligned)
return HA_RIGHT;
else
return HA_LEFT;
}
//! Definitions of the possible values represented as Strings
static const CEGUI::String LeftAligned;
static const CEGUI::String CentreAligned;
static const CEGUI::String RightAligned;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<DimensionType>
{
public:
typedef DimensionType return_type;
typedef DimensionType pass_type;
static String toString(pass_type val)
{
switch (val)
{
case DT_LEFT_EDGE:
return LeftEdge;
case DT_X_POSITION:
return XPosition;
case DT_TOP_EDGE:
return TopEdge;
case DT_Y_POSITION:
return YPosition;
case DT_RIGHT_EDGE:
return RightEdge;
case DT_BOTTOM_EDGE:
return BottomEdge;
case DT_WIDTH:
return Width;
case DT_HEIGHT:
return Height;
case DT_X_OFFSET:
return XOffset;
case DT_Y_OFFSET:
return YOffset;
default:
return Invalid;
}
}
static return_type fromString(const String& str)
{
if (str == LeftEdge)
return DT_LEFT_EDGE;
else if (str == XPosition)
return DT_X_POSITION;
else if (str == TopEdge)
return DT_TOP_EDGE;
else if (str == YPosition)
return DT_Y_POSITION;
else if (str == RightEdge)
return DT_RIGHT_EDGE;
else if (str == BottomEdge)
return DT_BOTTOM_EDGE;
else if (str == Width)
return DT_WIDTH;
else if (str == Height)
return DT_HEIGHT;
else if (str == XOffset)
return DT_X_OFFSET;
else if (str == YOffset)
return DT_Y_OFFSET;
else
return DT_INVALID;
}
//! Definitions of the possible values represented as Strings
static const CEGUI::String LeftEdge;
static const CEGUI::String RightEdge;
static const CEGUI::String BottomEdge;
static const CEGUI::String TopEdge;
static const CEGUI::String XPosition;
static const CEGUI::String YPosition;
static const CEGUI::String Width;
static const CEGUI::String Height;
static const CEGUI::String XOffset;
static const CEGUI::String YOffset;
static const CEGUI::String Invalid;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<VerticalTextFormatting>
{
public:
typedef VerticalTextFormatting return_type;
typedef VerticalTextFormatting pass_type;
static String toString(pass_type val)
{
switch (val)
{
case VTF_BOTTOM_ALIGNED:
return BottomAligned;
case VTF_CENTRE_ALIGNED:
return CentreAligned;
default:
return TopAligned;
}
}
static return_type fromString(const String& str)
{
if (str == CentreAligned)
return VTF_CENTRE_ALIGNED;
else if (str == BottomAligned)
return VTF_BOTTOM_ALIGNED;
else
return VTF_TOP_ALIGNED;
}
//! Definitions of the possible values represented as Strings
static const CEGUI::String TopAligned;
static const CEGUI::String CentreAligned;
static const CEGUI::String BottomAligned;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<HorizontalTextFormatting>
{
public:
typedef HorizontalTextFormatting return_type;
typedef HorizontalTextFormatting pass_type;
static String toString(pass_type val)
{
switch (val)
{
case HTF_RIGHT_ALIGNED:
return RightAligned;
case HTF_CENTRE_ALIGNED:
return CentreAligned;
case HTF_JUSTIFIED:
return Justified;
case HTF_WORDWRAP_LEFT_ALIGNED:
return WordWrapLeftAligned;
case HTF_WORDWRAP_RIGHT_ALIGNED:
return WordWrapRightAligned;
case HTF_WORDWRAP_CENTRE_ALIGNED:
return WordWrapCentreAligned;
case HTF_WORDWRAP_JUSTIFIED:
return WordWrapJustified;
default:
return LeftAligned;
}
}
static return_type fromString(const String& str)
{
if (str == CentreAligned)
return HTF_CENTRE_ALIGNED;
else if (str == RightAligned)
return HTF_RIGHT_ALIGNED;
else if (str == Justified)
return HTF_JUSTIFIED;
else if (str == WordWrapLeftAligned)
return HTF_WORDWRAP_LEFT_ALIGNED;
else if (str == WordWrapCentreAligned)
return HTF_WORDWRAP_CENTRE_ALIGNED;
else if (str == WordWrapRightAligned)
return HTF_WORDWRAP_RIGHT_ALIGNED;
else if (str == WordWrapJustified)
return HTF_WORDWRAP_JUSTIFIED;
else
return HTF_LEFT_ALIGNED;
}
//! Definitions of the possible values represented as Strings
static const CEGUI::String LeftAligned;
static const CEGUI::String CentreAligned;
static const CEGUI::String RightAligned;
static const CEGUI::String Justified;
static const CEGUI::String WordWrapLeftAligned;
static const CEGUI::String WordWrapRightAligned;
static const CEGUI::String WordWrapCentreAligned;
static const CEGUI::String WordWrapJustified;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<FontMetricType>
{
public:
typedef FontMetricType return_type;
typedef FontMetricType pass_type;
static String toString(pass_type val)
{
switch (val)
{
case FMT_BASELINE:
return Baseline;
case FMT_HORZ_EXTENT:
return HorzExtent;
default:
return LineSpacing;
}
}
static return_type fromString(const String& str)
{
if (str == LineSpacing)
return FMT_LINE_SPACING;
else if (str == Baseline)
return FMT_BASELINE;
else
return FMT_HORZ_EXTENT;
}
static const CEGUI::String LineSpacing;
static const CEGUI::String HorzExtent;
static const CEGUI::String Baseline;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<DimensionOperator>
{
public:
typedef DimensionOperator return_type;
typedef DimensionOperator pass_type;
static String toString(pass_type val)
{
switch (val)
{
case DOP_ADD:
return Add;
case DOP_SUBTRACT:
return Subtract;
case DOP_MULTIPLY:
return Multiply;
case DOP_DIVIDE:
return Divide;
default:
return Noop;
}
}
static return_type fromString(const String& str)
{
if (str == Add)
return DOP_ADD;
else if (str == Subtract)
return DOP_SUBTRACT;
else if (str == Multiply)
return DOP_MULTIPLY;
else if (str == Divide)
return DOP_DIVIDE;
else
return DOP_NOOP;
}
static const CEGUI::String Add;
static const CEGUI::String Subtract;
static const CEGUI::String Multiply;
static const CEGUI::String Divide;
static const CEGUI::String Noop;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<FrameImageComponent>
{
public:
typedef FrameImageComponent return_type;
typedef FrameImageComponent pass_type;
static String toString(pass_type val)
{
switch (val)
{
case FIC_TOP_LEFT_CORNER:
return TopLeftCorner;
case FIC_TOP_RIGHT_CORNER:
return TopRightCorner;
case FIC_BOTTOM_LEFT_CORNER:
return BottomLeftCorner;
case FIC_BOTTOM_RIGHT_CORNER:
return BottomRightCorner;
case FIC_LEFT_EDGE:
return LeftEdge;
case FIC_RIGHT_EDGE:
return RightEdge;
case FIC_TOP_EDGE:
return TopEdge;
case FIC_BOTTOM_EDGE:
return BottomEdge;
default:
return Background;
}
}
static return_type fromString(const String& str)
{
if (str == TopLeftCorner)
return FIC_TOP_LEFT_CORNER;
if (str == TopRightCorner)
return FIC_TOP_RIGHT_CORNER;
if (str == BottomLeftCorner)
return FIC_BOTTOM_LEFT_CORNER;
if (str == BottomRightCorner)
return FIC_BOTTOM_RIGHT_CORNER;
if (str == LeftEdge)
return FIC_LEFT_EDGE;
if (str == RightEdge)
return FIC_RIGHT_EDGE;
if (str == TopEdge)
return FIC_TOP_EDGE;
if (str == BottomEdge)
return FIC_BOTTOM_EDGE;
else
return FIC_BACKGROUND;
}
static const CEGUI::String TopLeftCorner;
static const CEGUI::String TopRightCorner;
static const CEGUI::String BottomLeftCorner;
static const CEGUI::String BottomRightCorner;
static const CEGUI::String TopEdge;
static const CEGUI::String LeftEdge;
static const CEGUI::String RightEdge;
static const CEGUI::String BottomEdge;
static const CEGUI::String Background;
};
template<>
class CEGUIEXPORT FalagardXMLHelper<ChildEventAction>
{
public:
typedef ChildEventAction return_type;
typedef ChildEventAction pass_type;
static String toString(pass_type val)
{
switch (val)
{
case CEA_REDRAW:
return Redraw;
case CEA_LAYOUT:
return Layout;
default:
CEGUI_THROW(InvalidRequestException(
"Invalid enumeration value given."));
}
}
static return_type fromString(const String& str)
{
if (str == Redraw)
return CEA_REDRAW;
if (str == Layout)
return CEA_LAYOUT;
CEGUI_THROW(InvalidRequestException(
"'" + str +
"' does not represent a ChildEventAction enumerated value."));
}
static const CEGUI::String Redraw;
static const CEGUI::String Layout;
};
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// PropertyHelper specialisations
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
template<>
class PropertyHelper<VerticalFormatting>
{
public:
typedef VerticalFormatting return_type;
typedef return_type safe_method_return_type;
typedef VerticalFormatting pass_type;
typedef String string_return_type;
static const String& getDataTypeName()
{
static String type("VerticalFormatting");
return type;
}
static return_type fromString(const String& str)
{
return FalagardXMLHelper<return_type>::fromString(str);
}
static string_return_type toString(pass_type val)
{
return FalagardXMLHelper<return_type>::toString(val);
}
};
template<>
class PropertyHelper<HorizontalFormatting>
{
public:
typedef HorizontalFormatting return_type;
typedef return_type safe_method_return_type;
typedef HorizontalFormatting pass_type;
typedef String string_return_type;
static const String& getDataTypeName()
{
static String type("HorizontalFormatting");
return type;
}
static return_type fromString(const String& str)
{
return FalagardXMLHelper<return_type>::fromString(str);
}
static string_return_type toString(pass_type val)
{
return FalagardXMLHelper<return_type>::toString(val);
}
};
template<>
class PropertyHelper<VerticalTextFormatting>
{
public:
typedef VerticalTextFormatting return_type;
typedef return_type safe_method_return_type;
typedef VerticalTextFormatting pass_type;
typedef String string_return_type;
static const String& getDataTypeName()
{
static String type("VerticalTextFormatting");
return type;
}
static return_type fromString(const String& str)
{
return FalagardXMLHelper<return_type>::fromString(str);
}
static string_return_type toString(pass_type val)
{
return FalagardXMLHelper<return_type>::toString(val);
}
};
template<>
class PropertyHelper<HorizontalTextFormatting>
{
public:
typedef HorizontalTextFormatting return_type;
typedef return_type safe_method_return_type;
typedef HorizontalTextFormatting pass_type;
typedef String string_return_type;
static const String& getDataTypeName()
{
static String type("HorizontalTextFormatting");
return type;
}
static return_type fromString(const String& str)
{
return FalagardXMLHelper<return_type>::fromString(str);
}
static string_return_type toString(pass_type val)
{
return FalagardXMLHelper<return_type>::toString(val);
}
};
}
#endif
|