Skip to content

Commit

Permalink
don't expose nctree in 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Feb 18, 2021
1 parent 3603a2a commit 2741b04
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 590 deletions.
1 change: 0 additions & 1 deletion doc/man/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ <h3>C library (section 3)</h3>
<a href="notcurses_stats.3.html">notcurses_stats</a>—notcurses runtime statistics<br/>
<a href="notcurses_stdplane.3.html">notcurses_stdplane</a>—acquire the standard <tt>ncplane</tt><br/>
<a href="notcurses_stop.3.html">notcurses_stop</a>—collapse the context<br/>
<a href="notcurses_tree.3.html">notcurses_tree</a>—high-level hierarchical line-based data<br/>
<a href="notcurses_visual.3.html">notcurses_visual</a>—operations on <tt>ncvisual</tt> objects<br/>
</div>
<div style="float:right;clear:right">
Expand Down
2 changes: 0 additions & 2 deletions doc/man/man3/notcurses.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ A few high-level widgets are included, all built atop ncplanes:
* **notcurses_reader(3)** for free-form input data
* **notcurses_reel(3)** for hierarchal display of block-based data
* **notcurses_selector(3)** for selecting one item from a set
* **notcurses_tree(3)** for hierarchal display of line-based data

## Threads

Expand Down Expand Up @@ -187,7 +186,6 @@ order to turn most error returns into exceptions.
**notcurses_stats(3)**,
**notcurses_stdplane(3)**,
**notcurses_stop(3)**,
**notcurses_tree(3)**,
**notcurses_visual(3)**,
**terminfo(5)**, **ascii(7)**, **utf-8(7)**,
**unicode(7)**
9 changes: 1 addition & 8 deletions doc/man/man3/notcurses_reel.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ tablet, unless no tablets exist, in which case they return **NULL**.

**ncreel_add** returns the newly-added **nctablet**.

# NOTES

**ncreel** shares many properties with **notcurses_tree**. Unlike the latter,
**ncreel**s supply only a single level of hierarchy, and allow elements to
come and go across the lifetime of the widget.

# BUGS

I can't decide whether to require the user to explicitly call **ncreel_redraw**.
Expand All @@ -143,5 +137,4 @@ things more complicated for both me and the user.

**notcurses(3)**,
**notcurses_input(3)**,
**notcurses_plane(3)**,
**notcurses_tree(3)**
**notcurses_plane(3)**
94 changes: 0 additions & 94 deletions doc/man/man3/notcurses_tree.3.md

This file was deleted.

67 changes: 0 additions & 67 deletions include/notcurses/notcurses.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ struct ncreader; // widget supporting free string input ala readline
struct ncfadectx; // context for a palette fade operation
struct nctablet; // grouped item within an ncreel
struct ncreel; // hierarchical block-based data browser
struct nctree; // hierarchical line-based data browser

// we never blit full blocks, but instead spaces (more efficient) with the
// background set to the desired foreground.
Expand Down Expand Up @@ -2998,72 +2997,6 @@ API bool ncmultiselector_offer_input(struct ncmultiselector* n, const ncinput* n
// Destroy the ncmultiselector.
API void ncmultiselector_destroy(struct ncmultiselector* n);

// nctree widget -- a vertical browser supporting line-based hierarchies.
//
// each item can have subitems, and has a curry. there is one callback for the
// entirety of the nctree. visible items have the callback invoked upon their
// curry and an ncplane. the ncplane can be reused across multiple invocations
// of the callback.

// each item has a curry, and zero or more subitems.
typedef struct nctree_item {
void* curry;
struct nctree_item* subs;
unsigned subcount;
} nctree_item;

typedef struct nctree_options {
const nctree_item* items; // top-level nctree_item array
unsigned count; // size of |items|
uint64_t bchannels; // base channels
int (*nctreecb)(struct ncplane*, void*, int); // item callback function
uint64_t flags; // bitfield of NCTREE_OPTION_*
} nctree_options;

// |opts| may *not* be NULL, since it is necessary to define a callback
// function.
API ALLOC struct nctree* nctree_create(struct ncplane* n, const nctree_options* opts)
__attribute__ ((nonnull (1, 2)));

// Returns the ncplane on which this nctree lives.
API struct ncplane* nctree_plane(struct nctree* n)
__attribute__ ((nonnull (1)));

// Redraw the nctree 'n' in its entirety. The tree will be cleared, and items
// will be lain out, using the focused item as a fulcrum. Item-drawing
// callbacks will be invoked for each visible item.
API int nctree_redraw(struct nctree* n)
__attribute__ ((nonnull (1)));

// Offer input 'ni' to the nctree 'n'. If it's relevant, this function returns
// true, and the input ought not be processed further. If it's irrelevant to
// the tree, false is returned. Relevant inputs include:
// * a mouse click on an item (focuses item)
// * a mouse scrollwheel event (srolls tree)
// * up, down, pgup, or pgdown (navigates among items)
API bool nctree_offer_input(struct nctree* n, const ncinput* ni)
__attribute__ ((nonnull (1, 2)));

// Return the focused item, if any items are present. This is not a copy;
// be careful to use it only for the duration of a critical section.
API void* nctree_focused(struct nctree* n) __attribute__ ((nonnull (1)));

// Change focus to the next item.
API void* nctree_next(struct nctree* n) __attribute__ ((nonnull (1)));

// Change focus to the previous item.
API void* nctree_prev(struct nctree* n) __attribute__ ((nonnull (1)));

// Go to the item specified by the array |spec| having |specdepth| elements. If
// the spec is invalid, NULL is returned, and the depth of the first invalid
// spec is written to *|failspec|. Otherwise, |specdepth| is written to
// *|failspec|, and the curry is returned (|failspec| is necessary because the
// curry could itself be NULL).
API void* nctree_goto(struct nctree* n, const int* spec, size_t specdepth, int* failspec);

// Destroy the nctree.
API void nctree_destroy(struct nctree* n);

// Menus. Horizontal menu bars are supported, on the top and/or bottom rows.
// If the menu bar is longer than the screen, it will be only partially
// visible. Menus may be either visible or invisible by default. In the event of
Expand Down
Loading

0 comments on commit 2741b04

Please sign in to comment.