mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Improve documentation (#1058)
* Remove @ingroup from class member definitions * Add the documentation for every public classes.
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
|
||||
namespace ftxui {
|
||||
/// @return the biggest Box contained in both |a| and |b|.
|
||||
/// @ingroup screen
|
||||
// static
|
||||
Box Box::Intersection(Box a, Box b) {
|
||||
return Box{
|
||||
@@ -19,7 +18,6 @@ Box Box::Intersection(Box a, Box b) {
|
||||
}
|
||||
|
||||
/// @return the smallest Box containing both |a| and |b|.
|
||||
/// @ingroup screen
|
||||
// static
|
||||
Box Box::Union(Box a, Box b) {
|
||||
return Box{
|
||||
@@ -33,7 +31,6 @@ Box Box::Union(Box a, Box b) {
|
||||
/// Shift the box by (x,y).
|
||||
/// @param x horizontal shift.
|
||||
/// @param y vertical shift.
|
||||
/// @ingroup screen
|
||||
void Box::Shift(int x, int y) {
|
||||
x_min += x;
|
||||
x_max += x;
|
||||
@@ -42,7 +39,6 @@ void Box::Shift(int x, int y) {
|
||||
}
|
||||
|
||||
/// @return whether (x,y) is contained inside the box.
|
||||
/// @ingroup screen
|
||||
bool Box::Contain(int x, int y) const {
|
||||
return x_min <= x && //
|
||||
x_max >= x && //
|
||||
@@ -51,20 +47,17 @@ bool Box::Contain(int x, int y) const {
|
||||
}
|
||||
|
||||
/// @return whether the box is empty.
|
||||
/// @ingroup screen
|
||||
bool Box::IsEmpty() const {
|
||||
return x_min > x_max || y_min > y_max;
|
||||
}
|
||||
|
||||
/// @return whether |other| is the same as |this|
|
||||
/// @ingroup screen
|
||||
bool Box::operator==(const Box& other) const {
|
||||
return (x_min == other.x_min) && (x_max == other.x_max) &&
|
||||
(y_min == other.y_min) && (y_max == other.y_max);
|
||||
}
|
||||
|
||||
/// @return whether |other| and |this| are different.
|
||||
/// @ingroup screen
|
||||
bool Box::operator!=(const Box& other) const {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
@@ -74,20 +74,16 @@ std::string Color::Print(bool is_background_color) const {
|
||||
}
|
||||
|
||||
/// @brief Build a transparent color.
|
||||
/// @ingroup screen
|
||||
Color::Color() = default;
|
||||
|
||||
/// @brief Build a transparent color.
|
||||
/// @ingroup screen
|
||||
Color::Color(Palette1 /*value*/) : Color() {}
|
||||
|
||||
/// @brief Build a color using the Palette16 colors.
|
||||
/// @ingroup screen
|
||||
Color::Color(Palette16 index)
|
||||
: type_(ColorType::Palette16), red_(index), alpha_(255) {}
|
||||
|
||||
/// @brief Build a color using Palette256 colors.
|
||||
/// @ingroup screen
|
||||
Color::Color(Palette256 index)
|
||||
: type_(ColorType::Palette256), red_(index), alpha_(255) {
|
||||
if (Terminal::ColorSupport() >= Terminal::Color::Palette256) {
|
||||
@@ -104,7 +100,6 @@ Color::Color(Palette256 index)
|
||||
/// @param green The quantity of green [0,255]
|
||||
/// @param blue The quantity of blue [0,255]
|
||||
/// @param alpha The quantity of alpha [0,255]
|
||||
/// @ingroup screen
|
||||
Color::Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
|
||||
: type_(ColorType::TrueColor),
|
||||
red_(red),
|
||||
@@ -148,7 +143,6 @@ Color::Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
|
||||
/// @param red The quantity of red [0,255]
|
||||
/// @param green The quantity of green [0,255]
|
||||
/// @param blue The quantity of blue [0,255]
|
||||
/// @ingroup screen
|
||||
// static
|
||||
Color Color::RGB(uint8_t red, uint8_t green, uint8_t blue) {
|
||||
return RGBA(red, green, blue, 255);
|
||||
@@ -160,7 +154,6 @@ Color Color::RGB(uint8_t red, uint8_t green, uint8_t blue) {
|
||||
/// @param green The quantity of green [0,255]
|
||||
/// @param blue The quantity of blue [0,255]
|
||||
/// @param alpha The quantity of alpha [0,255]
|
||||
/// @ingroup screen
|
||||
/// @see Color::RGB
|
||||
// static
|
||||
Color Color::RGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) {
|
||||
@@ -174,7 +167,6 @@ Color Color::RGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) {
|
||||
/// @param s The "colorfulness" [0,255].
|
||||
/// @param v The "Lightness" [0,255]
|
||||
/// @param alpha The quantity of alpha [0,255]
|
||||
/// @ingroup screen
|
||||
// static
|
||||
Color Color::HSVA(uint8_t h, uint8_t s, uint8_t v, uint8_t alpha) {
|
||||
uint8_t region = h / 43; // NOLINT
|
||||
@@ -202,7 +194,6 @@ Color Color::HSVA(uint8_t h, uint8_t s, uint8_t v, uint8_t alpha) {
|
||||
/// @param h The hue of the color [0,255]
|
||||
/// @param s The "colorfulness" [0,255].
|
||||
/// @param v The "Lightness" [0,255]
|
||||
/// @ingroup screen
|
||||
// static
|
||||
Color Color::HSV(uint8_t h, uint8_t s, uint8_t v) {
|
||||
return HSVA(h, s, v, 255);
|
||||
|
||||
Reference in New Issue
Block a user