summaryrefslogtreecommitdiffstats
path: root/src/pane.h
blob: e58cfd0e4582f2037cdf9df7c38648d0c111319e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include "ncurses.h"

#include <wchar.h>

struct pane;

typedef int (*pane_handler)(wint_t c);
typedef void (*pane_updater)(struct pane *pane, int sel);

struct pane {
	WINDOW *win;
	int sx, sy, ex, ey;
	int w, h;
	int active;

	pane_handler handle;
	pane_updater update;
};

void pane_init(struct pane *pane, pane_handler handle, pane_updater update);
void pane_resize(struct pane *pane, int sx, int sy, int ex, int ey);
void pane_free(struct pane *p);