Formatted code (#1007)

* Updated style

* Updated files

* fixed new line

* Updated spacing

* File fix WIP

* Updated to clang 13

* updated comment style

* Removed old comment code
This commit is contained in:
jLynx 2023-05-19 08:16:05 +12:00 committed by GitHub
parent 7aca7ce74d
commit 033c4e9a5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
599 changed files with 70746 additions and 66896 deletions

View file

@ -32,60 +32,57 @@
namespace ui {
class HandWriteView : public TextEntryView {
public:
HandWriteView(NavigationView& nav, std::string * str, size_t max_length);
public:
HandWriteView(NavigationView& nav, std::string* str, size_t max_length);
HandWriteView(const HandWriteView&) = delete;
HandWriteView(HandWriteView&&) = delete;
HandWriteView& operator=(const HandWriteView&) = delete;
HandWriteView& operator=(HandWriteView&&) = delete;
void paint(Painter& painter) override;
void on_show() override;
bool on_touch(const TouchEvent event) override;
private:
const char special_chars[5] = { '\'', '.', '?', '!', '=' };
const HandWriting * handwriting { };
Painter * _painter { };
uint8_t dir_cnt { 0 };
uint8_t dir_prev { 0 };
uint8_t flash_timer { 0 };
bool tracing { false };
uint8_t stroke_index { 0 };
uint8_t sample_skip { 0 }, move_wait { 0 };
uint8_t stroke_list[8];
Point start_pos { }, current_pos { }, last_pos { };
bool _lowercase = false;
void sample_pen();
void add_stroke(uint8_t dir);
void guess_letter();
void clear_zone(const Color color, const bool flash);
void on_button(Button& button);
std::array<Button, 10> num_buttons { };
std::array<Button, 5> special_buttons { };
HandWriteView(const HandWriteView&) = delete;
HandWriteView(HandWriteView&&) = delete;
HandWriteView& operator=(const HandWriteView&) = delete;
HandWriteView& operator=(HandWriteView&&) = delete;
Button button_case {
{ 8, 270, 32, 28 },
"UC"
};
void paint(Painter& painter) override;
void on_show() override;
bool on_touch(const TouchEvent event) override;
Button button_ok {
{ 190, 270, 40, 28 },
"OK"
};
MessageHandlerRegistration message_handler_sample {
Message::ID::DisplayFrameSync,
[this](const Message* const) {
this->sample_pen();
}
};
private:
const char special_chars[5] = {'\'', '.', '?', '!', '='};
const HandWriting* handwriting{};
Painter* _painter{};
uint8_t dir_cnt{0};
uint8_t dir_prev{0};
uint8_t flash_timer{0};
bool tracing{false};
uint8_t stroke_index{0};
uint8_t sample_skip{0}, move_wait{0};
uint8_t stroke_list[8];
Point start_pos{}, current_pos{}, last_pos{};
bool _lowercase = false;
void sample_pen();
void add_stroke(uint8_t dir);
void guess_letter();
void clear_zone(const Color color, const bool flash);
void on_button(Button& button);
std::array<Button, 10> num_buttons{};
std::array<Button, 5> special_buttons{};
Button button_case{
{8, 270, 32, 28},
"UC"};
Button button_ok{
{190, 270, 40, 28},
"OK"};
MessageHandlerRegistration message_handler_sample{
Message::ID::DisplayFrameSync,
[this](const Message* const) {
this->sample_pen();
}};
};
} /* namespace ui */
#endif/*__UNISTROKE_H__*/
#endif /*__UNISTROKE_H__*/