ref: 0cd1f6455c02fe0c2ade3e630debb315f054b253
dir: /fns.h/
#define BIT(b) (0x01 << (b))
#define RECTANGLE(w, h) ((Rectangle){(Point){(0),(0)}, (Point){(w),(h)}})
#define NOOP() ((void)(nil))
#define ARRLEN(a) ((sizeof(a))/(sizeof(a[0])))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
ulong msec(void);
void setbackground(ulong col);
void drawcanvas(void);
void applyzoom(void);
void zoom(float);
void zoomin(void);
void zoomout(void);
void stroke(void);
void clearlayer(Layer *);
void clearview(void);
void setbrushcolor(ulong col);
int resizeimage(Image *, Rectangle, float, Image *, Point);
int newlayerimage(Layer *);
void centercanvas(void);
Layer * newlayer(void);
void ntfprint(char *, ...);
void setcurrentlayer(Layer *);
Point mulptf(Point, float);
int rectcut(Rectangle *, Rectangle);
Point globaltoscreenpt(Point p);
Point globaltoscreenatcanvaspt(Point p);
Point screentocanvaspt(Point p);
Point canvastoscreenpt(Point p);
Point screentoglobalpt(Point p);
Point screentoglobalatcanvaspt(Point p);
// fs
int fsinit(char *);
void fsclose(void);
// bindings
void freebinding(Binding * b);
int removebindings(int, int);
Binding * addbinding(int, int);
int runbindings(int, int);
Binding * adduniquebinding(int, int);
void setdefaultbindings(void);
// utils
void quitloop(void);
int newtask(ulong, void (*)(void));
int removetask(int);
void runtasks(void);