瀏覽代碼

Clean up types and aliases, trying to be more consistent.

Michael Ragazzon 6 年之前
父節點
當前提交
68f53dce67
共有 59 個文件被更改,包括 168 次插入191 次删除
  1. 1 1
      Include/RmlUi/Core/ComputedValues.h
  2. 1 1
      Include/RmlUi/Core/ContextInstancer.h
  3. 1 1
      Include/RmlUi/Core/DecoratorInstancer.h
  4. 1 1
      Include/RmlUi/Core/Element.h
  5. 1 1
      Include/RmlUi/Core/EventInstancer.h
  6. 3 3
      Include/RmlUi/Core/Factory.h
  7. 1 1
      Include/RmlUi/Core/FontEffectInstancer.h
  8. 2 2
      Include/RmlUi/Core/PropertiesIteratorView.h
  9. 1 1
      Include/RmlUi/Core/Property.h
  10. 1 1
      Include/RmlUi/Core/Spritesheet.h
  11. 0 6
      Include/RmlUi/Core/StringUtilities.h
  12. 5 5
      Include/RmlUi/Core/StyleSheet.h
  13. 2 2
      Include/RmlUi/Core/Traits.h
  14. 1 1
      Include/RmlUi/Core/Transform.h
  15. 4 4
      Include/RmlUi/Core/TypeConverter.h
  16. 58 50
      Include/RmlUi/Core/Types.h
  17. 2 2
      Include/RmlUi/Core/Variant.h
  18. 1 1
      Include/RmlUi/Core/Variant.inl
  19. 1 1
      Source/Core/BitmapFont/FontFaceLayer.cpp
  20. 1 1
      Source/Core/BitmapFont/FontFaceLayer.h
  21. 2 2
      Source/Core/ContextInstancerDefault.cpp
  22. 1 1
      Source/Core/ContextInstancerDefault.h
  23. 3 3
      Source/Core/Core.cpp
  24. 1 1
      Source/Core/DecoratorTiledBoxInstancer.cpp
  25. 1 1
      Source/Core/DecoratorTiledBoxInstancer.h
  26. 1 1
      Source/Core/DecoratorTiledHorizontalInstancer.cpp
  27. 1 1
      Source/Core/DecoratorTiledHorizontalInstancer.h
  28. 1 1
      Source/Core/DecoratorTiledImageInstancer.cpp
  29. 1 1
      Source/Core/DecoratorTiledImageInstancer.h
  30. 1 1
      Source/Core/DecoratorTiledVerticalInstancer.cpp
  31. 1 1
      Source/Core/DecoratorTiledVerticalInstancer.h
  32. 8 8
      Source/Core/ElementAnimation.cpp
  33. 1 1
      Source/Core/ElementDecoration.cpp
  34. 2 2
      Source/Core/ElementDecoration.h
  35. 1 1
      Source/Core/ElementDocument.cpp
  36. 2 2
      Source/Core/ElementStyle.cpp
  37. 1 1
      Source/Core/ElementStyle.h
  38. 1 1
      Source/Core/EventDispatcher.cpp
  39. 2 2
      Source/Core/EventInstancerDefault.cpp
  40. 1 1
      Source/Core/EventInstancerDefault.h
  41. 6 6
      Source/Core/Factory.cpp
  42. 1 1
      Source/Core/FontEffectOutlineInstancer.cpp
  43. 1 1
      Source/Core/FontEffectOutlineInstancer.h
  44. 1 1
      Source/Core/FontEffectShadowInstancer.cpp
  45. 1 1
      Source/Core/FontEffectShadowInstancer.h
  46. 1 1
      Source/Core/FontFaceHandle.cpp
  47. 1 1
      Source/Core/FontFaceHandle.h
  48. 1 1
      Source/Core/FontFaceLayer.cpp
  49. 2 2
      Source/Core/FontFaceLayer.h
  50. 1 1
      Source/Core/PropertiesIteratorView.cpp
  51. 3 3
      Source/Core/PropertyParserTransform.cpp
  52. 1 1
      Source/Core/PropertySpecification.cpp
  53. 3 28
      Source/Core/StringUtilities.cpp
  54. 7 7
      Source/Core/StyleSheet.cpp
  55. 1 1
      Source/Core/StyleSheetParser.cpp
  56. 1 1
      Source/Core/Template.h
  57. 1 1
      Source/Core/Transform.cpp
  58. 2 2
      Source/Core/TypeConverter.cpp
  59. 12 12
      Source/Core/Variant.cpp

+ 1 - 1
Include/RmlUi/Core/ComputedValues.h

@@ -191,7 +191,7 @@ struct ComputedValues
 	PerspectiveOrigin perspective_origin_x = { PerspectiveOrigin::Percentage, 50.f };
 	PerspectiveOrigin perspective_origin_y = { PerspectiveOrigin::Percentage, 50.f };
 
-	TransformRef transform;
+	TransformPtr transform;
 	TransformOrigin transform_origin_x = { TransformOrigin::Percentage, 50.f };
 	TransformOrigin transform_origin_y = { TransformOrigin::Percentage, 50.f };
 	float transform_origin_z = 0.0f;

+ 1 - 1
Include/RmlUi/Core/ContextInstancer.h

@@ -52,7 +52,7 @@ public:
 	/// Instances a context.
 	/// @param[in] name Name of this context.
 	/// @return The instanced context.
-	virtual UniquePtr<Context> InstanceContext(const String& name) = 0;
+	virtual ContextPtr InstanceContext(const String& name) = 0;
 
 	/// Releases a context previously created by this context.
 	/// @param[in] context The context to release.

+ 1 - 1
Include/RmlUi/Core/DecoratorInstancer.h

@@ -62,7 +62,7 @@ public:
 	/// @param[in] properties All RCSS properties associated with the decorator.
 	/// @param[in] interface An interface for querying the active style sheet.
 	/// @return A shared_ptr to the decorator if it was instanced successfully.
-	virtual std::shared_ptr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) = 0;
+	virtual SharedPtr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) = 0;
 
 	/// Returns the property specification associated with the instancer.
 	const PropertySpecification& GetPropertySpecification() const;

+ 1 - 1
Include/RmlUi/Core/Element.h

@@ -735,7 +735,7 @@ private:
 	bool clipping_state_dirty;
 
 	// Transform state
-	std::unique_ptr< TransformState > transform_state;
+	UniquePtr< TransformState > transform_state;
 	bool transform_state_perspective_dirty;
 	bool transform_state_transform_dirty;
 	bool transform_state_parent_transform_dirty;

+ 1 - 1
Include/RmlUi/Core/EventInstancer.h

@@ -54,7 +54,7 @@ public:
 	/// @param[in] name Name of this event.
 	/// @param[in] parameters Additional parameters for this event.
 	/// @param[in] interruptible If the event propagation can be stopped.
-	virtual UniquePtr<Event> InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible) = 0;
+	virtual EventPtr InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible) = 0;
 
 	/// Releases an event instanced by this instancer.
 	/// @param[in] event The event to release.

+ 3 - 3
Include/RmlUi/Core/Factory.h

@@ -78,7 +78,7 @@ public:
 	/// Instances a new context.
 	/// @param[in] name The name of the new context.
 	/// @return The new context, or NULL if no context could be created.
