diff options
author | aiju <devnull@localhost> | 2014-07-30 15:57:14 +0200 |
---|---|---|
committer | aiju <devnull@localhost> | 2014-07-30 15:57:14 +0200 |
commit | 712fd30652d29dc9e936f11d7837d1cb079575fc (patch) | |
tree | 2915c820a5c05761f1d2ac4d525067f701aa474b /sys/src/cmd/spred/dat.h | |
parent | 555a05018b60b28bdfd6ada0310848c68fe20e48 (diff) |
added sprite editor spred
Diffstat (limited to 'sys/src/cmd/spred/dat.h')
-rw-r--r-- | sys/src/cmd/spred/dat.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/sys/src/cmd/spred/dat.h b/sys/src/cmd/spred/dat.h new file mode 100644 index 000000000..63ac1f75f --- /dev/null +++ b/sys/src/cmd/spred/dat.h @@ -0,0 +1,98 @@ +typedef struct Ident Ident; +typedef struct Win Win; +typedef struct Wintab Wintab; +typedef struct Pal Pal; +typedef struct Spr Spr; +typedef struct File File; + +enum { + BORDSIZ = 5, + MINSIZ = 3 * BORDSIZ, + SELSIZ = 2, + SCRBSIZ = 11, + SCRTSIZ = 14, + RUNEBLK = 4096, +}; + +enum { + DISB = NCOL, + NCOLS +}; + +enum { + CMD, + PAL, + SPR, + NTYPES +}; + +struct Wintab { + int (*init)(Win *); + void (*die)(Win *); + void (*click)(Win *, Mousectl *); + void (*menu)(Win *, Mousectl *); + int (*rmb)(Win *, Mousectl *); + void (*key)(Win *, Rune); + void (*draw)(Win *); + void (*zerox)(Win *, Win *); + u32int hexcols[NCOLS]; + Image *cols[NCOLS]; +}; + +struct Win { + Rectangle entire; + Rectangle inner; + Image *im; + Win *next, *prev; + Win *wnext, *wprev; + int type; + Wintab *tab; + + Frame fr; + Rune *runes; + int nrunes, arunes; + int toprune; + + int zoom; + Point scr; + File *f; + Rectangle sprr; +}; + +struct Ident { + uint type, dev; + Qid; +}; + +struct File { + int type; + Ref; + File *next, *prev; + char *name; + int change; + Ident id; + Win wins; +}; + +struct Pal { + File; + int ncol; + u32int *cols; + Image **ims; + int sel; +}; + +struct Spr { + File; + Pal *pal; + int w, h; + u32int *data; + char *palfile; +}; + +extern Win wlist; +extern File flist; +extern Win *actw, *actf, *cmdw; +extern Screen *scr; +extern Image *invcol; +extern int quitok; |