X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fminibuffer.h;h=f9b60d17473f8f1c11485c290353dea1eaa6c4fd;hb=4148a9244547e7184c1dcc8234e9e62d3143a42c;hp=7c214d6f28f8b4cee5c35c68790d3d2e2ecead63;hpb=a8a90bf854958562ddf588e3eddbc2b7cfa7f976;p=lyx.git diff --git a/src/minibuffer.h b/src/minibuffer.h index 7c214d6f28..f9b60d1747 100644 --- a/src/minibuffer.h +++ b/src/minibuffer.h @@ -1,6 +1,6 @@ // -*- C++ -*- -#ifndef _MINIBUFFER_H -#define _MINIBUFFER_H +#ifndef MINIBUFFER_H +#define MINIBUFFER_H #include FORMS_H_LOCATION #include "LString.h" @@ -16,14 +16,9 @@ class LyXView; class MiniBuffer { public: /// - MiniBuffer(LyXView *o, FL_Coord x, FL_Coord y, FL_Coord h, FL_Coord w) - : owner(o) - { - text = _("Welcome to LyX!"); - shows_no_match = true; - history_idx = history_cnt = 0; - add(FL_NORMAL_INPUT, x, y, h, w); - } + MiniBuffer(LyXView * o, + FL_Coord x, FL_Coord y, FL_Coord h, FL_Coord w); + /// bool shows_no_match; /// @@ -31,12 +26,12 @@ public: fl_set_timer(timer, a); } /// - void Set(string const& = string(), - string const& = string(), - string const& = string(), - int delay_secs=6); + void Set(string const & = string(), + string const & = string(), + string const & = string(), + int delay_secs= 6); /// - string GetText() const { return text; } + string const GetText() const { return text; } /// void Init(); /// @@ -60,34 +55,38 @@ public: int, void *); private: /// - LyXView *owner; + LyXView * owner; /// string text; /// string text_stored; /// - FL_OBJECT *add(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord); + FL_OBJECT * add(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord); /// - FL_OBJECT *timer; + FL_OBJECT * timer; /// - FL_OBJECT *the_buffer; + FL_OBJECT * the_buffer; /// string cur_cmd; /// enum{ MAX_HISTORY = 10 }; /// - string history[MAX_HISTORY]; + mutable string history[MAX_HISTORY]; /// - int history_idx, history_cnt; + mutable int history_idx; + /// + mutable int history_cnt; /// - void addHistory(string const &cmd) { - if (history_cnt==0 || (history_cnt>0 && cmd!=history[(history_cnt-1) % MAX_HISTORY])) { + void addHistory(string const & cmd) const { + if (history_cnt == 0 + || (history_cnt > 0 + && cmd != history[(history_cnt - 1) % MAX_HISTORY])) { history[history_cnt % MAX_HISTORY] = cmd; - history_cnt++; + ++history_cnt; } history_idx = history_cnt; } /// - string getHistory() { return history[history_idx % MAX_HISTORY]; } + string const getHistory() const { return history[history_idx % MAX_HISTORY]; } }; #endif