ncmpc  0.30
Public Member Functions | Data Fields
ListWindow Struct Reference

#include <ListWindow.hxx>

Public Member Functions

 ListWindow (WINDOW *_w, Size _size)
 
void Reset ()
 
void Resize (Size _size)
 
void SetLength (unsigned length)
 
void Paint (const ListRenderer &renderer) const
 
bool HandleCommand (command_t cmd)
 
bool HandleScrollCommand (command_t cmd)
 
void Center (unsigned n)
 
void ScrollTo (unsigned n)
 
void SetCursor (unsigned i)
 
void MoveCursor (unsigned n)
 
void MoveCursorNext ()
 
void MoveCursorPrevious ()
 
void MoveCursorTop ()
 
void MoveCursorMiddle ()
 
void MoveCursorBottom ()
 
void MoveCursorFirst ()
 
void MoveCursorLast ()
 
void MoveCursorNextPage ()
 
void MoveCursorPreviousPage ()
 
void ScrollUp (unsigned n)
 
void ScrollDown (unsigned n)
 
void FetchCursor ()
 
gcc_pure ListWindowRange GetRange () const
 
bool Find (const ListText &text, const char *str, bool wrap, bool bell_on_wrap)
 
bool ReverseFind (const ListText &text, const char *str, bool wrap, bool bell_on_wrap)
 
bool Jump (const ListText &text, const char *str)
 

Data Fields

WINDOW * w
 
Size size
 
unsigned length = 0
 
unsigned start = 0
 
unsigned selected = 0
 
unsigned range_base = 0
 
bool range_selection = false
 
bool hide_cursor = false
 

Constructor & Destructor Documentation

◆ ListWindow()

ListWindow::ListWindow ( WINDOW *  _w,
Size  _size 
)
inline

Member Function Documentation

◆ Reset()

void ListWindow::Reset ( )

reset a list window (selected=0, start=0)

◆ Resize()

void ListWindow::Resize ( Size  _size)

◆ SetLength()

void ListWindow::SetLength ( unsigned  length)

◆ Paint()

void ListWindow::Paint ( const ListRenderer renderer) const

◆ HandleCommand()

bool ListWindow::HandleCommand ( command_t  cmd)

perform basic list window commands (movement)

◆ HandleScrollCommand()

bool ListWindow::HandleScrollCommand ( command_t  cmd)

Scroll the window. Returns true if the command has been consumed.

◆ Center()

void ListWindow::Center ( unsigned  n)

Centers the visible range around item n on the list.

◆ ScrollTo()

void ListWindow::ScrollTo ( unsigned  n)

Scrolls the view to item n, as if the cursor would have been moved to the position.

◆ SetCursor()

void ListWindow::SetCursor ( unsigned  i)

Sets the position of the cursor. Disables range selection.

◆ MoveCursor()

void ListWindow::MoveCursor ( unsigned  n)

Moves the cursor. Modifies the range if range selection is enabled.

◆ MoveCursorNext()

void ListWindow::MoveCursorNext ( )

◆ MoveCursorPrevious()

void ListWindow::MoveCursorPrevious ( )

◆ MoveCursorTop()

void ListWindow::MoveCursorTop ( )

◆ MoveCursorMiddle()

void ListWindow::MoveCursorMiddle ( )

◆ MoveCursorBottom()

void ListWindow::MoveCursorBottom ( )

◆ MoveCursorFirst()

void ListWindow::MoveCursorFirst ( )

◆ MoveCursorLast()

void ListWindow::MoveCursorLast ( )

◆ MoveCursorNextPage()

void ListWindow::MoveCursorNextPage ( )

◆ MoveCursorPreviousPage()

void ListWindow::MoveCursorPreviousPage ( )

◆ ScrollUp()

void ListWindow::ScrollUp ( unsigned  n)

◆ ScrollDown()

void ListWindow::ScrollDown ( unsigned  n)

◆ FetchCursor()

void ListWindow::FetchCursor ( )

Ensures that the cursor is visible on the screen, i.e. it is not outside the current scrolling range.

◆ GetRange()

gcc_pure ListWindowRange ListWindow::GetRange ( ) const

Determines the lower and upper bound of the range selection. If range selection is disabled, it returns the cursor position (range length is 1).

◆ Find()

bool ListWindow::Find ( const ListText text,
const char *  str,
bool  wrap,
bool  bell_on_wrap 
)

Find a string in a list window.

◆ ReverseFind()

bool ListWindow::ReverseFind ( const ListText text,
const char *  str,
bool  wrap,
bool  bell_on_wrap 
)

Find a string in a list window (reversed).

◆ Jump()

bool ListWindow::Jump ( const ListText text,
const char *  str 
)

Find a string in a list window which begins with the given characters in *str.

Field Documentation

◆ w

WINDOW* ListWindow::w

◆ size

Size ListWindow::size

◆ length

unsigned ListWindow::length = 0

Number of items in this list.

◆ start

unsigned ListWindow::start = 0

◆ selected

unsigned ListWindow::selected = 0

◆ range_base

unsigned ListWindow::range_base = 0

Represents the base item.

◆ range_selection

bool ListWindow::range_selection = false

Range selection activated?

◆ hide_cursor

bool ListWindow::hide_cursor = false

The documentation for this struct was generated from the following file: