Pārlūkot izejas kodu

Fix some in-source documentation for typos and wrong parameters

Michael Ragazzon 1 gadu atpakaļ
vecāks
revīzija
ac7a1dcf9b

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

@@ -166,7 +166,7 @@ public:
 	/// @return The element's baseline. The default element will return 0.
 	virtual float GetBaseline() const;
 	/// Gets the intrinsic dimensions of this element, if it is a replaced element with an inherent size. This size will
-	/// only be overriden by a styled width or height.
+	/// only be overridden by a styled width or height.
 	/// @param[out] dimensions The dimensions to size, if appropriate.
 	/// @param[out] ratio The intrinsic ratio (width/height), if appropriate.
 	/// @return True if the element is a replaced element with intrinsic dimensions, false otherwise.
@@ -289,7 +289,7 @@ public:
 	bool IsPseudoClassSet(const String& pseudo_class) const;
 	/// Checks if a complete set of pseudo-classes are set on the element.
 	/// @param[in] pseudo_classes The list of pseudo-classes to check for.
-	/// @return True if all of the pseudo-classes are set, false if not.
+	/// @return True if all the pseudo-classes are set, false if not.
 	bool ArePseudoClassesSet(const StringList& pseudo_classes) const;
 	/// Gets a list of the current active pseudo-classes.
 	/// @return The list of active pseudo-classes.
@@ -333,8 +333,8 @@ public:
 	int GetNumAttributes() const;
 	//@}
 
-	/// Gets the outer-most focus element down the tree from this node.
-	/// @return Outer-most focus element.
+	/// Gets the outermost focus element down the tree from this node.
+	/// @return Outermost focus element.
 	Element* GetFocusLeafNode();
 
 	/// Returns the element's context.
@@ -410,10 +410,10 @@ public:
 	/// @param[in] scroll_top The element's new top scroll offset.
 	void SetScrollTop(float scroll_top);
 	/// Gets the width of the scrollable content of the element; it includes the element padding but not its margin.
-	/// @return The width (in pixels) of the of the scrollable content of the element.
+	/// @return The width (in pixels) of the scrollable content of the element.
 	float GetScrollWidth();
 	/// Gets the height of the scrollable content of the element; it includes the element padding but not its margin.
-	/// @return The height (in pixels) of the of the scrollable content of the element.
+	/// @return The height (in pixels) of the scrollable content of the element.
 	float GetScrollHeight();
 
 	/// Gets the object representing the declarations of an element's style attributes.
@@ -476,7 +476,7 @@ public:
 	/// @param[in] focus_visible True to indicate that the focus should be visually indicated by setting the ':focus-visible' pseudo class.
 	/// @return True if the change focus request was successful
 	bool Focus(bool focus_visible = false);
-	/// Removes focus from from this element.
+	/// Removes focus from this element.
 	void Blur();
 	/// Fakes a mouse click on this element.
 	void Click();
@@ -486,11 +486,11 @@ public:
 	/// @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.
 	/// @lifetime The added listener must stay alive until after the dispatched call from EventListener::OnDetach(). This occurs
-	///     eg. when the element is destroyed or when RemoveEventListener() is called with the same parameters passed here.
+	///     e.g. when the element is destroyed or when RemoveEventListener() is called with the same parameters passed here.
 	void AddEventListener(const String& event, EventListener* listener, bool in_capture_phase = false);
 	/// Adds an event listener to this element by id.
 	/// @lifetime The added listener must stay alive until after the dispatched call from EventListener::OnDetach(). This occurs
-	///     eg. when the element is destroyed or when RemoveEventListener() is called with the same parameters passed here.
+	///     e.g. when the element is destroyed or when RemoveEventListener() is called with the same parameters passed here.
 	void AddEventListener(EventId id, EventListener* listener, bool in_capture_phase = false);
 	/// Removes an event listener from this element.
 	/// @param[in] event Event to detach from.
@@ -526,10 +526,10 @@ public:
 	/// @param[in] element The element to append as a child.
 	/// @param[in] dom_element True if the element is to be part of the DOM, false otherwise. Only set this to false if you know what you're doing!
 	Element* AppendChild(ElementPtr element, bool dom_element = true);
-	/// Adds a child to this element, directly after the adjacent element. The new element inherits the DOM/non-DOM
+	/// Adds a child to this element directly before the adjacent element. The new element inherits the DOM/non-DOM
 	/// status from the adjacent element.
-	/// @param[in] element Element to insert into the this element.
-	/// @param[in] adjacent_element The element to insert directly before.
+	/// @param[in] element Element to be inserted.
+	/// @param[in] adjacent_element The reference element which the new element will be inserted before.
 	Element* InsertBefore(ElementPtr element, Element* adjacent_element);
 	/// Replaces the second node with the first node.
 	/// @param[in] inserted_element The element that will be inserted and replace the other element.
@@ -545,7 +545,7 @@ public:
 	bool HasChildNodes() const;
 
 	/// Get a child element by its ID.
-	/// @param[in] id Id of the the child element
+	/// @param[in] id The ID of the child element.
 	/// @return The child of this element with the given ID, or nullptr if no such child exists.
 	Element* GetElementById(const String& id);
 	/// Get all descendant elements with the given tag.
@@ -662,7 +662,7 @@ protected:
 	static void OverridePseudoClass(Element* target_element, const String& pseudo_class, bool activate);
 
 	enum class DirtyNodes { Self, SelfAndSiblings };
-	// Dirty the element style definition, including all descendants of the specificed nodes.
+	// Dirty the element style definition, including all descendants of the specified nodes.
 	void DirtyDefinition(DirtyNodes dirty_nodes);
 
 	void SetOwnerDocument(ElementDocument* document);

+ 5 - 4
Include/RmlUi/Core/Factory.h

