浏览代码

Make decorator list and font effect list use const pointers.

Michael Ragazzon 6 年之前
父节点
当前提交
7f27fc88d1
共有 33 个文件被更改,包括 82 次插入82 次删除
  1. 3 3
      Include/RmlUi/Core/Decorator.h
  2. 2 2
      Include/RmlUi/Core/Types.h
  3. 3 3
      Samples/invaders/src/DecoratorDefender.cpp
  4. 3 3
      Samples/invaders/src/DecoratorDefender.h
  5. 3 3
      Samples/invaders/src/DecoratorStarfield.cpp
  6. 3 3
      Samples/invaders/src/DecoratorStarfield.h
  7. 3 3
      Samples/luainvaders/src/DecoratorDefender.cpp
  8. 3 3
      Samples/luainvaders/src/DecoratorDefender.h
  9. 3 3
      Samples/luainvaders/src/DecoratorStarfield.cpp
  10. 3 3
      Samples/luainvaders/src/DecoratorStarfield.h
  11. 3 3
      Samples/tutorial/datagrid/src/DecoratorDefender.cpp
  12. 3 3
      Samples/tutorial/datagrid/src/DecoratorDefender.h
  13. 3 3
      Samples/tutorial/datagrid_tree/src/DecoratorDefender.cpp
  14. 3 3
      Samples/tutorial/datagrid_tree/src/DecoratorDefender.h
  15. 1 1
      Source/Core/BitmapFont/FontFaceLayer.cpp
  16. 1 1
      Source/Core/BitmapFont/FontFaceLayer.h
  17. 3 3
      Source/Core/DecoratorTiled.cpp
  18. 3 3
      Source/Core/DecoratorTiled.h
  19. 3 3
      Source/Core/DecoratorTiledBox.cpp
  20. 3 3
      Source/Core/DecoratorTiledBox.h
  21. 3 3
      Source/Core/DecoratorTiledHorizontal.cpp
  22. 3 3
      Source/Core/DecoratorTiledHorizontal.h
  23. 3 3
      Source/Core/DecoratorTiledImage.cpp
  24. 3 3
      Source/Core/DecoratorTiledImage.h
  25. 3 3
      Source/Core/DecoratorTiledVertical.cpp
  26. 3 3
      Source/Core/DecoratorTiledVertical.h
  27. 1 1
      Source/Core/ElementDecoration.cpp
  28. 2 2
      Source/Core/ElementDecoration.h
  29. 1 1
      Source/Core/FontFaceHandle.cpp
  30. 1 1
      Source/Core/FontFaceHandle.h
  31. 1 1
      Source/Core/FontFaceLayer.cpp
  32. 2 2
      Source/Core/FontFaceLayer.h
  33. 1 1
      Source/Core/StyleSheet.cpp

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

@@ -59,15 +59,15 @@ public:
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// @param[in] element The newly decorated element.
 	/// @param[in] element The newly decorated element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
-	virtual DecoratorDataHandle GenerateElementData(Element* element) = 0;
+	virtual DecoratorDataHandle GenerateElementData(Element* element) const = 0;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
 	/// @param[in] element_data The element data handle to release.
 	/// @param[in] element_data The element data handle to release.
-	virtual void ReleaseElementData(DecoratorDataHandle element_data) = 0;
+	virtual void ReleaseElementData(DecoratorDataHandle element_data) const = 0;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
 	/// @param[in] element The element to render the decorator on.
 	/// @param[in] element The element to render the decorator on.
 	/// @param[in] element_data The handle to the data generated by the decorator for the element.
 	/// @param[in] element_data The handle to the data generated by the decorator for the element.
-	virtual void RenderElement(Element* element, DecoratorDataHandle element_data) = 0;
+	virtual void RenderElement(Element* element, DecoratorDataHandle element_data) const = 0;
 
 
 	/// Value specifying an invalid or non-existent Decorator data handle.
 	/// Value specifying an invalid or non-existent Decorator data handle.
 	static const DecoratorDataHandle INVALID_DECORATORDATAHANDLE = 0;
 	static const DecoratorDataHandle INVALID_DECORATORDATAHANDLE = 0;

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

@@ -147,8 +147,8 @@ typedef std::shared_ptr< Transform > TransformRef;
 struct Transition;
 struct Transition;
 struct TransitionList;
 struct TransitionList;
 
 
