Fixes to Libc, Doxygen Comments and VTerm layout
[tpg/acess2.git] / Kernel / include / tpl_drv_video.h
1 /**\r
2  * \file tpl_drv_video.h\r
3  * \brief Video Driver Interface Definitions\r
4  * \note For AcessOS Version 1\r
5  * \r
6  * Video drivers extend the common driver interface tpl_drv_common.h\r
7  * and must support _at least_ the IOCtl numbers defined in this file\r
8  * to be compatable with Acess.\r
9  * \r
10  * \section IOCtls\r
11  * As said, a compatable driver must implement these calls correctly,\r
12  * but they may choose not to allow direct user access to the framebuffer.\r
13  * \r
14  * \section Screen Contents\r
15  * Reads and writes to the driver's file while in component colour modes\r
16  * must correspond to a change of the contents of the screen. The framebuffer\r
17  * must start at offset 0 in the file.\r
18  * In pallete colour modes the LFB is preceded by a 1024 byte pallete (allowing\r
19  * room for 256 entries of 32-bits each)\r
20 */\r
21 #ifndef _TPL_VIDEO_H\r
22 #define _TPL_VIDEO_H\r
23 \r
24 #include <tpl_drv_common.h>\r
25 \r
26 /**\r
27  * \enum eTplVideo_IOCtl\r
28  * \brief Common Video IOCtl Calls\r
29  * \extends eTplDrv_IOCtl\r
30  */\r
31 enum eTplVideo_IOCtl {\r
32         //! \brief Set Mode - (int mode)\r
33         VIDEO_IOCTL_SETMODE = 4,\r
34         //! \brief Get Mode - (int *mode)\r
35         VIDEO_IOCTL_GETMODE,\r
36         //! \brief Find a matching mode - (tVideo_IOCtl_Mode *info)\r
37         VIDEO_IOCTL_FINDMODE,\r
38         //! \brief Get mode info - (tVideo_IOCtl_Mode *info)\r
39         VIDEO_IOCTL_MODEINFO,\r
40         //! \brief Sets the cursor position (tVideo_IOCtl_Pos *pos)\r
41         VIDEO_IOCTL_SETCURSOR,\r
42         //! \brief Request access to Framebuffer - (void *dest), Return Boolean Success\r
43         VIDEO_IOCTL_REQLFB\r
44 };\r
45 \r
46 /**\r
47  \struct sVideo_IOCtl_Mode\r
48  \brief Mode Structure used in IOCtl Calls\r
49 */\r
50 struct sVideo_IOCtl_Mode {\r
51         short   id;             //!< Mide ID\r
52         Uint16  width;  //!< Width\r
53         Uint16  height; //!< Height\r
54         Uint8   bpp;    //!< Bits per Pixel\r
55         Uint8   flags;  //!< Mode Flags\r
56 };\r
57 typedef struct sVideo_IOCtl_Mode        tVideo_IOCtl_Mode;      //!< Mode Type\r
58 /**\r
59  * \brief Text Mode Flag\r
60  * \note A text mode should have the ::sVideo_IOCtl_Mode.bpp set to 12\r
61  */\r
62 #define VIDEO_FLAG_TEXT 0x1\r
63 #define VIDEO_FLAG_SLOW 0x2     //!< Non-accelerated mode\r
64 \r
65 typedef struct sVideo_IOCtl_Pos tVideo_IOCtl_Pos;       //!< Position Type\r
66 /**\r
67  */\r
68 struct sVideo_IOCtl_Pos {\r
69         Sint16  x;      //!< X Coordinate\r
70         Sint16  y;      //!< Y Coordinate\r
71 };\r
72 \r
73 /**\r
74  * \struct sVT_Char\r
75  * \brief Virtual Terminal Representation of a character\r
76  */\r
77 struct sVT_Char {\r
78         Uint32  Ch;\r
79         union {\r
80                 struct {\r
81                         Uint16  BGCol;\r
82                         Uint16  FGCol;\r
83                 };\r
84                 Uint32  Colour;\r
85         };\r
86 };\r
87 typedef struct sVT_Char tVT_Char;\r
88 \r
89 #define VT_COL_BLACK    0x0000\r
90 #define VT_COL_GREY             0x0888\r
91 #define VT_COL_LTGREY   0x0CCC\r
92 #define VT_COL_WHITE    0x0FFF\r
93 \r
94 extern int      giVT_CharWidth;\r
95 extern int      giVT_CharHeight;\r
96 extern void     VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC);\r
97 extern Uint32   VT_Colour12to24(Uint16 Col12);\r
98 \r
99 #endif\r

UCC git Repository :: git.ucc.asn.au