flipperzero-firmware/lib/app-scened-template/view_modules/byte_input_vm.cpp
あく 389ff92cc1
Naming and coding style convention, new linter tool. (#945)
* Makefile, Scripts: new linter
* About: remove ID from IC
* Firmware: remove double define for DIVC/DIVR
* Scripts: check folder names too. Docker: replace syntax check with make lint.
* Reformat Sources and Migrate to new file naming convention
* Docker: symlink clang-format-12 to clang-format
* Add coding style guide
2022-01-05 19:10:18 +03:00

33 lines
828 B
C++

#include "byte_input_vm.h"
ByteInputVM::ByteInputVM() {
byte_input = byte_input_alloc();
}
ByteInputVM::~ByteInputVM() {
byte_input_free(byte_input);
}
View* ByteInputVM::get_view() {
return byte_input_get_view(byte_input);
}
void ByteInputVM::clean() {
byte_input_set_header_text(byte_input, "");
byte_input_set_result_callback(byte_input, NULL, NULL, NULL, NULL, 0);
}
void ByteInputVM::set_result_callback(
ByteInputCallback input_callback,
ByteChangedCallback changed_callback,
void* callback_context,
uint8_t* bytes,
uint8_t bytes_count) {
byte_input_set_result_callback(
byte_input, input_callback, changed_callback, callback_context, bytes, bytes_count);
}
void ByteInputVM::set_header_text(const char* text) {
byte_input_set_header_text(byte_input, text);
}