Skip to content

Commit

Permalink
docs: fix spelling and grammar mistakes in documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Agarwal <[email protected]>
  • Loading branch information
Aditya-A-garwal committed Mar 24, 2024
1 parent ed68e1b commit f9e98df
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 87 deletions.
28 changes: 14 additions & 14 deletions lib/gui/include/widgets/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class App : public BasicWidget, public DrawableWidget {
/**
* @brief Report if this widget's visibility was changed and it requires to be cleared/redrawn
*
* @note See also `BasicWidget::get_dirty`
* @note See also `App::get_dirty`
*
* @return false Always
*
Expand Down Expand Up @@ -330,7 +330,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param y Y-coordiante of the pixel (offset from top-edge)
* @param color 16-bit color of the pixel
*
* @return Pointer to the app (allows for chaining method calls)
* @return Pointer to the app (allows chaining method calls)
*
*/
App *set_at(unsigned x, unsigned y, uint16_t color) override;
Expand All @@ -357,7 +357,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param y1 Y-coordinate of the second point (offset from top-edge)
* @param color 16-bit color of the line
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *draw_line(unsigned x0, unsigned y0, unsigned x1, unsigned y1, uint16_t color) override;
Expand All @@ -371,7 +371,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param h Height of the rectangle
* @param color 16-bit color of the rectangle
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *draw_rect(unsigned x, unsigned y, unsigned w, unsigned h, uint16_t color) override;
Expand All @@ -385,7 +385,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param h Height of the rectangle
* @param color 16-bit color of the rectangle
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *fill_rect(unsigned x, unsigned y, unsigned w, unsigned h, uint16_t color) override;
Expand All @@ -400,7 +400,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param r Radius of the rounded-corners
* @param color 16-bit color of the rectangle
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *draw_round_rect(unsigned x, unsigned y, unsigned w, unsigned h, unsigned r, uint16_t color) override;
Expand All @@ -414,7 +414,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param r Radius of the rounded-corners
* @param color 16-bit color of the rectangle
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *fill_round_rect(unsigned x, unsigned y, unsigned w, unsigned h, unsigned r, uint16_t color) override;
Expand All @@ -427,7 +427,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param r Radius of the circle
* @param color 16-bit color of the circle
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*/
App *draw_circle(unsigned x, unsigned y, unsigned r, uint16_t color) override;

Expand All @@ -439,7 +439,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param r Radius of the circle
* @param color 16-bit color of the circle
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *fill_circle(unsigned x, unsigned y, unsigned r, uint16_t color) override;
Expand All @@ -456,7 +456,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param w Reference to variable where the width of the textbox will be stored
* @param h Reference to variable where the height of the textbox will be stored
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *get_text_bounds(const char *text, unsigned text_size, unsigned x, unsigned y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) override;
Expand All @@ -466,7 +466,7 @@ class App : public BasicWidget, public DrawableWidget {
*
* @param f Pointer to font which should be used henceforth
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *set_font(const GFXfont *f) override;
Expand All @@ -480,7 +480,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param text_size Size of the text
* @param fg_color Color of the text
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *print(const char *text, unsigned x, unsigned y, unsigned text_size, uint16_t fg_color) override;
Expand All @@ -497,7 +497,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param fg_color Color of the text
* @param bg_color Color of the background
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*
*/
App *print_opaque(const char *text, unsigned x, unsigned y, unsigned text_size, uint16_t fg_color, uint16_t bg_color) override;
Expand All @@ -511,7 +511,7 @@ class App : public BasicWidget, public DrawableWidget {
* @param width Number of columns in the bitmap
* @param height Number of rows in the bitmap
*
* @return Pointer to the widget (allows for chaining method calls)
* @return Pointer to the widget (allows chaining method calls)
*/
App *draw_rgb_bitmap(unsigned x, unsigned y, const uint16_t *data, unsigned width, unsigned height) override;

Expand Down
8 changes: 4 additions & 4 deletions lib/gui/include/widgets/bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Bitmap : public BasicWidget, public InteractiveWidget {
protected:

/** The cooldown period between two pressed (used to prevent "bouncing", where a single press is detected as multiple) */
constexpr static unsigned DEBOUNCE_THRESH = 150;
constexpr static unsigned DEBOUNCE_THRESH = 200;

/** Reference to parent frame */
Frame *parent {nullptr};
Expand Down Expand Up @@ -51,9 +51,6 @@ class Bitmap : public BasicWidget, public InteractiveWidget {
/** Height of widget (number of rows occupied) */
unsigned widget_h;

/** The epoch when the widget was last pressed */
unsigned last_press_epoch {0};

/** Pointer to the bitmap array */
const uint16_t *data;

Expand All @@ -68,6 +65,9 @@ class Bitmap : public BasicWidget, public InteractiveWidget {
/** Reference to event queue for posting events */
RingQueueInterface<callback_event_t> *event_queue {nullptr};

/** The epoch when the widget was last pressed */
unsigned last_press_epoch {0};

public:

/**
Expand Down
5 changes: 3 additions & 2 deletions lib/gui/include/widgets/button.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @file bitmap.h
* @file button.h
* @author Aditya Agarwal ([email protected])
* @brief File that declares the `Bitmap` class, which is used to show 16-bit color bitmap images
* @brief File that declares the `Button` class, which is a simple and flexible implementation of a button
*
*/

Expand Down Expand Up @@ -135,6 +135,7 @@ class Button : public BasicWidget, public InteractiveWidget {

protected:

/** The cooldown period between two pressed (used to prevent "bouncing", where a single press is detected as multiple) */
constexpr static unsigned DEBOUNCE_THRESH = 200;

constexpr static unsigned DEFAULT_WIDTH = 64;
Expand Down
4 changes: 2 additions & 2 deletions lib/gui/include/widgets/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Frame : public BasicWidget, public DrawableWidget {


/**
* @brief Send the widget to a lower Z-index (higher up)
* @brief Send a widget to a lower Z-index (higher up)
*
* @warning If `child` is not a child of this widget, then this function does nothing
* @see Frame::send_back(BasicWidget*,unsigned)
Expand All @@ -63,7 +63,7 @@ class Frame : public BasicWidget, public DrawableWidget {
virtual Frame *send_front(BasicWidget *child, unsigned amt) = 0;

/**
* @brief Send the widget to a higher Z-index (lower down)
* @brief Send a widget to a higher Z-index (lower down)
*
* @warning If `child` is not a child of this widget, then this function does nothing
* @see Frame::send_front(BasicWidget*,unsigned)
Expand Down
26 changes: 13 additions & 13 deletions lib/gui/include/widgets/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class View : public Frame {
* @param y Y-coordiante of the pixel (offset from top-edge)
* @param color 16-bit color of the pixel
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *set_at(unsigned x, unsigned y, uint16_t color) override;
Expand All @@ -263,7 +263,7 @@ class View : public Frame {
* @param y1 Y-coordinate of the second point (offset from top-edge)
* @param color 16-bit color of the line
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *draw_line(unsigned x0, unsigned y0, unsigned x1, unsigned y1, uint16_t color) override;
Expand All @@ -277,7 +277,7 @@ class View : public Frame {
* @param h Height of the rectangle
* @param color 16-bit color of the rectangle
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *draw_rect(unsigned x, unsigned y, unsigned w, unsigned h, uint16_t color) override;
Expand All @@ -291,7 +291,7 @@ class View : public Frame {
* @param h Height of the rectangle
* @param color 16-bit color of the rectangle
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *fill_rect(unsigned x, unsigned y, unsigned w, unsigned h, uint16_t color) override;
Expand All @@ -306,7 +306,7 @@ class View : public Frame {
* @param r Radius of the rounded-corners
* @param color 16-bit color of the rectangle
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *draw_round_rect(unsigned x, unsigned y, unsigned w, unsigned h, unsigned r, uint16_t color) override;
Expand All @@ -320,7 +320,7 @@ class View : public Frame {
* @param r Radius of the rounded-corners
* @param color 16-bit color of the rectangle
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *fill_round_rect(unsigned x, unsigned y, unsigned w, unsigned h, unsigned r, uint16_t color) override;
Expand All @@ -333,7 +333,7 @@ class View : public Frame {
* @param r Radius of the circle
* @param color 16-bit color of the circle
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*/
View *draw_circle(unsigned x, unsigned y, unsigned r, uint16_t color) override;

Expand All @@ -345,7 +345,7 @@ class View : public Frame {
* @param r Radius of the circle
* @param color 16-bit color of the circle
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *fill_circle(unsigned x, unsigned y, unsigned r, uint16_t color) override;
Expand All @@ -362,7 +362,7 @@ class View : public Frame {
* @param w Reference to variable where the width of the textbox will be stored
* @param h Reference to variable where the height of the textbox will be stored
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *get_text_bounds(const char *text, unsigned text_size, unsigned x, unsigned y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) override;
Expand All @@ -372,7 +372,7 @@ class View : public Frame {
*
* @param f Pointer to font which should be used henceforth
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *set_font(const GFXfont *f) override;
Expand All @@ -386,7 +386,7 @@ class View : public Frame {
* @param text_size Size of the text
* @param fg_color Color of the text
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *print(const char *text, unsigned x, unsigned y, unsigned text_size, uint16_t fg_color) override;
Expand All @@ -403,7 +403,7 @@ class View : public Frame {
* @param fg_color Color of the text
* @param bg_color Color of the background
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*
*/
View *print_opaque(const char *text, unsigned x, unsigned y, unsigned text_size, uint16_t fg_color, uint16_t bg_color) override;
Expand All @@ -417,7 +417,7 @@ class View : public Frame {
* @param width Number of columns in the bitmap
* @param height Number of rows in the bitmap
*
* @return Pointer to the view (allows for chaining method calls)
* @return Pointer to the view (allows chaining method calls)
*/
View *draw_rgb_bitmap(unsigned x, unsigned y, const uint16_t *data, unsigned width, unsigned height) override;

Expand Down
Loading

0 comments on commit f9e98df

Please sign in to comment.