@@ -128,7 +128,7 @@ public:
 	static void RegisterDecoratorInstancer(const String& name, DecoratorInstancer* instancer);
 	/// Retrieves a decorator instancer registered with the factory.
 	/// @param[in] name The name of the desired decorator type.
-	/// @return The decorator instancer it it exists, nullptr otherwise.
+	/// @return The decorator instancer if it exists, nullptr otherwise.
 	static DecoratorInstancer* GetDecoratorInstancer(const String& name);
 
 	/// Registers a non-owning pointer to an instancer that will be used to instance filters.
@@ -138,7 +138,7 @@ public:
 	static void RegisterFilterInstancer(const String& name, FilterInstancer* instancer);
 	/// Retrieves a filter instancer registered with the factory.
 	/// @param[in] name The name of the desired filter type.
-	/// @return The filter instancer it it exists, nullptr otherwise.
+	/// @return The filter instancer if it exists, nullptr otherwise.
 	static FilterInstancer* GetFilterInstancer(const String& name);
 
 	/// Registers a non-owning pointer to an instancer that will be used to instance font effects.
@@ -148,7 +148,7 @@ public:
 	static void RegisterFontEffectInstancer(const String& name, FontEffectInstancer* instancer);
 	/// Retrieves a font-effect instancer registered with the factory.
 	/// @param[in] name The name of the desired font-effect type.
-	/// @return The font-effect instancer it it exists, nullptr otherwise.
+	/// @return The font-effect instancer if it exists, nullptr otherwise.
 	static FontEffectInstancer* GetFontEffectInstancer(const String& name);
 
 	/// Creates a style sheet from a user-generated string.
@@ -159,7 +159,7 @@ public:
 	/// @param[in] file_name The location of the style sheet file.
 	/// @return A pointer to the newly created style sheet.
 	static SharedPtr<StyleSheetContainer> InstanceStyleSheetFile(const String& file_name);
-	/// Creates a style sheet from an Stream.
+	/// Creates a style sheet from a Stream.
 	/// @param[in] stream A pointer to the stream containing the style sheet's contents.
 	/// @return A pointer to the newly created style sheet.
 	static SharedPtr<StyleSheetContainer> InstanceStyleSheetStream(Stream* stream);
@@ -186,6 +186,7 @@ public:
 	static void RegisterEventListenerInstancer(EventListenerInstancer* instancer);
 	/// Instance an event listener with the given string. This is used for instancing listeners for the on* events from RML.
 	/// @param[in] value The parameters to the event listener.
+	/// @param[in] element The element that initiates the call to the instancer.
 	/// @return The instanced event listener.
 	static EventListener* InstanceEventListener(const String& value, Element* element);
 

+ 3 - 6
Include/RmlUi/Core/StyleSheetSpecification.h

@@ -83,10 +83,10 @@ public:
 
 	/// Registers a custom shorthand property definition.
 	/// @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] property_names 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 True if all the property names exist, false otherwise.
+	/// @return The new shorthand ID if successfully parsed, Invalid otherwise.
 	static ShorthandId RegisterShorthand(const String& shorthand_name, const String& property_names, ShorthandType type);
 	/// Returns a shorthand definition.
 	/// @param[in] shorthand_name The name of the desired shorthand.
@@ -98,9 +98,6 @@ public:
 	/// @param[in] dictionary The property dictionary which will hold all declared properties.
 	/// @param[in] property_name The name of the declared property.
 	/// @param[in] property_value The values the property is being set to.
-	/// @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.
 	/// @return True if all properties were parsed successfully, false otherwise.
 	static bool ParsePropertyDeclaration(PropertyDictionary& dictionary, const String& property_name, const String& property_value);
 

+ 5 - 5
Source/Core/ElementStyle.h

@@ -61,7 +61,7 @@ public:
 	/// @param[in] pseudo_class The pseudo class to activate or deactivate.
 	/// @param[in] activate True if the pseudo class is to be activated, false to be deactivated.
 	/// @param[in] override_class True to activate or deactivate the override state of the pseudo class, for advanced use cases.
-	/// @note An overriden pseudo class means that it will act as if activated even when it has been cleared the normal way.
+	/// @note An overridden pseudo class means that it will act as if activated even when it has been cleared the normal way.
 	/// @return True if the pseudo class was changed.
 	bool SetPseudoClass(const String& pseudo_class, bool activate, bool override_class = false);
 	/// Checks if a specific pseudo-class has been set on the element.
@@ -90,21 +90,21 @@ public:
 	const StringList& GetClassNameList() const;
 
 	/// Sets a local property override on the element to a pre-parsed value.
-	/// @param[in] name The name of the new property.
+	/// @param[in] id The ID  of the new property.
 	/// @param[in] property The parsed property to set.
 	bool SetProperty(PropertyId id, const Property& property);
 	/// Removes a local property override on the element; its value will revert to that defined in
 	/// the style sheet.
-	/// @param[in] name The name of the local property definition to remove.
+	/// @param[in] id The ID of the local property definition to remove.
 	void RemoveProperty(PropertyId id);
 	/// 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.
-	/// @param[in] name The name of the property to fetch the value for.
+	/// @param[in] id The ID of the property to fetch the value for.
 	/// @return The value of this property for this element, or nullptr if no property exists with the given name.
 	const Property* GetProperty(PropertyId id) const;
 	/// Returns one of this element's properties. If this element is not defined this property, nullptr will be
 	/// returned.
-	/// @param[in] name The name of the property to fetch the value for.
+	/// @param[in] id The ID of the property to fetch the value for.
 	/// @return The value of this property for this element, or nullptr if this property has not been explicitly defined for this element.
 	const Property* GetLocalProperty(PropertyId id) const;
 	/// Returns the local style properties, excluding any properties from local class.