screen.h 2.4 KB

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