shithub: libacme

Download patch

ref: 990163b7e4b442c321fbd4466627e80c1c439020
parent: b517e0beea8b1adc16160d99f4b5e5e9a4a5d3d6
author: james palmer <foura@biobuf.link>
date: Sun Jun 6 19:25:33 EDT 2021

reorganize acme.h, add some more comments

--- a/acme.h
+++ b/acme.h
@@ -5,15 +5,30 @@
 };
 
 typedef struct AWin AWin;
+typedef struct AEvent AEvent;
+
 struct AWin {
-	int id;
+	int id;		/* acme window id */
+	
+	/* file descriptors */
 	int ctl;
 	int event;
 	int addr;
 	int data;
-	void *aux;
+	
+	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);
@@ -24,17 +39,6 @@
 void	awinerror(AWin *, char *,	...);
 void	awinaddtag(AWin *, char *);
 void	awinsettag(AWin *, char *);
-
-typedef struct AEvent AEvent;
-struct AEvent {
-	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[AEventSz + 1];
-};
 
 int aeventnext(AWin *, AEvent *);
 void aeventsend(AWin *, AEvent *);