-	static UniquePtr<Context> InstanceContext(const String& name);
+	static ContextPtr InstanceContext(const String& name);
 
 	/// Registers a non-owning pointer to the element instancer that will be used to instance an element when the specified tag is encountered.
 	/// @param[in] name Name of the instancer; elements with this as their tag will use this instancer.
@@ -163,10 +163,10 @@ public:
 	/// @param[in] parameters Additional parameters for this event.
 	/// @param[in] interruptible If the event propagation can be stopped.
 	/// @return The instanced event.
-	static UniquePtr<Event> InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible);
+	static EventPtr InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible);
 
 	/// Register the instancer to be used for all event listeners.
-	/// @lifetime The instancer must be kept alive until after the call to Core::Shutdown.
+	/// @lifetime The instancer must be kept alive until after the call to Core::Shutdown, or until a new instancer is set.
 	static void RegisterEventListenerInstancer(EventListenerInstancer* instancer);
 	/// Instance an event listener with the given string. This is used for instancing listeners for the on* events from RML.
 	/// @param[in] value The parameters to the event listener.

+ 1 - 1
Include/RmlUi/Core/FontEffectInstancer.h

@@ -59,7 +59,7 @@ public:
 	/// @param[in] properties All RCSS properties associated with the font effect.
 	/// @param[in] interface An interface for querying the active style sheet.
 	/// @return A shared_ptr to the font-effect if it was instanced successfully.
-	virtual std::shared_ptr<FontEffect> InstanceFontEffect(const String& name, const PropertyDictionary& properties) = 0;
+	virtual SharedPtr<FontEffect> InstanceFontEffect(const String& name, const PropertyDictionary& properties) = 0;
 
 	/// Returns the property specification associated with the instancer.
 	const PropertySpecification& GetPropertySpecification() const;

+ 2 - 2
Include/RmlUi/Core/PropertiesIteratorView.h

@@ -51,7 +51,7 @@ class PropertiesIterator;
 
 class RMLUICORE_API PropertiesIteratorView {
 public:
-	PropertiesIteratorView(std::unique_ptr<PropertiesIterator> ptr);
+	PropertiesIteratorView(UniquePtr<PropertiesIterator> ptr);
 	PropertiesIteratorView(PropertiesIteratorView&& other);
 	PropertiesIteratorView& operator=(PropertiesIteratorView&& other);
 	PropertiesIteratorView(const PropertiesIteratorView& other) = delete;
@@ -73,7 +73,7 @@ public:
 	const PseudoClassList& GetPseudoClassList() const;
 
 private:
-	std::unique_ptr<PropertiesIterator> ptr;
+	UniquePtr<PropertiesIterator> ptr;
 };
 
 }

+ 1 - 1
Include/RmlUi/Core/Property.h

@@ -75,7 +75,7 @@ public:
 		PC = 1 << 16,				// number suffixed by 'pc'; fetch as < float >
 		PPI_UNIT = INCH | CM | MM | PT | PC,
 
-		TRANSFORM = 1 << 17,			// transform; fetch as < TransformRef >, may be empty
+		TRANSFORM = 1 << 17,			// transform; fetch as < TransformPtr >, may be empty
 		TRANSITION = 1 << 18,           // transition; fetch as < TransitionList >
 		ANIMATION = 1 << 19,            // animation; fetch as < AnimationList >
 		DECORATOR = 1 << 20,            // decorator; fetch as < DecoratorList >

+ 1 - 1
Include/RmlUi/Core/Spritesheet.h

@@ -64,7 +64,7 @@ struct Spritesheet {
 		: name(name), image_source(image_source), definition_source(definition_source), definition_line_number(definition_line_number), texture(texture) {}
 };
 
-using SpritesheetMap = SmallUnorderedMap<String, std::shared_ptr<const Spritesheet>>; // key: spritesheet name (as given in @spritesheet)
+using SpritesheetMap = SmallUnorderedMap<String, SharedPtr<const Spritesheet>>; // key: spritesheet name (as given in @spritesheet)
 using SpriteDefinitionList = std::vector<std::pair<String, Rectangle>>; // Sprite name and rectangle
 
 

+ 0 - 6
Include/RmlUi/Core/StringUtilities.h

@@ -63,12 +63,6 @@ public:
 	/// @param[in] delimiter Delimiter to insert between the individual values.
 	static void JoinString(String& string, const StringList& string_list, const char delimiter = ',');
 
-	/// Hashes a string of data to an integer value using the FNV algorithm.
-	/// @param[in] data Data to hash.
-	/// @param[in] length Length of the string to hash. If this is -1, the data will be interpreted as a C string.
-	/// @return Integer hash of the data.
-	static Hash FNVHash(const char* data, int length = -1);
-
 	/// Converts a character array in UTF-8 encoding to a vector of words. The UCS-2 words will be encoded as
 	/// either big- or little-endian, depending on the host processor.
 	/// @param[in] input Input string in UTF-8 encoding.

+ 5 - 5
Include/RmlUi/Core/StyleSheet.h

@@ -59,7 +59,7 @@ using KeyframesMap = UnorderedMap<String, Keyframes>;
 struct DecoratorSpecification {
 	String decorator_type;
 	PropertyDictionary properties;
-	std::shared_ptr<Decorator> decorator;
+	SharedPtr<Decorator> decorator;
 };
 using DecoratorSpecificationMap = UnorderedMap<String, DecoratorSpecification>;
 
@@ -92,7 +92,7 @@ public:
 	Keyframes* GetKeyframes(const String& name);
 
 	/// Returns the Decorator of the given name, or null if it does not exist.
-	std::shared_ptr<Decorator> GetDecorator(const String& name) const;
+	SharedPtr<Decorator> GetDecorator(const String& name) const;
 
 	/// Parses the decorator property from a string and returns a list of instanced decorators.
 	DecoratorList InstanceDecoratorsFromString(const String& decorator_string_value, const String& source_file, int source_line_number) const;
@@ -105,11 +105,11 @@ public:
 
 	/// Returns the compiled element definition for a given element hierarchy. A reference count will be added for the
 	/// caller, so another should not be added. The definition should be released by removing the reference count.
-	std::shared_ptr<ElementDefinition> GetElementDefinition(const Element* element) const;
+	SharedPtr<ElementDefinition> GetElementDefinition(const Element* element) const;
 
 private:
 	// Root level node, attributes from special nodes like "body" get added to this node
-	std::unique_ptr<StyleSheetNode> root;
+	UniquePtr<StyleSheetNode> root;
 
 	// The maximum specificity offset used in this style sheet to distinguish between properties in
 	// similarly-specific rules, but declared on different lines. When style sheets are merged, the
@@ -132,7 +132,7 @@ private:
 	// Map of every node, even empty, un-styled, nodes.
 	NodeIndex complete_node_index;
 
-	typedef UnorderedMap< size_t, std::shared_ptr<ElementDefinition> > ElementDefinitionCache;
+	typedef UnorderedMap< size_t, SharedPtr<ElementDefinition> > ElementDefinitionCache;
 	// Index of node sets to element definitions.
 	mutable ElementDefinitionCache node_cache;
 };

+ 2 - 2
Include/RmlUi/Core/Traits.h

@@ -26,8 +26,8 @@
  *
  */
 
-#ifndef RMLUICOREREFERENCECOUNTABLE_H
-#define RMLUICOREREFERENCECOUNTABLE_H
+#ifndef RMLUICORETRAITS_H
+#define RMLUICORETRAITS_H
 
 #include "Header.h"
 #include <type_traits>

