pane.h (614B)
1#pragma once 2 3#define NCURSES_WIDECHAR 1 4 5#include <ncurses.h> 6 7#include <stdbool.h> 8 9struct pane; 10 11typedef bool (*pane_handler)(wint_t c); 12typedef void (*pane_updater)(struct pane *pane, int sel); 13 14struct pane { 15 WINDOW *win; 16 int sx, sy, ex, ey; 17 int w, h; 18 int active; 19 20 pane_handler handle; 21 pane_updater update; 22}; 23 24void pane_init(struct pane *pane, pane_handler handle, pane_updater update); 25void pane_deinit(struct pane *pane); 26 27void pane_resize(struct pane *pane, int sx, int sy, int ex, int ey); 28void pane_clearln(struct pane *pane, int y); 29void pane_writeln(struct pane *pane, int y, const char *line); 30