aboutsummaryrefslogtreecommitdiff
path: root/util/fbrun/FbRun.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-11-12 19:20:31 (GMT)
committerfluxgen <fluxgen>2002-11-12 19:20:31 (GMT)
commit4897fc22888c52ba28af48e9bc57465a86ea3d2e (patch)
treea20ea83cc7768ac187299bddb729d6d9a873fdbd /util/fbrun/FbRun.hh
parentd1292fc5999ec46c2bab9645675bdda11b2d9b04 (diff)
downloadfluxbox-4897fc22888c52ba28af48e9bc57465a86ea3d2e.zip
fluxbox-4897fc22888c52ba28af48e9bc57465a86ea3d2e.tar.bz2
added history
Diffstat (limited to 'util/fbrun/FbRun.hh')
-rw-r--r--util/fbrun/FbRun.hh16
1 files changed, 13 insertions, 3 deletions
diff --git a/util/fbrun/FbRun.hh b/util/fbrun/FbRun.hh
index ba7bf25..5c8a2dc 100644
--- a/util/fbrun/FbRun.hh
+++ b/util/fbrun/FbRun.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbRun.hh,v 1.2 2002/11/12 16:47:37 fluxgen Exp $ 22// $Id: FbRun.hh,v 1.3 2002/11/12 19:20:31 fluxgen Exp $
23 23
24#ifndef FBRUN_HH 24#ifndef FBRUN_HH
25#define FBRUN_HH 25#define FBRUN_HH
@@ -28,10 +28,10 @@
28#include "Font.hh" 28#include "Font.hh"
29 29
30#include <string> 30#include <string>
31#include <vector>
31 32
32/** 33/**
33 Creates and managed a run window 34 Creates and managed a run window
34 TODO: a command history
35*/ 35*/
36class FbRun: public FbTk::EventHandler<XEvent> { 36class FbRun: public FbTk::EventHandler<XEvent> {
37public: 37public:
@@ -54,9 +54,16 @@ public:
54 const FbTk::Font &font() const { return m_font; } 54 const FbTk::Font &font() const { return m_font; }
55 /// execute command and exit 55 /// execute command and exit
56 void run(const std::string &execstring); 56 void run(const std::string &execstring);
57 /// is this object done? 57 /// is this application done?
58 bool end() const { return m_end; } 58 bool end() const { return m_end; }
59 /**
60 loads history file.
61 @return true on success, else false
62 */
63 bool loadHistory(const char *filename);
59private: 64private:
65 void nextHistoryItem();
66 void prevHistoryItem();
60 void drawString(int x, int y, const char *text, size_t len); 67 void drawString(int x, int y, const char *text, size_t len);
61 void getSize(size_t &width, size_t &height); 68 void getSize(size_t &width, size_t &height);
62 void createWindow(int x, int y, size_t width, size_t height); 69 void createWindow(int x, int y, size_t width, size_t height);
@@ -72,6 +79,9 @@ private:
72 int m_bevel; ///< distance to window edge from font in pixels 79 int m_bevel; ///< distance to window edge from font in pixels
73 GC m_gc; 80 GC m_gc;
74 bool m_end; 81 bool m_end;
82 std::vector<std::string> m_history; ///< history list of commands
83 size_t m_current_history_item;
84 std::string m_history_file;
75}; 85};
76 86
77#endif // FBRUN_HH 87#endif // FBRUN_HH