Add a doxygen documentation.

This commit is contained in:
ArthurSonzogni
2020-08-09 14:53:56 +02:00
committed by Arthur Sonzogni
parent 5f15b2881e
commit 20b9a0f0f5
20 changed files with 936 additions and 525 deletions

View File

@@ -10,35 +10,7 @@
namespace ftxui {
// static
Event Event::Character(const std::string& input) {
Event event;
event.input_ = input;
event.is_character_ = true;
event.character_ = to_wstring(input)[0];
return event;
}
// static
Event Event::Character(char c) {
return Character(wchar_t(c));
}
// static
Event Event::Character(wchar_t c) {
Event event;
event.input_ = {(char)c};
event.is_character_ = true;
event.character_ = c;
return event;
}
// static
Event Event::Special(const std::string& input) {
Event event;
event.input_ = std::move(input);
return event;
}
namespace {
void ParseUTF8(Receiver<char>& in, Sender<Event>& out, std::string& input) {
char c;
@@ -131,6 +103,38 @@ void ParseESC(Receiver<char>& in, Sender<Event>& out, std::string& input) {
}
}
} // namespace
// static
Event Event::Character(const std::string& input) {
Event event;
event.input_ = input;
event.is_character_ = true;
event.character_ = to_wstring(input)[0];
return event;
}
// static
Event Event::Character(char c) {
return Character(wchar_t(c));
}
// static
Event Event::Character(wchar_t c) {
Event event;
event.input_ = {(char)c};
event.is_character_ = true;
event.character_ = c;
return event;
}
// static
Event Event::Special(const std::string& input) {
Event event;
event.input_ = std::move(input);
return event;
}
// static
void Event::Convert(Receiver<char>& in, Sender<Event>& out, char c) {
std::string input;

View File

@@ -4,8 +4,6 @@
#include "ftxui/component/screen_interactive.hpp"
#define DEFINE_CONSOLEV2_PROPERTIES
#include <stdio.h>
#include <algorithm>
@@ -20,6 +18,7 @@
#include "ftxui/screen/terminal.hpp"
#if defined(_WIN32)
#define DEFINE_CONSOLEV2_PROPERTIES
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
@@ -40,6 +39,7 @@
namespace ftxui {
namespace {
// Produce a stream of Event from a stream of char.
void CharToEventStream(Receiver<char> receiver, Sender<Event> sender) {
char c;
@@ -154,6 +154,8 @@ void OnResize(int /* signal */) {
on_resize();
}
} // namespace
ScreenInteractive::ScreenInteractive(int dimx,
int dimy,
Dimension dimension,