+ 1 - 1
Include/RmlUi/Core/Transform.h

@@ -59,7 +59,7 @@ public:
 	/// Construct transform with a list of primitives
 	Transform(std::vector<Transforms::Primitive> primitives);
 
-	/// Helper function to create a Property with TransformRef from list of primitives
+	/// Helper function to create a Property with TransformPtr from list of primitives
 	static Property MakeProperty(std::vector<Transforms::Primitive> primitives);
 
 	/// Remove all Primitives from this Transform

+ 4 - 4
Include/RmlUi/Core/TypeConverter.h

@@ -59,14 +59,14 @@ public:
 
 // Some more complex types are defined in cpp-file
 
-template<> class TypeConverter< TransformRef, TransformRef > {
+template<> class TypeConverter< TransformPtr, TransformPtr > {
 public:
-	RMLUICORE_API static bool Convert(const TransformRef& src, TransformRef& dest);
+	RMLUICORE_API static bool Convert(const TransformPtr& src, TransformPtr& dest);
 };
 
-template<> class TypeConverter< TransformRef, String > {
+template<> class TypeConverter< TransformPtr, String > {
 public:
-	RMLUICORE_API static bool Convert(const TransformRef& src, String& dest);
+	RMLUICORE_API static bool Convert(const TransformPtr& src, String& dest);
 };
 
 template<> class TypeConverter< TransitionList, TransitionList > {

+ 58 - 50
Include/RmlUi/Core/Types.h

@@ -57,12 +57,10 @@
 namespace Rml {
 namespace Core {
 
-// Define commonly used basic types.
+// Commonly used basic types
 typedef unsigned char byte;
 typedef wchar_t word;
 typedef double Time;
-typedef float TimeDelta;
-typedef unsigned int Hash;
 typedef void* ScriptObject;
 
 }
@@ -84,87 +82,97 @@ typedef unsigned __int64 uint64_t;
 namespace Rml {
 namespace Core {
 
-// Default colour types.
-typedef Colour< float, 1 > Colourf;
-typedef Colour< byte, 255 > Colourb;
-typedef Vector2< int > Vector2i;
-typedef Vector2< float > Vector2f;
-typedef Vector3< int > Vector3i;
-typedef Vector3< float > Vector3f;
-typedef Vector4< int > Vector4i;
-typedef Vector4< float > Vector4f;
 
-typedef Matrix4< float, ColumnMajorStorage< float > > ColumnMajorMatrix4f;
-typedef Matrix4< float, RowMajorStorage< float > > RowMajorMatrix4f;
-typedef ColumnMajorMatrix4f Matrix4f;
-
-template<typename T>
-using UniquePtr = std::unique_ptr<T, Releaser<T>>;
-template<typename T>
-using SharedPtr = std::shared_ptr<T>;
+// Color and linear algebra
+using Colourf = Colour< float, 1 >;
+using Colourb = Colour< byte, 255 >;
+using Vector2i = Vector2< int >;
+using Vector2f = Vector2< float >;
+using Vector3i = Vector3< int >;
+using Vector3f = Vector3< float >;
+using Vector4i = Vector4< int >;
+using Vector4f = Vector4< float >;
+using ColumnMajorMatrix4f = Matrix4< float, ColumnMajorStorage< float > >;
+using RowMajorMatrix4f = Matrix4< float, RowMajorStorage< float > >;
+using Matrix4f = ColumnMajorMatrix4f;
 
 
+// Common classes
 class Element;
 class ElementInstancer;
-using ElementPtr = UniquePtr<Element>;
-using ElementInstancerPtr = UniquePtr<ElementInstancer>;
 class ElementAnimation;
+class Context;
+class Event;
 class Property;
 class Variant;
 class Transform;
 class Decorator;
 class FontEffect;
 struct Animation;
+struct Transition;
+struct TransitionList;
 struct Rectangle;
 enum class PropertyId : uint16_t;
 
+
 // Types for external interfaces.
-typedef uintptr_t FileHandle;
-typedef uintptr_t TextureHandle;
-typedef uintptr_t CompiledGeometryHandle;
-typedef uintptr_t DecoratorDataHandle;
+using FileHandle = uintptr_t;
+using TextureHandle = uintptr_t;
+using CompiledGeometryHandle = uintptr_t;
+using DecoratorDataHandle = uintptr_t;
+
+
+// Smart pointer types
+template<typename T>
+using UniquePtr = std::unique_ptr<T>;
+template<typename T>
+using UniqueReleaserPtr = std::unique_ptr<T, Releaser<T>>;
+template<typename T>
+using SharedPtr = std::shared_ptr<T>;
 
-// Common containers
+using ElementPtr = UniqueReleaserPtr<Element>;
+using ContextPtr = UniqueReleaserPtr<Context>;
+using EventPtr = UniqueReleaserPtr<Event>;
+
+// Custom containers
 #ifdef RMLUI_DEBUG
-template < typename Key, typename Value>
+template <typename Key, typename Value>
 using UnorderedMap = std::unordered_map< Key, Value >;
 #else
 template < typename Key, typename Value>
 using UnorderedMap = robin_hood::unordered_flat_map< Key, Value >;
 #endif
-template < typename Key, typename Value>
+template <typename Key, typename Value>
 using SmallUnorderedMap = chobo::flat_map< Key, Value >;
-template < typename T >
+template <typename T>
 using SmallOrderedSet = chobo::flat_set< T >;
-template < typename T >
+template <typename T>
 using SmallUnorderedSet = chobo::flat_set< T >;
-// Note: Right now small ordered and unordered set use the same container, but we may
-// want to change this later so use ordered when a sorted container is needed.
-
+// Note: Right now the SmallOrderedSet and SmallUnorderedSet use the same container. However, as we may 
+// want to change this later, use the ordered container strictly when a sorted container is needed.
 
 
-// Container types for some common lists
-typedef std::vector< Element* > ElementList;
+// Container types for common classes
+using ElementList = std::vector< Element* >;
 using OwnedElementList = std::vector< ElementPtr >;
-typedef std::vector< ElementAnimation > ElementAnimationList;
-typedef SmallUnorderedSet< String > PseudoClassList;
-typedef SmallUnorderedSet< String > AttributeNameList;
-typedef SmallOrderedSet< PropertyId > PropertyNameList;
-typedef UnorderedMap< PropertyId, Property > PropertyMap;
-typedef SmallUnorderedMap< String, Variant > Dictionary;
-typedef Dictionary ElementAttributes;
+using ElementAnimationList = std::vector< ElementAnimation >;
 
-// Reference types
-typedef std::shared_ptr< Transform > TransformRef;
+using PseudoClassList = SmallUnorderedSet< String >;
+using AttributeNameList = SmallUnorderedSet< String >;
+using PropertyNameList = SmallOrderedSet< PropertyId >;
+using PropertyMap = UnorderedMap< PropertyId, Property >;
 
-struct Transition;
-struct TransitionList;
+using Dictionary = SmallUnorderedMap< String, Variant >;
+using ElementAttributes = Dictionary;
 
-using DecoratorList = std::vector<std::shared_ptr<const Decorator>>;
-using FontEffectList = std::vector<std::shared_ptr<const FontEffect>>;
-using FontEffectListPtr = std::shared_ptr<const FontEffectList>;
+using DecoratorList = std::vector<SharedPtr<const Decorator>>;
+using FontEffectList = std::vector<SharedPtr<const FontEffect>>;
 using AnimationList = std::vector<Animation>;
 
+// Additional smart pointers
+using TransformPtr = SharedPtr< Transform >;
+using FontEffectListPtr = SharedPtr<const FontEffectList>;
+
 }
 }
 

+ 2 - 2
Include/RmlUi/Core/Variant.h

@@ -137,8 +137,8 @@ private:
 
 	void Set(const String& value);
 	void Set(String&& value);
-	void Set(const TransformRef& value);
-	void Set(TransformRef&& value);
+	void Set(const TransformPtr& value);
+	void Set(TransformPtr&& value);
 	void Set(const TransitionList& value);
 	void Set(TransitionList&& value);
 	void Set(const AnimationList& value);

+ 1 - 1
Include/RmlUi/Core/Variant.inl

@@ -107,7 +107,7 @@ bool Variant::GetInto(T& value) const
 		break;
 
 	case TRANSFORMREF:
-		return TypeConverter< TransformRef, T >::Convert(*(TransformRef*)data, value);
+		return TypeConverter< TransformPtr, T >::Convert(*(TransformPtr*)data, value);
 		break;
 
 	case TRANSITIONLIST:

+ 1 - 1
Source/Core/BitmapFont/FontFaceLayer.cpp

@@ -44,7 +44,7 @@ BitmapFont::FontFaceLayer::~FontFaceLayer()
 }
 
 // Generates the character and texture data for the layer.
-bool BitmapFont::FontFaceLayer::Initialise(const Rml::Core::FontFaceHandle* _handle, std::shared_ptr<const FontEffect> _effect, const Rml::Core::FontFaceLayer* clone, bool deep_clone)
+bool BitmapFont::FontFaceLayer::Initialise(const Rml::Core::FontFaceHandle* _handle, SharedPtr<const FontEffect> _effect, const Rml::Core::FontFaceLayer* clone, bool deep_clone)
 {
 	(void)(_effect);
 

+ 1 - 1
Source/Core/BitmapFont/FontFaceLayer.h

@@ -61,7 +61,7 @@ public:
 	/// @param[in] clone The layer to optionally clone geometry and texture data from.
 	/// @param[in] deep_clone If true, the clones geometry will be completely cloned and the effect will have no option to affect even the glyph origins.
 	/// @return True if the layer was generated successfully, false if not.
-	bool Initialise(const Rml::Core::FontFaceHandle* handle, std::shared_ptr<const FontEffect> effect, const Rml::Core::FontFaceLayer* clone = NULL, bool deep_clone = false) override;
+	bool Initialise(const Rml::Core::FontFaceHandle* handle, SharedPtr<const FontEffect> effect, const Rml::Core::FontFaceLayer* clone = NULL, bool deep_clone = false) override;
 
 	/// Generates the texture data for a layer (for the texture database).
 	/// @param[out] texture_data The pointer to be set to the generated texture data.

+ 2 - 2
Source/Core/ContextInstancerDefault.cpp

@@ -41,9 +41,9 @@ ContextInstancerDefault::~ContextInstancerDefault()
 {
 }
 
-UniquePtr<Context> ContextInstancerDefault::InstanceContext(const String& name)
+ContextPtr ContextInstancerDefault::InstanceContext(const String& name)
 {
-	return UniquePtr<Context>(new Context(name));
+	return ContextPtr(new Context(name));
 }
 
 // Releases a context previously created by this context.

+ 1 - 1
Source/Core/ContextInstancerDefault.h

@@ -49,7 +49,7 @@ public:
 	/// Instances a context.
 	/// @param[in] name Name of this context.
 	/// @return The instanced context.
-	UniquePtr<Context> InstanceContext(const String& name) override;
+	ContextPtr InstanceContext(const String& name) override;
 
 	/// Releases a context previously created by this context.
 	/// @param[in] context The context to release.

+ 3 - 3
Source/Core/Core.cpp

@@ -48,11 +48,11 @@ static SystemInterface* system_interface = nullptr;
 static FileInterface* file_interface = nullptr;
 
 // Default interfaces should be created and destroyed on Initialise and Shutdown, respectively.
-static std::unique_ptr<FileInterface> default_file_interface;
+static UniquePtr<FileInterface> default_file_interface;
 
 static bool initialised = false;
 
-using ContextMap = UnorderedMap< String, UniquePtr<Context> >;
+using ContextMap = UnorderedMap< String, ContextPtr >;
 static ContextMap contexts;
 
 #ifndef RMLUI_VERSION
@@ -189,7 +189,7 @@ Context* CreateContext(const String& name, const Vector2i& dimensions, RenderInt
 		return nullptr;
 	}
 
-	UniquePtr<Context> new_context = Factory::InstanceContext(name);
+	ContextPtr new_context = Factory::InstanceContext(name);
 	if (!new_context)
 	{
 		Log::Message(Log::LT_WARNING, "Failed to instance context '%s', instancer returned NULL.", name.c_str());

+ 1 - 1
Source/Core/DecoratorTiledBoxInstancer.cpp

@@ -55,7 +55,7 @@ DecoratorTiledBoxInstancer::~DecoratorTiledBoxInstancer()
 }
 
 // Instances a box decorator.
-std::shared_ptr<Decorator>DecoratorTiledBoxInstancer::InstanceDecorator(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties, const DecoratorInstancerInterface& interface)
+SharedPtr<Decorator>DecoratorTiledBoxInstancer::InstanceDecorator(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties, const DecoratorInstancerInterface& interface)
 {
 	RMLUI_UNUSED(name);
 

+ 1 - 1
Source/Core/DecoratorTiledBoxInstancer.h

@@ -45,7 +45,7 @@ public:
 	~DecoratorTiledBoxInstancer();
 
 	/// Instances a box decorator.
-	std::shared_ptr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) override;
+	SharedPtr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) override;
 };
 
 }

+ 1 - 1
Source/Core/DecoratorTiledHorizontalInstancer.cpp

@@ -45,7 +45,7 @@ DecoratorTiledHorizontalInstancer::~DecoratorTiledHorizontalInstancer()
 {
 }
 
-std::shared_ptr<Decorator> DecoratorTiledHorizontalInstancer::InstanceDecorator(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties, const DecoratorInstancerInterface& interface)
+SharedPtr<Decorator> DecoratorTiledHorizontalInstancer::InstanceDecorator(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties, const DecoratorInstancerInterface& interface)
 {
 	RMLUI_UNUSED(name);
 

+ 1 - 1
Source/Core/DecoratorTiledHorizontalInstancer.h

@@ -45,7 +45,7 @@ public:
 	~DecoratorTiledHorizontalInstancer();
 
 	/// Instances a horizontal decorator.
-	std::shared_ptr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) override;
+	SharedPtr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) override;
 };
 
 }

