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-11-09 18:45:59 +00:00
|
|
|
% v2.0.3
|
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
|
|
|
|
|
2020-04-19 22:46:32 +00:00
|
|
|
**#include <notcurses/notcurses.h>**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
|
|
|
```c
|
2020-05-29 18:53:53 +00:00
|
|
|
#define NCREEL_OPTION_INFINITESCROLL 0x0001
|
|
|
|
#define NCREEL_OPTION_CIRCULAR 0x0002
|
2020-05-09 13:19:34 +00:00
|
|
|
|
2020-08-29 21:49:08 +00:00
|
|
|
struct ncreel;
|
|
|
|
struct nctablet;
|
|
|
|
|
2020-02-05 22:29:42 +00:00
|
|
|
typedef struct ncreel_options {
|
|
|
|
// 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
|
2020-11-06 23:15:57 +00:00
|
|
|
uint64_t flags; // bitfield over NCREEL_OPTION_*
|
2020-02-05 22:29:42 +00:00
|
|
|
} ncreel_options;
|
2020-01-04 07:37:55 +00:00
|
|
|
```
|
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**struct ncreel* ncreel_create(struct ncplane* ***nc***, const ncreel_options* ***popts***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**struct ncplane* ncreel_plane(struct ncreel* ***nr***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**typedef int (*tabletcb)(struct nctablet* ***t***, bool ***cliptop***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +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-11-06 21:49:35 +00:00
|
|
|
**int ncreel_tabletcount(const struct ncreel* ***nr***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**int ncreel_del(struct ncreel* ***nr***, struct nctablet* ***t***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**int ncreel_redraw(struct ncreel* ***nr***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**struct nctablet* ncreel_focused(struct ncreel* ***nr***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**struct nctablet* ncreel_next(struct ncreel* ***nr***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**struct nctablet* ncreel_prev(struct ncreel* ***nr***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**void ncreel_destroy(struct ncreel* ***nr***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**void* nctablet_userptr(struct nctablet* ***t***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2020-11-06 21:49:35 +00:00
|
|
|
**struct ncplane* nctablet_plane(struct nctablet* ***t***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
2020-08-29 21:49:08 +00:00
|
|
|
An **ncreel** is a widget for display and manipulation of hierarchal data,
|
|
|
|
intended to make effective use of the display area while supporting keyboards,
|
|
|
|
mice, and haptic interfaces. A series of **nctablet**s are ordered on a
|
|
|
|
virtual cylinder; the tablets can grow and shrink freely, while moving among
|
|
|
|
the tablets "spins" the cylinder. **ncreel**s support optional borders around
|
|
|
|
the reel and/or tablets.
|
|
|
|
|
|
|
|
**ncreel_redraw** arranges the tablets, invoking the **tabletcb** defined by
|
|
|
|
each. It will invoke the callbacks of only those tablets currently visible.
|
|
|
|
This function ought be called whenever the data within a tablet need be
|
|
|
|
refreshed. The return value of this callback is the number of lines drawn into
|
|
|
|
the **ncplane**. The tablet will be grown or shrunk as necessary to reflect
|
|
|
|
this return value.
|
|
|
|
|
|
|
|
Unless the reel is devoid of tablets, there is always a "focused" tablet (the
|
|
|
|
first tablet added to an empty reel becomes focused). The focused tablet can
|
|
|
|
change via **ncreel_next** and **ncreel_prev**. If **ncreel_del** is called on
|
|
|
|
the focused tablet, and at least one other tablet remains, some tablet receives
|
|
|
|
the focus.
|
|
|
|
|
2020-01-04 07:37:55 +00:00
|
|
|
# RETURN VALUES
|
|
|
|
|
|
|
|
# SEE ALSO
|
|
|
|
|
2020-05-09 00:56:39 +00:00
|
|
|
**notcurses(3)**,
|
|
|
|
**notcurses_plane(3)**
|