📄 grlib.h
字号:
extern const tFont g_sFontCmss38;
extern const tFont g_sFontCmss38b;
extern const tFont g_sFontCmss38i;
extern const tFont g_sFontCmss40;
extern const tFont g_sFontCmss40b;
extern const tFont g_sFontCmss40i;
extern const tFont g_sFontCmss42;
extern const tFont g_sFontCmss42b;
extern const tFont g_sFontCmss42i;
extern const tFont g_sFontCmss44;
extern const tFont g_sFontCmss44b;
extern const tFont g_sFontCmss44i;
extern const tFont g_sFontCmss46;
extern const tFont g_sFontCmss46b;
extern const tFont g_sFontCmss46i;
extern const tFont g_sFontCmss48;
extern const tFont g_sFontCmss48b;
extern const tFont g_sFontCmss48i;
extern const tFont g_sFontFixed6x8;
//*****************************************************************************
//
// Language identifiers supported by the string table processing functions.
//
//*****************************************************************************
#define GrLangZhPRC 0x0804 // Chinese (PRC)
#define GrLangZhTW 0x0404 // Chinese (Taiwan)
#define GrLangEnUS 0x0409 // English (United States)
#define GrLangEnUK 0x0809 // English (United Kingdom)
#define GrLangEnAUS 0x0C09 // English (Australia)
#define GrLangEnCA 0x1009 // English (Canada)
#define GrLangEnNZ 0x1409 // English (New Zealand)
#define GrLangFr 0x040C // French (Standard)
#define GrLangDe 0x0407 // German (Standard)
#define GrLangHi 0x0439 // Hindi
#define GrLangIt 0x0410 // Italian (Standard)
#define GrLangJp 0x0411 // Japanese
#define GrLangKo 0x0412 // Korean
#define GrLangEsMX 0x080A // Spanish (Mexico)
#define GrLangEsSP 0x0C0A // Spanish (Spain)
#define GrLangSwKE 0x0441 // Swahili (Kenya)
#define GrLangUrIN 0x0820 // Urdu (India)
#define GrLangUrPK 0x0420 // Urdu (Pakistan)
//*****************************************************************************
//
//! Translates a 24-bit RGB color to a display driver-specific color.
//!
//! \param pDisplay is the pointer to the display driver structure for the
//! display to operate upon.
//! \param ulValue is the 24-bit RGB color. The least-significant byte is the
//! blue channel, the next byte is the green channel, and the third byte is the
//! red channel.
//!
//! This function translates a 24-bit RGB color into a value that can be
//! written into the display's frame buffer in order to reproduce that color,
//! or the closest possible approximation of that color.
//!
//! \return Returns the display-driver specific color.
//
//*****************************************************************************
#define DpyColorTranslate(pDisplay, ulValue) \
((pDisplay)->pfnColorTranslate((pDisplay)->pvDisplayData, ulValue))
//*****************************************************************************
//
//! Flushes cached drawing operations.
//!
//! \param pDisplay is the pointer to the display driver structure for the
//! display to operate upon.
//!
//! This function flushes any cached drawing operations on a display.
//!
//! \return None.
//
//*****************************************************************************
#define DpyFlush(pDisplay) \
do \
{ \
const tDisplay *pD = pDisplay; \
pD->pfnFlush(pD->pvDisplayData); \
} \
while(0)
//*****************************************************************************
//
//! Gets the height of the display.
//!
//! \param pDisplay is a pointer to the display driver structure for the
//! display to query.
//!
//! This function determines the height of the display.
//!
//! \return Returns the height of the display in pixels.
//
//*****************************************************************************
#define DpyHeightGet(pDisplay) \
((pDisplay)->usHeight)
//*****************************************************************************
//
//! Draws a horizontal line on a display.
//!
//! \param pDisplay is the pointer to the display driver structure for the
//! display to operate upon.
//! \param lX1 is the starting X coordinate of the line.
//! \param lX2 is the ending X coordinate of the line.
//! \param lY is the Y coordinate of the line.
//! \param ulValue is the color to draw the line.
//!
//! This function draws a horizontal line on a display. This assumes that
//! clipping has already been performed, and that both end points of the line
//! are within the extents of the display.
//!
//! \return None.
//
//*****************************************************************************
#define DpyLineDrawH(pDisplay, lX1, lX2, lY, ulValue) \
do \
{ \
const tDisplay *pD = pDisplay; \
pD->pfnLineDrawH(pD->pvDisplayData, lX1, lX2, lY, ulValue); \
} \
while(0)
//*****************************************************************************
//
//! Draws a vertical line on a display.
//!
//! \param pDisplay is the pointer to the display driver structure for the
//! display to operate upon.
//! \param lX is the X coordinate of the line.
//! \param lY1 is the starting Y coordinate of the line.
//! \param lY2 is the ending Y coordinate of the line.
//! \param ulValue is the color to draw the line.
//!
//! This function draws a vertical line on a display. This assumes that
//! clipping has already been performed, and that both end points of the line
//! are within the extents of the display.
//!
//! \return None.
//
//*****************************************************************************
#define DpyLineDrawV(pDisplay, lX, lY1, lY2, ulValue) \
do \
{ \
const tDisplay *pD = pDisplay; \
pD->pfnLineDrawV(pD->pvDisplayData, lX, lY1, lY2, ulValue); \
} \
while(0)
//*****************************************************************************
//
//! Draws a pixel on a display.
//!
//! \param pDisplay is the pointer to the display driver structure for the
//! display to operate upon.
//! \param lX is the X coordinate of the pixel.
//! \param lY is the Y coordinate of the pixel.
//! \param ulValue is the color to draw the pixel.
//!
//! This function draws a pixel on a display. This assumes that clipping has
//! already been performed.
//!
//! \return None.
//
//*****************************************************************************
#define DpyPixelDraw(pDisplay, lX, lY, ulValue) \
do \
{ \
const tDisplay *pD = pDisplay; \
pD->pfnPixelDraw(pD->pvDisplayData, lX, lY, ulValue); \
} \
while(0)
//*****************************************************************************
//
//! Draws a horizontal sequence of pixels on a display.
//!
//! \param pDisplay is the pointer to the display driver structure for the
//! display to operate upon.
//! \param lX is the X coordinate of the first pixel.
//! \param lY is the Y coordinate of the first pixel.
//! \param lX0 is sub-pixel offset within the pixel data, which is valid for 1
//! or 4 bit per pixel formats.
//! \param lCount is the number of pixels to draw.
//! \param lBPP is the number of bits per pixel; must be 1, 4, or 8.
//! \param pucData is a pointer to the pixel data. For 1 and 4 bit per pixel
//! formats, the most significant bit(s) represent the left-most pixel.
//! \param pucPalette is a pointer to the palette used to draw the pixels.
//!
//! This function draws a horizontal sequence of pixels on a display, using the
//! supplied palette. For 1 bit per pixel format, the palette contains
//! pre-translated colors; for 4 and 8 bit per pixel formats, the palette
//! contains 24-bit RGB values that must be translated before being written to
//! the display.
//!
//! \return None.
//
//*****************************************************************************
#define DpyPixelDrawMultiple(pDisplay, lX, lY, lX0, lCount, lBPP, pucData, \
pucPalette) \
do \
{ \
const tDisplay *pD = pDisplay; \
pD->pfnPixelDrawMultiple(pD->pvDisplayData, lX, lY, lX0, lCount, \
lBPP, pucData, pucPalette); \
} \
while(0)
//*****************************************************************************
//
//! Fills a rectangle on a display.
//!
//! \param pDisplay is the pointer to the display driver structure for the
//! display to operate upon.
//! \param pRect is a pointer to the structure describing the rectangle to
//! fill.
//! \param ulValue is the color to fill the rectangle.
//!
//! This function fills a rectangle on the display. This assumes that clipping
//! has already been performed, and that all sides of the rectangle are within
//! the extents of the display.
//!
//! \return None.
//
//*****************************************************************************
#define DpyRectFill(pDisplay, pRect, ulValue) \
do \
{ \
const tDisplay *pD = pDisplay; \
pD->pfnRectFill(pD->pvDisplayData, pRect, ulValue); \
} \
while(0)
//*****************************************************************************
//
//! Gets the width of the display.
//!
//! \param pDisplay is a pointer to the display driver structure for the
//! display to query.
//!
//! This function determines the width of the display.
//!
//! \return Returns the width of the display in pixels.
//
//*****************************************************************************
#define DpyWidthGet(pDisplay) \
((pDisplay)->usWidth)
//*****************************************************************************
//
//! Determines if a point lies within a given rectangle.
//!
//! \param pRect is a pointer to the rectangle which the point is to be checked
//! against.
//! \param lX is the X coordinate of the point to be checked.
//! \param lY is the Y coordinate of the point to be checked.
//!
//! This function determines whether point (lX, lY) lies within the rectangle
//! described by \e pRect.
//!
//! \return Returns 1 if the point is within the rectangle or 0 otherwise.
//
//*****************************************************************************
#define GrRectContainsPoint(pRect, lX, lY) \
((((lX) >= (pRect)->sXMin) && ((lX) <= (pRect)->sXMax) && \
((lY) >= (pRect)->sYMin) && ((lY) <= (pRect)->sYMax)) ? 1 : 0)
//*****************************************************************************
//
// Prototypes for the graphics library functions.
//
//*****************************************************************************
extern void GrCircleDraw(const tContext *pContext, long lX, long lY,
long lRadius);
extern void GrCircleFill(const tContext *pContext, long lX, long lY,
long lRadius);
extern void GrContextClipRegionSet(tContext *pContext, tRectangle *pRect);
extern void GrContextInit(tContext *pContext, const tDisplay *pDisplay);
extern void GrImageDraw(const tContext *pContext,
const unsigned char *pucImage, long lX, long lY);
extern void GrLineDraw(const tContext *pContext, long lX1, long lY1, long lX2,
long lY2);
extern void GrLineDrawH(const tContext *pContext, long lX1, long lX2, long lY);
extern void GrLineDrawV(const tContext *pContext, long lX, long lY1, long lY2);
extern void GrOffScreen1BPPInit(tDisplay *pDisplay, unsigned char *pucImage,
long lWidth, long lHeight);
extern void GrOffScreen4BPPInit(tDisplay *pDisplay, unsigned char *pucImage,
long lWidth, long lHeight);
extern void GrOffScreen4BPPPaletteSet(tDisplay *pDisplay,
unsigned long *pulPalette,
unsigned long ulOffset,
unsigned long ulCount);
extern void GrOffScreen8BPPInit(tDisplay *pDisplay, unsigned char *pucImage,
long lWidth, long lHeight);
extern void GrOffScreen8BPPPaletteSet(tDisplay *pDisplay,
unsigned long *pulPalette,
unsigned long ulOffset,
unsigned long ulCount);
extern void GrRectDraw(const tContext *pContext, const tRectangle *pRect);
extern void GrRectFill(const tContext *pContext, const tRectangle *pRect);
extern void GrStringDraw(const tContext *pContext, const char *pcString,
long lLength, long lX, long lY,
unsigned long bOpaque);
extern long GrStringWidthGet(const tContext *pContext, const char *pcString,
long lLength);
extern void GrStringTableSet(const void *pvTable);
unsigned long GrStringLanguageSet(unsigned short usLangID);
unsigned long GrStringGet(int iIndex, char *pcData, unsigned long ulSize);
extern long GrRectOverlapCheck(tRectangle *psRect1, tRectangle *psRect2);
extern long GrRectIntersectGet(tRectangle *psRect1, tRectangle *psRect2,
tRectangle *psIntersect);
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************
#endif // __GRLIB_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -