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.
7 * Ingo Weinhold, ingo_weinhold@gmx.de
8 * Siarzhuk Zharski, zharik@gmx.li
10 #ifndef TERMINAL_BUFFER_H
11 #define TERMINAL_BUFFER_H
13 #include <GraphicsDefs.h>
15 #include <Messenger.h>
17 #include "BasicTerminalBuffer.h"
20 class TerminalBuffer
: public BasicTerminalBuffer
, public BLocker
{
23 virtual ~TerminalBuffer();
25 status_t
Init(int32 width
, int32 height
,
28 void SetListener(BMessenger listener
);
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
);
61 virtual void NotifyListener();
64 void _SwitchScreenBuffer();
69 TerminalLine
** fAlternateScreen
;
70 HistoryBuffer
* fAlternateHistory
;
71 int32 fAlternateScreenOffset
;
72 uint32 fAlternateAttributes
;
73 rgb_color
* fColorsPalette
;
75 // listener/dirty region management
81 #endif // TERMINAL_BUFFER_H