-using DecoratorList = std::vector<std::shared_ptr<Decorator>>;
-using FontEffectList = std::vector<std::shared_ptr<FontEffect>>;
+using DecoratorList = std::vector<std::shared_ptr<const Decorator>>;
+using FontEffectList = std::vector<std::shared_ptr<const FontEffect>>;
 using AnimationList = std::vector<Animation>;
 using AnimationList = std::vector<Animation>;
 
 
 }
 }

+ 3 - 3
Samples/invaders/src/DecoratorDefender.cpp

@@ -48,7 +48,7 @@ bool DecoratorDefender::Initialise(const Rml::Core::String& image_source, const
 }
 }
 
 
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
-Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element))
+Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element)) const
 {
 {
 	RMLUI_UNUSED(element);
 	RMLUI_UNUSED(element);
 
 
@@ -56,13 +56,13 @@ Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core:
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorDefender::ReleaseElementData(Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data))
+void DecoratorDefender::ReleaseElementData(Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data)) const
 {
 {
 	RMLUI_UNUSED(element_data);
 	RMLUI_UNUSED(element_data);
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorDefender::RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data))
+void DecoratorDefender::RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data)) const
 {
 {
 	RMLUI_UNUSED(element_data);
 	RMLUI_UNUSED(element_data);
 
 

+ 3 - 3
Samples/invaders/src/DecoratorDefender.h

@@ -41,15 +41,15 @@ public:
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// @param element[in] The newly decorated element.
 	/// @param element[in] The newly decorated element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
-	virtual Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element);
+	Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
 	/// @param element_data[in] The element data handle to release.
 	/// @param element_data[in] The element data handle to release.
-	virtual void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data);
+	void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
 	/// @param element[in] The element to render the decorator on.
 	/// @param element[in] The element to render the decorator on.
 	/// @param element_data[in] The handle to the data generated by the decorator for the element.
 	/// @param element_data[in] The handle to the data generated by the decorator for the element.
-	virtual void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data);
+	void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	int image_index;
 	int image_index;

+ 3 - 3
Samples/invaders/src/DecoratorStarfield.cpp

@@ -53,7 +53,7 @@ bool DecoratorStarfield::Initialise(int _num_layers, const Rml::Core::Colourb& _
 }
 }
 
 
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
-Rml::Core::DecoratorDataHandle DecoratorStarfield::GenerateElementData(Rml::Core::Element* element)
+Rml::Core::DecoratorDataHandle DecoratorStarfield::GenerateElementData(Rml::Core::Element* element) const
 {
 {
 	StarField* star_field = new StarField();
 	StarField* star_field = new StarField();
 
 
@@ -90,13 +90,13 @@ Rml::Core::DecoratorDataHandle DecoratorStarfield::GenerateElementData(Rml::Core
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorStarfield::ReleaseElementData(Rml::Core::DecoratorDataHandle element_data)
+void DecoratorStarfield::ReleaseElementData(Rml::Core::DecoratorDataHandle element_data) const
 {
 {
 	delete reinterpret_cast<StarField*>(element_data);
 	delete reinterpret_cast<StarField*>(element_data);
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorStarfield::RenderElement(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element), Rml::Core::DecoratorDataHandle element_data)
+void DecoratorStarfield::RenderElement(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element), Rml::Core::DecoratorDataHandle element_data) const
 {
 {
 	RMLUI_UNUSED(element);
 	RMLUI_UNUSED(element);
 
 

+ 3 - 3
Samples/invaders/src/DecoratorStarfield.h

@@ -42,15 +42,15 @@ public:
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// @param[in] element The newly decorated element.
 	/// @param[in] element The newly decorated element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
-	virtual Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element);
+	Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
 	/// @param[in] element_data The element data handle to release.
 	/// @param[in] element_data The element data handle to release.
-	virtual void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data);
+	void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
 	/// @param[in] element The element to render the decorator on.
 	/// @param[in] element The element to render the decorator on.
 	/// @param[in] element_data The handle to the data generated by the decorator for the element.
 	/// @param[in] element_data The handle to the data generated by the decorator for the element.
-	virtual void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data);
+	void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	int num_layers;
 	int num_layers;

+ 3 - 3
Samples/luainvaders/src/DecoratorDefender.cpp

@@ -48,7 +48,7 @@ bool DecoratorDefender::Initialise(const Rml::Core::String& image_source, const
 }
 }
 
 
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
-Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element))
+Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element)) const
 {
 {
 	RMLUI_UNUSED(element);
 	RMLUI_UNUSED(element);
 
 
@@ -56,13 +56,13 @@ Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core:
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorDefender::ReleaseElementData(Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data))
+void DecoratorDefender::ReleaseElementData(Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data)) const
 {
 {
 	RMLUI_UNUSED(element_data);
 	RMLUI_UNUSED(element_data);
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorDefender::RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data))
+void DecoratorDefender::RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data)) const
 {
 {
 	RMLUI_UNUSED(element_data);
 	RMLUI_UNUSED(element_data);
 
 

+ 3 - 3
Samples/luainvaders/src/DecoratorDefender.h

@@ -41,15 +41,15 @@ public:
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// @param element[in] The newly decorated element.
 	/// @param element[in] The newly decorated element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
-	virtual Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element);
+	Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
 	/// @param element_data[in] The element data handle to release.
 	/// @param element_data[in] The element data handle to release.
-	virtual void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data);
+	void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
 	/// @param element[in] The element to render the decorator on.
 	/// @param element[in] The element to render the decorator on.
 	/// @param element_data[in] The handle to the data generated by the decorator for the element.
 	/// @param element_data[in] The handle to the data generated by the decorator for the element.
