Big Changes - See commit details
[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 /**\r
66  * \brief Virtual Terminal Mode\r
67  * Describes a VTerm mode to the caller of ::TERM_IOCTL_QUERYMODE\r
68  */\r
69 typedef struct sTerm_IOCtl_Mode\r
70 {\r
71         short   ID;             //!< Zero Based index of mode\r
72         short   DriverID;       //!< Driver's ID number (from ::tVideo_IOCtl_Mode)\r
73         Uint16  Height; //!< Height\r
74         Uint16  Width;  //!< Width\r
75         Uint8   Depth;  //!< Bits per cell\r
76         struct {\r
77                 unsigned bText: 1;      //!< Text Mode marker\r
78                 unsigned unused:        7;\r
79         };\r
80 }       tTerm_IOCtl_Mode;\r
81 \r
82 /**\r
83  * \brief Terminal Modes\r
84  */\r
85 enum eTplTerminal_Modes {\r
86         /**\r
87          * \brief UTF-8 Text Mode\r
88          * Any writes to the terminal file are treated as UTF-8 encoded\r
89          * strings and reads will also return UTF-8 strings.\r
90          */\r
91         TERM_MODE_TEXT,\r
92         \r
93         /**\r
94          * \brief 32bpp Framebuffer\r
95          * Writes to the terminal file will write to the framebuffer.\r
96          * Reads will return UTF-32 characters\r
97          */\r
98         TERM_MODE_FB,\r
99         \r
100         /**\r
101          * \brief OpenGL 2D/3D\r
102          * Writes to the terminal file will send 3D commands\r
103          * Reads will return UTF-32 characters\r
104          * \note May or may not stay in the spec\r
105          */\r
106         TERM_MODE_OPENGL,\r
107         \r
108         /**\r
109          * \brief Number of terminal modes\r
110          */\r
111         NUM_TERM_MODES\r
112 };\r
113 \r
114 \r
115 #endif\r

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