2020-02-20 04:00:52 +00:00
|
|
|
% notcurses_reel(3)
|
2020-01-04 07:37:55 +00:00
|
|
|
% nick black <nickblack@linux.com>
|
2020-02-20 09:46:23 +00:00
|
|
|
% v1.2.1
|
2020-01-04 07:37:55 +00:00
|
|
|
|
|
|
|
# NAME
|
|
|
|
|
2020-02-20 04:00:52 +00:00
|
|
|
notcurses_reel - high-level widget for hierarchical data
|
2020-01-04 07:37:55 +00:00
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
|
|
|
**#include <notcurses.h>**
|
|
|
|
|
|
|
|
```c
|
2020-02-05 22:29:42 +00:00
|
|
|
typedef struct ncreel_options {
|
2020-01-04 07:37:55 +00:00
|
|
|
// require this many rows and columns (including borders).
|
|
|
|
// otherwise, a message will be displayed stating that a
|
|
|
|
// larger terminal is necessary, and input will be queued.
|
|
|
|
// if 0, no minimum will be enforced. may not be negative.
|
2020-02-05 22:29:42 +00:00
|
|
|
// note that ncreel_create() does not return error if
|
2020-01-04 07:37:55 +00:00
|
|
|
// given a WINDOW smaller than these minima; it instead
|
|
|
|
// patiently waits for the screen to get bigger.
|
|
|
|
int min_supported_cols;
|
|
|
|
int min_supported_rows;
|
|
|
|
|
|
|
|
// use no more than this many rows and columns (including
|
|
|
|
// borders). may not be less than the corresponding minimum.
|
|
|
|
// 0 means no maximum.
|
|
|
|
int max_supported_cols;
|
|
|
|
int max_supported_rows;
|
|
|
|
|
|
|
|
// desired offsets within the surrounding WINDOW (top right
|
2020-02-18 12:12:25 +00:00
|
|
|
// bottom left) upon creation / resize. an ncreel_move()
|
2020-01-04 07:37:55 +00:00
|
|
|
// operation updates these.
|
|
|
|
int toff, roff, boff, loff;
|
|
|
|
// is scrolling infinite (can one move down or up forever, or is
|
|
|
|
// an end reached?). if true, 'circular' specifies how to handle
|
|
|
|
// the special case of an incompletely-filled reel.
|
|
|
|
bool infinitescroll;
|
|
|
|
// is navigation circular (does moving down from the last panel
|
|
|
|
// move to the first, and vice versa)? only meaningful when
|
|
|
|
// infinitescroll is true. if infinitescroll is false, this must
|
|
|
|
// be false.
|
|
|
|
bool circular;
|
2020-02-05 22:29:42 +00:00
|
|
|
// notcurses can draw a border around the ncreel, and also
|
2020-01-04 07:37:55 +00:00
|
|
|
// around the component tablets. inhibit borders by setting all
|
|
|
|
// valid bits in the masks. partially inhibit borders by setting
|
|
|
|
// individual bits in the masks. the appropriate attr and pair
|
|
|
|
// values will be used to style the borders. focused and
|
|
|
|
// non-focused tablets can have different styles. you can instead
|
|
|
|
// draw your own borders, or forgo borders entirely.
|
|
|
|
unsigned bordermask; // bitfield; 1s will not be drawn
|
2020-02-05 22:29:42 +00:00
|
|
|
uint64_t borderchan; // attributes used for ncreel border
|
2020-01-04 07:37:55 +00:00
|
|
|
unsigned tabletmask; // bitfield for tablet borders
|
|
|
|
uint64_t tabletchan; // tablet border styling channel
|
|
|
|
uint64_t focusedchan;// focused tablet border styling channel
|
|
|
|
uint64_t bgchannel; // background colors
|
2020-02-05 22:29:42 +00:00
|
|
|
} ncreel_options;
|
2020-01-04 07:37:55 +00:00
|
|
|
```
|
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**struct ncreel* ncreel_create(struct ncplane* nc, const ncreel_options* popts, int efd);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-05 22:29:42 +00:00
|
|
|
**struct ncplane* ncreel_plane(struct ncreel* nr);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**typedef int (*tabletcb)(struct nctablet* t, int begx, int begy, int maxx, int maxy, bool cliptop);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**struct nctablet* ncreel_add(struct ncreel* nr, struct nctablet* after, struct nctablet* before, tabletcb cb, void* opaque);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-05 22:29:42 +00:00
|
|
|
**int ncreel_tabletcount(const struct ncreel* nr);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**int ncreel_touch(struct ncreel* nr, struct nctablet* t);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**int ncreel_del(struct ncreel* nr, struct nctablet* t);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-05 22:29:42 +00:00
|
|
|
**int ncreel_del_focused(struct ncreel* nr);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-05 22:29:42 +00:00
|
|
|
**int ncreel_move(struct ncreel* nr, int x, int y);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-05 22:29:42 +00:00
|
|
|
**int ncreel_redraw(struct ncreel* nr);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**struct nctablet* ncreel_focused(struct ncreel* nr);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**struct nctablet* ncreel_next(struct ncreel* nr);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**struct nctablet* ncreel_prev(struct ncreel* nr);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-05 22:29:42 +00:00
|
|
|
**int ncreel_destroy(struct ncreel* nr);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**void* nctablet_userptr(struct nctablet* t);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-02-06 01:04:56 +00:00
|
|
|
**struct ncplane* nctablet_ncplane(struct nctablet* t);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
|
|
|
# RETURN VALUES
|
|
|
|
|
|
|
|
# SEE ALSO
|
|
|
|
|
|
|
|
**notcurses(3)**, **notcurses_ncplane(3)**
|