ncmpc  0.29
Data Structures | Typedefs | Functions
list_window.h File Reference
#include "config.h"
#include "command.h"
#include "colors.h"
#include "ncmpc_curses.h"
#include <glib.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  list_window
 
struct  list_window_range
 

Typedefs

typedef const char *(* list_window_callback_fn_t) (unsigned i, void *data)
 
typedef void(* list_window_paint_callback_t) (WINDOW *w, unsigned i, unsigned y, unsigned width, bool selected, const void *data)
 

Functions

struct list_windowlist_window_init (WINDOW *w, unsigned width, unsigned height)
 
void list_window_free (struct list_window *lw)
 
void list_window_reset (struct list_window *lw)
 
void list_window_resize (struct list_window *lw, unsigned width, unsigned height)
 
void list_window_set_length (struct list_window *lw, unsigned length)
 
void list_window_paint (const struct list_window *lw, list_window_callback_fn_t callback, void *callback_data)
 
void list_window_paint2 (const struct list_window *lw, list_window_paint_callback_t paint_callback, const void *callback_data)
 
bool list_window_cmd (struct list_window *lw, command_t cmd)
 
bool list_window_scroll_cmd (struct list_window *lw, command_t cmd)
 
void list_window_center (struct list_window *lw, unsigned n)
 
void list_window_scroll_to (struct list_window *lw, unsigned n)
 
void list_window_set_cursor (struct list_window *lw, unsigned i)
 
void list_window_move_cursor (struct list_window *lw, unsigned n)
 
void list_window_fetch_cursor (struct list_window *lw)
 
void list_window_get_range (const struct list_window *lw, struct list_window_range *range)
 
bool list_window_find (struct list_window *lw, list_window_callback_fn_t callback, void *callback_data, const char *str, bool wrap, bool bell_on_wrap)
 
bool list_window_rfind (struct list_window *lw, list_window_callback_fn_t callback, void *callback_data, const char *str, bool wrap, bool bell_on_wrap)
 
bool list_window_jump (struct list_window *lw, list_window_callback_fn_t callback, void *callback_data, const char *str)
 

Typedef Documentation

◆ list_window_callback_fn_t

typedef const char*(* list_window_callback_fn_t) (unsigned i, void *data)

◆ list_window_paint_callback_t

typedef void(* list_window_paint_callback_t) (WINDOW *w, unsigned i, unsigned y, unsigned width, bool selected, const void *data)

Function Documentation

◆ list_window_init()

struct list_window* list_window_init ( WINDOW *  w,
unsigned  width,
unsigned  height 
)

◆ list_window_free()

void list_window_free ( struct list_window lw)

◆ list_window_reset()

void list_window_reset ( struct list_window lw)

◆ list_window_resize()

void list_window_resize ( struct list_window lw,
unsigned  width,
unsigned  height 
)

◆ list_window_set_length()

void list_window_set_length ( struct list_window lw,
unsigned  length 
)

◆ list_window_paint()

void list_window_paint ( const struct list_window lw,
list_window_callback_fn_t  callback,
void *  callback_data 
)

◆ list_window_paint2()

void list_window_paint2 ( const struct list_window lw,
list_window_paint_callback_t  paint_callback,
const void *  callback_data 
)

◆ list_window_cmd()

bool list_window_cmd ( struct list_window lw,
command_t  cmd 
)

◆ list_window_scroll_cmd()

bool list_window_scroll_cmd ( struct list_window lw,
command_t  cmd 
)

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

◆ list_window_center()

void list_window_center ( struct list_window lw,
unsigned  n 
)

Centers the visible range around item n on the list.

◆ list_window_scroll_to()

void list_window_scroll_to ( struct list_window lw,
unsigned  n 
)

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

◆ list_window_set_cursor()

void list_window_set_cursor ( struct list_window lw,
unsigned  i 
)

Sets the position of the cursor. Disables range selection.

◆ list_window_move_cursor()

void list_window_move_cursor ( struct list_window lw,
unsigned  n 
)

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

◆ list_window_fetch_cursor()

void list_window_fetch_cursor ( struct list_window lw)

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

◆ list_window_get_range()

void list_window_get_range ( const struct list_window lw,
struct list_window_range range 
)

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

◆ list_window_find()

bool list_window_find ( struct list_window lw,
list_window_callback_fn_t  callback,
void *  callback_data,
const char *  str,
bool  wrap,
bool  bell_on_wrap 
)

◆ list_window_rfind()

bool list_window_rfind ( struct list_window lw,
list_window_callback_fn_t  callback,
void *  callback_data,
const char *  str,
bool  wrap,
bool  bell_on_wrap 
)

◆ list_window_jump()

bool list_window_jump ( struct list_window lw,
list_window_callback_fn_t  callback,
void *  callback_data,
const char *  str 
)