+ 1 - 1
Source/Core/DecoratorTiledImageInstancer.cpp

@@ -44,7 +44,7 @@ DecoratorTiledImageInstancer::~DecoratorTiledImageInstancer()
 }
 
 
-std::shared_ptr<Decorator> DecoratorTiledImageInstancer::InstanceDecorator(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties, const DecoratorInstancerInterface& interface)
+SharedPtr<Decorator> DecoratorTiledImageInstancer::InstanceDecorator(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties, const DecoratorInstancerInterface& interface)
 {
 	RMLUI_UNUSED(name);
 

+ 1 - 1
Source/Core/DecoratorTiledImageInstancer.h

@@ -45,7 +45,7 @@ public:
 	~DecoratorTiledImageInstancer();
 
 	/// Instances an image decorator.
-	std::shared_ptr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) override;
+	SharedPtr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) override;
 };
 
 }

+ 1 - 1
Source/Core/DecoratorTiledVerticalInstancer.cpp

@@ -45,7 +45,7 @@ DecoratorTiledVerticalInstancer::~DecoratorTiledVerticalInstancer()
 {
 }
 
-std::shared_ptr<Decorator> DecoratorTiledVerticalInstancer::InstanceDecorator(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties, const DecoratorInstancerInterface& interface)
+SharedPtr<Decorator> DecoratorTiledVerticalInstancer::InstanceDecorator(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties, const DecoratorInstancerInterface& interface)
 {
 	RMLUI_UNUSED(name);
 

+ 1 - 1
Source/Core/DecoratorTiledVerticalInstancer.h

@@ -45,7 +45,7 @@ public:
 	~DecoratorTiledVerticalInstancer();
 
 	/// Instances a vertical decorator.
-	std::shared_ptr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) override;
+	SharedPtr<Decorator> InstanceDecorator(const String& name, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) override;
 };
 
 }

