shithub: libacme

ref: dfe87a2482a58d297233aacea4b3b60562e40f6d
dir: /acme.h/

View raw version
#pragma lib "libacme.a"

enum {
	Eventsz = 256 * UTFmax,
};

typedef struct Win Win;
struct Win {
	int id;
	int ctl;
	int event;
	int addr;
	int data;
	void *aux;
};

Win *	wincreate(void);
void	winclose(Win *);
int		winopen(Win *, char *, int);
void	wintitle(Win *, char *, ...);
void	winctl(Win *, char *, ...);
void	winclear(Win *);
void	winappend(Win *, char *, ...);
void	winerror(Win *, char *,	...);
void	winaddtag(Win *, char *);
void	winsettag(Win *, char *);

typedef struct Event Event;
struct Event {
	char origin;	/* mouse, keyboard, etc. */
	char type;		/* delete, exec, etc. */
	int p;			/* click point */
	int q0, q1;		/* expanded text */
	int flags;
	int ntext;
	char text[Eventsz + 1];
};

int eventnext(Win *, Event *);
void eventsend(Win *, Event *);