ElementDefinition.cpp 725 B

123456789101112131415161718192021222324252627
  1. #include "ElementDefinition.h"
  2. #include "../../Include/RmlUi/Core/PropertyIdSet.h"
  3. #include "StyleSheetNode.h"
  4. namespace Rml {
  5. ElementDefinition::ElementDefinition(const Vector<const StyleSheetNode*>& style_sheet_nodes)
  6. {
  7. // Initialises the element definition from the list of style sheet nodes.
  8. for (size_t i = 0; i < style_sheet_nodes.size(); ++i)
  9. properties.Merge(style_sheet_nodes[i]->GetProperties());
  10. for (auto& property : properties.GetProperties())
  11. property_ids.Insert(property.first);
  12. }
  13. const Property* ElementDefinition::GetProperty(PropertyId id) const
  14. {
  15. return properties.GetProperty(id);
  16. }
  17. const PropertyIdSet& ElementDefinition::GetPropertyIds() const
  18. {
  19. return property_ids;
  20. }
  21. } // namespace Rml