+ 8 - 8
Source/Core/ElementAnimation.cpp

@@ -118,8 +118,8 @@ static Property InterpolateProperties(const Property & p0, const Property& p1, f
 	{
 		using namespace Rml::Core::Transforms;
 
-		auto& t0 = p0.value.GetReference<TransformRef>();
-		auto& t1 = p1.value.GetReference<TransformRef>();
+		auto& t0 = p0.value.GetReference<TransformPtr>();
+		auto& t1 = p1.value.GetReference<TransformPtr>();
 
 		const auto& prim0 = t0->GetPrimitives();
 		const auto& prim1 = t1->GetPrimitives();
@@ -131,7 +131,7 @@ static Property InterpolateProperties(const Property & p0, const Property& p1, f
 		}
 
 		// Build the new, interpolating transform
-		std::unique_ptr<Transform> t(new Transform);
+		UniquePtr<Transform> t(new Transform);
 		t->GetPrimitives().reserve(t0->GetPrimitives().size());
 
 		for (size_t i = 0; i < prim0.size(); i++)
@@ -145,7 +145,7 @@ static Property InterpolateProperties(const Property & p0, const Property& p1, f
 			t->AddPrimitive(p);
 		}
 
-		return Property{ TransformRef(std::move(t)), Property::TRANSFORM };
+		return Property{ TransformPtr(std::move(t)), Property::TRANSFORM };
 	}
 
 	return alpha < 0.5f ? p0 : p1;
@@ -321,8 +321,8 @@ static bool PrepareTransforms(std::vector<AnimationKey>& keys, Element& element,
 		if(prop0.unit != Property::TRANSFORM || prop1.unit != Property::TRANSFORM)
 			return false;
 
-		auto& t0 = prop0.value.GetReference<TransformRef>();
-		auto& t1 = prop1.value.GetReference<TransformRef>();
+		auto& t0 = prop0.value.GetReference<TransformPtr>();
+		auto& t1 = prop1.value.GetReference<TransformPtr>();
 
 		auto result = PrepareTransformPair(*t0, *t1, element);
 
@@ -373,7 +373,7 @@ bool ElementAnimation::InternalAddKey(float time, const Property& property, Twee
 
 	if (key.property.unit == Property::TRANSFORM)
 	{
-		if (!key.property.value.GetReference<TransformRef>())
+		if (!key.property.value.GetReference<TransformPtr>())
 			key.property.value = std::make_shared<Transform>();
 	}
 
@@ -399,7 +399,7 @@ bool ElementAnimation::AddKey(float target_time, const Property & in_property, E
 	if (property.unit == Property::TRANSFORM)
 	{
 		bool must_decompose = false;
-		Transform& transform = *property.value.GetReference<TransformRef>();
+		Transform& transform = *property.value.GetReference<TransformPtr>();
 
 		for (auto& primitive : transform.GetPrimitives())
 		{

+ 1 - 1
Source/Core/ElementDecoration.cpp

@@ -65,7 +65,7 @@ bool ElementDecoration::ReloadDecorators()
 }
 
 // Loads a single decorator and adds it to the list of loaded decorators for this element.
-int ElementDecoration::LoadDecorator(std::shared_ptr<const Decorator> decorator)
+int ElementDecoration::LoadDecorator(SharedPtr<const Decorator> decorator)
 {
 	DecoratorHandle element_decorator;
 	element_decorator.decorator_data = decorator->GenerateElementData(element);

+ 2 - 2
Source/Core/ElementDecoration.h

@@ -59,7 +59,7 @@ public:
 
 private:
 	// Loads a single decorator and adds it to the list of loaded decorators for this element.
-	int LoadDecorator(std::shared_ptr<const Decorator> decorator);
+	int LoadDecorator(SharedPtr<const Decorator> decorator);
 	// Releases existing decorators and loads all decorators required by the element's definition.
 	bool ReloadDecorators();
 	// Releases all existing decorators and frees their data.
@@ -67,7 +67,7 @@ private:
 
 	struct DecoratorHandle
 	{
-		std::shared_ptr<const Decorator> decorator;
+		SharedPtr<const Decorator> decorator;
 		DecoratorDataHandle decorator_data;
 	};
 

+ 1 - 1
Source/Core/ElementDocument.cpp

@@ -100,7 +100,7 @@ void ElementDocument::ProcessHeader(const DocumentHeader* document_header)
 	{			
 		for (size_t i = 0;i < header.rcss_inline.size(); i++)
 		{			
-			std::unique_ptr<StyleSheet> inline_sheet = std::make_unique<StyleSheet>();
+			UniquePtr<StyleSheet> inline_sheet = std::make_unique<StyleSheet>();
 			auto stream = std::make_unique<StreamMemory>((const byte*) header.rcss_inline[i].c_str(), header.rcss_inline[i].size());
 			stream->SetSourceURL(document_header->source);
 

+ 2 - 2
Source/Core/ElementStyle.cpp

@@ -170,7 +170,7 @@ void ElementStyle::UpdateDefinition()
 	{
 		definition_dirty = false;
 
-		std::shared_ptr<ElementDefinition> new_definition;
+		SharedPtr<ElementDefinition> new_definition;
 		
 		if (auto& style_sheet = element->GetStyleSheet())
 		{
@@ -814,7 +814,7 @@ DirtyPropertyList ElementStyle::ComputeValues(Style::ComputedValues& values, con
 			break;
 
 		case PropertyId::Transform:
-			values.transform = p->Get<TransformRef>();
+			values.transform = p->Get<TransformPtr>();
 			break;
 		case PropertyId::TransformOriginX:
 			values.transform_origin_x = ComputeOrigin(p, font_size, document_font_size, dp_ratio);

+ 1 - 1
Source/Core/ElementStyle.h

@@ -154,7 +154,7 @@ private:
 	// Any properties that have been overridden in this element.
 	PropertyDictionary inline_properties;
 	// The definition of this element, provides applicable properties from the stylesheet.
-	std::shared_ptr<ElementDefinition> definition;
+	SharedPtr<ElementDefinition> definition;
 	// Set if a new element definition should be fetched from the style.
 	bool definition_dirty;
 

+ 1 - 1
Source/Core/EventDispatcher.cpp

@@ -110,7 +110,7 @@ void EventDispatcher::DetachAllEvents()
 
 bool EventDispatcher::DispatchEvent(Element* target_element, EventId id, const String& type, const Dictionary& parameters, bool interruptible, bool bubbles, DefaultActionPhase default_action_phase)
 {
-	UniquePtr<Event> event = Factory::InstanceEvent(target_element, id, type, parameters, interruptible);
+	EventPtr event = Factory::InstanceEvent(target_element, id, type, parameters, interruptible);
 	if (!event)
 		return false;
 

+ 2 - 2
Source/Core/EventInstancerDefault.cpp

@@ -41,9 +41,9 @@ EventInstancerDefault::~EventInstancerDefault()
 {
 }
 
-UniquePtr<Event> EventInstancerDefault::InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible)
+EventPtr EventInstancerDefault::InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible)
 {
-	return UniquePtr<Event>(new Event(target, id, type, parameters, interruptible));
+	return EventPtr(new Event(target, id, type, parameters, interruptible));
 }
 
 // Releases an event instanced by this instancer.

+ 1 - 1
Source/Core/EventInstancerDefault.h

@@ -51,7 +51,7 @@ public:
 	/// @param[in] name Name of this event.
 	/// @param[in] parameters Additional parameters for this event.
 	/// @param[in] interruptible If the event propagation can be stopped.
-	UniquePtr<Event> InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible) override;
+	EventPtr InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible) override;
 
 	/// Releases an event instanced by this instancer.
 	/// @param[in] event The event to release.

+ 6 - 6
Source/Core/Factory.cpp

@@ -78,7 +78,7 @@ static EventListenerInstancer* event_listener_instancer = nullptr;
 
 // Default instancers are constructed and destroyed on Initialise and Shutdown, respectively.
 struct DefaultInstancers {
-	template<typename T> using Ptr = std::unique_ptr<T>;
+	template<typename T> using Ptr = UniquePtr<T>;
 
 	Ptr<ContextInstancer> context_default;
 	Ptr<EventInstancer> event_default;
@@ -98,7 +98,7 @@ struct DefaultInstancers {
 	Ptr<FontEffectInstancer> font_effect_outline = std::make_unique<FontEffectOutlineInstancer>();
 };
 
-static std::unique_ptr<DefaultInstancers> default_instancers;
+static UniquePtr<DefaultInstancers> default_instancers;
 
 
 Factory::Factory()
@@ -183,9 +183,9 @@ void Factory::RegisterContextInstancer(ContextInstancer* instancer)
 }
 
 // Instances a new context.
-UniquePtr<Context> Factory::InstanceContext(const String& name)
+ContextPtr Factory::InstanceContext(const String& name)
 {
-	UniquePtr<Context> new_context = context_instancer->InstanceContext(name);
+	ContextPtr new_context = context_instancer->InstanceContext(name);
 	if (new_context)
 		new_context->SetInstancer(context_instancer);
 	return new_context;
@@ -410,9 +410,9 @@ void Factory::RegisterEventInstancer(EventInstancer* instancer)
 }
 
 // Instance an event object.
-UniquePtr<Event> Factory::InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible)
+EventPtr Factory::InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible)
 {
-	UniquePtr<Event> event = event_instancer->InstanceEvent(target, id, type, parameters, interruptible);
+	EventPtr event = event_instancer->InstanceEvent(target, id, type, parameters, interruptible);
 	if (event)
 		event->instancer = event_instancer;
 	return event;

+ 1 - 1
Source/Core/FontEffectOutlineInstancer.cpp

@@ -45,7 +45,7 @@ FontEffectOutlineInstancer::~FontEffectOutlineInstancer()
 }
 
 // Instances an outline font effect.
-std::shared_ptr<FontEffect> FontEffectOutlineInstancer::InstanceFontEffect(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties)
+SharedPtr<FontEffect> FontEffectOutlineInstancer::InstanceFontEffect(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties)
 {
 	RMLUI_UNUSED(name);
 

+ 1 - 1
Source/Core/FontEffectOutlineInstancer.h

@@ -46,7 +46,7 @@ public:
 	FontEffectOutlineInstancer();
 	virtual ~FontEffectOutlineInstancer();
 
-	std::shared_ptr<FontEffect> InstanceFontEffect(const String& name, const PropertyDictionary& properties) override;
+	SharedPtr<FontEffect> InstanceFontEffect(const String& name, const PropertyDictionary& properties) override;
 
 private:
 	PropertyId id_width, id_color;

+ 1 - 1
Source/Core/FontEffectShadowInstancer.cpp

@@ -46,7 +46,7 @@ FontEffectShadowInstancer::~FontEffectShadowInstancer()
 {
 }
 
-std::shared_ptr<FontEffect> FontEffectShadowInstancer::InstanceFontEffect(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties)
+SharedPtr<FontEffect> FontEffectShadowInstancer::InstanceFontEffect(const String& RMLUI_UNUSED_PARAMETER(name), const PropertyDictionary& properties)
 {
 	RMLUI_UNUSED(name);
 

+ 1 - 1
Source/Core/FontEffectShadowInstancer.h

@@ -46,7 +46,7 @@ public:
 	FontEffectShadowInstancer();
 	virtual ~FontEffectShadowInstancer();
 
-	std::shared_ptr<FontEffect> InstanceFontEffect(const String& name, const PropertyDictionary& properties) override;
+	SharedPtr<FontEffect> InstanceFontEffect(const String& name, const PropertyDictionary& properties) override;
 
 private:
 	PropertyId id_offset_x, id_offset_y, id_color;

+ 1 - 1
Source/Core/FontFaceHandle.cpp

@@ -300,7 +300,7 @@ Rml::Core::FontFaceLayer* FontFaceHandle::CreateNewLayer()
 }
 
 // Generates (or shares) a layer derived from a font effect.
-FontFaceLayer* FontFaceHandle::GenerateLayer(const std::shared_ptr<const FontEffect>& font_effect)
+FontFaceLayer* FontFaceHandle::GenerateLayer(const SharedPtr<const FontEffect>& font_effect)
 {
 	// See if this effect has been instanced before, as part of a different configuration.
 	FontLayerMap::iterator i = layers.find(font_effect.get());

+ 1 - 1
Source/Core/FontFaceHandle.h

@@ -119,7 +119,7 @@ protected:
 	virtual int GetKerning(word lhs, word rhs) const = 0;
 	virtual FontFaceLayer* CreateNewLayer();
 
-	FontFaceLayer* GenerateLayer(const std::shared_ptr<const FontEffect>& font_effect);
+	FontFaceLayer* GenerateLayer(const SharedPtr<const FontEffect>& font_effect);
 
 	typedef std::vector< int > GlyphKerningList;
 	typedef std::vector< GlyphKerningList > FontKerningList;

+ 1 - 1
Source/Core/FontFaceLayer.cpp

@@ -44,7 +44,7 @@ FontFaceLayer::~FontFaceLayer()
 }
 
 // Generates the character and texture data for the layer.
-bool FontFaceLayer::Initialise(const FontFaceHandle* _handle, std::shared_ptr<const FontEffect> _effect, const FontFaceLayer* clone, bool deep_clone)
+bool FontFaceLayer::Initialise(const FontFaceHandle* _handle, SharedPtr<const FontEffect> _effect, const FontFaceLayer* clone, bool deep_clone)
 {
 	handle = _handle;
 	effect = _effect;

+ 2 - 2
Source/Core/FontFaceLayer.h

@@ -61,7 +61,7 @@ public:
 	/// @param[in] clone The layer to optionally clone geometry and texture data from.
 	/// @param[in] deep_clone If true, the clones geometry will be completely cloned and the effect will have no option to affect even the glyph origins.
 	/// @return True if the layer was generated successfully, false if not.
-	virtual bool Initialise(const FontFaceHandle* handle, std::shared_ptr<const FontEffect> effect = {}, const FontFaceLayer* clone = NULL, bool deep_clone = false);
+	virtual bool Initialise(const FontFaceHandle* handle, SharedPtr<const FontEffect> effect = {}, const FontFaceLayer* clone = NULL, bool deep_clone = false);
 
 	/// Generates the texture data for a layer (for the texture database).
 	/// @param[out] texture_data The pointer to be set to the generated texture data.
@@ -137,7 +137,7 @@ public:
 	typedef std::vector< Texture > TextureList;
 
 	const FontFaceHandle* handle;
-	std::shared_ptr<const FontEffect> effect;
+	SharedPtr<const FontEffect> effect;
 
 	TextureLayout texture_layout;
 

+ 1 - 1
Source/Core/PropertiesIteratorView.cpp

@@ -35,7 +35,7 @@ namespace Core {
 
 
 
-PropertiesIteratorView::PropertiesIteratorView(std::unique_ptr<PropertiesIterator> ptr) : ptr(std::move(ptr)) {}
+PropertiesIteratorView::PropertiesIteratorView(UniquePtr<PropertiesIterator> ptr) : ptr(std::move(ptr)) {}
 
 PropertiesIteratorView::PropertiesIteratorView(PropertiesIteratorView&& other) : ptr(std::move(other.ptr)) {}
 

+ 3 - 3
Source/Core/PropertyParserTransform.cpp

@@ -49,12 +49,12 @@ bool PropertyParserTransform::ParseValue(Property& property, const String& value
 {
 	if(value == NONE)
 	{
-		property.value = Variant(TransformRef());
+		property.value = Variant(TransformPtr());
 		property.unit = Property::TRANSFORM;
 		return true;
 	}
 
-	std::unique_ptr<Transform> transform(new Transform);
+	UniquePtr<Transform> transform(new Transform);
 
 	char const* next = value.c_str();
 
@@ -176,7 +176,7 @@ bool PropertyParserTransform::ParseValue(Property& property, const String& value
 		}
 	}
 	
-	property.value = Variant(TransformRef(std::move(transform)));
+	property.value = Variant(TransformPtr(std::move(transform)));
 	property.unit = Property::TRANSFORM;
 
 	return true;

+ 1 - 1
Source/Core/PropertySpecification.cpp

@@ -147,7 +147,7 @@ ShorthandId PropertySpecification::RegisterShorthand(const String& shorthand_nam
 		return ShorthandId::Invalid;
 
 	// Construct the new shorthand definition and resolve its properties.
-	std::unique_ptr<ShorthandDefinition> property_shorthand(new ShorthandDefinition());
+	UniquePtr<ShorthandDefinition> property_shorthand(new ShorthandDefinition());
 	for (size_t i = 0; i < id_list.size(); i++)
 	{
 		ShorthandItem item;

+ 3 - 28
Source/Core/StringUtilities.cpp

@@ -148,34 +148,9 @@ void StringUtilities::JoinString(String& string, const StringList& string_list,
 			string += delimiter;
 	}
 }
-	
-// Hashes a string of data to an integer value using the FNV algorithm.
-Hash StringUtilities::FNVHash(const char *string, int length)
-{
-	// FNV-1 hash algorithm
-	Hash hval = 0;
-	unsigned char* bp = (unsigned char *)string;	// start of buffer
-	unsigned char* be = (unsigned char *)string + length;
-	
-	// FNV-1 hash each octet in the buffer
-	while (*bp || (length >= 0 && bp < be)) 
-	{
-		// xor the bottom with the current octet
-		hval ^= *bp++;
-		
-		/* multiply by the 32 bit FNV magic prime mod 2^32 */
-#if !defined(__GNUC__)		
-		const unsigned int FNV_32_PRIME = ((unsigned int)16777619);
-		hval *= FNV_32_PRIME;
-#else
-		hval += (hval<<1) + (hval<<4) + (hval<<7) + (hval<<8) + (hval<<24);
-#endif
-	}
-			 
-	return hval;
-}
-	
-	// Defines, helper functions for the UTF8 / UCS2 conversion functions.
+
+
+// Defines, helper functions for the UTF8 / UCS2 conversion functions.
 #define _NXT	0x80
 #define _SEQ2	0xc0
 #define _SEQ3	0xe0

+ 7 - 7
Source/Core/StyleSheet.cpp

@@ -124,7 +124,7 @@ Keyframes * StyleSheet::GetKeyframes(const String & name)
 	return nullptr;
 }
 
-std::shared_ptr<Decorator> StyleSheet::GetDecorator(const String& name) const
+SharedPtr<Decorator> StyleSheet::GetDecorator(const String& name) const
 {
 	auto it = decorator_map.find(name);
 	if (it == decorator_map.end())
@@ -166,7 +166,7 @@ DecoratorList StyleSheet::InstanceDecoratorsFromString(const String& decorator_s
 		if (invalid_parenthesis)
 		{
 			// We found no parenthesis, that means the value must be a name of a @decorator rule, look it up
-			std::shared_ptr<Decorator> decorator = GetDecorator(decorator_string);
+			SharedPtr<Decorator> decorator = GetDecorator(decorator_string);
 			if (decorator)
 				decorator_list.emplace_back(std::move(decorator));
 			else
@@ -199,7 +199,7 @@ DecoratorList StyleSheet::InstanceDecoratorsFromString(const String& decorator_s
 			// Set unspecified values to their defaults
 			specification.SetPropertyDefaults(properties);
 
-			std::shared_ptr<Decorator> decorator = instancer->InstanceDecorator(type, properties, DecoratorInstancerInterface(*this));
+			SharedPtr<Decorator> decorator = instancer->InstanceDecorator(type, properties, DecoratorInstancerInterface(*this));
 
 			if (decorator)
 				decorator_list.emplace_back(std::move(decorator));
@@ -271,7 +271,7 @@ FontEffectListPtr StyleSheet::InstanceFontEffectsFromString(const String& font_e
 			// Set unspecified values to their defaults
 			specification.SetPropertyDefaults(properties);
 
-			std::shared_ptr<FontEffect> font_effect = instancer->InstanceFontEffect(type, properties);
+			SharedPtr<FontEffect> font_effect = instancer->InstanceFontEffect(type, properties);
 			if (font_effect)
 			{
 				// Create a unique hash value for the given type and values
@@ -293,7 +293,7 @@ FontEffectListPtr StyleSheet::InstanceFontEffectsFromString(const String& font_e
 
 	// Partition the list such that the back layer effects appear before the front layer effects
 	std::stable_partition(font_effect_list.begin(), font_effect_list.end(), 
-		[](const std::shared_ptr<const FontEffect>& effect) { return effect->GetLayer() == FontEffect::Layer::Back; }
+		[](const SharedPtr<const FontEffect>& effect) { return effect->GetLayer() == FontEffect::Layer::Back; }
 	);
 
 	return std::make_shared<FontEffectList>(std::move(font_effect_list));
@@ -301,7 +301,7 @@ FontEffectListPtr StyleSheet::InstanceFontEffectsFromString(const String& font_e
 
 
 // Returns the compiled element definition for a given element hierarchy.
-std::shared_ptr<ElementDefinition> StyleSheet::GetElementDefinition(const Element* element) const
+SharedPtr<ElementDefinition> StyleSheet::GetElementDefinition(const Element* element) const
 {
 	RMLUI_ASSERT_NONRECURSIVE;
 
@@ -346,7 +346,7 @@ std::shared_ptr<ElementDefinition> StyleSheet::GetElementDefinition(const Elemen
 	auto cache_iterator = node_cache.find(seed);
 	if (cache_iterator != node_cache.end())
 	{
-		std::shared_ptr<ElementDefinition>& definition = (*cache_iterator).second;
+		SharedPtr<ElementDefinition>& definition = (*cache_iterator).second;
 		applicable_nodes.clear();
 		return definition;
 	}

+ 1 - 1
Source/Core/StyleSheetParser.cpp

@@ -307,7 +307,7 @@ bool StyleSheetParser::ParseDecoratorBlock(const String& at_name, DecoratorSpeci
 	// Set non-defined properties to their defaults
 	property_specification.SetPropertyDefaults(properties);
 
-	std::shared_ptr<Decorator> decorator = decorator_instancer->InstanceDecorator(decorator_type, properties, DecoratorInstancerInterface(style_sheet));
+	SharedPtr<Decorator> decorator = decorator_instancer->InstanceDecorator(decorator_type, properties, DecoratorInstancerInterface(style_sheet));
 	if (!decorator)
 	{
 		Log::Message(Log::LT_WARNING, "Could not instance decorator of type '%s' declared at %s:%d.", decorator_type.c_str(), stream_file_name.c_str(), line_number);

+ 1 - 1
Source/Core/Template.h

@@ -67,7 +67,7 @@ private:
 	String name;
 	String content;
 	DocumentHeader header;
-	std::unique_ptr<StreamMemory> body;
+	UniquePtr<StreamMemory> body;
 };
 
 }

+ 1 - 1
Source/Core/Transform.cpp

@@ -48,7 +48,7 @@ Transform::Transform(std::vector<Transforms::Primitive> primitives)
 
 Property Transform::MakeProperty(std::vector<Transforms::Primitive> primitives)
 {
-	Property p{ TransformRef{new Transform{primitives}}, Property::TRANSFORM };
+	Property p{ TransformPtr{new Transform{primitives}}, Property::TRANSFORM };
 	p.definition = StyleSheetSpecification::GetProperty(TRANSFORM);
 	return p;
 }

+ 2 - 2
Source/Core/TypeConverter.cpp

@@ -34,13 +34,13 @@
 namespace Rml {
 namespace Core {
 
-bool TypeConverter<TransformRef, TransformRef>::Convert(const TransformRef& src, TransformRef& dest)
+bool TypeConverter<TransformPtr, TransformPtr>::Convert(const TransformPtr& src, TransformPtr& dest)
 {
 	dest = src;
 	return true;
 }
 
-bool TypeConverter<TransformRef, String>::Convert(const TransformRef& src, String& dest)
+bool TypeConverter<TransformPtr, String>::Convert(const TransformPtr& src, String& dest)
 {
 	if (src)
 	{

+ 12 - 12
Source/Core/Variant.cpp

@@ -39,7 +39,7 @@ Variant::Variant() : type(NONE)
 	static_assert(sizeof(Colourf) <= LOCAL_DATA_SIZE, "Local data too small for Colourf");
 	static_assert(sizeof(Vector4f) <= LOCAL_DATA_SIZE, "Local data too small for Vector4f");
 	static_assert(sizeof(String) <= LOCAL_DATA_SIZE, "Local data too small for String");
-	static_assert(sizeof(TransformRef) <= LOCAL_DATA_SIZE, "Local data too small for TransformRef");
+	static_assert(sizeof(TransformPtr) <= LOCAL_DATA_SIZE, "Local data too small for TransformPtr");
 	static_assert(sizeof(TransitionList) <= LOCAL_DATA_SIZE, "Local data too small for TransitionList");
 	static_assert(sizeof(AnimationList) <= LOCAL_DATA_SIZE, "Local data too small for AnimationList");
 	static_assert(sizeof(DecoratorList) <= LOCAL_DATA_SIZE, "Local data too small for DecoratorList");
@@ -76,8 +76,8 @@ void Variant::Clear()
 		case TRANSFORMREF:
 		{
 			// Clean up the transform.
-			TransformRef* transform = (TransformRef*)data;
-			transform->~TransformRef();
+			TransformPtr* transform = (TransformPtr*)data;
+			transform->~TransformPtr();
 		}
 		break;
 		case TRANSITIONLIST:
@@ -129,7 +129,7 @@ void Variant::Set(const Variant& copy)
 		break;
 
 	case TRANSFORMREF:
-		Set(*(TransformRef*)copy.data);
+		Set(*(TransformPtr*)copy.data);
 		break;
 
 	case TRANSITIONLIST:
@@ -165,7 +165,7 @@ void Variant::Set(Variant&& other)
 		break;
 
 	case TRANSFORMREF:
-		Set(std::move(*(TransformRef*)other.data));
+		Set(std::move(*(TransformPtr*)other.data));
 		break;
 
 	case TRANSITIONLIST:
@@ -296,28 +296,28 @@ void Variant::Set(String&& value)
 }
 
 
-void Variant::Set(const TransformRef& value)
+void Variant::Set(const TransformPtr& value)
 {
 	if (type == TRANSFORMREF)
 	{
-		SET_VARIANT(TransformRef);
+		SET_VARIANT(TransformPtr);
 	}
 	else
 	{
 		type = TRANSFORMREF;
-		new(data) TransformRef(value);
+		new(data) TransformPtr(value);
 	}
 }
-void Variant::Set(TransformRef&& value)
+void Variant::Set(TransformPtr&& value)
 {
 	if (type == TRANSFORMREF)
 	{
-		(*(TransformRef*)data) = std::move(value);
+		(*(TransformPtr*)data) = std::move(value);
 	}
 	else
 	{
 		type = TRANSFORMREF;
-		new(data) TransformRef(std::move(value));
+		new(data) TransformPtr(std::move(value));
 	}
 }
 
@@ -472,7 +472,7 @@ bool Variant::operator==(const Variant & other) const
 	case VOIDPTR:
 		return DEFAULT_VARIANT_COMPARE(void*);
 	case TRANSFORMREF:
-		return DEFAULT_VARIANT_COMPARE(TransformRef);
+		return DEFAULT_VARIANT_COMPARE(TransformPtr);
 	case TRANSITIONLIST:
 		return DEFAULT_VARIANT_COMPARE(TransitionList);
 	case ANIMATIONLIST: