Skip to content

Commit 7158504

Browse files
committed
Review inline documentation to fix spelling and improve grammar
1 parent 843b5c1 commit 7158504

21 files changed

+107
-112
lines changed

Backends/RmlUi_Renderer_GL3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,8 +1089,8 @@ void RenderInterface_GL3::ReleaseGeometry(Rml::CompiledGeometryHandle handle)
10891089
delete geometry;
10901090
}
10911091

1092-
/// Flip vertical axis of the rectangle, and move its origin to the vertically opposite side of the viewport.
1093-
/// @note Changes coordinate system from RmlUi to OpenGL, or equivalently in reverse.
1092+
/// Flip the vertical axis of the rectangle, and move its origin to the vertically opposite side of the viewport.
1093+
/// @note Changes the coordinate system from RmlUi to OpenGL, or equivalently in reverse.
10941094
/// @note The Rectangle::Top and Rectangle::Bottom members will have reverse meaning in the returned rectangle.
10951095
static Rml::Rectanglei VerticallyFlipped(Rml::Rectanglei rect, int viewport_height)
10961096
{

Include/RmlUi/Core/Colour.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Colour {
7979
/// @param[in] rhs The colour to subtract.
8080
inline void operator-=(Colour rhs);
8181
/// Scales this colour component-wise in-place.
82-
/// @param[in] rhs The value to scale this colours's components by.
82+
/// @param[in] rhs The value to scale this colour's components by.
8383
inline void operator*=(float rhs);
8484
/// Scales this colour component-wise in-place by the inverse of a value.
8585
/// @param[in] rhs The value to divide this colour's components by.

Include/RmlUi/Core/Context.h

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class TextInputHandler;
5151
enum class EventId : uint16_t;
5252

5353
/**
54-
A context for storing, rendering and processing RML documents. Multiple contexts can exist simultaneously.
54+
A context for storing, rendering, and processing RML documents. Multiple contexts can exist simultaneously.
5555
5656
@author Peter Curry
5757
*/
@@ -85,7 +85,7 @@ class RMLUICORE_API Context : public ScriptInterface {
8585
float GetDensityIndependentPixelRatio() const;
8686

8787
/// Updates all elements in the context's documents.
88-
/// This must be called before Context::Render, but after any elements have been changed, added or removed.
88+
/// This must be called before Context::Render, but after any elements have been changed, added, or removed.
8989
bool Update();
9090
/// Renders all visible elements in the context's documents.
9191
bool Render();
@@ -117,7 +117,7 @@ class RMLUICORE_API Context : public ScriptInterface {
117117
void UnloadAllDocuments();
118118

119119
/// Enable or disable handling of the mouse cursor from this context.
120-
/// When enabled, changes to the cursor name is transmitted through the system interface.
120+
/// When enabled, changes to the cursor name are passed to the system interface.
121121
/// @param[in] enable True to enable mouse cursor handling, false to disable.
122122
void EnableMouseCursor(bool enable);
123123

@@ -151,11 +151,11 @@ class RMLUICORE_API Context : public ScriptInterface {
151151
/// @return The root element.
152152
Element* GetRootElement();
153153

154-
// Returns the youngest descendent of the given element which is under the given point in screen coordinates.
155-
// @param[in] point The point to test.
156-
// @param[in] ignore_element If set, this element and its descendents will be ignored.
157-
// @param[in] element Used internally.
158-
// @return The element under the point, or nullptr if nothing is.
154+
/// Returns the youngest descendent of the given element which is under the given point in screen coordinates.
155+
/// @param[in] point The point to test.
156+
/// @param[in] ignore_element If set, this element and its descendents will be ignored.
157+
/// @param[in] element Used internally.
158+
/// @return The element under the point, or nullptr if nothing is.
159159
Element* GetElementAtPoint(Vector2f point, const Element* ignore_element = nullptr, Element* element = nullptr) const;
160160

161161
/// Brings the document to the front of the document stack.
@@ -181,19 +181,19 @@ class RMLUICORE_API Context : public ScriptInterface {
181181

182182
/// Sends a key down event into this context.
183183
/// @param[in] key_identifier The key pressed.
184-
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together
184+
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc.) keys; this should be generated by ORing together
185185
/// members of the Input::KeyModifier enumeration.
186186
/// @return True if the event was not consumed (ie, was prevented from propagating by an element), false if it was.
187187
bool ProcessKeyDown(Input::KeyIdentifier key_identifier, int key_modifier_state);
188188
/// Sends a key up event into this context.
189189
/// @param[in] key_identifier The key released.
190-
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together
190+
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc.) keys; this should be generated by ORing together
191191
/// members of the Input::KeyModifier enumeration.
192192
/// @return True if the event was not consumed (ie, was prevented from propagating by an element), false if it was.
193193
bool ProcessKeyUp(Input::KeyIdentifier key_identifier, int key_modifier_state);
194194

195-
/// Sends a single unicode character as text input into this context.
196-
/// @param[in] character The unicode code point to send into this context.
195+
/// Sends a single Unicode character as text input into this context.
196+
/// @param[in] character The Unicode code point to send into this context.
197197
/// @return True if the event was not consumed (ie, was prevented from propagating by an element), false if it was.
198198
bool ProcessTextInput(Character character);
199199
/// Sends a single ascii character as text input into this context.
@@ -206,19 +206,19 @@ class RMLUICORE_API Context : public ScriptInterface {
206206
/// Sends a mouse movement event into this context.
207207
/// @param[in] x The x-coordinate of the mouse cursor, in window-coordinates (ie, 0 should be the left of the client area).
208208
/// @param[in] y The y-coordinate of the mouse cursor, in window-coordinates (ie, 0 should be the top of the client area).
209-
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together
209+
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc.) keys; this should be generated by ORing together
210210
/// members of the Input::KeyModifier enumeration.
211211
/// @return True if the mouse is not interacting with any elements in the context (see 'IsMouseInteracting'), otherwise false.
212212
bool ProcessMouseMove(int x, int y, int key_modifier_state);
213213
/// Sends a mouse-button down event into this context.
214-
/// @param[in] button_index The index of the button that was pressed; 0 for the left button, 1 for right, and 2 for middle button.
215-
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together
214+
/// @param[in] button_index The index of the button that was pressed. Left: 0, Right: 1, Middle: 2.
215+
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc.) keys; this should be generated by ORing together
216216
/// members of the Input::KeyModifier enumeration.
217217
/// @return True if the mouse is not interacting with any elements in the context (see 'IsMouseInteracting'), otherwise false.
218218
bool ProcessMouseButtonDown(int button_index, int key_modifier_state);
219219
/// Sends a mouse-button up event into this context.
220-
/// @param[in] button_index The index of the button that was release; 0 for the left button, 1 for right, and 2 for middle button.
221-
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together
220+
/// @param[in] button_index The index of the button that was release. Left: 0, Right: 1, Middle: 2.
221+
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc.) keys; this should be generated by ORing together
222222
/// members of the Input::KeyModifier enumeration.
223223
/// @return True if the mouse is not interacting with any elements in the context (see 'IsMouseInteracting'), otherwise false.
224224
bool ProcessMouseButtonUp(int button_index, int key_modifier_state);
@@ -227,14 +227,14 @@ class RMLUICORE_API Context : public ScriptInterface {
227227
bool ProcessMouseWheel(float wheel_delta, int key_modifier_state);
228228
/// Sends a mousescroll event into this context, and scrolls the document unless the event was stopped from propagating.
229229
/// @param[in] wheel_delta The mouse-wheel movement this frame, with positive values being directed right and down.
230-
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together
230+
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc.) keys; this should be generated by ORing together
231231
/// members of the Input::KeyModifier enumeration.
232232
/// @return True if the event was not consumed (ie, was prevented from propagating by an element), false if it was.
233233
bool ProcessMouseWheel(Vector2f wheel_delta, int key_modifier_state);
234234
/// Tells the context the mouse has left the window. This removes any hover state from all elements and prevents 'Update()' from setting the hover
235235
/// state for elements under the mouse.
236236
/// @return True if the mouse is not interacting with any elements in the context (see 'IsMouseInteracting'), otherwise false.
237-
/// @note The mouse is considered activate again after the next call to 'ProcessMouseMove()'.
237+
/// @note The mouse is considered activated again after the next call to 'ProcessMouseMove()'.
238238
bool ProcessMouseLeave();
239239

240240
/// Returns a hint on whether the mouse is currently interacting with any elements in this context, based on previously submitted
@@ -252,7 +252,7 @@ class RMLUICORE_API Context : public ScriptInterface {
252252
/// Retrieves the render manager which can be used to submit changes to the render state.
253253
RenderManager& GetRenderManager();
254254

255-
/// Obtains the text input handler.
255+
/// Retrieves the text input handler.
256256
TextInputHandler* GetTextInputHandler() const;
257257

258258
/// Sets the instancer to use for releasing this object.
@@ -271,32 +271,29 @@ class RMLUICORE_API Context : public ScriptInterface {
271271
/// @return A constructor for the data model, or empty if it could not be found.
272272
DataModelConstructor GetDataModel(const String& name);
273273
/// Removes the given data model.
274-
/// This also removes all data views, controllers and bindings contained by the data model.
274+
/// This also removes all data views, controllers, and bindings contained by the data model.
275275
/// @warning Invalidates all handles and constructors pointing to the data model.
276276
/// @param[in] name The name of the data model.
277-
/// @return True if succesfully removed, false if no data model was found.
277+
/// @return True if successfully removed, false if no data model was found.
278278
bool RemoveDataModel(const String& name);
279279

280-
/// This will set the documents base <tag> before creation. Default = "body"
280+
/// Sets the base tag name of documents before creation. Default: "body".
281281
/// @param[in] tag The name of the base tag. Example: "html"
282282
void SetDocumentsBaseTag(const String& tag);
283-
/// Gets the name of the documents base tag.
284-
/// @return The current documents base tag name.
283+
/// Gets the base tag name of documents.
284+
/// @return The current base tag name of documents.
285285
const String& GetDocumentsBaseTag();
286286

287-
/// Updates the time until Update should get called again. This can be used by elements
288-
/// and the app to implement on demand rendering and thus drastically save CPU/GPU and
289-
/// reduce power consumption during inactivity. The context stores the lowest requested
290-
/// timestamp, which can later retrieved using GetNextUpdateDelay().
291-
/// @param[in] delay Maximum time until next update
287+
/// Updates the time until Update() should get called again. This can be used by elements and the application to
288+
/// implement on-demand rendering and thus drastically save CPU/GPU and reduce power consumption during inactivity.
289+
/// The context stores the lowest requested timestamp, which can later be retrieved using GetNextUpdateDelay().
290+
/// @param[in] delay Maximum time until next update.
292291
void RequestNextUpdate(double delay);
293-
294-
/// Get the max delay until update and render should get called again. An application can choose
295-
/// to only call update and render once the time has elapsed, but theres no harm in doing so
296-
/// more often. The returned value can be infinity, in which case update should be invoked after
297-
/// user input was received. A value of 0 means "render as fast as possible", for example if
298-
/// an animation is playing.
299-
/// @return Time until next update is expected.
292+
/// Get the max delay until Update() and Render() should get called again. An application can choose to only call
293+
/// update and render once the time has elapsed, but there's no harm in doing so more often. The returned value can
294+
/// be infinity, in which case Update() should be invoked after user input was received. A value of 0 means "render
295+
/// as fast as possible", for example if an animation is playing.
296+
/// @return Time until the next update is expected.
300297
double GetNextUpdateDelay() const;
301298

302299
protected:
@@ -365,7 +362,7 @@ class RMLUICORE_API Context : public ScriptInterface {
365362
// Used when dragging a cloned object.
366363
Element* drag_clone;
367364

368-
// The element currently being dragged over; this is equivalent to hover, but only set while an element is being
365+
// The element currently being dragged over. This is equivalent to hover, but only set while an element is being
369366
// dragged, and excludes the dragged element.
370367
Element* drag_hover;
371368
// Set of elements that are currently being dragged over; this differs from the hover state as the dragged element
@@ -397,7 +394,7 @@ class RMLUICORE_API Context : public ScriptInterface {
397394

398395
// Creates the drag clone from the given element. The old drag clone will be released if necessary.
399396
void CreateDragClone(Element* element);
400-
// Releases the drag clone, if one exists.
397+
// Releases the drag clone if one exists.
401398
void ReleaseDragClone();
402399

403400
// Scroll the target by the given amount, using smooth scrolling.

Include/RmlUi/Core/Core.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ RMLUICORE_API void Shutdown();
6060
/// @return The version number.
6161
RMLUICORE_API String GetVersion();
6262

63-
/// Sets the interface through which all system requests are made. This is not required to be called, but if it is it
63+
/// Sets the interface through which all system requests are made. This is not required to be called, but if it is, it
6464
/// must be called before Initialise().
6565
/// @param[in] system_interface A non-owning pointer to the application-specified logging interface.
6666
/// @lifetime The interface must be kept alive until after the call to Rml::Shutdown.
@@ -77,15 +77,15 @@ RMLUICORE_API void SetRenderInterface(RenderInterface* render_interface);
7777
/// Returns RmlUi's default's render interface.
7878
RMLUICORE_API RenderInterface* GetRenderInterface();
7979

80-
/// Sets the interface through which all file I/O requests are made. This is not required to be called, but if it is it
80+
/// Sets the interface through which all file I/O requests are made. This is not required to be called, but if it is, it
8181
/// must be called before Initialise().
8282
/// @param[in] file_interface A non-owning pointer to the application-specified file interface.
8383
/// @lifetime The interface must be kept alive until after the call to Rml::Shutdown.
8484
RMLUICORE_API void SetFileInterface(FileInterface* file_interface);
8585
/// Returns RmlUi's file interface.
8686
RMLUICORE_API FileInterface* GetFileInterface();
8787

88-
/// Sets the interface through which all font requests are made. This is not required to be called, but if it is
88+
/// Sets the interface through which all font requests are made. This is not required to be called, but if it is,
8989
/// it must be called before Initialise().
9090
/// @param[in] font_interface A non-owning pointer to the application-specified font engine interface.
9191
/// @lifetime The interface must be kept alive until after the call to Rml::Shutdown.
@@ -108,13 +108,13 @@ RMLUICORE_API TextInputHandler* GetTextInputHandler();
108108
/// @param[in] text_input_handler The custom text input handler to use, or nullptr to use the default.
109109
/// @lifetime If specified, the render interface and the text input handler must be kept alive until after the call to
110110
/// Rml::Shutdown. Alternatively, the render interface can be destroyed after all contexts it belongs to have been
111-
/// destroyed and a subsequent call has been made to Rml::ReleaseRenderManagers.
111+
/// destroyed, and a subsequent call has been made to Rml::ReleaseRenderManagers.
112112
/// @return A non-owning pointer to the new context, or nullptr if the context could not be created.
113113
RMLUICORE_API Context* CreateContext(const String& name, Vector2i dimensions, RenderInterface* render_interface = nullptr,
114114
TextInputHandler* text_input_handler = nullptr);
115115
/// Removes and destroys a context.
116116
/// @param[in] name The name of the context to remove.
117-
/// @return True if name is a valid context, false otherwise.
117+
/// @return True if the name is a valid context, false otherwise.
118118
RMLUICORE_API bool RemoveContext(const String& name);
119119
/// Fetches a previously constructed context by name.
120120
/// @param[in] name The name of the desired context.
@@ -128,16 +128,17 @@ RMLUICORE_API Context* GetContext(int index);
128128
/// @return The total number of active RmlUi contexts.
129129
RMLUICORE_API int GetNumContexts();
130130

131-
/// Adds a new font face to the font engine. The face's family, style and weight will be determined from the face itself.
131+
/// Adds a new font face to the font engine. The face's family, style, and weight will be determined from the face itself.
132132
/// @param[in] file_path The path to the file to load the face from. The path is passed directly to the file interface which is used to load the file.
133133
/// The default file interface accepts both absolute paths and paths relative to the working directory.
134134
/// @param[in] fallback_face True to use this font face for unknown characters in other font faces.
135135
/// @param[in] weight The weight to load when the font face contains multiple weights, otherwise the weight to register the font as. By default, it
136136
/// loads all found font weights.
137137
/// @param[in] face_index The index of the font face within a font collection.
138138
/// @return True if the face was loaded successfully, false otherwise.
139-
RMLUICORE_API bool LoadFontFace(const String& file_path, bool fallback_face = false, Style::FontWeight weight = Style::FontWeight::Auto, int face_index = 0);
140-
/// Adds a new font face from memory to the font engine. The face's family, style and weight is given by the parameters.
139+
RMLUICORE_API bool LoadFontFace(const String& file_path, bool fallback_face = false, Style::FontWeight weight = Style::FontWeight::Auto,
140+
int face_index = 0);
141+
/// Adds a new font face from memory to the font engine. The face's family, style, and weight are given by the parameters.
141142
/// @param[in] data The font data.
142143
/// @param[in] family The family to register the font as.
143144
/// @param[in] style The style to register the font as.

0 commit comments

Comments
 (0)