From b59fab7e533ef96d72c92b224d4f24718bc6b0a1 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 21 Aug 2023 11:32:19 +0300 Subject: [PATCH] Style and comment updates --- source/button.h | 1 + source/dialog.h | 1 + source/dropdown.h | 1 + source/entry.h | 9 ++++++--- source/geometry.h | 1 + source/grid.h | 1 + source/image.cpp | 3 +-- source/label.h | 1 + source/lineararrangement.h | 1 + source/list.h | 4 ++-- source/part.h | 2 ++ source/resources.h | 5 +++-- source/toggle.h | 2 ++ source/widget.h | 1 + 14 files changed, 24 insertions(+), 9 deletions(-) diff --git a/source/button.h b/source/button.h index 165ca4f..22426ca 100644 --- a/source/button.h +++ b/source/button.h @@ -21,6 +21,7 @@ public: { public: Loader(Button &); + private: void text(const std::string &); }; diff --git a/source/dialog.h b/source/dialog.h index 285478e..6f35565 100644 --- a/source/dialog.h +++ b/source/dialog.h @@ -20,6 +20,7 @@ public: { public: Loader(Dialog &, WidgetMap &); + private: void action_button(const std::string &, int); }; diff --git a/source/dropdown.h b/source/dropdown.h index 3a42d00..e7935f7 100644 --- a/source/dropdown.h +++ b/source/dropdown.h @@ -19,6 +19,7 @@ public: { public: Loader(Dropdown &); + private: void item(const std::string &); }; diff --git a/source/entry.h b/source/entry.h index ee390a0..3c7ab63 100644 --- a/source/entry.h +++ b/source/entry.h @@ -16,9 +16,12 @@ Text entry field. Special parts: - text The current text of the widget. Graphics are ignored. - cursor Indicates the current input position. Fill_x is ignored. - slider A vertical slider for multiline entries. + text The current text of the widget. Graphics are ignored. + cursor Indicates the current input position. Fill and align are taken + from the text part. + selection Highlights the selected text. Fill and align are taken from the + text part. + slider A vertical slider for multiline entries. */ class MSPGLTK_API Entry: virtual public Widget, private Container { diff --git a/source/geometry.h b/source/geometry.h index fac3bbc..cb99ced 100644 --- a/source/geometry.h +++ b/source/geometry.h @@ -19,6 +19,7 @@ struct MSPGLTK_API Geometry Geometry() = default; Geometry(int x_, int y_, unsigned w_, unsigned h_): x(x_), y(y_), w(w_), h(h_) { } + bool is_inside(int, int) const; bool is_inside_relative(int, int) const; }; diff --git a/source/grid.h b/source/grid.h index be1c266..01cfffa 100644 --- a/source/grid.h +++ b/source/grid.h @@ -15,6 +15,7 @@ public: { public: Loader(Grid &); + private: void next_row(); void skip(); diff --git a/source/image.cpp b/source/image.cpp index 448da7b..6e24d71 100644 --- a/source/image.cpp +++ b/source/image.cpp @@ -12,8 +12,7 @@ namespace GLtk { Image::Image(const GL::Texture2D *i): image(i) -{ -} +{ } void Image::autosize_special(const Part &part, Geometry &ageom) const { diff --git a/source/label.h b/source/label.h index 6b350ed..0fb09e9 100644 --- a/source/label.h +++ b/source/label.h @@ -18,6 +18,7 @@ public: { public: Loader(Label &); + private: void text(const std::string &); }; diff --git a/source/lineararrangement.h b/source/lineararrangement.h index 7535bc7..6f3c26a 100644 --- a/source/lineararrangement.h +++ b/source/lineararrangement.h @@ -15,6 +15,7 @@ public: { public: Loader(LinearArrangement &); + private: void expand(); void spacing(unsigned); diff --git a/source/list.h b/source/list.h index 0938eaf..72b5b88 100644 --- a/source/list.h +++ b/source/list.h @@ -42,6 +42,7 @@ public: { public: Loader(List &); + private: void item(const std::string &); }; @@ -128,8 +129,7 @@ private: const ListDataStore *data; public: - TypedItemFactory(const ListData &d) - { set_data(d); } + TypedItemFactory(const ListData &d) { set_data(d); } void set_data(const ListData &d) override { diff --git a/source/part.h b/source/part.h index 10eef5f..1e79165 100644 --- a/source/part.h +++ b/source/part.h @@ -24,6 +24,7 @@ public: { public: Loader(Part &, Resources &); + private: void finish() override; @@ -44,6 +45,7 @@ private: public: Part(const std::string &); + const std::string &get_name() const { return name; } const Graphic *get_graphic(State) const; const Geometry &get_geometry() const { return geom; } diff --git a/source/resources.h b/source/resources.h index 6a1c603..31c5734 100644 --- a/source/resources.h +++ b/source/resources.h @@ -17,8 +17,8 @@ namespace Msp { namespace GLtk { /** -Stores resources such as styles and graphics. All widgets require a Resources -instance in constructor. +Stores resources such as styles and graphics. The Root widget requires a +Resources instance as constructor parameter. */ class MSPGLTK_API Resources: public DataFile::Collection { @@ -30,6 +30,7 @@ public: public: Loader(Resources &); + private: void default_font(const std::string &); void font(const std::string &); diff --git a/source/toggle.h b/source/toggle.h index 2b38ffc..7da0e36 100644 --- a/source/toggle.h +++ b/source/toggle.h @@ -19,8 +19,10 @@ public: { public: Loader(Toggle &); + private: void finish() override; + void text(const std::string &); }; diff --git a/source/widget.h b/source/widget.h index fc51798..001da84 100644 --- a/source/widget.h +++ b/source/widget.h @@ -31,6 +31,7 @@ public: { public: Loader(Widget &); + private: void position(int, int); void size(unsigned, unsigned); -- 2.45.2