25 #define YUILogComponent "ncurses"
26 #include <yui/YUILog.h>
32 #define PAD_PAGESIZE 1024
37 #define MAX_PAD_HEIGHT NCursesWindow::maxcoord()
41 :
NCursesPad( lines > MAX_PAD_HEIGHT ? PAD_PAGESIZE : lines, cols )
42 , _vheight( lines > MAX_PAD_HEIGHT ? lines : 0 )
63 srect =
wrect( 0, wsze::min( mysze, drect.Sze ) );
64 maxdpos = drect.Pos +
srect.Sze - 1;
65 maxspos = mysze -
srect.Sze;
73 maxdpos = maxspos = 0;
79 void NCPad::resize(
wsze nsze )
84 || nsze.W !=
width() )
91 if ( nsze.H > MAX_PAD_HEIGHT )
94 NCursesPad::resize( PAD_PAGESIZE, nsze.W );
99 NCursesPad::resize( nsze.H, nsze.W );
111 void NCPad::updateScrollHint()
113 NCScrollHint::VSet(
srect.Sze.H + maxspos.L,
srect.Sze.H,
srect.Pos.L );
114 NCScrollHint::HSet(
srect.Sze.W + maxspos.C,
srect.Sze.W,
srect.Pos.C );
136 drect.Pos.L, drect.Pos.C,
137 maxdpos.L, maxdpos.C,
144 for (
int i = 0; i <= maxdpos.L; ++i )
150 drect.Pos.L, drect.Pos.C,
151 maxdpos.L, maxdpos.C,
165 void NCPad::wRecoded()
171 bool NCPad::handleInput( wint_t key )
Screen dimension (screen size) in the order height, width: (H, W)
NCursesWindow * destwin
Where to draw us (may be nullptr, not owned)
int vheight() const
The (virtual) height of the Pad (even if truncated).
int copywin(NCursesWindow &win, int sminrow, int smincol, int dminrow, int dmincol, int dmaxrow, int dmaxcol, bool overlay=TRUE)
Overlay or overwrite the rectangle in win given by dminrow,dmincol, dmaxrow,dmaxcol with the rectangl...
wpair between(const wpair &Min, const wpair &Max) const
a copy of this clamped between Min and Max
int clear()
Clear the window.
int maxy() const
Largest y coord in window.
int width() const
Number of columns in this window.
Screen position pair in the order line, column: (L, C)
int height() const
Number of lines in this window.
bool paging() const
Whether the Pad is truncated (we're paging).
NCPad(int lines, int cols, const NCWidget &p)
bool dclear
should destwin be cleared before contents is copied there
virtual int setpos(const wpos &newpos)
Set the visible position to newpos (but clamp by maxspos), then update.
A rectangle is defined by its position and size: wpos Pos, wsze Sze.
virtual void directDraw(NCursesWindow &w, const wrect at, unsigned lineno)
Directly draw a table item at a specific location.
wrect srect
Source rectangle: the visible part of this pad.