Browse Source

Reverting to commit 9c42c7b. The strings to ID changes were too complicated compared to the performance gained.

Michael Ragazzon 6 years ago
parent
commit
f3b9ad29f0
100 changed files with 1263 additions and 1702 deletions
  1. 2 4
      Build/cmake/FileList.cmake
  2. 1 1
      Include/Rocket/Controls/ElementFormControlInput.h
  3. 1 1
      Include/Rocket/Controls/ElementFormControlTextArea.h
  4. 0 61
      Include/Rocket/Controls/ID.h
  5. 2 3
      Include/Rocket/Core/Animation.h
  6. 1 0
      Include/Rocket/Core/BitmapFont/FontProvider.h
  7. 3 3
      Include/Rocket/Core/Context.h
  8. 0 1
      Include/Rocket/Core/Core.h
  9. 1 0
      Include/Rocket/Core/Decorator.h
  10. 2 2
      Include/Rocket/Core/DecoratorInstancer.h
  11. 0 8
      Include/Rocket/Core/Dictionary.h
  12. 19 18
      Include/Rocket/Core/Element.h
  13. 2 2
      Include/Rocket/Core/Element.inl
  14. 1 1
      Include/Rocket/Core/ElementDocument.h
  15. 1 6
      Include/Rocket/Core/Event.h
  16. 1 1
      Include/Rocket/Core/EventInstancer.h
  17. 2 1
      Include/Rocket/Core/Factory.h
  18. 1 0
      Include/Rocket/Core/FontDatabase.h
  19. 3 3
      Include/Rocket/Core/FontEffectInstancer.h
  20. 1 0
      Include/Rocket/Core/FreeType/FontProvider.h
  21. 0 207
      Include/Rocket/Core/ID.h
  22. 0 3
      Include/Rocket/Core/Property.h
  23. 46 58
      Include/Rocket/Core/PropertyDictionary.h
  24. 11 10
      Include/Rocket/Core/PropertySpecification.h
  25. 1 2
      Include/Rocket/Core/StyleSheet.h
  26. 7 7
      Include/Rocket/Core/StyleSheetSpecification.h
  27. 1 1
      Include/Rocket/Core/TypeConverter.inl
  28. 2 13
      Include/Rocket/Core/Types.h
  29. 0 2
      Include/Rocket/Core/Variant.inl
  30. 32 33
      Samples/basic/animation/src/main.cpp
  31. 1 15
      Source/Controls/Controls.cpp
  32. 11 12
      Source/Controls/ElementDataGrid.cpp
  33. 5 5
      Source/Controls/ElementDataGridCell.cpp
  34. 9 10
      Source/Controls/ElementDataGridRow.cpp
  35. 1 2
      Source/Controls/ElementForm.cpp
  36. 1 2
      Source/Controls/ElementFormControl.cpp
  37. 1 1
      Source/Controls/ElementFormControlInput.cpp
  38. 7 7
      Source/Controls/ElementFormControlTextArea.cpp
  39. 8 9
      Source/Controls/ElementTabSet.cpp
  40. 3 3
      Source/Controls/ElementTextSelection.cpp
  41. 1 1
      Source/Controls/ElementTextSelection.h
  42. 0 83
      Source/Controls/ID.cpp
  43. 1 1
      Source/Controls/InputType.cpp
  44. 1 1
      Source/Controls/InputType.h
  45. 4 4
      Source/Controls/InputTypeButton.cpp
  46. 1 2
      Source/Controls/InputTypeCheckbox.cpp
  47. 1 2
      Source/Controls/InputTypeRadio.cpp
  48. 3 3
      Source/Controls/InputTypeText.cpp
  49. 1 1
      Source/Controls/InputTypeText.h
  50. 21 22
      Source/Controls/WidgetDropDown.cpp
  51. 29 30
      Source/Controls/WidgetSlider.cpp
  52. 25 26
      Source/Controls/WidgetTextInput.cpp
  53. 46 46
      Source/Core/Context.cpp
  54. 4 4
      Source/Core/DecoratorInstancer.cpp
  55. 2 2
      Source/Core/DecoratorTiled.cpp
  56. 20 47
      Source/Core/DecoratorTiledInstancer.cpp
  57. 1 1
      Source/Core/DecoratorTiledInstancer.h
  58. 176 131
      Source/Core/Element.cpp
  59. 2 2
      Source/Core/ElementAnimation.cpp
  60. 3 3
      Source/Core/ElementAnimation.h
  61. 2 2
      Source/Core/ElementBackground.cpp
  62. 5 5
      Source/Core/ElementBorder.cpp
  63. 33 46
      Source/Core/ElementDefinition.cpp
  64. 5 6
      Source/Core/ElementDefinition.h
  65. 24 24
      Source/Core/ElementDocument.cpp
  66. 12 12
      Source/Core/ElementHandle.cpp
  67. 6 6
      Source/Core/ElementImage.cpp
  68. 1 1
      Source/Core/ElementImage.h
  69. 9 9
      Source/Core/ElementScroll.cpp
  70. 90 86
      Source/Core/ElementStyle.cpp
  71. 15 15
      Source/Core/ElementStyle.h
  72. 31 31
      Source/Core/ElementStyleCache.cpp
  73. 12 12
      Source/Core/ElementTextDefault.cpp
  74. 1 1
      Source/Core/ElementTextDefault.h
  75. 6 6
      Source/Core/ElementUtilities.cpp
  76. 1 12
      Source/Core/Event.cpp
  77. 10 11
      Source/Core/EventDispatcher.cpp
  78. 4 4
      Source/Core/EventDispatcher.h
  79. 2 2
      Source/Core/EventInstancerDefault.cpp
  80. 1 1
      Source/Core/EventInstancerDefault.h
  81. 2 2
      Source/Core/EventIterators.h
  82. 29 25
      Source/Core/Factory.cpp
  83. 15 6
      Source/Core/FontDatabase.cpp
  84. 5 12
      Source/Core/FontEffectInstancer.cpp
  85. 5 3
      Source/Core/FontEffectOutlineInstancer.cpp
  86. 9 7
      Source/Core/FontEffectShadowInstancer.cpp
  87. 0 3
      Source/Core/FontEffectShadowInstancer.h
  88. 0 288
      Source/Core/ID.cpp
  89. 3 3
      Source/Core/LayoutBlockBox.cpp
  90. 1 1
      Source/Core/LayoutBlockBoxSpace.cpp
  91. 12 12
      Source/Core/LayoutEngine.cpp
  92. 1 33
      Source/Core/PropertyDictionary.cpp
  93. 12 16
      Source/Core/PropertyParserAnimation.cpp
  94. 1 1
      Source/Core/PropertyParserTransform.cpp
  95. 1 1
      Source/Core/PropertyShorthandDefinition.h
  96. 51 49
      Source/Core/PropertySpecification.cpp
  97. 140 0
      Source/Core/StringCache.cpp
  98. 149 0
      Source/Core/StringCache.h
  99. 11 8
      Source/Core/StyleSheetNode.cpp
  100. 13 10
      Source/Core/StyleSheetParser.cpp

+ 2 - 4
Build/cmake/FileList.cmake

@@ -68,6 +68,7 @@ set(Core_HDR_FILES
     ${PROJECT_SOURCE_DIR}/Source/Core/PropertyParserTransform.h
     ${PROJECT_SOURCE_DIR}/Source/Core/PropertyParserTransform.h
     ${PROJECT_SOURCE_DIR}/Source/Core/PropertyShorthandDefinition.h
     ${PROJECT_SOURCE_DIR}/Source/Core/PropertyShorthandDefinition.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamFile.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamFile.h
+    ${PROJECT_SOURCE_DIR}/Source/Core/StringCache.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetFactory.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetFactory.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetNode.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetNode.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetNodeSelector.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetNodeSelector.h
@@ -149,7 +150,6 @@ set(Core_PUB_HDR_FILES
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Geometry.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Geometry.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/GeometryUtilities.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/GeometryUtilities.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Header.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Header.h
-    ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/ID.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Input.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Input.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Log.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Log.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Math.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Math.h
@@ -274,7 +274,6 @@ set(Core_SRC_FILES
     ${PROJECT_SOURCE_DIR}/Source/Core/Geometry.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/Geometry.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/GeometryDatabase.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/GeometryDatabase.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/GeometryUtilities.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/GeometryUtilities.cpp
-    ${PROJECT_SOURCE_DIR}/Source/Core/ID.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/LayoutBlockBox.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/LayoutBlockBox.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/LayoutBlockBoxSpace.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/LayoutBlockBoxSpace.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/LayoutEngine.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/LayoutEngine.cpp
@@ -302,6 +301,7 @@ set(Core_SRC_FILES
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamFile.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamFile.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamMemory.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamMemory.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/String.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/String.cpp
+    ${PROJECT_SOURCE_DIR}/Source/Core/StringCache.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StringUtilities.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StringUtilities.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheet.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheet.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetFactory.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetFactory.cpp
@@ -395,7 +395,6 @@ set(Controls_PUB_HDR_FILES
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Controls/ElementFormControlTextArea.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Controls/ElementFormControlTextArea.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Controls/ElementTabSet.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Controls/ElementTabSet.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Controls/Header.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Controls/Header.h
-    ${PROJECT_SOURCE_DIR}/Include/Rocket/Controls/ID.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Controls/SelectOption.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Controls/SelectOption.h
 )
 )
 
 
@@ -418,7 +417,6 @@ set(Controls_SRC_FILES
     ${PROJECT_SOURCE_DIR}/Source/Controls/ElementFormControlTextArea.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/ElementFormControlTextArea.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/ElementTabSet.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/ElementTabSet.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/ElementTextSelection.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/ElementTextSelection.cpp
-    ${PROJECT_SOURCE_DIR}/Source/Controls/ID.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/InputType.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/InputType.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/InputTypeButton.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/InputTypeButton.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/InputTypeCheckbox.cpp
     ${PROJECT_SOURCE_DIR}/Source/Controls/InputTypeCheckbox.cpp

+ 1 - 1
Include/Rocket/Controls/ElementFormControlInput.h

@@ -72,7 +72,7 @@ protected:
 	virtual void OnAttributeChange(const Core::AttributeNameList& changed_attributes);
 	virtual void OnAttributeChange(const Core::AttributeNameList& changed_attributes);
 	/// Called when properties on the control are changed.
 	/// Called when properties on the control are changed.
 	/// @param[in] changed_properties The properties changed on the element.
 	/// @param[in] changed_properties The properties changed on the element.
-	virtual void OnPropertyChange(const Core::PropertyIdList& changed_properties);
+	virtual void OnPropertyChange(const Core::PropertyNameList& changed_properties);
 
 
 	/// If we are the added element, this will pass the call onto our type handler.
 	/// If we are the added element, this will pass the call onto our type handler.
 	/// @param[in] child The new member of the hierarchy.
 	/// @param[in] child The new member of the hierarchy.

+ 1 - 1
Include/Rocket/Controls/ElementFormControlTextArea.h

@@ -105,7 +105,7 @@ protected:
 	virtual void OnAttributeChange(const Core::AttributeNameList& changed_attributes);
 	virtual void OnAttributeChange(const Core::AttributeNameList& changed_attributes);
 	/// Called when properties on the control are changed.
 	/// Called when properties on the control are changed.
 	/// @param[in] changed_properties The properties changed on the element.
 	/// @param[in] changed_properties The properties changed on the element.
-	virtual void OnPropertyChange(const Core::PropertyIdList& changed_properties);
+	virtual void OnPropertyChange(const Core::PropertyNameList& changed_properties);
 
 
 	/// Returns the text content of the element.
 	/// Returns the text content of the element.
 	/// @param[out] content The content of the element.
 	/// @param[out] content The content of the element.

+ 0 - 61
Include/Rocket/Controls/ID.h

@@ -1,61 +0,0 @@
-/*
- * This source file is part of libRocket, the HTML/CSS Interface Middleware
- *
- * For the latest information, see http://www.librocket.com
- *
- * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-#ifndef ROCKETCONTROLSID_H
-#define ROCKETCONTROLSID_H
-
-#include "../Core/ID.h"
-
-namespace Rocket {
-namespace Controls {
-
-namespace PropertyId {
-
-	extern Core::PropertyId MinRows;
-	extern Core::PropertyId TabIndex;
-
-}
-
-namespace EventId {
-
-	extern Core::EventId Columnadd;
-	extern Core::EventId Rowadd;
-	extern Core::EventId Rowchange;
-	extern Core::EventId Rowremove;
-	extern Core::EventId Rowupdate;
-
-	extern Core::EventId Submit;
-	extern Core::EventId Change;
-
-	extern Core::EventId Tabchange;
-
-}
-
-}
-}
-
-#endif

+ 2 - 3
Include/Rocket/Core/Animation.h

@@ -33,7 +33,6 @@
 
 
 #include "String.h"
 #include "String.h"
 #include "Tween.h"
 #include "Tween.h"
-#include "ID.h"
 
 
 namespace Rocket {
 namespace Rocket {
 namespace Core {
 namespace Core {
@@ -53,7 +52,7 @@ typedef std::vector<Animation> AnimationList;
 
 
 /* Data parsed from the 'transition' property. */
 /* Data parsed from the 'transition' property. */
 struct Transition {
 struct Transition {
-	PropertyId property_id = PropertyId::Invalid;
+	String name;
 	Tween tween;
 	Tween tween;
 	float duration = 0.0f;
 	float duration = 0.0f;
 	float delay = 0.0f;
 	float delay = 0.0f;
@@ -68,7 +67,7 @@ struct TransitionList {
 
 
 inline bool operator==(const Animation& a, const Animation& b) { return a.duration == b.duration && a.tween == b.tween && a.delay == b.delay && a.alternate == b.alternate && a.paused == b.paused && a.num_iterations == b.num_iterations && a.name == b.name; }
 inline bool operator==(const Animation& a, const Animation& b) { return a.duration == b.duration && a.tween == b.tween && a.delay == b.delay && a.alternate == b.alternate && a.paused == b.paused && a.num_iterations == b.num_iterations && a.name == b.name; }
 inline bool operator!=(const Animation& a, const Animation& b) { return !(a == b); }
 inline bool operator!=(const Animation& a, const Animation& b) { return !(a == b); }
-inline bool operator==(const Transition& a, const Transition& b) { return a.property_id == b.property_id && a.tween == b.tween && a.duration == b.duration && a.delay == b.delay && a.reverse_adjustment_factor == b.reverse_adjustment_factor; }
+inline bool operator==(const Transition& a, const Transition& b) { return a.name == b.name && a.tween == b.tween && a.duration == b.duration && a.delay == b.delay && a.reverse_adjustment_factor == b.reverse_adjustment_factor; }
 inline bool operator!=(const Transition& a, const Transition& b) { return !(a == b); }
 inline bool operator!=(const Transition& a, const Transition& b) { return !(a == b); }
 inline bool operator==(const TransitionList& a, const TransitionList& b) { return a.none == b.none && a.all == b.all && a.transitions == b.transitions; }
 inline bool operator==(const TransitionList& a, const TransitionList& b) { return a.none == b.none && a.all == b.all && a.transitions == b.transitions; }
 inline bool operator!=(const TransitionList& a, const TransitionList& b) { return !(a == b); }
 inline bool operator!=(const TransitionList& a, const TransitionList& b) { return !(a == b); }

+ 1 - 0
Include/Rocket/Core/BitmapFont/FontProvider.h

@@ -38,6 +38,7 @@ namespace Core {
 
 
 class FontEffect;
 class FontEffect;
 class FontFaceHandle;
 class FontFaceHandle;
+class PropertyDictionary;
 
 
 namespace BitmapFont {
 namespace BitmapFont {
 
 

+ 3 - 3
Include/Rocket/Core/Context.h

@@ -158,12 +158,12 @@ public:
 	/// @param[in] event The name of the event to attach to.
 	/// @param[in] event The name of the event to attach to.
 	/// @param[in] listener Listener object to be attached.
 	/// @param[in] listener Listener object to be attached.
 	/// @param[in] in_capture_phase True if the listener is to be attached to the capture phase, false for the bubble phase.
 	/// @param[in] in_capture_phase True if the listener is to be attached to the capture phase, false for the bubble phase.
-	void AddEventListener(EventId event, EventListener* listener, bool in_capture_phase = false);
+	void AddEventListener(const String& event, EventListener* listener, bool in_capture_phase = false);
 	/// Removes an event listener from the context's root element.
 	/// Removes an event listener from the context's root element.
 	/// @param[in] event The name of the event to detach from.
 	/// @param[in] event The name of the event to detach from.
 	/// @param[in] listener Listener object to be detached.
 	/// @param[in] listener Listener object to be detached.
 	/// @param[in] in_capture_phase True to detach from the capture phase, false from the bubble phase.
 	/// @param[in] in_capture_phase True to detach from the capture phase, false from the bubble phase.
-	void RemoveEventListener(EventId event, EventListener* listener, bool in_capture_phase = false);
+	void RemoveEventListener(const String& event, EventListener* listener, bool in_capture_phase = false);
 
 
 	/// Sends a key down event into this context.
 	/// Sends a key down event into this context.
 	/// @param[in] key_identifier The key pressed.
 	/// @param[in] key_identifier The key pressed.
@@ -332,7 +332,7 @@ private:
 	void ReleaseUnloadedDocuments();
 	void ReleaseUnloadedDocuments();
 
 
 	// Sends the specified event to all elements in new_items that don't appear in old_items.
 	// Sends the specified event to all elements in new_items that don't appear in old_items.
-	static void SendEvents(const ElementSet& old_items, const ElementSet& new_items, EventId event, const Dictionary& parameters, bool interruptible);
+	static void SendEvents(const ElementSet& old_items, const ElementSet& new_items, const String& event, const Dictionary& parameters, bool interruptible);
 
 
 	friend class Element;
 	friend class Element;
 	friend ROCKETCORE_API Context* CreateContext(const String&, const Vector2i&, RenderInterface*);
 	friend ROCKETCORE_API Context* CreateContext(const String&, const Vector2i&, RenderInterface*);

+ 0 - 1
Include/Rocket/Core/Core.h

@@ -58,7 +58,6 @@
 #include "Geometry.h"
 #include "Geometry.h"
 #include "GeometryUtilities.h"
 #include "GeometryUtilities.h"
 #include "Input.h"
 #include "Input.h"
-#include "ID.h"
 #include "Log.h"
 #include "Log.h"
 #include "Plugin.h"
 #include "Plugin.h"
 #include "Property.h"
 #include "Property.h"

+ 1 - 0
Include/Rocket/Core/Decorator.h

@@ -39,6 +39,7 @@ namespace Core {
 
 
 class DecoratorInstancer;
 class DecoratorInstancer;
 class Element;
 class Element;
+class PropertyDictionary;
 class Property;
 class Property;
 struct Texture;
 struct Texture;
 class TextureResource;
 class TextureResource;

+ 2 - 2
Include/Rocket/Core/DecoratorInstancer.h

@@ -73,13 +73,13 @@ protected:
 	/// @param[in] property_name The name of the new property (how it is specified through RCSS).
 	/// @param[in] property_name The name of the new property (how it is specified through RCSS).
 	/// @param[in] default_value The default value to be used.
 	/// @param[in] default_value The default value to be used.
 	/// @return The new property definition, ready to have parsers attached.
 	/// @return The new property definition, ready to have parsers attached.
-	PropertyDefinition& RegisterProperty(PropertyId property_id, const String& default_value);
+	PropertyDefinition& RegisterProperty(const String& property_name, const String& default_value);
 	/// Registers a shorthand property definition.
 	/// Registers a shorthand property definition.
 	/// @param[in] shorthand_name The name to register the new shorthand property under.
 	/// @param[in] shorthand_name The name to register the new shorthand property under.
 	/// @param[in] properties A comma-separated list of the properties this definition is shorthand for. The order in which they are specified here is the order in which the values will be processed.
 	/// @param[in] properties A comma-separated list of the properties this definition is shorthand for. The order in which they are specified here is the order in which the values will be processed.
 	/// @param[in] type The type of shorthand to declare.
 	/// @param[in] type The type of shorthand to declare.
 	/// @param True if all the property names exist, false otherwise.
 	/// @param True if all the property names exist, false otherwise.
-	bool RegisterShorthand(PropertyId shorthand_id, const PropertyIdList& property_ids, PropertySpecification::ShorthandType type = PropertySpecification::AUTO);
+	bool RegisterShorthand(const String& shorthand_name, const String& property_names, PropertySpecification::ShorthandType type = PropertySpecification::AUTO);
 
 
 	// Releases the instancer.
 	// Releases the instancer.
 	virtual void OnReferenceDeactivate();
 	virtual void OnReferenceDeactivate();

+ 0 - 8
Include/Rocket/Core/Dictionary.h

@@ -30,8 +30,6 @@
 
 
 #include "Header.h"
 #include "Header.h"
 #include "Variant.h"
 #include "Variant.h"
-#include "ID.h"
-#include "Property.h"
 
 
 namespace Rocket {
 namespace Rocket {
 namespace Core {
 namespace Core {
@@ -48,12 +46,6 @@ inline const Variant* GetIf(const Dictionary& dictionary, const String& key)
 		return &(it->second);
 		return &(it->second);
 	return nullptr;
 	return nullptr;
 }
 }
-inline const Property* GetIf(const PropertyDictionary& dictionary, PropertyId property_id)
-{
-	if (auto it = dictionary.find(property_id); it != dictionary.end())
-		return &(it->second);
-	return nullptr;
-}
 template<typename T>
 template<typename T>
 inline T Get(const Dictionary& dictionary, const String& key, const T& default_value)
 inline T Get(const Dictionary& dictionary, const String& key, const T& default_value)
 {
 {

+ 19 - 18
Include/Rocket/Core/Element.h

@@ -57,6 +57,7 @@ class ElementDocument;
 class ElementScroll;
 class ElementScroll;
 class ElementStyle;
 class ElementStyle;
 class FontFaceHandle;
 class FontFaceHandle;
+class PropertyDictionary;
 class RenderInterface;
 class RenderInterface;
 class StyleSheet;
 class StyleSheet;
 struct ElementMeta;
 struct ElementMeta;
@@ -185,31 +186,31 @@ public:
 	/// @param[in] name The name of the new property.
 	/// @param[in] name The name of the new property.
 	/// @param[in] value The new property to set.
 	/// @param[in] value The new property to set.
 	/// @return True if the property parsed successfully, false otherwise.
 	/// @return True if the property parsed successfully, false otherwise.
-	bool SetProperty(PropertyId property_id, const String& value);
+	bool SetProperty(const String& name, const String& value);
 	/// Sets a local property override on the element to a pre-parsed value.
 	/// Sets a local property override on the element to a pre-parsed value.
 	/// @param[in] name The name of the new property.
 	/// @param[in] name The name of the new property.
 	/// @param[in] property The parsed property to set.
 	/// @param[in] property The parsed property to set.
 	/// @return True if the property was set successfully, false otherwise.
 	/// @return True if the property was set successfully, false otherwise.
-	bool SetProperty(PropertyId property_id, const Property& property);
+	bool SetProperty(const String& name, const Property& property);
 	/// Removes a local property override on the element; its value will revert to that defined in
 	/// Removes a local property override on the element; its value will revert to that defined in
 	/// the style sheet.
 	/// the style sheet.
 	/// @param[in] name The name of the local property definition to remove.
 	/// @param[in] name The name of the local property definition to remove.
-	void RemoveProperty(PropertyId property_id);
+	void RemoveProperty(const String& name);
 	/// Returns one of this element's properties. If this element is not defined this property, or a parent cannot
 	/// Returns one of this element's properties. If this element is not defined this property, or a parent cannot
 	/// be found that we can inherit the property from, the default value will be returned.
 	/// be found that we can inherit the property from, the default value will be returned.
 	/// @param[in] name The name of the property to fetch the value for.
 	/// @param[in] name The name of the property to fetch the value for.
 	/// @return The value of this property for this element, or NULL if no property exists with the given name.
 	/// @return The value of this property for this element, or NULL if no property exists with the given name.
-	const Property* GetProperty(PropertyId property_id);		
+	const Property* GetProperty(const String& name);		
 	/// Returns the values of one of this element's properties.		
 	/// Returns the values of one of this element's properties.		
 	/// @param[in] name The name of the property to get.
 	/// @param[in] name The name of the property to get.
 	/// @return The value of this property.
 	/// @return The value of this property.
 	template < typename T >
 	template < typename T >
-	T GetProperty(PropertyId property_id);
+	T GetProperty(const String& name);
 	/// Returns one of this element's properties. If this element is not defined this property, NULL will be
 	/// Returns one of this element's properties. If this element is not defined this property, NULL will be
 	/// returned.
 	/// returned.
 	/// @param[in] name The name of the property to fetch the value for.
 	/// @param[in] name The name of the property to fetch the value for.
 	/// @return The value of this property for this element, or NULL if this property has not been explicitly defined for this element.
 	/// @return The value of this property for this element, or NULL if this property has not been explicitly defined for this element.
-	const Property* GetLocalProperty(PropertyId property_id);
+	const Property* GetLocalProperty(const String& name);
 	/// Returns the local properties, excluding any properties from local class.
 	/// Returns the local properties, excluding any properties from local class.
 	/// @return The local properties for this element, or NULL if no properties defined
 	/// @return The local properties for this element, or NULL if no properties defined
 	const PropertyMap* GetLocalProperties();
 	const PropertyMap* GetLocalProperties();
@@ -218,7 +219,7 @@ public:
 	/// @param[in] name The name of the property to resolve the value for.
 	/// @param[in] name The name of the property to resolve the value for.
 	/// @param[in] base_value The value that is scaled by the percentage value, if it is a percentage.
 	/// @param[in] base_value The value that is scaled by the percentage value, if it is a percentage.
 	/// @return The value of this property for this element.
 	/// @return The value of this property for this element.
-	float ResolveProperty(PropertyId property_id, float base_value);
+	float ResolveProperty(const String& name, float base_value);
 	/// Resolves one of this element's non-inherited properties. If the value is a number or px, this is returned. Angles are returned as radians.
 	/// Resolves one of this element's non-inherited properties. If the value is a number or px, this is returned. Angles are returned as radians.
 	/// Precentages are resolved based on the second argument (the base value).
 	/// Precentages are resolved based on the second argument (the base value).
 	/// @param[in] name The property to resolve the value for.
 	/// @param[in] name The property to resolve the value for.
@@ -294,12 +295,12 @@ public:
 	/// If an animation of the same property name exists, it will be replaced.
 	/// If an animation of the same property name exists, it will be replaced.
 	/// If start_value is null, the current property value on this element is used.
 	/// If start_value is null, the current property value on this element is used.
 	/// @return True if a new animation was added.
 	/// @return True if a new animation was added.
-	bool Animate(PropertyId property_id, const Property& target_value, float duration, Tween tween = Tween{}, int num_iterations = 1, bool alternate_direction = true, float delay = 0.0f, const Property* start_value = nullptr);
+	bool Animate(const String& property_name, const Property& target_value, float duration, Tween tween = Tween{}, int num_iterations = 1, bool alternate_direction = true, float delay = 0.0f, const Property* start_value = nullptr);
 
 
 	/// Add a key to an animation, extending its duration.
 	/// Add a key to an animation, extending its duration.
 	/// If no animation exists for the given property name, the call will be ignored.
 	/// If no animation exists for the given property name, the call will be ignored.
 	/// @return True if a new animation key was added.
 	/// @return True if a new animation key was added.
-	bool AddAnimationKey(PropertyId property_id, const Property& target_value, float duration, Tween tween = Tween{});
+	bool AddAnimationKey(const String& property_name, const Property& target_value, float duration, Tween tween = Tween{});
 	
 	
 	/// Iterates over the properties defined on this element.
 	/// Iterates over the properties defined on this element.
 	/// @param[inout] index Index of the property to fetch. This is incremented to the next valid index after the fetch. Indices are not necessarily incremental.
 	/// @param[inout] index Index of the property to fetch. This is incremented to the next valid index after the fetch. Indices are not necessarily incremental.
@@ -307,7 +308,7 @@ public:
 	/// @param[out] name The name of the property at the specified index.
 	/// @param[out] name The name of the property at the specified index.
 	/// @param[out] property The property at the specified index.
 	/// @param[out] property The property at the specified index.
 	/// @return True if a property was successfully fetched.
 	/// @return True if a property was successfully fetched.
-	bool IterateProperties(int& index, PseudoClassList& pseudo_classes, PropertyId& property_id, const Property*& property) const;
+	bool IterateProperties(int& index, PseudoClassList& pseudo_classes, String& name, const Property*& property) const;
 	///@}
 	///@}
 
 
 	/** @name Pseudo-classes
 	/** @name Pseudo-classes
@@ -523,18 +524,18 @@ public:
 	/// @param[in] event Event to attach to.
 	/// @param[in] event Event to attach to.
 	/// @param[in] listener The listener object to be attached.
 	/// @param[in] listener The listener object to be attached.
 	/// @param[in] in_capture_phase True to attach in the capture phase, false in bubble phase.
 	/// @param[in] in_capture_phase True to attach in the capture phase, false in bubble phase.
-	void AddEventListener(EventId event_id, EventListener* listener, bool in_capture_phase = false);
+	void AddEventListener(const String& event, EventListener* listener, bool in_capture_phase = false);
 	/// Removes an event listener from this element.
 	/// Removes an event listener from this element.
 	/// @param[in] event Event to detach from.
 	/// @param[in] event Event to detach from.
 	/// @param[in] listener The listener object to be detached.
 	/// @param[in] listener The listener object to be detached.
 	/// @param[in] in_capture_phase True to detach from the capture phase, false from the bubble phase.
 	/// @param[in] in_capture_phase True to detach from the capture phase, false from the bubble phase.
-	void RemoveEventListener(EventId event_id, EventListener* listener, bool in_capture_phase = false);
+	void RemoveEventListener(const String& event, EventListener* listener, bool in_capture_phase = false);
 	/// Sends an event to this element.
 	/// Sends an event to this element.
 	/// @param[in] event Name of the event in string form.
 	/// @param[in] event Name of the event in string form.
 	/// @param[in] parameters The event parameters.
 	/// @param[in] parameters The event parameters.
 	/// @param[in] interruptible True if the propagation of the event be stopped.
 	/// @param[in] interruptible True if the propagation of the event be stopped.
 	/// @return True if the event was not consumed (ie, was prevented from propagating by an element), false if it was.
 	/// @return True if the event was not consumed (ie, was prevented from propagating by an element), false if it was.
-	bool DispatchEvent(EventId event_id, const Dictionary& parameters, bool interruptible = false);
+	bool DispatchEvent(const String& event, const Dictionary& parameters, bool interruptible = false);
 
 
 	/// Scrolls the parent element's contents so that this element is visible.
 	/// Scrolls the parent element's contents so that this element is visible.
 	/// @param[in] align_with_top If true, the element will align itself to the top of the parent element's window. If false, the element will be aligned to the bottom of the parent element's window.
 	/// @param[in] align_with_top If true, the element will align itself to the top of the parent element's window. If false, the element will be aligned to the bottom of the parent element's window.
@@ -638,10 +639,10 @@ protected:
 	virtual void OnAttributeChange(const AttributeNameList& changed_attributes);
 	virtual void OnAttributeChange(const AttributeNameList& changed_attributes);
 	/// Called when properties on the element are changed.
 	/// Called when properties on the element are changed.
 	/// @param[in] changed_properties The properties changed on the element.
 	/// @param[in] changed_properties The properties changed on the element.
-	virtual void OnPropertyChange(const PropertyIdList& changed_properties);
+	virtual void OnPropertyChange(const PropertyNameList& changed_properties);
 
 
 	void DirtyAllProperties() { all_properties_dirty = true; }
 	void DirtyAllProperties() { all_properties_dirty = true; }
-	void DirtyProperties(const PropertyIdList& changed_properties);
+	void DirtyProperties(const PropertyNameList& changed_properties);
 	void UpdateDirtyProperties();
 	void UpdateDirtyProperties();
 
 
 	/// Called when a child node has been added somewhere in the hierarchy.
 	/// Called when a child node has been added somewhere in the hierarchy.
@@ -690,10 +691,10 @@ private:
 	void UpdateTransformState();
 	void UpdateTransformState();
 
 
 	// Start an animation, replacing any existing animations of the same property name. If start_value is null, the element's current value is used.
 	// Start an animation, replacing any existing animations of the same property name. If start_value is null, the element's current value is used.
-	ElementAnimationList::iterator StartAnimation(PropertyId property_id, const Property * start_value, int num_iterations, bool alternate_direction, float delay);
+	ElementAnimationList::iterator StartAnimation(const String & property_name, const Property * start_value, int num_iterations, bool alternate_direction, float delay);
 
 
 	// Add a key to an animation, extending its duration. If target_value is null, the element's current value is used.
 	// Add a key to an animation, extending its duration. If target_value is null, the element's current value is used.
-	bool AddAnimationKeyTime(PropertyId property_id, const Property * target_value, float time, Tween tween);
+	bool AddAnimationKeyTime(const String & property_name, const Property * target_value, float time, Tween tween);
 
 
 	/// Start a transition of the given property on this element.
 	/// Start a transition of the given property on this element.
 	/// If an animation exists for the property, the call will be ignored. If a transition exists for this property, it will be replaced.
 	/// If an animation exists for the property, the call will be ignored. If a transition exists for this property, it will be replaced.
@@ -776,7 +777,7 @@ private:
 	bool structure_dirty;
 	bool structure_dirty;
 	bool parent_structure_dirty;
 	bool parent_structure_dirty;
 
 
-	PropertyIdList dirty_properties;
+	PropertyNameList dirty_properties;
 	bool all_properties_dirty;
 	bool all_properties_dirty;
 
 
 	// The element's font face; used to render text and resolve em / ex properties.
 	// The element's font face; used to render text and resolve em / ex properties.

+ 2 - 2
Include/Rocket/Core/Element.inl

@@ -28,9 +28,9 @@
 // Returns the values of one of this element's properties.
 // Returns the values of one of this element's properties.
 // We can assume the property will exist based on the RCSS inheritance.
 // We can assume the property will exist based on the RCSS inheritance.
 template < typename T >
 template < typename T >
-T Element::GetProperty(PropertyId id)
+T Element::GetProperty(const String& name)
 {
 {
-	const Property* property = GetProperty(id);
+	const Property* property = GetProperty(name);
 	ROCKET_ASSERTMSG(property, "Invalid property name.");
 	ROCKET_ASSERTMSG(property, "Invalid property name.");
 	return property->Get< T >();
 	return property->Get< T >();
 }
 }

+ 1 - 1
Include/Rocket/Core/ElementDocument.h

@@ -136,7 +136,7 @@ public:
 	
 	
 protected:
 protected:
 	/// Repositions the document if necessary.
 	/// Repositions the document if necessary.
-	virtual void OnPropertyChange(const PropertyIdList& changed_properties);
+	virtual void OnPropertyChange(const PropertyNameList& changed_properties);
 
 
 	/// Sets the dirty flag on the layout so the document will format its children before the next render.
 	/// Sets the dirty flag on the layout so the document will format its children before the next render.
 	virtual void DirtyLayout();
 	virtual void DirtyLayout();

+ 1 - 6
Include/Rocket/Core/Event.h

@@ -55,7 +55,7 @@ public:
 	/// @param[in] type The event type
 	/// @param[in] type The event type
 	/// @param[in] parameters The event parameters
 	/// @param[in] parameters The event parameters
 	/// @param[in] interruptible Can this event have is propagation stopped?
 	/// @param[in] interruptible Can this event have is propagation stopped?
-	Event(Element* target, EventId event_id, const Dictionary& parameters, bool interruptible = false);
+	Event(Element* target, const String& type, const Dictionary& parameters, bool interruptible = false);
 	/// Destructor
 	/// Destructor
 	virtual ~Event();
 	virtual ~Event();
 
 
@@ -82,14 +82,10 @@ public:
 	/// Get the event type.
 	/// Get the event type.
 	/// @return The event type.
 	/// @return The event type.
 	const String& GetType() const;
 	const String& GetType() const;
-	/// Get the event id.
-	/// @return The event type.
-	EventId GetId() const;
 	/// Checks if the event is of a certain type.
 	/// Checks if the event is of a certain type.
 	/// @param type The name of the type to check for.
 	/// @param type The name of the type to check for.
 	/// @return True if the event is of the requested type, false otherwise.
 	/// @return True if the event is of the requested type, false otherwise.
 	bool operator==(const String& type) const;
 	bool operator==(const String& type) const;
-	bool operator==(EventId id) const;
 
 
 	/// Has the event been stopped?
 	/// Has the event been stopped?
 	/// @return True if the event is still propogating
 	/// @return True if the event is still propogating
@@ -118,7 +114,6 @@ private:
 	void ProjectMouse(Element* element);
 	void ProjectMouse(Element* element);
 
 
 protected:
 protected:
-	EventId event_id;
 	String type;
 	String type;
 	Dictionary parameters;
 	Dictionary parameters;
 
 

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

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

+ 2 - 1
Include/Rocket/Core/Factory.h

@@ -49,6 +49,7 @@ class EventListenerInstancer;
 class FontEffect;
 class FontEffect;
 class FontEffectInstancer;
 class FontEffectInstancer;
 class StyleSheet;
 class StyleSheet;
+class PropertyDictionary;
 
 
 /**
 /**
 	The Factory contains a registry of instancers for different types.
 	The Factory contains a registry of instancers for different types.
@@ -158,7 +159,7 @@ public:
 	/// @param[in] parameters Additional parameters for this event.
 	/// @param[in] parameters Additional parameters for this event.
 	/// @param[in] interruptible If the event propagation can be stopped.
 	/// @param[in] interruptible If the event propagation can be stopped.
 	/// @return The instanced event.
 	/// @return The instanced event.
-	static Event* InstanceEvent(Element* target, EventId event_id, const Dictionary& parameters, bool interruptible);
+	static Event* InstanceEvent(Element* target, const String& name, const Dictionary& parameters, bool interruptible);
 
 
 	/// Register the instancer to be used for all event listeners.
 	/// Register the instancer to be used for all event listeners.
 	/// @return The registered instancer on success, NULL on failure.
 	/// @return The registered instancer on success, NULL on failure.

+ 1 - 0
Include/Rocket/Core/FontDatabase.h

@@ -39,6 +39,7 @@ namespace Core {
 class FontEffect;
 class FontEffect;
 class FontFamily;
 class FontFamily;
 class FontFaceHandle;
 class FontFaceHandle;
+class PropertyDictionary;
 
 
 /**
 /**
 	The font database contains all font families currently in use by Rocket.
 	The font database contains all font families currently in use by Rocket.

+ 3 - 3
Include/Rocket/Core/FontEffectInstancer.h

@@ -74,13 +74,13 @@ protected:
 	/// @param[in] default_value The default value to be used.
 	/// @param[in] default_value The default value to be used.
 	/// @param[in] affects_generation True if this property affects the effect's texture data or glyph size, false if not.
 	/// @param[in] affects_generation True if this property affects the effect's texture data or glyph size, false if not.
 	/// @return The new property definition, ready to have parsers attached.
 	/// @return The new property definition, ready to have parsers attached.
-	PropertyDefinition& RegisterProperty(const String& property_name, const String& default_value, bool affects_generation = true, PropertyId* out_property_id = nullptr);
+	PropertyDefinition& RegisterProperty(const String& property_name, const String& default_value, bool affects_generation = true);
 	/// Registers a shorthand property definition.
 	/// Registers a shorthand property definition.
 	/// @param[in] shorthand_name The name to register the new shorthand property under.
 	/// @param[in] shorthand_name The name to register the new shorthand property under.
 	/// @param[in] properties A comma-separated list of the properties this definition is shorthand for. The order in which they are specified here is the order in which the values will be processed.
 	/// @param[in] properties A comma-separated list of the properties this definition is shorthand for. The order in which they are specified here is the order in which the values will be processed.
 	/// @param[in] type The type of shorthand to declare.
 	/// @param[in] type The type of shorthand to declare.
 	/// @param True if all the property names exist, false otherwise.
 	/// @param True if all the property names exist, false otherwise.
-	bool RegisterShorthand(const String& shorthand_name, const PropertyIdList& property_ids, PropertySpecification::ShorthandType type = PropertySpecification::AUTO, PropertyId* out_property_id = nullptr);
+	bool RegisterShorthand(const String& shorthand_name, const String& property_names, PropertySpecification::ShorthandType type = PropertySpecification::AUTO);
 
 
 	// Releases the instancer.
 	// Releases the instancer.
 	virtual void OnReferenceDeactivate();
 	virtual void OnReferenceDeactivate();
@@ -89,7 +89,7 @@ private:
 	PropertySpecification properties;
 	PropertySpecification properties;
 
 
 	// Properties that define the geometry.
 	// Properties that define the geometry.
-	std::unordered_set< PropertyId > volatile_properties;
+	std::unordered_set< String > volatile_properties;
 
 
 	friend class Factory;
 	friend class Factory;
 };
 };

+ 1 - 0
Include/Rocket/Core/FreeType/FontProvider.h

@@ -38,6 +38,7 @@ namespace Core {
 
 
 class FontEffect;
 class FontEffect;
 class FontFaceHandle;
 class FontFaceHandle;
+class PropertyDictionary;
 
 
 namespace FreeType {
 namespace FreeType {
 
 

+ 0 - 207
Include/Rocket/Core/ID.h

@@ -1,207 +0,0 @@
-/*
- * This source file is part of libRocket, the HTML/CSS Interface Middleware
- *
- * For the latest information, see http://www.librocket.com
- *
- * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
- 
-#ifndef ROCKETCOREID_H
-#define ROCKETCOREID_H
-
-#include "Types.h"
-
-namespace Rocket {
-namespace Core {
-
-PropertyId GetPropertyId(const String& property_name);
-PropertyId CreateOrGetPropertyId(const String& name);
-const String& GetName(PropertyId property_id);
-
-EventId GetEventId(const String& event_name);
-EventId CreateOrGetEventId(const String& name);
-const String& GetName(EventId event_id); 
-
-
-
-enum class PropertyId : uint16_t 
-{
-	Invalid,
-
-	MarginTop,
-	MarginRight,
-	MarginBottom,
-	MarginLeft,
-	Margin,
-	PaddingTop,
-	PaddingRight,
-	PaddingBottom,
-	PaddingLeft,
-	Padding,
-	BorderTopWidth,
-	BorderRightWidth,
-	BorderBottomWidth,
-	BorderLeftWidth,
-	BorderWidth,
-	BorderTopColor,
-	BorderRightColor,
-	BorderBottomColor,
-	BorderLeftColor,
-	BorderColor,
-	BorderTop,
-	BorderRight,
-	BorderBottom,
-	BorderLeft,
-	Border,
-	Display,
-	Position,
-	Top,
-	Right,
-	Bottom,
-	Left,
-	Float,
-	Clear,
-	ZIndex,
-	Width,
-	MinWidth,
-	MaxWidth,
-	Height,
-	MinHeight,
-	MaxHeight,
-	LineHeight,
-	VerticalAlign,
-	Overflow,
-	OverflowX,
-	OverflowY,
-	Clip,
-	Visibility,
-	BackgroundColor,
-	Background,
-	Color,
-	ImageColor,
-	FontFamily,
-	FontCharset,
-	FontStyle,
-	FontWeight,
-	FontSize,
-	Font,
-	TextAlign,
-	TextDecoration,
-	TextTransform,
-	WhiteSpace,
-	Cursor,
-	Drag,
-	TabIndex,
-	ScrollbarMargin,
-
-	Perspective,
-	PerspectiveOrigin,
-	PerspectiveOriginX,
-	PerspectiveOriginY,
-	Transform,
-	TransformOrigin,
-	TransformOriginX,
-	TransformOriginY,
-	TransformOriginZ,
-	None,
-	All,
-
-	Transition,
-	Animation,
-	Keyframes,
-
-	ScrollDefaultStepSize,
-	Opacity,
-	PointerEvents,
-	Focus,
-
-	NumDefinedIds,
-	FirstCustomId = NumDefinedIds
-};
-
-
-enum class EventId : uint16_t 
-{
-	Invalid,
-
-	Mousedown,
-	Mousescroll,
-	Mouseover,
-	Mouseout,
-	Focus,
-	Blur,
-	Keydown,
-	Mouseup,
-	Click,
-	Load,
-	Unload,
-	Show,
-	Hide,
-	Keyup,
-	Textinput,
-	Mousemove,
-	Dragmove,
-	Dblclick,
-	Drag,
-	Dragstart,
-	Dragover,
-	Dragdrop,
-	Dragout,
-	Dragend,
-	Handledrag,
-	Resize,
-	Scroll,
-	Scrollchange,
-	Animationend,
-	Transitionend,
-
-	NumDefinedIds,
-	FirstCustomId = NumDefinedIds
-};
-
-// Edit: Actually, this might be too complicated due to structural pseudo class selectors
-//PseudoId GetPseudoId(const String& event_name);
-//PseudoId GetOrCreatePseudoId(const String& name);
-//const String& GetName(PseudoId pseudo_id);
-//enum class PseudoId : uint16_t
-//{
-//	Invalid,
-//
-//	Hover,
-//	Active,
-//	Focus,
-//	Dragged,
-//
-//	Disabled,
-//	Selected,
-//	Checked,
-//
-//	NumDefinedIds,
-//	FirstCustomId = NumDefinedIds
-//};
-
-
-}
-}
-
-#endif

+ 0 - 3
Include/Rocket/Core/Property.h

@@ -120,9 +120,6 @@ public:
 	int source_line_number;
 	int source_line_number;
 };
 };
 
 
-
-
-
 }
 }
 }
 }
 
 

+ 46 - 58
Include/Rocket/Core/PropertyDictionary.h

@@ -42,65 +42,53 @@ namespace Core {
 	@author Peter Curry
 	@author Peter Curry
  */
  */
 
 
+class ROCKETCORE_API PropertyDictionary
+{
+public:
+	PropertyDictionary();
+	~PropertyDictionary();
 
 
-/// Merges the contents of another fully-specified property dictionary with this one.
-/// Properties defined in the new dictionary will overwrite those with the same name as
-/// appropriate.
-void Merge(PropertyDictionary& destination, const PropertyDictionary& from, int specificity_offset = 0);
-
-/// Imports into the dictionary, and optionally defines the specificity of, potentially
-/// un-specified properties. In the case of name conflicts, the incoming properties will
-/// overwrite the existing properties if their specificity (or their forced specificity)
-/// are at least equal.
-void Import(PropertyDictionary& destination, const PropertyDictionary& from, int specificity = -1);
-
-//class ROCKETCORE_API PropertyDictionary
-//{
-//public:
-//	PropertyDictionary();
-//	~PropertyDictionary();
-//
-//	/// Sets a property on the dictionary. Any existing property with a similar name will be overwritten.
-//	/// @param[in] name The name of the property to add.
-//	/// @param[in] property The value of the new property.
-//	void SetProperty(const String& name, const Property& property);
-//	/// Removes a property from the dictionary, if it exists.
-//	/// @param[in] name The name of the property to remove.
-//	void RemoveProperty(const String& name);
-//	/// Returns the value of the property with the requested name, if one exists.
-//	/// @param[in] name The name of the desired property.
-//	const Property* GetProperty(const String& name) const;
-//
-//	/// Returns the number of properties in the dictionary.
-//	/// @return The number of properties in the dictionary.
-//	int GetNumProperties() const;
-//	/// Returns the map of properties in the dictionary.
-//	/// @return The property map.
-//	const PropertyMap& GetProperties() const;
-//
-//	/// Imports into the dictionary, and optionally defines the specificity of, potentially
-//	/// un-specified properties. In the case of name conflicts, the incoming properties will
-//	/// overwrite the existing properties if their specificity (or their forced specificity)
-//	/// are at least equal.
-//	/// @param[in] property_dictionary The properties to import.
-//	/// @param[in] specificity The specificity for all incoming properties. If this is not specified, the properties will keep their original specificity.
-//	void Import(const PropertyDictionary& property_dictionary, int specificity = -1);
-//
-//	/// Merges the contents of another fully-specified property dictionary with this one.
-//	/// Properties defined in the new dictionary will overwrite those with the same name as
-//	/// appropriate.
-//	/// @param[in] property_dictionary The dictionary to merge.
-//	/// @param[in] specificity_offset The specificities of all incoming properties will be offset by this value.
-//	void Merge(const PropertyDictionary& property_dictionary, int specificity_offset = 0);
-//
-//private:
-//	// Sets a property on the dictionary and its specificity if there is no name conflict, or its
-//	// specificity (given by the parameter, not read from the property itself) is at least equal to
-//	// the specificity of the conflicting property.
-//	void SetProperty(const String& name, const Rocket::Core::Property& property, int specificity);
-//
-//	PropertyMap properties;
-//};
+	/// Sets a property on the dictionary. Any existing property with a similar name will be overwritten.
+	/// @param[in] name The name of the property to add.
+	/// @param[in] property The value of the new property.
+	void SetProperty(const String& name, const Property& property);
+	/// Removes a property from the dictionary, if it exists.
+	/// @param[in] name The name of the property to remove.
+	void RemoveProperty(const String& name);
+	/// Returns the value of the property with the requested name, if one exists.
+	/// @param[in] name The name of the desired property.
+	const Property* GetProperty(const String& name) const;
+
+	/// Returns the number of properties in the dictionary.
+	/// @return The number of properties in the dictionary.
+	int GetNumProperties() const;
+	/// Returns the map of properties in the dictionary.
+	/// @return The property map.
+	const PropertyMap& GetProperties() const;
+
+	/// Imports into the dictionary, and optionally defines the specificity of, potentially
+	/// un-specified properties. In the case of name conflicts, the incoming properties will
+	/// overwrite the existing properties if their specificity (or their forced specificity)
+	/// are at least equal.
+	/// @param[in] property_dictionary The properties to import.
+	/// @param[in] specificity The specificity for all incoming properties. If this is not specified, the properties will keep their original specificity.
+	void Import(const PropertyDictionary& property_dictionary, int specificity = -1);
+
+	/// Merges the contents of another fully-specified property dictionary with this one.
+	/// Properties defined in the new dictionary will overwrite those with the same name as
+	/// appropriate.
+	/// @param[in] property_dictionary The dictionary to merge.
+	/// @param[in] specificity_offset The specificities of all incoming properties will be offset by this value.
+	void Merge(const PropertyDictionary& property_dictionary, int specificity_offset = 0);
+
+private:
+	// Sets a property on the dictionary and its specificity if there is no name conflict, or its
+	// specificity (given by the parameter, not read from the property itself) is at least equal to
+	// the specificity of the conflicting property.
+	void SetProperty(const String& name, const Rocket::Core::Property& property, int specificity);
+
+	PropertyMap properties;
+};
 
 
 }
 }
 }
 }

+ 11 - 10
Include/Rocket/Core/PropertySpecification.h

@@ -35,6 +35,7 @@
 namespace Rocket {
 namespace Rocket {
 namespace Core {
 namespace Core {
 
 
+class PropertyDictionary;
 struct PropertyShorthandDefinition;
 struct PropertyShorthandDefinition;
 
 
 /**
 /**
@@ -70,30 +71,30 @@ public:
 	/// @param[in] inherited True if this property is inherited from parent to child, false otherwise.
 	/// @param[in] inherited True if this property is inherited from parent to child, false otherwise.
 	/// @param[in] forces_layout True if this property requires its parent to be reformatted if changed.
 	/// @param[in] forces_layout True if this property requires its parent to be reformatted if changed.
 	/// @return The new property definition, ready to have parsers attached.
 	/// @return The new property definition, ready to have parsers attached.
-	PropertyDefinition& RegisterProperty(PropertyId property_id, const String& default_value, bool inherited, bool forces_layout);
+	PropertyDefinition& RegisterProperty(const String& property_name, const String& default_value, bool inherited, bool forces_layout);
 	/// Returns a property definition.
 	/// Returns a property definition.
 	/// @param[in] property_name The name of the desired property.
 	/// @param[in] property_name The name of the desired property.
 	/// @return The appropriate property definition if it could be found, NULL otherwise.
 	/// @return The appropriate property definition if it could be found, NULL otherwise.
-	const PropertyDefinition* GetProperty(PropertyId property_id) const;
+	const PropertyDefinition* GetProperty(const String& property_name) const;
 
 
 	/// Returns the list of the names of all registered property definitions.
 	/// Returns the list of the names of all registered property definitions.
 	/// @return The list with stored property names.
 	/// @return The list with stored property names.
-	const PropertyIdList& GetRegisteredProperties() const;
+	const PropertyNameList& GetRegisteredProperties() const;
 
 
 	/// Returns the list of the names of all registered inherited property definitions.
 	/// Returns the list of the names of all registered inherited property definitions.
 	/// @return The list with stored property names.
 	/// @return The list with stored property names.
-	const PropertyIdList& GetRegisteredInheritedProperties() const;
+	const PropertyNameList& GetRegisteredInheritedProperties() const;
 
 
 	/// Registers a shorthand property definition.
 	/// Registers a shorthand property definition.
 	/// @param[in] shorthand_name The name to register the new shorthand property under.
 	/// @param[in] shorthand_name The name to register the new shorthand property under.
 	/// @param[in] properties A comma-separated list of the properties this definition is shorthand for. The order in which they are specified here is the order in which the values will be processed.
 	/// @param[in] properties A comma-separated list of the properties this definition is shorthand for. The order in which they are specified here is the order in which the values will be processed.
 	/// @param[in] type The type of shorthand to declare.
 	/// @param[in] type The type of shorthand to declare.
 	/// @param True if all the property names exist, false otherwise.
 	/// @param True if all the property names exist, false otherwise.
-	bool RegisterShorthand(PropertyId shorthand_id, const PropertyIdList& property_ids, ShorthandType type = AUTO);
+	bool RegisterShorthand(const String& shorthand_name, const String& property_names, ShorthandType type = AUTO);
 	/// Returns a shorthand definition.
 	/// Returns a shorthand definition.
 	/// @param[in] shorthand_name The name of the desired shorthand.
 	/// @param[in] shorthand_name The name of the desired shorthand.
 	/// @return The appropriate shorthand definition if it could be found, NULL otherwise.
 	/// @return The appropriate shorthand definition if it could be found, NULL otherwise.
-	const PropertyShorthandDefinition* GetShorthand(PropertyId shorthand_id) const;
+	const PropertyShorthandDefinition* GetShorthand(const String& shorthand_name) const;
 
 
 	/// Parses a property declaration, setting any parsed and validated properties on the given dictionary.
 	/// Parses a property declaration, setting any parsed and validated properties on the given dictionary.
 	/// @param dictionary The property dictionary which will hold all declared properties.
 	/// @param dictionary The property dictionary which will hold all declared properties.
@@ -106,13 +107,13 @@ public:
 	void SetPropertyDefaults(PropertyDictionary& dictionary) const;
 	void SetPropertyDefaults(PropertyDictionary& dictionary) const;
 
 
 private:
 private:
-	typedef UnorderedMap< PropertyId, PropertyDefinition* > PropertyMap;
-	typedef UnorderedMap< PropertyId, PropertyShorthandDefinition* > ShorthandMap;
+	typedef UnorderedMap< String, PropertyDefinition* > PropertyMap;
+	typedef UnorderedMap< String, PropertyShorthandDefinition* > ShorthandMap;
 
 
 	PropertyMap properties;
 	PropertyMap properties;
 	ShorthandMap shorthands;
 	ShorthandMap shorthands;
-	PropertyIdList property_names;
-	PropertyIdList inherited_property_names;
+	PropertyNameList property_names;
+	PropertyNameList inherited_property_names;
 
 
 	bool ParsePropertyValues(StringList& values_list, const String& values, bool split_values) const;
 	bool ParsePropertyValues(StringList& values_list, const String& values, bool split_values) const;
 };
 };

+ 1 - 2
Include/Rocket/Core/StyleSheet.h

@@ -41,12 +41,11 @@ class ElementDefinition;
 class StyleSheetNode;
 class StyleSheetNode;
 
 
 struct KeyframeBlock {
 struct KeyframeBlock {
-	KeyframeBlock(float normalized_time) : normalized_time(normalized_time) {}
 	float normalized_time;  // [0, 1]
 	float normalized_time;  // [0, 1]
 	PropertyDictionary properties;
 	PropertyDictionary properties;
 };
 };
 struct Keyframes {
 struct Keyframes {
-	PropertyIdList property_ids;
+	std::vector<String> property_names;
 	std::vector<KeyframeBlock> blocks;
 	std::vector<KeyframeBlock> blocks;
 };
 };
 typedef UnorderedMap<String, Keyframes> KeyframesMap;
 typedef UnorderedMap<String, Keyframes> KeyframesMap;

+ 7 - 7
Include/Rocket/Core/StyleSheetSpecification.h

@@ -66,30 +66,30 @@ public:
 	/// @param[in] inherited True if this property is inherited from parent to child, false otherwise.
 	/// @param[in] inherited True if this property is inherited from parent to child, false otherwise.
 	/// @param[in] forces_layout True if a change in this property on an element will cause the element's layout to possibly change.
 	/// @param[in] forces_layout True if a change in this property on an element will cause the element's layout to possibly change.
 	/// @return The new property definition, ready to have parsers attached.
 	/// @return The new property definition, ready to have parsers attached.
-	static PropertyDefinition& RegisterProperty(PropertyId property_id, const String& default_value, bool inherited, bool forces_layout = false);
+	static PropertyDefinition& RegisterProperty(const String& property_name, const String& default_value, bool inherited, bool forces_layout = false);
 	/// Returns a property definition.
 	/// Returns a property definition.
 	/// @param[in] property_name The name of the desired property.
 	/// @param[in] property_name The name of the desired property.
 	/// @return The appropriate property definition if it could be found, NULL otherwise.
 	/// @return The appropriate property definition if it could be found, NULL otherwise.
-	static const PropertyDefinition* GetProperty(PropertyId id);
+	static const PropertyDefinition* GetProperty(const String& property_name);
 
 
 	/// Returns the list of the names of all registered property definitions.
 	/// Returns the list of the names of all registered property definitions.
 	/// @return The list with stored property names.
 	/// @return The list with stored property names.
-	static const PropertyIdList & GetRegisteredProperties();
+	static const PropertyNameList & GetRegisteredProperties();
 
 
 	/// Returns the list of the names of all registered inherited property definitions.
 	/// Returns the list of the names of all registered inherited property definitions.
 	/// @return The list with stored property names.
 	/// @return The list with stored property names.
-	static const PropertyIdList& GetRegisteredInheritedProperties();
+	static const PropertyNameList & GetRegisteredInheritedProperties();
 
 
 	/// Registers a shorthand property definition.
 	/// Registers a shorthand property definition.
 	/// @param[in] shorthand_name The name to register the new shorthand property under.
 	/// @param[in] shorthand_name The name to register the new shorthand property under.
 	/// @param[in] properties A comma-separated list of the properties this definition is shorthand for. The order in which they are specified here is the order in which the values will be processed.
 	/// @param[in] properties A comma-separated list of the properties this definition is shorthand for. The order in which they are specified here is the order in which the values will be processed.
 	/// @param[in] type The type of shorthand to declare.
 	/// @param[in] type The type of shorthand to declare.
 	/// @param True if all the property names exist, false otherwise.
 	/// @param True if all the property names exist, false otherwise.
-	static bool RegisterShorthand(PropertyId shorthand_id, const PropertyIdList& property_ids, PropertySpecification::ShorthandType type = PropertySpecification::AUTO);
+	static bool RegisterShorthand(const String& shorthand_name, const String& property_names, PropertySpecification::ShorthandType type = PropertySpecification::AUTO);
 	/// Returns a shorthand definition.
 	/// Returns a shorthand definition.
 	/// @param[in] shorthand_name The name of the desired shorthand.
 	/// @param[in] shorthand_name The name of the desired shorthand.
 	/// @return The appropriate shorthand definition if it could be found, NULL otherwise.
 	/// @return The appropriate shorthand definition if it could be found, NULL otherwise.
-	static const PropertyShorthandDefinition* GetShorthand(PropertyId shorthand_id);
+	static const PropertyShorthandDefinition* GetShorthand(const String& shorthand_name);
 
 
 	/// Parses a property declaration, setting any parsed and validated properties on the given dictionary.
 	/// Parses a property declaration, setting any parsed and validated properties on the given dictionary.
 	/// @param[in] dictionary The property dictionary which will hold all declared properties.
 	/// @param[in] dictionary The property dictionary which will hold all declared properties.
@@ -98,7 +98,7 @@ public:
 	/// @param[in] source_file The file where this property was declared. Used for error reporting, debugging and relative paths for referenced assets.
 	/// @param[in] source_file The file where this property was declared. Used for error reporting, debugging and relative paths for referenced assets.
 	/// @param[in] line_number The location of the source file where this property was declared. Used for error reporting and debugging.
 	/// @param[in] line_number The location of the source file where this property was declared. Used for error reporting and debugging.
 	/// @return True if all properties were parsed successfully, false otherwise.
 	/// @return True if all properties were parsed successfully, false otherwise.
-	static bool ParsePropertyDeclaration(PropertyDictionary& dictionary, const String& name, const String& property_value, const String& source_file = "", int source_line_number = 0);
+	static bool ParsePropertyDeclaration(PropertyDictionary& dictionary, const String& property_name, const String& property_value, const String& source_file = "", int source_line_number = 0);
 
 
 private:
 private:
 	StyleSheetSpecification();
 	StyleSheetSpecification();

+ 1 - 1
Include/Rocket/Core/TypeConverter.inl

@@ -380,7 +380,7 @@ public:
 		for (size_t i = 0; i < src.transitions.size(); i++)
 		for (size_t i = 0; i < src.transitions.size(); i++)
 		{
 		{
 			const Transition& t = src.transitions[i];
 			const Transition& t = src.transitions[i];
-			dest += GetName(t.property_id) + " ";
+			dest += t.name + " ";
 			dest += t.tween.to_string() + " ";
 			dest += t.tween.to_string() + " ";
 			if (TypeConverter< float, String >::Convert(t.duration, tmp)) dest += tmp + "s ";
 			if (TypeConverter< float, String >::Convert(t.duration, tmp)) dest += tmp + "s ";
 			if (t.delay > 0.0f && TypeConverter< float, String >::Convert(t.delay, tmp)) dest += tmp + "s ";
 			if (t.delay > 0.0f && TypeConverter< float, String >::Convert(t.delay, tmp)) dest += tmp + "s ";

+ 2 - 13
Include/Rocket/Core/Types.h

@@ -102,31 +102,20 @@ typedef uintptr_t TextureHandle;
 typedef uintptr_t CompiledGeometryHandle;
 typedef uintptr_t CompiledGeometryHandle;
 typedef uintptr_t DecoratorDataHandle;
 typedef uintptr_t DecoratorDataHandle;
 
 
-enum class PropertyId : uint16_t;
-enum class EventId : uint16_t;
-//enum class PseudoId : uint16_t;
-
 // List of elements.
 // List of elements.
 typedef std::vector< Element* > ElementList;
 typedef std::vector< Element* > ElementList;
 typedef std::vector< String > PseudoClassList;
 typedef std::vector< String > PseudoClassList;
 typedef std::unordered_set< String > PropertyNameList;
 typedef std::unordered_set< String > PropertyNameList;
-typedef std::unordered_set< PropertyId > PropertyIdList;
 typedef std::unordered_set< String > AttributeNameList;
 typedef std::unordered_set< String > AttributeNameList;
 typedef std::vector< ElementAnimation > ElementAnimationList;
 typedef std::vector< ElementAnimation > ElementAnimationList;
 
 
-
 // Unordered map
 // Unordered map
 template < typename Key, typename Value>
 template < typename Key, typename Value>
-//using UnorderedMap = robin_hood::unordered_flat_map< Key, Value >;
-using UnorderedMap = std::unordered_map< Key, Value >;
-
-typedef UnorderedMap< PropertyId, Property > PropertyMap;
-using PropertyDictionary = PropertyMap;
-
+using UnorderedMap = robin_hood::unordered_flat_map< Key, Value >;
+typedef UnorderedMap< String, Property > PropertyMap;
 using Dictionary = UnorderedMap< String, Variant >;
 using Dictionary = UnorderedMap< String, Variant >;
 typedef Dictionary ElementAttributes;
 typedef Dictionary ElementAttributes;
 
 
-
 // Reference types
 // Reference types
 typedef std::shared_ptr< Transform > TransformRef;
 typedef std::shared_ptr< Transform > TransformRef;
 
 

+ 0 - 2
Include/Rocket/Core/Variant.inl

@@ -35,8 +35,6 @@ inline Variant::Type Variant::GetType() const
 template< typename T >
 template< typename T >
 Variant::Variant(const T& t) : type(NONE)
 Variant::Variant(const T& t) : type(NONE)
 {
 {
-	static_assert(!std::is_same<PropertyId, T>(), "type can't be PropertyId");
-	static_assert(!std::is_same<EventId, T>(), "type can't be EventId");
 	Set( t );
 	Set( t );
 }
 }
 
 

+ 32 - 33
Samples/basic/animation/src/main.cpp

@@ -55,8 +55,8 @@ public:
 		{
 		{
 			{
 			{
 				//document->GetElementById("title")->SetInnerRML(title);
 				//document->GetElementById("title")->SetInnerRML(title);
-				document->SetProperty(PropertyId::Left, Property(position.x, Property::PX));
-				document->SetProperty(PropertyId::Top, Property(position.y, Property::PX));
+				document->SetProperty("left", Property(position.x, Property::PX));
+				document->SetProperty("top", Property(position.y, Property::PX));
 				//document->Animate("opacity", Property(1.0f, Property::NUMBER), 1.5f, Tween{Tween::Quadratic, Tween::Out}, 1, true, 0.0f);
 				//document->Animate("opacity", Property(1.0f, Property::NUMBER), 1.5f, Tween{Tween::Quadratic, Tween::Out}, 1, true, 0.0f);
 			}
 			}
 
 
@@ -65,64 +65,64 @@ public:
 				auto el = document->GetElementById("start_game");
 				auto el = document->GetElementById("start_game");
 				auto p1 = Transform::MakeProperty({ Transforms::Rotate2D{10.f}, Transforms::TranslateX{100.f} });
 				auto p1 = Transform::MakeProperty({ Transforms::Rotate2D{10.f}, Transforms::TranslateX{100.f} });
 				auto p2 = Transform::MakeProperty({ Transforms::Scale2D{3.f} });
 				auto p2 = Transform::MakeProperty({ Transforms::Scale2D{3.f} });
-				el->Animate(PropertyId::Transform, p1, 1.8f, Tween{ Tween::Elastic, Tween::InOut }, -1, true);
-				el->AddAnimationKey(PropertyId::Transform, p2, 1.3f, Tween{ Tween::Elastic, Tween::InOut });
+				el->Animate("transform", p1, 1.8f, Tween{ Tween::Elastic, Tween::InOut }, -1, true);
+				el->AddAnimationKey("transform", p2, 1.3f, Tween{ Tween::Elastic, Tween::InOut });
 			}
 			}
 			{
 			{
 				auto el = document->GetElementById("high_scores");
 				auto el = document->GetElementById("high_scores");
-				el->Animate(PropertyId::MarginLeft, Property(0.f, Property::PX), 0.3f, Tween{ Tween::Sine, Tween::In }, 10, true, 1.f);
-				el->AddAnimationKey(PropertyId::MarginLeft, Property(100.f, Property::PX), 3.0f, Tween{ Tween::Circular, Tween::Out });
+				el->Animate("margin-left", Property(0.f, Property::PX), 0.3f, Tween{ Tween::Sine, Tween::In }, 10, true, 1.f);
+				el->AddAnimationKey("margin-left", Property(100.f, Property::PX), 3.0f, Tween{ Tween::Circular, Tween::Out });
 			}
 			}
 			{
 			{
 				auto el = document->GetElementById("options");
 				auto el = document->GetElementById("options");
-				el->Animate(PropertyId::ImageColor, Property(Colourb(128, 255, 255, 255), Property::COLOUR), 0.3f, Tween{}, -1, false);
-				el->AddAnimationKey(PropertyId::ImageColor, Property(Colourb(128, 128, 255, 255), Property::COLOUR), 0.3f);
-				el->AddAnimationKey(PropertyId::ImageColor, Property(Colourb(0, 128, 128, 255), Property::COLOUR), 0.3f);
-				el->AddAnimationKey(PropertyId::ImageColor, Property(Colourb(64, 128, 255, 0), Property::COLOUR), 0.9f);
-				el->AddAnimationKey(PropertyId::ImageColor, Property(Colourb(255, 255, 255, 255), Property::COLOUR), 0.3f);
+				el->Animate("image-color", Property(Colourb(128, 255, 255, 255), Property::COLOUR), 0.3f, Tween{}, -1, false);
+				el->AddAnimationKey("image-color", Property(Colourb(128, 128, 255, 255), Property::COLOUR), 0.3f);
+				el->AddAnimationKey("image-color", Property(Colourb(0, 128, 128, 255), Property::COLOUR), 0.3f);
+				el->AddAnimationKey("image-color", Property(Colourb(64, 128, 255, 0), Property::COLOUR), 0.9f);
+				el->AddAnimationKey("image-color", Property(Colourb(255, 255, 255, 255), Property::COLOUR), 0.3f);
 			}
 			}
 			{
 			{
 				auto el = document->GetElementById("help");
 				auto el = document->GetElementById("help");
-				el->Animate(PropertyId::MarginLeft, Property(100.f, Property::PX), 1.0f, Tween{ Tween::Quadratic, Tween::InOut }, -1, true);
+				el->Animate("margin-left", Property(100.f, Property::PX), 1.0f, Tween{ Tween::Quadratic, Tween::InOut }, -1, true);
 			}
 			}
 			{
 			{
 				auto el = document->GetElementById("exit");
 				auto el = document->GetElementById("exit");
 				PropertyDictionary pd;
 				PropertyDictionary pd;
 				StyleSheetSpecification::ParsePropertyDeclaration(pd, "transform", "translate(200px, 200px) rotate(1215deg)");
 				StyleSheetSpecification::ParsePropertyDeclaration(pd, "transform", "translate(200px, 200px) rotate(1215deg)");
-				el->Animate(PropertyId::Transform, pd[PropertyId::Transform], 3.f, Tween{ Tween::Bounce, Tween::Out }, -1);
+				el->Animate("transform", *pd.GetProperty("transform"), 3.f, Tween{ Tween::Bounce, Tween::Out }, -1);
 			}
 			}
 
 
 			// Transform tests
 			// Transform tests
 			{
 			{
 				auto el = document->GetElementById("generic");
 				auto el = document->GetElementById("generic");
-				auto p = Transform::MakeProperty({ Transforms::TranslateY{50, Property::PX}, Transforms::Rotate3D{0.8f, 0, 1, 110, Property::DEG} });
-				el->Animate(PropertyId::Transform, p, 1.3f, Tween{ Tween::Quadratic, Tween::InOut }, -1, true);
+				auto p = Transform::MakeProperty({ Transforms::TranslateY{50, Property::PX}, Transforms::Rotate3D{0.8f, 0, 1, 110, Property::DEG}});
+				el->Animate("transform", p, 1.3f, Tween{Tween::Quadratic, Tween::InOut}, -1, true);
 			}
 			}
 			{
 			{
 				auto el = document->GetElementById("combine");
 				auto el = document->GetElementById("combine");
 				auto p = Transform::MakeProperty({ Transforms::Translate2D{50, 50, Property::PX}, Transforms::Rotate2D(1215) });
 				auto p = Transform::MakeProperty({ Transforms::Translate2D{50, 50, Property::PX}, Transforms::Rotate2D(1215) });
-				el->Animate(PropertyId::Transform, p, 8.0f, Tween{}, -1, true);
+				el->Animate("transform", p, 8.0f, Tween{}, -1, true);
 			}
 			}
 			{
 			{
 				auto el = document->GetElementById("decomposition");
 				auto el = document->GetElementById("decomposition");
 				auto p = Transform::MakeProperty({ Transforms::Translate2D{50, 50, Property::PX}, Transforms::Rotate2D(1215) });
 				auto p = Transform::MakeProperty({ Transforms::Translate2D{50, 50, Property::PX}, Transforms::Rotate2D(1215) });
-				el->Animate(PropertyId::Transform, p, 8.0f, Tween{}, -1, true);
+				el->Animate("transform", p, 8.0f, Tween{}, -1, true);
 			}
 			}
 
 
 			// Mixed units tests
 			// Mixed units tests
 			{
 			{
 				auto el = document->GetElementById("abs_rel");
 				auto el = document->GetElementById("abs_rel");
-				el->Animate(PropertyId::MarginLeft, Property(50.f, Property::PERCENT), 1.5f, Tween{}, -1, true);
+				el->Animate("margin-left", Property(50.f, Property::PERCENT), 1.5f, Tween{}, -1, true);
 			}
 			}
 			{
 			{
 				auto el = document->GetElementById("abs_rel_transform");
 				auto el = document->GetElementById("abs_rel_transform");
 				auto p = Transform::MakeProperty({ Transforms::TranslateX{0, Property::PX} });
 				auto p = Transform::MakeProperty({ Transforms::TranslateX{0, Property::PX} });
-				el->Animate(PropertyId::Transform, p, 1.5f, Tween{}, -1, true);
+				el->Animate("transform", p, 1.5f, Tween{}, -1, true);
 			}
 			}
 			{
 			{
 				auto el = document->GetElementById("animation_event");
 				auto el = document->GetElementById("animation_event");
-				el->Animate(PropertyId::Top, Property(Math::RandomReal(250.f), Property::PX), 1.5f, Tween{ Tween::Cubic, Tween::InOut });
-				el->Animate(PropertyId::Left, Property(Math::RandomReal(250.f), Property::PX), 1.5f, Tween{ Tween::Cubic, Tween::InOut });
+				el->Animate("top", Property(Math::RandomReal(250.f), Property::PX), 1.5f, Tween{ Tween::Cubic, Tween::InOut });
+				el->Animate("left", Property(Math::RandomReal(250.f), Property::PX), 1.5f, Tween{ Tween::Cubic, Tween::InOut });
 			}
 			}
 
 
 			document->Show();
 			document->Show();
@@ -143,7 +143,6 @@ public:
 		  Replace Dictionary with unordered_flat_map: 40.0  [b04b4e5]
 		  Replace Dictionary with unordered_flat_map: 40.0  [b04b4e5]
 		  Dirty flag for structure changes: 43.0  [fdf6f53]
 		  Dirty flag for structure changes: 43.0  [fdf6f53]
 		  Replacing containers: 46.0  [c307140]
 		  Replacing containers: 46.0  [c307140]
-		  Replacing lots of strings with IDs: 55.0
 		
 		
 		*/
 		*/
 		
 		
@@ -234,8 +233,8 @@ void GameLoop()
 		static float ff = 0.0f;
 		static float ff = 0.0f;
 		ff += float(nudge)*0.3f;
 		ff += float(nudge)*0.3f;
 		auto el = window->GetDocument()->GetElementById("exit");
 		auto el = window->GetDocument()->GetElementById("exit");
-		auto f = el->GetProperty<float>(Rocket::Core::PropertyId::MarginLeft);
-		el->SetProperty(Rocket::Core::PropertyId::MarginLeft, Rocket::Core::Property(ff, Rocket::Core::Property::PX));
+		auto f = el->GetProperty<float>("margin-left");
+		el->SetProperty("margin-left", Rocket::Core::Property(ff, Rocket::Core::Property::PX));
 		float f_left = el->GetAbsoluteLeft();
 		float f_left = el->GetAbsoluteLeft();
 		Rocket::Core::Log::Message(Rocket::Core::Log::LT_INFO, "margin-left: '%f'   abs: %f.", ff, f_left);
 		Rocket::Core::Log::Message(Rocket::Core::Log::LT_INFO, "margin-left: '%f'   abs: %f.", ff, f_left);
 		nudge = 0;
 		nudge = 0;
@@ -305,23 +304,23 @@ public:
 			else if (key_identifier == Rocket::Core::Input::KI_LEFT)
 			else if (key_identifier == Rocket::Core::Input::KI_LEFT)
 			{
 			{
 				auto el = context->GetRootElement()->GetElementById("keyevent_response");
 				auto el = context->GetRootElement()->GetElementById("keyevent_response");
-				if (el) el->Animate(PropertyId::Left, Property{ -200.f, Property::PX }, 0.5, Tween{ Tween::Cubic });
+				if (el) el->Animate("left", Property{ -200.f, Property::PX }, 0.5, Tween{ Tween::Cubic });
 			}
 			}
 			else if (key_identifier == Rocket::Core::Input::KI_RIGHT)
 			else if (key_identifier == Rocket::Core::Input::KI_RIGHT)
 			{
 			{
 				auto el = context->GetRootElement()->GetElementById("keyevent_response");
 				auto el = context->GetRootElement()->GetElementById("keyevent_response");
-				if (el) el->Animate(PropertyId::Left, Property{ 200.f, Property::PX }, 0.5, Tween{ Tween::Cubic });
+				if (el) el->Animate("left", Property{ 200.f, Property::PX }, 0.5, Tween{ Tween::Cubic });
 			}
 			}
 			else if (key_identifier == Rocket::Core::Input::KI_UP)
 			else if (key_identifier == Rocket::Core::Input::KI_UP)
 			{
 			{
 				auto el = context->GetRootElement()->GetElementById("keyevent_response");
 				auto el = context->GetRootElement()->GetElementById("keyevent_response");
 				auto offset_right = Property{ 200.f, Property::PX };
 				auto offset_right = Property{ 200.f, Property::PX };
-				if (el) el->Animate(PropertyId::Left, Property{ 0.f, Property::PX }, 0.5, Tween{ Tween::Cubic }, 1, true, 0, &offset_right);
+				if (el) el->Animate("left", Property{ 0.f, Property::PX }, 0.5, Tween{ Tween::Cubic }, 1, true, 0, &offset_right);
 			}
 			}
 			else if (key_identifier == Rocket::Core::Input::KI_DOWN)
 			else if (key_identifier == Rocket::Core::Input::KI_DOWN)
 			{
 			{
 				auto el = context->GetRootElement()->GetElementById("keyevent_response");
 				auto el = context->GetRootElement()->GetElementById("keyevent_response");
-				if (el) el->Animate(PropertyId::Left, Property{ 0.f, Property::PX }, 0.5, Tween{ Tween::Cubic });
+				if (el) el->Animate("left", Property{ 0.f, Property::PX }, 0.5, Tween{ Tween::Cubic });
 			}
 			}
 		}
 		}
 		if (event == "click")
 		if (event == "click")
@@ -337,8 +336,8 @@ public:
 			auto el = event.GetTargetElement();
 			auto el = event.GetTargetElement();
 			if (el->GetId() == "animation_event")
 			if (el->GetId() == "animation_event")
 			{
 			{
-				el->Animate(Rocket::Core::PropertyId::Top, Property(Math::RandomReal(200.f), Property::PX), 1.2f, Tween{ Tween::Cubic, Tween::InOut });
-				el->Animate(Rocket::Core::PropertyId::Left, Property(Math::RandomReal(100.f), Property::PERCENT), 0.8f, Tween{ Tween::Cubic, Tween::InOut });
+				el->Animate("top", Property(Math::RandomReal(200.f), Property::PX), 1.2f, Tween{ Tween::Cubic, Tween::InOut });
+				el->Animate("left", Property(Math::RandomReal(100.f), Property::PERCENT), 0.8f, Tween{ Tween::Cubic, Tween::InOut });
 			}
 			}
 		}
 		}
 	}
 	}
@@ -426,9 +425,9 @@ int main(int ROCKET_UNUSED_PARAMETER(argc), char** ROCKET_UNUSED_PARAMETER(argv)
 	Shell::LoadFonts("assets/");
 	Shell::LoadFonts("assets/");
 
 
 	window = new DemoWindow("Animation sample", Rocket::Core::Vector2f(81, 100), context);
 	window = new DemoWindow("Animation sample", Rocket::Core::Vector2f(81, 100), context);
-	window->GetDocument()->AddEventListener(Rocket::Core::EventId::Keydown, new Event("hello"));
-	window->GetDocument()->AddEventListener(Rocket::Core::EventId::Keyup, new Event("hello"));
-	window->GetDocument()->AddEventListener(Rocket::Core::EventId::Animationend, new Event("hello"));
+	window->GetDocument()->AddEventListener("keydown", new Event("hello"));
+	window->GetDocument()->AddEventListener("keyup", new Event("hello"));
+	window->GetDocument()->AddEventListener("animationend", new Event("hello"));
 
 
 
 
 	Shell::EventLoop(GameLoop);
 	Shell::EventLoop(GameLoop);

+ 1 - 15
Source/Controls/Controls.cpp

@@ -26,7 +26,6 @@
  */
  */
 
 
 #include "../../Include/Rocket/Controls/Controls.h"
 #include "../../Include/Rocket/Controls/Controls.h"
-#include "../../Include/Rocket/Controls/ID.h"
 #include "../../Include/Rocket/Core/ElementInstancerGeneric.h"
 #include "../../Include/Rocket/Core/ElementInstancerGeneric.h"
 #include "../../Include/Rocket/Core/Factory.h"
 #include "../../Include/Rocket/Core/Factory.h"
 #include "../../Include/Rocket/Core/StyleSheetSpecification.h"
 #include "../../Include/Rocket/Core/StyleSheetSpecification.h"
@@ -42,9 +41,6 @@
 namespace Rocket {
 namespace Rocket {
 namespace Controls {
 namespace Controls {
 
 
-// See ID.cpp (not exposed to header file)
-void InitialiseIDs();
-
 // Registers the custom element instancers.
 // Registers the custom element instancers.
 void RegisterElementInstancers()
 void RegisterElementInstancers()
 {
 {
@@ -130,9 +126,7 @@ void Initialise()
 	// Prevent double initialisation
 	// Prevent double initialisation
 	if (!initialised)
 	if (!initialised)
 	{
 	{
-		InitialiseIDs();
-
-		Core::StyleSheetSpecification::RegisterProperty(PropertyId::MinRows, "0", false, false).AddParser("number");
+		Core::StyleSheetSpecification::RegisterProperty("min-rows", "0", false, false).AddParser("number");
 
 
 		// Register the element instancers for our custom elements.
 		// Register the element instancers for our custom elements.
 		RegisterElementInstancers();
 		RegisterElementInstancers();
@@ -147,13 +141,5 @@ void Initialise()
 	}
 	}
 }
 }
 
 
-
-
-namespace ControlsPropertyId {
-
-	Core::PropertyId ColumnAdd;
-
-}
-
 }
 }
 }
 }

+ 11 - 12
Source/Controls/ElementDataGrid.cpp

@@ -27,7 +27,6 @@
 
 
 #include "../../Include/Rocket/Controls/ElementDataGrid.h"
 #include "../../Include/Rocket/Controls/ElementDataGrid.h"
 #include "../../Include/Rocket/Controls/DataSource.h"
 #include "../../Include/Rocket/Controls/DataSource.h"
-#include "../../Include/Rocket/Controls/ID.h"
 #include "../../Include/Rocket/Core/Math.h"
 #include "../../Include/Rocket/Core/Math.h"
 #include "../../Include/Rocket/Core/XMLParser.h"
 #include "../../Include/Rocket/Core/XMLParser.h"
 #include "../../Include/Rocket/Core/Event.h"
 #include "../../Include/Rocket/Core/Event.h"
@@ -46,24 +45,24 @@ ElementDataGrid::ElementDataGrid(const Rocket::Core::String& tag) : Core::Elemen
 
 
 	// Create the row for the column headers:
 	// Create the row for the column headers:
 	header = dynamic_cast< ElementDataGridRow* >(Core::Factory::InstanceElement(this, "#rktctl_datagridrow", "datagridheader", attributes));
 	header = dynamic_cast< ElementDataGridRow* >(Core::Factory::InstanceElement(this, "#rktctl_datagridrow", "datagridheader", attributes));
-	header->SetProperty(Core::PropertyId::Display, "block");
+	header->SetProperty("display", "block");
 	header->Initialise(this);
 	header->Initialise(this);
 	AppendChild(header);
 	AppendChild(header);
 	header->RemoveReference();
 	header->RemoveReference();
 
 
 	body = Core::Factory::InstanceElement(this, "*", "datagridbody", attributes);
 	body = Core::Factory::InstanceElement(this, "*", "datagridbody", attributes);
-	body->SetProperty(Core::PropertyId::Display, "none");
-	body->SetProperty(Core::PropertyId::Width, "auto");
+	body->SetProperty("display", "none");
+	body->SetProperty("width", "auto");
 	AppendChild(body);
 	AppendChild(body);
 	body->RemoveReference();
 	body->RemoveReference();
 
 
 	body_visible = false;
 	body_visible = false;
 
 
 	root = dynamic_cast< ElementDataGridRow* >(Core::Factory::InstanceElement(this, "#rktctl_datagridrow", "datagridroot", attributes));
 	root = dynamic_cast< ElementDataGridRow* >(Core::Factory::InstanceElement(this, "#rktctl_datagridrow", "datagridroot", attributes));
-	root->SetProperty(Core::PropertyId::Display, "none");
+	root->SetProperty("display", "none");
 	root->Initialise(this);
 	root->Initialise(this);
 
 
-	SetProperty(Core::PropertyId::Overflow, "auto");
+	SetProperty("overflow", "auto");
 
 
 	new_data_source = "";
 	new_data_source = "";
 }
 }
@@ -109,11 +108,11 @@ void ElementDataGrid::AddColumn(const Rocket::Core::String& fields, const Rocket
 	// The header elements are added to the header row at the top of the table.
 	// The header elements are added to the header row at the top of the table.
 	if (header_element)
 	if (header_element)
 	{
 	{
-		header_element->SetProperty(Core::PropertyId::Display, "inline-block");
+		header_element->SetProperty("display", "inline-block");
 
 
 		// Push all the width properties from the column onto the header element.
 		// Push all the width properties from the column onto the header element.
 		Rocket::Core::String width = header_element->GetAttribute<Rocket::Core::String>("width", "100%");
 		Rocket::Core::String width = header_element->GetAttribute<Rocket::Core::String>("width", "100%");
-		header_element->SetProperty(Core::PropertyId::Width, width);
+		header_element->SetProperty("width", width);
 
 
 		header->AppendChild(header_element);
 		header->AppendChild(header_element);
 	}
 	}
@@ -140,7 +139,7 @@ void ElementDataGrid::AddColumn(const Rocket::Core::String& fields, const Rocket
 
 
 	Rocket::Core::Dictionary parameters;
 	Rocket::Core::Dictionary parameters;
 	parameters["index"] = (int)(columns.size() - 1);
 	parameters["index"] = (int)(columns.size() - 1);
-	DispatchEvent(EventId::Columnadd, parameters);
+	DispatchEvent("columnadd", parameters);
 }
 }
 
 
 // Returns the number of columns in this table
 // Returns the number of columns in this table
@@ -235,12 +234,12 @@ void ElementDataGrid::OnUpdate()
 	bool any_new_children = root->UpdateChildren();
 	bool any_new_children = root->UpdateChildren();
 	if (any_new_children)
 	if (any_new_children)
 	{
 	{
-		DispatchEvent(EventId::Rowupdate, Rocket::Core::Dictionary());
+		DispatchEvent("rowupdate", Rocket::Core::Dictionary());
 	}
 	}
 	
 	
-	if (!body_visible && (!any_new_children || root->GetNumLoadedChildren() >= Rocket::Core::Math::RealToInteger(ResolveProperty(PropertyId::MinRows, 0))))
+	if (!body_visible && (!any_new_children || root->GetNumLoadedChildren() >= Rocket::Core::Math::RealToInteger(ResolveProperty("min-rows", 0))))
 	{
 	{
-		body->SetProperty(Core::PropertyId::Display, "block");
+		body->SetProperty("display", "block");
 		body_visible = true;
 		body_visible = true;
 	}
 	}
 	
 	

+ 5 - 5
Source/Controls/ElementDataGridCell.cpp

@@ -40,7 +40,7 @@ ElementDataGridCell::ElementDataGridCell(const Rocket::Core::String& tag) : Core
 ElementDataGridCell::~ElementDataGridCell()
 ElementDataGridCell::~ElementDataGridCell()
 {
 {
 	if (header) {
 	if (header) {
-		header->RemoveEventListener(Core::EventId::Resize, this);
+		header->RemoveEventListener("resize", this);
 		header->RemoveReference();
 		header->RemoveReference();
 	}
 	}
 }
 }
@@ -52,8 +52,8 @@ void ElementDataGridCell::Initialise(int _column, Core::Element* _header)
 	if (header)
 	if (header)
 	{
 	{
 		header->AddReference();
 		header->AddReference();
-		header->AddEventListener(Core::EventId::Resize, this);
-		SetProperty(Core::PropertyId::Width, Core::Property(header->GetBox().GetSize(Core::Box::MARGIN).x, Core::Property::PX));
+		header->AddEventListener("resize", this);
+		SetProperty("width", Core::Property(header->GetBox().GetSize(Core::Box::MARGIN).x, Core::Property::PX));
 	}
 	}
 }
 }
 
 
@@ -66,11 +66,11 @@ void ElementDataGridCell::ProcessEvent(Core::Event& event)
 {
 {
 	Core::Element::ProcessEvent(event);
 	Core::Element::ProcessEvent(event);
 
 
-	if (event == Core::EventId::Resize)
+	if (event == "resize")
 	{
 	{
 		if (event.GetTargetElement() == header)
 		if (event.GetTargetElement() == header)
 		{
 		{
-			SetProperty(Core::PropertyId::Width, Core::Property(header->GetBox().GetSize(Core::Box::MARGIN).x, Core::Property::PX));
+			SetProperty("width", Core::Property(header->GetBox().GetSize(Core::Box::MARGIN).x, Core::Property::PX));
 		}
 		}
 	}
 	}
 }
 }

+ 9 - 10
Source/Controls/ElementDataGridRow.cpp

@@ -31,7 +31,6 @@
 #include "../../Include/Rocket/Controls/DataFormatter.h"
 #include "../../Include/Rocket/Controls/DataFormatter.h"
 #include "../../Include/Rocket/Controls/ElementDataGrid.h"
 #include "../../Include/Rocket/Controls/ElementDataGrid.h"
 #include "../../Include/Rocket/Controls/ElementDataGridCell.h"
 #include "../../Include/Rocket/Controls/ElementDataGridCell.h"
-#include "../../Include/Rocket/Controls/ID.h"
 #include "../Core/Clock.h"
 #include "../Core/Clock.h"
 
 
 namespace Rocket {
 namespace Rocket {
@@ -54,8 +53,8 @@ ElementDataGridRow::ElementDataGridRow(const Rocket::Core::String& tag) : Core::
 	dirty_children = false;
 	dirty_children = false;
 	row_expanded = true;
 	row_expanded = true;
 
 
-	SetProperty(Core::PropertyId::WhiteSpace, "nowrap");
-	SetProperty(Core::PropertyId::Display, Rocket::Core::Property(Rocket::Core::DISPLAY_INLINE_BLOCK, Rocket::Core::Property::KEYWORD));
+	SetProperty("white-space", "nowrap");
+	SetProperty("display", Rocket::Core::Property(Rocket::Core::DISPLAY_INLINE_BLOCK, Rocket::Core::Property::KEYWORD));
 }
 }
 
 
 ElementDataGridRow::~ElementDataGridRow()
 ElementDataGridRow::~ElementDataGridRow()
@@ -86,7 +85,7 @@ void ElementDataGridRow::Initialise(ElementDataGrid* _parent_grid, ElementDataGr
 	{
 	{
 		ElementDataGridCell* cell = dynamic_cast< ElementDataGridCell* >(Core::Factory::InstanceElement(this, "#rktctl_datagridcell", "datagridcell", cell_attributes));
 		ElementDataGridCell* cell = dynamic_cast< ElementDataGridCell* >(Core::Factory::InstanceElement(this, "#rktctl_datagridcell", "datagridcell", cell_attributes));
 		cell->Initialise(i, header_row->GetChild(i));
 		cell->Initialise(i, header_row->GetChild(i));
-		cell->SetProperty(Core::PropertyId::Display, Rocket::Core::Property(Rocket::Core::DISPLAY_INLINE_BLOCK, Rocket::Core::Property::KEYWORD));
+		cell->SetProperty("display", Rocket::Core::Property(Rocket::Core::DISPLAY_INLINE_BLOCK, Rocket::Core::Property::KEYWORD));
 		AppendChild(cell);
 		AppendChild(cell);
 		cell->RemoveReference();
 		cell->RemoveReference();
 	}
 	}
@@ -388,7 +387,7 @@ void ElementDataGridRow::AddChildren(int first_row_added, int num_rows_added)
 
 
 			if (!row_expanded)
 			if (!row_expanded)
 			{
 			{
-				new_row->SetProperty(Core::PropertyId::Display, "none");
+				new_row->SetProperty("display", "none");
 			}
 			}
 		}
 		}
 
 
@@ -412,7 +411,7 @@ void ElementDataGridRow::AddChildren(int first_row_added, int num_rows_added)
 	Rocket::Core::Dictionary parameters;
 	Rocket::Core::Dictionary parameters;
 	parameters["first_row_added"] = GetChildTableRelativeIndex(first_row_added);
 	parameters["first_row_added"] = GetChildTableRelativeIndex(first_row_added);
 	parameters["num_rows_added"] = num_rows_added;
 	parameters["num_rows_added"] = num_rows_added;
-	parent_grid->DispatchEvent(EventId::Rowadd, parameters);
+	parent_grid->DispatchEvent("rowadd", parameters);
 }
 }
 
 
 void ElementDataGridRow::RemoveChildren(int first_row_removed, int num_rows_removed)
 void ElementDataGridRow::RemoveChildren(int first_row_removed, int num_rows_removed)
@@ -444,7 +443,7 @@ void ElementDataGridRow::RemoveChildren(int first_row_removed, int num_rows_remo
 	Rocket::Core::Dictionary parameters;
 	Rocket::Core::Dictionary parameters;
 	parameters["first_row_removed"] = GetChildTableRelativeIndex(first_row_removed);
 	parameters["first_row_removed"] = GetChildTableRelativeIndex(first_row_removed);
 	parameters["num_rows_removed"] = num_rows_removed;
 	parameters["num_rows_removed"] = num_rows_removed;
-	parent_grid->DispatchEvent(EventId::Rowremove, parameters);
+	parent_grid->DispatchEvent("rowremove", parameters);
 }
 }
 
 
 void ElementDataGridRow::ChangeChildren(int first_row_changed, int num_rows_changed)
 void ElementDataGridRow::ChangeChildren(int first_row_changed, int num_rows_changed)
@@ -455,7 +454,7 @@ void ElementDataGridRow::ChangeChildren(int first_row_changed, int num_rows_chan
 	Rocket::Core::Dictionary parameters;
 	Rocket::Core::Dictionary parameters;
 	parameters["first_row_changed"] = GetChildTableRelativeIndex(first_row_changed);
 	parameters["first_row_changed"] = GetChildTableRelativeIndex(first_row_changed);
 	parameters["num_rows_changed"] = num_rows_changed;
 	parameters["num_rows_changed"] = num_rows_changed;
-	parent_grid->DispatchEvent(EventId::Rowchange, parameters);
+	parent_grid->DispatchEvent("rowchange", parameters);
 }
 }
 
 
 // Returns the number of rows under this row (children, grandchildren, etc)
 // Returns the number of rows under this row (children, grandchildren, etc)
@@ -672,7 +671,7 @@ void ElementDataGridRow::DirtyRow()
 // Sets this row's child rows to be visible.
 // Sets this row's child rows to be visible.
 void ElementDataGridRow::Show()
 void ElementDataGridRow::Show()
 {
 {
-	SetProperty(Core::PropertyId::Display, "inline-block");
+	SetProperty("display", "inline-block");
 
 
 	if (row_expanded)
 	if (row_expanded)
 	{
 	{
@@ -686,7 +685,7 @@ void ElementDataGridRow::Show()
 // Sets this row's children to be invisible.
 // Sets this row's children to be invisible.
 void ElementDataGridRow::Hide()
 void ElementDataGridRow::Hide()
 {
 {
-	SetProperty(Core::PropertyId::Display, "none");
+	SetProperty("display", "none");
 
 
 	for (size_t i = 0; i < children.size(); i++)
 	for (size_t i = 0; i < children.size(); i++)
 	{
 	{

+ 1 - 2
Source/Controls/ElementForm.cpp

@@ -29,7 +29,6 @@
 #include "../../Include/Rocket/Core/Dictionary.h"
 #include "../../Include/Rocket/Core/Dictionary.h"
 #include "../../Include/Rocket/Core/ElementUtilities.h"
 #include "../../Include/Rocket/Core/ElementUtilities.h"
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
-#include "../../Include/Rocket/Controls/ID.h"
 
 
 namespace Rocket {
 namespace Rocket {
 namespace Controls {
 namespace Controls {
@@ -87,7 +86,7 @@ void ElementForm::Submit(const Rocket::Core::String& name, const Rocket::Core::S
 			values[control_name] = control_value;
 			values[control_name] = control_value;
 	}
 	}
 
 
-	DispatchEvent(EventId::Submit, values);
+	DispatchEvent("submit", values);
 }
 }
 
 
 }
 }

+ 1 - 2
Source/Controls/ElementFormControl.cpp

@@ -26,14 +26,13 @@
  */
  */
 
 
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
-#include "../../Include/Rocket/Controls/ID.h"
 
 
 namespace Rocket {
 namespace Rocket {
 namespace Controls {
 namespace Controls {
 
 
 ElementFormControl::ElementFormControl(const Rocket::Core::String& tag) : Core::Element(tag)
 ElementFormControl::ElementFormControl(const Rocket::Core::String& tag) : Core::Element(tag)
 {
 {
-	SetProperty(PropertyId::TabIndex, "auto");
+	SetProperty("tab-index", "auto");
 }
 }
 
 
 ElementFormControl::~ElementFormControl()
 ElementFormControl::~ElementFormControl()

+ 1 - 1
Source/Controls/ElementFormControlInput.cpp

@@ -127,7 +127,7 @@ void ElementFormControlInput::OnAttributeChange(const Core::AttributeNameList& c
 }
 }
 
 
 // Called when properties on the element are changed.
 // Called when properties on the element are changed.
-void ElementFormControlInput::OnPropertyChange(const Core::PropertyIdList& changed_properties)
+void ElementFormControlInput::OnPropertyChange(const Core::PropertyNameList& changed_properties)
 {
 {
 	ElementFormControl::OnPropertyChange(changed_properties);
 	ElementFormControl::OnPropertyChange(changed_properties);
 
 

+ 7 - 7
Source/Controls/ElementFormControlTextArea.cpp

@@ -39,8 +39,8 @@ ElementFormControlTextArea::ElementFormControlTextArea(const Rocket::Core::Strin
 {
 {
 	widget = new WidgetTextInputMultiLine(this);
 	widget = new WidgetTextInputMultiLine(this);
 
 
-	SetProperty(Core::PropertyId::Overflow, "auto");
-	SetProperty(Core::PropertyId::WhiteSpace, "pre-wrap");
+	SetProperty("overflow", "auto");
+	SetProperty("white-space", "pre-wrap");
 }
 }
 
 
 ElementFormControlTextArea::~ElementFormControlTextArea()
 ElementFormControlTextArea::~ElementFormControlTextArea()
@@ -151,9 +151,9 @@ void ElementFormControlTextArea::OnAttributeChange(const Core::AttributeNameList
 	if (changed_attributes.find("wrap") != changed_attributes.end())
 	if (changed_attributes.find("wrap") != changed_attributes.end())
 	{
 	{
 		if (GetWordWrap())
 		if (GetWordWrap())
-			SetProperty(Core::PropertyId::WhiteSpace, "pre-wrap");
+			SetProperty("white-space", "pre-wrap");
 		else
 		else
-			SetProperty(Core::PropertyId::WhiteSpace, "pre");
+			SetProperty("white-space", "pre");
 	}
 	}
 
 
 	if (changed_attributes.find("rows") != changed_attributes.end() ||
 	if (changed_attributes.find("rows") != changed_attributes.end() ||
@@ -168,12 +168,12 @@ void ElementFormControlTextArea::OnAttributeChange(const Core::AttributeNameList
 }
 }
 
 
 // Called when properties on the control are changed.
 // Called when properties on the control are changed.
-void ElementFormControlTextArea::OnPropertyChange(const Core::PropertyIdList& changed_properties)
+void ElementFormControlTextArea::OnPropertyChange(const Core::PropertyNameList& changed_properties)
 {
 {
 	ElementFormControl::OnPropertyChange(changed_properties);
 	ElementFormControl::OnPropertyChange(changed_properties);
 
 
-	if (changed_properties.find(Core::PropertyId::Color) != changed_properties.end() ||
-		changed_properties.find(Core::PropertyId::BackgroundColor) != changed_properties.end())
+	if (changed_properties.find("color") != changed_properties.end() ||
+		changed_properties.find("background-color") != changed_properties.end())
 		widget->UpdateSelectionColours();
 		widget->UpdateSelectionColours();
 }
 }
 
 

+ 8 - 9
Source/Controls/ElementTabSet.cpp

@@ -26,7 +26,6 @@
  */
  */
 
 
 #include "../../Include/Rocket/Controls/ElementTabSet.h"
 #include "../../Include/Rocket/Controls/ElementTabSet.h"
-#include "../../Include/Rocket/Controls/ID.h"
 #include "../../Include/Rocket/Core/Math.h"
 #include "../../Include/Rocket/Core/Math.h"
 #include "../../Include/Rocket/Core/Factory.h"
 #include "../../Include/Rocket/Core/Factory.h"
 
 
@@ -125,15 +124,15 @@ void ElementTabSet::SetActiveTab(int tab_index)
 		Core::Element* new_window = windows->GetChild(tab_index);
 		Core::Element* new_window = windows->GetChild(tab_index);
 
 
 		if (old_window)
 		if (old_window)
-			old_window->SetProperty(Core::PropertyId::Display, "none");
+			old_window->SetProperty("display", "none");			
 		if (new_window)
 		if (new_window)
-			new_window->SetProperty(Core::PropertyId::Display, "inline-block");
+			new_window->SetProperty("display", "inline-block");
 
 
 		active_tab = tab_index;
 		active_tab = tab_index;
 
 
 		Rocket::Core::Dictionary parameters;
 		Rocket::Core::Dictionary parameters;
 		parameters["tab_index"] = active_tab;
 		parameters["tab_index"] = active_tab;
-		DispatchEvent(EventId::Tabchange, parameters);
+		DispatchEvent("tabchange", parameters);
 	}
 	}
 }
 }
 
 
@@ -181,8 +180,8 @@ void ElementTabSet::OnChildAdd(Core::Element* child)
 	if (child->GetParentNode() == GetChildByTag("tabs"))
 	if (child->GetParentNode() == GetChildByTag("tabs"))
 	{
 	{
 		// Set up the new button and append it
 		// Set up the new button and append it
-		child->SetProperty(Core::PropertyId::Display, "inline-block");
-		child->AddEventListener(Core::EventId::Click, this);
+		child->SetProperty("display", "inline-block");
+		child->AddEventListener("click", this);
 
 
 		if (child->GetParentNode()->GetChild(active_tab) == child)
 		if (child->GetParentNode()->GetChild(active_tab) == child)
 			child->SetPseudoClass("selected", true);
 			child->SetPseudoClass("selected", true);
@@ -191,11 +190,11 @@ void ElementTabSet::OnChildAdd(Core::Element* child)
 	if (child->GetParentNode() == GetChildByTag("panels"))
 	if (child->GetParentNode() == GetChildByTag("panels"))
 	{
 	{
 		// Hide the new tab window
 		// Hide the new tab window
-		child->SetProperty(Core::PropertyId::Display, "none");
+		child->SetProperty("display", "none");
 		
 		
 		// Make the new element visible if its the active tab
 		// Make the new element visible if its the active tab
 		if (child->GetParentNode()->GetChild(active_tab) == child)
 		if (child->GetParentNode()->GetChild(active_tab) == child)
-			child->SetProperty(Core::PropertyId::Display, "inline-block");
+			child->SetProperty("display", "inline-block");
 	}
 	}
 }
 }
 
 
@@ -206,7 +205,7 @@ void ElementTabSet::OnChildRemove(Core::Element* child)
 	// If its a tab, remove its event listener
 	// If its a tab, remove its event listener
 	if (child->GetParentNode() == GetChildByTag("tabs"))
 	if (child->GetParentNode() == GetChildByTag("tabs"))
 	{
 	{
-		child->RemoveEventListener(Core::EventId::Click, this);
+		child->RemoveEventListener("click", this);
 	}
 	}
 }
 }
 
 

+ 3 - 3
Source/Controls/ElementTextSelection.cpp

@@ -47,7 +47,7 @@ void ElementTextSelection::SetWidget(WidgetTextInput* _widget)
 }
 }
 
 
 // Processes 'color' and 'background-color' property changes.
 // Processes 'color' and 'background-color' property changes.
-void ElementTextSelection::OnPropertyChange(const Rocket::Core::PropertyIdList& changed_properties)
+void ElementTextSelection::OnPropertyChange(const Rocket::Core::PropertyNameList& changed_properties)
 {
 {
 	Element::OnPropertyChange(changed_properties);
 	Element::OnPropertyChange(changed_properties);
 
 
@@ -55,8 +55,8 @@ void ElementTextSelection::OnPropertyChange(const Rocket::Core::PropertyIdList&
 		return;
 		return;
 
 
 	// Check for a colour change.
 	// Check for a colour change.
-	if (changed_properties.find(Core::PropertyId::Color) != changed_properties.end() ||
-		changed_properties.find(Core::PropertyId::BackgroundColor) != changed_properties.end())
+	if (changed_properties.find("color") != changed_properties.end() ||
+		changed_properties.find("background-color") != changed_properties.end())
 	{
 	{
 		widget->UpdateSelectionColours();
 		widget->UpdateSelectionColours();
 	}
 	}

+ 1 - 1
Source/Controls/ElementTextSelection.h

@@ -54,7 +54,7 @@ public:
 
 
 protected:
 protected:
 	/// Processes 'color' and 'background-color' property changes.
 	/// Processes 'color' and 'background-color' property changes.
-	virtual void OnPropertyChange(const Rocket::Core::PropertyIdList& changed_properties);
+	virtual void OnPropertyChange(const Rocket::Core::PropertyNameList& changed_properties);
 
 
 private:
 private:
 	WidgetTextInput* widget;
 	WidgetTextInput* widget;

+ 0 - 83
Source/Controls/ID.cpp

@@ -1,83 +0,0 @@
-/*
- * This source file is part of libRocket, the HTML/CSS Interface Middleware
- *
- * For the latest information, see http://www.librocket.com
- *
- * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-#include "../../Include/Rocket/Controls/ID.h"
-
-namespace Rocket {
-namespace Controls {
-
-
-// All ID values are undefined until Rocket::Controls::Initialise
-
-namespace PropertyId {
-
-Core::PropertyId MinRows;
-Core::PropertyId TabIndex;
-
-}
-
-namespace EventId {
-
-Core::EventId Columnadd;
-Core::EventId Rowadd;
-Core::EventId Rowchange;
-Core::EventId Rowremove;
-Core::EventId Rowupdate;
-
-Core::EventId Submit;
-Core::EventId Change;
-
-Core::EventId Tabchange;
-
-}
-
-// Called from Rocket::Controls::Initialise (not exposed to header file)
-void InitialiseIDs()
-{
-	{
-		using namespace PropertyId;
-		MinRows = Rocket::Core::CreateOrGetPropertyId("min-rows");
-		TabIndex = Rocket::Core::CreateOrGetPropertyId("tab-index");
-	}
-
-	{	
-		using namespace EventId;
-		Columnadd = Rocket::Core::CreateOrGetEventId("columnadd");
-		Rowadd = Rocket::Core::CreateOrGetEventId("rowadd");
-		Rowchange = Rocket::Core::CreateOrGetEventId("rowchange");
-		Rowremove = Rocket::Core::CreateOrGetEventId("rowremove");
-		Rowupdate = Rocket::Core::CreateOrGetEventId("rowupdate");
-
-		Submit = Rocket::Core::CreateOrGetEventId("submit");
-		Change = Rocket::Core::CreateOrGetEventId("change");
-
-		Tabchange = Rocket::Core::CreateOrGetEventId("tabchange");
-	}
-}
-
-}
-}

+ 1 - 1
Source/Controls/InputType.cpp

@@ -70,7 +70,7 @@ bool InputType::OnAttributeChange(const Core::AttributeNameList& ROCKET_UNUSED_P
 }
 }
 
 
 // Called when properties on the control are changed.
 // Called when properties on the control are changed.
-void InputType::OnPropertyChange(const Core::PropertyIdList& ROCKET_UNUSED_PARAMETER(changed_properties))
+void InputType::OnPropertyChange(const Core::PropertyNameList& ROCKET_UNUSED_PARAMETER(changed_properties))
 {
 {
 	ROCKET_UNUSED(changed_properties);
 	ROCKET_UNUSED(changed_properties);
 }
 }

+ 1 - 1
Source/Controls/InputType.h

@@ -69,7 +69,7 @@ public:
 	virtual bool OnAttributeChange(const Core::AttributeNameList& changed_attributes);
 	virtual bool OnAttributeChange(const Core::AttributeNameList& changed_attributes);
 	/// Called when properties on the control are changed.
 	/// Called when properties on the control are changed.
 	/// @param[in] changed_properties The properties changed on the element.
 	/// @param[in] changed_properties The properties changed on the element.
-	virtual void OnPropertyChange(const Core::PropertyIdList& changed_properties);
+	virtual void OnPropertyChange(const Core::PropertyNameList& changed_properties);
 
 
 	/// Called when the element is added into a hierarchy.
 	/// Called when the element is added into a hierarchy.
 	virtual void OnChildAdd();
 	virtual void OnChildAdd();

+ 4 - 4
Source/Controls/InputTypeButton.cpp

@@ -81,8 +81,8 @@ void InputTypeButton::OnChildAdd()
 	if (document == NULL)
 	if (document == NULL)
 		return;
 		return;
 
 
-	document->AddEventListener(Core::EventId::Click, this, true);
-	document->AddEventListener(Core::EventId::Dblclick, this, true);
+	document->AddEventListener("click", this, true);
+	document->AddEventListener("dblclick", this, true);
 }
 }
 
 
 // Called when the element is removed from a hierarchy.
 // Called when the element is removed from a hierarchy.
@@ -90,8 +90,8 @@ void InputTypeButton::OnChildRemove()
 {
 {
 	if (document != NULL)
 	if (document != NULL)
 	{
 	{
-		document->RemoveEventListener(Core::EventId::Click, this, true);
-		document->RemoveEventListener(Core::EventId::Dblclick, this, true);
+		document->RemoveEventListener("click", this, true);
+		document->RemoveEventListener("dblclick", this, true);
 		document = NULL;
 		document = NULL;
 	}
 	}
 }
 }

+ 1 - 2
Source/Controls/InputTypeCheckbox.cpp

@@ -27,7 +27,6 @@
 
 
 #include "InputTypeCheckbox.h"
 #include "InputTypeCheckbox.h"
 #include "../../Include/Rocket/Controls/ElementFormControlInput.h"
 #include "../../Include/Rocket/Controls/ElementFormControlInput.h"
-#include "../../Include/Rocket/Controls/ID.h"
 
 
 namespace Rocket {
 namespace Rocket {
 namespace Controls {
 namespace Controls {
@@ -57,7 +56,7 @@ bool InputTypeCheckbox::OnAttributeChange(const Core::AttributeNameList& changed
 
 
 		Rocket::Core::Dictionary parameters;
 		Rocket::Core::Dictionary parameters;
 		parameters["value"] = Rocket::Core::String(checked ? GetValue() : "");
 		parameters["value"] = Rocket::Core::String(checked ? GetValue() : "");
-		element->DispatchEvent(EventId::Change, parameters);
+		element->DispatchEvent("change", parameters);
 	}
 	}
 
 
 	return true;
 	return true;

+ 1 - 2
Source/Controls/InputTypeRadio.cpp

@@ -29,7 +29,6 @@
 #include "../../Include/Rocket/Controls/ElementFormControlInput.h"
 #include "../../Include/Rocket/Controls/ElementFormControlInput.h"
 #include "../../Include/Rocket/Core/ElementUtilities.h"
 #include "../../Include/Rocket/Core/ElementUtilities.h"
 #include "../../Include/Rocket/Controls/ElementForm.h"
 #include "../../Include/Rocket/Controls/ElementForm.h"
-#include "../../Include/Rocket/Controls/ID.h"
 
 
 namespace Rocket {
 namespace Rocket {
 namespace Controls {
 namespace Controls {
@@ -64,7 +63,7 @@ bool InputTypeRadio::OnAttributeChange(const Core::AttributeNameList& changed_at
 
 
 		Rocket::Core::Dictionary parameters;
 		Rocket::Core::Dictionary parameters;
 		parameters["value"] = Rocket::Core::String(checked ? GetValue() : "");
 		parameters["value"] = Rocket::Core::String(checked ? GetValue() : "");
-		element->DispatchEvent(EventId::Change, parameters);
+		element->DispatchEvent("change", parameters);
 	}
 	}
 
 
 	return true;
 	return true;

+ 3 - 3
Source/Controls/InputTypeText.cpp

@@ -88,10 +88,10 @@ bool InputTypeText::OnAttributeChange(const Core::AttributeNameList& changed_att
 }
 }
 
 
 // Called when properties on the control are changed.
 // Called when properties on the control are changed.
-void InputTypeText::OnPropertyChange(const Core::PropertyIdList& changed_properties)
+void InputTypeText::OnPropertyChange(const Core::PropertyNameList& changed_properties)
 {
 {
-	if (changed_properties.find(Core::PropertyId::Color) != changed_properties.end() ||
-		changed_properties.find(Core::PropertyId::BackgroundColor) != changed_properties.end())
+	if (changed_properties.find("color") != changed_properties.end() ||
+		changed_properties.find("background-color") != changed_properties.end())
 		widget->UpdateSelectionColours();
 		widget->UpdateSelectionColours();
 }
 }
 
 

+ 1 - 1
Source/Controls/InputTypeText.h

@@ -65,7 +65,7 @@ public:
 	virtual bool OnAttributeChange(const Core::AttributeNameList& changed_attributes);
 	virtual bool OnAttributeChange(const Core::AttributeNameList& changed_attributes);
 	/// Called when properties on the control are changed.
 	/// Called when properties on the control are changed.
 	/// @param[in] changed_properties The properties changed on the element.
 	/// @param[in] changed_properties The properties changed on the element.
-	virtual void OnPropertyChange(const Core::PropertyIdList& changed_properties);
+	virtual void OnPropertyChange(const Core::PropertyNameList& changed_properties);
 
 
 	/// Checks for necessary functional changes in the control as a result of the event.
 	/// Checks for necessary functional changes in the control as a result of the event.
 	/// @param[in] event The event to process.
 	/// @param[in] event The event to process.

+ 21 - 22
Source/Controls/WidgetDropDown.cpp

@@ -34,7 +34,6 @@
 #include "../../Include/Rocket/Core/Property.h"
 #include "../../Include/Rocket/Core/Property.h"
 #include "../../Include/Rocket/Core/StyleSheetKeywords.h"
 #include "../../Include/Rocket/Core/StyleSheetKeywords.h"
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
-#include "../../Include/Rocket/Controls/ID.h"
 
 
 namespace Rocket {
 namespace Rocket {
 namespace Controls {
 namespace Controls {
@@ -53,16 +52,16 @@ WidgetDropDown::WidgetDropDown(ElementFormControl* element)
 	value_element = Core::Factory::InstanceElement(element, "*", "selectvalue", Rocket::Core::XMLAttributes());
 	value_element = Core::Factory::InstanceElement(element, "*", "selectvalue", Rocket::Core::XMLAttributes());
 	selection_element = Core::Factory::InstanceElement(parent_element, "*", "selectbox", Rocket::Core::XMLAttributes());
 	selection_element = Core::Factory::InstanceElement(parent_element, "*", "selectbox", Rocket::Core::XMLAttributes());
 
 
-	value_element->SetProperty(Core::PropertyId::Overflow, "hidden");
+	value_element->SetProperty("overflow", "hidden");
 
 
-	selection_element->SetProperty(Core::PropertyId::Visibility, "hidden");
-	selection_element->SetProperty(Core::PropertyId::ZIndex, Core::Property(1.0f, Core::Property::NUMBER));
-	selection_element->SetProperty(Core::PropertyId::Clip, "none");
+	selection_element->SetProperty("visibility", "hidden");
+	selection_element->SetProperty("z-index", Core::Property(1.0f, Core::Property::NUMBER));
+	selection_element->SetProperty("clip", "none");
 
 
-	parent_element->AddEventListener(Core::EventId::Click, this, true);
-	parent_element->AddEventListener(Core::EventId::Blur, this);
-	parent_element->AddEventListener(Core::EventId::Focus, this);
-	parent_element->AddEventListener(Core::EventId::Keydown, this, true);
+	parent_element->AddEventListener("click", this, true);
+	parent_element->AddEventListener("blur", this);
+	parent_element->AddEventListener("focus", this);
+	parent_element->AddEventListener("keydown", this, true);
 
 
 	// Add the elements to our parent element.
 	// Add the elements to our parent element.
 	parent_element->AppendChild(button_element, false);
 	parent_element->AppendChild(button_element, false);
@@ -76,12 +75,12 @@ WidgetDropDown::~WidgetDropDown()
 	//   Not always a problem, but sometimes it invalidates the layout lock in Element::RemoveChild, which results in a permanently corrupted document.
 	//   Not always a problem, but sometimes it invalidates the layout lock in Element::RemoveChild, which results in a permanently corrupted document.
 	//   However, we do need to remove events of children.
 	//   However, we do need to remove events of children.
 	for(auto& option : options)
 	for(auto& option : options)
-		option.GetElement()->RemoveEventListener(Core::EventId::Click, this);
+		option.GetElement()->RemoveEventListener("click", this);
 
 
-	parent_element->RemoveEventListener(Core::EventId::Click, this, true);
-	parent_element->RemoveEventListener(Core::EventId::Blur, this);
-	parent_element->RemoveEventListener(Core::EventId::Focus, this);
-	parent_element->RemoveEventListener(Core::EventId::Keydown, this, true);
+	parent_element->RemoveEventListener("click", this, true);
+	parent_element->RemoveEventListener("blur", this);
+	parent_element->RemoveEventListener("focus", this);
+	parent_element->RemoveEventListener("keydown", this, true);
 
 
 	button_element->RemoveReference();
 	button_element->RemoveReference();
 	selection_element->RemoveReference();
 	selection_element->RemoveReference();
@@ -206,7 +205,7 @@ void WidgetDropDown::SetSelection(int selection, bool force)
 
 
 		Rocket::Core::Dictionary parameters;
 		Rocket::Core::Dictionary parameters;
 		parameters["value"] = value;
 		parameters["value"] = value;
-		parent_element->DispatchEvent(EventId::Change, parameters);
+		parent_element->DispatchEvent("change", parameters);
 	}
 	}
 }
 }
 
 
@@ -223,10 +222,10 @@ int WidgetDropDown::AddOption(const Rocket::Core::String& rml, const Rocket::Cor
 	Core::Element* element = Core::Factory::InstanceElement(selection_element, "*", "option", Rocket::Core::XMLAttributes());
 	Core::Element* element = Core::Factory::InstanceElement(selection_element, "*", "option", Rocket::Core::XMLAttributes());
 
 
 	// Force to block display and inject the RML. Register a click handler so we can be notified of selection.
 	// Force to block display and inject the RML. Register a click handler so we can be notified of selection.
-	element->SetProperty(Core::PropertyId::Display, "block");
-	element->SetProperty(Core::PropertyId::Clip, "auto");
+	element->SetProperty("display", "block");
+	element->SetProperty("clip", "auto");
 	element->SetInnerRML(rml);
 	element->SetInnerRML(rml);
-	element->AddEventListener(Core::EventId::Click, this);
+	element->AddEventListener("click", this);
 
 
 	int option_index;
 	int option_index;
 	if (before < 0 ||
 	if (before < 0 ||
@@ -261,7 +260,7 @@ void WidgetDropDown::RemoveOption(int index)
 		return;
 		return;
 
 
 	// Remove the listener and delete the option element.
 	// Remove the listener and delete the option element.
-	options[index].GetElement()->RemoveEventListener(Core::EventId::Click, this);
+	options[index].GetElement()->RemoveEventListener("click", this);
 	selection_element->RemoveChild(options[index].GetElement());
 	selection_element->RemoveChild(options[index].GetElement());
 	options.erase(options.begin() + index);
 	options.erase(options.begin() + index);
 
 
@@ -332,7 +331,7 @@ void WidgetDropDown::ProcessEvent(Core::Event& event)
 				element = element->GetParentNode();
 				element = element->GetParentNode();
 			}
 			}
 
 
-			if (selection_element->GetProperty< int >(Core::PropertyId::Visibility) == Core::VISIBILITY_HIDDEN)
+			if (selection_element->GetProperty< int >("visibility") == Core::VISIBILITY_HIDDEN)
 				ShowSelectBox(true);
 				ShowSelectBox(true);
 			else
 			else
 				ShowSelectBox(false);
 				ShowSelectBox(false);
@@ -380,13 +379,13 @@ void WidgetDropDown::ShowSelectBox(bool show)
 {
 {
 	if (show)
 	if (show)
 	{
 	{
-		selection_element->SetProperty(Core::PropertyId::Visibility, "visible");
+		selection_element->SetProperty("visibility", "visible");
 		value_element->SetPseudoClass("checked", true);
 		value_element->SetPseudoClass("checked", true);
 		button_element->SetPseudoClass("checked", true);
 		button_element->SetPseudoClass("checked", true);
 	}
 	}
 	else
 	else
 	{
 	{
-		selection_element->SetProperty(Core::PropertyId::Visibility, "hidden");
+		selection_element->SetProperty("visibility", "hidden");
 		value_element->SetPseudoClass("checked", false);
 		value_element->SetPseudoClass("checked", false);
 		button_element->SetPseudoClass("checked", false);
 		button_element->SetPseudoClass("checked", false);
 	}
 	}

+ 29 - 30
Source/Controls/WidgetSlider.cpp

@@ -28,7 +28,6 @@
 #include "WidgetSlider.h"
 #include "WidgetSlider.h"
 #include "../../Include/Rocket/Core.h"
 #include "../../Include/Rocket/Core.h"
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
-#include "../../Include/Rocket/Controls/ID.h"
 #include "../Core/Clock.h"
 #include "../Core/Clock.h"
 
 
 namespace Rocket {
 namespace Rocket {
@@ -68,16 +67,16 @@ WidgetSlider::~WidgetSlider()
 		parent->RemoveChild(track);
 		parent->RemoveChild(track);
 	}
 	}
 
 
-	parent->RemoveEventListener(Core::EventId::Blur, this);
-	parent->RemoveEventListener(Core::EventId::Focus, this);
-	parent->RemoveEventListener(Core::EventId::Keydown, this, true);
-	parent->RemoveEventListener(Core::EventId::Mousedown, this);
-	parent->RemoveEventListener(Core::EventId::Mouseup, this);
-	parent->RemoveEventListener(Core::EventId::Mouseout, this);
+	parent->RemoveEventListener("blur", this);
+	parent->RemoveEventListener("focus", this);
+	parent->RemoveEventListener("keydown", this, true);
+	parent->RemoveEventListener("mousedown", this);
+	parent->RemoveEventListener("mouseup", this);
+	parent->RemoveEventListener("mouseout", this);
 
 
-	parent->RemoveEventListener(Core::EventId::Drag, this);
-	parent->RemoveEventListener(Core::EventId::Dragstart, this);
-	parent->RemoveEventListener(Core::EventId::Dragend, this);
+	parent->RemoveEventListener("drag", this);
+	parent->RemoveEventListener("dragstart", this);
+	parent->RemoveEventListener("dragend", this);
 
 
 	for (int i = 0; i < 2; i++)
 	for (int i = 0; i < 2; i++)
 	{
 	{
@@ -91,7 +90,7 @@ WidgetSlider::~WidgetSlider()
 // Initialises the slider to a given orientation.
 // Initialises the slider to a given orientation.
 bool WidgetSlider::Initialise()
 bool WidgetSlider::Initialise()
 {
 {
-	parent->SetProperty(Core::PropertyId::Drag, "drag");
+	parent->SetProperty("drag", "drag");
 
 
 	// Create all of our child elements as standard elements, and abort if we can't create them.
 	// Create all of our child elements as standard elements, and abort if we can't create them.
 	track = Core::Factory::InstanceElement(parent, "*", "slidertrack", Rocket::Core::XMLAttributes());
 	track = Core::Factory::InstanceElement(parent, "*", "slidertrack", Rocket::Core::XMLAttributes());
@@ -100,8 +99,8 @@ bool WidgetSlider::Initialise()
 
 
 	arrows[0] = Core::Factory::InstanceElement(parent, "*", "sliderarrowdec", Rocket::Core::XMLAttributes());
 	arrows[0] = Core::Factory::InstanceElement(parent, "*", "sliderarrowdec", Rocket::Core::XMLAttributes());
 	arrows[1] = Core::Factory::InstanceElement(parent, "*", "sliderarrowinc", Rocket::Core::XMLAttributes());
 	arrows[1] = Core::Factory::InstanceElement(parent, "*", "sliderarrowinc", Rocket::Core::XMLAttributes());
-	arrows[0]->SetProperty(Core::PropertyId::Drag, "drag");
-	arrows[1]->SetProperty(Core::PropertyId::Drag, "drag");
+	arrows[0]->SetProperty("drag", "drag");
+	arrows[1]->SetProperty("drag", "drag");
 
 
 	if (track == NULL ||
 	if (track == NULL ||
 		bar == NULL ||
 		bar == NULL ||
@@ -137,16 +136,16 @@ bool WidgetSlider::Initialise()
 
 
 	// Attach the listeners
 	// Attach the listeners
 	// All listeners are attached to parent, ensuring that we don't get duplicate events when it bubbles from child to parent
 	// All listeners are attached to parent, ensuring that we don't get duplicate events when it bubbles from child to parent
-	parent->AddEventListener(Core::EventId::Blur, this);
-	parent->AddEventListener(Core::EventId::Focus, this);
-	parent->AddEventListener(Core::EventId::Keydown, this, true);
-	parent->AddEventListener(Core::EventId::Mousedown, this);
-	parent->AddEventListener(Core::EventId::Mouseup, this);
-	parent->AddEventListener(Core::EventId::Mouseout, this);
+	parent->AddEventListener("blur", this);
+	parent->AddEventListener("focus", this);
+	parent->AddEventListener("keydown", this, true);
+	parent->AddEventListener("mousedown", this);
+	parent->AddEventListener("mouseup", this);
+	parent->AddEventListener("mouseout", this);
 
 
-	parent->AddEventListener(Core::EventId::Drag, this);
-	parent->AddEventListener(Core::EventId::Dragstart, this);
-	parent->AddEventListener(Core::EventId::Dragend, this);
+	parent->AddEventListener("drag", this);
+	parent->AddEventListener("dragstart", this);
+	parent->AddEventListener("dragend", this);
 
 
 	return true;
 	return true;
 }
 }
@@ -186,7 +185,7 @@ void WidgetSlider::SetBarPosition(float _bar_position)
 
 
 	Rocket::Core::Dictionary parameters;
 	Rocket::Core::Dictionary parameters;
 	parameters["value"] = bar_position;
 	parameters["value"] = bar_position;
-	parent->DispatchEvent(EventId::Change, parameters);
+	parent->DispatchEvent("change", parameters);
 }
 }
 
 
 // Returns the current position of the bar.
 // Returns the current position of the bar.
@@ -314,7 +313,7 @@ void WidgetSlider::FormatBar(float bar_length)
 	Rocket::Core::Vector2f bar_box_content = bar_box.GetSize();
 	Rocket::Core::Vector2f bar_box_content = bar_box.GetSize();
 	if (orientation == HORIZONTAL)
 	if (orientation == HORIZONTAL)
 	{
 	{
-		if (bar->GetLocalProperty(Core::PropertyId::Height) == NULL)
+		if (bar->GetLocalProperty("height") == NULL)
 			bar_box_content.y = parent->GetBox().GetSize().y;
 			bar_box_content.y = parent->GetBox().GetSize().y;
 	}
 	}
 
 
@@ -326,16 +325,16 @@ void WidgetSlider::FormatBar(float bar_length)
 		{
 		{
 			float track_length = track_size.y - (bar_box.GetCumulativeEdge(Core::Box::CONTENT, Core::Box::TOP) + bar_box.GetCumulativeEdge(Core::Box::CONTENT, Core::Box::BOTTOM));
 			float track_length = track_size.y - (bar_box.GetCumulativeEdge(Core::Box::CONTENT, Core::Box::TOP) + bar_box.GetCumulativeEdge(Core::Box::CONTENT, Core::Box::BOTTOM));
 
 
-			if (bar->GetLocalProperty(Core::PropertyId::Height) == NULL)
+			if (bar->GetLocalProperty("height") == NULL)
 			{
 			{
 				bar_box_content.y = track_length * bar_length;
 				bar_box_content.y = track_length * bar_length;
 
 
 				// Check for 'min-height' restrictions.
 				// Check for 'min-height' restrictions.
-				float min_track_length = bar->ResolveProperty(Core::PropertyId::MinHeight, track_length);
+				float min_track_length = bar->ResolveProperty("min-height", track_length);
 				bar_box_content.y = Rocket::Core::Math::Max(min_track_length, bar_box_content.y);
 				bar_box_content.y = Rocket::Core::Math::Max(min_track_length, bar_box_content.y);
 
 
 				// Check for 'max-height' restrictions.
 				// Check for 'max-height' restrictions.
-				float max_track_length = bar->ResolveProperty(Core::PropertyId::MaxHeight, track_length);
+				float max_track_length = bar->ResolveProperty("max-height", track_length);
 				if (max_track_length > 0)
 				if (max_track_length > 0)
 					bar_box_content.y = Rocket::Core::Math::Min(max_track_length, bar_box_content.y);
 					bar_box_content.y = Rocket::Core::Math::Min(max_track_length, bar_box_content.y);
 			}
 			}
@@ -347,16 +346,16 @@ void WidgetSlider::FormatBar(float bar_length)
 		{
 		{
 			float track_length = track_size.x - (bar_box.GetCumulativeEdge(Core::Box::CONTENT, Core::Box::LEFT) + bar_box.GetCumulativeEdge(Core::Box::CONTENT, Core::Box::RIGHT));
 			float track_length = track_size.x - (bar_box.GetCumulativeEdge(Core::Box::CONTENT, Core::Box::LEFT) + bar_box.GetCumulativeEdge(Core::Box::CONTENT, Core::Box::RIGHT));
 
 
-			if (bar->GetLocalProperty(Core::PropertyId::Width) == NULL)
+			if (bar->GetLocalProperty("width") == NULL)
 			{
 			{
 				bar_box_content.x = track_length * bar_length;
 				bar_box_content.x = track_length * bar_length;
 
 
 				// Check for 'min-width' restrictions.
 				// Check for 'min-width' restrictions.
-				float min_track_length = bar->ResolveProperty(Core::PropertyId::MinWidth, track_length);
+				float min_track_length = bar->ResolveProperty("min-width", track_length);
 				bar_box_content.x = Rocket::Core::Math::Max(min_track_length, bar_box_content.x);
 				bar_box_content.x = Rocket::Core::Math::Max(min_track_length, bar_box_content.x);
 
 
 				// Check for 'max-width' restrictions.
 				// Check for 'max-width' restrictions.
-				float max_track_length = bar->ResolveProperty(Core::PropertyId::MaxWidth, track_length);
+				float max_track_length = bar->ResolveProperty("max-width", track_length);
 				if (max_track_length > 0)
 				if (max_track_length > 0)
 					bar_box_content.x = Rocket::Core::Math::Min(max_track_length, bar_box_content.x);
 					bar_box_content.x = Rocket::Core::Math::Min(max_track_length, bar_box_content.x);
 			}
 			}

+ 25 - 26
Source/Controls/WidgetTextInput.cpp

@@ -30,7 +30,6 @@
 #include "../../Include/Rocket/Core.h"
 #include "../../Include/Rocket/Core.h"
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
 #include "../../Include/Rocket/Controls/ElementFormControl.h"
 #include "../../Include/Rocket/Controls/Clipboard.h"
 #include "../../Include/Rocket/Controls/Clipboard.h"
-#include "../../Include/Rocket/Controls/ID.h"
 #include "../../Include/Rocket/Core/SystemInterface.h"
 #include "../../Include/Rocket/Core/SystemInterface.h"
 #include "../Core/Clock.h"
 #include "../Core/Clock.h"
 
 
@@ -44,18 +43,18 @@ WidgetTextInput::WidgetTextInput(ElementFormControl* _parent) : internal_dimensi
 	keyboard_showed = false;
 	keyboard_showed = false;
 	
 	
 	parent = _parent;
 	parent = _parent;
-	parent->SetProperty(Core::PropertyId::WhiteSpace, "pre");
-	parent->SetProperty(Core::PropertyId::Overflow, "hidden");
-	parent->SetProperty(Core::PropertyId::Drag, "drag");
+	parent->SetProperty("white-space", "pre");
+	parent->SetProperty("overflow", "hidden");
+	parent->SetProperty("drag", "drag");
 	parent->SetClientArea(Rocket::Core::Box::CONTENT);
 	parent->SetClientArea(Rocket::Core::Box::CONTENT);
 
 
-	parent->AddEventListener(Core::EventId::Resize, this, true);
-	parent->AddEventListener(Core::EventId::Keydown, this, true);
-	parent->AddEventListener(Core::EventId::Textinput, this, true);
-	parent->AddEventListener(Core::EventId::Focus, this, true);
-	parent->AddEventListener(Core::EventId::Blur, this, true);
-	parent->AddEventListener(Core::EventId::Mousedown, this, true);
-	parent->AddEventListener(Core::EventId::Drag, this, true);
+	parent->AddEventListener("resize", this, true);
+	parent->AddEventListener("keydown", this, true);
+	parent->AddEventListener("textinput", this, true);
+	parent->AddEventListener("focus", this, true);
+	parent->AddEventListener("blur", this, true);
+	parent->AddEventListener("mousedown", this, true);
+	parent->AddEventListener("drag", this, true);
 
 
 	text_element = dynamic_cast< Core::ElementText* >(Core::Factory::InstanceElement(parent, "#text", "#text", Rocket::Core::XMLAttributes()));
 	text_element = dynamic_cast< Core::ElementText* >(Core::Factory::InstanceElement(parent, "#text", "#text", Rocket::Core::XMLAttributes()));
 	selected_text_element = dynamic_cast< Core::ElementText* >(Core::Factory::InstanceElement(parent, "#text", "#text", Rocket::Core::XMLAttributes()));
 	selected_text_element = dynamic_cast< Core::ElementText* >(Core::Factory::InstanceElement(parent, "#text", "#text", Rocket::Core::XMLAttributes()));
@@ -100,13 +99,13 @@ WidgetTextInput::WidgetTextInput(ElementFormControl* _parent) : internal_dimensi
 
 
 WidgetTextInput::~WidgetTextInput()
 WidgetTextInput::~WidgetTextInput()
 {
 {
-	parent->RemoveEventListener(Core::EventId::Resize, this, true);
-	parent->RemoveEventListener(Core::EventId::Keydown, this, true);
-	parent->RemoveEventListener(Core::EventId::Textinput, this, true);
-	parent->RemoveEventListener(Core::EventId::Focus, this, true);
-	parent->RemoveEventListener(Core::EventId::Blur, this, true);
-	parent->RemoveEventListener(Core::EventId::Mousedown, this, true);
-	parent->RemoveEventListener(Core::EventId::Drag, this, true);
+	parent->RemoveEventListener("resize", this, true);
+	parent->RemoveEventListener("keydown", this, true);
+	parent->RemoveEventListener("textinput", this, true);
+	parent->RemoveEventListener("focus", this, true);
+	parent->RemoveEventListener("blur", this, true);
+	parent->RemoveEventListener("mousedown", this, true);
+	parent->RemoveEventListener("drag", this, true);
 
 
 	// Remove all the children added by the text widget.
 	// Remove all the children added by the text widget.
 	parent->RemoveChild(text_element);
 	parent->RemoveChild(text_element);
@@ -155,24 +154,24 @@ void WidgetTextInput::UpdateSelectionColours()
 	// Determine what the colour of the selected text is. If our 'selection' element has the 'color'
 	// Determine what the colour of the selected text is. If our 'selection' element has the 'color'
 	// attribute set, then use that. Otherwise, use the inverse of our own text colour.
 	// attribute set, then use that. Otherwise, use the inverse of our own text colour.
 	Rocket::Core::Colourb colour;
 	Rocket::Core::Colourb colour;
-	const Rocket::Core::Property* colour_property = selection_element->GetLocalProperty(Core::PropertyId::Color);
+	const Rocket::Core::Property* colour_property = selection_element->GetLocalProperty("color");
 	if (colour_property != NULL)
 	if (colour_property != NULL)
 		colour = colour_property->Get< Rocket::Core::Colourb >();
 		colour = colour_property->Get< Rocket::Core::Colourb >();
 	else
 	else
 	{
 	{
-		colour = parent->GetProperty< Rocket::Core::Colourb >(Core::PropertyId::Color);
+		colour = parent->GetProperty< Rocket::Core::Colourb >("color");
 		colour.red = 255 - colour.red;
 		colour.red = 255 - colour.red;
 		colour.green = 255 - colour.green;
 		colour.green = 255 - colour.green;
 		colour.blue = 255 - colour.blue;
 		colour.blue = 255 - colour.blue;
 	}
 	}
 
 
 	// Set the computed text colour on the element holding the selected text.
 	// Set the computed text colour on the element holding the selected text.
-	selected_text_element->SetProperty(Core::PropertyId::Color, Rocket::Core::Property(colour, Rocket::Core::Property::COLOUR));
+	selected_text_element->SetProperty("color", Rocket::Core::Property(colour, Rocket::Core::Property::COLOUR));
 
 
 	// If the 'background-color' property has been set on the 'selection' element, use that as the
 	// If the 'background-color' property has been set on the 'selection' element, use that as the
 	// background colour for the selected text. Otherwise, use the inverse of the selected text
 	// background colour for the selected text. Otherwise, use the inverse of the selected text
 	// colour.
 	// colour.
-	colour_property = selection_element->GetLocalProperty(Core::PropertyId::BackgroundColor);
+	colour_property = selection_element->GetLocalProperty("background-color");
 	if (colour_property != NULL)
 	if (colour_property != NULL)
 		selection_colour = colour_property->Get< Rocket::Core::Colourb >();
 		selection_colour = colour_property->Get< Rocket::Core::Colourb >();
 	else
 	else
@@ -243,7 +242,7 @@ void WidgetTextInput::DispatchChangeEvent(bool linebreak)
 	Rocket::Core::Dictionary parameters;
 	Rocket::Core::Dictionary parameters;
 	parameters["value"] = GetElement()->GetAttribute< Rocket::Core::String >("value", "");
 	parameters["value"] = GetElement()->GetAttribute< Rocket::Core::String >("value", "");
 	parameters["linebreak"] = Core::Variant(linebreak);
 	parameters["linebreak"] = Core::Variant(linebreak);
-	GetElement()->DispatchEvent(EventId::Change, parameters);
+	GetElement()->DispatchEvent("change", parameters);
 }
 }
 
 
 // Processes the "keydown" and "textinput" event to write to the input field, and the "focus" and "blur" to set
 // Processes the "keydown" and "textinput" event to write to the input field, and the "focus" and "blur" to set
@@ -679,8 +678,8 @@ void WidgetTextInput::FormatElement()
 	Core::ElementScroll* scroll = parent->GetElementScroll();
 	Core::ElementScroll* scroll = parent->GetElementScroll();
 	float width = parent->GetBox().GetSize(Core::Box::PADDING).x;
 	float width = parent->GetBox().GetSize(Core::Box::PADDING).x;
 
 
-	int x_overflow_property = parent->GetProperty< int >(Core::PropertyId::OverflowX);
-	int y_overflow_property = parent->GetProperty< int >(Core::PropertyId::OverflowY);
+	int x_overflow_property = parent->GetProperty< int >("overflow-x");
+	int y_overflow_property = parent->GetProperty< int >("overflow-y");
 
 
 	if (x_overflow_property == Core::OVERFLOW_SCROLL)
 	if (x_overflow_property == Core::OVERFLOW_SCROLL)
 		scroll->EnableScrollbar(Core::ElementScroll::HORIZONTAL, width);
 		scroll->EnableScrollbar(Core::ElementScroll::HORIZONTAL, width);
@@ -877,7 +876,7 @@ void WidgetTextInput::GenerateCursor()
 
 
 	cursor_size.x = 1;
 	cursor_size.x = 1;
 	cursor_size.y = (float) Core::ElementUtilities::GetLineHeight(text_element) + 2;
 	cursor_size.y = (float) Core::ElementUtilities::GetLineHeight(text_element) + 2;
-	Core::GeometryUtilities::GenerateQuad(&vertices[0], &indices[0], Rocket::Core::Vector2f(0, 0), cursor_size, parent->GetProperty< Rocket::Core::Colourb >(Core::PropertyId::Color));
+	Core::GeometryUtilities::GenerateQuad(&vertices[0], &indices[0], Rocket::Core::Vector2f(0, 0), cursor_size, parent->GetProperty< Rocket::Core::Colourb >("color"));
 }
 }
 
 
 void WidgetTextInput::UpdateCursorPosition()
 void WidgetTextInput::UpdateCursorPosition()

+ 46 - 46
Source/Core/Context.cpp

@@ -50,7 +50,7 @@ Context::Context(const String& name) : name(name), dimensions(0, 0), mouse_posit
 	root = Factory::InstanceElement(NULL, "*", "#root", XMLAttributes());
 	root = Factory::InstanceElement(NULL, "*", "#root", XMLAttributes());
 	root->SetId(name);
 	root->SetId(name);
 	root->SetOffset(Vector2f(0, 0), NULL);
 	root->SetOffset(Vector2f(0, 0), NULL);
-	root->SetProperty(PropertyId::ZIndex, "0");
+	root->SetProperty(Z_INDEX, "0");
 
 
 	Element* element = Factory::InstanceElement(NULL, "body", "body", XMLAttributes());
 	Element* element = Factory::InstanceElement(NULL, "body", "body", XMLAttributes());
 	cursor_proxy = dynamic_cast< ElementDocument* >(element);
 	cursor_proxy = dynamic_cast< ElementDocument* >(element);
@@ -279,7 +279,7 @@ ElementDocument* Context::LoadDocument(Stream* stream)
 	document->UpdateDocument();
 	document->UpdateDocument();
 
 
 	PluginRegistry::NotifyDocumentLoad(document);
 	PluginRegistry::NotifyDocumentLoad(document);
-	document->DispatchEvent(EventId::Load, Dictionary(), false);
+	document->DispatchEvent(LOAD, Dictionary(), false);
 
 
 	return document;
 	return document;
 }
 }
@@ -317,7 +317,7 @@ void Context::UnloadDocument(ElementDocument* _document)
 	if (document->GetParentNode() == root)
 	if (document->GetParentNode() == root)
 	{
 	{
 		// Dispatch the unload notifications.
 		// Dispatch the unload notifications.
-		document->DispatchEvent(EventId::Unload, Dictionary(), false);
+		document->DispatchEvent(UNLOAD, Dictionary(), false);
 		PluginRegistry::NotifyDocumentUnload(document);
 		PluginRegistry::NotifyDocumentUnload(document);
 
 
 		// Remove the document from the context.
 		// Remove the document from the context.
@@ -455,13 +455,13 @@ void Context::PushDocumentToBack(ElementDocument* document)
 }
 }
 
 
 // Adds an event listener to the root element.
 // Adds an event listener to the root element.
-void Context::AddEventListener(EventId event, EventListener* listener, bool in_capture_phase)
+void Context::AddEventListener(const String& event, EventListener* listener, bool in_capture_phase)
 {
 {
 	root->AddEventListener(event, listener, in_capture_phase);
 	root->AddEventListener(event, listener, in_capture_phase);
 }
 }
 
 
 // Removes an event listener from the root element.
 // Removes an event listener from the root element.
-void Context::RemoveEventListener(EventId event, EventListener* listener, bool in_capture_phase)
+void Context::RemoveEventListener(const String& event, EventListener* listener, bool in_capture_phase)
 {
 {
 	root->RemoveEventListener(event, listener, in_capture_phase);
 	root->RemoveEventListener(event, listener, in_capture_phase);
 }
 }
@@ -475,9 +475,9 @@ bool Context::ProcessKeyDown(Input::KeyIdentifier key_identifier, int key_modifi
 	GenerateKeyModifierEventParameters(parameters, key_modifier_state);
 	GenerateKeyModifierEventParameters(parameters, key_modifier_state);
 
 
 	if (focus)
 	if (focus)
-		return focus->DispatchEvent(EventId::Keydown, parameters, true);
+		return focus->DispatchEvent(KEYDOWN, parameters, true);
 	else
 	else
-		return root->DispatchEvent(EventId::Keydown, parameters, true);
+		return root->DispatchEvent(KEYDOWN, parameters, true);
 }
 }
 
 
 // Sends a key up event into Rocket.
 // Sends a key up event into Rocket.
@@ -489,9 +489,9 @@ bool Context::ProcessKeyUp(Input::KeyIdentifier key_identifier, int key_modifier
 	GenerateKeyModifierEventParameters(parameters, key_modifier_state);
 	GenerateKeyModifierEventParameters(parameters, key_modifier_state);
 
 
 	if (focus)
 	if (focus)
-		return focus->DispatchEvent(EventId::Keyup, parameters, true);
+		return focus->DispatchEvent(KEYUP, parameters, true);
 	else
 	else
-		return root->DispatchEvent(EventId::Keyup, parameters, true);
+		return root->DispatchEvent(KEYUP, parameters, true);
 }
 }
 
 
 // Sends a single character of text as text input into Rocket.
 // Sends a single character of text as text input into Rocket.
@@ -502,9 +502,9 @@ bool Context::ProcessTextInput(word character)
 	parameters["data"] = character;
 	parameters["data"] = character;
 
 
 	if (focus)
 	if (focus)
-		return focus->DispatchEvent(EventId::Textinput, parameters, true);
+		return focus->DispatchEvent(TEXTINPUT, parameters, true);
 	else
 	else
-		return root->DispatchEvent(EventId::Textinput, parameters, true);
+		return root->DispatchEvent(TEXTINPUT, parameters, true);
 }
 }
 
 
 // Sends a string of text as text input into Rocket.
 // Sends a string of text as text input into Rocket.
@@ -519,9 +519,9 @@ bool Context::ProcessTextInput(const String& string)
 		parameters["data"] = string[i];
 		parameters["data"] = string[i];
 
 
 		if (focus)
 		if (focus)
-			consumed = focus->DispatchEvent(EventId::Textinput, parameters, true) && consumed;
+			consumed = focus->DispatchEvent(TEXTINPUT, parameters, true) && consumed;
 		else
 		else
-			consumed = root->DispatchEvent(EventId::Textinput, parameters, true) && consumed;
+			consumed = root->DispatchEvent(TEXTINPUT, parameters, true) && consumed;
 	}
 	}
 
 
 	return consumed;
 	return consumed;
@@ -558,11 +558,11 @@ void Context::ProcessMouseMove(int x, int y, int key_modifier_state)
 	{
 	{
 		if (hover)
 		if (hover)
 		{
 		{
-			hover->DispatchEvent(EventId::Mousemove, parameters, true);
+			hover->DispatchEvent(MOUSEMOVE, parameters, true);
 
 
 			if (drag_hover &&
 			if (drag_hover &&
 				drag_verbose)
 				drag_verbose)
-				drag_hover->DispatchEvent(EventId::Dragmove, drag_parameters, true);
+				drag_hover->DispatchEvent(DRAGMOVE, drag_parameters, true);
 		}
 		}
 	}
 	}
 }
 }
@@ -570,10 +570,10 @@ void Context::ProcessMouseMove(int x, int y, int key_modifier_state)
 static Element* FindFocusElement(Element* element)
 static Element* FindFocusElement(Element* element)
 {
 {
 	ElementDocument* owner_document = element->GetOwnerDocument();
 	ElementDocument* owner_document = element->GetOwnerDocument();
-	if (!owner_document || owner_document->GetProperty< int >(PropertyId::Focus) == FOCUS_NONE)
+	if (!owner_document || owner_document->GetProperty< int >(FOCUS) == FOCUS_NONE)
 		return NULL;
 		return NULL;
 	
 	
-	while (element && element->GetProperty< int >(PropertyId::Focus) == FOCUS_NONE)
+	while (element && element->GetProperty< int >(FOCUS) == FOCUS_NONE)
 	{
 	{
 		element = element->GetParentNode();
 		element = element->GetParentNode();
 	}
 	}
@@ -610,7 +610,7 @@ void Context::ProcessMouseButtonDown(int button_index, int key_modifier_state)
 		
 		
 		// Call 'onmousedown' on every item in the hover chain, and copy the hover chain to the active chain.
 		// Call 'onmousedown' on every item in the hover chain, and copy the hover chain to the active chain.
 		if (hover)
 		if (hover)
-			propogate = hover->DispatchEvent(EventId::Mousedown, parameters, true);
+			propogate = hover->DispatchEvent(MOUSEDOWN, parameters, true);
 
 
 		if (propogate)
 		if (propogate)
 		{
 		{
@@ -621,7 +621,7 @@ void Context::ProcessMouseButtonDown(int button_index, int key_modifier_state)
 				float(click_time - last_click_time) < DOUBLE_CLICK_TIME)
 				float(click_time - last_click_time) < DOUBLE_CLICK_TIME)
 			{
 			{
 				if (hover)
 				if (hover)
-					propogate = hover->DispatchEvent(EventId::Dblclick, parameters, true);
+					propogate = hover->DispatchEvent(DBLCLICK, parameters, true);
 
 
 				last_click_element = NULL;
 				last_click_element = NULL;
 				last_click_time = 0;
 				last_click_time = 0;
@@ -644,7 +644,7 @@ void Context::ProcessMouseButtonDown(int button_index, int key_modifier_state)
 			drag = hover;
 			drag = hover;
 			while (drag)
 			while (drag)
 			{
 			{
-				int drag_style = drag->GetProperty(PropertyId::Drag)->value.Get< int >();
+				int drag_style = drag->GetProperty(DRAG)->value.Get< int >();
 				switch (drag_style)
 				switch (drag_style)
 				{
 				{
 					case DRAG_NONE:		drag = drag->GetParentNode(); continue;
 					case DRAG_NONE:		drag = drag->GetParentNode(); continue;
@@ -660,7 +660,7 @@ void Context::ProcessMouseButtonDown(int button_index, int key_modifier_state)
 	{
 	{
 		// Not the primary mouse button, so we're not doing any special processing.
 		// Not the primary mouse button, so we're not doing any special processing.
 		if (hover)
 		if (hover)
-			hover->DispatchEvent(EventId::Mousedown, parameters, true);
+			hover->DispatchEvent(MOUSEDOWN, parameters, true);
 	}
 	}
 }
 }
 
 
@@ -676,13 +676,13 @@ void Context::ProcessMouseButtonUp(int button_index, int key_modifier_state)
 	{
 	{
 		// The elements in the new hover chain have the 'onmouseup' event called on them.
 		// The elements in the new hover chain have the 'onmouseup' event called on them.
 		if (hover)
 		if (hover)
-			hover->DispatchEvent(EventId::Mouseup, parameters, true);
+			hover->DispatchEvent(MOUSEUP, parameters, true);
 
 
 		// If the active element (the one that was being hovered over when the mouse button was pressed) is still being
 		// If the active element (the one that was being hovered over when the mouse button was pressed) is still being
 		// hovered over, we click it.
 		// hovered over, we click it.
 		if (hover && active && active == FindFocusElement(*hover))
 		if (hover && active && active == FindFocusElement(*hover))
 		{
 		{
-			active->DispatchEvent(EventId::Click, parameters, true);
+			active->DispatchEvent(CLICK, parameters, true);
 		}
 		}
 
 
 		// Unset the 'active' pseudo-class on all the elements in the active chain; because they may not necessarily
 		// Unset the 'active' pseudo-class on all the elements in the active chain; because they may not necessarily
@@ -703,12 +703,12 @@ void Context::ProcessMouseButtonUp(int button_index, int key_modifier_state)
 				{
 				{
 					if (drag_verbose)
 					if (drag_verbose)
 					{
 					{
-						drag_hover->DispatchEvent(EventId::Dragdrop, drag_parameters, true);
-						drag_hover->DispatchEvent(EventId::Dragout, drag_parameters, true);
+						drag_hover->DispatchEvent(DRAGDROP, drag_parameters, true);
+						drag_hover->DispatchEvent(DRAGOUT, drag_parameters, true);
 					}
 					}
 				}
 				}
 
 
-				drag->DispatchEvent(EventId::Dragend, drag_parameters, true);
+				drag->DispatchEvent(DRAGEND, drag_parameters, true);
 
 
 				ReleaseDragClone();
 				ReleaseDragClone();
 			}
 			}
@@ -722,7 +722,7 @@ void Context::ProcessMouseButtonUp(int button_index, int key_modifier_state)
 	{
 	{
 		// Not the left mouse button, so we're not doing any special processing.
 		// Not the left mouse button, so we're not doing any special processing.
 		if (hover)
 		if (hover)
-			hover->DispatchEvent(EventId::Mouseup, parameters, true);
+			hover->DispatchEvent(MOUSEUP, parameters, true);
 	}
 	}
 }
 }
 
 
@@ -735,7 +735,7 @@ bool Context::ProcessMouseWheel(int wheel_delta, int key_modifier_state)
 		GenerateKeyModifierEventParameters(scroll_parameters, key_modifier_state);
 		GenerateKeyModifierEventParameters(scroll_parameters, key_modifier_state);
 		scroll_parameters["wheel_delta"] = wheel_delta;
 		scroll_parameters["wheel_delta"] = wheel_delta;
 
 
-		return hover->DispatchEvent(EventId::Mousescroll, scroll_parameters, true);
+		return hover->DispatchEvent(MOUSESCROLL, scroll_parameters, true);
 	}
 	}
 
 
 	return true;
 	return true;
@@ -821,7 +821,7 @@ void Context::OnElementRemove(Element* element)
 
 
 	Dictionary parameters;
 	Dictionary parameters;
 	GenerateMouseEventParameters(parameters, -1);
 	GenerateMouseEventParameters(parameters, -1);
-	SendEvents(old_hover_chain, hover_chain, EventId::Mouseout, parameters, true);
+	SendEvents(old_hover_chain, hover_chain, MOUSEOUT, parameters, true);
 }
 }
 
 
 // Internal callback for when a new element gains focus
 // Internal callback for when a new element gains focus
@@ -857,8 +857,8 @@ bool Context::OnFocusChange(Element* new_focus)
 	Dictionary parameters;
 	Dictionary parameters;
 
 
 	// Send out blur/focus events.
 	// Send out blur/focus events.
-	SendEvents(old_chain, new_chain, EventId::Blur, parameters, false);
-	SendEvents(new_chain, old_chain, EventId::Focus, parameters, false);
+	SendEvents(old_chain, new_chain, BLUR, parameters, false);
+	SendEvents(new_chain, old_chain, FOCUS, parameters, false);
 
 
 	focus = new_focus;
 	focus = new_focus;
 
 
@@ -866,7 +866,7 @@ bool Context::OnFocusChange(Element* new_focus)
 	ElementDocument* document = focus->GetOwnerDocument();
 	ElementDocument* document = focus->GetOwnerDocument();
 	if (document != NULL)
 	if (document != NULL)
 	{
 	{
-		const Property* z_index_property = document->GetProperty(PropertyId::ZIndex);
+		const Property* z_index_property = document->GetProperty(Z_INDEX);
 		if (z_index_property->unit == Property::KEYWORD &&
 		if (z_index_property->unit == Property::KEYWORD &&
 			z_index_property->value.Get< int >() == Z_INDEX_AUTO)
 			z_index_property->value.Get< int >() == Z_INDEX_AUTO)
 			document->PullToFront();
 			document->PullToFront();
@@ -893,7 +893,7 @@ void Context::GenerateClickEvent(Element* element)
 	Dictionary parameters;
 	Dictionary parameters;
 	GenerateMouseEventParameters(parameters, 0);
 	GenerateMouseEventParameters(parameters, 0);
 
 
-	element->DispatchEvent(EventId::Click, parameters, true);
+	element->DispatchEvent(CLICK, parameters, true);
 }
 }
 
 
 // Updates the current hover elements, sending required events.
 // Updates the current hover elements, sending required events.
@@ -911,17 +911,17 @@ void Context::UpdateHoverChain(const Dictionary& parameters, const Dictionary& d
 				Dictionary drag_start_parameters = drag_parameters;
 				Dictionary drag_start_parameters = drag_parameters;
 				drag_start_parameters["mouse_x"] = old_mouse_position.x;
 				drag_start_parameters["mouse_x"] = old_mouse_position.x;
 				drag_start_parameters["mouse_y"] = old_mouse_position.y;
 				drag_start_parameters["mouse_y"] = old_mouse_position.y;
-				drag->DispatchEvent(EventId::Dragstart, drag_start_parameters);
+				drag->DispatchEvent(DRAGSTART, drag_start_parameters);
 				drag_started = true;
 				drag_started = true;
 
 
-				if (drag->GetProperty< int >(PropertyId::Drag) == DRAG_CLONE)
+				if (drag->GetProperty< int >(DRAG) == DRAG_CLONE)
 				{
 				{
 					// Clone the element and attach it to the mouse cursor.
 					// Clone the element and attach it to the mouse cursor.
 					CreateDragClone(*drag);
 					CreateDragClone(*drag);
 				}
 				}
 			}
 			}
 
 
-			drag->DispatchEvent(EventId::Drag, drag_parameters);
+			drag->DispatchEvent(DRAG, drag_parameters);
 		}
 		}
 	}
 	}
 
 
@@ -931,8 +931,8 @@ void Context::UpdateHoverChain(const Dictionary& parameters, const Dictionary& d
 	{
 	{
 		String new_mouse_cursor;
 		String new_mouse_cursor;
 
 
-		if (hover && hover->GetProperty(PropertyId::Cursor)->unit != Property::KEYWORD)
-			new_mouse_cursor = hover->GetProperty< String >(PropertyId::Cursor);
+		if (hover && hover->GetProperty(CURSOR)->unit != Property::KEYWORD)
+			new_mouse_cursor = hover->GetProperty< String >(CURSOR);
 
 
 		GetSystemInterface()->SetMouseCursor(new_mouse_cursor);
 		GetSystemInterface()->SetMouseCursor(new_mouse_cursor);
 	}
 	}
@@ -947,8 +947,8 @@ void Context::UpdateHoverChain(const Dictionary& parameters, const Dictionary& d
 	}
 	}
 
 
 	// Send mouseout / mouseover events.
 	// Send mouseout / mouseover events.
-	SendEvents(hover_chain, new_hover_chain, EventId::Mouseout, parameters, true);
-	SendEvents(new_hover_chain, hover_chain, EventId::Mouseover, parameters, true);
+	SendEvents(hover_chain, new_hover_chain, MOUSEOUT, parameters, true);
+	SendEvents(new_hover_chain, hover_chain, MOUSEOVER, parameters, true);
 
 
 	// Send out drag events.
 	// Send out drag events.
 	if (drag)
 	if (drag)
@@ -979,8 +979,8 @@ void Context::UpdateHoverChain(const Dictionary& parameters, const Dictionary& d
 			drag_verbose)
 			drag_verbose)
 		{
 		{
 			// Send out ondragover and ondragout events as appropriate.
 			// Send out ondragover and ondragout events as appropriate.
-			SendEvents(drag_hover_chain, new_drag_hover_chain, EventId::Dragout, drag_parameters, true);
-			SendEvents(new_drag_hover_chain, drag_hover_chain, EventId::Dragover, drag_parameters, true);
+			SendEvents(drag_hover_chain, new_drag_hover_chain, DRAGOUT, drag_parameters, true);
+			SendEvents(new_drag_hover_chain, drag_hover_chain, DRAGOVER, drag_parameters, true);
 		}
 		}
 
 
 		drag_hover_chain.swap(new_drag_hover_chain);
 		drag_hover_chain.swap(new_drag_hover_chain);
@@ -1100,9 +1100,9 @@ void Context::CreateDragClone(Element* element)
 
 
 	// Set all the required properties and pseudo-classes on the clone.
 	// Set all the required properties and pseudo-classes on the clone.
 	drag_clone->SetPseudoClass("drag", true);
 	drag_clone->SetPseudoClass("drag", true);
-	drag_clone->SetProperty(PropertyId::Position, "absolute");
-	drag_clone->SetProperty(PropertyId::Left, Property(element->GetAbsoluteLeft() - element->GetBox().GetEdge(Box::MARGIN, Box::LEFT) - mouse_position.x, Property::PX));
-	drag_clone->SetProperty(PropertyId::Top, Property(element->GetAbsoluteTop() - element->GetBox().GetEdge(Box::MARGIN, Box::TOP) - mouse_position.y, Property::PX));
+	drag_clone->SetProperty("position", "absolute");
+	drag_clone->SetProperty("left", Property(element->GetAbsoluteLeft() - element->GetBox().GetEdge(Box::MARGIN, Box::LEFT) - mouse_position.x, Property::PX));
+	drag_clone->SetProperty("top", Property(element->GetAbsoluteTop() - element->GetBox().GetEdge(Box::MARGIN, Box::TOP) - mouse_position.y, Property::PX));
 }
 }
 
 
 // Releases the drag clone, if one exists.
 // Releases the drag clone, if one exists.
@@ -1169,7 +1169,7 @@ void Context::ReleaseUnloadedDocuments()
 }
 }
 
 
 // Sends the specified event to all elements in new_items that don't appear in old_items.
 // Sends the specified event to all elements in new_items that don't appear in old_items.
-void Context::SendEvents(const ElementSet& old_items, const ElementSet& new_items, EventId event, const Dictionary& parameters, bool interruptible)
+void Context::SendEvents(const ElementSet& old_items, const ElementSet& new_items, const String& event, const Dictionary& parameters, bool interruptible)
 {
 {
 	ElementList elements;
 	ElementList elements;
 	std::set_difference(old_items.begin(), old_items.end(), new_items.begin(), new_items.end(), std::back_inserter(elements));
 	std::set_difference(old_items.begin(), old_items.end(), new_items.begin(), new_items.end(), std::back_inserter(elements));

+ 4 - 4
Source/Core/DecoratorInstancer.cpp

@@ -46,15 +46,15 @@ const PropertySpecification& DecoratorInstancer::GetPropertySpecification() cons
 }
 }
 
 
 // Registers a property for the decorator.
 // Registers a property for the decorator.
-PropertyDefinition& DecoratorInstancer::RegisterProperty(PropertyId property_id, const String& default_value)
+PropertyDefinition& DecoratorInstancer::RegisterProperty(const String& property_name, const String& default_value)
 {
 {
-	return properties.RegisterProperty(property_id, default_value, false, false);
+	return properties.RegisterProperty(property_name, default_value, false, false);
 }
 }
 
 
 // Registers a shorthand property definition.
 // Registers a shorthand property definition.
-bool DecoratorInstancer::RegisterShorthand(PropertyId shorthand_id, const PropertyIdList& property_ids, PropertySpecification::ShorthandType type)
+bool DecoratorInstancer::RegisterShorthand(const String& shorthand_name, const String& property_names, PropertySpecification::ShorthandType type)
 {
 {
-	return properties.RegisterShorthand(shorthand_id, property_ids, type);
+	return properties.RegisterShorthand(shorthand_name, property_names, type);
 }
 }
 
 
 // Releases the instancer.
 // Releases the instancer.

+ 2 - 2
Source/Core/DecoratorTiled.cpp

@@ -118,9 +118,9 @@ Vector2f DecoratorTiled::Tile::GetDimensions(Element* element)
 void DecoratorTiled::Tile::GenerateGeometry(std::vector< Vertex >& vertices, std::vector< int >& indices, Element* element, const Vector2f& surface_origin, const Vector2f& surface_dimensions, const Vector2f& tile_dimensions) const
 void DecoratorTiled::Tile::GenerateGeometry(std::vector< Vertex >& vertices, std::vector< int >& indices, Element* element, const Vector2f& surface_origin, const Vector2f& surface_dimensions, const Vector2f& tile_dimensions) const
 {
 {
 	RenderInterface* render_interface = element->GetRenderInterface();
 	RenderInterface* render_interface = element->GetRenderInterface();
-    float opacity = element->GetProperty<float>(PropertyId::Opacity);
+    float opacity = element->GetProperty<float>(OPACITY);
 
 
-    Colourb quad_colour = element->GetProperty<Colourb>(PropertyId::ImageColor);
+    Colourb quad_colour = element->GetProperty<Colourb>(IMAGE_COLOR);
 
 
     // Apply opacity
     // Apply opacity
     quad_colour.alpha = (byte)(opacity * (float)quad_colour.alpha);
     quad_colour.alpha = (byte)(opacity * (float)quad_colour.alpha);

+ 20 - 47
Source/Core/DecoratorTiledInstancer.cpp

@@ -39,72 +39,45 @@ DecoratorTiledInstancer::~DecoratorTiledInstancer()
 // Adds the property declarations for a tile.
 // Adds the property declarations for a tile.
 void DecoratorTiledInstancer::RegisterTileProperty(const String& name, bool register_repeat_modes)
 void DecoratorTiledInstancer::RegisterTileProperty(const String& name, bool register_repeat_modes)
 {
 {
-	RegisterProperty(CreateOrGetPropertyId( CreateString(32, "decorator-%s-src", name.c_str())), "").AddParser("string");
-	RegisterProperty(CreateOrGetPropertyId( CreateString(32, "decorator-%s-s-begin", name.c_str())), "0").AddParser("length");
-	RegisterProperty(CreateOrGetPropertyId( CreateString(32, "decorator-%s-s-end", name.c_str())), "1").AddParser("length");
-	RegisterProperty(CreateOrGetPropertyId( CreateString(32, "decorator-%s-t-begin", name.c_str())), "0").AddParser("length");
-	RegisterProperty(CreateOrGetPropertyId( CreateString(32, "decorator-%s-t-end", name.c_str())), "1").AddParser("length");
-	RegisterShorthand(CreateOrGetPropertyId(CreateString(32, "decorator-%s-s", name.c_str())),
-		{ CreateOrGetPropertyId(CreateString(32, "decorator-%s-s-begin", name.c_str())), CreateOrGetPropertyId(CreateString(32, "decorator-%s-s-end", name.c_str())) }
-	);
-	RegisterShorthand(CreateOrGetPropertyId(CreateString(32, "decorator-%s-t", name.c_str())),
-		{ CreateOrGetPropertyId(CreateString(32, "decorator-%s-t-begin", name.c_str())), CreateOrGetPropertyId(CreateString(32, "decorator-%s-t-end", name.c_str())) }
-	);
+	RegisterProperty(CreateString(32, "%s-src", name.c_str()), "").AddParser("string");
+	RegisterProperty(CreateString(32, "%s-s-begin", name.c_str()), "0").AddParser("length");
+	RegisterProperty(CreateString(32, "%s-s-end", name.c_str()), "1").AddParser("length");
+	RegisterProperty(CreateString(32, "%s-t-begin", name.c_str()), "0").AddParser("length");
+	RegisterProperty(CreateString(32, "%s-t-end", name.c_str()), "1").AddParser("length");
+	RegisterShorthand(CreateString(32, "%s-s", name.c_str()), CreateString(64, "%s-s-begin, %s-s-end", name.c_str(), name.c_str()));
+	RegisterShorthand(CreateString(32, "%s-t", name.c_str()), CreateString(64, "%s-t-begin, %s-t-end", name.c_str(), name.c_str()));
 
 
 	if (register_repeat_modes)
 	if (register_repeat_modes)
 	{
 	{
-		RegisterProperty(CreateOrGetPropertyId( CreateString(32, "decorator-%s-repeat", name.c_str())), "stretch")
+		RegisterProperty(CreateString(32, "%s-repeat", name.c_str()), "stretch")
 			.AddParser("keyword", "stretch, clamp-stretch, clamp-truncate, repeat-stretch, repeat-truncate");
 			.AddParser("keyword", "stretch, clamp-stretch, clamp-truncate, repeat-stretch, repeat-truncate");
-		
-		RegisterShorthand(CreateOrGetPropertyId("decorator-" + name),
-			{ 
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-src", name.c_str())),
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-repeat", name.c_str())),
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-s-begin", name.c_str())),
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-t-begin", name.c_str())),
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-s-end", name.c_str())),
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-t-end", name.c_str())),
-			}
-		);
+		RegisterShorthand(name, CreateString(256, "%s-src, %s-repeat, %s-s-begin, %s-t-begin, %s-s-end, %s-t-end", name.c_str(), name.c_str(), name.c_str(), name.c_str(), name.c_str(), name.c_str()));
 	}
 	}
 	else
 	else
-		RegisterShorthand(CreateOrGetPropertyId("decorator-" + name),
-			{
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-src", name.c_str())),
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-s-begin", name.c_str())),
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-t-begin", name.c_str())),
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-s-end", name.c_str())),
-				CreateOrGetPropertyId(CreateString(32, "decorator-%s-t-end", name.c_str())),
-			}
-		);
+		RegisterShorthand(name, CreateString(256, "%s-src, %s-s-begin, %s-t-begin, %s-s-end, %s-t-end", name.c_str(), name.c_str(), name.c_str(), name.c_str(), name.c_str()));
 }
 }
 
 
 // Retrieves all the properties for a tile from the property dictionary.
 // Retrieves all the properties for a tile from the property dictionary.
 void DecoratorTiledInstancer::GetTileProperties(DecoratorTiled::Tile& tile, String& texture_name, String& rcss_path, const PropertyDictionary& properties, const String& name)
 void DecoratorTiledInstancer::GetTileProperties(DecoratorTiled::Tile& tile, String& texture_name, String& rcss_path, const PropertyDictionary& properties, const String& name)
 {
 {
-	LoadTexCoord(properties, GetPropertyId( CreateString(32, "decorator-%s-s-begin", name.c_str())), tile.texcoords[0].x, tile.texcoords_absolute[0][0]);
-	LoadTexCoord(properties, GetPropertyId( CreateString(32, "decorator-%s-t-begin", name.c_str())), tile.texcoords[0].y, tile.texcoords_absolute[0][1]);
-	LoadTexCoord(properties, GetPropertyId( CreateString(32, "decorator-%s-s-end", name.c_str())), tile.texcoords[1].x, tile.texcoords_absolute[1][0]);
-	LoadTexCoord(properties, GetPropertyId( CreateString(32, "decorator-%s-t-end", name.c_str())), tile.texcoords[1].y, tile.texcoords_absolute[1][1]);
+	LoadTexCoord(properties, CreateString(32, "%s-s-begin", name.c_str()), tile.texcoords[0].x, tile.texcoords_absolute[0][0]);
+	LoadTexCoord(properties, CreateString(32, "%s-t-begin", name.c_str()), tile.texcoords[0].y, tile.texcoords_absolute[0][1]);
+	LoadTexCoord(properties, CreateString(32, "%s-s-end", name.c_str()), tile.texcoords[1].x, tile.texcoords_absolute[1][0]);
+	LoadTexCoord(properties, CreateString(32, "%s-t-end", name.c_str()), tile.texcoords[1].y, tile.texcoords_absolute[1][1]);
 
 
-	const Property* repeat_property = GetIf(properties, GetPropertyId( CreateString(32, "decorator-%s-repeat", name.c_str())));
+	const Property* repeat_property = properties.GetProperty(CreateString(32, "%s-repeat", name.c_str()));
 	if (repeat_property != NULL)
 	if (repeat_property != NULL)
 		tile.repeat_mode = (DecoratorTiled::TileRepeatMode) repeat_property->value.Get< int >();
 		tile.repeat_mode = (DecoratorTiled::TileRepeatMode) repeat_property->value.Get< int >();
 
 
-	const Property* texture_property = GetIf(properties, GetPropertyId( CreateString(32, "decorator-%s-src", name.c_str())));
-	if(texture_property != NULL)
-	{
-		texture_name = texture_property->Get< String >();
-		rcss_path = texture_property->source;
-	}
+	const Property* texture_property = properties.GetProperty(CreateString(32, "%s-src", name.c_str()));
+	texture_name = texture_property->Get< String >();
+	rcss_path = texture_property->source;
 }
 }
 
 
 // Loads a single texture coordinate value from the properties.
 // Loads a single texture coordinate value from the properties.
-void DecoratorTiledInstancer::LoadTexCoord(const PropertyDictionary& properties, PropertyId id, float& tex_coord, bool& tex_coord_absolute)
+void DecoratorTiledInstancer::LoadTexCoord(const PropertyDictionary& properties, const String& name, float& tex_coord, bool& tex_coord_absolute)
 {
 {
-	auto& property_name = GetName(id);
-
-	const Property* property = GetIf(properties, id);
+	const Property* property = properties.GetProperty(name);
 	if (property == NULL)
 	if (property == NULL)
 		return;
 		return;
 
 

+ 1 - 1
Source/Core/DecoratorTiledInstancer.h

@@ -58,7 +58,7 @@ protected:
 
 
 private:
 private:
 	// Loads a single texture coordinate value from the properties.
 	// Loads a single texture coordinate value from the properties.
-	void LoadTexCoord(const PropertyDictionary& properties, PropertyId id, float& tex_coord, bool& tex_coord_absolute);
+	void LoadTexCoord(const PropertyDictionary& properties, const String& name, float& tex_coord, bool& tex_coord_absolute);
 };
 };
 
 
 }
 }

+ 176 - 131
Source/Core/Element.cpp

@@ -439,7 +439,7 @@ void Element::SetBox(const Box& box)
 		border->DirtyBorder();
 		border->DirtyBorder();
 		decoration->ReloadDecorators();
 		decoration->ReloadDecorators();
 
 
-		DispatchEvent(EventId::Resize, Dictionary());
+		DispatchEvent(RESIZE, Dictionary());
 	}
 	}
 }
 }
 
 
@@ -447,7 +447,7 @@ void Element::SetBox(const Box& box)
 void Element::AddBox(const Box& box)
 void Element::AddBox(const Box& box)
 {
 {
 	boxes.push_back(box);
 	boxes.push_back(box);
-	DispatchEvent(EventId::Resize, Dictionary());
+	DispatchEvent(RESIZE, Dictionary());
 
 
 	background->DirtyBackground();
 	background->DirtyBackground();
 	border->DirtyBorder();
 	border->DirtyBorder();
@@ -527,33 +527,33 @@ FontFaceHandle* Element::GetFontFaceHandle() const
 }
 }
 
 
 // Sets a local property override on the element.
 // Sets a local property override on the element.
-bool Element::SetProperty(PropertyId property_id, const String& value)
+bool Element::SetProperty(const String& name, const String& value)
 {
 {
-	return style->SetProperty(property_id, value);
+	return style->SetProperty(name, value);
 }
 }
 
 
 // Removes a local property override on the element.
 // Removes a local property override on the element.
-void Element::RemoveProperty(PropertyId property_id)
+void Element::RemoveProperty(const String& name)
 {
 {
-	style->RemoveProperty(property_id);
+	style->RemoveProperty(name);
 }
 }
 
 
 // Sets a local property override on the element to a pre-parsed value.
 // Sets a local property override on the element to a pre-parsed value.
-bool Element::SetProperty(PropertyId property_id, const Property& property)
+bool Element::SetProperty(const String& name, const Property& property)
 {
 {
-	return style->SetProperty(property_id, property);
+	return style->SetProperty(name, property);
 }
 }
 
 
 // Returns one of this element's properties.
 // Returns one of this element's properties.
-const Property* Element::GetProperty(PropertyId property_id)
+const Property* Element::GetProperty(const String& name)
 {
 {
-	return style->GetProperty(property_id);
+	return style->GetProperty(name);	
 }
 }
 
 
 // Returns one of this element's properties.
 // Returns one of this element's properties.
-const Property* Element::GetLocalProperty(PropertyId property_id)
+const Property* Element::GetLocalProperty(const String& name)
 {
 {
-	return style->GetLocalProperty(property_id);
+	return style->GetLocalProperty(name);
 }
 }
 
 
 const PropertyMap * Element::GetLocalProperties()
 const PropertyMap * Element::GetLocalProperties()
@@ -562,9 +562,9 @@ const PropertyMap * Element::GetLocalProperties()
 }
 }
 
 
 // Resolves one of this element's style.
 // Resolves one of this element's style.
-float Element::ResolveProperty(PropertyId property_id, float base_value)
+float Element::ResolveProperty(const String& name, float base_value)
 {
 {
-	return style->ResolveProperty(property_id, base_value);
+	return style->ResolveProperty(name, base_value);
 }
 }
 
 
 // Resolves one of this element's style.
 // Resolves one of this element's style.
@@ -902,16 +902,16 @@ const Vector2f Element::Project(const Vector2f& point) noexcept
 		// return a value that's pretty sure to not match anything,
 		// return a value that's pretty sure to not match anything,
 		// since this case has nothing to do with the user `picking'
 		// since this case has nothing to do with the user `picking'
 		// anything.
 		// anything.
-		constexpr float inf = std::numeric_limits< float >::infinity();
+		float inf = std::numeric_limits< float >::infinity();
 		return Vector2f(-inf, -inf);
 		return Vector2f(-inf, -inf);
 	}
 	}
 }
 }
 
 
 
 
 // Iterates over the properties defined on this element.
 // Iterates over the properties defined on this element.
-bool Element::IterateProperties(int& index, PseudoClassList& pseudo_classes, PropertyId& property_id, const Property*& property) const
+bool Element::IterateProperties(int& index, PseudoClassList& pseudo_classes, String& name, const Property*& property) const
 {
 {
-	return style->IterateProperties(index, pseudo_classes, property_id, property);
+	return style->IterateProperties(index, pseudo_classes, name, property);
 }
 }
 
 
 // Sets or removes a pseudo-class on the element.
 // Sets or removes a pseudo-class on the element.
@@ -1120,7 +1120,7 @@ void Element::SetScrollLeft(float scroll_left)
 	scroll->UpdateScrollbar(ElementScroll::HORIZONTAL);
 	scroll->UpdateScrollbar(ElementScroll::HORIZONTAL);
 	DirtyOffset();
 	DirtyOffset();
 
 
-	DispatchEvent(EventId::Scroll, Dictionary());
+	DispatchEvent("scroll", Dictionary());
 }
 }
 
 
 // Gets the top scroll offset of the element.
 // Gets the top scroll offset of the element.
@@ -1136,7 +1136,7 @@ void Element::SetScrollTop(float scroll_top)
 	scroll->UpdateScrollbar(ElementScroll::VERTICAL);
 	scroll->UpdateScrollbar(ElementScroll::VERTICAL);
 	DirtyOffset();
 	DirtyOffset();
 
 
-	DispatchEvent(EventId::Scroll, Dictionary());
+	DispatchEvent("scroll", Dictionary());
 }
 }
 
 
 // Gets the width of the scrollable content of the element; it includes the element padding but not its margin.
 // Gets the width of the scrollable content of the element; it includes the element padding but not its margin.
@@ -1268,7 +1268,7 @@ void Element::SetInnerRML(const String& rml)
 bool Element::Focus()
 bool Element::Focus()
 {
 {
 	// Are we allowed focus?
 	// Are we allowed focus?
-	int focus_property = GetProperty< int >(PropertyId::Focus);
+	int focus_property = GetProperty< int >(FOCUS);
 	if (focus_property == FOCUS_NONE)
 	if (focus_property == FOCUS_NONE)
 		return false;
 		return false;
 
 
@@ -1325,21 +1325,21 @@ void Element::Click()
 }
 }
 
 
 // Adds an event listener
 // Adds an event listener
-void Element::AddEventListener(EventId event_id, EventListener* listener, bool in_capture_phase)
+void Element::AddEventListener(const String& event, EventListener* listener, bool in_capture_phase)
 {
 {
-	event_dispatcher->AttachEvent(event_id, listener, in_capture_phase);
+	event_dispatcher->AttachEvent(event, listener, in_capture_phase);
 }
 }
 
 
 // Removes an event listener from this element.
 // Removes an event listener from this element.
-void Element::RemoveEventListener(EventId event_id, EventListener* listener, bool in_capture_phase)
+void Element::RemoveEventListener(const String& event, EventListener* listener, bool in_capture_phase)
 {
 {
-	event_dispatcher->DetachEvent(event_id, listener, in_capture_phase);
+	event_dispatcher->DetachEvent(event, listener, in_capture_phase);
 }
 }
 
 
 // Dispatches the specified event
 // Dispatches the specified event
-bool Element::DispatchEvent(EventId event_id, const Dictionary& parameters, bool interruptible)
+bool Element::DispatchEvent(const String& event, const Dictionary& parameters, bool interruptible)
 {
 {
-	return event_dispatcher->DispatchEvent(this, event_id, parameters, interruptible);
+	return event_dispatcher->DispatchEvent(this, event, parameters, interruptible);
 }
 }
 
 
 // Scrolls the parent element's contents so that this element is visible.
 // Scrolls the parent element's contents so that this element is visible.
@@ -1356,8 +1356,8 @@ void Element::ScrollIntoView(bool align_with_top)
 	Element* scroll_parent = parent;
 	Element* scroll_parent = parent;
 	while (scroll_parent != NULL)
 	while (scroll_parent != NULL)
 	{
 	{
-		int overflow_x_property = scroll_parent->GetProperty< int >(PropertyId::OverflowX);
-		int overflow_y_property = scroll_parent->GetProperty< int >(PropertyId::OverflowY);
+		int overflow_x_property = scroll_parent->GetProperty< int >(OVERFLOW_X);
+		int overflow_y_property = scroll_parent->GetProperty< int >(OVERFLOW_Y);
 
 
 		if ((overflow_x_property != OVERFLOW_VISIBLE &&
 		if ((overflow_x_property != OVERFLOW_VISIBLE &&
 			 scroll_parent->GetScrollWidth() > scroll_parent->GetClientWidth()) ||
 			 scroll_parent->GetScrollWidth() > scroll_parent->GetClientWidth()) ||
@@ -1642,12 +1642,12 @@ bool Element::IsClippingEnabled()
 	if (clipping_state_dirty)
 	if (clipping_state_dirty)
 	{
 	{
 		// Is clipping enabled for this element, yes unless both overlow properties are set to visible
 		// Is clipping enabled for this element, yes unless both overlow properties are set to visible
-		clipping_enabled = style->GetProperty(PropertyId::OverflowX)->Get< int >() != OVERFLOW_VISIBLE
-							|| style->GetProperty(PropertyId::OverflowY)->Get< int >() != OVERFLOW_VISIBLE;
+		clipping_enabled = style->GetProperty(OVERFLOW_X)->Get< int >() != OVERFLOW_VISIBLE 
+							|| style->GetProperty(OVERFLOW_Y)->Get< int >() != OVERFLOW_VISIBLE;
 		
 		
 		// Get the clipping ignore depth from the clip property
 		// Get the clipping ignore depth from the clip property
 		clipping_ignore_depth = 0;
 		clipping_ignore_depth = 0;
-		const Property* clip_property = GetProperty(PropertyId::Clip);
+		const Property* clip_property = GetProperty(CLIP);
 		if (clip_property->unit == Property::NUMBER)
 		if (clip_property->unit == Property::NUMBER)
 			clipping_ignore_depth = clip_property->Get< int >();
 			clipping_ignore_depth = clip_property->Get< int >();
 		else if (clip_property->Get< int >() == CLIP_NONE)
 		else if (clip_property->Get< int >() == CLIP_NONE)
@@ -1725,13 +1725,16 @@ void Element::OnAttributeChange(const AttributeNameList& changed_attributes)
 		StyleSheetParser parser;
 		StyleSheetParser parser;
 		parser.ParseProperties(properties, GetAttribute< String >("style", ""));
 		parser.ParseProperties(properties, GetAttribute< String >("style", ""));
 
 
-		for (auto& [id, value] : properties)
-			SetProperty(id, value);
+		Rocket::Core::PropertyMap property_map = properties.GetProperties();
+		for (Rocket::Core::PropertyMap::iterator i = property_map.begin(); i != property_map.end(); ++i)
+		{
+			SetProperty((*i).first, (*i).second);
+		}
 	}
 	}
 }
 }
 
 
 // Called when properties on the element are changed.
 // Called when properties on the element are changed.
-void Element::OnPropertyChange(const PropertyIdList& changed_properties)
+void Element::OnPropertyChange(const PropertyNameList& changed_properties)
 {
 {
 	bool all_dirty = false;
 	bool all_dirty = false;
 	{
 	{
@@ -1749,9 +1752,9 @@ void Element::OnPropertyChange(const PropertyIdList& changed_properties)
 		else
 		else
 		{
 		{
 			// Force a relayout if any of the changed properties require it.
 			// Force a relayout if any of the changed properties require it.
-			for (const auto& p : changed_properties)
+			for (PropertyNameList::const_iterator i = changed_properties.begin(); i != changed_properties.end(); ++i)
 			{
 			{
-				const PropertyDefinition* property_definition = StyleSheetSpecification::GetProperty(p);
+				const PropertyDefinition* property_definition = StyleSheetSpecification::GetProperty(*i);
 				if (property_definition)
 				if (property_definition)
 				{
 				{
 					if (property_definition->IsLayoutForced())
 					if (property_definition->IsLayoutForced())
@@ -1765,11 +1768,11 @@ void Element::OnPropertyChange(const PropertyIdList& changed_properties)
 	}
 	}
 
 
 	// Update the visibility.
 	// Update the visibility.
-	if (all_dirty || changed_properties.find(PropertyId::Visibility) != changed_properties.end() ||
-		changed_properties.find(PropertyId::Display) != changed_properties.end())
+	if (all_dirty || changed_properties.find(VISIBILITY) != changed_properties.end() ||
+		changed_properties.find(DISPLAY) != changed_properties.end())
 	{
 	{
 		bool new_visibility = GetDisplay() != DISPLAY_NONE &&
 		bool new_visibility = GetDisplay() != DISPLAY_NONE &&
-							  GetProperty< int >(PropertyId::Visibility) == VISIBILITY_VISIBLE;
+							  GetProperty< int >(VISIBILITY) == VISIBILITY_VISIBLE;
 
 
 		if (visible != new_visibility)
 		if (visible != new_visibility)
 		{
 		{
@@ -1780,7 +1783,7 @@ void Element::OnPropertyChange(const PropertyIdList& changed_properties)
 		}
 		}
 
 
 		if (all_dirty || 
 		if (all_dirty || 
-			changed_properties.find(PropertyId::Display) != changed_properties.end())
+			changed_properties.find(DISPLAY) != changed_properties.end())
 		{
 		{
 			if (parent != NULL)
 			if (parent != NULL)
 				parent->DirtyStructure();
 				parent->DirtyStructure();
@@ -1789,11 +1792,11 @@ void Element::OnPropertyChange(const PropertyIdList& changed_properties)
 
 
 	// Fetch a new font face if it has been changed.
 	// Fetch a new font face if it has been changed.
 	if (all_dirty ||
 	if (all_dirty ||
-		changed_properties.find(PropertyId::FontFamily) != changed_properties.end() ||
-		changed_properties.find(PropertyId::FontCharset) != changed_properties.end() ||
-		changed_properties.find(PropertyId::FontWeight) != changed_properties.end() ||
-		changed_properties.find(PropertyId::FontStyle) != changed_properties.end() ||
-		changed_properties.find(PropertyId::FontSize) != changed_properties.end())
+		changed_properties.find(FONT_FAMILY) != changed_properties.end() ||
+		changed_properties.find(FONT_CHARSET) != changed_properties.end() ||
+		changed_properties.find(FONT_WEIGHT) != changed_properties.end() ||
+		changed_properties.find(FONT_STYLE) != changed_properties.end() ||
+		changed_properties.find(FONT_SIZE) != changed_properties.end())
 	{
 	{
 		// Store the old em; if it changes, then we need to dirty all em-relative properties.
 		// Store the old em; if it changes, then we need to dirty all em-relative properties.
 		int old_em = -1;
 		int old_em = -1;
@@ -1832,10 +1835,10 @@ void Element::OnPropertyChange(const PropertyIdList& changed_properties)
 
 
 	// Update the position.
 	// Update the position.
 	if (all_dirty ||
 	if (all_dirty ||
-		changed_properties.find(PropertyId::Left) != changed_properties.end() ||
-		changed_properties.find(PropertyId::Right) != changed_properties.end() ||
-		changed_properties.find(PropertyId::Top) != changed_properties.end() ||
-		changed_properties.find(PropertyId::Bottom) != changed_properties.end())
+		changed_properties.find(LEFT) != changed_properties.end() ||
+		changed_properties.find(RIGHT) != changed_properties.end() ||
+		changed_properties.find(TOP) != changed_properties.end() ||
+		changed_properties.find(BOTTOM) != changed_properties.end())
 	{
 	{
 		UpdateOffset();
 		UpdateOffset();
 		DirtyOffset();
 		DirtyOffset();
@@ -1843,9 +1846,9 @@ void Element::OnPropertyChange(const PropertyIdList& changed_properties)
 
 
 	// Update the z-index.
 	// Update the z-index.
 	if (all_dirty || 
 	if (all_dirty || 
-		changed_properties.find(PropertyId::ZIndex) != changed_properties.end())
+		changed_properties.find(Z_INDEX) != changed_properties.end())
 	{
 	{
-		const Property* z_index_property = GetProperty(PropertyId::ZIndex);
+		const Property* z_index_property = GetProperty(Z_INDEX);
 
 
 		if (z_index_property->unit == Property::KEYWORD &&
 		if (z_index_property->unit == Property::KEYWORD &&
 			z_index_property->value.Get< int >() == Z_INDEX_AUTO)
 			z_index_property->value.Get< int >() == Z_INDEX_AUTO)
@@ -1898,64 +1901,106 @@ void Element::OnPropertyChange(const PropertyIdList& changed_properties)
 
 
 	// Dirty the background if it's changed.
 	// Dirty the background if it's changed.
     if (all_dirty ||
     if (all_dirty ||
-        changed_properties.find(PropertyId::BackgroundColor) != changed_properties.end() ||
-		changed_properties.find(PropertyId::Opacity) != changed_properties.end() ||
-		changed_properties.find(PropertyId::ImageColor) != changed_properties.end()) {
-		background->DirtyBackground();
-		decoration->ReloadDecorators();
-	}
+        changed_properties.find(BACKGROUND_COLOR) != changed_properties.end() ||
+		changed_properties.find(OPACITY) != changed_properties.end() ||
+		changed_properties.find(IMAGE_COLOR) != changed_properties.end()) {
+        background->DirtyBackground();
+        decoration->ReloadDecorators();
+    }
 
 
 	// Dirty the border if it's changed.
 	// Dirty the border if it's changed.
-	if (all_dirty ||
-		changed_properties.find(PropertyId::BorderTopWidth) != changed_properties.end() ||
-		changed_properties.find(PropertyId::BorderRightWidth) != changed_properties.end() ||
-		changed_properties.find(PropertyId::BorderBottomWidth) != changed_properties.end() ||
-		changed_properties.find(PropertyId::BorderLeftWidth) != changed_properties.end() ||
-		changed_properties.find(PropertyId::BorderTopColor) != changed_properties.end() ||
-		changed_properties.find(PropertyId::BorderRightColor) != changed_properties.end() ||
-		changed_properties.find(PropertyId::BorderBottomColor) != changed_properties.end() ||
-		changed_properties.find(PropertyId::BorderLeftColor) != changed_properties.end() ||
-		changed_properties.find(PropertyId::Opacity) != changed_properties.end())
+	if (all_dirty || 
+		changed_properties.find(BORDER_TOP_WIDTH) != changed_properties.end() ||
+		changed_properties.find(BORDER_RIGHT_WIDTH) != changed_properties.end() ||
+		changed_properties.find(BORDER_BOTTOM_WIDTH) != changed_properties.end() ||
+		changed_properties.find(BORDER_LEFT_WIDTH) != changed_properties.end() ||
+		changed_properties.find(BORDER_TOP_COLOR) != changed_properties.end() ||
+		changed_properties.find(BORDER_RIGHT_COLOR) != changed_properties.end() ||
+		changed_properties.find(BORDER_BOTTOM_COLOR) != changed_properties.end() ||
+		changed_properties.find(BORDER_LEFT_COLOR) != changed_properties.end() ||
+		changed_properties.find(OPACITY) != changed_properties.end())
 		border->DirtyBorder();
 		border->DirtyBorder();
 
 
 	
 	
 	// Check for clipping state changes
 	// Check for clipping state changes
 	if (all_dirty ||
 	if (all_dirty ||
-		changed_properties.find(PropertyId::Clip) != changed_properties.end() ||
-		changed_properties.find(PropertyId::OverflowX) != changed_properties.end() ||
-		changed_properties.find(PropertyId::OverflowY) != changed_properties.end())
+		changed_properties.find(CLIP) != changed_properties.end() ||
+		changed_properties.find(OVERFLOW_X) != changed_properties.end() ||
+		changed_properties.find(OVERFLOW_Y) != changed_properties.end())
 	{
 	{
 		clipping_state_dirty = true;
 		clipping_state_dirty = true;
 	}
 	}
 
 
 	// Check for `perspective' and `perspective-origin' changes
 	// Check for `perspective' and `perspective-origin' changes
 	if (all_dirty ||
 	if (all_dirty ||
-		changed_properties.find(PropertyId::Perspective) != changed_properties.end() ||
-		changed_properties.find(PropertyId::PerspectiveOriginX) != changed_properties.end() ||
-		changed_properties.find(PropertyId::PerspectiveOriginY) != changed_properties.end())
+		changed_properties.find(PERSPECTIVE) != changed_properties.end() ||
+		changed_properties.find(PERSPECTIVE_ORIGIN_X) != changed_properties.end() ||
+		changed_properties.find(PERSPECTIVE_ORIGIN_Y) != changed_properties.end())
 	{
 	{
 		DirtyTransformState(true, false, false);
 		DirtyTransformState(true, false, false);
 	}
 	}
 
 
 	// Check for `transform' and `transform-origin' changes
 	// Check for `transform' and `transform-origin' changes
 	if (all_dirty ||
 	if (all_dirty ||
-		changed_properties.find(PropertyId::Transform) != changed_properties.end() ||
-		changed_properties.find(PropertyId::TransformOriginX) != changed_properties.end() ||
-		changed_properties.find(PropertyId::TransformOriginY) != changed_properties.end() ||
-		changed_properties.find(PropertyId::TransformOriginZ) != changed_properties.end())
+		changed_properties.find(TRANSFORM) != changed_properties.end() ||
+		changed_properties.find(TRANSFORM_ORIGIN_X) != changed_properties.end() ||
+		changed_properties.find(TRANSFORM_ORIGIN_Y) != changed_properties.end() ||
+		changed_properties.find(TRANSFORM_ORIGIN_Z) != changed_properties.end())
 	{
 	{
 		DirtyTransformState(false, true, false);
 		DirtyTransformState(false, true, false);
 	}
 	}
 
 
 	// Check for `animation' changes
 	// Check for `animation' changes
-	if (all_dirty || changed_properties.find(PropertyId::Animation) != changed_properties.end())
+	if (all_dirty || changed_properties.find(ANIMATION) != changed_properties.end())
 	{
 	{
 		DirtyAnimation();
 		DirtyAnimation();
 	}
 	}
 }
 }
 
 
-void Element::DirtyProperties(const PropertyIdList& changed_properties)
+void Element::DirtyProperties(const PropertyNameList& changed_properties) 
 { 
 { 
+	// 
+	//if (
+	//	changed_properties.find(FONT_FAMILY) != changed_properties.end() ||
+	//	changed_properties.find(FONT_CHARSET) != changed_properties.end() ||
+	//	changed_properties.find(FONT_WEIGHT) != changed_properties.end() ||
+	//	changed_properties.find(FONT_STYLE) != changed_properties.end() ||
+	//	changed_properties.find(FONT_SIZE) != changed_properties.end())
+	//{
+	//	// Store the old em; if it changes, then we need to dirty all em-relative properties.
+	//	int old_em = -1;
+	//	if (font_face_handle != NULL)
+	//		old_em = font_face_handle->GetLineHeight();
+
+	//	// Fetch the new font face.
+	//	FontFaceHandle * new_font_face_handle = ElementUtilities::GetFontFaceHandle(this);
+
+	//	// If this is different from our current font face, then we've got to nuke
+	//	// all our characters and tell our parent that we have to be re-laid out.
+	//	if (new_font_face_handle != font_face_handle)
+	//	{
+	//		if (font_face_handle)
+	//			font_face_handle->RemoveReference();
+
+	//		font_face_handle = new_font_face_handle;
+
+	//		// Our font face has changed; odds are, so has our em. All of our em-relative values
+	//		// have therefore probably changed as well, so we'll need to dirty them.
+	//		int new_em = -1;
+	//		if (font_face_handle != NULL)
+	//			new_em = font_face_handle->GetLineHeight();
+
+	//		// However, if all properties are dirty, we don't need to perform this expensive
+	//		// step as all properties are dirtied below anyway.
+	//		if (old_em != new_em && !all_properties_dirty)
+	//		{
+	//			style->DirtyEmProperties();
+	//		}
+	//	}
+	//	else if (new_font_face_handle != NULL)
+	//		new_font_face_handle->RemoveReference();
+	//}
+
 	if (all_properties_dirty)
 	if (all_properties_dirty)
 		return;
 		return;
 
 
@@ -2037,15 +2082,15 @@ void Element::OnReferenceDeactivate()
 
 
 void Element::ProcessEvent(Event& event)
 void Element::ProcessEvent(Event& event)
 {
 {
-	if (event == EventId::Mousedown && IsPointWithinElement(Vector2f(event.GetParameter< float >("mouse_x", 0), event.GetParameter< float >("mouse_y", 0))) &&
+	if (event == MOUSEDOWN && IsPointWithinElement(Vector2f(event.GetParameter< float >("mouse_x", 0), event.GetParameter< float >("mouse_y", 0))) &&
 		event.GetParameter< int >("button", 0) == 0)
 		event.GetParameter< int >("button", 0) == 0)
 		SetPseudoClass("active", true);
 		SetPseudoClass("active", true);
 
 
-	if (event == EventId::Mousescroll)
+	if (event == MOUSESCROLL)
 	{
 	{
 		if (GetScrollHeight() > GetClientHeight())
 		if (GetScrollHeight() > GetClientHeight())
 		{
 		{
-			int overflow_property = GetProperty< int >(PropertyId::OverflowY);
+			int overflow_property = GetProperty< int >(OVERFLOW_Y);
 			if (overflow_property == OVERFLOW_AUTO ||
 			if (overflow_property == OVERFLOW_AUTO ||
 				overflow_property == OVERFLOW_SCROLL)
 				overflow_property == OVERFLOW_SCROLL)
 			{
 			{
@@ -2058,7 +2103,7 @@ void Element::ProcessEvent(Event& event)
 				if ((wheel_delta < 0 && GetScrollTop() > 0) ||
 				if ((wheel_delta < 0 && GetScrollTop() > 0) ||
 					(wheel_delta > 0 && GetScrollHeight() > GetScrollTop() + GetClientHeight()))
 					(wheel_delta > 0 && GetScrollHeight() > GetScrollTop() + GetClientHeight()))
 				{
 				{
-					SetScrollTop(GetScrollTop() + wheel_delta * (GetFontFaceHandle() ? ElementUtilities::GetLineHeight(this) : (GetProperty(PropertyId::ScrollDefaultStepSize) ? GetProperty< int >(PropertyId::ScrollDefaultStepSize) : 0)));
+					SetScrollTop(GetScrollTop() + wheel_delta * (GetFontFaceHandle() ? ElementUtilities::GetLineHeight(this) : (GetProperty(SCROLL_DEFAULT_STEP_SIZE) ? GetProperty< int >(SCROLL_DEFAULT_STEP_SIZE) : 0)));
 				}
 				}
 			}
 			}
 		}
 		}
@@ -2068,14 +2113,14 @@ void Element::ProcessEvent(Event& event)
 
 
 	if (event.GetTargetElement() == this)
 	if (event.GetTargetElement() == this)
 	{
 	{
-		if (event == EventId::Mouseover)
+		if (event == MOUSEOVER)
 			SetPseudoClass("hover", true);
 			SetPseudoClass("hover", true);
-		else if (event == EventId::Mouseout)
+		else if (event == MOUSEOUT)
 			SetPseudoClass("hover", false);
 			SetPseudoClass("hover", false);
-		else if (event == EventId::Focus)
-			SetPseudoClass("focus", true);
-		else if (event == EventId::Blur)
-			SetPseudoClass("focus", false);
+		else if (event == FOCUS)
+			SetPseudoClass(FOCUS, true);
+		else if (event == BLUR)
+			SetPseudoClass(FOCUS, false);
 	}
 	}
 }
 }
 
 
@@ -2178,27 +2223,27 @@ void Element::UpdateOffset()
 			const Box& parent_box = offset_parent->GetBox();
 			const Box& parent_box = offset_parent->GetBox();
 			Vector2f containing_block = parent_box.GetSize(Box::PADDING);
 			Vector2f containing_block = parent_box.GetSize(Box::PADDING);
 
 
-			const Property *left = GetLocalProperty(PropertyId::Left);
-			const Property *right = GetLocalProperty(PropertyId::Right);
+			const Property *left = GetLocalProperty(LEFT);
+			const Property *right = GetLocalProperty(RIGHT);
 			// If the element is anchored left, then the position is offset by that resolved value.
 			// If the element is anchored left, then the position is offset by that resolved value.
 			if (left != NULL && left->unit != Property::KEYWORD)
 			if (left != NULL && left->unit != Property::KEYWORD)
-				relative_offset_base.x = parent_box.GetEdge(Box::BORDER, Box::LEFT) + (ResolveProperty(PropertyId::Left, containing_block.x) + GetBox().GetEdge(Box::MARGIN, Box::LEFT));
+				relative_offset_base.x = parent_box.GetEdge(Box::BORDER, Box::LEFT) + (ResolveProperty(LEFT, containing_block.x) + GetBox().GetEdge(Box::MARGIN, Box::LEFT));
 			// If the element is anchored right, then the position is set first so the element's right-most edge
 			// If the element is anchored right, then the position is set first so the element's right-most edge
 			// (including margins) will render up against the containing box's right-most content edge, and then
 			// (including margins) will render up against the containing box's right-most content edge, and then
 			// offset by the resolved value.
 			// offset by the resolved value.
 			else if (right != NULL && right->unit != Property::KEYWORD)
 			else if (right != NULL && right->unit != Property::KEYWORD)
-				relative_offset_base.x = containing_block.x + parent_box.GetEdge(Box::BORDER, Box::LEFT) - (ResolveProperty(PropertyId::Right, containing_block.x) + GetBox().GetSize(Box::BORDER).x + GetBox().GetEdge(Box::MARGIN, Box::RIGHT));
+				relative_offset_base.x = containing_block.x + parent_box.GetEdge(Box::BORDER, Box::LEFT) - (ResolveProperty(RIGHT, containing_block.x) + GetBox().GetSize(Box::BORDER).x + GetBox().GetEdge(Box::MARGIN, Box::RIGHT));
 
 
-			const Property *top = GetLocalProperty(PropertyId::Top);
-			const Property *bottom = GetLocalProperty(PropertyId::Bottom);
+			const Property *top = GetLocalProperty(TOP);
+			const Property *bottom = GetLocalProperty(BOTTOM);
 			// If the element is anchored top, then the position is offset by that resolved value.
 			// If the element is anchored top, then the position is offset by that resolved value.
 			if (top != NULL && top->unit != Property::KEYWORD)
 			if (top != NULL && top->unit != Property::KEYWORD)
-				relative_offset_base.y = parent_box.GetEdge(Box::BORDER, Box::TOP) + (ResolveProperty(PropertyId::Top, containing_block.y) + GetBox().GetEdge(Box::MARGIN, Box::TOP));
+				relative_offset_base.y = parent_box.GetEdge(Box::BORDER, Box::TOP) + (ResolveProperty(TOP, containing_block.y) + GetBox().GetEdge(Box::MARGIN, Box::TOP));
 			// If the element is anchored bottom, then the position is set first so the element's right-most edge
 			// If the element is anchored bottom, then the position is set first so the element's right-most edge
 			// (including margins) will render up against the containing box's right-most content edge, and then
 			// (including margins) will render up against the containing box's right-most content edge, and then
 			// offset by the resolved value.
 			// offset by the resolved value.
 			else if (bottom != NULL && bottom->unit != Property::KEYWORD)
 			else if (bottom != NULL && bottom->unit != Property::KEYWORD)
-				relative_offset_base.y = containing_block.y + parent_box.GetEdge(Box::BORDER, Box::TOP) - (ResolveProperty(PropertyId::Bottom, containing_block.y) + GetBox().GetSize(Box::BORDER).y + GetBox().GetEdge(Box::MARGIN, Box::BOTTOM));
+				relative_offset_base.y = containing_block.y + parent_box.GetEdge(Box::BORDER, Box::TOP) - (ResolveProperty(BOTTOM, containing_block.y) + GetBox().GetSize(Box::BORDER).y + GetBox().GetEdge(Box::MARGIN, Box::BOTTOM));
 		}
 		}
 	}
 	}
 	else if (position_property == POSITION_RELATIVE)
 	else if (position_property == POSITION_RELATIVE)
@@ -2208,21 +2253,21 @@ void Element::UpdateOffset()
 			const Box& parent_box = offset_parent->GetBox();
 			const Box& parent_box = offset_parent->GetBox();
 			Vector2f containing_block = parent_box.GetSize();
 			Vector2f containing_block = parent_box.GetSize();
 
 
-			const Property *left = GetLocalProperty(PropertyId::Left);
-			const Property *right = GetLocalProperty(PropertyId::Right);
+			const Property *left = GetLocalProperty(LEFT);
+			const Property *right = GetLocalProperty(RIGHT);
 			if (left != NULL && left->unit != Property::KEYWORD)
 			if (left != NULL && left->unit != Property::KEYWORD)
-				relative_offset_position.x = ResolveProperty(PropertyId::Left, containing_block.x);
+				relative_offset_position.x = ResolveProperty(LEFT, containing_block.x);
 			else if (right != NULL && right->unit != Property::KEYWORD)
 			else if (right != NULL && right->unit != Property::KEYWORD)
-				relative_offset_position.x = -1 * ResolveProperty(PropertyId::Right, containing_block.x);
+				relative_offset_position.x = -1 * ResolveProperty(RIGHT, containing_block.x);
 			else
 			else
 				relative_offset_position.x = 0;
 				relative_offset_position.x = 0;
 
 
-			const Property *top = GetLocalProperty(PropertyId::Top);
-			const Property *bottom = GetLocalProperty(PropertyId::Bottom);
+			const Property *top = GetLocalProperty(TOP);
+			const Property *bottom = GetLocalProperty(BOTTOM);
 			if (top != NULL && top->unit != Property::KEYWORD)
 			if (top != NULL && top->unit != Property::KEYWORD)
-				relative_offset_position.y = ResolveProperty(PropertyId::Top, containing_block.y);
+				relative_offset_position.y = ResolveProperty(TOP, containing_block.y);
 			else if (bottom != NULL && bottom->unit != Property::KEYWORD)
 			else if (bottom != NULL && bottom->unit != Property::KEYWORD)
-				relative_offset_position.y = -1 * ResolveProperty(PropertyId::Bottom, containing_block.y);
+				relative_offset_position.y = -1 * ResolveProperty(BOTTOM, containing_block.y);
 			else
 			else
 				relative_offset_position.y = 0;
 				relative_offset_position.y = 0;
 		}
 		}
@@ -2332,11 +2377,11 @@ void Element::UpdateStructure()
 }
 }
 
 
 
 
-bool Element::Animate(PropertyId property_id, const Property & target_value, float duration, Tween tween, int num_iterations, bool alternate_direction, float delay, const Property* start_value)
+bool Element::Animate(const String & property_name, const Property & target_value, float duration, Tween tween, int num_iterations, bool alternate_direction, float delay, const Property* start_value)
 {
 {
 	bool result = false;
 	bool result = false;
 
 
-	if (auto it_animation = StartAnimation(property_id, start_value, num_iterations, alternate_direction, delay); it_animation != animations.end())
+	if (auto it_animation = StartAnimation(property_name, start_value, num_iterations, alternate_direction, delay); it_animation != animations.end())
 	{
 	{
 		result = it_animation->AddKey(duration, target_value, *this, tween, true);
 		result = it_animation->AddKey(duration, target_value, *this, tween, true);
 		if (!result)
 		if (!result)
@@ -2347,12 +2392,12 @@ bool Element::Animate(PropertyId property_id, const Property & target_value, flo
 }
 }
 
 
 
 
-bool Element::AddAnimationKey(PropertyId property_id, const Property & target_value, float duration, Tween tween)
+bool Element::AddAnimationKey(const String & property_name, const Property & target_value, float duration, Tween tween)
 {
 {
 	ElementAnimation* animation = nullptr;
 	ElementAnimation* animation = nullptr;
 
 
 	for (auto& existing_animation : animations) {
 	for (auto& existing_animation : animations) {
-		if (existing_animation.GetPropertyId() == property_id) {
+		if (existing_animation.GetPropertyName() == property_name) {
 			animation = &existing_animation;
 			animation = &existing_animation;
 			break;
 			break;
 		}
 		}
@@ -2366,9 +2411,9 @@ bool Element::AddAnimationKey(PropertyId property_id, const Property & target_va
 }
 }
 
 
 
 
-ElementAnimationList::iterator Element::StartAnimation(PropertyId property_id, const Property* start_value, int num_iterations, bool alternate_direction, float delay)
+ElementAnimationList::iterator Element::StartAnimation(const String & property_name, const Property* start_value, int num_iterations, bool alternate_direction, float delay)
 {
 {
-	auto it = std::find_if(animations.begin(), animations.end(), [property_id](const ElementAnimation& el) { return el.GetPropertyId() == property_id; });
+	auto it = std::find_if(animations.begin(), animations.end(), [&](const ElementAnimation& el) { return el.GetPropertyName() == property_name; });
 
 
 	if (it == animations.end())
 	if (it == animations.end())
 	{
 	{
@@ -2382,10 +2427,10 @@ ElementAnimationList::iterator Element::StartAnimation(PropertyId property_id, c
 	{
 	{
 		value = *start_value;
 		value = *start_value;
 		if (!value.definition)
 		if (!value.definition)
-			if(auto default_value = GetProperty(property_id))
+			if(auto default_value = GetProperty(property_name))
 				value.definition = default_value->definition;	
 				value.definition = default_value->definition;	
 	}
 	}
-	else if (auto default_value = GetProperty(property_id))
+	else if (auto default_value = GetProperty(property_name))
 	{
 	{
 		value = *default_value;
 		value = *default_value;
 	}
 	}
@@ -2393,7 +2438,7 @@ ElementAnimationList::iterator Element::StartAnimation(PropertyId property_id, c
 	if (value.definition)
 	if (value.definition)
 	{
 	{
 		double start_time = Clock::GetElapsedTime() + (double)delay;
 		double start_time = Clock::GetElapsedTime() + (double)delay;
-		*it = ElementAnimation{ property_id, value, start_time, 0.0f, num_iterations, alternate_direction, false };
+		*it = ElementAnimation{ property_name, value, start_time, 0.0f, num_iterations, alternate_direction, false };
 	}
 	}
 	else
 	else
 	{
 	{
@@ -2405,17 +2450,17 @@ ElementAnimationList::iterator Element::StartAnimation(PropertyId property_id, c
 }
 }
 
 
 
 
-bool Element::AddAnimationKeyTime(PropertyId property_id, const Property* target_value, float time, Tween tween)
+bool Element::AddAnimationKeyTime(const String & property_name, const Property* target_value, float time, Tween tween)
 {
 {
 	if (!target_value)
 	if (!target_value)
-		target_value = GetProperty(property_id);
+		target_value = GetProperty(property_name);
 	if (!target_value)
 	if (!target_value)
 		return false;
 		return false;
 
 
 	ElementAnimation* animation = nullptr;
 	ElementAnimation* animation = nullptr;
 
 
 	for (auto& existing_animation : animations) {
 	for (auto& existing_animation : animations) {
-		if (existing_animation.GetPropertyId() == property_id) {
+		if (existing_animation.GetPropertyName() == property_name) {
 			animation = &existing_animation;
 			animation = &existing_animation;
 			break;
 			break;
 		}
 		}
@@ -2430,7 +2475,7 @@ bool Element::AddAnimationKeyTime(PropertyId property_id, const Property* target
 
 
 bool Element::StartTransition(const Transition & transition, const Property& start_value, const Property & target_value)
 bool Element::StartTransition(const Transition & transition, const Property& start_value, const Property & target_value)
 {
 {
-	auto it = std::find_if(animations.begin(), animations.end(), [&transition](const ElementAnimation& el) { return el.GetPropertyId() == transition.property_id; });
+	auto it = std::find_if(animations.begin(), animations.end(), [&](const ElementAnimation& el) { return el.GetPropertyName() == transition.name; });
 
 
 	if (it != animations.end() && !it->IsTransition())
 	if (it != animations.end() && !it->IsTransition())
 		return false;
 		return false;
@@ -2442,7 +2487,7 @@ bool Element::StartTransition(const Transition & transition, const Property& sta
 	{
 	{
 		// Add transition as new animation
 		// Add transition as new animation
 		animations.push_back(
 		animations.push_back(
-			ElementAnimation{ transition.property_id, start_value, start_time, 0.0f, 1, false, true }
+			ElementAnimation{ transition.name, start_value, start_time, 0.0f, 1, false, true }
 		);
 		);
 		it = (animations.end() - 1);
 		it = (animations.end() - 1);
 	}
 	}
@@ -2453,13 +2498,13 @@ bool Element::StartTransition(const Transition & transition, const Property& sta
 		f = 1.0f - (1.0f - f)*transition.reverse_adjustment_factor;
 		f = 1.0f - (1.0f - f)*transition.reverse_adjustment_factor;
 		duration = duration * f;
 		duration = duration * f;
 		// Replace old transition
 		// Replace old transition
-		*it = ElementAnimation{ transition.property_id, start_value, start_time, 0.0f, 1, false, true };
+		*it = ElementAnimation{ transition.name, start_value, start_time, 0.0f, 1, false, true };
 	}
 	}
 
 
 	bool result = it->AddKey(duration, target_value, *this, transition.tween, true);
 	bool result = it->AddKey(duration, target_value, *this, transition.tween, true);
 
 
 	if (result)
 	if (result)
-		SetProperty(transition.property_id, start_value);
+		SetProperty(transition.name, start_value);
 	else
 	else
 		animations.erase(it);
 		animations.erase(it);
 
 
@@ -2476,7 +2521,7 @@ void Element::UpdateAnimation()
 {
 {
 	if (dirty_animation)
 	if (dirty_animation)
 	{
 	{
-		const Property* property = style->GetLocalProperty(PropertyId::Animation);
+		const Property* property = style->GetLocalProperty(ANIMATION);
 		StyleSheet* stylesheet = nullptr;
 		StyleSheet* stylesheet = nullptr;
 
 
 		if (property && (stylesheet = GetStyleSheet()))
 		if (property && (stylesheet = GetStyleSheet()))
@@ -2488,29 +2533,29 @@ void Element::UpdateAnimation()
 				Keyframes* keyframes_ptr = stylesheet->GetKeyframes(animation.name);
 				Keyframes* keyframes_ptr = stylesheet->GetKeyframes(animation.name);
 				if (keyframes_ptr && keyframes_ptr->blocks.size() >= 1 && !animation.paused)
 				if (keyframes_ptr && keyframes_ptr->blocks.size() >= 1 && !animation.paused)
 				{
 				{
-					auto& property_ids = keyframes_ptr->property_ids;
+					auto& property_names = keyframes_ptr->property_names;
 					auto& blocks = keyframes_ptr->blocks;
 					auto& blocks = keyframes_ptr->blocks;
 
 
 					bool has_from_key = (blocks[0].normalized_time == 0);
 					bool has_from_key = (blocks[0].normalized_time == 0);
 					bool has_to_key = (blocks.back().normalized_time == 1);
 					bool has_to_key = (blocks.back().normalized_time == 1);
 
 
 					// If the first key defines initial conditions for a given property, use those values, else, use this element's current values.
 					// If the first key defines initial conditions for a given property, use those values, else, use this element's current values.
-					for (PropertyId id : property_ids)
-						StartAnimation(id, (has_from_key ? GetIf(blocks[0].properties, id) : nullptr), animation.num_iterations, animation.alternate, animation.delay);
+					for (auto& property : property_names)
+						StartAnimation(property, (has_from_key ? blocks[0].properties.GetProperty(property) : nullptr), animation.num_iterations, animation.alternate, animation.delay);
 
 
 					// Need to skip the first and last keys if they set the initial and end conditions, respectively.
 					// Need to skip the first and last keys if they set the initial and end conditions, respectively.
 					for (int i = (has_from_key ? 1 : 0); i < (int)blocks.size() + (has_to_key ? -1 : 0); i++)
 					for (int i = (has_from_key ? 1 : 0); i < (int)blocks.size() + (has_to_key ? -1 : 0); i++)
 					{
 					{
 						// Add properties of current key to animation
 						// Add properties of current key to animation
 						float time = blocks[i].normalized_time * animation.duration;
 						float time = blocks[i].normalized_time * animation.duration;
-						for (auto& property : blocks[i].properties)
+						for (auto& property : blocks[i].properties.GetProperties())
 							AddAnimationKeyTime(property.first, &property.second, time, animation.tween);
 							AddAnimationKeyTime(property.first, &property.second, time, animation.tween);
 					}
 					}
 
 
 					// If the last key defines end conditions for a given property, use those values, else, use this element's current values.
 					// If the last key defines end conditions for a given property, use those values, else, use this element's current values.
 					float time = animation.duration;
 					float time = animation.duration;
-					for (PropertyId id : property_ids)
-						AddAnimationKeyTime(id, (has_to_key ? GetIf(blocks.back().properties, id) : nullptr), time, animation.tween);
+					for (auto& property : property_names)
+						AddAnimationKeyTime(property, (has_to_key ? blocks.back().properties.GetProperty(property) : nullptr), time, animation.tween);
 				}
 				}
 			}
 			}
 		}
 		}
@@ -2529,7 +2574,7 @@ void Element::AdvanceAnimations()
 		{
 		{
 			Property property = animation.UpdateAndGetProperty(time, *this);
 			Property property = animation.UpdateAndGetProperty(time, *this);
 			if (property.unit != Property::UNKNOWN)
 			if (property.unit != Property::UNKNOWN)
-				SetProperty(animation.GetPropertyId(), property);
+				SetProperty(animation.GetPropertyName(), property);
 		}
 		}
 
 
 		auto it_completed = std::remove_if(animations.begin(), animations.end(), [](const ElementAnimation& animation) { return animation.IsComplete(); });
 		auto it_completed = std::remove_if(animations.begin(), animations.end(), [](const ElementAnimation& animation) { return animation.IsComplete(); });
@@ -2541,7 +2586,7 @@ void Element::AdvanceAnimations()
 
 
 		for (auto it = it_completed; it != animations.end(); ++it)
 		for (auto it = it_completed; it != animations.end(); ++it)
 		{
 		{
-			dictionary_list.emplace_back(Dictionary({ { "property", GetName(it->GetPropertyId())} }));
+			dictionary_list.emplace_back(Dictionary({ { "property", it->GetPropertyName()} }));
 			is_transition.push_back(it->IsTransition());
 			is_transition.push_back(it->IsTransition());
 		}
 		}
 
 
@@ -2549,7 +2594,7 @@ void Element::AdvanceAnimations()
 		animations.erase(it_completed, animations.end());
 		animations.erase(it_completed, animations.end());
 
 
 		for (size_t i = 0; i < dictionary_list.size(); i++)
 		for (size_t i = 0; i < dictionary_list.size(); i++)
-			DispatchEvent(is_transition[i] ? EventId::Transitionend : EventId::Animationend, dictionary_list[i]);
+			DispatchEvent(is_transition[i] ? TRANSITIONEND : ANIMATIONEND, dictionary_list[i]);
 	}
 	}
 }
 }
 
 

+ 2 - 2
Source/Core/ElementAnimation.cpp

@@ -366,8 +366,8 @@ static bool PrepareTransforms(std::vector<AnimationKey>& keys, Element& element,
 }
 }
 
 
 
 
-ElementAnimation::ElementAnimation(PropertyId property_id, const Property& current_value, double start_world_time, float duration, int num_iterations, bool alternate_direction, bool is_transition)
-	: property_id(property_id), duration(duration), num_iterations(num_iterations), alternate_direction(alternate_direction),
+ElementAnimation::ElementAnimation(const String& property_name, const Property& current_value, double start_world_time, float duration, int num_iterations, bool alternate_direction, bool is_transition)
+	: property_name(property_name), duration(duration), num_iterations(num_iterations), alternate_direction(alternate_direction),
 	last_update_world_time(start_world_time), time_since_iteration_start(0.0f), current_iteration(0), reverse_direction(false), animation_complete(false), is_transition(is_transition)
 	last_update_world_time(start_world_time), time_since_iteration_start(0.0f), current_iteration(0), reverse_direction(false), animation_complete(false), is_transition(is_transition)
 {
 {
 	if (!current_value.definition)
 	if (!current_value.definition)

+ 3 - 3
Source/Core/ElementAnimation.h

@@ -47,7 +47,7 @@ struct AnimationKey {
 class ElementAnimation
 class ElementAnimation
 {
 {
 private:
 private:
-	PropertyId property_id;
+	String property_name;
 
 
 	float duration;           // for a single iteration
 	float duration;           // for a single iteration
 	int num_iterations;       // -1 for infinity
 	int num_iterations;       // -1 for infinity
@@ -68,13 +68,13 @@ private:
 	float GetInterpolationFactorAndKeys(int* out_key0, int* out_key1) const;
 	float GetInterpolationFactorAndKeys(int* out_key0, int* out_key1) const;
 public:
 public:
 	ElementAnimation() {}
 	ElementAnimation() {}
-	ElementAnimation(PropertyId property_id, const Property& current_value, double start_world_time, float duration, int num_iterations, bool alternate_direction, bool is_transition);
+	ElementAnimation(const String& property_name, const Property& current_value, double start_world_time, float duration, int num_iterations, bool alternate_direction, bool is_transition);
 
 
 	bool AddKey(float target_time, const Property & property, Element & element, Tween tween, bool extend_duration);
 	bool AddKey(float target_time, const Property & property, Element & element, Tween tween, bool extend_duration);
 
 
 	Property UpdateAndGetProperty(double time, Element& element);
 	Property UpdateAndGetProperty(double time, Element& element);
 
 
-	PropertyId GetPropertyId() const { return property_id; }
+	const String& GetPropertyName() const { return property_name; }
 	float GetDuration() const { return duration; }
 	float GetDuration() const { return duration; }
 	bool IsComplete() const { return animation_complete; }
 	bool IsComplete() const { return animation_complete; }
 	bool IsTransition() const { return is_transition; }
 	bool IsTransition() const { return is_transition; }

+ 2 - 2
Source/Core/ElementBackground.cpp

@@ -67,8 +67,8 @@ void ElementBackground::DirtyBackground()
 void ElementBackground::GenerateBackground()
 void ElementBackground::GenerateBackground()
 {
 {
 	// Fetch the new colour for the background. If the colour is transparent, then we don't render any background.
 	// Fetch the new colour for the background. If the colour is transparent, then we don't render any background.
-	Colourb colour = element->GetProperty(PropertyId::BackgroundColor)->value.Get< Colourb >();
-	float opacity = element->GetProperty<float>(PropertyId::Opacity);
+	Colourb colour = element->GetProperty(BACKGROUND_COLOR)->value.Get< Colourb >();
+	float opacity = element->GetProperty<float>(OPACITY);
 
 
 	// Apply opacity
 	// Apply opacity
 	colour.alpha = (byte)(opacity * (float)colour.alpha);
 	colour.alpha = (byte)(opacity * (float)colour.alpha);

+ 5 - 5
Source/Core/ElementBorder.cpp

@@ -90,13 +90,13 @@ void ElementBorder::GenerateBorder()
 		int* raw_indices = &indices[0];
 		int* raw_indices = &indices[0];
 
 
 		Colourb border_colours[4];
 		Colourb border_colours[4];
-		border_colours[0] = element->GetProperty(PropertyId::BorderTopColor)->value.Get< Colourb >();
-		border_colours[1] = element->GetProperty(PropertyId::BorderRightColor)->value.Get< Colourb >();
-		border_colours[2] = element->GetProperty(PropertyId::BorderBottomColor)->value.Get< Colourb >();
-		border_colours[3] = element->GetProperty(PropertyId::BorderLeftColor)->value.Get< Colourb >();
+		border_colours[0] = element->GetProperty(BORDER_TOP_COLOR)->value.Get< Colourb >();
+		border_colours[1] = element->GetProperty(BORDER_RIGHT_COLOR)->value.Get< Colourb >();
+		border_colours[2] = element->GetProperty(BORDER_BOTTOM_COLOR)->value.Get< Colourb >();
+		border_colours[3] = element->GetProperty(BORDER_LEFT_COLOR)->value.Get< Colourb >();
 
 
 		// Apply opacity to the border
 		// Apply opacity to the border
-		float opacity = element->GetProperty<float>(PropertyId::Opacity);
+		float opacity = element->GetProperty<float>(OPACITY);
 		for(int i = 0; i < 4; ++i) {
 		for(int i = 0; i < 4; ++i) {
 			border_colours[i].alpha = (byte)(opacity * (float)border_colours[i].alpha);
 			border_colours[i].alpha = (byte)(opacity * (float)border_colours[i].alpha);
 		}
 		}

+ 33 - 46
Source/Core/ElementDefinition.cpp

@@ -71,10 +71,8 @@ void ElementDefinition::Initialise(const std::vector< const StyleSheetNode* >& s
 
 
 	// Merge the default (non-pseudo-class) properties.
 	// Merge the default (non-pseudo-class) properties.
 	for (size_t i = 0; i < style_sheet_nodes.size(); ++i)
 	for (size_t i = 0; i < style_sheet_nodes.size(); ++i)
-	{
-		const auto& merge_properties = style_sheet_nodes[i]->GetProperties();
-		properties.insert(merge_properties.begin(), merge_properties.end());
-	}
+		properties.Merge(style_sheet_nodes[i]->GetProperties());
+
 
 
 	// Merge the pseudo-class properties.
 	// Merge the pseudo-class properties.
 	PseudoClassPropertyMap merged_pseudo_class_properties;
 	PseudoClassPropertyMap merged_pseudo_class_properties;
@@ -90,29 +88,25 @@ void ElementDefinition::Initialise(const std::vector< const StyleSheetNode* >& s
 			if (k == merged_pseudo_class_properties.end())
 			if (k == merged_pseudo_class_properties.end())
 				merged_pseudo_class_properties[(*j).first] = (*j).second;
 				merged_pseudo_class_properties[(*j).first] = (*j).second;
 			else
 			else
-			{
-				const auto& merge_properties = (*j).second;
-				k->second.insert(merge_properties.begin(), merge_properties.end());
-			}
+				(*k).second.Merge((*j).second);
 
 
 			// Search through all entries in this dictionary; we'll insert each one into our optimised list of
 			// Search through all entries in this dictionary; we'll insert each one into our optimised list of
 			// pseudo-class properties.
 			// pseudo-class properties.
-			for (PropertyMap::const_iterator k = (*j).second.begin(); k != (*j).second.end(); ++k)
+			for (PropertyMap::const_iterator k = (*j).second.GetProperties().begin(); k != (*j).second.GetProperties().end(); ++k)
 			{
 			{
-				PropertyId property_id = (*k).first;
+				const String& property_name = (*k).first;
 				const Property& property = (*k).second;
 				const Property& property = (*k).second;
 
 
 				// Skip this property if its specificity is lower than the base property's, as in
 				// Skip this property if its specificity is lower than the base property's, as in
 				// this case it will never be used.
 				// this case it will never be used.
-				const Property* default_property = GetIf(properties, property_id);
+				const Property* default_property = properties.GetProperty(property_name);
 				if (default_property != NULL &&
 				if (default_property != NULL &&
 					default_property->specificity >= property.specificity)
 					default_property->specificity >= property.specificity)
 					continue;
 					continue;
 
 
-				// TODO: Pseudo-class should also probably be a PropertyId, for now we do a conversion to String here
-				PseudoClassPropertyDictionary::iterator l = pseudo_class_properties.find(property_id);
+				PseudoClassPropertyDictionary::iterator l = pseudo_class_properties.find(property_name);
 				if (l == pseudo_class_properties.end())
 				if (l == pseudo_class_properties.end())
-					pseudo_class_properties[property_id] = PseudoClassPropertyList(1, PseudoClassProperty((*j).first, property));
+					pseudo_class_properties[property_name] = PseudoClassPropertyList(1, PseudoClassProperty((*j).first, property));
 				else
 				else
 				{
 				{
 					// Find the location to insert this entry in the map, based on property priorities.
 					// Find the location to insert this entry in the map, based on property priorities.
@@ -132,10 +126,10 @@ void ElementDefinition::Initialise(const std::vector< const StyleSheetNode* >& s
 }
 }
 
 
 // Returns a specific property from the element definition's base properties.
 // Returns a specific property from the element definition's base properties.
-const Property* ElementDefinition::GetProperty(PropertyId property_id, const PseudoClassList& pseudo_classes) const
+const Property* ElementDefinition::GetProperty(const String& name, const PseudoClassList& pseudo_classes) const
 {
 {
 	// Find a pseudo-class override for this property.
 	// Find a pseudo-class override for this property.
-	PseudoClassPropertyDictionary::const_iterator property_iterator = pseudo_class_properties.find(property_id);
+	PseudoClassPropertyDictionary::const_iterator property_iterator = pseudo_class_properties.find(name);
 	if (property_iterator != pseudo_class_properties.end())
 	if (property_iterator != pseudo_class_properties.end())
 	{
 	{
 		const PseudoClassPropertyList& property_list = (*property_iterator).second;
 		const PseudoClassPropertyList& property_list = (*property_iterator).second;
@@ -148,24 +142,19 @@ const Property* ElementDefinition::GetProperty(PropertyId property_id, const Pse
 		}
 		}
 	}
 	}
 
 
-	auto it = properties.find(property_id);
-	if (it != properties.end())
-		return &it->second;
-	return nullptr;
+	return properties.GetProperty(name);
 }
 }
 
 
 // Returns the list of properties this element definition defines for an element with the given set of pseudo-classes.
 // Returns the list of properties this element definition defines for an element with the given set of pseudo-classes.
-void ElementDefinition::GetDefinedProperties(PropertyIdList& property_ids, const PseudoClassList& pseudo_classes) const
+void ElementDefinition::GetDefinedProperties(PropertyNameList& property_names, const PseudoClassList& pseudo_classes) const
 {
 {
-	for (auto& p : properties)
-		property_ids.insert(p.first);
+	for (PropertyMap::const_iterator i = properties.GetProperties().begin(); i != properties.GetProperties().end(); ++i)
+		property_names.insert((*i).first);
 
 
 	for (PseudoClassPropertyDictionary::const_iterator i = pseudo_class_properties.begin(); i != pseudo_class_properties.end(); ++i)
 	for (PseudoClassPropertyDictionary::const_iterator i = pseudo_class_properties.begin(); i != pseudo_class_properties.end(); ++i)
 	{
 	{
-		PropertyId id = i->first;
-
 		// If this property is already in the default dictionary, don't bother checking for it here.
 		// If this property is already in the default dictionary, don't bother checking for it here.
-		if (property_ids.find(id) != property_ids.end())
+		if (property_names.find((*i).first) != property_names.end())
 			continue;
 			continue;
 
 
 		const PseudoClassPropertyList& property_list = (*i).second;
 		const PseudoClassPropertyList& property_list = (*i).second;
@@ -183,20 +172,18 @@ void ElementDefinition::GetDefinedProperties(PropertyIdList& property_ids, const
 		}
 		}
 
 
 		if (property_defined)
 		if (property_defined)
-			property_ids.insert(id);
+			property_names.insert((*i).first);
 	}
 	}
 }
 }
 
 
 // Returns the list of properties this element definition has explicit definitions for involving the given
 // Returns the list of properties this element definition has explicit definitions for involving the given
 // pseudo-class.
 // pseudo-class.
-void ElementDefinition::GetDefinedProperties(PropertyIdList& property_ids, const PseudoClassList& pseudo_classes, const String& pseudo_class) const
+void ElementDefinition::GetDefinedProperties(PropertyNameList& property_names, const PseudoClassList& pseudo_classes, const String& pseudo_class) const
 {
 {
 	for (PseudoClassPropertyDictionary::const_iterator i = pseudo_class_properties.begin(); i != pseudo_class_properties.end(); ++i)
 	for (PseudoClassPropertyDictionary::const_iterator i = pseudo_class_properties.begin(); i != pseudo_class_properties.end(); ++i)
 	{
 	{
-		PropertyId id = i->first;
-
 		// If this property has already been found, don't bother checking for it again.
 		// If this property has already been found, don't bother checking for it again.
-		if (property_ids.find(id) != property_ids.end())
+		if (property_names.find((*i).first) != property_names.end())
 			continue;
 			continue;
 
 
 		const PseudoClassPropertyList& property_list = (*i).second;
 		const PseudoClassPropertyList& property_list = (*i).second;
@@ -232,21 +219,21 @@ void ElementDefinition::GetDefinedProperties(PropertyIdList& property_ids, const
 		}
 		}
 
 
 		if (property_defined)
 		if (property_defined)
-			property_ids.insert(id);
+			property_names.insert((*i).first);
 	}
 	}
 }
 }
 
 
 // Iterates over the properties in the definition.
 // Iterates over the properties in the definition.
-bool ElementDefinition::IterateProperties(int& index, const PseudoClassList& pseudo_classes, PseudoClassList& property_pseudo_classes, PropertyId& property_id, const Property*& property) const
+bool ElementDefinition::IterateProperties(int& index, const PseudoClassList& pseudo_classes, PseudoClassList& property_pseudo_classes, String& property_name, const Property*& property) const
 {
 {
-	if (index < (int)properties.size())
+	if (index < properties.GetNumProperties())
 	{
 	{
-		PropertyMap::const_iterator i = properties.begin();
+		PropertyMap::const_iterator i = properties.GetProperties().begin();
 		for (int count = 0; count < index; ++count)
 		for (int count = 0; count < index; ++count)
 			++i;
 			++i;
 
 
 		property_pseudo_classes.clear();
 		property_pseudo_classes.clear();
-		property_id = (*i).first;
+		property_name = (*i).first;
 		property = &((*i).second);
 		property = &((*i).second);
 		++index;
 		++index;
 
 
@@ -254,7 +241,7 @@ bool ElementDefinition::IterateProperties(int& index, const PseudoClassList& pse
 	}
 	}
 
 
 	// Not in the base properties; check for pseudo-class overrides.
 	// Not in the base properties; check for pseudo-class overrides.
-	int property_count = (int)properties.size();
+	int property_count = properties.GetNumProperties();
 	for (PseudoClassPropertyDictionary::const_iterator i = pseudo_class_properties.begin(); i != pseudo_class_properties.end(); ++i)
 	for (PseudoClassPropertyDictionary::const_iterator i = pseudo_class_properties.begin(); i != pseudo_class_properties.end(); ++i)
 	{
 	{
 		// Iterate over each pseudo-class set that has a definition for this property; if we find one that matches our
 		// Iterate over each pseudo-class set that has a definition for this property; if we find one that matches our
@@ -270,7 +257,7 @@ bool ElementDefinition::IterateProperties(int& index, const PseudoClassList& pse
 					// Copy the list of pseudo-classes.
 					// Copy the list of pseudo-classes.
 					property_pseudo_classes = (*i).second[j].first;
 					property_pseudo_classes = (*i).second[j].first;
 
 
-					property_id = (*i).first;
+					property_name = (*i).first;
 					property = &((*i).second[j].second);
 					property = &((*i).second[j].second);
 					++index;
 					++index;
 
 
@@ -355,9 +342,9 @@ void ElementDefinition::BuildPropertyGroup(PropertyGroupMap& groups, const Strin
 {
 {
 	String property_suffix = "-" + group_type;
 	String property_suffix = "-" + group_type;
 
 
-	for (PropertyMap::const_iterator property_iterator = element_properties.begin(); property_iterator != element_properties.end(); ++property_iterator)
+	for (PropertyMap::const_iterator property_iterator = element_properties.GetProperties().begin(); property_iterator != element_properties.GetProperties().end(); ++property_iterator)
 	{
 	{
-		const String& property_name = GetName((*property_iterator).first);
+		const String& property_name = (*property_iterator).first;
 		if (property_name.size() > property_suffix.size() &&
 		if (property_name.size() > property_suffix.size() &&
 			strcasecmp(property_name.c_str() + (property_name.size() - property_suffix.size()), property_suffix.c_str()) == 0)
 			strcasecmp(property_name.c_str() + (property_name.size() - property_suffix.size()), property_suffix.c_str()) == 0)
 		{
 		{
@@ -418,14 +405,15 @@ void ElementDefinition::BuildPropertyGroup(PropertyGroupMap& groups, const Strin
 }
 }
 
 
 // Updates a property dictionary of all properties for a single group.
 // Updates a property dictionary of all properties for a single group.
-int ElementDefinition::BuildPropertyGroupDictionary(PropertyDictionary& group_properties, const String& group_type, const String& group_name, const PropertyDictionary& element_properties)
+int ElementDefinition::BuildPropertyGroupDictionary(PropertyDictionary& group_properties, const String& ROCKET_UNUSED_PARAMETER(group_type), const String& group_name, const PropertyDictionary& element_properties)
 {
 {
+	ROCKET_UNUSED(group_type);
+
 	int num_properties = 0;
 	int num_properties = 0;
 
 
-	for (PropertyMap::const_iterator property_iterator = element_properties.begin(); property_iterator != element_properties.end(); ++property_iterator)
+	for (PropertyMap::const_iterator property_iterator = element_properties.GetProperties().begin(); property_iterator != element_properties.GetProperties().end(); ++property_iterator)
 	{
 	{
-		PropertyId id = (*property_iterator).first;
-		const String& full_property_name = GetName(id);
+		const String& full_property_name = (*property_iterator).first;
 		if (full_property_name.size() > group_name.size() + 1 &&
 		if (full_property_name.size() > group_name.size() + 1 &&
 			strncasecmp(full_property_name.c_str(), group_name.c_str(), group_name.size()) == 0 &&
 			strncasecmp(full_property_name.c_str(), group_name.c_str(), group_name.size()) == 0 &&
 			full_property_name[group_name.size()] == '-')
 			full_property_name[group_name.size()] == '-')
@@ -434,8 +422,7 @@ int ElementDefinition::BuildPropertyGroupDictionary(PropertyDictionary& group_pr
 //			if (property_name == group_type)
 //			if (property_name == group_type)
 //				continue;
 //				continue;
 
 
-			PropertyId new_id = CreateOrGetPropertyId(group_type + "-" + property_name);
-			group_properties[new_id] = (*property_iterator).second;
+			group_properties.SetProperty(property_name, (*property_iterator).second);
 			num_properties++;
 			num_properties++;
 		}
 		}
 	}
 	}

+ 5 - 6
Source/Core/ElementDefinition.h

@@ -45,10 +45,9 @@ class FontEffect;
 // PseudoClassPropertyMap defined in StyleSheetNode.h ... bit clumsy). Here the properties are stored as a list
 // PseudoClassPropertyMap defined in StyleSheetNode.h ... bit clumsy). Here the properties are stored as a list
 // of definitions against each property name in specificity-order, along with the pseudo-class requirements for each
 // of definitions against each property name in specificity-order, along with the pseudo-class requirements for each
 // one. This makes it much more straight-forward to query at run-time.
 // one. This makes it much more straight-forward to query at run-time.
-//TODO Replace with property IDs
 typedef std::pair< StringList, Property > PseudoClassProperty;
 typedef std::pair< StringList, Property > PseudoClassProperty;
 typedef std::vector< PseudoClassProperty > PseudoClassPropertyList;
 typedef std::vector< PseudoClassProperty > PseudoClassPropertyList;
-typedef UnorderedMap< PropertyId, PseudoClassPropertyList > PseudoClassPropertyDictionary;
+typedef UnorderedMap< String, PseudoClassPropertyList > PseudoClassPropertyDictionary;
 
 
 typedef UnorderedMap< String, Decorator* > DecoratorMap;
 typedef UnorderedMap< String, Decorator* > DecoratorMap;
 typedef std::map< StringList, DecoratorMap > PseudoClassDecoratorMap;
 typedef std::map< StringList, DecoratorMap > PseudoClassDecoratorMap;
@@ -77,19 +76,19 @@ public:
 	/// @param[in] name The name of the property to return.
 	/// @param[in] name The name of the property to return.
 	/// @param[in] pseudo_classes The pseudo-classes currently active on the calling element.
 	/// @param[in] pseudo_classes The pseudo-classes currently active on the calling element.
 	/// @return The property defined against the give name, or NULL if no such property was found.
 	/// @return The property defined against the give name, or NULL if no such property was found.
-	const Property* GetProperty(PropertyId id, const PseudoClassList& pseudo_classes) const;
+	const Property* GetProperty(const String& name, const PseudoClassList& pseudo_classes) const;
 
 
 	/// Returns the list of properties this element definition defines for an element with the given set of
 	/// Returns the list of properties this element definition defines for an element with the given set of
 	/// pseudo-classes.
 	/// pseudo-classes.
 	/// @param[out] property_names The list to store the defined properties in.
 	/// @param[out] property_names The list to store the defined properties in.
 	/// @param[in] pseudo_classes The pseudo-classes defined on the querying element.
 	/// @param[in] pseudo_classes The pseudo-classes defined on the querying element.
-	void GetDefinedProperties(PropertyIdList& property_ids, const PseudoClassList& pseudo_classes) const;
+	void GetDefinedProperties(PropertyNameList& property_names, const PseudoClassList& pseudo_classes) const;
 	/// Returns the list of properties this element definition has explicit definitions for involving the given
 	/// Returns the list of properties this element definition has explicit definitions for involving the given
 	/// pseudo-class.
 	/// pseudo-class.
 	/// @param[out] property_names The list of store the newly defined / undefined properties in.
 	/// @param[out] property_names The list of store the newly defined / undefined properties in.
 	/// @param[in] pseudo_classes The list of pseudo-classes currently set on the element (post-change).
 	/// @param[in] pseudo_classes The list of pseudo-classes currently set on the element (post-change).
 	/// @param[in] pseudo_class The pseudo-class that was just activated or deactivated.
 	/// @param[in] pseudo_class The pseudo-class that was just activated or deactivated.
-	void GetDefinedProperties(PropertyIdList& property_ids, const PseudoClassList& pseudo_classes, const String& pseudo_class) const;
+	void GetDefinedProperties(PropertyNameList& property_names, const PseudoClassList& pseudo_classes, const String& pseudo_class) const;
 
 
 	/// Iterates over the properties in the definition.
 	/// Iterates over the properties in the definition.
 	/// @param[inout] index Index of the property to fetch. This is incremented to the next valid index after the fetch.
 	/// @param[inout] index Index of the property to fetch. This is incremented to the next valid index after the fetch.
@@ -98,7 +97,7 @@ public:
 	/// @param[out] property_name The name of the property at the specified index.
 	/// @param[out] property_name The name of the property at the specified index.
 	/// @param[out] property The property at the specified index.
 	/// @param[out] property The property at the specified index.
 	/// @return True if a property was successfully fetched.
 	/// @return True if a property was successfully fetched.
-	bool IterateProperties(int& index, const PseudoClassList& pseudo_classes, PseudoClassList& property_pseudo_classes, PropertyId& property_id, const Property*& property) const;
+	bool IterateProperties(int& index, const PseudoClassList& pseudo_classes, PseudoClassList& property_pseudo_classes, String& property_name, const Property*& property) const;
 
 
 	/// Returns the list of the element definition's instanced decorators in the default state.
 	/// Returns the list of the element definition's instanced decorators in the default state.
 	/// @return The list of instanced decorators.
 	/// @return The list of instanced decorators.

+ 24 - 24
Source/Core/ElementDocument.cpp

@@ -53,7 +53,7 @@ ElementDocument::ElementDocument(const String& tag) : Element(tag)
 
 
 	ForceLocalStackingContext();
 	ForceLocalStackingContext();
 
 
-	SetProperty(PropertyId::Position, "absolute");
+	SetProperty(POSITION, "absolute");
 }
 }
 
 
 ElementDocument::~ElementDocument()
 ElementDocument::~ElementDocument()
@@ -148,7 +148,7 @@ void ElementDocument::ProcessHeader(const DocumentHeader* document_header)
 	}
 	}
 
 
 	// Hide this document.
 	// Hide this document.
-	SetProperty(PropertyId::Visibility, "hidden");
+	SetProperty(VISIBILITY, "hidden");
 }
 }
 
 
 ElementDocument* ElementDocument::GetOwnerDocument()
 ElementDocument* ElementDocument::GetOwnerDocument()
@@ -223,7 +223,7 @@ void ElementDocument::Show(int focus_flags)
 	modal = (focus_flags & MODAL) > 0;
 	modal = (focus_flags & MODAL) > 0;
 
 
 	// Set to visible and switch focus if necessary
 	// Set to visible and switch focus if necessary
-	SetProperty(PropertyId::Visibility, "visible");
+	SetProperty(VISIBILITY, "visible");
 	if (focus_flags & FOCUS || focus_flags & MODAL)
 	if (focus_flags & FOCUS || focus_flags & MODAL)
 	{
 	{
 		// If no element could be focused, focus the window
 		// If no element could be focused, focus the window
@@ -233,13 +233,13 @@ void ElementDocument::Show(int focus_flags)
 		}
 		}
 	}
 	}
 
 
-	DispatchEvent(EventId::Show, Dictionary(), false);
+	DispatchEvent("show", Dictionary(), false);
 }
 }
 
 
 void ElementDocument::Hide()
 void ElementDocument::Hide()
 {
 {
-	SetProperty(PropertyId::Visibility, "hidden");
-	DispatchEvent(EventId::Hide, Dictionary(), false);
+	SetProperty(VISIBILITY, "hidden");
+	DispatchEvent("hide", Dictionary(), false);
 	
 	
 	if (context)
 	if (context)
 	{
 	{
@@ -338,21 +338,21 @@ void ElementDocument::UpdatePosition()
 	// Work out our containing block; relative offsets are calculated against it.
 	// Work out our containing block; relative offsets are calculated against it.
 	Vector2f containing_block = GetParentNode()->GetBox().GetSize(Box::CONTENT);
 	Vector2f containing_block = GetParentNode()->GetBox().GetSize(Box::CONTENT);
 
 
-	const Property *left = GetLocalProperty(PropertyId::Left);
-	const Property *right = GetLocalProperty(PropertyId::Right);
+	const Property *left = GetLocalProperty(LEFT);
+	const Property *right = GetLocalProperty(RIGHT);
 	if (left != NULL && left->unit != Property::KEYWORD)
 	if (left != NULL && left->unit != Property::KEYWORD)
-		position.x = ResolveProperty(PropertyId::Left, containing_block.x);
+		position.x = ResolveProperty(LEFT, containing_block.x);
 	else if (right != NULL && right->unit != Property::KEYWORD)
 	else if (right != NULL && right->unit != Property::KEYWORD)
-		position.x = (containing_block.x - GetBox().GetSize(Box::MARGIN).x) - ResolveProperty(PropertyId::Right, containing_block.x);
+		position.x = (containing_block.x - GetBox().GetSize(Box::MARGIN).x) - ResolveProperty(RIGHT, containing_block.x);
 	else
 	else
 		position.x = GetBox().GetEdge(Box::MARGIN, Box::LEFT);
 		position.x = GetBox().GetEdge(Box::MARGIN, Box::LEFT);
 
 
-	const Property *top = GetLocalProperty(PropertyId::Top);
-	const Property *bottom = GetLocalProperty(PropertyId::Bottom);
+	const Property *top = GetLocalProperty(TOP);
+	const Property *bottom = GetLocalProperty(BOTTOM);
 	if (top != NULL && top->unit != Property::KEYWORD)
 	if (top != NULL && top->unit != Property::KEYWORD)
-		position.y = ResolveProperty(PropertyId::Top, containing_block.y);
+		position.y = ResolveProperty(TOP, containing_block.y);
 	else if (bottom != NULL && bottom->unit != Property::KEYWORD)
 	else if (bottom != NULL && bottom->unit != Property::KEYWORD)
-		position.y = (containing_block.y - GetBox().GetSize(Box::MARGIN).y) - ResolveProperty(PropertyId::Bottom, containing_block.y);
+		position.y = (containing_block.y - GetBox().GetSize(Box::MARGIN).y) - ResolveProperty(BOTTOM, containing_block.y);
 	else
 	else
 		position.y = GetBox().GetEdge(Box::MARGIN, Box::TOP);
 		position.y = GetBox().GetEdge(Box::MARGIN, Box::TOP);
 
 
@@ -385,18 +385,18 @@ void ElementDocument::DirtyDpProperties()
 }
 }
 
 
 // Repositions the document if necessary.
 // Repositions the document if necessary.
-void ElementDocument::OnPropertyChange(const PropertyIdList& changed_properties)
+void ElementDocument::OnPropertyChange(const PropertyNameList& changed_properties)
 {
 {
 	Element::OnPropertyChange(changed_properties);
 	Element::OnPropertyChange(changed_properties);
 
 
 	// If the document's font-size has been changed, we need to dirty all rem properties.
 	// If the document's font-size has been changed, we need to dirty all rem properties.
-	if (changed_properties.find(PropertyId::FontSize) != changed_properties.end())
+	if (changed_properties.find(FONT_SIZE) != changed_properties.end())
 		GetStyle()->DirtyRemProperties();
 		GetStyle()->DirtyRemProperties();
 
 
-	if (changed_properties.find(PropertyId::Top) != changed_properties.end() ||
-		changed_properties.find(PropertyId::Right) != changed_properties.end() ||
-		changed_properties.find(PropertyId::Bottom) != changed_properties.end() ||
-		changed_properties.find(PropertyId::Left) != changed_properties.end())
+	if (changed_properties.find(TOP) != changed_properties.end() ||
+		changed_properties.find(RIGHT) != changed_properties.end() ||
+		changed_properties.find(BOTTOM) != changed_properties.end() ||
+		changed_properties.find(LEFT) != changed_properties.end())
 		UpdatePosition();
 		UpdatePosition();
 }
 }
 
 
@@ -406,7 +406,7 @@ void ElementDocument::ProcessEvent(Event& event)
 	Element::ProcessEvent(event);
 	Element::ProcessEvent(event);
 
 
 	// Process generic keyboard events for this window in capture phase
 	// Process generic keyboard events for this window in capture phase
-	if (event.GetPhase() == Event::PHASE_BUBBLE && event == EventId::Keydown)
+	if (event.GetPhase() == Event::PHASE_BUBBLE && event == KEYDOWN)
 	{
 	{
 		int key_identifier = event.GetParameter<int>("key_identifier", Input::KI_UNKNOWN);
 		int key_identifier = event.GetParameter<int>("key_identifier", Input::KI_UNKNOWN);
 
 
@@ -421,7 +421,7 @@ void ElementDocument::ProcessEvent(Event& event)
 		{
 		{
 			Element* focus_node = GetFocusLeafNode();
 			Element* focus_node = GetFocusLeafNode();
 
 
-			if (focus_node && focus_node->GetProperty<int>(PropertyId::TabIndex) == TAB_INDEX_AUTO)
+			if (focus_node && focus_node->GetProperty<int>(TAB_INDEX) == TAB_INDEX_AUTO)
 			{
 			{
 				focus_node->Click();
 				focus_node->Click();
 			}
 			}
@@ -429,7 +429,7 @@ void ElementDocument::ProcessEvent(Event& event)
 	}
 	}
 	else if (event.GetTargetElement() == this)
 	else if (event.GetTargetElement() == this)
 	{
 	{
-		if (event == EventId::Resize)
+		if (event == RESIZE)
 			UpdatePosition();
 			UpdatePosition();
 	}
 	}
 }
 }
@@ -506,7 +506,7 @@ bool ElementDocument::SearchFocusSubtree(Element* element, bool forward)
 	}
 	}
 
 
 	// Check if this is the node we're looking for
 	// Check if this is the node we're looking for
-	if (element->GetProperty<int>(PropertyId::TabIndex) == TAB_INDEX_AUTO)
+	if (element->GetProperty<int>(TAB_INDEX) == TAB_INDEX_AUTO)
 	{
 	{
 		element->Focus();
 		element->Focus();
 		element->ScrollIntoView(false);
 		element->ScrollIntoView(false);

+ 12 - 12
Source/Core/ElementHandle.cpp

@@ -38,7 +38,7 @@ namespace Core {
 ElementHandle::ElementHandle(const String& tag) : Element(tag), drag_start(0, 0)
 ElementHandle::ElementHandle(const String& tag) : Element(tag), drag_start(0, 0)
 {
 {
 	// Make sure we can be dragged!
 	// Make sure we can be dragged!
-	SetProperty(PropertyId::Drag, "drag");
+	SetProperty(DRAG, DRAG);
 
 
 	move_target = NULL;
 	move_target = NULL;
 	size_target = NULL;
 	size_target = NULL;
@@ -83,7 +83,7 @@ void ElementHandle::ProcessEvent(Event& event)
 			initialised = true;
 			initialised = true;
 		}
 		}
 
 
-		if (event == EventId::Dragstart)
+		if (event == DRAGSTART)
 		{
 		{
 			// Store the drag starting position
 			// Store the drag starting position
 			drag_start.x = event.GetParameter< int >("mouse_x", 0);
 			drag_start.x = event.GetParameter< int >("mouse_x", 0);
@@ -98,7 +98,7 @@ void ElementHandle::ProcessEvent(Event& event)
 			if (size_target)
 			if (size_target)
 				size_original_size = size_target->GetBox().GetSize(Box::CONTENT);
 				size_original_size = size_target->GetBox().GetSize(Box::CONTENT);
 		}
 		}
-		else if (event == EventId::Drag)
+		else if (event == DRAG)
 		{
 		{
 			// Work out the delta
 			// Work out the delta
 			int x = event.GetParameter< int >("mouse_x", 0) - drag_start.x;
 			int x = event.GetParameter< int >("mouse_x", 0) - drag_start.x;
@@ -107,8 +107,8 @@ void ElementHandle::ProcessEvent(Event& event)
 			// Update the move and size objects
 			// Update the move and size objects
 			if (move_target)
 			if (move_target)
 			{
 			{
-				move_target->SetProperty(PropertyId::Left, Property(Math::RealToInteger(move_original_position.x + x), Property::PX));
-				move_target->SetProperty(PropertyId::Top, Property(Math::RealToInteger(move_original_position.y + y), Property::PX));
+				move_target->SetProperty(LEFT, Property(Math::RealToInteger(move_original_position.x + x), Property::PX));
+				move_target->SetProperty(TOP, Property(Math::RealToInteger(move_original_position.y + y), Property::PX));
 			}
 			}
 
 
 			if (size_target)
 			if (size_target)
@@ -118,25 +118,25 @@ void ElementHandle::ProcessEvent(Event& event)
 
 
 				// Check if we have auto-margins; if so, they have to be set to the current margins.
 				// Check if we have auto-margins; if so, they have to be set to the current margins.
 				if (margin_top->unit == Property::KEYWORD)
 				if (margin_top->unit == Property::KEYWORD)
-					size_target->SetProperty(PropertyId::MarginTop, Property((float) Math::RealToInteger(size_target->GetBox().GetEdge(Box::MARGIN, Box::TOP)), Property::PX));
+					size_target->SetProperty(MARGIN_TOP, Property((float) Math::RealToInteger(size_target->GetBox().GetEdge(Box::MARGIN, Box::TOP)), Property::PX));
 				if (margin_right->unit == Property::KEYWORD)
 				if (margin_right->unit == Property::KEYWORD)
-					size_target->SetProperty(PropertyId::MarginRight, Property((float) Math::RealToInteger(size_target->GetBox().GetEdge(Box::MARGIN, Box::RIGHT)), Property::PX));
+					size_target->SetProperty(MARGIN_RIGHT, Property((float) Math::RealToInteger(size_target->GetBox().GetEdge(Box::MARGIN, Box::RIGHT)), Property::PX));
 				if (margin_bottom->unit == Property::KEYWORD)
 				if (margin_bottom->unit == Property::KEYWORD)
-					size_target->SetProperty(PropertyId::MarginBottom, Property((float) Math::RealToInteger(size_target->GetBox().GetEdge(Box::MARGIN, Box::BOTTOM)), Property::PX));
+					size_target->SetProperty(MARGIN_BOTTOM, Property((float) Math::RealToInteger(size_target->GetBox().GetEdge(Box::MARGIN, Box::BOTTOM)), Property::PX));
 				if (margin_left->unit == Property::KEYWORD)
 				if (margin_left->unit == Property::KEYWORD)
-					size_target->SetProperty(PropertyId::MarginLeft, Property((float) Math::RealToInteger(size_target->GetBox().GetEdge(Box::MARGIN, Box::LEFT)), Property::PX));
+					size_target->SetProperty(MARGIN_LEFT, Property((float) Math::RealToInteger(size_target->GetBox().GetEdge(Box::MARGIN, Box::LEFT)), Property::PX));
 
 
 				int new_x = Math::RealToInteger(size_original_size.x + x);
 				int new_x = Math::RealToInteger(size_original_size.x + x);
 				int new_y = Math::RealToInteger(size_original_size.y + y);
 				int new_y = Math::RealToInteger(size_original_size.y + y);
 
 
-				size_target->SetProperty(PropertyId::Width, Property(Math::Max< float >((float) new_x, 0), Property::PX));
-				size_target->SetProperty(PropertyId::Height, Property(Math::Max< float >((float) new_y, 0), Property::PX));
+				size_target->SetProperty(WIDTH, Property(Math::Max< float >((float) new_x, 0), Property::PX));
+				size_target->SetProperty(HEIGHT, Property(Math::Max< float >((float) new_y, 0), Property::PX));
 			}
 			}
 
 
 			Dictionary parameters;
 			Dictionary parameters;
 			parameters["handle_x"] = x;
 			parameters["handle_x"] = x;
 			parameters["handle_y"] = y;
 			parameters["handle_y"] = y;
-			DispatchEvent(EventId::Handledrag, parameters);
+			DispatchEvent("handledrag", parameters);
 		}
 		}
 	}
 	}
 }
 }

+ 6 - 6
Source/Core/ElementImage.cpp

@@ -156,12 +156,12 @@ void ElementImage::OnAttributeChange(const Rocket::Core::AttributeNameList& chan
 		DirtyLayout();
 		DirtyLayout();
 }
 }
 
 
-void ElementImage::OnPropertyChange(const PropertyIdList& changed_properties)
+void ElementImage::OnPropertyChange(const PropertyNameList& changed_properties)
 {
 {
     Element::OnPropertyChange(changed_properties);
     Element::OnPropertyChange(changed_properties);
 
 
-    if (changed_properties.find(PropertyId::ImageColor) != changed_properties.end() ||
-        changed_properties.find(PropertyId::Opacity) != changed_properties.end()) {
+    if (changed_properties.find(IMAGE_COLOR) != changed_properties.end() ||
+        changed_properties.find(OPACITY) != changed_properties.end()) {
         GenerateGeometry();
         GenerateGeometry();
     }
     }
 }
 }
@@ -172,7 +172,7 @@ void ElementImage::ProcessEvent(Rocket::Core::Event& event)
 	Element::ProcessEvent(event);
 	Element::ProcessEvent(event);
 
 
 	if (event.GetTargetElement() == this &&
 	if (event.GetTargetElement() == this &&
-		event == EventId::Resize)
+		event == RESIZE)
 	{
 	{
 		GenerateGeometry();
 		GenerateGeometry();
 	}
 	}
@@ -211,8 +211,8 @@ void ElementImage::GenerateGeometry()
 		texcoords[1] = Vector2f(1, 1);
 		texcoords[1] = Vector2f(1, 1);
 	}
 	}
 
 
-    float opacity = GetProperty<float>(PropertyId::Opacity);
-	Colourb quad_colour = GetProperty<Colourb>(PropertyId::ImageColor);
+    float opacity = GetProperty<float>(OPACITY);
+	Colourb quad_colour = GetProperty<Colourb>(IMAGE_COLOR);
     quad_colour.alpha = (byte)(opacity * (float)quad_colour.alpha);
     quad_colour.alpha = (byte)(opacity * (float)quad_colour.alpha);
 	
 	
 	Vector2f quad_size = GetBox().GetSize(Rocket::Core::Box::CONTENT).Round();
 	Vector2f quad_size = GetBox().GetSize(Rocket::Core::Box::CONTENT).Round();

+ 1 - 1
Source/Core/ElementImage.h

@@ -86,7 +86,7 @@ protected:
 
 
 	/// Called when properties on the element are changed.
 	/// Called when properties on the element are changed.
 	/// @param[in] changed_properties The properties changed on the element.
 	/// @param[in] changed_properties The properties changed on the element.
-	virtual void OnPropertyChange(const PropertyIdList& changed_properties);
+	virtual void OnPropertyChange(const PropertyNameList& changed_properties);
 
 
 	/// Regenerates the element's geometry on a resize event.
 	/// Regenerates the element's geometry on a resize event.
 	/// @param[in] event The event to process.
 	/// @param[in] event The event to process.

+ 9 - 9
Source/Core/ElementScroll.cpp

@@ -54,7 +54,7 @@ void ElementScroll::ClearScrollbars()
 	{
 	{
 		if (scrollbars[i].element != NULL)
 		if (scrollbars[i].element != NULL)
 		{
 		{
-			scrollbars[i].element->RemoveEventListener(EventId::Scrollchange, this);
+			scrollbars[i].element->RemoveEventListener("scrollchange", this);
 			scrollbars[i] = Scrollbar();
 			scrollbars[i] = Scrollbar();
 		}
 		}
 	}
 	}
@@ -82,7 +82,7 @@ void ElementScroll::EnableScrollbar(Orientation orientation, float element_width
 	if (!scrollbars[orientation].enabled)
 	if (!scrollbars[orientation].enabled)
 	{
 	{
 		CreateScrollbar(orientation);
 		CreateScrollbar(orientation);
-		scrollbars[orientation].element->SetProperty(PropertyId::Visibility, "visible");
+		scrollbars[orientation].element->SetProperty(VISIBILITY, "visible");
 		scrollbars[orientation].enabled = true;
 		scrollbars[orientation].enabled = true;
 	}
 	}
 
 
@@ -97,7 +97,7 @@ void ElementScroll::EnableScrollbar(Orientation orientation, float element_width
 		if (box.GetSize().y < 0)
 		if (box.GetSize().y < 0)
 			scrollbars[orientation].size = box.GetCumulativeEdge(Box::CONTENT, Box::LEFT) +
 			scrollbars[orientation].size = box.GetCumulativeEdge(Box::CONTENT, Box::LEFT) +
 										   box.GetCumulativeEdge(Box::CONTENT, Box::RIGHT) +
 										   box.GetCumulativeEdge(Box::CONTENT, Box::RIGHT) +
-										   scrollbars[orientation].element->ResolveProperty(PropertyId::Height, element_width);
+										   scrollbars[orientation].element->ResolveProperty(HEIGHT, element_width);
 		else
 		else
 			scrollbars[orientation].size = box.GetSize(Box::MARGIN).y;
 			scrollbars[orientation].size = box.GetSize(Box::MARGIN).y;
 	}
 	}
@@ -108,7 +108,7 @@ void ElementScroll::DisableScrollbar(Orientation orientation)
 {
 {
 	if (scrollbars[orientation].enabled)
 	if (scrollbars[orientation].enabled)
 	{
 	{
-		scrollbars[orientation].element->SetProperty(PropertyId::Visibility, "hidden");
+		scrollbars[orientation].element->SetProperty(VISIBILITY, "hidden");
 		scrollbars[orientation].enabled = false;
 		scrollbars[orientation].enabled = false;
 	}
 	}
 }
 }
@@ -192,7 +192,7 @@ void ElementScroll::FormatScrollbars()
 		}
 		}
 
 
 		float slider_length = containing_block[1 - i];
 		float slider_length = containing_block[1 - i];
-		float user_scrollbar_margin = scrollbars[i].element->ResolveProperty(PropertyId::ScrollbarMargin, slider_length);
+		float user_scrollbar_margin = scrollbars[i].element->ResolveProperty(SCROLLBAR_MARGIN, slider_length);
 		float min_scrollbar_margin = GetScrollbarSize(i == VERTICAL ? HORIZONTAL : VERTICAL);
 		float min_scrollbar_margin = GetScrollbarSize(i == VERTICAL ? HORIZONTAL : VERTICAL);
 		slider_length -= Math::Max(user_scrollbar_margin, min_scrollbar_margin);
 		slider_length -= Math::Max(user_scrollbar_margin, min_scrollbar_margin);
 
 
@@ -218,12 +218,12 @@ void ElementScroll::FormatScrollbars()
 		corner->SetBox(corner_box);
 		corner->SetBox(corner_box);
 		corner->SetOffset(containing_block - Vector2f(scrollbars[VERTICAL].size, scrollbars[HORIZONTAL].size), element, true);
 		corner->SetOffset(containing_block - Vector2f(scrollbars[VERTICAL].size, scrollbars[HORIZONTAL].size), element, true);
 
 
-		corner->SetProperty(PropertyId::Visibility, "visible");
+		corner->SetProperty(VISIBILITY, "visible");
 	}
 	}
 	else
 	else
 	{
 	{
 		if (corner != NULL)
 		if (corner != NULL)
-			corner->SetProperty(PropertyId::Visibility, "hidden");
+			corner->SetProperty(VISIBILITY, "hidden");
 	}
 	}
 }
 }
 
 
@@ -249,8 +249,8 @@ bool ElementScroll::CreateScrollbar(Orientation orientation)
 		return true;
 		return true;
 
 
 	scrollbars[orientation].element = Factory::InstanceElement(element, "*", orientation == VERTICAL ? "scrollbarvertical" : "scrollbarhorizontal", XMLAttributes());
 	scrollbars[orientation].element = Factory::InstanceElement(element, "*", orientation == VERTICAL ? "scrollbarvertical" : "scrollbarhorizontal", XMLAttributes());
-	scrollbars[orientation].element->AddEventListener(EventId::Scrollchange, this);
-	scrollbars[orientation].element->SetProperty(PropertyId::Clip, "1");
+	scrollbars[orientation].element->AddEventListener("scrollchange", this);
+	scrollbars[orientation].element->SetProperty(CLIP, "1");
 
 
 	scrollbars[orientation].widget = new WidgetSliderScroll(scrollbars[orientation].element);
 	scrollbars[orientation].widget = new WidgetSliderScroll(scrollbars[orientation].element);
 	scrollbars[orientation].widget->Initialise(orientation == VERTICAL ? WidgetSlider::VERTICAL : WidgetSlider::HORIZONTAL);
 	scrollbars[orientation].widget->Initialise(orientation == VERTICAL ? WidgetSlider::VERTICAL : WidgetSlider::HORIZONTAL);

+ 90 - 86
Source/Core/ElementStyle.cpp

@@ -81,31 +81,32 @@ const ElementDefinition* ElementStyle::GetDefinition()
 
 
 
 
 // Returns one of this element's properties.
 // Returns one of this element's properties.
-const Property* ElementStyle::GetLocalProperty(PropertyId id, PropertyDictionary* local_properties, ElementDefinition* definition, const PseudoClassList& pseudo_classes)
+const Property* ElementStyle::GetLocalProperty(const String& name, PropertyDictionary* local_properties, ElementDefinition* definition, const PseudoClassList& pseudo_classes)
 {
 {
 	// Check for overriding local properties.
 	// Check for overriding local properties.
 	if (local_properties != NULL)
 	if (local_properties != NULL)
 	{
 	{
-		if (auto it = local_properties->find(id); it != local_properties->end())
-			return &it->second;
+		const Property* property = local_properties->GetProperty(name);
+		if (property != NULL)
+			return property;
 	}
 	}
 
 
 	// Check for a property defined in an RCSS rule.
 	// Check for a property defined in an RCSS rule.
 	if (definition != NULL)
 	if (definition != NULL)
-		return definition->GetProperty(id, pseudo_classes);
+		return definition->GetProperty(name, pseudo_classes);
 
 
 	return NULL;
 	return NULL;
 }
 }
 
 
 // Returns one of this element's properties.
 // Returns one of this element's properties.
-const Property* ElementStyle::GetProperty(PropertyId id, Element* element, PropertyDictionary* local_properties, ElementDefinition* definition, const PseudoClassList& pseudo_classes)
+const Property* ElementStyle::GetProperty(const String& name, Element* element, PropertyDictionary* local_properties, ElementDefinition* definition, const PseudoClassList& pseudo_classes)
 {
 {
-	const Property* local_property = GetLocalProperty(id, local_properties, definition, pseudo_classes);
+	const Property* local_property = GetLocalProperty(name, local_properties, definition, pseudo_classes);
 	if (local_property != NULL)
 	if (local_property != NULL)
 		return local_property;
 		return local_property;
 
 
 	// Fetch the property specification.
 	// Fetch the property specification.
-	const PropertyDefinition* property = StyleSheetSpecification::GetProperty(id);
+	const PropertyDefinition* property = StyleSheetSpecification::GetProperty(name);
 	if (property == NULL)
 	if (property == NULL)
 		return NULL;
 		return NULL;
 
 
@@ -115,7 +116,7 @@ const Property* ElementStyle::GetProperty(PropertyId id, Element* element, Prope
 		Element* parent = element->GetParentNode();
 		Element* parent = element->GetParentNode();
 		while (parent != NULL)
 		while (parent != NULL)
 		{
 		{
-			const Property* parent_property = parent->GetStyle()->GetLocalProperty(id);
+			const Property* parent_property = parent->GetStyle()->GetLocalProperty(name);
 			if (parent_property)
 			if (parent_property)
 				return parent_property;
 				return parent_property;
 
 
@@ -129,14 +130,14 @@ const Property* ElementStyle::GetProperty(PropertyId id, Element* element, Prope
 
 
 // Apply transition to relevant properties if a transition is defined on element.
 // Apply transition to relevant properties if a transition is defined on element.
 // Properties that are part of a transition are removed from the properties list.
 // Properties that are part of a transition are removed from the properties list.
-void ElementStyle::TransitionPropertyChanges(Element* element, PropertyIdList& properties, PropertyDictionary* local_properties, ElementDefinition* old_definition, ElementDefinition* new_definition,
+void ElementStyle::TransitionPropertyChanges(Element* element, PropertyNameList& properties, PropertyDictionary* local_properties, ElementDefinition* old_definition, ElementDefinition* new_definition,
 	const PseudoClassList& pseudo_classes_before, const PseudoClassList& pseudo_classes_after)
 	const PseudoClassList& pseudo_classes_before, const PseudoClassList& pseudo_classes_after)
 {
 {
 	ROCKET_ASSERT(element);
 	ROCKET_ASSERT(element);
 	if (!old_definition || !new_definition || properties.empty())
 	if (!old_definition || !new_definition || properties.empty())
 		return;
 		return;
 
 
-	if (const Property* transition_property = GetLocalProperty(PropertyId::Transition, local_properties, new_definition, pseudo_classes_after))
+	if (const Property* transition_property = GetLocalProperty(TRANSITION, local_properties, new_definition, pseudo_classes_after))
 	{
 	{
 		auto transition_list = transition_property->Get<TransitionList>();
 		auto transition_list = transition_property->Get<TransitionList>();
 
 
@@ -144,8 +145,8 @@ void ElementStyle::TransitionPropertyChanges(Element* element, PropertyIdList& p
 		{
 		{
 			auto add_transition = [&](const Transition& transition) {
 			auto add_transition = [&](const Transition& transition) {
 				bool transition_added = false;
 				bool transition_added = false;
-				const Property* start_value = GetProperty(transition.property_id, element, local_properties, old_definition, pseudo_classes_before);
-				const Property* target_value = GetProperty(transition.property_id, element, nullptr, new_definition, pseudo_classes_after);
+				const Property* start_value = GetProperty(transition.name, element, local_properties, old_definition, pseudo_classes_before);
+				const Property* target_value = GetProperty(transition.name, element, nullptr, new_definition, pseudo_classes_after);
 				if (start_value && target_value && (*start_value != *target_value))
 				if (start_value && target_value && (*start_value != *target_value))
 					transition_added = element->StartTransition(transition, *start_value, *target_value);
 					transition_added = element->StartTransition(transition, *start_value, *target_value);
 				return transition_added;
 				return transition_added;
@@ -156,7 +157,7 @@ void ElementStyle::TransitionPropertyChanges(Element* element, PropertyIdList& p
 				Transition transition = transition_list.transitions[0];
 				Transition transition = transition_list.transitions[0];
 				for (auto it = properties.begin(); it != properties.end(); )
 				for (auto it = properties.begin(); it != properties.end(); )
 				{
 				{
-					transition.property_id = *it;
+					transition.name = *it;
 					if (add_transition(transition))
 					if (add_transition(transition))
 						it = properties.erase(it);
 						it = properties.erase(it);
 					else
 					else
@@ -167,7 +168,7 @@ void ElementStyle::TransitionPropertyChanges(Element* element, PropertyIdList& p
 			{
 			{
 				for (auto& transition : transition_list.transitions)
 				for (auto& transition : transition_list.transitions)
 				{
 				{
-					if (auto it = properties.find(transition.property_id); it != properties.end())
+					if (auto it = properties.find(transition.name); it != properties.end())
 					{
 					{
 						if (add_transition(transition))
 						if (add_transition(transition))
 							properties.erase(it);
 							properties.erase(it);
@@ -195,7 +196,7 @@ void ElementStyle::UpdateDefinition()
 		// Switch the property definitions if the definition has changed.
 		// Switch the property definitions if the definition has changed.
 		if (new_definition != definition || new_definition == NULL)
 		if (new_definition != definition || new_definition == NULL)
 		{
 		{
-			PropertyIdList properties;
+			PropertyNameList properties;
 			
 			
 			if (definition != NULL)
 			if (definition != NULL)
 				definition->GetDefinedProperties(properties, pseudo_classes);
 				definition->GetDefinedProperties(properties, pseudo_classes);
@@ -250,7 +251,7 @@ void ElementStyle::SetPseudoClass(const String& pseudo_class, bool activate)
 
 
 		if (definition != NULL)
 		if (definition != NULL)
 		{
 		{
-			PropertyIdList properties;
+			PropertyNameList properties;
 			definition->GetDefinedProperties(properties, pseudo_classes, pseudo_class);
 			definition->GetDefinedProperties(properties, pseudo_classes, pseudo_class);
 
 
 			TransitionPropertyChanges(element, properties, local_properties, definition, definition, pseudo_classes_before, pseudo_classes);
 			TransitionPropertyChanges(element, properties, local_properties, definition, definition, pseudo_classes_before, pseudo_classes);
@@ -339,30 +340,29 @@ String ElementStyle::GetClassNames() const
 }
 }
 
 
 // Sets a local property override on the element.
 // Sets a local property override on the element.
-bool ElementStyle::SetProperty(PropertyId id, const String& value)
+bool ElementStyle::SetProperty(const String& name, const String& value)
 {
 {
 	if (local_properties == NULL)
 	if (local_properties == NULL)
 		local_properties = new PropertyDictionary();
 		local_properties = new PropertyDictionary();
 
 
-	if (StyleSheetSpecification::ParsePropertyDeclaration(*local_properties, GetName(id), value))
+	if (StyleSheetSpecification::ParsePropertyDeclaration(*local_properties, name, value))
 	{
 	{
-		DirtyProperty(id);
+		DirtyProperty(name);
 		return true;
 		return true;
 	}
 	}
 	else
 	else
 	{
 	{
-		const String& name = GetName(id);
 		Log::Message(Log::LT_WARNING, "Syntax error parsing inline property declaration '%s: %s;'.", name.c_str(), value.c_str());
 		Log::Message(Log::LT_WARNING, "Syntax error parsing inline property declaration '%s: %s;'.", name.c_str(), value.c_str());
 		return false;
 		return false;
 	}
 	}
 }
 }
 
 
 // Sets a local property override on the element to a pre-parsed value.
 // Sets a local property override on the element to a pre-parsed value.
-bool ElementStyle::SetProperty(PropertyId property_id, const Property& property)
+bool ElementStyle::SetProperty(const String& name, const Property& property)
 {
 {
 	Property new_property = property;
 	Property new_property = property;
 
 
-	new_property.definition = StyleSheetSpecification::GetProperty(property_id);
+	new_property.definition = StyleSheetSpecification::GetProperty(name);
 	if (new_property.definition == NULL)
 	if (new_property.definition == NULL)
 		return false;
 		return false;
 
 
@@ -370,43 +370,43 @@ bool ElementStyle::SetProperty(PropertyId property_id, const Property& property)
 	if (local_properties == NULL)
 	if (local_properties == NULL)
 		local_properties = new PropertyDictionary();
 		local_properties = new PropertyDictionary();
 
 
-	(*local_properties)[property_id] = new_property;
-	DirtyProperty(property_id);
+	local_properties->SetProperty(name, new_property);
+	DirtyProperty(name);
 
 
 	return true;
 	return true;
 }
 }
 
 
 // Removes a local property override on the element.
 // Removes a local property override on the element.
-void ElementStyle::RemoveProperty(PropertyId property_id)
+void ElementStyle::RemoveProperty(const String& name)
 {
 {
 	if (local_properties == NULL)
 	if (local_properties == NULL)
 		return;
 		return;
 
 
-	if (local_properties->find(property_id) != local_properties->end())
+	if (local_properties->GetProperty(name) != NULL)
 	{
 	{
-		local_properties->erase(property_id);
-		DirtyProperty(property_id);
+		local_properties->RemoveProperty(name);
+		DirtyProperty(name);
 	}
 	}
 }
 }
 
 
 
 
 
 
 // Returns one of this element's properties.
 // Returns one of this element's properties.
-const Property* ElementStyle::GetProperty(PropertyId property_id)
+const Property* ElementStyle::GetProperty(const String& name)
 {
 {
-	return GetProperty(property_id, element, local_properties, definition, pseudo_classes);
+	return GetProperty(name, element, local_properties, definition, pseudo_classes);
 }
 }
 
 
 // Returns one of this element's properties.
 // Returns one of this element's properties.
-const Property* ElementStyle::GetLocalProperty(PropertyId property_id)
+const Property* ElementStyle::GetLocalProperty(const String& name)
 {
 {
-	return GetLocalProperty(property_id, local_properties, definition, pseudo_classes);
+	return GetLocalProperty(name, local_properties, definition, pseudo_classes);
 }
 }
 
 
 const PropertyMap * ElementStyle::GetLocalProperties() const
 const PropertyMap * ElementStyle::GetLocalProperties() const
 {
 {
 	if (local_properties)
 	if (local_properties)
-		return local_properties;
+		return &local_properties->GetProperties();
 	return NULL;
 	return NULL;
 }
 }
 
 
@@ -477,15 +477,15 @@ float ElementStyle::ResolveAngle(const Property * property)
 	return 0.0f;
 	return 0.0f;
 }
 }
 
 
-float ElementStyle::ResolveNumericProperty(PropertyId property_id, const Property * property)
+float ElementStyle::ResolveNumericProperty(const String& property_name, const Property * property)
 {
 {
-	if ((property->unit & Property::LENGTH) && !(property->unit == Property::EM && property_id == PropertyId::FontSize))
+	if ((property->unit & Property::LENGTH) && !(property->unit == Property::EM && property_name == FONT_SIZE))
 	{
 	{
 		return ResolveLength(property);
 		return ResolveLength(property);
 	}
 	}
 
 
 	auto definition = property->definition;
 	auto definition = property->definition;
-	if (!definition) definition = StyleSheetSpecification::GetProperty(property_id);
+	if (!definition) definition = StyleSheetSpecification::GetProperty(property_name);
 	if (!definition) return 0.0f;
 	if (!definition) return 0.0f;
 
 
 	auto relative_target = definition->GetRelativeTarget();
 	auto relative_target = definition->GetRelativeTarget();
@@ -598,9 +598,9 @@ float ElementStyle::ResolveProperty(const Property* property, float base_value)
 }
 }
 
 
 // Resolves one of this element's properties.
 // Resolves one of this element's properties.
-float ElementStyle::ResolveProperty(PropertyId property_id, float base_value)
+float ElementStyle::ResolveProperty(const String& name, float base_value)
 {
 {
-	const Property* property = GetProperty(property_id);
+	const Property* property = GetProperty(name);
 	if (!property)
 	if (!property)
 	{
 	{
 		ROCKET_ERROR;
 		ROCKET_ERROR;
@@ -609,7 +609,7 @@ float ElementStyle::ResolveProperty(PropertyId property_id, float base_value)
 
 
 	// The calculated value of the font-size property is inherited, so we need to check if this
 	// The calculated value of the font-size property is inherited, so we need to check if this
 	// is an inherited property. If so, then we return our parent's font size instead.
 	// is an inherited property. If so, then we return our parent's font size instead.
-	if (property_id == PropertyId::FontSize && property->unit & Property::RELATIVE_UNIT)
+	if (name == FONT_SIZE && property->unit & Property::RELATIVE_UNIT)
 	{
 	{
 		// If the rem unit is used, the font-size is inherited directly from the document,
 		// If the rem unit is used, the font-size is inherited directly from the document,
 		// otherwise we use the parent's font size.
 		// otherwise we use the parent's font size.
@@ -619,7 +619,7 @@ float ElementStyle::ResolveProperty(PropertyId property_id, float base_value)
 			if (owner_document == NULL)
 			if (owner_document == NULL)
 				return 0;
 				return 0;
 
 
-			base_value = element->GetOwnerDocument()->ResolveProperty(PropertyId::FontSize, 0);
+			base_value = element->GetOwnerDocument()->ResolveProperty(FONT_SIZE, 0);
 		}
 		}
 		else
 		else
 		{
 		{
@@ -627,11 +627,11 @@ float ElementStyle::ResolveProperty(PropertyId property_id, float base_value)
 			if (parent == NULL)
 			if (parent == NULL)
 				return 0;
 				return 0;
 
 
-			if (GetLocalProperty(PropertyId::FontSize) == NULL)
-				return parent->ResolveProperty(PropertyId::FontSize, 0);
+			if (GetLocalProperty(FONT_SIZE) == NULL)
+				return parent->ResolveProperty(FONT_SIZE, 0);
 
 
 			// The base value for font size is always the height of *this* element's parent's font.
 			// The base value for font size is always the height of *this* element's parent's font.
-			base_value = parent->ResolveProperty(PropertyId::FontSize, 0);
+			base_value = parent->ResolveProperty(FONT_SIZE, 0);
 		}
 		}
 
 
 		switch (property->unit)
 		switch (property->unit)
@@ -653,18 +653,18 @@ float ElementStyle::ResolveProperty(PropertyId property_id, float base_value)
 }
 }
 
 
 // Iterates over the properties defined on the element.
 // Iterates over the properties defined on the element.
-bool ElementStyle::IterateProperties(int& index, PseudoClassList& property_pseudo_classes, PropertyId& property_id, const Property*& property)
+bool ElementStyle::IterateProperties(int& index, PseudoClassList& property_pseudo_classes, String& name, const Property*& property)
 {
 {
 	// First check for locally defined properties.
 	// First check for locally defined properties.
 	if (local_properties != NULL)
 	if (local_properties != NULL)
 	{
 	{
-		if (index < (int)local_properties->size())
+		if (index < local_properties->GetNumProperties())
 		{
 		{
-			PropertyMap::const_iterator i = local_properties->cbegin();
+			PropertyMap::const_iterator i = local_properties->GetProperties().begin();
 			for (int count = 0; count < index; ++count)
 			for (int count = 0; count < index; ++count)
 				++i;
 				++i;
 
 
-			property_id = (*i).first;
+			name = (*i).first;
 			property = &((*i).second);
 			property = &((*i).second);
 			property_pseudo_classes.clear();
 			property_pseudo_classes.clear();
 			++index;
 			++index;
@@ -678,15 +678,15 @@ bool ElementStyle::IterateProperties(int& index, PseudoClassList& property_pseud
 	{
 	{
 		int index_offset = 0;
 		int index_offset = 0;
 		if (local_properties != NULL)
 		if (local_properties != NULL)
-			index_offset = (int)local_properties->size();
+			index_offset = local_properties->GetNumProperties();
 
 
 		// Offset the index to be relative to the definition before we start indexing. When we do get a property back,
 		// Offset the index to be relative to the definition before we start indexing. When we do get a property back,
 		// check that it hasn't been overridden by the element's local properties; if so, continue on to the next one.
 		// check that it hasn't been overridden by the element's local properties; if so, continue on to the next one.
 		index -= index_offset;
 		index -= index_offset;
-		while (definition->IterateProperties(index, pseudo_classes, property_pseudo_classes, property_id, property))
+		while (definition->IterateProperties(index, pseudo_classes, property_pseudo_classes, name, property))
 		{
 		{
 			if (local_properties == NULL ||
 			if (local_properties == NULL ||
-				local_properties->find(property_id) == local_properties->end())
+				local_properties->GetProperty(name) == NULL)
 			{
 			{
 				index += index_offset;
 				index += index_offset;
 				return true;
 				return true;
@@ -724,7 +724,7 @@ void ElementStyle::DirtyChildDefinitions()
 // Dirties every property.
 // Dirties every property.
 void ElementStyle::DirtyProperties()
 void ElementStyle::DirtyProperties()
 {
 {
-	const PropertyIdList &properties = StyleSheetSpecification::GetRegisteredProperties();
+	const PropertyNameList &properties = StyleSheetSpecification::GetRegisteredProperties();
 	DirtyProperties(properties);
 	DirtyProperties(properties);
 }
 }
 
 
@@ -734,11 +734,11 @@ void ElementStyle::DirtyEmProperties()
 	if (!em_properties)
 	if (!em_properties)
 	{
 	{
 		// Check if any of these are currently em-relative. If so, dirty them.
 		// Check if any of these are currently em-relative. If so, dirty them.
-		em_properties = new PropertyIdList;
+		em_properties = new PropertyNameList;
 		for (auto& property : StyleSheetSpecification::GetRegisteredProperties())
 		for (auto& property : StyleSheetSpecification::GetRegisteredProperties())
 		{
 		{
 			// Skip font-size; this is relative to our parent's em, not ours.
 			// Skip font-size; this is relative to our parent's em, not ours.
-			if (property == PropertyId::FontSize)
+			if (property == FONT_SIZE)
 				continue;
 				continue;
 
 
 			// Get this property from this element. If this is em-relative, then add it to the list to
 			// Get this property from this element. If this is em-relative, then add it to the list to
@@ -760,7 +760,7 @@ void ElementStyle::DirtyEmProperties()
 // Dirties font-size on child elements if appropriate.
 // Dirties font-size on child elements if appropriate.
 void ElementStyle::DirtyInheritedEmProperties()
 void ElementStyle::DirtyInheritedEmProperties()
 {
 {
-	const Property* font_size = element->GetLocalProperty(PropertyId::FontSize);
+	const Property* font_size = element->GetLocalProperty(FONT_SIZE);
 	if (font_size == NULL)
 	if (font_size == NULL)
 	{
 	{
 		int num_children = element->GetNumChildren(true);
 		int num_children = element->GetNumChildren(true);
@@ -770,21 +770,21 @@ void ElementStyle::DirtyInheritedEmProperties()
 	else
 	else
 	{
 	{
 		if (font_size->unit & Property::RELATIVE_UNIT)
 		if (font_size->unit & Property::RELATIVE_UNIT)
-			DirtyProperty(PropertyId::FontSize);
+			DirtyProperty(FONT_SIZE);
 	}
 	}
 }
 }
 
 
 // Dirties rem properties.
 // Dirties rem properties.
 void ElementStyle::DirtyRemProperties()
 void ElementStyle::DirtyRemProperties()
 {
 {
-	const PropertyIdList& properties = StyleSheetSpecification::GetRegisteredProperties();
-	PropertyIdList rem_properties;
+	const PropertyNameList &properties = StyleSheetSpecification::GetRegisteredProperties();
+	PropertyNameList rem_properties;
 
 
 	// Dirty all the properties of this element that use the rem unit.
 	// Dirty all the properties of this element that use the rem unit.
-	for (auto& p : properties)
+	for (PropertyNameList::const_iterator list_iterator = properties.begin(); list_iterator != properties.end(); ++list_iterator)
 	{
 	{
-		if (element->GetProperty(p)->unit == Property::REM)
-			rem_properties.insert(p);
+		if (element->GetProperty(*list_iterator)->unit == Property::REM)
+			rem_properties.insert(*list_iterator);
 	}
 	}
 
 
 	if (!rem_properties.empty())
 	if (!rem_properties.empty())
@@ -798,14 +798,14 @@ void ElementStyle::DirtyRemProperties()
 
 
 void ElementStyle::DirtyDpProperties()
 void ElementStyle::DirtyDpProperties()
 {
 {
-	const PropertyIdList& properties = StyleSheetSpecification::GetRegisteredProperties();
-	PropertyIdList dp_properties;
+	const PropertyNameList &properties = StyleSheetSpecification::GetRegisteredProperties();
+	PropertyNameList dp_properties;
 
 
 	// Dirty all the properties of this element that use the dp unit.
 	// Dirty all the properties of this element that use the dp unit.
-	for (auto& p : properties)
+	for (PropertyNameList::const_iterator list_iterator = properties.begin(); list_iterator != properties.end(); ++list_iterator)
 	{
 	{
-		if (element->GetProperty(p)->unit == Property::DP)
-			dp_properties.insert(p);
+		if (element->GetProperty(*list_iterator)->unit == Property::DP)
+			dp_properties.insert(*list_iterator);
 	}
 	}
 
 
 	if (!dp_properties.empty())
 	if (!dp_properties.empty())
@@ -818,13 +818,16 @@ void ElementStyle::DirtyDpProperties()
 }
 }
 
 
 // Sets a single property as dirty.
 // Sets a single property as dirty.
-void ElementStyle::DirtyProperty(PropertyId property_id)
+void ElementStyle::DirtyProperty(const String& property)
 {
 {
-	DirtyProperties({ property_id });
+	PropertyNameList properties;
+	properties.insert(String(property));
+
+	DirtyProperties(properties);
 }
 }
 
 
 // Sets a list of properties as dirty.
 // Sets a list of properties as dirty.
-void ElementStyle::DirtyProperties(const PropertyIdList& properties, bool clear_em_properties)
+void ElementStyle::DirtyProperties(const PropertyNameList& properties, bool clear_em_properties)
 {
 {
 	if (properties.empty())
 	if (properties.empty())
 		return;
 		return;
@@ -837,21 +840,21 @@ void ElementStyle::DirtyProperties(const PropertyIdList& properties, bool clear_
 
 
 	if (all_inherited_dirty)
 	if (all_inherited_dirty)
 	{
 	{
-		const PropertyIdList &all_inherited_properties = StyleSheetSpecification::GetRegisteredInheritedProperties();
+		const PropertyNameList &all_inherited_properties = StyleSheetSpecification::GetRegisteredInheritedProperties();
 		for (int i = 0; i < element->GetNumChildren(true); i++)
 		for (int i = 0; i < element->GetNumChildren(true); i++)
 			element->GetChild(i)->GetStyle()->DirtyInheritedProperties(all_inherited_properties);
 			element->GetChild(i)->GetStyle()->DirtyInheritedProperties(all_inherited_properties);
 	}
 	}
 	else
 	else
 	{
 	{
-		PropertyIdList inherited_properties;
+		PropertyNameList inherited_properties;
 
 
-		for (auto& p : properties)
+		for (PropertyNameList::const_iterator i = properties.begin(); i != properties.end(); ++i)
 		{
 		{
 			// If this property is an inherited property, then push it into the list to be passed onto our children.
 			// If this property is an inherited property, then push it into the list to be passed onto our children.
-			const PropertyDefinition* property = StyleSheetSpecification::GetProperty(p);
+			const PropertyDefinition* property = StyleSheetSpecification::GetProperty(*i);
 			if (property != NULL &&
 			if (property != NULL &&
 				property->IsInherited())
 				property->IsInherited())
-				inherited_properties.insert(p);
+				inherited_properties.insert(*i);
 		}
 		}
 
 
 		// Pass the list of those properties that are inherited onto our children.
 		// Pass the list of those properties that are inherited onto our children.
@@ -878,18 +881,18 @@ void ElementStyle::DirtyProperties(const PropertyIdList& properties, bool clear_
 }
 }
 
 
 // Sets a list of our potentially inherited properties as dirtied by an ancestor.
 // Sets a list of our potentially inherited properties as dirtied by an ancestor.
-void ElementStyle::DirtyInheritedProperties(const PropertyIdList& properties)
+void ElementStyle::DirtyInheritedProperties(const PropertyNameList& properties)
 {
 {
 	bool clear_em_properties = em_properties != NULL;
 	bool clear_em_properties = em_properties != NULL;
 
 
-	PropertyIdList inherited_properties;
-	for (auto& p : properties)
+	PropertyNameList inherited_properties;
+	for (PropertyNameList::const_iterator i = properties.begin(); i != properties.end(); ++i)
 	{
 	{
-		const Property *property = GetLocalProperty(p);
+		const Property *property = GetLocalProperty((*i));
 		if (property == NULL)
 		if (property == NULL)
 		{
 		{
-			inherited_properties.insert(p);
-			if (!clear_em_properties && em_properties != NULL && em_properties->find(p) != em_properties->end()) {
+			inherited_properties.insert(*i);
+			if (!clear_em_properties && em_properties != NULL && em_properties->find((*i)) != em_properties->end()) {
 				clear_em_properties = true;
 				clear_em_properties = true;
 			}
 			}
 		}
 		}
@@ -913,6 +916,7 @@ void ElementStyle::DirtyInheritedProperties(const PropertyIdList& properties)
 		element->GetChild(i)->GetStyle()->DirtyInheritedProperties(inherited_properties);
 		element->GetChild(i)->GetStyle()->DirtyInheritedProperties(inherited_properties);
 
 
 	element->DirtyProperties(properties);
 	element->DirtyProperties(properties);
+	//element->OnPropertyChange(properties);
 }
 }
 
 
 void ElementStyle::GetOffsetProperties(const Property **top, const Property **bottom, const Property **left, const Property **right )
 void ElementStyle::GetOffsetProperties(const Property **top, const Property **bottom, const Property **left, const Property **right )
@@ -998,43 +1002,43 @@ const Property *ElementStyle::GetVerticalAlignProperty()
 // Returns 'perspective' property value from element's style or local cache.
 // Returns 'perspective' property value from element's style or local cache.
 const Property *ElementStyle::GetPerspective()
 const Property *ElementStyle::GetPerspective()
 {
 {
-	return element->GetProperty(PropertyId::Perspective);
+	return element->GetProperty(PERSPECTIVE);
 }
 }
 
 
 // Returns 'perspective-origin-x' property value from element's style or local cache.
 // Returns 'perspective-origin-x' property value from element's style or local cache.
 const Property *ElementStyle::GetPerspectiveOriginX()
 const Property *ElementStyle::GetPerspectiveOriginX()
 {
 {
-	return element->GetProperty(PropertyId::PerspectiveOriginX);
+	return element->GetProperty(PERSPECTIVE_ORIGIN_X);
 }
 }
 
 
 // Returns 'perspective-origin-y' property value from element's style or local cache.
 // Returns 'perspective-origin-y' property value from element's style or local cache.
 const Property *ElementStyle::GetPerspectiveOriginY()
 const Property *ElementStyle::GetPerspectiveOriginY()
 {
 {
-	return element->GetProperty(PropertyId::PerspectiveOriginY);
+	return element->GetProperty(PERSPECTIVE_ORIGIN_Y);
 }
 }
 
 
 // Returns 'transform' property value from element's style or local cache.
 // Returns 'transform' property value from element's style or local cache.
 const Property *ElementStyle::GetTransform()
 const Property *ElementStyle::GetTransform()
 {
 {
-	return element->GetProperty(PropertyId::Transform);
+	return element->GetProperty(TRANSFORM);
 }
 }
 
 
 // Returns 'transform-origin-x' property value from element's style or local cache.
 // Returns 'transform-origin-x' property value from element's style or local cache.
 const Property *ElementStyle::GetTransformOriginX()
 const Property *ElementStyle::GetTransformOriginX()
 {
 {
-	return element->GetProperty(PropertyId::TransformOriginX);
+	return element->GetProperty(TRANSFORM_ORIGIN_X);
 }
 }
 
 
 // Returns 'transform-origin-y' property value from element's style or local cache.
 // Returns 'transform-origin-y' property value from element's style or local cache.
 const Property *ElementStyle::GetTransformOriginY()
 const Property *ElementStyle::GetTransformOriginY()
 {
 {
-	return element->GetProperty(PropertyId::TransformOriginY);
+	return element->GetProperty(TRANSFORM_ORIGIN_Y);
 }
 }
 
 
 // Returns 'transform-origin-z' property value from element's style or local cache.
 // Returns 'transform-origin-z' property value from element's style or local cache.
 const Property *ElementStyle::GetTransformOriginZ()
 const Property *ElementStyle::GetTransformOriginZ()
 {
 {
-	return element->GetProperty(PropertyId::TransformOriginZ);
+	return element->GetProperty(TRANSFORM_ORIGIN_Z);
 }
 }
 
 
 }
 }

+ 15 - 15
Source/Core/ElementStyle.h

@@ -84,25 +84,25 @@ public:
 	/// Sets a local property override on the element.
 	/// Sets a local property override on the element.
 	/// @param[in] name The name of the new property.
 	/// @param[in] name The name of the new property.
 	/// @param[in] property The new property to set.
 	/// @param[in] property The new property to set.
-	bool SetProperty(PropertyId id, const String& value);
+	bool SetProperty(const String& name, const String& value);
 	/// Sets a local property override on the element to a pre-parsed value.
 	/// Sets a local property override on the element to a pre-parsed value.
 	/// @param[in] name The name of the new property.
 	/// @param[in] name The name of the new property.
 	/// @param[in] property The parsed property to set.
 	/// @param[in] property The parsed property to set.
-	bool SetProperty(PropertyId id, const Property& property);
+	bool SetProperty(const String& name, const Property& property);
 	/// Removes a local property override on the element; its value will revert to that defined in
 	/// Removes a local property override on the element; its value will revert to that defined in
 	/// the style sheet.
 	/// the style sheet.
 	/// @param[in] name The name of the local property definition to remove.
 	/// @param[in] name The name of the local property definition to remove.
-	void RemoveProperty(PropertyId id);
+	void RemoveProperty(const String& name);
 	/// Returns one of this element's properties. If this element is not defined this property, or a parent cannot
 	/// Returns one of this element's properties. If this element is not defined this property, or a parent cannot
 	/// be found that we can inherit the property from, the default value will be returned.
 	/// be found that we can inherit the property from, the default value will be returned.
 	/// @param[in] name The name of the property to fetch the value for.
 	/// @param[in] name The name of the property to fetch the value for.
 	/// @return The value of this property for this element, or NULL if no property exists with the given name.
 	/// @return The value of this property for this element, or NULL if no property exists with the given name.
-	const Property* GetProperty(PropertyId id);
+	const Property* GetProperty(const String& name);
 	/// Returns one of this element's properties. If this element is not defined this property, NULL will be
 	/// Returns one of this element's properties. If this element is not defined this property, NULL will be
 	/// returned.
 	/// returned.
 	/// @param[in] name The name of the property to fetch the value for.
 	/// @param[in] name The name of the property to fetch the value for.
 	/// @return The value of this property for this element, or NULL if this property has not been explicitly defined for this element.
 	/// @return The value of this property for this element, or NULL if this property has not been explicitly defined for this element.
-	const Property* GetLocalProperty(PropertyId id);
+	const Property* GetLocalProperty(const String& name);
 	/// Returns the local properties, excluding any properties from local class.
 	/// Returns the local properties, excluding any properties from local class.
 	/// @return The local properties for this element, or NULL if no properties defined
 	/// @return The local properties for this element, or NULL if no properties defined
 	const PropertyMap* GetLocalProperties() const;
 	const PropertyMap* GetLocalProperties() const;
@@ -115,7 +115,7 @@ public:
 	static float ResolveAngle(const Property* property);
 	static float ResolveAngle(const Property* property);
 
 
 	/// Resolves a number-length-percentage property to pixels.
 	/// Resolves a number-length-percentage property to pixels.
-	float ResolveNumericProperty(PropertyId property_id, const Property* property);
+	float ResolveNumericProperty(const String& property_name, const Property* property);
 
 
 	/// Resolves the canonical unit (pixels) from 'number-length-percent' property.
 	/// Resolves the canonical unit (pixels) from 'number-length-percent' property.
 	/// 'percentage' and 'number' gets multiplied by the size of the specified relative reference.
 	/// 'percentage' and 'number' gets multiplied by the size of the specified relative reference.
@@ -134,7 +134,7 @@ public:
 	/// @param[in] name The name of the property to resolve the value for.
 	/// @param[in] name The name of the property to resolve the value for.
 	/// @param[in] base_value The value that is scaled by the percentage value, if it is a percentage.
 	/// @param[in] base_value The value that is scaled by the percentage value, if it is a percentage.
 	/// @return The value of this property for this element.
 	/// @return The value of this property for this element.
-	float ResolveProperty(PropertyId name, float base_value);
+	float ResolveProperty(const String& name, float base_value);
 
 
 	/// Iterates over the properties defined on the element.
 	/// Iterates over the properties defined on the element.
 	/// @param[inout] index Index of the property to fetch. This is incremented to the next valid index after the fetch. Indices are not necessarily incremental.
 	/// @param[inout] index Index of the property to fetch. This is incremented to the next valid index after the fetch. Indices are not necessarily incremental.
@@ -142,7 +142,7 @@ public:
 	/// @param[out] name The name of the property at the specified index.
 	/// @param[out] name The name of the property at the specified index.
 	/// @param[out] property The property at the specified index.
 	/// @param[out] property The property at the specified index.
 	/// @return True if a property was successfully fetched.
 	/// @return True if a property was successfully fetched.
-	bool IterateProperties(int& index, PseudoClassList& pseudo_classes, PropertyId& id, const Property*& property);
+	bool IterateProperties(int& index, PseudoClassList& pseudo_classes, String& name, const Property*& property);
 
 
 	/// Returns the active style sheet for this element. This may be NULL.
 	/// Returns the active style sheet for this element. This may be NULL.
 	StyleSheet* GetStyleSheet() const;
 	StyleSheet* GetStyleSheet() const;
@@ -215,15 +215,15 @@ public:
 
 
 private:
 private:
 	// Sets a single property as dirty.
 	// Sets a single property as dirty.
-	void DirtyProperty(PropertyId property_id);
+	void DirtyProperty(const String& property);
 	// Sets a list of properties as dirty.
 	// Sets a list of properties as dirty.
-	void DirtyProperties(const PropertyIdList& properties, bool clear_em_properties = true);
+	void DirtyProperties(const PropertyNameList& properties, bool clear_em_properties = true);
 	// Sets a list of our potentially inherited properties as dirtied by an ancestor.
 	// Sets a list of our potentially inherited properties as dirtied by an ancestor.
-	void DirtyInheritedProperties(const PropertyIdList& properties);
+	void DirtyInheritedProperties(const PropertyNameList& properties);
 
 
-	static const Property* GetLocalProperty(PropertyId id, PropertyDictionary * local_properties, ElementDefinition * definition, const PseudoClassList & pseudo_classes);
-	static const Property* GetProperty(PropertyId id, Element * element, PropertyDictionary * local_properties, ElementDefinition * definition, const PseudoClassList & pseudo_classes);
-	static void TransitionPropertyChanges(Element * element, PropertyIdList& properties, PropertyDictionary * local_properties, ElementDefinition * old_definition, ElementDefinition * new_definition,
+	static const Property* GetLocalProperty(const String & name, PropertyDictionary * local_properties, ElementDefinition * definition, const PseudoClassList & pseudo_classes);
+	static const Property* GetProperty(const String & name, Element * element, PropertyDictionary * local_properties, ElementDefinition * definition, const PseudoClassList & pseudo_classes);
+	static void TransitionPropertyChanges(Element * element, PropertyNameList & properties, PropertyDictionary * local_properties, ElementDefinition * old_definition, ElementDefinition * new_definition,
 		const PseudoClassList & pseudo_classes_before, const PseudoClassList & pseudo_classes_after);
 		const PseudoClassList & pseudo_classes_before, const PseudoClassList & pseudo_classes_after);
 
 
 	// Element these properties belong to
 	// Element these properties belong to
@@ -237,7 +237,7 @@ private:
 	// Any properties that have been overridden in this element.
 	// Any properties that have been overridden in this element.
 	PropertyDictionary* local_properties;
 	PropertyDictionary* local_properties;
 	// All properties (including inherited) that are EM-relative.
 	// All properties (including inherited) that are EM-relative.
-	PropertyIdList* em_properties;
+	PropertyNameList* em_properties;
 	// The definition of this element; if this is NULL one will be fetched from the element's style.
 	// The definition of this element; if this is NULL one will be fetched from the element's style.
 	ElementDefinition* definition;
 	ElementDefinition* definition;
 	// Set if a new element definition should be fetched from the style.
 	// Set if a new element definition should be fetched from the style.

+ 31 - 31
Source/Core/ElementStyleCache.cpp

@@ -150,28 +150,28 @@ void ElementStyleCache::GetOffsetProperties(const Property **o_top, const Proper
 	if (o_top)
 	if (o_top)
 	{
 	{
 		if (!top)
 		if (!top)
-			top = style->GetProperty(PropertyId::Top);
+			top = style->GetProperty(TOP);
 		*o_top = top;
 		*o_top = top;
 	}
 	}
 
 
 	if (o_bottom)
 	if (o_bottom)
 	{
 	{
 		if (!bottom)
 		if (!bottom)
-			bottom = style->GetProperty(PropertyId::Bottom);
+			bottom = style->GetProperty(BOTTOM);
 		*o_bottom = bottom;
 		*o_bottom = bottom;
 	}
 	}
 
 
 	if (o_left)
 	if (o_left)
 	{
 	{
 		if (!left)
 		if (!left)
-			left = style->GetProperty(PropertyId::Left);
+			left = style->GetProperty(LEFT);
 		*o_left = left;
 		*o_left = left;
 	}
 	}
 
 
 	if (o_right)
 	if (o_right)
 	{
 	{
 		if (!right)
 		if (!right)
-			right = style->GetProperty(PropertyId::Right);
+			right = style->GetProperty(RIGHT);
 		*o_right = right;
 		*o_right = right;
 	}
 	}
 }
 }
@@ -181,28 +181,28 @@ void ElementStyleCache::GetBorderWidthProperties(const Property **o_border_top_w
 	if (o_border_top_width)
 	if (o_border_top_width)
 	{
 	{
 		if (!border_top_width)
 		if (!border_top_width)
-			border_top_width = style->GetProperty(PropertyId::BorderTopWidth);
+			border_top_width = style->GetProperty(BORDER_TOP_WIDTH);
 		*o_border_top_width = border_top_width;
 		*o_border_top_width = border_top_width;
 	}
 	}
 
 
 	if (o_border_bottom_width)
 	if (o_border_bottom_width)
 	{
 	{
 		if (!border_bottom_width)
 		if (!border_bottom_width)
-			border_bottom_width = style->GetProperty(PropertyId::BorderBottomWidth);
+			border_bottom_width = style->GetProperty(BORDER_BOTTOM_WIDTH);
 		*o_border_bottom_width = border_bottom_width;
 		*o_border_bottom_width = border_bottom_width;
 	}
 	}
 
 
 	if (o_border_left_width)
 	if (o_border_left_width)
 	{
 	{
 		if (!border_left_width)
 		if (!border_left_width)
-			border_left_width = style->GetProperty(PropertyId::BorderLeftWidth);
+			border_left_width = style->GetProperty(BORDER_LEFT_WIDTH);
 		*o_border_left_width = border_left_width;
 		*o_border_left_width = border_left_width;
 	}
 	}
 
 
 	if (o_border_right_width)
 	if (o_border_right_width)
 	{
 	{
 		if (!border_right_width)
 		if (!border_right_width)
-			border_right_width = style->GetProperty(PropertyId::BorderRightWidth);
+			border_right_width = style->GetProperty(BORDER_RIGHT_WIDTH);
 		*o_border_right_width = border_right_width;
 		*o_border_right_width = border_right_width;
 	}
 	}
 }
 }
@@ -212,28 +212,28 @@ void ElementStyleCache::GetMarginProperties(const Property **o_margin_top, const
 	if (o_margin_top)
 	if (o_margin_top)
 	{
 	{
 		if (!margin_top)
 		if (!margin_top)
-			margin_top = style->GetProperty(PropertyId::MarginTop);
+			margin_top = style->GetProperty(MARGIN_TOP);
 		*o_margin_top = margin_top;
 		*o_margin_top = margin_top;
 	}
 	}
 
 
 	if (o_margin_bottom)
 	if (o_margin_bottom)
 	{
 	{
 		if (!margin_bottom)
 		if (!margin_bottom)
-			margin_bottom = style->GetProperty(PropertyId::MarginBottom);
+			margin_bottom = style->GetProperty(MARGIN_BOTTOM);
 		*o_margin_bottom = margin_bottom;
 		*o_margin_bottom = margin_bottom;
 	}
 	}
 
 
 	if (o_margin_left)
 	if (o_margin_left)
 	{
 	{
 		if (!margin_left)
 		if (!margin_left)
-			margin_left = style->GetProperty(PropertyId::MarginLeft);
+			margin_left = style->GetProperty(MARGIN_LEFT);
 		*o_margin_left = margin_left;
 		*o_margin_left = margin_left;
 	}
 	}
 
 
 	if (o_margin_right)
 	if (o_margin_right)
 	{
 	{
 		if (!margin_right)
 		if (!margin_right)
-			margin_right = style->GetProperty(PropertyId::MarginRight);
+			margin_right = style->GetProperty(MARGIN_RIGHT);
 		*o_margin_right = margin_right;
 		*o_margin_right = margin_right;
 	}
 	}
 }
 }
@@ -243,28 +243,28 @@ void ElementStyleCache::GetPaddingProperties(const Property **o_padding_top, con
 	if (o_padding_top)
 	if (o_padding_top)
 	{
 	{
 		if (!padding_top)
 		if (!padding_top)
-			padding_top = style->GetProperty(PropertyId::PaddingTop);
+			padding_top = style->GetProperty(PADDING_TOP);
 		*o_padding_top = padding_top;
 		*o_padding_top = padding_top;
 	}
 	}
 
 
 	if (o_padding_bottom)
 	if (o_padding_bottom)
 	{
 	{
 		if (!padding_bottom)
 		if (!padding_bottom)
-			padding_bottom = style->GetProperty(PropertyId::PaddingBottom);
+			padding_bottom = style->GetProperty(PADDING_BOTTOM);
 		*o_padding_bottom = padding_bottom;
 		*o_padding_bottom = padding_bottom;
 	}
 	}
 
 
 	if (o_padding_left)
 	if (o_padding_left)
 	{
 	{
 		if (!padding_left)
 		if (!padding_left)
-			padding_left = style->GetProperty(PropertyId::PaddingLeft);
+			padding_left = style->GetProperty(PADDING_LEFT);
 		*o_padding_left = padding_left;
 		*o_padding_left = padding_left;
 	}
 	}
 
 
 	if (o_padding_right)
 	if (o_padding_right)
 	{
 	{
 		if (!padding_right)
 		if (!padding_right)
-			padding_right = style->GetProperty(PropertyId::PaddingRight);
+			padding_right = style->GetProperty(PADDING_RIGHT);
 		*o_padding_right = padding_right;
 		*o_padding_right = padding_right;
 	}
 	}
 }
 }
@@ -274,14 +274,14 @@ void ElementStyleCache::GetDimensionProperties(const Property **o_width, const P
 	if (o_width)
 	if (o_width)
 	{
 	{
 		if (!width)
 		if (!width)
-			width = style->GetProperty(PropertyId::Width);
+			width = style->GetProperty(WIDTH);
 		*o_width = width;
 		*o_width = width;
 	}
 	}
 
 
 	if (o_height)
 	if (o_height)
 	{
 	{
 		if (!height)
 		if (!height)
-			height = style->GetProperty(PropertyId::Height);
+			height = style->GetProperty(HEIGHT);
 		*o_height = height;
 		*o_height = height;
 	}
 	}
 }
 }
@@ -293,7 +293,7 @@ void ElementStyleCache::GetLocalDimensionProperties(const Property **o_width, co
 		if (!have_local_width)
 		if (!have_local_width)
 		{
 		{
 			have_local_width = true;
 			have_local_width = true;
-			local_width = style->GetLocalProperty(PropertyId::Width);
+			local_width = style->GetLocalProperty(WIDTH);
 		}
 		}
 		*o_width = local_width;
 		*o_width = local_width;
 	}
 	}
@@ -303,7 +303,7 @@ void ElementStyleCache::GetLocalDimensionProperties(const Property **o_width, co
 		if (!have_local_height)
 		if (!have_local_height)
 		{
 		{
 			have_local_height = true;
 			have_local_height = true;
-			local_height = style->GetLocalProperty(PropertyId::Height);
+			local_height = style->GetLocalProperty(HEIGHT);
 		}
 		}
 		*o_height = local_height;
 		*o_height = local_height;
 	}
 	}
@@ -314,14 +314,14 @@ void ElementStyleCache::GetOverflow(int *o_overflow_x, int *o_overflow_y)
 	if (o_overflow_x)
 	if (o_overflow_x)
 	{
 	{
 		if (overflow_x < 0)
 		if (overflow_x < 0)
-			overflow_x = style->GetProperty(PropertyId::OverflowX)->Get< int >();
+			overflow_x = style->GetProperty(OVERFLOW_X)->Get< int >();
 		*o_overflow_x = overflow_x;
 		*o_overflow_x = overflow_x;
 	}
 	}
 
 
 	if (o_overflow_y)
 	if (o_overflow_y)
 	{
 	{
 		if (overflow_y < 0)
 		if (overflow_y < 0)
-			overflow_y = style->GetProperty(PropertyId::OverflowY)->Get< int >();
+			overflow_y = style->GetProperty(OVERFLOW_Y)->Get< int >();
 		*o_overflow_y = overflow_y;
 		*o_overflow_y = overflow_y;
 	}
 	}
 }
 }
@@ -329,63 +329,63 @@ void ElementStyleCache::GetOverflow(int *o_overflow_x, int *o_overflow_y)
 int ElementStyleCache::GetPosition()
 int ElementStyleCache::GetPosition()
 {
 {
 	if (position < 0)
 	if (position < 0)
-		position = style->GetProperty(PropertyId::Position)->Get< int >();
+		position = style->GetProperty(POSITION)->Get< int >();
 	return position;
 	return position;
 }
 }
 
 
 int ElementStyleCache::GetFloat()
 int ElementStyleCache::GetFloat()
 {
 {
 	if (float_ < 0)
 	if (float_ < 0)
-		float_ = style->GetProperty(PropertyId::Float)->Get< int >();
+		float_ = style->GetProperty(FLOAT)->Get< int >();
 	return float_;
 	return float_;
 }
 }
 
 
 int ElementStyleCache::GetDisplay()
 int ElementStyleCache::GetDisplay()
 {
 {
 	if (display < 0)
 	if (display < 0)
-		display = style->GetProperty(PropertyId::Display)->Get< int >();
+		display = style->GetProperty(DISPLAY)->Get< int >();
 	return display;
 	return display;
 }
 }
 
 
 int ElementStyleCache::GetWhitespace()
 int ElementStyleCache::GetWhitespace()
 {
 {
 	if (whitespace < 0)
 	if (whitespace < 0)
-		whitespace = style->GetProperty(PropertyId::WhiteSpace)->Get< int >();
+		whitespace = style->GetProperty(WHITE_SPACE)->Get< int >();
 	return whitespace;
 	return whitespace;
 }
 }
 
 
 int ElementStyleCache::GetPointerEvents()
 int ElementStyleCache::GetPointerEvents()
 {
 {
 	if (pointer_events < 0)
 	if (pointer_events < 0)
-		pointer_events = style->GetProperty(PropertyId::PointerEvents)->Get< int >();
+		pointer_events = style->GetProperty(POINTER_EVENTS)->Get< int >();
 	return pointer_events;
 	return pointer_events;
 }
 }
 
 
 const Property *ElementStyleCache::GetLineHeightProperty()
 const Property *ElementStyleCache::GetLineHeightProperty()
 {
 {
 	if (!line_height)
 	if (!line_height)
-		line_height = style->GetProperty(PropertyId::LineHeight);
+		line_height = style->GetProperty(LINE_HEIGHT);
 	return line_height;
 	return line_height;
 }
 }
 
 
 int ElementStyleCache::GetTextAlign()
 int ElementStyleCache::GetTextAlign()
 {
 {
 	if (text_align < 0)
 	if (text_align < 0)
-		text_align = style->GetProperty(PropertyId::TextAlign)->Get< int >();
+		text_align = style->GetProperty(TEXT_ALIGN)->Get< int >();
 	return text_align;
 	return text_align;
 }
 }
 
 
 int ElementStyleCache::GetTextTransform()
 int ElementStyleCache::GetTextTransform()
 {
 {
 	if (text_transform < 0)
 	if (text_transform < 0)
-		text_transform = style->GetProperty(PropertyId::TextTransform)->Get< int >();
+		text_transform = style->GetProperty(TEXT_TRANSFORM)->Get< int >();
 	return text_transform;
 	return text_transform;
 }
 }
 
 
 const Property *ElementStyleCache::GetVerticalAlignProperty()
 const Property *ElementStyleCache::GetVerticalAlignProperty()
 {
 {
 	if (!vertical_align)
 	if (!vertical_align)
-		vertical_align = style->GetProperty(PropertyId::VerticalAlign);
+		vertical_align = style->GetProperty(VERTICAL_ALIGN);
 	return vertical_align;
 	return vertical_align;
 }
 }
 
 

+ 12 - 12
Source/Core/ElementTextDefault.cpp

@@ -279,30 +279,30 @@ void ElementTextDefault::SuppressAutoLayout()
 	dirty_layout_on_change = false;
 	dirty_layout_on_change = false;
 }
 }
 
 
-void ElementTextDefault::OnPropertyChange(const PropertyIdList& changed_properties)
+void ElementTextDefault::OnPropertyChange(const PropertyNameList& changed_properties)
 {
 {
 	Element::OnPropertyChange(changed_properties);
 	Element::OnPropertyChange(changed_properties);
 
 
 	bool colour_changed = false;
 	bool colour_changed = false;
 	bool font_face_changed = false;
 	bool font_face_changed = false;
 
 
-	if (changed_properties.find(PropertyId::Color) != changed_properties.end() || 
-		changed_properties.find(PropertyId::Opacity) != changed_properties.end())
+	if (changed_properties.find(COLOR) != changed_properties.end() || 
+		changed_properties.find(OPACITY) != changed_properties.end())
 	{
 	{
 		// Fetch our (potentially) new colour.
 		// Fetch our (potentially) new colour.
-		Colourb new_colour = GetProperty(PropertyId::Color)->value.Get< Colourb >();
-		float opacity = GetProperty(PropertyId::Opacity)->value.Get< float>();
+		Colourb new_colour = GetProperty(COLOR)->value.Get< Colourb >();
+		float opacity = GetProperty(OPACITY)->value.Get< float>();
 		new_colour.alpha = byte(opacity * float(new_colour.alpha));
 		new_colour.alpha = byte(opacity * float(new_colour.alpha));
 		colour_changed = colour != new_colour;
 		colour_changed = colour != new_colour;
 		if (colour_changed)
 		if (colour_changed)
 			colour = new_colour;
 			colour = new_colour;
 	}
 	}
 
 
-	if (changed_properties.find(PropertyId::FontFamily) != changed_properties.end() ||
-		changed_properties.find(PropertyId::FontCharset) != changed_properties.end() ||
-		changed_properties.find(PropertyId::FontWeight) != changed_properties.end() ||
-		changed_properties.find(PropertyId::FontStyle) != changed_properties.end() ||
-		changed_properties.find(PropertyId::FontSize) != changed_properties.end())
+	if (changed_properties.find(FONT_FAMILY) != changed_properties.end() ||
+		changed_properties.find(FONT_CHARSET) != changed_properties.end() ||
+		changed_properties.find(FONT_WEIGHT) != changed_properties.end() ||
+		changed_properties.find(FONT_STYLE) != changed_properties.end() ||
+		changed_properties.find(FONT_SIZE) != changed_properties.end())
 	{
 	{
 		font_face_changed = true;
 		font_face_changed = true;
 
 
@@ -310,9 +310,9 @@ void ElementTextDefault::OnPropertyChange(const PropertyIdList& changed_properti
 		font_dirty = true;
 		font_dirty = true;
 	}
 	}
 
 
-	if (changed_properties.find(PropertyId::TextDecoration) != changed_properties.end())
+	if (changed_properties.find(TEXT_DECORATION) != changed_properties.end())
 	{
 	{
-		decoration_property = GetProperty< int >(PropertyId::TextDecoration);
+		decoration_property = GetProperty< int >(TEXT_DECORATION);
 		if (decoration_property != TEXT_DECORATION_NONE)
 		if (decoration_property != TEXT_DECORATION_NONE)
 		{
 		{
 			if (decoration_property != generated_decoration)
 			if (decoration_property != generated_decoration)

+ 1 - 1
Source/Core/ElementTextDefault.h

@@ -77,7 +77,7 @@ public:
 	virtual void SuppressAutoLayout();
 	virtual void SuppressAutoLayout();
 
 
 protected:
 protected:
-	virtual void OnPropertyChange(const PropertyIdList& properties) override;
+	virtual void OnPropertyChange(const PropertyNameList& properties);
 
 
 	/// Returns the RML of this element
 	/// Returns the RML of this element
 	/// @param content[out] The raw text.
 	/// @param content[out] The raw text.

+ 6 - 6
Source/Core/ElementUtilities.cpp

@@ -116,11 +116,11 @@ void ElementUtilities::GetElementsByClassName(ElementList& elements, Element* ro
 FontFaceHandle* ElementUtilities::GetFontFaceHandle(Element* element)
 FontFaceHandle* ElementUtilities::GetFontFaceHandle(Element* element)
 {
 {
 	// Fetch the new font face.
 	// Fetch the new font face.
-	String font_family = element->GetProperty(PropertyId::FontFamily)->value.Get< String >();
-	String font_charset = element->GetProperty(PropertyId::FontCharset)->value.Get< String >();
-	Font::Style font_style = (Font::Style) element->GetProperty(PropertyId::FontStyle)->value.Get< int >();
-	Font::Weight font_weight = (Font::Weight) element->GetProperty(PropertyId::FontWeight)->value.Get< int >();
-	int font_size = Math::RealToInteger(element->ResolveProperty(PropertyId::FontSize, 0));
+	String font_family = element->GetProperty(FONT_FAMILY)->value.Get< String >();
+	String font_charset = element->GetProperty(FONT_CHARSET)->value.Get< String >();
+	Font::Style font_style = (Font::Style) element->GetProperty(FONT_STYLE)->value.Get< int >();
+	Font::Weight font_weight = (Font::Weight) element->GetProperty(FONT_WEIGHT)->value.Get< int >();
+	int font_size = Math::RealToInteger(element->ResolveProperty(FONT_SIZE, 0));
 
 
 	FontFaceHandle* font = FontDatabase::GetFontFaceHandle(font_family, font_charset, font_style, font_weight, font_size);
 	FontFaceHandle* font = FontDatabase::GetFontFaceHandle(font_family, font_charset, font_style, font_weight, font_size);
 	return font;
 	return font;
@@ -193,7 +193,7 @@ void ElementUtilities::BindEventAttributes(Element* element)
 		{
 		{
 			EventListener* listener = Factory::InstanceEventListener(variant.Get<String>(), element);
 			EventListener* listener = Factory::InstanceEventListener(variant.Get<String>(), element);
 			if (listener)
 			if (listener)
-				element->AddEventListener(GetEventId(name.substr(2)), listener, false);
+				element->AddEventListener(name.substr(2), listener, false);
 		}
 		}
 	}
 	}
 }
 }

+ 1 - 12
Source/Core/Event.cpp

@@ -34,7 +34,6 @@ namespace Core {
 
 
 Event::Event()
 Event::Event()
 {
 {
-	event_id = EventId::Invalid;
 	phase = PHASE_UNKNOWN;
 	phase = PHASE_UNKNOWN;
 	interruped = false;
 	interruped = false;
 	interruptible = false;
 	interruptible = false;
@@ -42,10 +41,9 @@ Event::Event()
 	target_element = NULL;
 	target_element = NULL;
 }
 }
 
 
-Event::Event(Element* _target_element, EventId event_id, const Dictionary& _parameters, bool _interruptible) : event_id(event_id), parameters(_parameters), target_element(_target_element), parameters_backup(_parameters), interruptible(_interruptible)
+Event::Event(Element* _target_element, const String& _type, const Dictionary& _parameters, bool _interruptible) : type(_type), parameters(_parameters), target_element(_target_element), parameters_backup(_parameters), interruptible(_interruptible)
 {
 {
 	phase = PHASE_UNKNOWN;
 	phase = PHASE_UNKNOWN;
-	type = GetName(event_id);
 	interruped = false;
 	interruped = false;
 	current_element = NULL;
 	current_element = NULL;
 }
 }
@@ -74,21 +72,12 @@ const String& Event::GetType() const
 {
 {
 	return type;
 	return type;
 }
 }
-EventId Event::GetId() const
-{
-	return event_id;
-}
 
 
 bool Event::operator==(const String& _type) const
 bool Event::operator==(const String& _type) const
 {
 {
 	return type == _type;
 	return type == _type;
 }
 }
 
 
-bool Event::operator==(EventId _id) const
-{
-	return event_id == _id;
-}
-
 void Event::SetPhase(EventPhase _phase)
 void Event::SetPhase(EventPhase _phase)
 {
 {
 	phase = _phase;
 	phase = _phase;

+ 10 - 11
Source/Core/EventDispatcher.cpp

@@ -52,15 +52,15 @@ EventDispatcher::~EventDispatcher()
 	}
 	}
 }
 }
 
 
-void EventDispatcher::AttachEvent(EventId event_id, EventListener* listener, bool in_capture_phase)
+void EventDispatcher::AttachEvent(const String& type, EventListener* listener, bool in_capture_phase)
 {
 {
 	// Look up the event
 	// Look up the event
-	Events::iterator event_itr = events.find(event_id);
+	Events::iterator event_itr = events.find(type);
 
 
 	// Ensure the event is in the event list
 	// Ensure the event is in the event list
 	if (event_itr == events.end())
 	if (event_itr == events.end())
 	{
 	{
-		event_itr = events.emplace(event_id, Listeners()).first;
+		event_itr = events.emplace(type, Listeners()).first;
 	}
 	}
 
 
 	// Add the action to the events
 	// Add the action to the events
@@ -69,10 +69,10 @@ void EventDispatcher::AttachEvent(EventId event_id, EventListener* listener, boo
 	listener->OnAttach(element);
 	listener->OnAttach(element);
 }
 }
 
 
-void EventDispatcher::DetachEvent(EventId event_id, EventListener* listener, bool in_capture_phase)
+void EventDispatcher::DetachEvent(const String& type, EventListener* listener, bool in_capture_phase)
 {
 {
 	// Look up the event
 	// Look up the event
-	Events::iterator event_itr = events.find(event_id);
+	Events::iterator event_itr = events.find(type);
 
 
 	// Bail if we can't find the event
 	// Bail if we can't find the event
 	if (event_itr == events.end())
 	if (event_itr == events.end())
@@ -110,10 +110,10 @@ void EventDispatcher::DetachAllEvents()
 		element->GetChild(i)->GetEventDispatcher()->DetachAllEvents();
 		element->GetChild(i)->GetEventDispatcher()->DetachAllEvents();
 }
 }
 
 
-bool EventDispatcher::DispatchEvent(Element* target_element, EventId event_id, const Dictionary& parameters, bool interruptible)
+bool EventDispatcher::DispatchEvent(Element* target_element, const String& name, const Dictionary& parameters, bool interruptible)
 {
 {
 	//Event event(target_element, name, parameters, interruptible);
 	//Event event(target_element, name, parameters, interruptible);
-	Event* event = Factory::InstanceEvent(target_element, event_id, parameters, interruptible);
+	Event* event = Factory::InstanceEvent(target_element, name, parameters, interruptible);
 	if (event == NULL)
 	if (event == NULL)
 		return false;
 		return false;
 
 
@@ -166,10 +166,9 @@ bool EventDispatcher::DispatchEvent(Element* target_element, EventId event_id, c
 String EventDispatcher::ToString() const
 String EventDispatcher::ToString() const
 {
 {
 	String result;
 	String result;
-	for (const auto& nvp : events)
+	for (auto nvp : events)
 	{
 	{
-		auto& name = GetName(nvp.first);
-		result += CreateString(name.size() + 32, "%s (%d), ", name.c_str(), static_cast<int>(nvp.second.size()));
+		result += CreateString(nvp.first.size() + 32, "%s (%d), ", nvp.first.c_str(), static_cast<int>(nvp.second.size()));
 	}
 	}
 	if (result.size() > 2) 
 	if (result.size() > 2) 
 	{
 	{
@@ -181,7 +180,7 @@ String EventDispatcher::ToString() const
 void EventDispatcher::TriggerEvents(Event* event)
 void EventDispatcher::TriggerEvents(Event* event)
 {
 {
 	// Look up the event
 	// Look up the event
-	Events::iterator itr = events.find(event->GetId());
+	Events::iterator itr = events.find(event->GetType());
 
 
 	if (itr != events.end())
 	if (itr != events.end())
 	{
 	{

+ 4 - 4
Source/Core/EventDispatcher.h

@@ -59,13 +59,13 @@ public:
 	/// @param[in] type Type of the event to attach to
 	/// @param[in] type Type of the event to attach to
 	/// @param[in] event_listener The event listener to be notified when the event fires
 	/// @param[in] event_listener The event listener to be notified when the event fires
 	/// @param[in] in_capture_phase Should the listener be notified in the capture phase
 	/// @param[in] in_capture_phase Should the listener be notified in the capture phase
-	void AttachEvent(EventId event_id, EventListener* event_listener, bool in_capture_phase);
+	void AttachEvent(const String& type, EventListener* event_listener, bool in_capture_phase);
 
 
 	/// Detaches a listener from the specified event name
 	/// Detaches a listener from the specified event name
 	/// @param[in] type Type of the event to attach to
 	/// @param[in] type Type of the event to attach to
 	/// @para[in]m event_listener The event listener to be notified when the event fires
 	/// @para[in]m event_listener The event listener to be notified when the event fires
 	/// @param[in] in_capture_phase Should the listener be notified in the capture phase
 	/// @param[in] in_capture_phase Should the listener be notified in the capture phase
-	void DetachEvent(EventId event_id, EventListener* listener, bool in_capture_phase);
+	void DetachEvent(const String& type, EventListener* listener, bool in_capture_phase);
 
 
 	/// Detaches all events from this dispatcher and all child dispatchers.
 	/// Detaches all events from this dispatcher and all child dispatchers.
 	void DetachAllEvents();
 	void DetachAllEvents();
@@ -76,7 +76,7 @@ public:
 	/// @param[in] parameters The event parameters
 	/// @param[in] parameters The event parameters
 	/// @param[in] interruptible Can the event propagation be stopped
 	/// @param[in] interruptible Can the event propagation be stopped
 	/// @return True if the event was not consumed (ie, was prevented from propagating by an element), false if it was.
 	/// @return True if the event was not consumed (ie, was prevented from propagating by an element), false if it was.
-	bool DispatchEvent(Element* element, EventId event_id, const Dictionary& parameters, bool interruptible);
+	bool DispatchEvent(Element* element, const String& name, const Dictionary& parameters, bool interruptible);
 
 
 	/// Returns event types with number of listeners for debugging.
 	/// Returns event types with number of listeners for debugging.
 	/// @return Summary of attached listeners.
 	/// @return Summary of attached listeners.
@@ -92,7 +92,7 @@ private:
 		bool in_capture_phase;
 		bool in_capture_phase;
 	};
 	};
 	typedef std::vector< Listener > Listeners;
 	typedef std::vector< Listener > Listeners;
-	typedef UnorderedMap< EventId, Listeners > Events;
+	typedef UnorderedMap< String, Listeners > Events;
 	Events events;
 	Events events;
 
 
 	void TriggerEvents(Event* event);
 	void TriggerEvents(Event* event);

+ 2 - 2
Source/Core/EventInstancerDefault.cpp

@@ -40,9 +40,9 @@ EventInstancerDefault::~EventInstancerDefault()
 {
 {
 }
 }
 
 
-Event* EventInstancerDefault::InstanceEvent(Element* target, EventId event_id, const Dictionary& parameters, bool interruptible)
+Event* EventInstancerDefault::InstanceEvent(Element* target, const String& name, const Dictionary& parameters, bool interruptible)
 {
 {
-	return new Event(target, event_id, parameters, interruptible);
+	return new Event(target, name, parameters, interruptible);
 }
 }
 
 
 // Releases an event instanced by this instancer.
 // Releases an event instanced by this instancer.

+ 1 - 1
Source/Core/EventInstancerDefault.h

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

+ 2 - 2
Source/Core/EventIterators.h

@@ -43,7 +43,7 @@ namespace Core {
 class RKTEventFunctor
 class RKTEventFunctor
 {
 {
 public:
 public:
-	RKTEventFunctor(EventId event, const Dictionary& parameters, bool interruptible)
+	RKTEventFunctor(const String& event, const Dictionary& parameters, bool interruptible)
 	{
 	{
 		this->event = event;
 		this->event = event;
 		this->parameters = &parameters;
 		this->parameters = &parameters;
@@ -56,7 +56,7 @@ public:
 	}
 	}
 
 
 private:
 private:
-	EventId event;
+	String event;
 	const Dictionary* parameters;
 	const Dictionary* parameters;
 	bool interruptible;
 	bool interruptible;
 };
 };

+ 29 - 25
Source/Core/Factory.cpp

@@ -360,15 +360,15 @@ Decorator* Factory::InstanceDecorator(const String& name, const PropertyDictiona
 	const PropertySpecification& property_specification = (*iterator).second->GetPropertySpecification();
 	const PropertySpecification& property_specification = (*iterator).second->GetPropertySpecification();
 
 
 	PropertyDictionary parsed_properties;
 	PropertyDictionary parsed_properties;
-	for (const auto& [id,value] : properties)
+	for (PropertyMap::const_iterator i = properties.GetProperties().begin(); i != properties.GetProperties().end(); ++i)
 	{
 	{
-		specificity = Math::Max(specificity, value.specificity);
+		specificity = Math::Max(specificity, (*i).second.specificity);
 
 
 		// Check for the 'z-index' property; we don't want to send this through.
 		// Check for the 'z-index' property; we don't want to send this through.
-		if (id == PropertyId::ZIndex)
-			z_index = value.value.Get< float >();
+		if ((*i).first == Z_INDEX)
+			z_index = (*i).second.value.Get< float >();
 		else
 		else
-			property_specification.ParsePropertyDeclaration(parsed_properties, GetName(id), value.value.Get< String >(), value.source, value.source_line_number);
+			property_specification.ParsePropertyDeclaration(parsed_properties, (*i).first, (*i).second.value.Get< String >(), (*i).second.source, (*i).second.source_line_number);
 	}
 	}
 
 
 	// Set the property defaults for all unset properties.
 	// Set the property defaults for all unset properties.
@@ -420,22 +420,22 @@ FontEffect* Factory::InstanceFontEffect(const String& name, const PropertyDictio
 	const PropertySpecification& property_specification = (*iterator).second->GetPropertySpecification();
 	const PropertySpecification& property_specification = (*iterator).second->GetPropertySpecification();
 
 
 	PropertyDictionary parsed_properties;
 	PropertyDictionary parsed_properties;
-	for (const auto& [id, value] : properties)
+	for (PropertyMap::const_iterator i = properties.GetProperties().begin(); i != properties.GetProperties().end(); ++i)
 	{
 	{
-		specificity = Math::Max(specificity, value.specificity);
+		specificity = Math::Max(specificity, i->second.specificity);
 
 
 		// Check for the 'z-index' property; we don't want to send this through.
 		// Check for the 'z-index' property; we don't want to send this through.
-		if (id == PropertyId::ZIndex)
+		if (i->first == Z_INDEX)
 		{
 		{
 			set_z_index = true;
 			set_z_index = true;
-			z_index = value.value.Get< float >();
+			z_index = i->second.value.Get< float >();
 		}
 		}
-		else if (id == PropertyId::Color)
+		else if (i->first == COLOR)
 		{
 		{
 			static PropertyParserColour colour_parser;
 			static PropertyParserColour colour_parser;
 
 
 			Property colour_property;
 			Property colour_property;
-			if (colour_parser.ParseValue(colour_property, value.value.Get< String >(), ParameterMap()))
+			if (colour_parser.ParseValue(colour_property, i->second.value.Get< String >(), ParameterMap()))
 			{
 			{
 				colour = colour_property.value.Get< Colourb >();
 				colour = colour_property.value.Get< Colourb >();
 				set_colour = true;
 				set_colour = true;
@@ -443,7 +443,7 @@ FontEffect* Factory::InstanceFontEffect(const String& name, const PropertyDictio
 		}
 		}
 		else
 		else
 		{
 		{
-			property_specification.ParsePropertyDeclaration(parsed_properties, GetName(id), value.value.Get< String >(), value.source, value.source_line_number);
+			property_specification.ParsePropertyDeclaration(parsed_properties, (*i).first, (*i).second.value.Get< String >(), (*i).second.source, (*i).second.source_line_number);
 		}
 		}
 	}
 	}
 
 
@@ -452,22 +452,26 @@ FontEffect* Factory::InstanceFontEffect(const String& name, const PropertyDictio
 
 
 	// Compile an ordered list of the values of the properties used to generate the effect's
 	// Compile an ordered list of the values of the properties used to generate the effect's
 	// textures and geometry.
 	// textures and geometry.
-	std::vector<PropertyId> generation_ids;
-	
-	for (const auto& [id, value] : parsed_properties)
+	typedef std::list< std::pair< String, String > > GenerationPropertyList;
+	GenerationPropertyList generation_properties;
+	for (PropertyMap::const_iterator i = parsed_properties.GetProperties().begin(); i != parsed_properties.GetProperties().end(); ++i)
 	{
 	{
-		if (instancer->volatile_properties.find(id) != instancer->volatile_properties.end())
-			generation_ids.push_back(id);
-	}
+		if (instancer->volatile_properties.find(i->first) != instancer->volatile_properties.end())
+		{
+			GenerationPropertyList::iterator j = generation_properties.begin();
+			while (j != generation_properties.end() &&
+				   j->first < i->first)
+				++j;
 
 
-	std::sort(generation_ids.begin(), generation_ids.end());
+			generation_properties.insert(j, GenerationPropertyList::value_type(i->first, i->second.value.Get< String >()));
+		}
+	}
 
 
 	String generation_key;
 	String generation_key;
-	for (PropertyId id : generation_ids)
+	for (GenerationPropertyList::iterator i = generation_properties.begin(); i != generation_properties.end(); ++i)
 	{
 	{
-		auto it = parsed_properties.find(id);
-		ROCKET_ASSERT(it != parsed_properties.end());
-		generation_key += it->second.value.Get<String>() + ";";
+		generation_key += i->second;
+		generation_key += ";";
 	}
 	}
 
 
 	// Now we can actually instance the effect!
 	// Now we can actually instance the effect!
@@ -546,9 +550,9 @@ EventInstancer* Factory::RegisterEventInstancer(EventInstancer* instancer)
 }
 }
 
 
 // Instance an event object.
 // Instance an event object.
-Event* Factory::InstanceEvent(Element* target, EventId event_id, const Dictionary& parameters, bool interruptible)
+Event* Factory::InstanceEvent(Element* target, const String& name, const Dictionary& parameters, bool interruptible)
 {
 {
-	Event* event = event_instancer->InstanceEvent(target, event_id, parameters, interruptible);
+	Event* event = event_instancer->InstanceEvent(target, name, parameters, interruptible);
 	if (event != NULL)
 	if (event != NULL)
 		event->instancer = event_instancer;
 		event->instancer = event_instancer;
 
 

+ 15 - 6
Source/Core/FontDatabase.cpp

@@ -190,17 +190,26 @@ FontEffect* FontDatabase::GetFontEffect(const String& name, const PropertyDictio
 	//  * could be shared with decorators as well
 	//  * could be shared with decorators as well
 
 
 	// Generate a key so we can distinguish unique property sets quickly.
 	// Generate a key so we can distinguish unique property sets quickly.
-	typedef std::map< PropertyId, String > SortedPropertyValueList;
-	SortedPropertyValueList sorted_properties;
-	for (const auto& [id, value] : properties)
+	typedef std::list< std::pair< String, String > > PropertyList;
+	PropertyList sorted_properties;
+	for (PropertyMap::const_iterator property_iterator = properties.GetProperties().begin(); property_iterator != properties.GetProperties().end(); ++property_iterator)
 	{
 	{
-		sorted_properties.emplace(id, value.Get<String>());
+		// Skip the font-effect declaration.
+		if (property_iterator->first == "font-effect")
+			continue;
+
+		PropertyList::iterator insert = sorted_properties.begin();
+		while (insert != sorted_properties.end() &&
+			   insert->first < property_iterator->first)
+		   ++insert;
+
+		sorted_properties.insert(insert, PropertyList::value_type(property_iterator->first, property_iterator->second.Get< String >()));
 	}
 	}
 
 
 	// Generate the font effect's key from the properties.
 	// Generate the font effect's key from the properties.
 	String key = name + ";";
 	String key = name + ";";
-	for (const auto& [id, value] : sorted_properties)
-		key += GetName(id) + ":" + value + ";";
+	for (PropertyList::iterator i = sorted_properties.begin(); i != sorted_properties.end(); ++i)
+		key += i->first + ":" + i->second + ";";
 
 
 	// Check if we have a previously instanced effect.
 	// Check if we have a previously instanced effect.
 	FontEffectCache::iterator i = font_effect_cache.find(key);
 	FontEffectCache::iterator i = font_effect_cache.find(key);

+ 5 - 12
Source/Core/FontEffectInstancer.cpp

@@ -46,25 +46,18 @@ const PropertySpecification& FontEffectInstancer::GetPropertySpecification() con
 }
 }
 
 
 // Registers a property for the font effect.
 // Registers a property for the font effect.
-PropertyDefinition& FontEffectInstancer::RegisterProperty(const String& property_name, const String& default_value, bool affects_generation, PropertyId* out_property_id)
+PropertyDefinition& FontEffectInstancer::RegisterProperty(const String& property_name, const String& default_value, bool affects_generation)
 {
 {
-	PropertyId id = CreateOrGetPropertyId(ToLower(property_name));
-	if (out_property_id)
-		*out_property_id = id;
-
 	if (affects_generation)
 	if (affects_generation)
-		volatile_properties.insert(id);
+		volatile_properties.insert(ToLower(property_name));
 
 
-	return properties.RegisterProperty(id, default_value, false, false);
+	return properties.RegisterProperty(property_name, default_value, false, false);
 }
 }
 
 
 // Registers a shorthand property definition.
 // Registers a shorthand property definition.
-bool FontEffectInstancer::RegisterShorthand(const String& shorthand_name, const PropertyIdList& property_ids, PropertySpecification::ShorthandType type, PropertyId* out_property_id)
+bool FontEffectInstancer::RegisterShorthand(const String& shorthand_name, const String& property_names, PropertySpecification::ShorthandType type)
 {
 {
-	PropertyId id = CreateOrGetPropertyId(ToLower(shorthand_name));
-	if (out_property_id)
-		*out_property_id = id;
-	return properties.RegisterShorthand(id, property_ids, type);
+	return properties.RegisterShorthand(shorthand_name, property_names, type);
 }
 }
 
 
 // Releases the instancer.
 // Releases the instancer.

+ 5 - 3
Source/Core/FontEffectOutlineInstancer.cpp

@@ -34,7 +34,7 @@ namespace Core {
 
 
 FontEffectOutlineInstancer::FontEffectOutlineInstancer()
 FontEffectOutlineInstancer::FontEffectOutlineInstancer()
 {
 {
-	RegisterProperty("font-effect-width", "1", true)
+	RegisterProperty("width", "1", true)
 		.AddParser("length");
 		.AddParser("length");
 }
 }
 
 
@@ -43,9 +43,11 @@ FontEffectOutlineInstancer::~FontEffectOutlineInstancer()
 }
 }
 
 
 // Instances an outline font effect.
 // Instances an outline font effect.
-FontEffect* FontEffectOutlineInstancer::InstanceFontEffect(const String& name, const PropertyDictionary& properties)
+FontEffect* FontEffectOutlineInstancer::InstanceFontEffect(const String& ROCKET_UNUSED_PARAMETER(name), const PropertyDictionary& properties)
 {
 {
-	float width = GetIf(properties, GetPropertyId("font-effect-width"))->Get<float>();
+	ROCKET_UNUSED(name);
+
+	float width = properties.GetProperty("width")->Get< float >();
 
 
 	FontEffectOutline* font_effect = new FontEffectOutline();
 	FontEffectOutline* font_effect = new FontEffectOutline();
 	if (font_effect->Initialise(Math::RealToInteger(width)))
 	if (font_effect->Initialise(Math::RealToInteger(width)))

+ 9 - 7
Source/Core/FontEffectShadowInstancer.cpp

@@ -32,13 +32,13 @@
 namespace Rocket {
 namespace Rocket {
 namespace Core {
 namespace Core {
 
 
-FontEffectShadowInstancer::FontEffectShadowInstancer() : offset_x(PropertyId::Invalid), offset_y(PropertyId::Invalid)
+FontEffectShadowInstancer::FontEffectShadowInstancer()
 {
 {
-	RegisterProperty("font-effect-offset-x", "0", true, &offset_x)
+	RegisterProperty("offset-x", "0", true)
 		.AddParser("length");
 		.AddParser("length");
-	RegisterProperty("font-effect-offset-y", "0", true, &offset_y)
+	RegisterProperty("offset-y", "0", true)
 		.AddParser("length");
 		.AddParser("length");
-	RegisterShorthand("font-effect-offset", { offset_x, offset_y });
+	RegisterShorthand("offset", "offset-x, offset-y");
 }
 }
 
 
 FontEffectShadowInstancer::~FontEffectShadowInstancer()
 FontEffectShadowInstancer::~FontEffectShadowInstancer()
@@ -46,11 +46,13 @@ FontEffectShadowInstancer::~FontEffectShadowInstancer()
 }
 }
 
 
 // Instances an outline font effect.
 // Instances an outline font effect.
-FontEffect* FontEffectShadowInstancer::InstanceFontEffect(const String& name, const PropertyDictionary& properties)
+FontEffect* FontEffectShadowInstancer::InstanceFontEffect(const String& ROCKET_UNUSED_PARAMETER(name), const PropertyDictionary& properties)
 {
 {
+	ROCKET_UNUSED(name);
+
 	Vector2i offset;
 	Vector2i offset;
-	offset.x = Math::RealToInteger(GetIf(properties, offset_x)->Get< float >());
-	offset.y = Math::RealToInteger(GetIf(properties, offset_y)->Get< float >());
+	offset.x = Math::RealToInteger(properties.GetProperty("offset-x")->Get< float >());
+	offset.y = Math::RealToInteger(properties.GetProperty("offset-y")->Get< float >());
 
 
 	FontEffectShadow* font_effect = new FontEffectShadow();
 	FontEffectShadow* font_effect = new FontEffectShadow();
 	if (font_effect->Initialise(offset))
 	if (font_effect->Initialise(offset))

+ 0 - 3
Source/Core/FontEffectShadowInstancer.h

@@ -56,9 +56,6 @@ public:
 
 
 	/// Releases the instancer.
 	/// Releases the instancer.
 	virtual void Release();
 	virtual void Release();
-
-private:
-	PropertyId offset_x, offset_y;
 };
 };
 
 
 }
 }

+ 0 - 288
Source/Core/ID.cpp

@@ -1,288 +0,0 @@
-/*
- * This source file is part of libRocket, the HTML/CSS Interface Middleware
- *
- * For the latest information, see http://www.librocket.com
- *
- * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
- 
-#include "precompiled.h"
-
-namespace Rocket {
-namespace Core {
-
-
-
-template <typename ID>
-class IdNameMap {
-
-	std::vector<String> name_map;  // IDs are indices into the NameMap
-	UnorderedMap<String, ID> reverse_map;
-
-protected:
-	IdNameMap(ID id_num_to_initialize) {
-		name_map.resize((size_t)id_num_to_initialize);
-		reverse_map.reserve((size_t)id_num_to_initialize);
-	}
-
-	void add(ID id, const String& name) {
-		name_map[(size_t)id] = name;
-		reverse_map.emplace(name, id);
-	}
-
-	void assert_all_inserted(ID id_num_to_initialize) const {
-		ROCKET_ASSERT(name_map.size() == (size_t)id_num_to_initialize && reverse_map.size() == (size_t)id_num_to_initialize);
-	}
-
-public:
-	ID GetId(const String& name)
-	{
-		if (auto it = reverse_map.find(ToLower(name)); it != reverse_map.end())
-			return it->second;
-		return ID::Invalid;
-	}
-	const String& GetName(ID id)
-	{
-		if (static_cast<size_t>(id) < name_map.size())
-			return name_map[static_cast<size_t>(id)];
-		return name_map[static_cast<size_t>(ID::Invalid)];
-	}
-	
-	ID CreateIdFromName(const String& name)
-	{
-		String lower = ToLower(name);
-		ID next_id = static_cast<ID>(name_map.size());
-
-		// Only insert if not already in list
-		auto [it, inserted] = reverse_map.emplace(lower, next_id);
-		if (inserted)
-			name_map.push_back(lower);
-
-		// Return the property id that already existed, or the new one if inserted
-		return it->second;
-	}
-};
-
-class PropertyIdNameMap : public IdNameMap<PropertyId>
-{
-public:
-	PropertyIdNameMap();
-};
-
-inline PropertyIdNameMap::PropertyIdNameMap() : IdNameMap(PropertyId::NumDefinedIds)
-{
-	add(PropertyId::Invalid, "invalid_property");
-	add(PropertyId::MarginTop, "margin-top");
-	add(PropertyId::MarginRight, "margin-right");
-	add(PropertyId::MarginBottom, "margin-bottom");
-	add(PropertyId::MarginLeft, "margin-left");
-	add(PropertyId::Margin, "margin");
-	add(PropertyId::PaddingTop, "padding-top");
-	add(PropertyId::PaddingRight, "padding-right");
-	add(PropertyId::PaddingBottom, "padding-bottom");
-	add(PropertyId::PaddingLeft, "padding-left");
-	add(PropertyId::Padding, "padding");
-	add(PropertyId::BorderTopWidth, "border-top-width");
-	add(PropertyId::BorderRightWidth, "border-right-width");
-	add(PropertyId::BorderBottomWidth, "border-bottom-width");
-	add(PropertyId::BorderLeftWidth, "border-left-width");
-	add(PropertyId::BorderWidth, "border-width");
-	add(PropertyId::BorderTopColor, "border-top-color");
-	add(PropertyId::BorderRightColor, "border-right-color");
-	add(PropertyId::BorderBottomColor, "border-bottom-color");
-	add(PropertyId::BorderLeftColor, "border-left-color");
-	add(PropertyId::BorderColor, "border-color");
-	add(PropertyId::BorderTop, "border-top");
-	add(PropertyId::BorderRight, "border-right");
-	add(PropertyId::BorderBottom, "border-bottom");
-	add(PropertyId::BorderLeft, "border-left");
-	add(PropertyId::Border, "border");
-	add(PropertyId::Display, "display");
-	add(PropertyId::Position, "position");
-	add(PropertyId::Top, "top");
-	add(PropertyId::Right, "right");
-	add(PropertyId::Bottom, "bottom");
-	add(PropertyId::Left, "left");
-	add(PropertyId::Float, "float");
-	add(PropertyId::Clear, "clear");
-	add(PropertyId::ZIndex, "z-index");
-	add(PropertyId::Width, "width");
-	add(PropertyId::MinWidth, "min-width");
-	add(PropertyId::MaxWidth, "max-width");
-	add(PropertyId::Height, "height");
-	add(PropertyId::MinHeight, "min-height");
-	add(PropertyId::MaxHeight, "max-height");
-	add(PropertyId::LineHeight, "line-height");
-	add(PropertyId::VerticalAlign, "vertical-align");
-	add(PropertyId::Overflow, "overflow");
-	add(PropertyId::OverflowX, "overflow-x");
-	add(PropertyId::OverflowY, "overflow-y");
-	add(PropertyId::Clip, "clip");
-	add(PropertyId::Visibility, "visibility");
-	add(PropertyId::BackgroundColor, "background-color");
-	add(PropertyId::Background, "background");
-	add(PropertyId::Color, "color");
-	add(PropertyId::ImageColor, "image-color");
-	add(PropertyId::FontFamily, "font-family");
-	add(PropertyId::FontCharset, "font-charset");
-	add(PropertyId::FontStyle, "font-style");
-	add(PropertyId::FontWeight, "font-weight");
-	add(PropertyId::FontSize, "font-size");
-	add(PropertyId::Font, "font");
-	add(PropertyId::TextAlign, "text-align");
-	add(PropertyId::TextDecoration, "text-decoration");
-	add(PropertyId::TextTransform, "text-transform");
-	add(PropertyId::WhiteSpace, "white-space");
-	add(PropertyId::Cursor, "cursor");
-	add(PropertyId::Drag, "drag");
-	add(PropertyId::TabIndex, "tab-index");
-	add(PropertyId::ScrollbarMargin, "scrollbar-margin");
-	add(PropertyId::Perspective, "perspective");
-	add(PropertyId::PerspectiveOrigin, "perspective-origin");
-	add(PropertyId::PerspectiveOriginX, "perspective-origin-x");
-	add(PropertyId::PerspectiveOriginY, "perspective-origin-y");
-	add(PropertyId::Transform, "transform");
-	add(PropertyId::TransformOrigin, "transform-origin");
-	add(PropertyId::TransformOriginX, "transform-origin-x");
-	add(PropertyId::TransformOriginY, "transform-origin-y");
-	add(PropertyId::TransformOriginZ, "transform-origin-z");
-	add(PropertyId::None, "none");
-	add(PropertyId::All, "all");
-	add(PropertyId::Transition, "transition");
-	add(PropertyId::Animation, "animation");
-	add(PropertyId::Keyframes, "keyframes");
-	add(PropertyId::ScrollDefaultStepSize, "scroll-default-step-size");
-	add(PropertyId::Opacity, "opacity");
-	add(PropertyId::PointerEvents, "pointer-events");
-	add(PropertyId::Focus, "focus");
-
-	assert_all_inserted(PropertyId::NumDefinedIds);
-}
-
-
-class EventIdNameMap : public IdNameMap<EventId>
-{
-public:
-	EventIdNameMap();
-};
-
-inline EventIdNameMap::EventIdNameMap() : IdNameMap(EventId::NumDefinedIds)
-{
-	add(EventId::Invalid, "invalid_event");
-	add(EventId::Mousedown, "mousedown");
-	add(EventId::Mousescroll, "mousescroll");
-	add(EventId::Mouseover, "mouseover");
-	add(EventId::Mouseout, "mouseout");
-	add(EventId::Focus, "focus");
-	add(EventId::Blur, "blur");
-	add(EventId::Keydown, "keydown");
-	add(EventId::Mouseup, "mouseup");
-	add(EventId::Click, "click");
-	add(EventId::Load, "load");
-	add(EventId::Unload, "unload");
-	add(EventId::Show, "show");
-	add(EventId::Hide, "hide");
-	add(EventId::Keyup, "keyup");
-	add(EventId::Textinput, "textinput");
-	add(EventId::Mousemove, "mousemove");
-	add(EventId::Dragmove, "dragmove");
-	add(EventId::Dblclick, "dblclick");
-	add(EventId::Drag, "drag");
-	add(EventId::Dragstart, "dragstart");
-	add(EventId::Dragover, "dragover");
-	add(EventId::Dragdrop, "dragdrop");
-	add(EventId::Dragout, "dragout");
-	add(EventId::Dragend, "dragend");
-	add(EventId::Handledrag, "handledrag");
-	add(EventId::Resize, "resize");
-	add(EventId::Scroll, "scroll");
-	add(EventId::Scrollchange, "scrollchange");
-	add(EventId::Animationend, "animationend");
-	add(EventId::Transitionend, "transitionend");
-
-	assert_all_inserted(EventId::NumDefinedIds);
-}
-
-static PropertyIdNameMap property_map;
-
-PropertyId GetPropertyId(const String& property_name) {
-	return property_map.GetId(property_name);
-}
-PropertyId CreateOrGetPropertyId(const String& name) {
-	return property_map.CreateIdFromName(name);
-}
-const String& GetName(PropertyId property_id) {
-	return property_map.GetName(property_id);
-}
-
-static EventIdNameMap event_map;
-
-EventId GetEventId(const String& event_name) {
-	return event_map.GetId(event_name);
-}
-EventId CreateOrGetEventId(const String& name) {
-	return event_map.CreateIdFromName(name);
-}
-const String& GetName(EventId event_id) {
-	return event_map.GetName(event_id);
-}
-
-//
-//class PseudoIdNameMap : public IdNameMap<PseudoId>
-//{
-//public:
-//	PseudoIdNameMap();
-//};
-//
-//inline PseudoIdNameMap::PseudoIdNameMap() : IdNameMap(PseudoId::NumDefinedIds)
-//{
-//	add(PseudoId::Invalid, "invalid_pseudo_class");
-//	add(PseudoId::Hover, "hover");
-//	add(PseudoId::Active, "active");
-//	add(PseudoId::Focus, "focus");
-//	add(PseudoId::Dragged, "dragged");
-//
-//	add(PseudoId::Disabled, "disabled");
-//	add(PseudoId::Selected, "selected");
-//	add(PseudoId::Checked, "checked");
-//
-//	assert_all_inserted(PseudoId::NumDefinedIds);
-//}
-//
-//
-//static PseudoIdNameMap pseudo_map;
-//
-//PseudoId GetPseudoId(const String& event_name) {
-//	return pseudo_map.GetId(event_name);
-//}
-//PseudoId GetOrCreatePseudoId(const String& name) {
-//	return pseudo_map.CreateIdFromName(name);
-//}
-//const String& GetName(PseudoId pseudo_id) {
-//	return pseudo_map.GetName(pseudo_id);
-//}
-
-
-
-}
-}

+ 3 - 3
Source/Core/LayoutBlockBox.cpp

@@ -90,7 +90,7 @@ LayoutBlockBox::LayoutBlockBox(LayoutEngine* _layout_engine, LayoutBlockBox* _pa
 			if (self_offset_parent != this)
 			if (self_offset_parent != this)
 			{
 			{
 				// Get the next position within our offset parent's containing block.
 				// Get the next position within our offset parent's containing block.
-				parent->PositionBlockBox(position, box, element->GetProperty< int >(PropertyId::Clear));
+				parent->PositionBlockBox(position, box, element->GetProperty< int >(CLEAR));
 				element->SetOffset(position - (self_offset_parent->GetPosition() - offset_root->GetPosition()), self_offset_parent->GetElement());
 				element->SetOffset(position - (self_offset_parent->GetPosition() - offset_root->GetPosition()), self_offset_parent->GetElement());
 			}
 			}
 			else
 			else
@@ -544,8 +544,8 @@ float LayoutBlockBox::InternalContentWidth() const
 		if (element)
 		if (element)
 		{
 		{
 			const Property* width = nullptr;
 			const Property* width = nullptr;
-			const Property* min_width = element->GetLocalProperty(PropertyId::MinWidth);
-			const Property* max_width = element->GetLocalProperty(PropertyId::MaxWidth);
+			const Property* min_width = element->GetLocalProperty("min-width");
+			const Property* max_width = element->GetLocalProperty("max-width");
 			element->GetLocalDimensionProperties(&width, nullptr);
 			element->GetLocalDimensionProperties(&width, nullptr);
 			if(width)
 			if(width)
 			{
 			{

+ 1 - 1
Source/Core/LayoutBlockBoxSpace.cpp

@@ -76,7 +76,7 @@ float LayoutBlockBoxSpace::PositionBox(float cursor, Element* element)
 	}
 	}
 
 
 	// Shift the cursor down past to clear boxes, if necessary.
 	// Shift the cursor down past to clear boxes, if necessary.
-	cursor = ClearBoxes(cursor, element->GetProperty< int >(PropertyId::Clear));
+	cursor = ClearBoxes(cursor, element->GetProperty< int >(CLEAR));
 
 
 	// Find a place to put this box.
 	// Find a place to put this box.
 	Vector2f element_offset;
 	Vector2f element_offset;

+ 12 - 12
Source/Core/LayoutEngine.cpp

@@ -241,13 +241,13 @@ void LayoutEngine::BuildBox(Box& box, float& min_height, float& max_height, Layo
 	float box_height = box.GetSize().y;
 	float box_height = box.GetSize().y;
 	if (box_height < 0)
 	if (box_height < 0)
 	{
 	{
-		if (element->GetLocalProperty(PropertyId::MinHeight) != NULL)
-			min_height = element->ResolveProperty(PropertyId::MinHeight, containing_block.y);
+		if (element->GetLocalProperty(MIN_HEIGHT) != NULL)
+			min_height = element->ResolveProperty(MIN_HEIGHT, containing_block.y);
 		else
 		else
 			min_height = 0;
 			min_height = 0;
 
 
-		if (element->GetLocalProperty(PropertyId::MaxHeight) != NULL)
-			max_height = element->ResolveProperty(PropertyId::MaxHeight, containing_block.y);
+		if (element->GetLocalProperty(MAX_HEIGHT) != NULL)
+			max_height = element->ResolveProperty(MAX_HEIGHT, containing_block.y);
 		else
 		else
 			max_height = FLT_MAX;
 			max_height = FLT_MAX;
 	}
 	}
@@ -263,13 +263,13 @@ float LayoutEngine::ClampWidth(float width, Element* element, float containing_b
 {
 {
 	float min_width, max_width;
 	float min_width, max_width;
 
 
-	if (element->GetLocalProperty(PropertyId::MinWidth) != NULL)
-		min_width = element->ResolveProperty(PropertyId::MinWidth, containing_block_width);
+	if (element->GetLocalProperty(MIN_WIDTH) != NULL)
+		min_width = element->ResolveProperty(MIN_WIDTH, containing_block_width);
 	else
 	else
 		min_width = 0;
 		min_width = 0;
 
 
-	if (element->GetLocalProperty(PropertyId::MaxWidth) != NULL)
-		max_width = element->ResolveProperty(PropertyId::MaxWidth, containing_block_width);
+	if (element->GetLocalProperty(MAX_WIDTH) != NULL)
+		max_width = element->ResolveProperty(MAX_WIDTH, containing_block_width);
 	else
 	else
 		max_width = FLT_MAX;
 		max_width = FLT_MAX;
 
 
@@ -281,13 +281,13 @@ float LayoutEngine::ClampHeight(float height, Element* element, float containing
 {
 {
 	float min_height, max_height;
 	float min_height, max_height;
 
 
-	if (element->GetLocalProperty(PropertyId::MinHeight) != NULL)
-		min_height = element->ResolveProperty(PropertyId::MinHeight, containing_block_height);
+	if (element->GetLocalProperty(MIN_HEIGHT) != NULL)
+		min_height = element->ResolveProperty(MIN_HEIGHT, containing_block_height);
 	else
 	else
 		min_height = 0;
 		min_height = 0;
 
 
-	if (element->GetLocalProperty(PropertyId::MaxHeight) != NULL)
-		max_height = element->ResolveProperty(PropertyId::MaxHeight, containing_block_height);
+	if (element->GetLocalProperty(MAX_HEIGHT) != NULL)
+		max_height = element->ResolveProperty(MAX_HEIGHT, containing_block_height);
 	else
 	else
 		max_height = FLT_MAX;
 		max_height = FLT_MAX;
 
 

+ 1 - 33
Source/Core/PropertyDictionary.cpp

@@ -31,37 +31,6 @@
 namespace Rocket {
 namespace Rocket {
 namespace Core {
 namespace Core {
 
 
-
-// Sets a property on the dictionary and its specificity if there is no name conflict, or its
-// specificity (given by the parameter, not read from the property itself) is at least equal to
-// the specificity of the conflicting property.
-static inline void SetProperty(PropertyDictionary& properties, PropertyId id, const Property& property, int specificity)
-{
-	PropertyMap::iterator iterator = properties.find(id);
-	if (iterator != properties.end() &&
-		iterator->second.specificity > specificity)
-		return;
-
-	Property & new_property = (properties[id] = property);
-	new_property.specificity = specificity;
-}
-
-void Merge(PropertyDictionary& destination, const PropertyDictionary& from, int specificity_offset)
-{
-	for (const auto& [id, property] : from)
-	{
-		SetProperty(destination, id, property, property.specificity + specificity_offset);
-	}
-}
-void Import(PropertyDictionary& destination, const PropertyDictionary& from, int specificity)
-{
-	for (const auto& [id, property] : from)
-	{
-		SetProperty(destination, id, property, specificity > 0 ? specificity : property.specificity);
-	}
-}
-
-#if 0
 PropertyDictionary::PropertyDictionary()
 PropertyDictionary::PropertyDictionary()
 {
 {
 }
 }
@@ -135,7 +104,6 @@ void PropertyDictionary::SetProperty(const String& name, const Rocket::Core::Pro
 	Property& new_property = (properties[name] = property);
 	Property& new_property = (properties[name] = property);
 	new_property.specificity = specificity;
 	new_property.specificity = specificity;
 }
 }
-#endif
+
 }
 }
 }
 }
-

+ 12 - 16
Source/Core/PropertyParserAnimation.cpp

@@ -227,8 +227,9 @@ static bool ParseTransition(Property & property, const StringList& transition_va
 
 
 	for (const String& single_transition_value : transition_values)
 	for (const String& single_transition_value : transition_values)
 	{
 	{
+
 		Transition transition;
 		Transition transition;
-		PropertyIdList target_property_ids;
+		StringList target_property_names;
 
 
 		StringList arguments;
 		StringList arguments;
 		StringUtilities::ExpandString(arguments, single_transition_value, ' ');
 		StringUtilities::ExpandString(arguments, single_transition_value, ' ');
@@ -258,7 +259,7 @@ static bool ParseTransition(Property & property, const StringList& transition_va
 					if (transition_list.transitions.size() > 0) // The all keyword can not be part of multiple definitions
 					if (transition_list.transitions.size() > 0) // The all keyword can not be part of multiple definitions
 						return false;
 						return false;
 					transition_list.all = true;
 					transition_list.all = true;
-					target_property_ids.insert(PropertyId::All);
+					target_property_names.push_back("all");
 				}
 				}
 				else if (it->second.type == Keyword::TWEEN)
 				else if (it->second.type == Keyword::TWEEN)
 				{
 				{
@@ -304,19 +305,17 @@ static bool ParseTransition(Property & property, const StringList& transition_va
 				}
 				}
 				else
 				else
 				{
 				{
-					PropertyId id = GetPropertyId(argument);
-
 					// Must be a property name or shorthand, expand now
 					// Must be a property name or shorthand, expand now
-					if (auto shorthand = StyleSheetSpecification::GetShorthand(id))
+					if (auto shorthand = StyleSheetSpecification::GetShorthand(argument))
 					{
 					{
 						// For shorthands, add each underlying property separately
 						// For shorthands, add each underlying property separately
 						for (const auto& property : shorthand->properties)
 						for (const auto& property : shorthand->properties)
-							target_property_ids.insert(property.first);
+							target_property_names.push_back(property.first);
 					}
 					}
-					else if (auto definition = StyleSheetSpecification::GetProperty(id))
+					else if (auto definition = StyleSheetSpecification::GetProperty(argument))
 					{
 					{
 						// Single property
 						// Single property
-						target_property_ids.insert(id);
+						target_property_names.push_back(argument);
 					}
 					}
 					else
 					else
 					{
 					{
@@ -328,19 +327,16 @@ static bool ParseTransition(Property & property, const StringList& transition_va
 		}
 		}
 
 
 		// Validate the parsed transition
 		// Validate the parsed transition
-		if (target_property_ids.empty() || transition.duration <= 0.0f || transition.reverse_adjustment_factor < 0.0f || transition.reverse_adjustment_factor > 1.0f
-			|| (transition_list.all && target_property_ids.size() != 1))
+		if (target_property_names.empty() || transition.duration <= 0.0f || transition.reverse_adjustment_factor < 0.0f || transition.reverse_adjustment_factor > 1.0f
+			|| (transition_list.all && target_property_names.size() != 1))
 		{
 		{
 			return false;
 			return false;
 		}
 		}
 
 
-		for (const auto& id : target_property_ids)
+		for (const auto& property_name : target_property_names)
 		{
 		{
-			if (id != PropertyId::Invalid)
-			{
-				transition.property_id = id;
-				transition_list.transitions.push_back(transition);
-			}
+			transition.name = property_name;
+			transition_list.transitions.push_back(transition);
 		}
 		}
 	}
 	}
 
 

+ 1 - 1
Source/Core/PropertyParserTransform.cpp

@@ -46,7 +46,7 @@ PropertyParserTransform::~PropertyParserTransform()
 // Called to parse a RCSS transform declaration.
 // Called to parse a RCSS transform declaration.
 bool PropertyParserTransform::ParseValue(Property& property, const String& value, const ParameterMap& parameters) const
 bool PropertyParserTransform::ParseValue(Property& property, const String& value, const ParameterMap& parameters) const
 {
 {
-	if(value == "none")
+	if(value == NONE)
 	{
 	{
 		property.value = Variant(TransformRef());
 		property.value = Variant(TransformRef());
 		property.unit = Property::TRANSFORM;
 		property.unit = Property::TRANSFORM;

+ 1 - 1
Source/Core/PropertyShorthandDefinition.h

@@ -41,7 +41,7 @@ class PropertyDefinition;
 
 
 struct PropertyShorthandDefinition
 struct PropertyShorthandDefinition
 {
 {
-	typedef std::vector< std::pair< PropertyId, const PropertyDefinition* > > PropertyDefinitionList;
+	typedef std::vector< std::pair< String, const PropertyDefinition* > > PropertyDefinitionList;
 
 
 	PropertyDefinitionList properties;
 	PropertyDefinitionList properties;
 	PropertySpecification::ShorthandType type;
 	PropertySpecification::ShorthandType type;

+ 51 - 49
Source/Core/PropertySpecification.cpp

@@ -50,34 +50,36 @@ PropertySpecification::~PropertySpecification()
 }
 }
 
 
 // Registers a property with a new definition.
 // Registers a property with a new definition.
-PropertyDefinition& PropertySpecification::RegisterProperty(PropertyId property_id, const String& default_value, bool inherited, bool forces_layout)
+PropertyDefinition& PropertySpecification::RegisterProperty(const String& property_name, const String& default_value, bool inherited, bool forces_layout)
 {
 {
+	String lower_case_name = ToLower(property_name);
+
 	// Create the property and validate the default value.
 	// Create the property and validate the default value.
 	PropertyDefinition* property_definition = new PropertyDefinition(default_value, inherited, forces_layout);
 	PropertyDefinition* property_definition = new PropertyDefinition(default_value, inherited, forces_layout);
 
 
 	// Delete any existing property.
 	// Delete any existing property.
-	PropertyMap::iterator iterator = properties.find(property_id);
+	PropertyMap::iterator iterator = properties.find(lower_case_name);
 	if (iterator != properties.end())
 	if (iterator != properties.end())
 	{
 	{
 		delete (*iterator).second;
 		delete (*iterator).second;
 	}
 	}
 	else
 	else
 	{
 	{
-		property_names.insert(property_id);
+		property_names.insert(lower_case_name);
 		if (inherited)
 		if (inherited)
 		{
 		{
-			inherited_property_names.insert(property_id);
+			inherited_property_names.insert(lower_case_name);
 		}
 		}
 	}
 	}
 
 
-	properties[property_id] = property_definition;
+	properties[lower_case_name] = property_definition;
 	return *property_definition;
 	return *property_definition;
 }
 }
 
 
 // Returns a property definition.
 // Returns a property definition.
-const PropertyDefinition* PropertySpecification::GetProperty(PropertyId property_id) const
+const PropertyDefinition* PropertySpecification::GetProperty(const String& property_name) const
 {
 {
-	PropertyMap::const_iterator iterator = properties.find(property_id);
+	PropertyMap::const_iterator iterator = properties.find(property_name);
 	if (iterator == properties.end())
 	if (iterator == properties.end())
 		return NULL;
 		return NULL;
 
 
@@ -85,61 +87,59 @@ const PropertyDefinition* PropertySpecification::GetProperty(PropertyId property
 }
 }
 
 
 // Fetches a list of the names of all registered property definitions.
 // Fetches a list of the names of all registered property definitions.
-const PropertyIdList& PropertySpecification::GetRegisteredProperties(void) const
+const PropertyNameList& PropertySpecification::GetRegisteredProperties(void) const
 {
 {
 	return property_names;
 	return property_names;
 }
 }
 
 
 // Fetches a list of the names of all registered property definitions.
 // Fetches a list of the names of all registered property definitions.
-const PropertyIdList& PropertySpecification::GetRegisteredInheritedProperties(void) const
+const PropertyNameList& PropertySpecification::GetRegisteredInheritedProperties(void) const
 {
 {
 	return inherited_property_names;
 	return inherited_property_names;
 }
 }
 
 
 // Registers a shorthand property definition.
 // Registers a shorthand property definition.
-bool PropertySpecification::RegisterShorthand(PropertyId shorthand_id, const PropertyIdList& property_ids, ShorthandType type)
+bool PropertySpecification::RegisterShorthand(const String& shorthand_name, const String& property_names, ShorthandType type)
 {
 {
-	if (property_ids.empty())
+	StringList properties;
+	StringUtilities::ExpandString(properties, ToLower(property_names));
+
+	if (properties.empty())
 		return false;
 		return false;
 
 
+	String lower_case_name = ToLower(shorthand_name);
+
 	// Construct the new shorthand definition and resolve its properties.
 	// Construct the new shorthand definition and resolve its properties.
 	PropertyShorthandDefinition* property_shorthand = new PropertyShorthandDefinition();
 	PropertyShorthandDefinition* property_shorthand = new PropertyShorthandDefinition();
-	for(PropertyId property_id : property_ids)
+	for (size_t i = 0; i < properties.size(); i++)
 	{
 	{
-		const PropertyDefinition* property = GetProperty(property_id);
+		const PropertyDefinition* property = GetProperty(properties[i]);
 		bool shorthand_found = false;
 		bool shorthand_found = false;
 
 
 		if (property == NULL && type == RECURSIVE)
 		if (property == NULL && type == RECURSIVE)
 		{
 		{
 			// See if recursive type points to another shorthand instead
 			// See if recursive type points to another shorthand instead
-			const PropertyShorthandDefinition* shorthand = GetShorthand(property_id);
+			const PropertyShorthandDefinition* shorthand = GetShorthand(properties[i]);
 			shorthand_found = (shorthand != NULL);
 			shorthand_found = (shorthand != NULL);
 		}
 		}
 
 
 		if (property == NULL && !shorthand_found)
 		if (property == NULL && !shorthand_found)
 		{
 		{
-			auto& shorthand_name = GetName(shorthand_id);
-			auto& property_name = GetName(property_id);
-			Log::Message(Log::LT_ERROR, "Shorthand property '%s' was registered with invalid property '%s'.", shorthand_name.c_str(), property_name.c_str());
+			Log::Message(Log::LT_ERROR, "Shorthand property '%s' was registered with invalid property '%s'.", shorthand_name.c_str(), properties[i].c_str());
 			delete property_shorthand;
 			delete property_shorthand;
 
 
 			return false;
 			return false;
 		}
 		}
-		property_shorthand->properties.emplace_back(property_id, property);
+		property_shorthand->properties.push_back(PropertyShorthandDefinition::PropertyDefinitionList::value_type(properties[i], property));
 	}
 	}
 
 
 	if (type == AUTO)
 	if (type == AUTO)
 	{
 	{
-		StringList property_names;
-		property_names.reserve(property_ids.size());
-		for (PropertyId id : property_ids)
-			property_names.push_back(GetName(id));
-
-		if (property_names.size() == 4 &&
-			property_names[0].find("-top") != String::npos &&
-			property_names[1].find("-right") != String::npos &&
-			property_names[2].find("-bottom") != String::npos &&
-			property_names[3].find("-left") != String::npos)
+		if (properties.size() == 4 &&
+			properties[0].find("-top") != String::npos &&
+			properties[1].find("-right") != String::npos &&
+			properties[2].find("-bottom") != String::npos &&
+			properties[3].find("-left") != String::npos)
 			property_shorthand->type = BOX;
 			property_shorthand->type = BOX;
 		else
 		else
 			property_shorthand->type = FALL_THROUGH;
 			property_shorthand->type = FALL_THROUGH;
@@ -147,12 +147,12 @@ bool PropertySpecification::RegisterShorthand(PropertyId shorthand_id, const Pro
 	else
 	else
 		property_shorthand->type = type;
 		property_shorthand->type = type;
 
 
-	shorthands[shorthand_id] = property_shorthand;
+	shorthands[lower_case_name] = property_shorthand;
 	return true;
 	return true;
 }
 }
 
 
 // Returns a shorthand definition.
 // Returns a shorthand definition.
-const PropertyShorthandDefinition* PropertySpecification::GetShorthand(PropertyId shorthand_name) const
+const PropertyShorthandDefinition* PropertySpecification::GetShorthand(const String& shorthand_name) const
 {
 {
 	ShorthandMap::const_iterator iterator = shorthands.find(shorthand_name);
 	ShorthandMap::const_iterator iterator = shorthands.find(shorthand_name);
 	if (iterator == shorthands.end())
 	if (iterator == shorthands.end())
@@ -164,10 +164,10 @@ const PropertyShorthandDefinition* PropertySpecification::GetShorthand(PropertyI
 // Parses a property declaration, setting any parsed and validated properties on the given dictionary.
 // Parses a property declaration, setting any parsed and validated properties on the given dictionary.
 bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& dictionary, const String& property_name, const String& property_value, const String& source_file, int source_line_number) const
 bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& dictionary, const String& property_name, const String& property_value, const String& source_file, int source_line_number) const
 {
 {
-	PropertyId property_id = CreateOrGetPropertyId(property_name);
+	String lower_case_name = ToLower(property_name);
 
 
 	// Attempt to parse as a single property.
 	// Attempt to parse as a single property.
-	const PropertyDefinition* property_definition = GetProperty(property_id);
+	const PropertyDefinition* property_definition = GetProperty(lower_case_name);
 
 
 	StringList property_values;
 	StringList property_values;
 	if (!ParsePropertyValues(property_values, property_value, property_definition == NULL) || property_values.size() == 0)
 	if (!ParsePropertyValues(property_values, property_value, property_definition == NULL) || property_values.size() == 0)
@@ -180,7 +180,7 @@ bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& diction
 		new_property.source_line_number = source_line_number;
 		new_property.source_line_number = source_line_number;
 		if (property_definition->ParseValue(new_property, property_values[0]))
 		if (property_definition->ParseValue(new_property, property_values[0]))
 		{
 		{
-			dictionary[property_id] = new_property;
+			dictionary.SetProperty(lower_case_name, new_property);
 			return true;
 			return true;
 		}
 		}
 
 
@@ -188,7 +188,7 @@ bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& diction
 	}
 	}
 
 
 	// Try as a shorthand.
 	// Try as a shorthand.
-	const PropertyShorthandDefinition* shorthand_definition = GetShorthand(property_id);
+	const PropertyShorthandDefinition* shorthand_definition = GetShorthand(lower_case_name);
 	if (shorthand_definition != NULL)
 	if (shorthand_definition != NULL)
 	{
 	{
 		// If this definition is a 'box'-style shorthand (x-top, x-right, x-bottom, x-left, etc) and there are fewer
 		// If this definition is a 'box'-style shorthand (x-top, x-right, x-bottom, x-left, etc) and there are fewer
@@ -209,7 +209,7 @@ bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& diction
 
 
 						new_property.source = source_file;
 						new_property.source = source_file;
 						new_property.source_line_number = source_line_number;
 						new_property.source_line_number = source_line_number;
-						dictionary[shorthand_definition->properties[i].first] = new_property;
+						dictionary.SetProperty(shorthand_definition->properties[i].first, new_property);
 					}
 					}
 				}
 				}
 				break;
 				break;
@@ -225,20 +225,20 @@ bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& diction
 
 
 					if (!shorthand_definition->properties[0].second->ParseValue(new_property, property_values[0]))
 					if (!shorthand_definition->properties[0].second->ParseValue(new_property, property_values[0]))
 						return false;
 						return false;
-					dictionary[shorthand_definition->properties[0].first] = new_property;
+					dictionary.SetProperty(shorthand_definition->properties[0].first, new_property);
 
 
 					if (!shorthand_definition->properties[2].second->ParseValue(new_property, property_values[0]))
 					if (!shorthand_definition->properties[2].second->ParseValue(new_property, property_values[0]))
 						return false;
 						return false;
-					dictionary[shorthand_definition->properties[2].first] = new_property;
+					dictionary.SetProperty(shorthand_definition->properties[2].first, new_property);
 
 
 					// Parse the second value into the left and right properties.
 					// Parse the second value into the left and right properties.
 					if (!shorthand_definition->properties[1].second->ParseValue(new_property, property_values[1]))
 					if (!shorthand_definition->properties[1].second->ParseValue(new_property, property_values[1]))
 						return false;
 						return false;
-					dictionary[shorthand_definition->properties[1].first] = new_property;
+					dictionary.SetProperty(shorthand_definition->properties[1].first, new_property);
 
 
 					if (!shorthand_definition->properties[3].second->ParseValue(new_property, property_values[1]))
 					if (!shorthand_definition->properties[3].second->ParseValue(new_property, property_values[1]))
 						return false;
 						return false;
-					dictionary[shorthand_definition->properties[3].first] = new_property;
+					dictionary.SetProperty(shorthand_definition->properties[3].first, new_property);
 				}
 				}
 				break;
 				break;
 
 
@@ -253,21 +253,21 @@ bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& diction
 
 
 					if (!shorthand_definition->properties[0].second->ParseValue(new_property, property_values[0]))
 					if (!shorthand_definition->properties[0].second->ParseValue(new_property, property_values[0]))
 						return false;
 						return false;
-					dictionary[shorthand_definition->properties[0].first] = new_property;
+					dictionary.SetProperty(shorthand_definition->properties[0].first, new_property);
 
 
 					// Parse the second value into the left and right properties.
 					// Parse the second value into the left and right properties.
 					if (!shorthand_definition->properties[1].second->ParseValue(new_property, property_values[1]))
 					if (!shorthand_definition->properties[1].second->ParseValue(new_property, property_values[1]))
 						return false;
 						return false;
-					dictionary[shorthand_definition->properties[1].first] = new_property;
+					dictionary.SetProperty(shorthand_definition->properties[1].first, new_property);
 
 
 					if (!shorthand_definition->properties[3].second->ParseValue(new_property, property_values[1]))
 					if (!shorthand_definition->properties[3].second->ParseValue(new_property, property_values[1]))
 						return false;
 						return false;
-					dictionary[shorthand_definition->properties[3].first] = new_property;
+					dictionary.SetProperty(shorthand_definition->properties[3].first, new_property);
 
 
 					// Parse the third value into the bottom property.
 					// Parse the third value into the bottom property.
 					if (!shorthand_definition->properties[2].second->ParseValue(new_property, property_values[2]))
 					if (!shorthand_definition->properties[2].second->ParseValue(new_property, property_values[2]))
 						return false;
 						return false;
-					dictionary[shorthand_definition->properties[2].first] = new_property;
+					dictionary.SetProperty(shorthand_definition->properties[2].first, new_property);
 				}
 				}
 				break;
 				break;
 
 
@@ -280,7 +280,7 @@ bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& diction
 
 
 			for (size_t i = 0; i < shorthand_definition->properties.size(); i++)
 			for (size_t i = 0; i < shorthand_definition->properties.size(); i++)
 			{
 			{
-				const String& property_name = GetName(shorthand_definition->properties[i].first);
+				const auto& property_name = shorthand_definition->properties[i].first;
 				result |= ParsePropertyDeclaration(dictionary, property_name, property_value, source_file, source_line_number);
 				result |= ParsePropertyDeclaration(dictionary, property_name, property_value, source_file, source_line_number);
 			}
 			}
 
 
@@ -310,7 +310,7 @@ bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& diction
 					return false;
 					return false;
 				}
 				}
 
 
-				dictionary[shorthand_definition->properties[property_index].first] = new_property;
+				dictionary.SetProperty(shorthand_definition->properties[property_index].first, new_property);
 
 
 				// Increment the value index, unless we're replicating the last value and we're up to the last value.
 				// Increment the value index, unless we're replicating the last value and we're up to the last value.
 				if (shorthand_definition->type != REPLICATE ||
 				if (shorthand_definition->type != REPLICATE ||
@@ -326,7 +326,7 @@ bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& diction
 	Property new_property(property_value, Property::UNKNOWN);
 	Property new_property(property_value, Property::UNKNOWN);
 	new_property.source = source_file;
 	new_property.source = source_file;
 	new_property.source_line_number = source_line_number;
 	new_property.source_line_number = source_line_number;
-	dictionary[property_id] = new_property;
+	dictionary.SetProperty(lower_case_name, new_property);
 
 
 	return true;
 	return true;
 }
 }
@@ -334,9 +334,11 @@ bool PropertySpecification::ParsePropertyDeclaration(PropertyDictionary& diction
 // Sets all undefined properties in the dictionary to their defaults.
 // Sets all undefined properties in the dictionary to their defaults.
 void PropertySpecification::SetPropertyDefaults(PropertyDictionary& dictionary) const
 void PropertySpecification::SetPropertyDefaults(PropertyDictionary& dictionary) const
 {
 {
-	for (auto& [id, value] : properties)
-		if (auto it = dictionary.find(id); it == dictionary.end())
-			dictionary[id] = *value->GetDefaultValue();
+	for (PropertyMap::const_iterator i = properties.begin(); i != properties.end(); ++i)
+	{
+		if (dictionary.GetProperty((*i).first) == NULL)
+			dictionary.SetProperty((*i).first, *(*i).second->GetDefaultValue());
+	}
 }
 }
 
 
 bool PropertySpecification::ParsePropertyValues(StringList& values_list, const String& values, bool split_values) const
 bool PropertySpecification::ParsePropertyValues(StringList& values_list, const String& values, bool split_values) const

+ 140 - 0
Source/Core/StringCache.cpp

@@ -0,0 +1,140 @@
+/*
+ * This source file is part of libRocket, the HTML/CSS Interface Middleware
+ *
+ * For the latest information, see http://www.librocket.com
+ *
+ * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ */
+
+ 
+#include "precompiled.h"
+
+namespace Rocket {
+namespace Core {
+
+const String MARGIN_TOP = "margin-top";
+const String MARGIN_RIGHT = "margin-right";
+const String MARGIN_BOTTOM = "margin-bottom";
+const String MARGIN_LEFT = "margin-left";
+const String MARGIN = "margin";
+const String PADDING_TOP = "padding-top";
+const String PADDING_RIGHT = "padding-right";
+const String PADDING_BOTTOM = "padding-bottom";
+const String PADDING_LEFT = "padding-left";
+const String PADDING = "padding";
+const String BORDER_TOP_WIDTH = "border-top-width";
+const String BORDER_RIGHT_WIDTH = "border-right-width";
+const String BORDER_BOTTOM_WIDTH = "border-bottom-width";
+const String BORDER_LEFT_WIDTH = "border-left-width";
+const String BORDER_WIDTH = "border-width";
+const String BORDER_TOP_COLOR = "border-top-color";
+const String BORDER_RIGHT_COLOR = "border-right-color";
+const String BORDER_BOTTOM_COLOR = "border-bottom-color";
+const String BORDER_LEFT_COLOR = "border-left-color";
+const String BORDER_COLOR = "border-color";
+const String BORDER_TOP = "border-top";
+const String BORDER_RIGHT = "border-right";
+const String BORDER_BOTTOM = "border-bottom";
+const String BORDER_LEFT = "border-left";
+const String BORDER = "border";
+const String DISPLAY = "display";
+const String POSITION = "position";
+const String TOP = "top";
+const String RIGHT = "right";
+const String BOTTOM = "bottom";
+const String LEFT = "left";
+const String FLOAT = "float";
+const String CLEAR = "clear";
+const String Z_INDEX = "z-index";
+const String WIDTH = "width";
+const String MIN_WIDTH = "min-width";
+const String MAX_WIDTH = "max-width";
+const String HEIGHT = "height";
+const String MIN_HEIGHT = "min-height";
+const String MAX_HEIGHT = "max-height";
+const String LINE_HEIGHT = "line-height";
+const String VERTICAL_ALIGN = "vertical-align";
+const String OVERFLOW_X = "overflow-x";
+const String OVERFLOW_Y = "overflow-y";
+const String CLIP = "clip";
+const String VISIBILITY = "visibility";
+const String BACKGROUND_COLOR = "background-color";
+const String BACKGROUND = "background";
+const String COLOR = "color";
+const String IMAGE_COLOR = "image-color";
+const String FONT_FAMILY = "font-family";
+const String FONT_CHARSET = "font-charset";
+const String FONT_STYLE = "font-style";
+const String FONT_WEIGHT = "font-weight";
+const String FONT_SIZE = "font-size";
+const String FONT = "font";
+const String TEXT_ALIGN = "text-align";
+const String TEXT_DECORATION = "text-decoration";
+const String TEXT_TRANSFORM = "text-transform";
+const String WHITE_SPACE = "white-space";
+const String CURSOR = "cursor";
+const String DRAG = "drag";
+const String TAB_INDEX = "tab-index";
+const String SCROLLBAR_MARGIN = "scrollbar-margin";
+const String PERSPECTIVE = "perspective";
+const String PERSPECTIVE_ORIGIN = "perspective-origin";
+const String PERSPECTIVE_ORIGIN_X = "perspective-origin-x";
+const String PERSPECTIVE_ORIGIN_Y = "perspective-origin-y";
+const String TRANSFORM = "transform";
+const String TRANSFORM_ORIGIN = "transform-origin";
+const String TRANSFORM_ORIGIN_X = "transform-origin-x";
+const String TRANSFORM_ORIGIN_Y = "transform-origin-y";
+const String TRANSFORM_ORIGIN_Z = "transform-origin-z";
+const String NONE = "none";
+const String TRANSITION = "transition";
+const String ANIMATION = "animation";
+const String KEYFRAMES = "keyframes";
+const String SCROLL_DEFAULT_STEP_SIZE = "scroll-default-step-size";
+const String OPACITY = "opacity";
+const String POINTER_EVENTS = "pointer-events";
+const String MOUSEDOWN = "mousedown";
+const String MOUSESCROLL = "mousescroll";
+const String MOUSEOVER = "mouseover";
+const String MOUSEOUT = "mouseout";
+const String FOCUS = "focus";
+const String BLUR = "blur";
+const String KEYDOWN = "keydown";
+const String MOUSEUP = "mouseup";
+const String CLICK = "click";
+const String DRAGSTART = "dragstart";
+const String DRAGOVER = "dragover";
+const String LOAD = "load";
+const String UNLOAD = "unload";
+const String KEYUP = "keyup";
+const String TEXTINPUT = "textinput";
+const String MOUSEMOVE = "mousemove";
+const String DRAGMOVE = "dragmove";
+const String DBLCLICK = "dblclick";
+const String DRAGDROP = "dragdrop";
+const String DRAGOUT = "dragout";
+const String DRAGEND = "dragend";
+const String RESIZE = "resize";
+const String ANIMATIONEND = "animationend";
+const String TRANSITIONEND = "transitionend";
+
+}
+}

+ 149 - 0
Source/Core/StringCache.h

@@ -0,0 +1,149 @@
+/*
+ * This source file is part of libRocket, the HTML/CSS Interface Middleware
+ *
+ * For the latest information, see http://www.librocket.com
+ *
+ * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ */
+
+ 
+#ifndef ROCKETCORESTRINGCACHE_H
+#define ROCKETCORESTRINGCACHE_H
+
+#include "../../Include/Rocket/Core/String.h"
+
+namespace Rocket {
+namespace Core {
+
+extern const String MARGIN_TOP;
+extern const String MARGIN_RIGHT;
+extern const String MARGIN_BOTTOM;
+extern const String MARGIN_LEFT;
+extern const String MARGIN;
+extern const String PADDING_TOP;
+extern const String PADDING_RIGHT;
+extern const String PADDING_BOTTOM;
+extern const String PADDING_LEFT;
+extern const String PADDING;
+extern const String BORDER_TOP_WIDTH;
+extern const String BORDER_RIGHT_WIDTH;
+extern const String BORDER_BOTTOM_WIDTH;
+extern const String BORDER_LEFT_WIDTH;
+extern const String BORDER_WIDTH;
+extern const String BORDER_TOP_COLOR;
+extern const String BORDER_RIGHT_COLOR;
+extern const String BORDER_BOTTOM_COLOR;
+extern const String BORDER_LEFT_COLOR;
+extern const String BORDER_COLOR;
+extern const String BORDER_TOP;
+extern const String BORDER_RIGHT;
+extern const String BORDER_BOTTOM;
+extern const String BORDER_LEFT;
+extern const String BORDER;
+extern const String DISPLAY;
+extern const String POSITION;
+extern const String TOP;
+extern const String RIGHT;
+extern const String BOTTOM;
+extern const String LEFT;
+extern const String FLOAT;
+extern const String CLEAR;
+extern const String Z_INDEX;
+extern const String WIDTH;
+extern const String MIN_WIDTH;
+extern const String MAX_WIDTH;
+extern const String HEIGHT;
+extern const String MIN_HEIGHT;
+extern const String MAX_HEIGHT;
+extern const String LINE_HEIGHT;
+extern const String VERTICAL_ALIGN;
+extern const String OVERFLOW_X;
+extern const String OVERFLOW_Y;
+extern const String CLIP;
+extern const String VISIBILITY;
+extern const String BACKGROUND_COLOR;
+extern const String BACKGROUND;
+extern const String COLOR;
+extern const String IMAGE_COLOR;
+extern const String FONT_FAMILY;
+extern const String FONT_CHARSET;
+extern const String FONT_STYLE;
+extern const String FONT_WEIGHT;
+extern const String FONT_SIZE;
+extern const String FONT;
+extern const String TEXT_ALIGN;
+extern const String TEXT_DECORATION;
+extern const String TEXT_TRANSFORM;
+extern const String WHITE_SPACE;
+extern const String CURSOR;
+extern const String DRAG;
+extern const String TAB_INDEX;
+extern const String SCROLLBAR_MARGIN;
+
+extern const String PERSPECTIVE;
+extern const String PERSPECTIVE_ORIGIN;
+extern const String PERSPECTIVE_ORIGIN_X;
+extern const String PERSPECTIVE_ORIGIN_Y;
+extern const String TRANSFORM;
+extern const String TRANSFORM_ORIGIN;
+extern const String TRANSFORM_ORIGIN_X;
+extern const String TRANSFORM_ORIGIN_Y;
+extern const String TRANSFORM_ORIGIN_Z;
+extern const String NONE;
+
+extern const String TRANSITION;
+extern const String ANIMATION;
+extern const String KEYFRAMES;
+
+extern const String SCROLL_DEFAULT_STEP_SIZE;
+extern const String OPACITY;
+extern const String POINTER_EVENTS;
+
+extern const String MOUSEDOWN;
+extern const String MOUSESCROLL;
+extern const String MOUSEOVER;
+extern const String MOUSEOUT;
+extern const String FOCUS;
+extern const String BLUR;
+extern const String KEYDOWN;
+extern const String MOUSEUP;
+extern const String CLICK;
+extern const String DRAGSTART;
+extern const String LOAD;
+extern const String UNLOAD;
+extern const String KEYUP;
+extern const String TEXTINPUT;
+extern const String MOUSEMOVE;
+extern const String DRAGMOVE;
+extern const String DBLCLICK;
+extern const String DRAGDROP;
+extern const String DRAGOUT;
+extern const String DRAGEND;
+extern const String DRAGOVER;
+extern const String RESIZE;
+extern const String ANIMATIONEND;
+extern const String TRANSITIONEND;
+
+}
+}
+
+#endif

+ 11 - 8
Source/Core/StyleSheetNode.cpp

@@ -72,7 +72,7 @@ StyleSheetNode::~StyleSheetNode()
 // Writes the style sheet node (and all ancestors) into the stream.
 // Writes the style sheet node (and all ancestors) into the stream.
 void StyleSheetNode::Write(Stream* stream)
 void StyleSheetNode::Write(Stream* stream)
 {
 {
-	if (properties.size() > 0)
+	if (properties.GetNumProperties() > 0)
 	{
 	{
 		String rule;
 		String rule;
 		StyleSheetNode* hierarchy = this;
 		StyleSheetNode* hierarchy = this;
@@ -110,9 +110,12 @@ void StyleSheetNode::Write(Stream* stream)
 		stream->Write(CreateString(1024, "%s /* specificity: %d */\n", StringUtilities::StripWhitespace(rule).c_str(), specificity));
 		stream->Write(CreateString(1024, "%s /* specificity: %d */\n", StringUtilities::StripWhitespace(rule).c_str(), specificity));
 		stream->Write("{\n");
 		stream->Write("{\n");
 
 
-		for (const auto& [id, property] : properties)
+		const Rocket::Core::PropertyMap& property_map = properties.GetProperties();
+		for (Rocket::Core::PropertyMap::const_iterator i = property_map.begin(); i != property_map.end(); ++i)
 		{
 		{
-			const String& name = Rocket::Core::GetName(id);
+			const String& name = i->first;
+			const Rocket::Core::Property& property = i->second;
+
 			stream->Write(CreateString(1024, "\t%s: %s; /* specificity: %d */\n", name.c_str(), property.value.Get< String >().c_str(), property.specificity));
 			stream->Write(CreateString(1024, "\t%s: %s; /* specificity: %d */\n", name.c_str(), property.value.Get< String >().c_str(), property.specificity));
 		}
 		}
 
 
@@ -163,7 +166,7 @@ void StyleSheetNode::BuildIndex(StyleSheet::NodeIndex& styled_index, StyleSheet:
 
 
 	// If we are a styled node (ie, have some style attributes attached), then we insert our closest parent tag node
 	// If we are a styled node (ie, have some style attributes attached), then we insert our closest parent tag node
 	// into the list of styled tag nodes.
 	// into the list of styled tag nodes.
-	if (properties.size() > 0)
+	if (properties.GetNumProperties() > 0)
 	{
 	{
 		StyleSheetNode* tag_node = this;
 		StyleSheetNode* tag_node = this;
 		while (tag_node != NULL &&
 		while (tag_node != NULL &&
@@ -203,14 +206,14 @@ int StyleSheetNode::GetSpecificity() const
 // properties.
 // properties.
 void StyleSheetNode::ImportProperties(const PropertyDictionary& _properties, int rule_specificity)
 void StyleSheetNode::ImportProperties(const PropertyDictionary& _properties, int rule_specificity)
 {
 {
-	Import(properties, _properties, specificity + rule_specificity);
+	properties.Import(_properties, specificity + rule_specificity);
 }
 }
 
 
 // Merges properties from another node (ie, with potentially differing specificities) into the
 // Merges properties from another node (ie, with potentially differing specificities) into the
 // node's properties.
 // node's properties.
 void StyleSheetNode::MergeProperties(const PropertyDictionary& _properties, int rule_specificity_offset)
 void StyleSheetNode::MergeProperties(const PropertyDictionary& _properties, int rule_specificity_offset)
 {
 {
-	Merge(properties, _properties, specificity + rule_specificity_offset);
+	properties.Merge(_properties, rule_specificity_offset);
 }
 }
 
 
 // Returns the node's default properties.
 // Returns the node's default properties.
@@ -439,7 +442,7 @@ void StyleSheetNode::GetApplicableDescendants(std::vector< const StyleSheetNode*
 		break;
 		break;
 	}
 	}
 
 
-	if (properties.size() > 0 ||
+	if (properties.GetNumProperties() > 0 ||
 		!children[PSEUDO_CLASS].empty())
 		!children[PSEUDO_CLASS].empty())
 		applicable_nodes.push_back(this);
 		applicable_nodes.push_back(this);
 
 
@@ -561,7 +564,7 @@ void StyleSheetNode::GetPseudoClassProperties(PseudoClassPropertyMap& pseudo_cla
 	StringList pseudo_classes(ancestor_pseudo_classes);
 	StringList pseudo_classes(ancestor_pseudo_classes);
 	pseudo_classes.push_back(name);
 	pseudo_classes.push_back(name);
 
 
-	if (properties.size() > 0)
+	if (properties.GetNumProperties() > 0)
 		pseudo_class_properties[pseudo_classes] = properties;
 		pseudo_class_properties[pseudo_classes] = properties;
 
 
 	for (NodeMap::const_iterator i = children[PSEUDO_CLASS].begin(); i != children[PSEUDO_CLASS].end(); ++i)
 	for (NodeMap::const_iterator i = children[PSEUDO_CLASS].begin(); i != children[PSEUDO_CLASS].end(); ++i)

+ 13 - 10
Source/Core/StyleSheetParser.cpp

@@ -78,18 +78,22 @@ static void PostprocessKeyframes(KeyframesMap& keyframes_map)
 	{
 	{
 		Keyframes& keyframes = keyframes_pair.second;
 		Keyframes& keyframes = keyframes_pair.second;
 		auto& blocks = keyframes.blocks;
 		auto& blocks = keyframes.blocks;
-		auto& property_ids = keyframes.property_ids;
+		auto& property_names = keyframes.property_names;
 
 
 		// Sort keyframes on selector value.
 		// Sort keyframes on selector value.
 		std::sort(blocks.begin(), blocks.end(), [](const KeyframeBlock& a, const KeyframeBlock& b) { return a.normalized_time < b.normalized_time; });
 		std::sort(blocks.begin(), blocks.end(), [](const KeyframeBlock& a, const KeyframeBlock& b) { return a.normalized_time < b.normalized_time; });
 
 
 		// Add all property names specified by any block
 		// Add all property names specified by any block
-		if(blocks.size() > 0) property_ids.reserve(blocks.size() * blocks[0].properties.size());
+		if(blocks.size() > 0) property_names.reserve(blocks.size() * blocks[0].properties.GetNumProperties());
 		for(auto& block : blocks)
 		for(auto& block : blocks)
 		{
 		{
-			for (auto& property : block.properties)
-				property_ids.insert(property.first);
+			for (auto& property : block.properties.GetProperties())
+				property_names.push_back(property.first);
 		}
 		}
+		// Remove duplicate property names
+		std::sort(property_names.begin(), property_names.end());
+		property_names.erase(std::unique(property_names.begin(), property_names.end()), property_names.end());
+		property_names.shrink_to_fit();
 	}
 	}
 
 
 }
 }
@@ -102,7 +106,7 @@ bool StyleSheetParser::ParseKeyframeBlock(KeyframesMap& keyframes_map, const Str
 		Log::Message(Log::LT_WARNING, "Invalid keyframes identifier '%s' at %s:%d", identifier.c_str(), stream_file_name.c_str(), line_number);
 		Log::Message(Log::LT_WARNING, "Invalid keyframes identifier '%s' at %s:%d", identifier.c_str(), stream_file_name.c_str(), line_number);
 		return false;
 		return false;
 	}
 	}
-	if (properties.size() == 0)
+	if (properties.GetNumProperties() == 0)
 		return true;
 		return true;
 
 
 	StringList rule_list;
 	StringList rule_list;
@@ -138,7 +142,7 @@ bool StyleSheetParser::ParseKeyframeBlock(KeyframesMap& keyframes_map, const Str
 		auto it = std::find_if(keyframes.blocks.begin(), keyframes.blocks.end(), [selector](const KeyframeBlock& keyframe_block) { return Math::AbsoluteValue(keyframe_block.normalized_time - selector) < 0.0001f; });
 		auto it = std::find_if(keyframes.blocks.begin(), keyframes.blocks.end(), [selector](const KeyframeBlock& keyframe_block) { return Math::AbsoluteValue(keyframe_block.normalized_time - selector) < 0.0001f; });
 		if (it == keyframes.blocks.end())
 		if (it == keyframes.blocks.end())
 		{
 		{
-			keyframes.blocks.emplace_back( selector );
+			keyframes.blocks.push_back(KeyframeBlock{ selector });
 			it = (keyframes.blocks.end() - 1);
 			it = (keyframes.blocks.end() - 1);
 		}
 		}
 		else
 		else
@@ -147,7 +151,7 @@ bool StyleSheetParser::ParseKeyframeBlock(KeyframesMap& keyframes_map, const Str
 			it->properties = PropertyDictionary();
 			it->properties = PropertyDictionary();
 		}
 		}
 
 
-		Import(it->properties, properties);
+		it->properties.Import(properties);
 	}
 	}
 
 
 	return true;
 	return true;
@@ -205,11 +209,10 @@ int StyleSheetParser::Parse(StyleSheetNode* node, KeyframesMap& keyframes, Strea
 			{
 			{
 				if (token == '{')
 				if (token == '{')
 				{
 				{
-					static const String& keyframes_str = GetName(PropertyId::Keyframes);
 					keyframes_identifier.clear();
 					keyframes_identifier.clear();
-					if (pre_token_str.substr(0, keyframes_str.size()) == keyframes_str)
+					if (pre_token_str.substr(0, KEYFRAMES.size()) == KEYFRAMES)
 					{
 					{
-						keyframes_identifier = StringUtilities::StripWhitespace(pre_token_str.substr(keyframes_str.size()));
+						keyframes_identifier = StringUtilities::StripWhitespace(pre_token_str.substr(KEYFRAMES.size()));
 					}
 					}
 					state = State::KeyframesRules;
 					state = State::KeyframesRules;
 				}
 				}

Some files were not shown because too many files changed in this diff