-	virtual void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data);
+	void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	int image_index;
 	int image_index;

+ 3 - 3
Samples/luainvaders/src/DecoratorStarfield.cpp

@@ -53,7 +53,7 @@ bool DecoratorStarfield::Initialise(int _num_layers, const Rml::Core::Colourb& _
 }
 }
 
 
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
-Rml::Core::DecoratorDataHandle DecoratorStarfield::GenerateElementData(Rml::Core::Element* element)
+Rml::Core::DecoratorDataHandle DecoratorStarfield::GenerateElementData(Rml::Core::Element* element) const
 {
 {
 	StarField* star_field = new StarField();
 	StarField* star_field = new StarField();
 
 
@@ -90,13 +90,13 @@ Rml::Core::DecoratorDataHandle DecoratorStarfield::GenerateElementData(Rml::Core
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorStarfield::ReleaseElementData(Rml::Core::DecoratorDataHandle element_data)
+void DecoratorStarfield::ReleaseElementData(Rml::Core::DecoratorDataHandle element_data) const
 {
 {
 	delete (StarField*)element_data;
 	delete (StarField*)element_data;
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorStarfield::RenderElement(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element), Rml::Core::DecoratorDataHandle element_data)
+void DecoratorStarfield::RenderElement(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element), Rml::Core::DecoratorDataHandle element_data) const
 {
 {
 	RMLUI_UNUSED(element);
 	RMLUI_UNUSED(element);
 
 

+ 3 - 3
Samples/luainvaders/src/DecoratorStarfield.h

@@ -42,15 +42,15 @@ public:
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// @param[in] element The newly decorated element.
 	/// @param[in] element The newly decorated element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
-	virtual Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element);
+	Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
 	/// @param[in] element_data The element data handle to release.
 	/// @param[in] element_data The element data handle to release.
-	virtual void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data);
+	void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
 	/// @param[in] element The element to render the decorator on.
 	/// @param[in] element The element to render the decorator on.
 	/// @param[in] element_data The handle to the data generated by the decorator for the element.
 	/// @param[in] element_data The handle to the data generated by the decorator for the element.
-	virtual void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data);
+	void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	int num_layers;
 	int num_layers;

+ 3 - 3
Samples/tutorial/datagrid/src/DecoratorDefender.cpp

@@ -31,7 +31,7 @@ bool DecoratorDefender::Initialise(const Rml::Core::String& image_source, const
 }
 }
 
 
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
-Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element))
+Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element)) const
 {
 {
 	RMLUI_UNUSED(element);
 	RMLUI_UNUSED(element);
 
 
@@ -39,13 +39,13 @@ Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core:
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorDefender::ReleaseElementData(Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data))
+void DecoratorDefender::ReleaseElementData(Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data)) const
 {
 {
 	RMLUI_UNUSED(element_data);
 	RMLUI_UNUSED(element_data);
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorDefender::RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data))
+void DecoratorDefender::RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data)) const
 {
 {
 	RMLUI_UNUSED(element_data);
 	RMLUI_UNUSED(element_data);
 
 

+ 3 - 3
Samples/tutorial/datagrid/src/DecoratorDefender.h

@@ -29,15 +29,15 @@ public:
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// @param element[in] The newly decorated element.
 	/// @param element[in] The newly decorated element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
-	virtual Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element);
+	Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
 	/// @param element_data[in] The element data handle to release.
 	/// @param element_data[in] The element data handle to release.
-	virtual void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data);
+	void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
 	/// @param element[in] The element to render the decorator on.
 	/// @param element[in] The element to render the decorator on.
 	/// @param element_data[in] The handle to the data generated by the decorator for the element.
 	/// @param element_data[in] The handle to the data generated by the decorator for the element.
