]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/omap/screen.h
reduce software cursor flickering
[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, int);
18 extern void absmousetrack(int, int, int, int);
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 ulong    blanktime;
46 extern void     setscreenimageclipr(Rectangle);
47 extern void     drawflush(void);
48 extern int drawidletime(void);
49 extern QLock    drawlock;
50
51 #define ishwimage(i)    0               /* for ../port/devdraw.c */
52
53 /* swcursor.c */
54 void            swcursorhide(void);
55 void            swcursoravoid(Rectangle);
56 void            swcursordraw(Point);
57 void            swcursorload(Cursor *);
58 void            swcursorinit(void);
59
60 /* for communication between devdss.c and screen.c */
61
62 enum {
63         /* maxima */
64         Wid             = 1280,
65         Ht              = 1024,
66         Depth           = 16,           /* bits per pixel */
67
68         Pcolours        = 256,          /* Palette */
69         Pred            = 0,
70         Pgreen          = 1,
71         Pblue           = 2,
72
73         Pblack          = 0x00,
74         Pwhite          = 0xFF,
75
76         /* settings indices */
77         Res800x600      = 0,
78         Res1024x768,
79         Res1280x1024,
80         Res1400x1050,
81 };
82
83 struct Settings {
84         uint    wid;            /* width in pixels */
85         uint    ht;             /* height in pixels */
86         uint    freq;           /* refresh frequency; only printed */
87         uint    chan;           /* draw chan */
88
89         /* shouldn't be needed? */
90         uint    pixelclock;
91
92         /* horizontal timing */
93         uint    hbp;            /* back porch: pixel clocks before scan line */
94         uint    hfp;            /* front porch: pixel clocks after scan line */
95         uint    hsw;            /* sync pulse width: more hfp */
96
97         /* vertical timing */
98         uint    vbp;            /* back porch: line clocks before frame */
99         uint    vfp;            /* front porch: line clocks after frame */
100         uint    vsw;            /* sync pulse width: more vfp */
101 };
102
103 struct OScreen {
104         Cursor;
105         Settings *settings;
106         int     open;
107 };
108
109 struct Omap3fb {                /* frame buffer for 24-bit active color */
110 //      short   palette[256];
111         /* pixel data, even; base type's width must match Depth */
112         ushort  pixel[Wid*Ht];
113 };