2 * \file api_drv_terminal.h
\r
3 * \brief Terminal Driver Interface Definitions
\r
5 #ifndef _API_DRV_TERMINAL_H
\r
6 #define _API_DRV_TERMINAL_H
\r
8 #include <api_drv_common.h>
\r
11 * \brief Common Terminal IOCtl Calls
\r
12 * \extends eTplDrv_IOCtl
\r
14 enum eTplTerminal_IOCtl {
\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
24 TERM_IOCTL_MODETYPE = 4,
\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
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
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
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
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
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
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
62 TERM_IOCTL_QUERYMODE,
\r
66 * \brief Forces the current terminal to be shown
\r
68 TERM_IOCTL_FORCESHOW,
\r
71 * ioctl(..., tVideo_IOCtl_Pos *pos)
\r
72 * \brief Returns the current text cursor position
\r
73 * \param pos New cursor position. If NULL, the position is not changed
\r
74 * \return Cursor position (as X+Y*Width)
\r
76 TERM_IOCTL_GETSETCURSOR,
\r
79 * ioctl(..., tVideo_IOCtl_Bitmap *Bmp)
\r
80 * \brief Set the video cursor bitmap
\r
81 * \param Bmp New bitmap (if NULL, the current bitmap is removed)
\r
82 * \return Boolean failure
\r
84 TERM_IOCTL_SETCURSORBITMAP,
\r
88 * \brief Virtual Terminal Mode
\r
89 * Describes a VTerm mode to the caller of ::TERM_IOCTL_QUERYMODE
\r
91 typedef struct sTerm_IOCtl_Mode
\r
93 short ID; //!< Zero Based index of mode
\r
94 short DriverID; //!< Driver's ID number (from ::tVideo_IOCtl_Mode)
\r
95 Uint16 Height; //!< Height
\r
96 Uint16 Width; //!< Width
\r
97 Uint8 Depth; //!< Bits per cell
\r
99 unsigned bText: 1; //!< Text Mode marker
\r
100 unsigned unused: 7;
\r
102 } tTerm_IOCtl_Mode;
\r
105 * \brief Terminal Modes
\r
107 enum eTplTerminal_Modes {
\r
109 * \brief UTF-8 Text Mode
\r
110 * Any writes to the terminal file are treated as UTF-8 encoded
\r
111 * strings and reads will also return UTF-8 strings.
\r
116 * \brief 32bpp Framebuffer
\r
117 * Writes to the terminal file will write to the framebuffer.
\r
118 * Reads will return UTF-32 characters
\r
123 * \brief 32bpp 2D Accellerated mode
\r
124 * Writes to the terminal file will be read as a command stream
\r
125 * defined in ::eTplTerminal_2D_Commands
\r
130 * \brief OpenGL 2D/3D
\r
131 * Writes to the terminal file will send 3D commands
\r
132 * Reads will return UTF-32 characters
\r
133 * \note May or may not stay in the spec
\r
138 * \brief Number of terminal modes
\r
144 * \brief 2D Command IDs
\r
145 * \todo Complete this structure
\r
147 * Command IDs for when the terminal type is eTplTerminal_Modes.TERM_MODE_2DACCEL
\r
149 enum eTplTerminal_2D_Commands
\r
152 * \brief No Operation - Used for padding
\r
157 * (Uint16 X, Y, W, H, Uint32 Data[])
\r
158 * \brief Blits a bitmap to the display
\r
159 * \param X,Y Coordinates of Top-Left corner
\r
160 * \param W,H Dimensions
\r
161 * \param Data 32-bpp pixel data
\r