X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2FWM%2Finclude%2Fwm.h;h=7807c9013c53cbdf54273981dfafbe367ae52a20;hb=54ee7218058b4285be6b02195cba4e90c4e12a2d;hp=1c0671f502a6a783d9b9556f9aa95eb161c4e8f4;hpb=2f16fec349eabb42f5e23ea2b821f149fa6b767e;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/WM/include/wm.h b/Usermode/Applications/axwin3_src/WM/include/wm.h index 1c0671f5..7807c901 100644 --- a/Usermode/Applications/axwin3_src/WM/include/wm.h +++ b/Usermode/Applications/axwin3_src/WM/include/wm.h @@ -23,7 +23,7 @@ //! Don't decoratate even if root #define WINFLAG_NODECORATE 0x00000002 //! Window takes up all of screen -#define WINFLAG_MAXIMIZED 0x00000005 +#define WINFLAG_MAXIMIZED 0x00000004 //! Window contents are valid #define WINFLAG_CLEAN 0x00000040 //! All child windows are un-changed @@ -57,9 +57,34 @@ extern int WM_SendMessage(tWindow *Source, tWindow *Dest, int MessageID, int Len // --- Rendering extern void WM_Render_FillRect(tWindow *Window, int X, int Y, int W, int H, tColour Colour); extern void WM_Render_DrawRect(tWindow *Window, int X, int Y, int W, int H, tColour Colour); -extern int WM_Render_DrawText(tWindow *Window, int X, int Y, int W, int H, tFont *Font, tColour Colour, const char *Text); -extern void WM_Render_GetTextDims(tFont *Font, const char *Text, int *W, int *H); +/** + * \brief Draw text to a window + * \param Window Destination Window + * \param X X coordinate (Left) + * \param Y Y coordinate (Top) + * \param W Width of destination region + * \param H Height of destination region + * \param Font Font to use + * \param Colour Text foreground colour + * \param Text UTF-8 string to render + * \param MaxLen Number of bytes in \a Text to read (Note: A final multi-byte sequence can exceed this count) + * + * \note As as noted in the \a MaxLen parameter, up to 3 more bytes may be read + * if the final character is a multi-byte UTF-8 sequence. This allows 1 + * to be passed to only render a single character. + */ +extern int WM_Render_DrawText(tWindow *Window, int X, int Y, int W, int H, tFont *Font, tColour Colour, const char *Text, int MaxLen); +/** + * \brief Get the dimensions of a string if it was rendered + * \param Font Font to use + * \param Text UTF-8 string to be processed + * \param MaxLen Number of bytes in \a Text to read (same caveat as WM_Render_DrawText applies) + * \param W Pointer to an integer to store the width of the rendered text + * \param H Pointer to an integer to store the height of the rendered text + */ +extern void WM_Render_GetTextDims(tFont *Font, const char *Text, int MaxLen, int *W, int *H); extern void WM_Render_DrawImage(tWindow *Window, int X, int Y, int W, int H, tImage *Image); +extern void WM_Render_SetTextCursor(tWindow *Window, int X, int Y, int W, int H, tColour Colour); // NOTE: Should really be elsewhere extern tColour Video_AlphaBlend(tColour _orig, tColour _new, uint8_t _alpha); #endif