|
|
|
@ -2004,34 +2004,46 @@ struct ncplane* ncreel_plane(struct ncreel* pr);
|
|
|
|
|
// which must be less than or equal to ncplane_dim_y(nctablet_plane(t)).
|
|
|
|
|
typedef int (*tabletcb)(struct nctablet* t, bool cliptop);
|
|
|
|
|
|
|
|
|
|
// Add a new tablet to the provided ncreel, having the callback object
|
|
|
|
|
// Add a new nctablet to the provided ncreel, having the callback object
|
|
|
|
|
// opaque. Neither, either, or both of after and before may be specified. If
|
|
|
|
|
// neither is specified, the new tablet can be added anywhere on the reel. If
|
|
|
|
|
// one or the other is specified, the tablet will be added before or after the
|
|
|
|
|
// specified tablet. If both are specified, the tablet will be added to the
|
|
|
|
|
// resulting location, assuming it is valid (after->next == before->prev); if
|
|
|
|
|
// it is not valid, or there is any other error, NULL will be returned.
|
|
|
|
|
// Calls ncreel_redraw() upon success.
|
|
|
|
|
struct nctablet* ncreel_add(struct ncreel* pr, struct nctablet* after,
|
|
|
|
|
struct nctablet* before, tabletcb cb, void* opaque);
|
|
|
|
|
struct nctablet* before, tabletcb cb,
|
|
|
|
|
void* opaque);
|
|
|
|
|
|
|
|
|
|
// Return the number of tablets.
|
|
|
|
|
// Return the number of nctablets in the ncreel.
|
|
|
|
|
int ncreel_tabletcount(const struct ncreel* pr);
|
|
|
|
|
|
|
|
|
|
// Delete the tablet specified by t from the ncreel specified by pr. Returns
|
|
|
|
|
// -1 if the tablet cannot be found.
|
|
|
|
|
// -1 if the tablet cannot be found. Calls ncreel_redraw() on success.
|
|
|
|
|
int ncreel_del(struct ncreel* pr, struct nctablet* t);
|
|
|
|
|
|
|
|
|
|
// Redraw the ncreel in its entirety.
|
|
|
|
|
// Redraw the ncreel in its entirety. The reel will be cleared, and tablets
|
|
|
|
|
// will be lain out, using the focused tablet as a fulcrum. Tablet drawing
|
|
|
|
|
// callbacks will be invoked for each visible tablet.
|
|
|
|
|
int ncreel_redraw(struct ncreel* pr);
|
|
|
|
|
|
|
|
|
|
// Offer the input to the ncreel. If it's relevant, this function returns
|
|
|
|
|
// true, and the input ought not be processed further. If it's irrelevant to
|
|
|
|
|
// the reel, false is returned. Relevant inputs include:
|
|
|
|
|
// * a mouse click on a tablet (focuses tablet)
|
|
|
|
|
// * a mouse scrollwheel event (rolls reel)
|
|
|
|
|
// * up, down, pgup, or pgdown (navigates among items)
|
|
|
|
|
bool ncreel_offer_input(struct ncreel* n, const struct ncinput* nc);
|
|
|
|
|
|
|
|
|
|
// Return the focused tablet, if any tablets are present. This is not a copy;
|
|
|
|
|
// be careful to use it only for the duration of a critical section.
|
|
|
|
|
struct nctablet* ncreel_focused(struct ncreel* pr);
|
|
|
|
|
|
|
|
|
|
// Change focus to the next tablet, if one exists
|
|
|
|
|
// Change focus to the next tablet, if one exists. Calls ncreel_redraw().
|
|
|
|
|
struct nctablet* ncreel_next(struct ncreel* pr);
|
|
|
|
|
|
|
|
|
|
// Change focus to the previous tablet, if one exists
|
|
|
|
|
// Change focus to the previous tablet, if one exists. Calls ncreel_redraw().
|
|
|
|
|
struct nctablet* ncreel_prev(struct ncreel* pr);
|
|
|
|
|
|
|
|
|
|
// Destroy an ncreel allocated with ncreel_create(). Does not destroy the
|
|
|
|
|