More UDI work
[tpg/acess2.git] / Kernel / include / tpl_drv_video.h
index 23d3907..bf3d286 100644 (file)
  * \extends eTplDrv_IOCtl\r
  */\r
 enum eTplVideo_IOCtl {\r
-       //! \brief Set Mode - (int mode)\r
-       VIDEO_IOCTL_SETMODE = 4,\r
-       //! \brief Get Mode - (int *mode)\r
-       VIDEO_IOCTL_GETMODE,\r
-       //! \brief Find a matching mode - (tVideo_IOCtl_Mode *info)\r
+       /**\r
+        * ioctl(..., int *mode)\r
+        * \brief Get/Set Mode\r
+        * \return Current mode ID or -1 on error\r
+        * \r
+        * If \a mode is non-NULL, the current video mode is set to \a *mode.\r
+        * This updated ID is then returned to the user.\r
+        */\r
+       VIDEO_IOCTL_GETSETMODE = 4,\r
+       \r
+       /**\r
+        * ioctl(..., tVideo_IOCtl_Mode *info)\r
+        * \brief Find a matching mode\r
+        * \return 1 if a mode was found, 0 otherwise\r
+        * \r
+        * Using avaliable modes matching the \a bpp and \a flags fields\r
+        * set the \a id field to the mode id of the mode with the closest\r
+        * \a width and \a height.\r
+        */\r
        VIDEO_IOCTL_FINDMODE,\r
-       //! \brief Get mode info - (tVideo_IOCtl_Mode *info)\r
+       \r
+       /**\r
+        * ioctl(..., tVideo_IOCtl_Mode *info)\r
+        * \brief Get mode info\r
+        * \return 1 if the mode exists, 0 otherwise\r
+        * \r
+        * Set \a info's fields to the mode specified by the \a id field.\r
+        */\r
        VIDEO_IOCTL_MODEINFO,\r
-       //! \brief Request access to Framebuffer - (void *dest), Return Boolean Success\r
+       \r
+       /**\r
+        * ioctl(..., tVideo_IOCtl_Pos *pos)\r
+        * \brief Sets the cursor position\r
+        * \return Boolean success\r
+        * \r
+        * Set the text mode cursor position (if it is supported)\r
+        * If the \a pos is set to (-1,-1) the cursor is hidden, otherwise\r
+        * \a pos MUST be within the current screen size (as given by the\r
+        * current mode's tVideo_IOCtl_Mode.width and tVideo_IOCtl_Mode.height\r
+        * fields).\r
+        */\r
+       VIDEO_IOCTL_SETCURSOR,\r
+       \r
+       /**\r
+        * ioctl(..., tVAddr MapTo)\r
+        * \brief Request access to Framebuffer\r
+        * \return Boolean Success\r
+        * \r
+        * Requests the driver to allow the user direct access to the\r
+        * framebuffer by mapping it to the supplied address.\r
+        * If the driver does not allow this boolean FALSE (0) is returned,\r
+        * else if the call succeeds (and the framebuffer ends up mapped) boolean\r
+        * TRUE (1) is returned.\r
+        */\r
        VIDEO_IOCTL_REQLFB\r
 };\r
 \r
 /**\r
- \struct sVideo_IOCtl_Mode\r
- \brief Mode Structure used in IOCtl Calls\r
-*/\r
-struct sVideo_IOCtl_Mode {\r
-       short   id;             //!< Mide ID\r
+ * \brief Mode Structure used in IOCtl Calls\r
+ * \r
+ * Defines a video mode supported by (or requested of) this driver (depending\r
+ * on what ioctl call is used)\r
+ */\r
+typedef struct sVideo_IOCtl_Mode\r
+{\r
+       short   id;             //!< Mode ID\r
        Uint16  width;  //!< Width\r
        Uint16  height; //!< Height\r
-       Uint16  bpp;    //!< Bits per Pixel\r
-};\r
-typedef struct sVideo_IOCtl_Mode       tVideo_IOCtl_Mode;      //!< Mode Type\r
+       Uint8   bpp;    //!< Bits per Unit (Character or Pixel, depending on \a flags)\r
+       Uint8   flags;  //!< Mode Flags\r
+}      tVideo_IOCtl_Mode;\r
+\r
+//! \name Video Mode flags\r
+//! \{\r
+/**\r
+ * \brief Text Mode Flag\r
+ * \note A text mode should have the ::sVideo_IOCtl_Mode.bpp set to 12\r
+ */\r
+#define VIDEO_FLAG_TEXT        0x1\r
+/**\r
+ * \brief Slow (non-accellerated mode)\r
+ */\r
+#define VIDEO_FLAG_SLOW        0x2\r
+//! \}\r
+\r
+/**\r
+ * \brief Describes a position in the video framebuffer\r
+ */\r
+typedef struct sVideo_IOCtl_Pos\r
+{\r
+       Sint16  x;      //!< X Coordinate\r
+       Sint16  y;      //!< Y Coordinate\r
+}      tVideo_IOCtl_Pos;\r
 \r
 /**\r
- * \struct sVT_Char\r
  * \brief Virtual Terminal Representation of a character\r
  */\r
-struct sVT_Char {\r
-       Uint32  Ch;\r
+typedef struct sVT_Char\r
+{\r
+       Uint32  Ch;     //!< UTF-32 Character\r
        union {\r
                struct {\r
-                       Uint16  BGCol;\r
-                       Uint16  FGCol;\r
+                       Uint16  BGCol;  //!< 12-bit Foreground Colour\r
+                       Uint16  FGCol;  //!< 12-bit Background Colour\r
                };\r
-               Uint32  Colour;\r
+               Uint32  Colour; //!< Compound colour for ease of access\r
        };\r
-};\r
-typedef struct sVT_Char        tVT_Char;\r
+}      tVT_Char;\r
 \r
+/**\r
+ * \name Basic builtin colour definitions\r
+ * \{\r
+ */\r
 #define        VT_COL_BLACK    0x0000\r
 #define        VT_COL_GREY             0x0888\r
 #define        VT_COL_LTGREY   0x0CCC\r
 #define        VT_COL_WHITE    0x0FFF\r
+/**\r
+ * \}\r
+ */\r
+\r
+//! \brief Defines the width of a rendered character\r
+extern int     giVT_CharWidth;\r
+//! \brief Defines the height of a rendered character\r
+extern int     giVT_CharHeight;\r
+/**\r
+ * \fn void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC)\r
+ * \brief Driver helper that renders a character to a buffer\r
+ * \param Codepoint    Unicode character to render\r
+ * \param Buffer       Buffer to render to (32-bpp)\r
+ * \param Pitch        Number of DWords per line\r
+ * \param BGC  32-bit Background Colour\r
+ * \param FGC  32-bit Foreground Colour\r
+ * \r
+ * This function is provided to help video drivers to support a simple\r
+ * text mode by keeping the character rendering abstracted from the driver,\r
+ * easing the driver development and reducing code duplication.\r
+ */\r
+extern void    VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC);\r
+/**\r
+ * \fn Uint32 VT_Colour12to24(Uint16 Col12)\r
+ * \brief Converts a colour from 12bpp to 32bpp\r
+ * \param Col12        12-bpp input colour\r
+ * \return Expanded 32-bpp (24-bit colour) version of \a Col12\r
+ */\r
+extern Uint32  VT_Colour12to24(Uint16 Col12);\r
 \r
 #endif\r

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