gdi.h File Reference
Go to the source code of this file.
Data Structures
Defines
- #define PIXEL_invalid 0
- Invalid pixel.
- #define PIXEL_transparent SysPixelIndex[0]
- Transparent.
- #define PIXEL_darkblue SysPixelIndex[1]
- Dark blue.
- #define PIXEL_darkgreen SysPixelIndex[2]
- Dark green.
- #define PIXEL_darkcyan SysPixelIndex[3]
- Dark cyan.
- #define PIXEL_darkred SysPixelIndex[4]
- Dark red.
- #define PIXEL_darkmagenta SysPixelIndex[5]
- Dark magenta.
- #define PIXEL_darkyellow SysPixelIndex[6]
- Dark yellow.
- #define PIXEL_darkgray SysPixelIndex[7]
- Dark gray.
- #define PIXEL_lightgray SysPixelIndex[8]
- Light gray.
- #define PIXEL_blue SysPixelIndex[9]
- Blue.
- #define PIXEL_green SysPixelIndex[10]
- Green.
- #define PIXEL_cyan SysPixelIndex[11]
- Cyan.
- #define PIXEL_red SysPixelIndex[12]
- Red.
- #define PIXEL_magenta SysPixelIndex[13]
- Magenta.
- #define PIXEL_yellow SysPixelIndex[14]
- Yellow.
- #define PIXEL_lightwhite SysPixelIndex[15]
- Light white.
- #define PIXEL_black SysPixelIndex[16]
- Black.
- #define COLOR_invalid PIXEL_invalid
- #define COLOR_transparent PIXEL_transparent
- #define COLOR_darkred PIXEL_darkred
- #define COLOR_darkgreen PIXEL_darkgreen
- #define COLOR_darkyellow PIXEL_darkyellow
- #define COLOR_darkblue PIXEL_darkblue
- #define COLOR_darkmagenta PIXEL_darkmagenta
- #define COLOR_darkcyan PIXEL_darkcyan
- #define COLOR_lightgray PIXEL_lightgray
- #define COLOR_darkgray PIXEL_darkgray
- #define COLOR_red PIXEL_red
- #define COLOR_green PIXEL_green
- #define COLOR_yellow PIXEL_yellow
- #define COLOR_blue PIXEL_blue
- #define COLOR_magenta PIXEL_magenta
- #define COLOR_cyan PIXEL_cyan
- #define COLOR_lightwhite PIXEL_lightwhite
- #define COLOR_black PIXEL_black
- #define SysColorIndex SysPixelIndex
- #define InitFreeClipRectList(heap, size) InitBlockDataHeap (heap, sizeof (CLIPRECT), size)
- Initializes the private block data heap used to allocate clipping rectangles.
- #define ClipRectAlloc(heap) BlockDataAlloc (heap)
- Allocates a clipping rectangles from the private block data heap.
- #define FreeClipRect(heap, cr) BlockDataFree (heap, cr);
- Frees a clipping rectangle which is allocated from the private block data heap.
- #define DestroyFreeClipRectList(heap) DestroyBlockDataHeap (heap);
- Destroys the private block data heap used to allocate clipping rectangles.
- #define UnionRectWithRegion AddClipRect
- Is an alias of AddClipRect.
- #define CopyRegion ClipRgnCopy
- Is an alias of ClipRgnCopy.
- #define IntersectRegion ClipRgnIntersect
- Is an alias of ClipRgnIntersect.
- #define HDC_SCREEN 0
- Handle to the device context of the whole screen.
- #define HDC_INVALID 0xFFFFFFFF
- Indicates an invalid handle to device context.
- #define CreateCompatibleDC(hdc) CreateCompatibleDCEx(hdc, 0, 0)
- Creates a memory DC which is compatible with a given DC.
- #define DeleteCompatibleDC(hdc) DeleteMemDC(hdc)
- Deletes a memory DC.
- #define GetBkColor(hdc) GetDCAttr (hdc, DC_ATTR_BK_COLOR)
- Gets the background color of a DC.
- #define GetBkMode(hdc) GetDCAttr (hdc, DC_ATTR_BK_MODE)
- Gets the background mode of a DC.
- #define GetPenColor(hdc) GetDCAttr (hdc, DC_ATTR_PEN_COLOR)
- Gets the pen color of a DC.
- #define GetBrushColor(hdc) GetDCAttr (hdc, DC_ATTR_BRUSH_COLOR)
- Gets the brush color of a DC.
- #define GetTextColor(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_COLOR)
- Gets the text color of a DC.
- #define GetTabStop(hdc) GetDCAttr (hdc, DC_ATTR_TAB_STOP)
- Gets the tabstop value of a DC.
- #define SetBkColor(hdc, color) SetDCAttr (hdc, DC_ATTR_BK_COLOR, (DWORD) color)
- Sets the background color of a DC to a new value.
- #define SetBkMode(hdc, mode) SetDCAttr (hdc, DC_ATTR_BK_MODE, (DWORD) mode)
- Sets the background color of a DC to a new mode.
- #define SetPenColor(hdc, color) SetDCAttr (hdc, DC_ATTR_PEN_COLOR, (DWORD) color)
- Sets the pen color of a DC to a new value.
- #define SetBrushColor(hdc, color) SetDCAttr (hdc, DC_ATTR_BRUSH_COLOR, (DWORD) color)
- Sets the brush color of a DC to a new value.
- #define SetTextColor(hdc, color) SetDCAttr (hdc, DC_ATTR_TEXT_COLOR, (DWORD) color)
- Sets the text color of a DC to a new value.
- #define SetTabStop(hdc, value) SetDCAttr (hdc, DC_ATTR_TAB_STOP, (DWORD) value)
- Sets the tabstop of a DC to a new value.
- #define DrawHDotLine(hdc, x, y, w) DrawHVDotLine (hdc, x, y, w, TRUE);
- Draws a horizontal dot dash line.
- #define DrawVDotLine(hdc, x, y, h) DrawHVDotLine (hdc, x, y, h, FALSE);
- Draws a vertical dot line.
- #define PolygonGenerator(context, pts, vertices, cb) PolygonGeneratorEx(context, pts, vertices, cb, NULL)
- This is a general polygon generator.
- #define GetPenType(hdc) GetDCAttr (hdc, DC_ATTR_PEN_TYPE)
- Gets the pen type of a DC.
- #define SetPenType(hdc, type) SetDCAttr (hdc, DC_ATTR_PEN_TYPE, (DWORD) type)
- Sets the pen type of a DC to a new type.
- #define GetPenCapStyle(hdc) GetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE)
- Gets the pen cap style of a DC.
- #define SetPenCapStyle(hdc, style) SetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE, (DWORD) style)
- Sets the pen type of a DC to a new type.
- #define GetPenJoinStyle(hdc) GetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE)
- Gets the pen join style of a DC.
- #define SetPenJoinStyle(hdc, style) SetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE, (DWORD) style)
- Sets the pen type of a DC to a new type.
- #define GetPenWidth(hdc) GetDCAttr (hdc, DC_ATTR_PEN_WIDTH)
- Gets the pen width of a DC.
- #define SetPenWidth(hdc, width) SetDCAttr (hdc, DC_ATTR_PEN_WIDTH, (DWORD) width)
- Sets the pen width of a DC to a new width.
- #define GetBrushType(hdc) GetDCAttr (hdc, DC_ATTR_BRUSH_TYPE)
- Gets the brush type of a DC.
- #define SetBrushType(hdc, type) SetDCAttr (hdc, DC_ATTR_BRUSH_TYPE, (DWORD) type)
- Sets the brush type of a DC to a new type.
- #define GetMapMode(hdc) GetDCAttr (hdc, DC_ATTR_MAP_MODE)
- Retrieves the current mapping mode of a DC.
- #define SetMapMode(hdc, mapmode) SetDCAttr (hdc, DC_ATTR_MAP_MODE, (DWORD)mapmode)
- Sets the mapping mode of a display context.
- #define GetViewportOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_VORG, pPt)
- Retrieves the x-coordinates and y-coordinates of the viewport origin for a device context.
- #define GetViewportExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_VEXT, pPt)
- Retrieves the x-extents and y-extents of the current viewport for a device context.
- #define GetWindowOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_WORG, pPt)
- Retrieves the x-coordinates and y-coordinates of the window for a device context.
- #define GetWindowExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_WEXT, pPt)
- Retrieves the x-extents and y-extents of the current window for a device context.
- #define SetViewportOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_VORG, pPt)
- Sets the x-coordinates and y-coordinates of the viewport origin for a device context.
- #define SetViewportExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_VEXT, pPt)
- Sets the x-extents and y-extents of the current viewport for a device context.
- #define SetWindowOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_WORG, pPt)
- Sets the x-coordinates and y-coordinates of the window for a device context.
- #define SetWindowExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_WEXT, pPt)
- Sets the x-extents and y-extents of the current window for a device context.
- #define CreateIcon(hdc, w, h, AndBits, XorBits, colornum) CreateIconEx(hdc, w, h, AndBits, XorBits, colornum, NULL)
- #define RECTWP(prc) ((prc)->right - (prc)->left)
- Gets the width of a RECT object by using the pointer to it.
- #define RECTHP(prc) ((prc)->bottom - (prc)->top)
- Gets the height of a RECT object by using the pointer to it.
- #define RECTW(rc) ((rc).right - (rc).left)
- Gets the width of a RECT object.
- #define RECTH(rc) ((rc).bottom - (rc).top)
- Gets the height of a RECT object.
- #define FONT_CHARSET_GB1988_0 "GB1988-0"
- EUC encoding of GB1988 charset, treat as ISO8859-1.
- #define FONT_CHARSET_GB2312_0 "GB2312-0"
- EUC encoding of GB2312 charset.
- #define FONT_CHARSET_GB18030_0 "GB18030-0"
- EUC encoding of GB18030 charset.
- #define FONT_CHARSET_EUCTW "EUC-TW"
- EUC encoding of CNS11643 charset, not supported.
- #define FONT_CHARSET_KSC5636_0 "KSC5636-0"
- EUC encoding of KSC5636 charset, treat as ISO8859-1.
- #define FONT_CHARSET_KSC5601_0 "KSC5601-0"
- EUC encoding of KSC5601 charset.
- #define FONT_CHARSET_JISX0201_0 "JISX0201-0"
- EUC encoding of JISX0201 charset.
- #define FONT_CHARSET_JISX0208_0 "JISX0208-0"
- EUC encoding of JISX0208 charset.
- #define FONT_CHARSET_JISX0201_1 "JISX0201-1"
- Shift-JIS encoding of JISX0201 charset.
- #define FONT_CHARSET_JISX0208_1 "JISX0208-1"
- Shift-JIS encoding of JISX0208 charset.
- #define FONT_CHARSET_ISO_10646_1 "ISO-10646-1"
- UCS-2 encoding of UNICODE.
- #define FONT_CHARSET_UTF8 "UTF-8"
- UTF-8 encoding of UNICODE.
- #define FONT_CHARSET_UTF16LE "UTF-16LE"
- UTF-16 encoding (Little-Endian) of UNICODE.
- #define FONT_CHARSET_UTF16BE "UTF-16BE"
- UTF-16 encoding (Big-Endian) of UNICODE.
- #define INV_LOGFONT 0
- Invalid logfont.
- #define SYSLOGFONT_DEFAULT 0
- #define SYSLOGFONT_WCHAR_DEF 1
- #define SYSLOGFONT_FIXED 2
- #define SYSLOGFONT_CAPTION 3
- #define SYSLOGFONT_MENU 4
- #define SYSLOGFONT_CONTROL 5
- #define MB2WC(log_font, dest, mstr, n) MB2WCEx (log_font, dest, sizeof(wchar_t) == 4, mstr, n)
- The backward compatibility version of MB2WCEx.
- #define WC2MB(log_font, s, wc) WC2MBEx (log_font, s, (UChar32)wc)
- The backward compatibility version of WC2MBEx.
- #define MBS2WCS(log_font, dest, mstr, mstr_len, n)
- The backward compatibility version of MBS2WCSEx.
- #define WCS2MBS(log_font, dest, wcs, wcs_len, n)
- The backward compatibility version of WCS2MBSEx.
- #define GetTextCharacterExtra(hdc) GetDCAttr (hdc, DC_ATTR_CHAR_EXTRA)
- Retrieves the current intercharacter spacing for the DC.
- #define GetTextAboveLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_ALINE_EXTRA)
- Retrieves the current spacing above line for the DC.
- #define GetTextBellowLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_BLINE_EXTRA)
- Retrieves the current spacing bellow line for the DC.
- #define SetTextCharacterExtra(hdc, extra) SetDCAttr (hdc, DC_ATTR_CHAR_EXTRA, (DWORD) extra)
- Sets the intercharacter spacing for the DC and returns the old spacing value.
- #define SetTextAboveLineExtra(hdc, extra) SetDCAttr (hdc, DC_ATTR_ALINE_EXTRA, (DWORD) extra)
- Sets the spacing above line for the DC and returns the old value.
- #define SetTextBellowLineExtra(hdc, extra) SetDCAttr (hdc, DC_ATTR_BLINE_EXTRA, (DWORD) extra)
- Sets the spacing bellow line for the DC and returns the old value.
- #define GetTextAlign(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_ALIGN)
- Retrieves the current text-alignment flags of a DC.
- #define SetTextAlign(hdc, ta_flags) SetDCAttr (hdc, DC_ATTR_TEXT_ALIGN, (DWORD)ta_flags)
- Sets text-alignment flags of a DC.
- #define TextOut(hdc, x, y, text) TextOutLen (hdc, x, y, text, -1)
- Outputs text.
- #define TabbedTextOut(hdc, x, y, text) TabbedTextOutLen (hdc, x, y, text, -1)
- Outputs formatted text.
- #define DrawText(hdc, text, n, rc, format) DrawTextEx2 (hdc, text, n, rc, 0, format, NULL)
- Draws a formatted text in a rectangle.
- #define DrawTextEx(hdc, text, n, rc, indent, format) DrawTextEx2 (hdc, text, n, rc, indent, format, NULL)
- Draws a formatted text in a rectangle.
- #define MLS_BLENDMODE_NONE 0x00
- #define LoadBitmap LoadBitmapFromFile
- An alias of LoadBitmapFromFile.
- #define LoadMyBitmap LoadMyBitmapFromFile
- Alias of LoadMyBitmapFromFile.
- #define IS_MBC_GLYPH(glyph) ((glyph) & 0x80000000)
- to judge wether the glyph is multibyte glyph
- #define SET_MBC_GLYPH(glyph) ((glyph) | 0x80000000)
- set the glyph with multibyte mask
- #define REAL_GLYPH(glyph) ((glyph) & 0x7FFFFFFF)
- get real glyph value from a glyph
- #define SELECT_DEVFONT(plogfont, glyph)
- select a device font acording to the glyph value.
Typedefs
- typedef struct _BLOCKHEAP BLOCKHEAP
- typedef BLOCKHEAP * PBLOCKHEAP
- Data type of the pointer to a BLOCKHEAP.
- typedef struct _BITMAP BITMAP
- typedef BITMAP * PBITMAP
- Data type of pointer to a BITMAP.
- typedef struct _MYBITMAP MYBITMAP
- typedef struct _MYBITMAP * PMYBITMAP
- Data type of pointer to a struct _MYBITMAP.
- typedef struct _CLIPRECT CLIPRECT
- typedef struct _CLIPRGN CLIPRGN
- typedef CLIPRGN * PCLIPRGN
- Data type of the pointer to a CLIPRGN.
- typedef void(* CB_DIRECT_DRAW_RECT )(HDC hdc, Uint8 *pixels, int pitch, int bytesPerPixel, const RECT *rc, void *context)
- Type of directly access pixels hook function.
- typedef int(* ON_UPDATE_SECONDARYDC )(HWND hwnd, HDC secondary_dc, HDC real_dc, const RECT *secondary_rc, const RECT *real_rc, const RECT *main_update_rc)
- The callback type of on updating secondary DC.
- typedef void(* CB_LINE )(void *context, int stepx, int stepy)
- The type of line generator callback.
- typedef void(* CB_CIRCLE )(void *context, int x1, int x2, int y)
- The type of circle generator callback.
- typedef void(* CB_ELLIPSE )(void *context, int x1, int x2, int y)
- The type of ellipse generator callback.
- typedef void(* CB_ARC )(void *context, int x, int y)
- The type of arc generator callback.
- typedef void(* CB_POLYGON )(void *context, int x1, int x2, int y)
- The type of polygon generator callback.
- typedef BOOL(* CB_EQUAL_PIXEL )(void *context, int x, int y)
- Flodd filling generator's equation callback.
- typedef void(* CB_FLOOD_FILL )(void *context, int x1, int x2, int y)
- Flodd filling generator's scan line callback.
- typedef struct _STIPPLE STIPPLE
- typedef struct _ARC ARC
- typedef struct _LOGFONT LOGFONT
- typedef LOGFONT * PLOGFONT
- Data type of pointer to a LOGFONT.
- typedef const LOGFONT * CPLOGFONT
- Data type of pointer to a const LOGFONT.
- typedef struct _WORDINFO WORDINFO
- Date type of _WORDINFO.
- typedef struct _FONTMETRICS FONTMETRICS
- typedef struct _GLYPHBITMAP GLYPHBITMAP
- typedef struct _DTFIRSTLINE DTFIRSTLINE
- typedef void(* CB_ONE_SCANLINE )(void *context, MYBITMAP *my_bmp, int y)
- The type of scanline loaded callback.
- typedef struct _GLYPHMAPINFO GLYPHMAPINFO
- Data type of struct _GLYPHMAPINFO.
- typedef struct _GLYPHINFO GLYPHINFO
- Data type of struct _GLYPHINFO.
Enumerations
- enum PenType { PT_SOLID,
PT_ON_OFF_DASH,
PT_DOUBLE_DASH
}
- enum PTCapStyle { PT_CAP_BUTT,
PT_CAP_ROUND,
PT_CAP_PROJECTING
}
- enum PTJoinStyle { PT_JOIN_MITER,
PT_JOIN_ROUND,
PT_JOIN_BEVEL
}
- enum BrushType { BT_SOLID,
BT_TILED,
BT_STIPPLED,
BT_OPAQUE_STIPPLED
}
- enum mg_FT_LcdFilter {
MG_SMOOTH_NONE = 0,
MG_SMOOTH_DEFAULT = 1,
MG_SMOOTH_LIGHT = 2,
MG_SMOOTH_LEGACY = 16,
MG_SMOOTH_MAX
}
- enum SHAPETYPE
Data type of enum.
More...
Functions
- MG_EXPORT void InitBlockDataHeap (PBLOCKHEAP heap, size_t bd_size, size_t heap_size)
- Initializes a private block data heap.
- MG_EXPORT void * BlockDataAlloc (PBLOCKHEAP heap)
- Allocates a data block from private heap.
- MG_EXPORT void BlockDataFree (PBLOCKHEAP heap, void *data)
- Frees an allocated data block.
- MG_EXPORT void DestroyBlockDataHeap (PBLOCKHEAP heap)
- Destroys a private block data heap.
- MG_EXPORT void GUIAPI InitClipRgn (PCLIPRGN pRgn, PBLOCKHEAP pFreeList)
- Initializes a clipping region.
- MG_EXPORT void GUIAPI EmptyClipRgn (PCLIPRGN pRgn)
- Empties a clipping region.
- MG_EXPORT PCLIPRGN GUIAPI CreateClipRgn (void)
- Creates a clipping region.
- MG_EXPORT void GUIAPI DestroyClipRgn (PCLIPRGN pRgn)
- Empties and destroys a clipping region.
- MG_EXPORT BOOL GUIAPI ClipRgnCopy (PCLIPRGN pDstRgn, const CLIPRGN *pSrcRgn)
- Copies one region to another.
- MG_EXPORT BOOL GUIAPI ClipRgnIntersect (PCLIPRGN pRstRgn, const CLIPRGN *pRgn1, const CLIPRGN *pRgn2)
- Intersects two region.
- MG_EXPORT void GUIAPI GetClipRgnBoundRect (PCLIPRGN pRgn, PRECT pRect)
- Gets the bounding rectangle of a region.
- MG_EXPORT BOOL GUIAPI SetClipRgn (PCLIPRGN pRgn, const RECT *pRect)
- Sets a region to contain only one rect.
- MG_EXPORT BOOL GUIAPI IsEmptyClipRgn (const CLIPRGN *pRgn)
- Determines whether a region is an empty region.
- MG_EXPORT BOOL GUIAPI AddClipRect (PCLIPRGN pRgn, const RECT *pRect)
- Unions one rectangle to a region.
- MG_EXPORT BOOL GUIAPI IntersectClipRect (PCLIPRGN pRgn, const RECT *pRect)
- Intersects a rectangle with a region.
- MG_EXPORT BOOL GUIAPI SubtractClipRect (PCLIPRGN pRgn, const RECT *pRect)
- Subtracts a rectangle from a region.
- MG_EXPORT BOOL GUIAPI PtInRegion (PCLIPRGN region, int x, int y)
- Determines whether a point is in a region.
- MG_EXPORT BOOL GUIAPI RectInRegion (PCLIPRGN region, const RECT *rect)
- Determines whether a rectangle is intersected with a region.
- MG_EXPORT void GUIAPI OffsetRegionEx (PCLIPRGN region, const RECT *rcClient, const RECT *rcScroll, int x, int y)
- Offsets the region in the specified window's scroll area.
- MG_EXPORT void GUIAPI OffsetRegion (PCLIPRGN region, int x, int y)
- Offsets the region.
- MG_EXPORT BOOL GUIAPI UnionRegion (PCLIPRGN dst, const CLIPRGN *src1, const CLIPRGN *src2)
- Unions two regions.
- MG_EXPORT BOOL GUIAPI SubtractRegion (CLIPRGN *rgnD, const CLIPRGN *rgnM, const CLIPRGN *rgnS)
- Substrcts a region from another.
- MG_EXPORT BOOL GUIAPI XorRegion (CLIPRGN *dst, const CLIPRGN *src1, const CLIPRGN *src2)
- Does the XOR operation between two regions.
- MG_EXPORT BOOL GUIAPI InitCircleRegion (PCLIPRGN dst, int x, int y, int r)
- Initializes a region to be an enclosed circle.
- MG_EXPORT BOOL GUIAPI InitEllipseRegion (PCLIPRGN dst, int x, int y, int rx, int ry)
- Initializes a region to be an enclosed ellipse.
- MG_EXPORT BOOL GUIAPI InitPolygonRegion (PCLIPRGN dst, const POINT *pts, int vertices)
- Initializes a region to be an enclosed polygon.
- MG_EXPORT unsigned int GUIAPI GetGDCapability (HDC hdc, int iItem)
- Returns a capability of a DC.
- MG_EXPORT HDC GUIAPI GetDC (HWND hwnd)
- Gets a window DC of a window.
- MG_EXPORT HDC GUIAPI GetClientDC (HWND hwnd)
- Gets a client DC of a window.
- MG_EXPORT HDC GUIAPI GetSubDC (HDC hdc, int off_x, int off_y, int width, int height)
- This function gets a sub DC which is compliant to the specified client DC.
- MG_EXPORT void GUIAPI ReleaseDC (HDC hdc)
- Releases a DC from DC pool.
- MG_EXPORT HWND GUIAPI WindowFromDC (HDC hdc)
- Get the window handle from DC.
- MG_EXPORT int GUIAPI SaveDC (HDC hdc)
- Saves the current state of a device context.
- MG_EXPORT BOOL GUIAPI RestoreDC (HDC hdc, int saved_dc)
- Restores a device context (DC) to the specified state.
- MG_EXPORT HDC GUIAPI CreateCompatibleDCEx (HDC hdc, int width, int height)
- Creates a memory DC which is compatible with the specified reference DC.
- MG_EXPORT BOOL GUIAPI IsCompatibleDC (HDC hdc1, HDC hdc2)
- Check whether a given DC is compliant to a specific DC.
- MG_EXPORT HDC GUIAPI CreateMemDCEx (int width, int height, int depth, DWORD flags, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask, void *bits, int pitch)
- Creates a memory DC.
- static HDC GUIAPI CreateMemDC (int width, int height, int depth, DWORD flags, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
- Creates a memory DC.
- MG_EXPORT HDC GUIAPI CreateSubMemDC (HDC parent, int off_x, int off_y, int width, int height, BOOL comp_to_parent)
- Creates a sub memory DC in the given memory DC.
- MG_EXPORT HDC GUIAPI CreateMemDCFromBitmap (HDC hdc, const BITMAP *bmp)
- Creates a memory DC from a reference DC and a BITMAP object.
- MG_EXPORT HDC GUIAPI CreateMemDCFromMyBitmap (const MYBITMAP *my_bmp, const RGB *pal)
- Creates a memory DC from a device independent MYBITMAP object.
- MG_EXPORT BOOL GUIAPI ConvertMemDC (HDC mem_dc, HDC ref_dc, DWORD flags)
- Converts a memory DC to have a same format as a reference DC.
- MG_EXPORT BOOL GUIAPI SetMemDCAlpha (HDC mem_dc, DWORD flags, Uint8 alpha)
- Sets the alpha value for the entire surface of a DC, as opposed to using the alpha component of each pixel.
- MG_EXPORT BOOL GUIAPI SetMemDCColorKey (HDC mem_dc, DWORD flags, Uint32 color_key)
- Sets the color key (transparent pixel) of a memory DC.
- MG_EXPORT void GUIAPI DeleteMemDC (HDC mem_dc)
- Deletes a memory DC.
- MG_EXPORT Uint8 *GUIAPI LockDC (HDC hdc, const RECT *rw_rc, int *width, int *height, int *pitch)
- Locks a dc to get direct access to pixels in the DC.
- MG_EXPORT BOOL GUIAPI LockDCEx (HDC hdc, const PCLIPRGN region, void *context, CB_DIRECT_DRAW_RECT cb)
- directly access the pixels in a DC.
- MG_EXPORT void GUIAPI UnlockDC (HDC hdc)
- Unlocks a locked DC.
- MG_EXPORT HDC GUIAPI CreatePrivateDC (HWND hwnd)
- Creates a private window DC of a window.
- MG_EXPORT HDC GUIAPI CreatePrivateClientDC (HWND hwnd)
- Creates a private client DC of a window.
- HDC GUIAPI CreatePrivateSubDC (HDC hdc, int off_x, int off_y, int width, int height)
- Creates a private SubDC of a window.
- MG_EXPORT HDC GUIAPI GetPrivateClientDC (HWND hwnd)
- Returns the private client DC of a window.
- MG_EXPORT void GUIAPI DeletePrivateDC (HDC hdc)
- Deletes the DC returned by CreatePrivateDC or CreatePrivateClientDC or CreatePrivateSubDC.
- MG_EXPORT HDC GUIAPI CreateSecondaryDC (HWND hwnd)
- Creates a secondary window DC of a window.
- MG_EXPORT HDC GUIAPI SetSecondaryDC (HWND hwnd, HDC secondary_dc, ON_UPDATE_SECONDARYDC on_update_secondarydc)
- Set a window's secondary DC and the callback procedure for the secondary DC update.
- MG_EXPORT HDC GUIAPI GetSecondaryDC (HWND hwnd)
- Retrives and returns the secondary DC of a specific window.
- MG_EXPORT HDC GUIAPI GetSecondaryClientDC (HWND hwnd)
- Retrives and returns the client secondary DC of a specific window.
- MG_EXPORT void GUIAPI ReleaseSecondaryDC (HWND hwnd, HDC hdc)
- Release the DC returned by GetSecondaryDC or GetSecondaryClientDC.
- MG_EXPORT void GUIAPI DeleteSecondaryDC (HWND hwnd)
- Deletes the secondary DC of the window.
- MG_EXPORT Uint32 GUIAPI GetDCAttr (HDC hdc, int attr)
- Gets a specified attribute value of a DC.
- MG_EXPORT Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value)
- Sets a specified attribute value of a DC.
- MG_EXPORT int GUIAPI GetRasterOperation (HDC hdc)
- Gets the raster operation of a DC.
- MG_EXPORT int GUIAPI SetRasterOperation (HDC hdc, int rop)
- Sets the raster operation of a DC to a new value.
- MG_EXPORT int GUIAPI GetPalette (HDC hdc, int start, int len, GAL_Color *cmap)
- Gets palette entries of a DC.
- MG_EXPORT BOOL GUIAPI SetPalette (HDC hdc, int start, int len, GAL_Color *cmap)
- Sets palette entries of a DC.
- MG_EXPORT BOOL GUIAPI SetColorfulPalette (HDC hdc)
- Sets a DC with colorfule palette.
- MG_EXPORT HPALETTE GUIAPI CreatePalette (GAL_Palette *pal)
- Creates a logical palette.
- MG_EXPORT BOOL GUIAPI SelectPalette (HDC hdc, HPALETTE hpal, BOOL reserved)
- Selects a palette for a DC.
- MG_EXPORT BOOL GUIAPI RealizePalette (HDC hdc)
- This function maps palette entries from the current logical palette to the system palette.
- MG_EXPORT BOOL GUIAPI ResizePalette (HPALETTE hpal, int len)
- Resizes a logical palette.
- MG_EXPORT void GUIAPI DestroyPalette (HPALETTE hpal)
- Destroy a logical palette.
- MG_EXPORT HPALETTE GUIAPI GetDefaultPalette (void)
- Gets the system default logical palette.
- MG_EXPORT int GUIAPI GetPaletteEntries (HPALETTE hpal, int start, int len, GAL_Color *cmap)
- Gets palette entries of a logical palette.
- MG_EXPORT int GUIAPI SetPaletteEntries (HPALETTE hpal, int start, int len, GAL_Color *cmap)
- Sets palette entries of a logical palette.
- MG_EXPORT UINT GUIAPI GetNearestPaletteIndex (HPALETTE hpal, Uint8 red, Uint8 green, Uint8 blue)
- Gets the nearest palette index in the logical palette for a spefici color.
- MG_EXPORT RGBCOLOR GUIAPI GetNearestColor (HDC hdc, Uint8 red, Uint8 green, Uint8 blue)
- Gets the nearest color compliant to a DC for a spefici color.
- MG_EXPORT void GUIAPI SetPixel (HDC hdc, int x, int y, gal_pixel pixel)
- Sets the pixel with a new pixel value at the specified position on a DC.
- MG_EXPORT gal_pixel GUIAPI SetPixelRGB (HDC hdc, int x, int y, Uint8 r, Uint8 g, Uint8 b)
- Sets the pixel by a RGB triple at the specified position on a DC.
- MG_EXPORT gal_pixel GUIAPI SetPixelRGBA (HDC hdc, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
- Sets the pixel by a RGBA quarter at the specified position on a DC.
- MG_EXPORT gal_pixel GUIAPI GetPixel (HDC hdc, int x, int y)
- Gets the pixel value at the specified position on a DC.
- MG_EXPORT gal_pixel GUIAPI GetPixelRGB (HDC hdc, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b)
- Gets the pixel value at the specified position on a DC in RGB triple.
- MG_EXPORT gal_pixel GUIAPI GetPixelRGBA (HDC hdc, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
- Gets the pixel value at the specified position on a DC in RGBA quarter.
- MG_EXPORT void GUIAPI RGBA2Pixels (HDC hdc, const RGB *rgbs, gal_pixel *pixels, int count)
- Gets the pixel values from a color array in RGBA quarter under a DC.
- static gal_pixel RGBA2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
- Gets the pixel value from a color in RGBA quarter under a DC.
- MG_EXPORT void GUIAPI RGB2Pixels (HDC hdc, const RGB *rgbs, gal_pixel *pixels, int count)
- Gets the pixel values from a color array in RGB triple under a DC.
- static gal_pixel RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b)
- Gets the pixel value from a color in RGB triple under a DC.
- MG_EXPORT void GUIAPI Pixel2RGBs (HDC hdc, const gal_pixel *pixels, RGB *rgbs, int count)
- Gets the colors in RGB triple from a pixel value array under a DC.
- static void Pixel2RGB (HDC hdc, gal_pixel pixel, Uint8 *r, Uint8 *g, Uint8 *b)
- Gets the color in RGB triple from a pixel value under a DC.
- MG_EXPORT void GUIAPI Pixel2RGBAs (HDC hdc, const gal_pixel *pixels, RGB *rgbs, int count)
- Gets the colors in RGBA quarter from a array of pixel values under a DC.
- static void Pixel2RGBA (HDC hdc, gal_pixel pixel, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
- Gets the color in RGBA quarter from a pixel value under a DC.
- static DWORD Pixel2DWORD (HDC hdc, gal_pixel pixel)
- An inline function to convert pixel value to DWORD color.
- static gal_pixel DWORD2PIXEL (HDC hdc, DWORD dword)
- An inline function to convert DWORD color to gal_pixel.
- MG_EXPORT void GUIAPI FocusRect (HDC hdc, int x0, int y0, int x1, int y1)
- Draws a focus rectangle.
- MG_EXPORT void GUIAPI DrawHVDotLine (HDC hdc, int x, int y, int w_h, BOOL H_V)
- Draws a horizontal or vertical dot dash line.
- MG_EXPORT BOOL GUIAPI LineClipper (const RECT *cliprc, int *_x0, int *_y0, int *_x1, int *_y1)
- The line clipper using Cohen-Sutherland algorithm.
- MG_EXPORT void GUIAPI LineGenerator (void *context, int x1, int y1, int x2, int y2, CB_LINE cb)
- A line generator based-on Breshenham algorithm.
- MG_EXPORT void GUIAPI CircleGenerator (void *context, int sx, int sy, int r, CB_CIRCLE cb)
- A circle generator.
- MG_EXPORT void GUIAPI EllipseGenerator (void *context, int sx, int sy, int rx, int ry, CB_ELLIPSE cb)
- An ellipse generator.
- MG_EXPORT void GUIAPI CircleArcGenerator (void *context, int sx, int sy, int r, int ang1, int ang2, CB_ARC cb)
- An arc generator.
- MG_EXPORT BOOL GUIAPI MonotoneVerticalPolygonGenerator (void *context, const POINT *pts, int vertices, CB_POLYGON cb)
- A monotone vertical polygon generator.
- MG_EXPORT BOOL GUIAPI PolygonIsMonotoneVertical (const POINT *pts, int vertices)
- Checks a polygon is monotone vertical or not.
- MG_EXPORT BOOL GUIAPI PolygonGeneratorEx (void *context, const POINT *pts, int vertices, CB_POLYGON cb, RECT *rc_output)
- A general polygon generator.
- MG_EXPORT BOOL GUIAPI FloodFillGenerator (void *context, const RECT *src_rc, int x, int y, CB_EQUAL_PIXEL cb_equal_pixel, CB_FLOOD_FILL cb_flood_fill)
- A flood filling generator.
- MG_EXPORT int GUIAPI SetBitmapScalerType (HDC hdc, int scaler_type)
- set bitmap scaler algorithm callback of DC according by scaler_type.
- MG_EXPORT void GUIAPI MoveTo (HDC hdc, int x, int y)
- Moves the current zero pen position.
- MG_EXPORT void GUIAPI LineTo (HDC hdc, int x, int y)
- Draws a zero line to a position.
- MG_EXPORT void GUIAPI Rectangle (HDC hdc, int x0, int y0, int x1, int y1)
- Draws a rectangle.
- MG_EXPORT void GUIAPI PolyLineTo (HDC hdc, const POINT *pts, int vertices)
- Draws a polyline.
- MG_EXPORT void GUIAPI SplineTo (HDC hdc, const POINT *pts)
- Draws a bezier spline.
- MG_EXPORT void GUIAPI Circle (HDC hdc, int sx, int sy, int r)
- Draws a circle.
- MG_EXPORT void GUIAPI Ellipse (HDC hdc, int sx, int sy, int rx, int ry)
- Draws a ellipse.
- MG_EXPORT void GUIAPI CircleArc (HDC hdc, int sx, int sy, int r, int ang1, int ang2)
- Draws an arc.
- MG_EXPORT void GUIAPI FillBox (HDC hdc, int x, int y, int w, int h)
- Fills a rectangle box.
- MG_EXPORT void GUIAPI FillCircle (HDC hdc, int sx, int sy, int r)
- Fills a circle.
- MG_EXPORT void GUIAPI FillEllipse (HDC hdc, int sx, int sy, int rx, int ry)
- Fills an ellipse.
- MG_EXPORT BOOL GUIAPI FillPolygon (HDC hdc, const POINT *pts, int vertices)
- Fills an polygon.
- MG_EXPORT BOOL GUIAPI FloodFill (HDC hdc, int x, int y)
- Fills an enclosed area starting at point (x,y).
- MG_EXPORT void GUIAPI SetPenDashes (HDC hdc, int dash_offset, const unsigned char *dash_list, int n)
- Sets the way dashed-lines are drawn.
- MG_EXPORT void GUIAPI SetBrushInfo (HDC hdc, const BITMAP *tile, const STIPPLE *stipple)
- Set the tile or stipple with the DC.
- MG_EXPORT void GUIAPI SetBrushOrigin (HDC hdc, int x, int y)
- Set the origin when using tiles or stipples with the DC.
- MG_EXPORT void GUIAPI LineEx (HDC hdc, int x1, int y1, int x2, int y2)
- Draws a line with the current pen in the DC hdc.
- MG_EXPORT void GUIAPI ArcEx (HDC hdc, int x, int y, int width, int height, int ang1, int ang2)
- Draws an arc with the current pen in a DC.
- MG_EXPORT void GUIAPI FillArcEx (HDC hdc, int x, int y, int width, int height, int ang1, int ang2)
- Fills an arc with the current brush in a DC.
- MG_EXPORT void GUIAPI PolyLineEx (HDC hdc, const POINT *pts, int nr_pts)
- Draws a polyline with the current pen in a DC.
- MG_EXPORT void GUIAPI PolyArcEx (HDC hdc, const ARC *arcs, int nr_arcs)
- Draws a polyarc with the current pen in a DC.
- MG_EXPORT void GUIAPI PolyFillArcEx (HDC hdc, const ARC *arcs, int nr_arcs)
- Fill a polyarc with the current brush in a DC.
- MG_EXPORT BOOL GUIAPI RoundRect (HDC hdc, int x0, int y0, int x1, int y1, int cw, int ch)
- Draw and fill a rectangle with rounded corners in a DC.
- MG_EXPORT void GUIAPI GetDCLCS (HDC hdc, int which, POINT *pt)
- Retrieves mapping parameters of a device context.
- MG_EXPORT void GUIAPI SetDCLCS (HDC hdc, int which, const POINT *pt)
- Sets mapping parameters of a device context.
- MG_EXPORT void GUIAPI DPtoLP (HDC hdc, POINT *pPt)
- Converts device coordinates into logical coordinates.
- MG_EXPORT void GUIAPI LPtoDP (HDC hdc, POINT *pPt)
- Converts logical coordinates into device coordinates.
- MG_EXPORT void GUIAPI SPtoLP (HDC hdc, POINT *pPt)
- Converts screen coordinates into logical coordinates.
- MG_EXPORT void GUIAPI LPtoSP (HDC hdc, POINT *pPt)
- Converts logical coordinates into screen coordinates.
- MG_EXPORT void GUIAPI ExcludeClipRect (HDC hdc, const RECT *prc)
- Excludes the specified rectangle from the current visible region of a DC.
- MG_EXPORT void GUIAPI IncludeClipRect (HDC hdc, const RECT *prc)
- Includes the specified rectangle to the current visible region of a DC.
- MG_EXPORT BOOL GUIAPI PtVisible (HDC hdc, int x, int y)
- Checks whether a point is visible.
- MG_EXPORT void GUIAPI ClipRectIntersect (HDC hdc, const RECT *prc)
- Intersects the specified rectangle with the visible region of the DC.
- MG_EXPORT void GUIAPI SelectClipRect (HDC hdc, const RECT *prc)
- Sets the visible region of a DC to be a rectangle.
- MG_EXPORT int GUIAPI SelectClipRegionEx (HDC hdc, const CLIPRGN *pRgn, int fnMode)
- Combines the specified region with the current clipping region using the specified mode.
- MG_EXPORT void GUIAPI SelectClipRegion (HDC hdc, const CLIPRGN *pRgn)
- Sets the visible region of a DC to be a region.
- MG_EXPORT int GUIAPI OffsetClipRegion (HDC hdc, int nXOffset, int nYOffset)
- Moves the clipping region of a device context by the specified offsets.
- MG_EXPORT void GUIAPI GetBoundsRect (HDC hdc, RECT *pRect)
- Retrieves the bounding rectangle of the current visible region of a DC.
- MG_EXPORT BOOL GUIAPI RectVisible (HDC hdc, const RECT *pRect)
- Checks whether the specified rectangle is visible.
- MG_EXPORT int GUIAPI GetClipBox (HDC hdc, RECT *clipbox)
- Retrieves the bounding rectangle of the current clipping region of a DC.
- MG_EXPORT BOOL GUIAPI GetBitmapFromDC (HDC hdc, int x, int y, int w, int h, BITMAP *bmp)
- Gets image box on a DC and saves it into a BITMAP object.
- MG_EXPORT BOOL GUIAPI FillBoxWithBitmap (HDC hdc, int x, int y, int w, int h, const BITMAP *bmp)
- Fills a box with a BITMAP object.
- MG_EXPORT BOOL GUIAPI FillBoxWithBitmapPart (HDC hdc, int x, int y, int w, int h, int bw, int bh, const BITMAP *bmp, int xo, int yo)
- Fills a box with a part of a bitmap oject.
- MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y, int box_w, int box_h, const BITMAP *pbmp, int bmp_x, int bmp_y, int bmp_w, int bmp_h)
- Fills a part of bitmap into a box, and the parts bitmap will be scaled if needed.
- MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh, HDC hddc, int dx, int dy, DWORD dwRop)
- Performs a bit-block transfer from a device context into another device context.
- MG_EXPORT void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh, HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop)
- Copies a bitmap from a source rectangle into a destination rectangle, streches the bitmap if necessary.
- MG_EXPORT BOOL GUIAPI ScaleBitmapEx (BITMAP *dst, const BITMAP *src, HDC ref_dc)
- Scales a BITMAP object into another BITMAP object by specify algorithm.
- MG_EXPORT gal_pixel GUIAPI GetPixelInBitmapEx (const BITMAP *bmp, int x, int y, Uint8 *alpha)
- Returns the pixel value in a BITMAP object.
- static gal_pixel GUIAPI GetPixelInBitmap (const BITMAP *bmp, int x, int y)
- Returns the pixel value in a BITMAP object.
- static BOOL GUIAPI SetPixelInBitmap (const BITMAP *bmp, int x, int y, gal_pixel pixel)
- Sets pixel value in a BITMAP object.
- MG_EXPORT BOOL GUIAPI SaveScreenRectContent (const RECT *rcWin, const char *filename)
- Saves content of a rectangle in the screen to a file.
- MG_EXPORT BOOL GUIAPI SaveMainWindowContent (HWND hWnd, const char *filename)
- Saves content of a main window to a file.
- MG_EXPORT HICON GUIAPI LoadIconFromFile (HDC hdc, const char *filename, int which)
- Loads an icon from a Windows ICO file.
- MG_EXPORT HICON GUIAPI LoadIconFromMem (HDC hdc, const void *area, int which)
- Loads an icon from a memory area.
- MG_EXPORT HICON GUIAPI CreateIconEx (HDC hdc, int w, int h, const BYTE *AndBits, const BYTE *XorBits, int colornum, const RGB *pal)
- Creates an icon object from the memory.
- MG_EXPORT BOOL GUIAPI DestroyIcon (HICON hicon)
- Destroys an icon object.
- MG_EXPORT BOOL GUIAPI GetIconSize (HICON hicon, int *w, int *h)
- Gets the size of an icon object.
- MG_EXPORT void GUIAPI DrawIcon (HDC hdc, int x, int y, int w, int h, HICON hicon)
- Draws an icon into a box.
- static void SetRect (RECT *prc, int left, int top, int right, int bottom)
- Sets a rectangle.
- static void SetRectEmpty (RECT *prc)
- Empties a rectangle.
- static void CopyRect (RECT *pdrc, const RECT *psrc)
- Copies one rectangle to another.
- static void OffsetRect (RECT *prc, int x, int y)
- Moves a rectangle by offsets.
- static void InflateRect (RECT *prc, int cx, int cy)
- Increases or decreases the width and height of an rectangle.
- static void InflateRectToPt (RECT *prc, int x, int y)
- Inflates a rectangle to contain a point.
- static BOOL PtInRect (const RECT *prc, int x, int y)
- Determines whether a point lies within an rectangle.
- MG_EXPORT BOOL GUIAPI IsRectEmpty (const RECT *prc)
- Determines whether an rectangle is empty.
- MG_EXPORT BOOL GUIAPI EqualRect (const RECT *prc1, const RECT *prc2)
- Determines whether two rectangles are equal.
- MG_EXPORT void GUIAPI NormalizeRect (RECT *pRect)
- Normalizes a rectangle.
- MG_EXPORT BOOL GUIAPI IntersectRect (RECT *pdrc, const RECT *psrc1, const RECT *psrc2)
- Calculates the intersection of two rectangles.
- MG_EXPORT BOOL GUIAPI IsCovered (const RECT *prc1, const RECT *prc2)
- Determines whether one rectangle is covered by another.
- MG_EXPORT BOOL GUIAPI DoesIntersect (const RECT *psrc1, const RECT *psrc2)
- Determines whether two rectangles intersect.
- MG_EXPORT BOOL GUIAPI UnionRect (RECT *pdrc, const RECT *psrc1, const RECT *psrc2)
- Unions two source rectangles.
- MG_EXPORT void GUIAPI GetBoundRect (PRECT pdrc, const RECT *psrc1, const RECT *psrc2)
- Gets the bound rectangle of two source rectangles.
- MG_EXPORT int GUIAPI SubtractRect (RECT *rc, const RECT *psrc1, const RECT *psrc2)
- Obtains the rectangles when substracting one rectangle from another.
- MG_EXPORT void GUIAPI GetFontMetrics (LOGFONT *log_font, FONTMETRICS *font_metrics)
- Gets metrics information of a logical font.
- MG_EXPORT void GUIAPI GetGlyphBitmap (LOGFONT *log_font, const char *mchar, int mchar_len, GLYPHBITMAP *glyph_bitmap)
- Gets the glyph bitmap information when uses a logical font to output a character.
- MG_EXPORT BOOL GUIAPI InitVectorialFonts (void)
- Initializes vectorial font renderer.
- MG_EXPORT void GUIAPI TermVectorialFonts (void)
- Terminates vectorial font renderer.
- MG_EXPORT PLOGFONT GUIAPI CreateLogFont (const char *type, const char *family, const char *charset, char weight, char slant, char flip, char other, char underline, char struckout, int size, int rotation)
- Creates a logical font.
- MG_EXPORT PLOGFONT GUIAPI CreateLogFontByName (const char *font_name)
- Creates a logical font by a font name.
- MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirect (LOGFONT *logfont)
- Creates a logical font indirectly from a LOGFONT structure.
- MG_EXPORT void GUIAPI DestroyLogFont (PLOGFONT log_font)
- Destroys a logical font.
- MG_EXPORT void GUIAPI GetLogFontInfo (HDC hdc, LOGFONT *log_font)
- Gets logical font information of a DC.
- MG_EXPORT PLOGFONT GUIAPI GetCurFont (HDC hdc)
- Gets the pointer to the current logical font of a DC.
- MG_EXPORT PLOGFONT GUIAPI SelectFont (HDC hdc, PLOGFONT log_font)
- Selects a logical font into a DC.
- MG_EXPORT const DEVFONT *GUIAPI GetNextDevFont (const DEVFONT *dev_font)
- Get next devfont information.
- MG_EXPORT BOOL GUIAPI ft2SetLcdFilter (LOGFONT *logfont, mg_FT_LcdFilter filter)
- Set freetype2 smooth mode.
- MG_EXPORT DEVFONT *GUIAPI LoadDevFontFromFile (const char *devfont_name, const char *file_name)
- Load device font from font file.
- MG_EXPORT void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont)
- Destroy device font loaded dynamically from font file.
- static PLOGFONT GUIAPI GetSystemFont (int font_id)
- Gets the system logical font through an font identifier.
- MG_EXPORT int GUIAPI GetSysFontMaxWidth (int font_id)
- Gets the maximal width of a single-byte character of a system font.
- MG_EXPORT int GUIAPI GetSysFontAveWidth (int font_id)
- Gets the average width of a single-byte character of a system font.
- MG_EXPORT int GUIAPI GetSysFontHeight (int font_id)
- Gets the height of a single-byte character of a system font.
- MG_EXPORT const char *GUIAPI GetSysCharset (BOOL wchar)
- Gets the current system charset.
- MG_EXPORT int GUIAPI GetSysCharHeight (void)
- Gets the height of a character of the default system font.
- MG_EXPORT int GUIAPI GetSysCharWidth (void)
- Gets the width of a single-byte character of the default system font.
- MG_EXPORT int GUIAPI GetSysCCharWidth (void)
- Gets the width of a multi-byte character of the default system font.
- MG_EXPORT int GUIAPI GetTextMCharInfo (PLOGFONT log_font, const char *mstr, int len, int *pos_chars)
- Retrieves positions of multi-byte characters in a string.
- MG_EXPORT int GUIAPI GetTextWordInfo (PLOGFONT log_font, const char *mstr, int len, int *pos_words, WORDINFO *info_words)
- Retrieves information of multi-byte words in a string.
- MG_EXPORT int GUIAPI GetFirstMCharLen (PLOGFONT log_font, const char *mstr, int len)
- Retrieves the length of the first multi-byte character in a string.
- MG_EXPORT int GUIAPI GetFirstWord (PLOGFONT log_font, const char *mstr, int len, WORDINFO *word_info)
- Retrieves the length and info of the first multi-byte word in a string.
- MG_EXPORT int GUIAPI MB2WCEx (PLOGFONT log_font, void *dest, BOOL wc32, const unsigned char *mstr, int n)
- Converts a multibyte character to a wide character in UCS according to the charset/encoding of the logical font.
- MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, UChar32 wc)
- Converts a wide character in UCS to a multibyte character according to the charset/encoding of the logical font.
- MG_EXPORT int GUIAPI MBS2WCSEx (PLOGFONT log_font, void *dest, BOOL wc32, const unsigned char *mstr, int mstr_len, int n, int *conved_mstr_len)
- Converts a multibyte string to a wide character string in UC16 according to the charset/encoding of the logical font.
- MG_EXPORT int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char *dest, const void *wcs, int wcs_len, BOOL wc32, int n, int *conved_wcs_len)
- Converts a wide character string in UC16 to a multibyte string according to the charset/encoding of the logical font.
- MG_EXPORT int GUIAPI GetTextExtentPoint (HDC hdc, const char *text, int len, int max_extent, int *fit_chars, int *pos_chars, int *dx_chars, SIZE *size)
- Computes the extent of a string when output the string in a limited space.
- MG_EXPORT int GUIAPI GetTabbedTextExtentPoint (HDC hdc, const char *text, int len, int max_extent, int *fit_chars, int *pos_chars, int *dx_chars, SIZE *size)
- Computes the extent of a string when output the formatted string in a limited space.
- MG_EXPORT int GUIAPI GetFontHeight (HDC hdc)
- Retrieves the height of the current logical font in a DC.
- MG_EXPORT int GUIAPI GetMaxFontWidth (HDC hdc)
- Retrieves the maximal character width of the current logical font in a DC.
- MG_EXPORT int GUIAPI GetTextExtent (HDC hdc, const char *spText, int len, SIZE *pSize)
- Computes the output extent of a string of text.
- MG_EXPORT int GUIAPI GetTabbedTextExtent (HDC hdc, const char *spText, int len, SIZE *pSize)
- Computes the output extent of a formatted text.
- MG_EXPORT int GUIAPI TextOutLen (HDC hdc, int x, int y, const char *spText, int len)
- Outputs a string of text.
- MG_EXPORT int GUIAPI TextOutOmitted (HDC hdc, int x, int y, const char *mtext, int len, int max_extent)
- Outputs a string of text with omitted format.
- MG_EXPORT int GUIAPI TabbedTextOutLen (HDC hdc, int x, int y, const char *spText, int len)
- Outputs a formatted text.
- MG_EXPORT int GUIAPI TabbedTextOutEx (HDC hdc, int x, int y, const char *spText, int nCount, int nTabPositions, int *pTabPositions, int nTabOrigin)
- Writes a character string at a specified location, expanding tabs to the values specified in an anrry of tab-stop positions.
- MG_EXPORT void GUIAPI GetLastTextOutPos (HDC hdc, POINT *pt)
- Retrieves the last text output position.
- MG_EXPORT int GUIAPI DrawTextEx2 (HDC hdc, const char *pText, int nCount, RECT *pRect, int nIndent, UINT nFormat, DTFIRSTLINE *firstline)
- Draws a formatted text in a rectangle.
- MG_EXPORT BOOL GUIAPI RegisterBitmapFileType (const char *ext, void *(*init)(MG_RWops *fp, MYBITMAP *my_bmp, RGB *pal), int(*load)(MG_RWops *fp, void *init_info, MYBITMAP *my_bmp, CB_ONE_SCANLINE cb, void *context), void(*cleanup)(void *init_info), int(*save)(MG_RWops *fp, MYBITMAP *my_bmp, RGB *pal), BOOL(*check)(MG_RWops *fp))
- Registers a bitmap file loader, saver, and checker.
- MG_EXPORT const char *GUIAPI CheckBitmapType (MG_RWops *fp)
- Checks the type of the bitmap in a data source.
- MG_EXPORT BOOL GUIAPI mlsEnableSlaveScreen (HDC dc_mls, BOOL enable)
- Enable or Disable a MLShadow slave screen.
- MG_EXPORT int GUIAPI LoadBitmapEx (HDC hdc, PBITMAP pBitmap, MG_RWops *area, const char *ext)
- Loads a device-dependent bitmap from a general data source.
- MG_EXPORT int GUIAPI LoadBitmapFromFile (HDC hdc, PBITMAP pBitmap, const char *spFileName)
- Loads a device-dependent bitmap from a file.
- MG_EXPORT int GUIAPI LoadBitmapFromMem (HDC hdc, PBITMAP pBitmap, const void *mem, int size, const char *ext)
- Loads a device-dependent bitmap from memory.
- MG_EXPORT void GUIAPI UnloadBitmap (PBITMAP pBitmap)
- Unloads a bitmap.
- MG_EXPORT void GUIAPI ReplaceBitmapColor (HDC hdc, PBITMAP pBitmap, gal_pixel iOColor, gal_pixel iNColor)
- Replaces a specific pixels in a bitmap with another pixel.
- MG_EXPORT void GUIAPI HFlipBitmap (BITMAP *bmp, unsigned char *inter_buff)
- Horizontal Flip the special Bitmap object.
- MG_EXPORT void GUIAPI VFlipBitmap (BITMAP *bmp, unsigned char *inter_buff)
- Vertical Flip the special Bitmap object.
- MG_EXPORT void *GUIAPI InitMyBitmapSL (MG_RWops *area, const char *ext, MYBITMAP *my_bmp, RGB *pal)
- Initializes scanline loader of the MYBITMAP object from a data source.
- MG_EXPORT int GUIAPI LoadMyBitmapSL (MG_RWops *area, void *load_info, MYBITMAP *my_bmp, CB_ONE_SCANLINE cb, void *context)
- Loads MYBITMAP scanlines from a data source one by one.
- MG_EXPORT int GUIAPI CleanupMyBitmapSL (MYBITMAP *my_bmp, void *load_info)
- Cleanups the scanline loader.
- MG_EXPORT int GUIAPI LoadMyBitmapEx (PMYBITMAP my_bmp, RGB *pal, MG_RWops *area, const char *ext)
- Loads a MYBITMAP object from a data source.
- MG_EXPORT int GUIAPI LoadMyBitmapFromFile (PMYBITMAP my_bmp, RGB *pal, const char *file_name)
- Loads a MYBITMAP object from a file.
- MG_EXPORT int GUIAPI LoadMyBitmapFromMem (PMYBITMAP my_bmp, RGB *pal, const void *mem, int size, const char *ext)
- Loads a MYBITMAP object from memory.
- MG_EXPORT void GUIAPI UnloadMyBitmap (PMYBITMAP my_bmp)
- Unloads a bitmap.
- MG_EXPORT int GUIAPI SaveMyBitmapToFile (PMYBITMAP my_bmp, RGB *pal, const char *spFileName)
- Saves a MYBITMAP object to a bitmap file.
- MG_EXPORT int GUIAPI SaveBitmapToFile (HDC hdc, PBITMAP pBitmap, const char *spFileName)
- Saves a BITMAP object to a bitmap file.
- MG_EXPORT BOOL GUIAPI InitBitmap (HDC hdc, Uint32 w, Uint32 h, Uint32 pitch, BYTE *bits, PBITMAP bmp)
- Initializes a BITMAP object as a normal bitmap.
- MG_EXPORT HDC GUIAPI InitSlaveScreen (const char *name, const char *mode)
- Initializes slave screen.
- MG_EXPORT void GUIAPI TerminateSlaveScreen (HDC hdc)
- Terminates slave screen.
- MG_EXPORT BOOL GUIAPI InitBitmapPixelFormat (HDC hdc, PBITMAP bmp)
- Initializes the bitmap pixel format information of a BITMAP object.
- MG_EXPORT void GUIAPI DeleteBitmapAlphaPixel (PBITMAP bmp)
- Deletes the bitmap alpha pixel format information of a BITMAP object.
- MG_EXPORT int GUIAPI ExpandMyBitmap (HDC hdc, PBITMAP bmp, const MYBITMAP *my_bmp, const RGB *pal, int frame)
- Expands a MYBITMAP object to a BITMAP object.
- MG_EXPORT void GUIAPI ExpandMonoBitmap (HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg)
- Convert a mono color MYBITMAP pixel data to a BITMAP pixel data.
- MG_EXPORT void GUIAPI Expand16CBitmap (HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, const RGB *pal)
- Convert a 16 color MYBITMAP pixel data to a BITMAP pixel data.
- MG_EXPORT void GUIAPI CompileRGBABitmap (HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, void *pixel_format, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT *mybmp)
- Convert a MYBITMAP pixel data to a BITMAP pixel data.
- MG_EXPORT void GUIAPI CompileRGBABitmapEx (HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, void *pixel_format, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT *mybmp, BYTE *alpha_mask)
- Compile a MYBITMAP pixel data to a BITMAP pixel data.
- MG_EXPORT int GUIAPI PaintImageEx (HDC hdc, int x, int y, MG_RWops *area, const char *ext)
- Paints an image from data source on device directly.
- MG_EXPORT int GUIAPI PaintImageFromFile (HDC hdc, int x, int y, const char *spFileName)
- Paints an image from file on device directly.
- MG_EXPORT int GUIAPI PaintImageFromMem (HDC hdc, int x, int y, const void *mem, int size, const char *ext)
- Paints an image from memory on device directly.
- MG_EXPORT int GUIAPI StretchPaintImageEx (HDC hdc, int x, int y, int w, int h, MG_RWops *area, const char *ext)
- Paints an image from data source on device directly.
- MG_EXPORT int GUIAPI StretchPaintImageFromFile (HDC hdc, int x, int y, int w, int h, const char *spFileName)
- Paints an image from file on device directly.
- MG_EXPORT int GUIAPI StretchPaintImageFromMem (HDC hdc, int x, int y, int w, int h, const void *mem, int size, const char *ext)
- Paints an image from memory on device directly.
- MG_EXPORT void GUIAPI RotateBitmap (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle)
- Rotate a bitmap object.
- MG_EXPORT void GUIAPI RotateBitmapVFlip (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle)
- Flips vertically and rotates a bitmap object.
- MG_EXPORT void GUIAPI RotateBitmapHFlip (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle)
- Flips horizontally and rotates a bitmap object.
- MG_EXPORT void GUIAPI RotateScaledBitmap (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle, int w, int h)
- Stretches or shrinks a bitmap object at the same as rotating it.
- MG_EXPORT void GUIAPI RotateScaledBitmapVFlip (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle, int w, int h)
- Flip vertically, rotates, stretch or shrinks a bitmap object.
- MG_EXPORT void GUIAPI RotateScaledBitmapHFlip (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle, int w, int h)
- Flip horizontaly, rotates, stretch or shrinks a bitmap object.
- MG_EXPORT void GUIAPI PivotBitmap (HDC hdc, const BITMAP *bmp, int lx, int ty, int cx, int cy, int angle)
- Pivot a bitmap object.
- MG_EXPORT void GUIAPI PivotScaledBitmapFlip (HDC hdc, const BITMAP *bmp, fixed x, fixed y, fixed cx, fixed cy, int angle, fixed scale_x, fixed scale_y, BOOL h_flip, BOOL v_flip)
- Rotates, stretches or shrinks, flips a bitmap object.
- MG_EXPORT DEVFONT *GUIAPI CreateBMPDevFont (const char *bmpfont_name, const BITMAP *glyph_bmp, const char *start_mchar, int nr_glyphs, int glyph_width)
- Create a bitmap device font.
- MG_EXPORT BOOL GUIAPI AddGlyphsToBMPFont (DEVFONT *dev_font, BITMAP *glyph_bmp, const char *start_mchar, int nr_glyphs, int glyph_width)
- Add a new segment in device font.
- MG_EXPORT void GUIAPI DestroyBMPFont (DEVFONT *dev_font)
- Destroy the bitmap device font.
- MG_EXPORT Glyph32 GUIAPI GetGlyphValue (LOGFONT *logfont, const char *mchar, int mchar_len, const char *pre_mchar, int pre_len)
- Get the glyph value of a multi-byte character.
- MG_EXPORT Glyph32 GUIAPI GetGlyphShape (LOGFONT *logfont, const char *mchar, int mchar_len, SHAPETYPE shape_type)
- Get the glyph shape of a character.
- MG_EXPORT int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value, int *adv_x, int *adv_y)
- Draw a glyph.
- MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT *logfont, Glyph32 glyph_value, GLYPHINFO *glyph_info)
- Retriev the information of a glyph.
- MG_EXPORT int GUIAPI GetGlyphsExtent (HDC hdc, Glyph32 *glyphs, int nr_glyphs, SIZE *size)
- Get visual extent value of a glyph string.
- MG_EXPORT int GUIAPI GetGlyphsExtentPoint (HDC hdc, Glyph32 *glyphs, int nr_glyphs, int max_extent, SIZE *size)
- Get the visual extent value of a glyph string.
- MG_EXPORT int GUIAPI BIDIGetTextLogicalGlyphs (LOGFONT *log_font, const char *text, int text_len, Glyph32 **glyphs, GLYPHMAPINFO **glyphs_map)
- Get logical glyphs string of the text.
- MG_EXPORT int GUIAPI BIDIGetTextVisualGlyphs (LOGFONT *log_font, const char *text, int text_len, Glyph32 **glyphs, GLYPHMAPINFO **glyphs_map)
- Get visual glyphs and glyph_map info relative with logical string byte index.
- MG_EXPORT Glyph32 *GUIAPI BIDILogGlyphs2VisGlyphs (LOGFONT *log_font, Glyph32 *glyphs, int nr_glyphs, GLYPHMAPINFO *glyphs_map)
- Reorder the logical glyphs string to visual glyphs string.
- MG_EXPORT void GUIAPI GetTextRangesLog2Vis (LOGFONT *log_font, char *text, int text_len, int start_index, int end_index, int **ranges, int *nr_ranges)
- Get a list of visual ranges corresponding to a given logical range.
- MG_EXPORT void GUIAPI BIDIGetLogicalEmbeddLevels (LOGFONT *log_font, Glyph32 *glyphs, int nr_glyphs, Uint8 **embedding_level_list)
- Get the logical embedding levels for the logical glyph string and generate runs by embedding levels, the for reorder to get visual glyph string.
- MG_EXPORT void GUIAPI BIDIGetVisualEmbeddLevels (LOGFONT *log_font, Glyph32 *glyphs, int nr_glyphs, Uint8 **embedding_level_list)
- Get the visual embedding levels for the given logical glyph string, then you can get the edge for visual glyphs.
Variables
Detailed Description
- Author:
- Wei Yongming <ymwei@minigui.org>
- Date:
- 2002/01/06
This file includes graphics device interfaces of MiniGUI.
Copyright (C) 2002-2009 Feynman Software.
Copyright (C) 1998-2002 Wei Yongming.
All rights reserved by Feynman Software.
This file is part of MiniGUI, a compact cross-platform Graphics
User Interface (GUI) support system for real-time embedded systems.
Definition in file gdi.h.
Function Documentation
BOOL GUIAPI AddGlyphsToBMPFont |
( |
DEVFONT * |
dev_font, |
|
|
BITMAP * |
glyph_bmp, |
|
|
const char * |
start_mchar, |
|
|
int |
nr_glyphs, |
|
|
int |
glyph_width | |
|
) |
| | |
Add a new segment in device font.
This function add a new segment to the device font pointed by dev_font.
- Parameters:
-
| dev_font | The pointer to the device font. |
| glyph_bmp | The pointer to the segment glyph bitmap object. |
| start_mchar | The pointer to the first char of the segment. |
| nr_glyphs | The character count of the segment. |
| glyph_width | The character width in the segment. |
- Returns:
- TRUE if success, otherwise FALSE.
DEVFONT *GUIAPI CreateBMPDevFont |
( |
const char * |
bmpfont_name, |
|
|
const BITMAP * |
glyph_bmp, |
|
|
const char * |
start_mchar, |
|
|
int |
nr_glyphs, |
|
|
int |
glyph_width | |
|
) |
| | |
Create a bitmap device font.
This function create a bitmap device font and return the pointer to the new device font.
- Parameters:
-
| bmpfont_name | The font name. |
| glyph_bmp | The pointer to the bitmap object. |
| start_mchar | The pointer to the first char of segment. |
| nr_glyphs | The character count of the segment. |
| glyph_width | The character width. |
- Returns:
- The pointer to the new device font on sucess, otherwise NULL.
void GUIAPI DestroyBMPFont |
( |
DEVFONT * |
dev_font |
) |
|
Destroy the bitmap device font.
This function destroy the bitmap device font pointed by dev_font.
- Parameters:
-
| dev_font | The pointer to the device font which will be destroyed. |
- Returns:
- TRUE if success, otherwise FALSE.