BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / terminal / TerminalBuffer.h
blobaa856beb6d291f19136ce5755fbeace3b276e900
1 /*
2 * Copyright 2013, Haiku, Inc. All rights reserved.
3 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Distributed under the terms of the MIT License.
6 * Authors:
7 * Ingo Weinhold, ingo_weinhold@gmx.de
8 * Siarzhuk Zharski, zharik@gmx.li
9 */
10 #ifndef TERMINAL_BUFFER_H
11 #define TERMINAL_BUFFER_H
13 #include <GraphicsDefs.h>
14 #include <Locker.h>
15 #include <Messenger.h>
17 #include "BasicTerminalBuffer.h"
20 class TerminalBuffer : public BasicTerminalBuffer, public BLocker {
21 public:
22 TerminalBuffer();
23 virtual ~TerminalBuffer();
25 status_t Init(int32 width, int32 height,
26 int32 historySize);
28 void SetListener(BMessenger listener);
29 void UnsetListener();
31 int Encoding() const;
32 void SetEncoding(int encoding);
34 void SetTitle(const char* title);
35 void SetColors(uint8* indexes, rgb_color* colors,
36 int32 count = 1, bool dynamic = false);
37 void ResetColors(uint8* indexes,
38 int32 count = 1, bool dynamic = false);
39 void SetCursorStyle(int32 style, bool blinking);
40 void SetCursorBlinking(bool blinking);
41 void SetCursorHidden(bool hidden);
42 void SetPaletteColor(uint8 index, rgb_color color);
43 rgb_color PaletteColor(uint8 index);
44 int GuessPaletteColor(int red, int green, int blue);
46 void NotifyQuit(int32 reason);
48 virtual status_t ResizeTo(int32 width, int32 height);
49 virtual status_t ResizeTo(int32 width, int32 height,
50 int32 historyCapacity);
52 void UseAlternateScreenBuffer(bool clear);
53 void UseNormalScreenBuffer();
55 void ReportX10MouseEvent(bool report);
56 void ReportNormalMouseEvent(bool report);
57 void ReportButtonMouseEvent(bool report);
58 void ReportAnyMouseEvent(bool report);
60 protected:
61 virtual void NotifyListener();
63 private:
64 void _SwitchScreenBuffer();
66 private:
67 int fEncoding;
69 TerminalLine** fAlternateScreen;
70 HistoryBuffer* fAlternateHistory;
71 int32 fAlternateScreenOffset;
72 uint32 fAlternateAttributes;
73 rgb_color* fColorsPalette;
75 // listener/dirty region management
76 BMessenger fListener;
77 bool fListenerValid;
81 #endif // TERMINAL_BUFFER_H