2014-07-11 03:27:04 +04:00
|
|
|
#ifndef face_hh_INCLUDED
|
|
|
|
#define face_hh_INCLUDED
|
|
|
|
|
|
|
|
#include "color.hh"
|
2014-11-12 23:31:56 +03:00
|
|
|
#include "flags.hh"
|
2014-07-11 03:27:04 +04:00
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
2014-07-15 23:11:47 +04:00
|
|
|
enum class Attribute : int
|
|
|
|
{
|
|
|
|
Normal = 0,
|
|
|
|
Underline = 1 << 1,
|
|
|
|
Reverse = 1 << 2,
|
|
|
|
Blink = 1 << 3,
|
|
|
|
Bold = 1 << 4,
|
|
|
|
Dim = 1 << 5
|
2014-07-11 03:27:04 +04:00
|
|
|
};
|
|
|
|
|
2014-11-12 23:31:56 +03:00
|
|
|
template<> struct WithBitOps<Attribute> : std::true_type {};
|
2014-07-15 23:11:47 +04:00
|
|
|
|
2014-07-11 03:27:04 +04:00
|
|
|
struct Face
|
|
|
|
{
|
|
|
|
Color fg;
|
|
|
|
Color bg;
|
|
|
|
Attribute attributes;
|
|
|
|
|
2015-04-25 12:47:39 +03:00
|
|
|
constexpr Face(Color fg = Color::Default, Color bg = Color::Default,
|
2014-07-15 23:11:47 +04:00
|
|
|
Attribute attributes = Attribute::Normal)
|
2014-07-11 03:27:04 +04:00
|
|
|
: fg{fg}, bg{bg}, attributes{attributes} {}
|
|
|
|
};
|
|
|
|
|
2015-03-21 19:32:22 +03:00
|
|
|
constexpr bool operator==(const Face& lhs, const Face& rhs)
|
2014-07-11 03:27:04 +04:00
|
|
|
{
|
|
|
|
return lhs.fg == rhs.fg and
|
|
|
|
lhs.bg == rhs.bg and
|
|
|
|
lhs.attributes == rhs.attributes;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:32:22 +03:00
|
|
|
constexpr bool operator!=(const Face& lhs, const Face& rhs)
|
2014-07-11 03:27:04 +04:00
|
|
|
{
|
|
|
|
return not (lhs == rhs);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // face_hh_INCLUDED
|