-	virtual void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data);
+	void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	int image_index;
 	int image_index;

+ 3 - 3
Samples/tutorial/datagrid_tree/src/DecoratorDefender.cpp

@@ -31,7 +31,7 @@ bool DecoratorDefender::Initialise(const Rml::Core::String& image_source, const
 }
 }
 
 
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
 /// Called on a decorator to generate any required per-element data for a newly decorated element.
-Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element))
+Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core::Element* RMLUI_UNUSED_PARAMETER(element)) const
 {
 {
 	RMLUI_UNUSED(element);
 	RMLUI_UNUSED(element);
 
 
@@ -39,13 +39,13 @@ Rml::Core::DecoratorDataHandle DecoratorDefender::GenerateElementData(Rml::Core:
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorDefender::ReleaseElementData(Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data))
+void DecoratorDefender::ReleaseElementData(Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data)) const
 {
 {
 	RMLUI_UNUSED(element_data);
 	RMLUI_UNUSED(element_data);
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorDefender::RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data))
+void DecoratorDefender::RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle RMLUI_UNUSED_PARAMETER(element_data)) const
 {
 {
 	RMLUI_UNUSED(element_data);
 	RMLUI_UNUSED(element_data);
 
 

+ 3 - 3
Samples/tutorial/datagrid_tree/src/DecoratorDefender.h

@@ -29,15 +29,15 @@ public:
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// @param element[in] The newly decorated element.
 	/// @param element[in] The newly decorated element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
 	/// @return A handle to a decorator-defined data handle, or NULL if none is needed for the element.
-	virtual Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element);
+	Rml::Core::DecoratorDataHandle GenerateElementData(Rml::Core::Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
 	/// @param element_data[in] The element data handle to release.
 	/// @param element_data[in] The element data handle to release.
-	virtual void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data);
+	void ReleaseElementData(Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
 	/// @param element[in] The element to render the decorator on.
 	/// @param element[in] The element to render the decorator on.
 	/// @param element_data[in] The handle to the data generated by the decorator for the element.
 	/// @param element_data[in] The handle to the data generated by the decorator for the element.
-	virtual void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data);
+	void RenderElement(Rml::Core::Element* element, Rml::Core::DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	int image_index;
 	int image_index;

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

@@ -45,7 +45,7 @@ FontFaceLayer::~FontFaceLayer()
 }
 }
 
 
 // Generates the character and texture data for the layer.
 // Generates the character and texture data for the layer.
