]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/spred/dat.h
exec(2): fix prototypes
[plan9front.git] / sys / src / cmd / spred / dat.h
1 typedef struct Ident Ident;
2 typedef struct Win Win;
3 typedef struct Wintab Wintab;
4 typedef struct Pal Pal;
5 typedef struct Spr Spr;
6 typedef struct File File;
7
8 enum {
9         BORDSIZ = 5,
10         MINSIZ = 3 * BORDSIZ,
11         SELSIZ = 2,
12         SCRBSIZ = 11,
13         SCRTSIZ = 14,
14         RUNEBLK = 4096,
15 };
16
17 enum {
18         DISB = NCOL,
19         NCOLS
20 };
21
22 enum {
23         CMD,
24         PAL,
25         SPR,
26         NTYPES
27 };
28
29 struct Wintab {
30         int (*init)(Win *);
31         void (*die)(Win *);
32         void (*click)(Win *, Mousectl *);
33         void (*menu)(Win *, Mousectl *);
34         int (*rmb)(Win *, Mousectl *);
35         void (*key)(Win *, Rune);
36         void (*draw)(Win *);
37         void (*zerox)(Win *, Win *);
38         u32int hexcols[NCOLS];
39         Image *cols[NCOLS];
40 };
41
42 struct Win {
43         Rectangle entire;
44         Rectangle inner;
45         Image *im;
46         Win *next, *prev;
47         Win *wnext, *wprev;
48         int type;
49         Wintab *tab;
50         
51         Frame fr;
52         Rune *runes;
53         int nrunes, arunes, opoint;
54         int toprune;
55         
56         int zoom;
57         Point scr;
58         File *f;
59         Rectangle sprr;
60 };
61
62 struct Ident {
63         uint type, dev;
64         Qid;
65 };
66
67 struct File {
68         int type;
69         Ref;
70         File *next, *prev;
71         char *name;
72         int change;
73         Ident id;
74         Win wins;
75 };
76
77 struct Pal {
78         File;
79         int ncol;
80         u32int *cols;
81         Image **ims;
82         int sel;
83 };
84
85 struct Spr {    
86         File;
87         Pal *pal;
88         int w, h;
89         u32int *data;
90         char *palfile;
91 };
92
93 extern Win wlist;
94 extern File flist;
95 extern Win *actw, *actf, *cmdw;
96 extern Screen *scr;
97 extern Image *invcol;
98 extern int quitok;