b32b83d5267849e6df5f04d7f0e20efbf5b782a5
[tpg/acess2.git] / Kernel / include / tpl_drv_terminal.h
1 /**\r
2  * \file tpl_drv_terminal.h\r
3  * \brief Terminal Driver Interface Definitions\r
4 */\r
5 #ifndef _TPL_TERMINAL_H\r
6 #define _TPL_TERMINAL_H\r
7 \r
8 #include <tpl_drv_common.h>\r
9 \r
10 /**\r
11  * \brief Common Terminal IOCtl Calls\r
12  * \extends eTplDrv_IOCtl\r
13  */\r
14 enum eTplTerminal_IOCtl {\r
15         /**\r
16          * ioctl(..., int *mode)\r
17          * \brief Get/Set the current video mode type\r
18          * \param mode Pointer to an integer with the new mode number (or NULL)\r
19          *             If \a mode is non-NULL the current terminal mode is changed/updated\r
20          *             to the mode indicated by \a *mode\r
21          * \note See ::eTplTerminal_Modes\r
22          * \return Current/new terminal mode\r
23         */\r
24         TERM_IOCTL_MODETYPE = 4,\r
25         \r
26         /**\r
27          * ioctl(..., int *width)\r
28          * \brief Get/set the display width\r
29          * \param width Pointer to an integer containing the new width (or NULL)\r
30          * \return Current/new width\r
31          * \r
32          * If \a width is non-NULL the current width is updated (but is not\r
33          * applied until ::TERM_IOCTL_MODETYPE is called with \a mode non-NULL.\r
34          */\r
35         TERM_IOCTL_WIDTH,\r
36         \r
37         /**\r
38          * ioctl(..., int *height)\r
39          * \brief Get/set the display height\r
40          * \param height        Pointer to an integer containing the new height\r
41          * \return Current height\r
42          * \r
43          * If \a height is non-NULL the current height is updated (but is not\r
44          * applied until ::TERM_IOCTL_MODETYPE is called with a non-NULL \a mode.\r
45          */\r
46         TERM_IOCTL_HEIGHT,\r
47         \r
48         /**\r
49          * ioctl(..., tTerm_IOCtl_Mode *info)\r
50          * \brief Queries the current driver about it's native modes\r
51          * \param info  A pointer to a ::tTerm_IOCtl_Mode with \a ID set to\r
52          *        the mode index (or NULL)\r
53          * \return Number of modes\r
54          * \r
55          * If \a info is NULL, the number of avaliable vative display modes\r
56          * is returned. These display modes will have sequential ID numbers\r
57          * from zero up to this value.\r
58          * \r
59          * \note The id field of \a info is not for use with ::TERM_IOCTL_MODETYPE\r
60          *       This field is just for indexing the mode to get its information.\r
61          */\r
62         TERM_IOCTL_QUERYMODE,\r
63         \r
64         /**\r
65          * ioctl(...)\r
66          * \brief Forces the current terminal to be shown\r
67          */\r
68         TERM_IOCTL_FORCESHOW,\r
69         \r
70         /**\r
71          * ioctl(...)\r
72          * \brief Returns the current text cursor position\r
73          * \return Cursor position (as X+Y*Width)\r
74          */\r
75         TERM_IOCTL_GETCURSOR\r
76 };\r
77 \r
78 /**\r
79  * \brief Virtual Terminal Mode\r
80  * Describes a VTerm mode to the caller of ::TERM_IOCTL_QUERYMODE\r
81  */\r
82 typedef struct sTerm_IOCtl_Mode\r
83 {\r
84         short   ID;             //!< Zero Based index of mode\r
85         short   DriverID;       //!< Driver's ID number (from ::tVideo_IOCtl_Mode)\r
86         Uint16  Height; //!< Height\r
87         Uint16  Width;  //!< Width\r
88         Uint8   Depth;  //!< Bits per cell\r
89         struct {\r
90                 unsigned bText: 1;      //!< Text Mode marker\r
91                 unsigned unused:        7;\r
92         };\r
93 }       tTerm_IOCtl_Mode;\r
94 \r
95 /**\r
96  * \brief Terminal Modes\r
97  */\r
98 enum eTplTerminal_Modes {\r
99         /**\r
100          * \brief UTF-8 Text Mode\r
101          * Any writes to the terminal file are treated as UTF-8 encoded\r
102          * strings and reads will also return UTF-8 strings.\r
103          */\r
104         TERM_MODE_TEXT,\r
105         \r
106         /**\r
107          * \brief 32bpp Framebuffer\r
108          * Writes to the terminal file will write to the framebuffer.\r
109          * Reads will return UTF-32 characters\r
110          */\r
111         TERM_MODE_FB,\r
112         \r
113         /**\r
114          * \brief 32bpp 2D Accellerated mode\r
115          * Writes to the terminal file will be read as a command stream\r
116          * defined in ::eTplTerminal_2D_Commands\r
117          */\r
118         TERM_MODE_2DACCEL,\r
119         \r
120         /**\r
121          * \brief OpenGL 2D/3D\r
122          * Writes to the terminal file will send 3D commands\r
123          * Reads will return UTF-32 characters\r
124          * \note May or may not stay in the spec\r
125          */\r
126         TERM_MODE_3D,\r
127         \r
128         /**\r
129          * \brief Number of terminal modes\r
130          */\r
131         NUM_TERM_MODES\r
132 };\r
133 \r
134 /**\r
135  * \brief 2D Command IDs\r
136  * \todo Complete this structure\r
137  * \r
138  * Command IDs for when the terminal type is eTplTerminal_Modes.TERM_MODE_2DACCEL\r
139  */\r
140 enum eTplTerminal_2D_Commands\r
141 {\r
142         /**\r
143          * \brief No Operation - Used for padding\r
144          */\r
145         TERM_2DCMD_NOP,\r
146         \r
147         /**\r
148          * (Uint16 X, Y, W, H, Uint32 Data[])\r
149          * \brief Blits a bitmap to the display\r
150          * \param X,Y   Coordinates of Top-Left corner\r
151          * \param W,H   Dimensions\r
152          * \param Data  32-bpp pixel data\r
153          */\r
154         TERM_2DCMD_PUSH\r
155 };\r
156 \r
157 #endif\r

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