-bool FontFaceLayer::Initialise(const Rml::Core::FontFaceHandle* _handle, std::shared_ptr<FontEffect> _effect, const Rml::Core::FontFaceLayer* clone, bool deep_clone)
+bool FontFaceLayer::Initialise(const Rml::Core::FontFaceHandle* _handle, std::shared_ptr<const FontEffect> _effect, const Rml::Core::FontFaceLayer* clone, bool deep_clone)
 {
 {
 	(void)(_effect);
 	(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] 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.
 	/// @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.
 	/// @return True if the layer was generated successfully, false if not.
-	bool Initialise(const Rml::Core::FontFaceHandle* handle, std::shared_ptr<FontEffect> effect, const Rml::Core::FontFaceLayer* clone = NULL, bool deep_clone = false) override;
+	bool Initialise(const Rml::Core::FontFaceHandle* handle, std::shared_ptr<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).
 	/// 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.
 	/// @param[out] texture_data The pointer to be set to the generated texture data.

+ 3 - 3
Source/Core/DecoratorTiled.cpp

@@ -63,7 +63,7 @@ DecoratorTiled::Tile::Tile() : position(0, 0), size(1, 1)
 
 
 
 
 // Calculates the tile's dimensions from the texture and texture coordinates.
 // Calculates the tile's dimensions from the texture and texture coordinates.
-void DecoratorTiled::Tile::CalculateDimensions(Element* element, const Texture& texture)
+void DecoratorTiled::Tile::CalculateDimensions(Element* element, const Texture& texture) const
 {
 {
 	RenderInterface* render_interface = element->GetRenderInterface();
 	RenderInterface* render_interface = element->GetRenderInterface();
 	auto data_iterator = data.find(render_interface);
 	auto data_iterator = data.find(render_interface);
@@ -105,7 +105,7 @@ void DecoratorTiled::Tile::CalculateDimensions(Element* element, const Texture&
 }
 }
 
 
 // Get this tile's dimensions.
 // Get this tile's dimensions.
-Vector2f DecoratorTiled::Tile::GetDimensions(Element* element)
+Vector2f DecoratorTiled::Tile::GetDimensions(Element* element) const
 {
 {
 	RenderInterface* render_interface = element->GetRenderInterface();
 	RenderInterface* render_interface = element->GetRenderInterface();
 	auto data_iterator = data.find(render_interface);
 	auto data_iterator = data.find(render_interface);
@@ -275,7 +275,7 @@ void DecoratorTiled::Tile::GenerateGeometry(std::vector< Vertex >& vertices, std
 }
 }
 
 
 // Scales a tile dimensions by a fixed value along one axis.
 // Scales a tile dimensions by a fixed value along one axis.
-void DecoratorTiled::ScaleTileDimensions(Vector2f& tile_dimensions, float axis_value, int axis)
+void DecoratorTiled::ScaleTileDimensions(Vector2f& tile_dimensions, float axis_value, int axis) const
 {
 {
 	if (tile_dimensions[axis] != axis_value)
 	if (tile_dimensions[axis] != axis_value)
 	{
 	{

+ 3 - 3
Source/Core/DecoratorTiled.h

@@ -87,9 +87,9 @@ public:
 		Tile();
 		Tile();
 
 
 		/// Calculates the tile's dimensions from the texture and texture coordinates.
 		/// Calculates the tile's dimensions from the texture and texture coordinates.
-		void CalculateDimensions(Element* element, const Texture& texture);
+		void CalculateDimensions(Element* element, const Texture& texture) const;
 		/// Get this tile's dimensions.
 		/// Get this tile's dimensions.
-		Vector2f GetDimensions(Element* element);
+		Vector2f GetDimensions(Element* element) const;
 
 
 		/// Generates geometry to render this tile across a surface.
 		/// Generates geometry to render this tile across a surface.
 		/// @param[out] vertices The array to store the generated vertex data.
 		/// @param[out] vertices The array to store the generated vertex data.
@@ -127,7 +127,7 @@ protected:
 	/// @param tile_dimensions[in, out] The tile dimensions to scale.
 	/// @param tile_dimensions[in, out] The tile dimensions to scale.
 	/// @param axis_value[in] The fixed value to scale against.
 	/// @param axis_value[in] The fixed value to scale against.
 	/// @param axis[in] The axis to scale against; either 0 (for x) or 1 (for y).
 	/// @param axis[in] The axis to scale against; either 0 (for x) or 1 (for y).
-	void ScaleTileDimensions(Vector2f& tile_dimensions, float axis_value, int axis);
+	void ScaleTileDimensions(Vector2f& tile_dimensions, float axis_value, int axis) const;
 };
 };
 
 
 }
 }

+ 3 - 3
Source/Core/DecoratorTiledBox.cpp

@@ -106,7 +106,7 @@ bool DecoratorTiledBox::Initialise(const Tile* _tiles, const Texture* _textures)
 }
 }
 
 
 // Called on a decorator to generate any required per-element data for a newly decorated element.
 // Called on a decorator to generate any required per-element data for a newly decorated element.
-DecoratorDataHandle DecoratorTiledBox::GenerateElementData(Element* element)
+DecoratorDataHandle DecoratorTiledBox::GenerateElementData(Element* element) const
 {
 {
 	// Initialise the tiles for this element.
 	// Initialise the tiles for this element.
 	for (int i = 0; i < 9; i++)
 	for (int i = 0; i < 9; i++)
@@ -278,13 +278,13 @@ DecoratorDataHandle DecoratorTiledBox::GenerateElementData(Element* element)
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorTiledBox::ReleaseElementData(DecoratorDataHandle element_data)
+void DecoratorTiledBox::ReleaseElementData(DecoratorDataHandle element_data) const
 {
 {
 	delete reinterpret_cast< DecoratorTiledBoxData* >(element_data);
 	delete reinterpret_cast< DecoratorTiledBoxData* >(element_data);
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorTiledBox::RenderElement(Element* element, DecoratorDataHandle element_data)
+void DecoratorTiledBox::RenderElement(Element* element, DecoratorDataHandle element_data) const
 {
 {
 	Vector2f translation = element->GetAbsoluteOffset(Box::PADDING).Round();
 	Vector2f translation = element->GetAbsoluteOffset(Box::PADDING).Round();
 	DecoratorTiledBoxData* data = reinterpret_cast< DecoratorTiledBoxData* >(element_data);
 	DecoratorTiledBoxData* data = reinterpret_cast< DecoratorTiledBoxData* >(element_data);

+ 3 - 3
Source/Core/DecoratorTiledBox.h

@@ -51,12 +51,12 @@ public:
 	bool Initialise(const Tile* tiles, const Texture* textures);
 	bool Initialise(const Tile* tiles, const Texture* textures);
 
 
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
-	virtual DecoratorDataHandle GenerateElementData(Element* element);
+	DecoratorDataHandle GenerateElementData(Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
-	virtual void ReleaseElementData(DecoratorDataHandle element_data);
+	void ReleaseElementData(DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
-	virtual void RenderElement(Element* element, DecoratorDataHandle element_data);
+	void RenderElement(Element* element, DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	enum
 	enum

+ 3 - 3
Source/Core/DecoratorTiledHorizontal.cpp

@@ -91,7 +91,7 @@ bool DecoratorTiledHorizontal::Initialise(const Tile* _tiles, const Texture* _te
 }
 }
 
 
 // Called on a decorator to generate any required per-element data for a newly decorated element.
 // Called on a decorator to generate any required per-element data for a newly decorated element.
-DecoratorDataHandle DecoratorTiledHorizontal::GenerateElementData(Element* element)
+DecoratorDataHandle DecoratorTiledHorizontal::GenerateElementData(Element* element) const
 {
 {
 	// Initialise the tiles for this element.
 	// Initialise the tiles for this element.
 	for (int i = 0; i < 3; i++)
 	for (int i = 0; i < 3; i++)
@@ -135,13 +135,13 @@ DecoratorDataHandle DecoratorTiledHorizontal::GenerateElementData(Element* eleme
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorTiledHorizontal::ReleaseElementData(DecoratorDataHandle element_data)
+void DecoratorTiledHorizontal::ReleaseElementData(DecoratorDataHandle element_data) const
 {
 {
 	delete reinterpret_cast< DecoratorTiledHorizontalData* >(element_data);
 	delete reinterpret_cast< DecoratorTiledHorizontalData* >(element_data);
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorTiledHorizontal::RenderElement(Element* element, DecoratorDataHandle element_data)
+void DecoratorTiledHorizontal::RenderElement(Element* element, DecoratorDataHandle element_data) const
 {
 {
 	Vector2f translation = element->GetAbsoluteOffset(Box::PADDING).Round();
 	Vector2f translation = element->GetAbsoluteOffset(Box::PADDING).Round();
 	DecoratorTiledHorizontalData* data = reinterpret_cast< DecoratorTiledHorizontalData* >(element_data);
 	DecoratorTiledHorizontalData* data = reinterpret_cast< DecoratorTiledHorizontalData* >(element_data);

+ 3 - 3
Source/Core/DecoratorTiledHorizontal.h

@@ -51,12 +51,12 @@ public:
 	bool Initialise(const Tile* tiles, const Texture* textures);
 	bool Initialise(const Tile* tiles, const Texture* textures);
 
 
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
-	virtual DecoratorDataHandle GenerateElementData(Element* element);
+	DecoratorDataHandle GenerateElementData(Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
-	virtual void ReleaseElementData(DecoratorDataHandle element_data);
+	void ReleaseElementData(DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
-	virtual void RenderElement(Element* element, DecoratorDataHandle element_data);
+	void RenderElement(Element* element, DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	enum
 	enum

+ 3 - 3
Source/Core/DecoratorTiledImage.cpp

@@ -51,7 +51,7 @@ bool DecoratorTiledImage::Initialise(const Tile& _tile, const Texture& _texture)
 }
 }
 
 
 // Called on a decorator to generate any required per-element data for a newly decorated element.
 // Called on a decorator to generate any required per-element data for a newly decorated element.
-DecoratorDataHandle DecoratorTiledImage::GenerateElementData(Element* element)
+DecoratorDataHandle DecoratorTiledImage::GenerateElementData(Element* element) const
 {
 {
 	// Calculate the tile's dimensions for this element.
 	// Calculate the tile's dimensions for this element.
 	tile.CalculateDimensions(element, *GetTexture(tile.texture_index));
 	tile.CalculateDimensions(element, *GetTexture(tile.texture_index));
@@ -66,13 +66,13 @@ DecoratorDataHandle DecoratorTiledImage::GenerateElementData(Element* element)
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorTiledImage::ReleaseElementData(DecoratorDataHandle element_data)
+void DecoratorTiledImage::ReleaseElementData(DecoratorDataHandle element_data) const
 {
 {
 	delete reinterpret_cast< Geometry* >(element_data);
 	delete reinterpret_cast< Geometry* >(element_data);
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorTiledImage::RenderElement(Element* element, DecoratorDataHandle element_data)
+void DecoratorTiledImage::RenderElement(Element* element, DecoratorDataHandle element_data) const
 {
 {
 	Geometry* data = reinterpret_cast< Geometry* >(element_data);
 	Geometry* data = reinterpret_cast< Geometry* >(element_data);
 	data->Render(element->GetAbsoluteOffset(Box::PADDING).Round());
 	data->Render(element->GetAbsoluteOffset(Box::PADDING).Round());

+ 3 - 3
Source/Core/DecoratorTiledImage.h

@@ -51,12 +51,12 @@ public:
 	bool Initialise(const Tile& tile, const Texture& texture);
 	bool Initialise(const Tile& tile, const Texture& texture);
 
 
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
-	virtual DecoratorDataHandle GenerateElementData(Element* element);
+	DecoratorDataHandle GenerateElementData(Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
-	virtual void ReleaseElementData(DecoratorDataHandle element_data);
+	void ReleaseElementData(DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
-	virtual void RenderElement(Element* element, DecoratorDataHandle element_data);
+	void RenderElement(Element* element, DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	Tile tile;
 	Tile tile;

+ 3 - 3
Source/Core/DecoratorTiledVertical.cpp

@@ -92,7 +92,7 @@ bool DecoratorTiledVertical::Initialise(const Tile* _tiles, const Texture* _text
 }
 }
 
 
 // Called on a decorator to generate any required per-element data for a newly decorated element.
 // Called on a decorator to generate any required per-element data for a newly decorated element.
-DecoratorDataHandle DecoratorTiledVertical::GenerateElementData(Element* element)
+DecoratorDataHandle DecoratorTiledVertical::GenerateElementData(Element* element) const
 {
 {
 	// Initialise the tile for this element.
 	// Initialise the tile for this element.
 	for (int i = 0; i < 3; i++)
 	for (int i = 0; i < 3; i++)
@@ -136,13 +136,13 @@ DecoratorDataHandle DecoratorTiledVertical::GenerateElementData(Element* element
 }
 }
 
 
 // Called to release element data generated by this decorator.
 // Called to release element data generated by this decorator.
-void DecoratorTiledVertical::ReleaseElementData(DecoratorDataHandle element_data)
+void DecoratorTiledVertical::ReleaseElementData(DecoratorDataHandle element_data) const
 {
 {
 	delete reinterpret_cast< DecoratorTiledVerticalData* >(element_data);
 	delete reinterpret_cast< DecoratorTiledVerticalData* >(element_data);
 }
 }
 
 
 // Called to render the decorator on an element.
 // Called to render the decorator on an element.
-void DecoratorTiledVertical::RenderElement(Element* element, DecoratorDataHandle element_data)
+void DecoratorTiledVertical::RenderElement(Element* element, DecoratorDataHandle element_data) const
 {
 {
 	Vector2f translation = element->GetAbsoluteOffset(Box::PADDING);
 	Vector2f translation = element->GetAbsoluteOffset(Box::PADDING);
 	DecoratorTiledVerticalData* data = reinterpret_cast< DecoratorTiledVerticalData* >(element_data);
 	DecoratorTiledVerticalData* data = reinterpret_cast< DecoratorTiledVerticalData* >(element_data);

+ 3 - 3
Source/Core/DecoratorTiledVertical.h

@@ -51,12 +51,12 @@ public:
 	bool Initialise(const Tile* tiles, const Texture* textures);
 	bool Initialise(const Tile* tiles, const Texture* textures);
 
 
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
 	/// Called on a decorator to generate any required per-element data for a newly decorated element.
-	virtual DecoratorDataHandle GenerateElementData(Element* element);
+	DecoratorDataHandle GenerateElementData(Element* element) const override;
 	/// Called to release element data generated by this decorator.
 	/// Called to release element data generated by this decorator.
-	virtual void ReleaseElementData(DecoratorDataHandle element_data);
+	void ReleaseElementData(DecoratorDataHandle element_data) const override;
 
 
 	/// Called to render the decorator on an element.
 	/// Called to render the decorator on an element.
-	virtual void RenderElement(Element* element, DecoratorDataHandle element_data);
+	void RenderElement(Element* element, DecoratorDataHandle element_data) const override;
 
 
 private:
 private:
 	enum
 	enum

+ 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.
 // Loads a single decorator and adds it to the list of loaded decorators for this element.
-int ElementDecoration::LoadDecorator(std::shared_ptr<Decorator> decorator)
+int ElementDecoration::LoadDecorator(std::shared_ptr<const Decorator> decorator)
 {
 {
 	DecoratorHandle element_decorator;
 	DecoratorHandle element_decorator;
 	element_decorator.decorator_data = decorator->GenerateElementData(element);
 	element_decorator.decorator_data = decorator->GenerateElementData(element);

+ 2 - 2
Source/Core/ElementDecoration.h

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

+ 1 - 1
Source/Core/FontFaceHandle.cpp

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

+ 1 - 1
Source/Core/FontFaceHandle.h

@@ -117,7 +117,7 @@ public:
 protected:
 protected:
 	/// Destroys the handle.
 	/// Destroys the handle.
 	void OnReferenceDeactivate() override;
 	void OnReferenceDeactivate() override;
-	FontFaceLayer* GenerateLayer(const std::shared_ptr<FontEffect>& font_effect);
+	FontFaceLayer* GenerateLayer(const std::shared_ptr<const FontEffect>& font_effect);
 	virtual int GetKerning(word lhs, word rhs) const = 0;
 	virtual int GetKerning(word lhs, word rhs) const = 0;
 
 
 	typedef std::vector< int > GlyphKerningList;
 	typedef std::vector< int > GlyphKerningList;

+ 1 - 1
Source/Core/FontFaceLayer.cpp

@@ -44,7 +44,7 @@ FontFaceLayer::~FontFaceLayer()
 }
 }
 
 
 // Generates the character and texture data for the layer.
 // Generates the character and texture data for the layer.
-bool FontFaceLayer::Initialise(const FontFaceHandle* _handle, std::shared_ptr<FontEffect> _effect, const FontFaceLayer* clone, bool deep_clone)
+bool FontFaceLayer::Initialise(const FontFaceHandle* _handle, std::shared_ptr<const FontEffect> _effect, const FontFaceLayer* clone, bool deep_clone)
 {
 {
 	handle = _handle;
 	handle = _handle;
 	effect = _effect;
 	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] 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.
 	/// @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.
 	/// @return True if the layer was generated successfully, false if not.
-	virtual bool Initialise(const FontFaceHandle* handle, std::shared_ptr<FontEffect> effect = {}, const FontFaceLayer* clone = NULL, bool deep_clone = false);
+	virtual bool Initialise(const FontFaceHandle* handle, std::shared_ptr<const FontEffect> effect = {}, const FontFaceLayer* clone = NULL, bool deep_clone = false);
 
 
 	/// Generates the texture data for a layer (for the texture database).
 	/// 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.
 	/// @param[out] texture_data The pointer to be set to the generated texture data.
@@ -137,7 +137,7 @@ public:
 	typedef std::vector< Texture > TextureList;
 	typedef std::vector< Texture > TextureList;
 
 
 	const FontFaceHandle* handle;
 	const FontFaceHandle* handle;
-	std::shared_ptr<FontEffect> effect;
+	std::shared_ptr<const FontEffect> effect;
 
 
 	TextureLayout texture_layout;
 	TextureLayout texture_layout;
 
 

+ 1 - 1
Source/Core/StyleSheet.cpp

@@ -297,7 +297,7 @@ FontEffectList StyleSheet::InstanceFontEffectsFromString(const String& font_effe
 
 
 	// Partition the list such that the back layer effects appear before the front layer effects
 	// 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(), 
 	std::stable_partition(font_effect_list.begin(), font_effect_list.end(), 
-		[](const std::shared_ptr<FontEffect>& effect) { return effect->GetLayer() == FontEffect::Layer::Back; }
+		[](const std::shared_ptr<const FontEffect>& effect) { return effect->GetLayer() == FontEffect::Layer::Back; }
 	);
 	);
 
 
 	return font_effect_list;
 	return font_effect_list;