#ifndef __DMG_DRAW_H__ #define __DMG_DRAW_H__ /* config */ #include "DHL_Graphic.h" typedef enum { eDMG_C_TRANSPARENT, eDMG_C_BLACK, eDMG_C_RED, eDMG_C_GREEN, eDMG_C_BLUE, eDMG_C_YELLOW, eDMG_C_MAGENTA, eDMG_C_CYAN, eDMG_C_WHITE, eDMG_C_H_BLACK, eDMG_C_H_RED, eDMG_C_H_GREEN, eDMG_C_H_BLUE, eDMG_C_H_YELLOW, eDMG_C_H_MAGENTA, eDMG_C_H_CYAN, eDMG_C_H_WHITE, } tDMG_Color; typedef struct { UINT16 idx; UINT16 len; } DMG_STR_RowInfo_t; /* draw func */ void DMG_SetPlane(tDHL_PlaneID id); tDHL_PlaneID DMG_GetPlane(); UINT32 DMG_ConvertDefColor(UINT32 color); void DMG_FillRect(int x, int y, int w, int h, UINT32 color); void DMG_EraseRect(int x, int y, int w, int h, UINT32 color); void DMG_DrawHLine(int x, int y, int w, UINT32 color); void DMG_DrawVLine(int x, int y, int h, UINT32 color); void DMG_BLT(tDHL_PlaneID src_id, tDHL_PlaneID dst_id, tDHL_GrpRect *src_r, tDHL_GrpRect *dst_r); void DMG_DrawLine(int x1, int y1, int x2, int y2); void DMG_DrawBox(int x, int y, int w, int h, UINT32 color); void DMG_DrawEllipse(int ox, int oy, int rw, int rh); void DMG_DrawImage(int x, int y, int w, int h, void *pimg); void DMG_DrawImagePng(int x, int y, void *pimg); void DMG_DrawImageFile(int x, int y, char *file_name); void DMG_AutoRefresh(void); /* font print func */ #define SUPPORT_JUNGLE 1 #define SUPPORT_BMF 1 #define USE_MULTI_LANG #define DEFAULT_FONT_SIZE 25 #define MAX_NUM_DRAW_ROW 24 /* DMG ALIGN OPTION -PrintStrEx APIÀÇ optionÀ¸·Î »ç¿ëµÇ¸ç, LT/CT/RT¿Í MD/TP/BT¸¦ Á¶ÇÕÇÒ ¼ö ÀÖ´Ù. ¿¹) DMG_OPT_A_RT | DMG_OPT_A_MD -Default°ªÀº LT/MDÀÌ´Ù. */ #define DMG_OPT_A_LT 0x0 /* left */ #define DMG_OPT_A_CT 0x1 /* center */ #define DMG_OPT_A_RT 0x2 /* right */ #define DMG_OPT_A_MD 0x0 /* middle */ #define DMG_OPT_A_TP 0x4 /* top */ #define DMG_OPT_A_BT 0x8 /* bottom */ /* Font -ÇöÀç font´Â jungle¸¸ Áö¿øµÈ´Ù. */ typedef enum { eDMG_FONT_NONE=0, eDMG_FONT_JUNGLE, eDMG_FONT_BMF, /* bitmap font */ eDMG_FONT_DHL, /* dhl font */ eDMG_FONT_DHL_END=10 } tDMG_Font; typedef enum { eDMG_LANG_ENG=0, eDMG_LANG_SPA, eDMG_LANG_FRE, } tDMG_Language; /* Font Style -CC¸¦ °í·ÁÇØ¼­ Font StyleÀº ¾Æ·¡¿Í °°ÀÌ Á¤ÀÇÇÑ´Ù. */ typedef enum { eDMG_FS_DEFAULT=0, eDMG_FS_SERIFMONO, eDMG_FS_SERIF, eDMG_FS_SANSERIFMONO, eDMG_FS_SANSERIF, eDMG_FS_CASUAL, eDMG_FS_SMALLCAPITAL, eDMG_FS_KOREAN=100 } tDMG_FontStyle; /* Edge Type -CC¸¦ °í·ÁÇØ¼­ Edge TypeÀº ¾Æ·¡¿Í °°ÀÌ Á¤ÀÇÇÑ´Ù. */ typedef enum { eDMG_ET_NONE=0, eDMG_ET_RAISED, eDMG_ET_DEPRESSED, eDMG_ET_UNIFORM, eDMG_ET_LEFT_DROP_SHADOW, eDMG_ET_RIGHT_DROP_SHADOW } tDMG_EdgeType; /* Font Attr -Font ¼Ó¼ºÀ¸·Î ¾Æ·¡¿Í °°Àº °ªÀ» °¡Áø´Ù. ¾ÆÁ÷ ÇѱÛ, unicode¿¡ ´ëÇÑ Å×½ºÆ®´Â µÇÁö ¾ÊÀ½ */ typedef struct { UINT8 type; UINT8 size; BOOL is_bold; BOOL is_italic; BOOL is_underline; BOOL is_unicode; tDMG_FontStyle font_style; tDMG_EdgeType edge_type; UINT32 c_edge; } tDMG_FontAttr; /* print API*/ /* DMG_PrintCh -ÇØ´ç planeÀÇ ÁÂÇ¥ x, y¿¡ ¹®ÀÚ ch¸¦ Âï´Â´Ù. -¹®ÀÚ¸¦ Âï±â Àü¿¡ ¸ÕÀú DMG_SetFontAttr()¸¦ È£ÃâÇÏ¿© Font ¼Ó¼º°ªÀ» µî·ÏÇØ¾ß ÇÑ´Ù. */ int DMG_PrintCh(int x, int y, UINT16 ch, UINT32 color); /* DMG_PrintCh -ÇØ´ç planeÀÇ ÁÂÇ¥ x, y¿¡ char *ŸÀÔÀÇ strÀ» Âï´Â´Ù. */ int DMG_PrintStr(int x, int y, char *pstr, UINT32 color); /* DMG_PrintUStr -ÇØ´ç planeÀÇ ÁÂÇ¥ x, y¿¡ UINT16 *ŸÀÔÀÇ strÀ» Âï´Â´Ù. */ int DMG_PrintUStr(int x, int y, UINT16 *pstr, UINT32 color); /* DMG_PrintCh -ÇØ´ç planeÀÇ ÁÂÇ¥ x, y¿¡ char *ŸÀÔÀÇ strÀ» Âï´Â´Ù. */ void DMG_PrintStrEx(int x, int y, int w, int h, char *pstr, UINT32 color, UINT32 opt); void DMG_PrintUStrEx(int x, int y, int w, int h, UINT16 *pstr, UINT32 color, UINT32 opt); void DMG_PrintNUStrEx(int x, int y, int w, int h, int str_start, int str_len, UINT16* pstr, UINT32 color, UINT32 opt); int DMG_PrintStr3Lang(int x, int y, char *pstr1, char *pstr2, char *pstr3, UINT32 color); void DMG_PrintStrEx3Lang(int x, int y, int w, int h, char *pstr1, char *pstr2, char *pstr3, UINT32 color, UINT32 opt); /* width, height */ int DMG_GetChWidth(UINT16 ch); int DMG_GetStrWidth(char *pstr); int DMG_GetUStrWidth(UINT16 *pstr); int DMG_GetChHeight(UINT16 ch); int DMG_GetStrHeight(char *pstr); int DMG_GetUStrHeight(UINT16 *pstr); int DMG_GetUStrLineCount(int w, UINT16 *pstr, DMG_STR_RowInfo_t* return_str_info_t); /* font attr */ void DMG_GetDefaultFontAttr(tDMG_FontAttr *pfont_attr); void DMG_GetFontAttr(tDMG_FontAttr *pfont_attr); void DMG_SetFontAttr(tDMG_FontAttr *pfont_attr); void DMG_SetFontSize(int size); int DMG_GetFontSize(void); void DMG_SetTempFontSize(int size); void DMG_RestoreFontSize(void); void DMG_SetLanguage(tDMG_Language lang); int DMG_GetLanguage(void); void DMG_SetFont(tDMG_Font font); void DMG_SetInterLineGap(int gap); /* init */ void DMG_DrawInit(void); #endif /* end of file */