23 #ifndef FlexNCurses20091110H 24 #define FlexNCurses20091110H 30 #include <boost/thread.hpp> 32 #include "goby/common/time.h" 33 #include "term_color.h" 58 void add_win(
const Group* title);
63 void insert(boost::posix_time::ptime t,
const std::string& s,
Group* g);
69 size_t panel_from_group(
Group* g);
70 void recalculate_win();
72 void alive(
bool alive);
83 void putline(
const std::string& s,
unsigned scrn,
bool refresh =
true);
85 void putlines(
unsigned scrn,
86 const std::multimap<boost::posix_time::ptime, std::string>::const_iterator& alpha,
87 const std::multimap<boost::posix_time::ptime, std::string>::const_iterator& omega,
92 size_t find_containing_window(
int y,
int x);
95 bool in_window(
void* p,
int y,
int x);
97 void write_head_title(
size_t i);
100 void select(
size_t gt);
104 size_t down() {
return down(find_first_selected()); }
105 size_t up() {
return up(find_first_selected()); }
106 size_t left() {
return left(find_first_selected()); }
107 size_t right() {
return right(find_first_selected()); }
108 size_t down(
size_t curr);
109 size_t up(
size_t curr);
110 size_t left(
size_t curr);
111 size_t right(
size_t curr);
112 size_t find_first_selected();
113 void shift(
size_t next);
115 bool last_in_col(
size_t val);
116 bool first_in_col(
size_t val);
124 void uncombine_all();
125 void uncombine(
size_t i);
126 void uncombine_selected();
127 int lines_from_beg(
int l,
size_t i);
144 void restore_order();
146 void toggle_minimized(
int i);
147 void redraw_lines(
int j,
int offset = -1);
149 std::multimap<boost::posix_time::ptime, std::string> get_history(
size_t i,
int how_much = -1);
150 size_t get_history_size(
size_t i);
152 template <
typename T> T min(
const T& a,
const T& b) {
return (a < b ? a : b); }
154 template <
typename T> T max(
const T& a,
const T& b) {
return (a > b ? a : b); }
167 std::vector<void*> vert_windows_;
169 std::vector<void*> col_end_windows_;
178 Panel(
const Group* group = 0)
179 : group_(group), window_(0), head_window_(0), minimized_(
false), selected_(
false),
180 locked_(
false), col_(1), lines_from_beg_(0), original_order_(0), max_hist_(20000)
184 void window(
void* v) { window_ = v; }
185 void head_window(
void* v) { head_window_ = v; }
186 void group(
const Group* g) { group_ = g; }
188 void set_minimized(
bool b) { minimized_ = b; }
189 int minimized(
bool b);
190 int toggle_minimized() {
return minimized(minimized() ^
true); }
191 void selected(
bool b) { selected_ = b; }
192 void ywidth(
int i) { ywidth_ = i; }
193 int lines_from_beg(
int i);
194 void grow() { ++ywidth_; }
195 void locked(
bool b) { locked_ = b; }
198 if (ywidth_ == HEAD_Y)
206 void col(
int i) { col_ = i; }
207 void original_order(
int i) { original_order_ = i; }
208 void add_combined(
size_t i) { combined_.insert(i); }
209 void clear_combined() { combined_.clear(); }
211 void* window()
const {
return window_; }
212 void* head_window()
const {
return head_window_; }
213 const Group* group()
const {
return group_; }
214 bool minimized()
const {
return minimized_; }
215 bool selected()
const {
return selected_; }
216 int ywidth()
const {
return ywidth_; }
217 int col()
const {
return col_; }
218 bool locked()
const {
return locked_; }
219 int lines_from_beg()
const {
return lines_from_beg_; }
220 int original_order()
const {
return original_order_; }
221 std::multimap<boost::posix_time::ptime, std::string>& history() {
return history_; }
222 unsigned max_hist()
const {
return max_hist_; }
223 const std::set<size_t>& combined()
const {
return combined_; }
233 int unminimized_ywidth_;
238 std::multimap<boost::posix_time::ptime, std::string> history_;
239 std::set<size_t> combined_;
242 std::vector<Panel> panels_;
243 std::set<size_t> unique_panels_;
247 std::vector<int> line_buffer_;
Color
The eight terminal colors (and bold or "light" variants)
void run_input()
run in its own thread to take input from the user
void insert(boost::posix_time::ptime t, const std::string &s, Group *g)
Add a string to the gui.
The global namespace for the Goby project.
Enables the Verbosity == gui mode of the Goby logger and displays an NCurses gui for the logger conte...
Defines a group of messages to be sent to the Goby logger. For Verbosity == verbose streams...