PropertyParserAnimation.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "../../Include/RmlUi/Core/PropertyParser.h"
  3. #include "ControlledLifetimeResource.h"
  4. namespace Rml {
  5. /**
  6. Parses the RCSS 'animation' and 'transition' property specifications.
  7. */
  8. class PropertyParserAnimation : public PropertyParser {
  9. public:
  10. enum Type { ANIMATION_PARSER, TRANSITION_PARSER } type;
  11. /// Constructs the parser for either the animation or the transition type.
  12. PropertyParserAnimation(Type type);
  13. /// Called to parse a RCSS animation or transition declaration.
  14. /// @param[out] property The property to set the parsed value on.
  15. /// @param[in] value The raw value defined for this property.
  16. /// @param[in] parameters The parameters defined for this property.
  17. /// @return True if the value was validated successfully, false otherwise.
  18. bool ParseValue(Property& property, const String& value, const ParameterMap& parameters) const override;
  19. static void Initialize();
  20. static void Shutdown();
  21. private:
  22. static bool ParseAnimation(Property& property, const StringList& animation_values);
  23. static bool ParseTransition(Property& property, const StringList& transition_values);
  24. static ControlledLifetimeResource<struct PropertyParserAnimationData> parser_data;
  25. };
  26. } // namespace Rml