shithub: libacme

ref: 990163b7e4b442c321fbd4466627e80c1c439020
dir: /acme.h/

View raw version
#pragma lib "libacme.a"

enum {
	AEventSz = 256 * UTFmax,
};

typedef struct AWin AWin;
typedef struct AEvent AEvent;

struct AWin {
	int id;		/* acme window id */
	
	/* file descriptors */
	int ctl;
	int event;
	int addr;
	int data;
	
	void *aux;	/* user data */
};

struct AEvent {
	char origin;				/* mouse, keyboard, etc. */
	char type;					/* delete, exec, etc. */
	int p;						/* click point */
	int q0, q1;					/* expanded text */
	int flags;					/* event flags */
	int ntext;					/* how much text */
	char text[AEventSz + 1];	/* text from the event */
};

AWin *	awincreate(void);
void	awinclose(AWin *);
int		awinopen(AWin *, char *, int);
void	awintitle(AWin *, char *, ...);
void	awinctl(AWin *, char *, ...);
void	awinclear(AWin *);
void	awinappend(AWin *, char *, ...);
void	awinerror(AWin *, char *,	...);
void	awinaddtag(AWin *, char *);
void	awinsettag(AWin *, char *);

int aeventnext(AWin *, AEvent *);
void aeventsend(AWin *, AEvent *);