diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2011-09-02 16:51:20 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2011-09-02 16:51:20 +0000 |
| commit | 535285d9e6008d0c635b85eb6dc9202a3aae11db (patch) | |
| tree | c5838219a067cbee262a79045f0cb5a71813c1f2 /src/display_buffer.hh | |
Initial commit
Diffstat (limited to 'src/display_buffer.hh')
| -rw-r--r-- | src/display_buffer.hh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/display_buffer.hh b/src/display_buffer.hh new file mode 100644 index 00000000..bde04bed --- /dev/null +++ b/src/display_buffer.hh @@ -0,0 +1,55 @@ +#ifndef display_buffer_hh_INCLUDED +#define display_buffer_hh_INCLUDED + +#include <string> +#include <vector> + +#include "buffer.hh" + +namespace Kakoune +{ + +typedef int Color; +typedef int Attribute; + +enum Attributes +{ + UNDERLINE = 1 +}; + +struct DisplayAtom +{ + std::string content; + Color fg_color; + Color bg_color; + Attribute attribute; + + DisplayAtom() : fg_color(0), bg_color(0), attribute(0) {} +}; + +class DisplayBuffer +{ +public: + typedef std::vector<DisplayAtom> AtomList; + typedef AtomList::iterator iterator; + typedef AtomList::const_iterator const_iterator; + + DisplayBuffer(); + + LineAndColumn dimensions() const; + + void clear() { m_atoms.clear(); } + void append(const DisplayAtom& atom) { m_atoms.push_back(atom); } + + iterator begin() { return m_atoms.begin(); } + iterator end() { return m_atoms.end(); } + + const_iterator begin() const { return m_atoms.begin(); } + const_iterator end() const { return m_atoms.end(); } +private: + AtomList m_atoms; +}; + +} + +#endif // display_buffer_hh_INCLUDED |
