2 * Copyright 2012-2015, Adrien Destugues, pulkomandy@gmail.com
3 * Distributed under the terms of the MIT licence.
15 class TermView
: public BView
19 TermView(BRect bounds
);
22 void AttachedToWindow();
23 void Draw(BRect updateRect
);
24 void FrameResized(float width
, float height
);
25 void GetPreferredSize(float* width
, float* height
);
26 void KeyDown(const char* bytes
, int32 numBytes
);
27 void MessageReceived(BMessage
* message
);
28 void SetLineTerminator(BString bytes
);
30 void PushBytes(const char* bytes
, const size_t length
);
35 VTermRect
_PixelsToGlyphs(BRect pixels
) const;
36 BRect
_GlyphsToPixels(const VTermRect
& glyphs
) const;
37 BRect
_GlyphsToPixels(const int width
, const int height
)
39 void _GetCell(VTermPos pos
, VTermScreenCell
& cell
);
41 void _Damage(VTermRect rect
);
42 void _MoveCursor(VTermPos pos
, VTermPos oldPos
,
44 void _PushLine(int cols
, const VTermScreenCell
* cells
);
46 static int _Damage(VTermRect rect
, void* user
);
47 static int _MoveCursor(VTermPos pos
, VTermPos oldPos
,
48 int visible
, void* user
);
49 static int _PushLine(int cols
, const VTermScreenCell
* cells
,
51 static int _PopLine(int cols
, const VTermScreenCell
* cells
,
56 VTermScreen
* fTermScreen
;
61 BString fLineTerminator
;
63 static const VTermScreenCallbacks sScreenCallbacks
;
65 static const int kDefaultWidth
= 80;
66 static const int kDefaultHeight
= 25;
67 static const int kBorderSpacing
= 3;
68 static const int kScrollBackSize
= 1000;