]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/omap/screen.h
devmouse: refactor screen blanking logic
[plan9front.git] / sys / src / 9 / omap / screen.h
1 typedef struct Cursor Cursor;
2 typedef struct Cursorinfo       Cursorinfo;
3 typedef struct OScreen OScreen;
4 typedef struct Omap3fb Omap3fb;
5 typedef struct Settings Settings;
6
7 struct Cursorinfo
8 {
9         Cursor;
10         Lock;
11 };
12
13 extern Cursor   arrow;
14 extern Cursorinfo cursor;
15
16 /* devmouse.c */
17 extern void mousetrack(int, int, int, ulong);
18 extern void absmousetrack(int, int, int, ulong);
19 extern Point mousexy(void);
20
21 extern void     mouseaccelerate(int);
22 extern void     mouseresize(void);
23 extern void     mouseredraw(void);
24
25 /* screen.c */
26 extern uchar* attachscreen(Rectangle*, ulong*, int*, int*, int*);
27 extern void     flushmemscreen(Rectangle);
28 extern void     cursoron(void);
29 extern void     cursoroff(void);
30 extern void     setcursor(Cursor*);
31 extern int      screensize(int, int, int, ulong);
32 extern int      screenaperture(int, int);
33 extern Rectangle physgscreenr;  /* actual monitor size */
34 extern void     blankscreen(int);
35
36 extern void swcursorinit(void);
37 extern void swcursorhide(void);
38 extern void swcursoravoid(Rectangle);
39 extern void swcursorunhide(void);
40
41 /* devdraw.c */
42 extern void     deletescreenimage(void);
43 extern void     resetscreenimage(void);
44 extern int              drawhasclients(void);
45 extern void     setscreenimageclipr(Rectangle);
46 extern void     drawflush(void);
47 extern QLock    drawlock;
48
49 #define ishwimage(i)    0               /* for ../port/devdraw.c */
50
51 /* swcursor.c */
52 void            swcursorhide(void);
53 void            swcursoravoid(Rectangle);
54 void            swcursordraw(Point);
55 void            swcursorload(Cursor *);
56 void            swcursorinit(void);
57
58 /* for communication between devdss.c and screen.c */
59
60 enum {
61         /* maxima */
62         Wid             = 1280,
63         Ht              = 1024,
64         Depth           = 16,           /* bits per pixel */
65
66         Pcolours        = 256,          /* Palette */
67         Pred            = 0,
68         Pgreen          = 1,
69         Pblue           = 2,
70
71         Pblack          = 0x00,
72         Pwhite          = 0xFF,
73
74         /* settings indices */
75         Res800x600      = 0,
76         Res1024x768,
77         Res1280x1024,
78         Res1400x1050,
79 };
80
81 struct Settings {
82         uint    wid;            /* width in pixels */
83         uint    ht;             /* height in pixels */
84         uint    freq;           /* refresh frequency; only printed */
85         uint    chan;           /* draw chan */
86
87         /* shouldn't be needed? */
88         uint    pixelclock;
89
90         /* horizontal timing */
91         uint    hbp;            /* back porch: pixel clocks before scan line */
92         uint    hfp;            /* front porch: pixel clocks after scan line */
93         uint    hsw;            /* sync pulse width: more hfp */
94
95         /* vertical timing */
96         uint    vbp;            /* back porch: line clocks before frame */
97         uint    vfp;            /* front porch: line clocks after frame */
98         uint    vsw;            /* sync pulse width: more vfp */
99 };
100
101 struct OScreen {
102         Cursor;
103         Settings *settings;
104         int     open;
105 };
106
107 struct Omap3fb {                /* frame buffer for 24-bit active color */
108 //      short   palette[256];
109         /* pixel data, even; base type's width must match Depth */
110         ushort  pixel[Wid*Ht];
111 };