| 1 | |
|---|
| 2 | #ifndef __DMG_DRAW_H__ |
|---|
| 3 | #define __DMG_DRAW_H__ |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | /* config */ |
|---|
| 7 | #include "DHL_Graphic.h" |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | typedef enum { |
|---|
| 11 | eDMG_C_TRANSPARENT, |
|---|
| 12 | eDMG_C_BLACK, |
|---|
| 13 | eDMG_C_RED, |
|---|
| 14 | eDMG_C_GREEN, |
|---|
| 15 | eDMG_C_BLUE, |
|---|
| 16 | eDMG_C_YELLOW, |
|---|
| 17 | eDMG_C_MAGENTA, |
|---|
| 18 | eDMG_C_CYAN, |
|---|
| 19 | eDMG_C_WHITE, |
|---|
| 20 | eDMG_C_H_BLACK, |
|---|
| 21 | eDMG_C_H_RED, |
|---|
| 22 | eDMG_C_H_GREEN, |
|---|
| 23 | eDMG_C_H_BLUE, |
|---|
| 24 | eDMG_C_H_YELLOW, |
|---|
| 25 | eDMG_C_H_MAGENTA, |
|---|
| 26 | eDMG_C_H_CYAN, |
|---|
| 27 | eDMG_C_H_WHITE, |
|---|
| 28 | } tDMG_Color; |
|---|
| 29 | |
|---|
| 30 | typedef struct { |
|---|
| 31 | UINT16 idx; |
|---|
| 32 | UINT16 len; |
|---|
| 33 | } DMG_STR_RowInfo_t; |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | /* draw func */ |
|---|
| 37 | |
|---|
| 38 | void DMG_SetPlane(tDHL_PlaneID id); |
|---|
| 39 | tDHL_PlaneID DMG_GetPlane(); |
|---|
| 40 | |
|---|
| 41 | UINT32 DMG_ConvertDefColor(UINT32 color); |
|---|
| 42 | |
|---|
| 43 | void DMG_FillRect(int x, int y, int w, int h, UINT32 color); |
|---|
| 44 | void DMG_EraseRect(int x, int y, int w, int h, UINT32 color); |
|---|
| 45 | |
|---|
| 46 | void DMG_DrawHLine(int x, int y, int w, UINT32 color); |
|---|
| 47 | void DMG_DrawVLine(int x, int y, int h, UINT32 color); |
|---|
| 48 | void DMG_BLT(tDHL_PlaneID src_id, tDHL_PlaneID dst_id, tDHL_GrpRect *src_r, tDHL_GrpRect *dst_r); |
|---|
| 49 | void DMG_DrawLine(int x1, int y1, int x2, int y2); |
|---|
| 50 | void DMG_DrawBox(int x, int y, int w, int h, UINT32 color); |
|---|
| 51 | void DMG_DrawEllipse(int ox, int oy, int rw, int rh); |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | void DMG_DrawImage(int x, int y, int w, int h, void *pimg); |
|---|
| 55 | void DMG_DrawImagePng(int x, int y, void *pimg); |
|---|
| 56 | void DMG_DrawImageFile(int x, int y, char *file_name); |
|---|
| 57 | |
|---|
| 58 | void DMG_AutoRefresh(void); |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | /* font print func */ |
|---|
| 65 | |
|---|
| 66 | #define SUPPORT_JUNGLE 1 |
|---|
| 67 | #define SUPPORT_BMF 1 |
|---|
| 68 | |
|---|
| 69 | #define USE_MULTI_LANG |
|---|
| 70 | |
|---|
| 71 | #define DEFAULT_FONT_SIZE 25 |
|---|
| 72 | |
|---|
| 73 | #define MAX_NUM_DRAW_ROW 24 |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | /* DMG ALIGN OPTION |
|---|
| 77 | -PrintStrEx APIÀÇ optionÀ¸·Î »ç¿ëµÇ¸ç, LT/CT/RT¿Í MD/TP/BT¸¦ Á¶ÇÕÇÒ ¼ö ÀÖ´Ù. |
|---|
| 78 | ¿¹) DMG_OPT_A_RT | DMG_OPT_A_MD |
|---|
| 79 | -Default°ªÀº LT/MDÀÌ´Ù. |
|---|
| 80 | */ |
|---|
| 81 | #define DMG_OPT_A_LT 0x0 /* left */ |
|---|
| 82 | #define DMG_OPT_A_CT 0x1 /* center */ |
|---|
| 83 | #define DMG_OPT_A_RT 0x2 /* right */ |
|---|
| 84 | #define DMG_OPT_A_MD 0x0 /* middle */ |
|---|
| 85 | #define DMG_OPT_A_TP 0x4 /* top */ |
|---|
| 86 | #define DMG_OPT_A_BT 0x8 /* bottom */ |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | /* Font |
|---|
| 90 | -ÇöÀç font´Â jungle¸¸ Áö¿øµÈ´Ù. |
|---|
| 91 | */ |
|---|
| 92 | typedef enum { |
|---|
| 93 | eDMG_FONT_NONE=0, |
|---|
| 94 | eDMG_FONT_JUNGLE, |
|---|
| 95 | eDMG_FONT_BMF, /* bitmap font */ |
|---|
| 96 | eDMG_FONT_DHL, /* dhl font */ |
|---|
| 97 | eDMG_FONT_DHL_END=10 |
|---|
| 98 | } tDMG_Font; |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | typedef enum { |
|---|
| 102 | eDMG_LANG_ENG=0, |
|---|
| 103 | eDMG_LANG_SPA, |
|---|
| 104 | eDMG_LANG_FRE, |
|---|
| 105 | } tDMG_Language; |
|---|
| 106 | |
|---|
| 107 | /* Font Style |
|---|
| 108 | -CC¸¦ °í·ÁÇØ¼ Font StyleÀº ¾Æ·¡¿Í °°ÀÌ Á¤ÀÇÇÑ´Ù. |
|---|
| 109 | */ |
|---|
| 110 | typedef enum { |
|---|
| 111 | eDMG_FS_DEFAULT=0, |
|---|
| 112 | eDMG_FS_SERIFMONO, |
|---|
| 113 | eDMG_FS_SERIF, |
|---|
| 114 | eDMG_FS_SANSERIFMONO, |
|---|
| 115 | eDMG_FS_SANSERIF, |
|---|
| 116 | eDMG_FS_CASUAL, |
|---|
| 117 | eDMG_FS_SMALLCAPITAL, |
|---|
| 118 | eDMG_FS_KOREAN=100 |
|---|
| 119 | } tDMG_FontStyle; |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | /* Edge Type |
|---|
| 123 | -CC¸¦ °í·ÁÇØ¼ Edge TypeÀº ¾Æ·¡¿Í °°ÀÌ Á¤ÀÇÇÑ´Ù. |
|---|
| 124 | */ |
|---|
| 125 | typedef enum { |
|---|
| 126 | eDMG_ET_NONE=0, |
|---|
| 127 | eDMG_ET_RAISED, |
|---|
| 128 | eDMG_ET_DEPRESSED, |
|---|
| 129 | eDMG_ET_UNIFORM, |
|---|
| 130 | eDMG_ET_LEFT_DROP_SHADOW, |
|---|
| 131 | eDMG_ET_RIGHT_DROP_SHADOW |
|---|
| 132 | } tDMG_EdgeType; |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | /* Font Attr |
|---|
| 136 | -Font ¼Ó¼ºÀ¸·Î ¾Æ·¡¿Í °°Àº °ªÀ» °¡Áø´Ù. ¾ÆÁ÷ ÇѱÛ, unicode¿¡ ´ëÇÑ Å×½ºÆ®´Â µÇÁö ¾ÊÀ½ |
|---|
| 137 | */ |
|---|
| 138 | typedef struct { |
|---|
| 139 | UINT8 type; |
|---|
| 140 | UINT8 size; |
|---|
| 141 | BOOL is_bold; |
|---|
| 142 | BOOL is_italic; |
|---|
| 143 | BOOL is_underline; |
|---|
| 144 | BOOL is_unicode; |
|---|
| 145 | tDMG_FontStyle font_style; |
|---|
| 146 | tDMG_EdgeType edge_type; |
|---|
| 147 | UINT32 c_edge; |
|---|
| 148 | } tDMG_FontAttr; |
|---|
| 149 | |
|---|
| 150 | |
|---|
| 151 | /* print API*/ |
|---|
| 152 | |
|---|
| 153 | |
|---|
| 154 | /* DMG_PrintCh |
|---|
| 155 | -ÇØ´ç planeÀÇ ÁÂÇ¥ x, y¿¡ ¹®ÀÚ ch¸¦ Âï´Â´Ù. |
|---|
| 156 | -¹®ÀÚ¸¦ Âï±â Àü¿¡ ¸ÕÀú DMG_SetFontAttr()¸¦ È£ÃâÇÏ¿© Font ¼Ó¼º°ªÀ» µî·ÏÇØ¾ß ÇÑ´Ù. |
|---|
| 157 | */ |
|---|
| 158 | int DMG_PrintCh(int x, int y, UINT16 ch, UINT32 color); |
|---|
| 159 | |
|---|
| 160 | /* DMG_PrintCh |
|---|
| 161 | -ÇØ´ç planeÀÇ ÁÂÇ¥ x, y¿¡ char *ŸÀÔÀÇ strÀ» Âï´Â´Ù. |
|---|
| 162 | */ |
|---|
| 163 | int DMG_PrintStr(int x, int y, char *pstr, UINT32 color); |
|---|
| 164 | |
|---|
| 165 | /* DMG_PrintUStr |
|---|
| 166 | -ÇØ´ç planeÀÇ ÁÂÇ¥ x, y¿¡ UINT16 *ŸÀÔÀÇ strÀ» Âï´Â´Ù. |
|---|
| 167 | */ |
|---|
| 168 | int DMG_PrintUStr(int x, int y, UINT16 *pstr, UINT32 color); |
|---|
| 169 | |
|---|
| 170 | /* DMG_PrintCh |
|---|
| 171 | -ÇØ´ç planeÀÇ ÁÂÇ¥ x, y¿¡ char *ŸÀÔÀÇ strÀ» Âï´Â´Ù. |
|---|
| 172 | */ |
|---|
| 173 | void DMG_PrintStrEx(int x, int y, int w, int h, |
|---|
| 174 | char *pstr, UINT32 color, UINT32 opt); |
|---|
| 175 | |
|---|
| 176 | void DMG_PrintUStrEx(int x, int y, int w, int h, |
|---|
| 177 | UINT16 *pstr, UINT32 color, UINT32 opt); |
|---|
| 178 | |
|---|
| 179 | void DMG_PrintNUStrEx(int x, int y, int w, int h, |
|---|
| 180 | int str_start, int str_len, |
|---|
| 181 | UINT16* pstr, UINT32 color, UINT32 opt); |
|---|
| 182 | |
|---|
| 183 | |
|---|
| 184 | int DMG_PrintStr3Lang(int x, int y, |
|---|
| 185 | char *pstr1, char *pstr2, char *pstr3, UINT32 color); |
|---|
| 186 | |
|---|
| 187 | void DMG_PrintStrEx3Lang(int x, int y, int w, int h, |
|---|
| 188 | char *pstr1, char *pstr2, char *pstr3, UINT32 color, UINT32 opt); |
|---|
| 189 | |
|---|
| 190 | /* width, height */ |
|---|
| 191 | int DMG_GetChWidth(UINT16 ch); |
|---|
| 192 | |
|---|
| 193 | int DMG_GetStrWidth(char *pstr); |
|---|
| 194 | int DMG_GetUStrWidth(UINT16 *pstr); |
|---|
| 195 | |
|---|
| 196 | int DMG_GetChHeight(UINT16 ch); |
|---|
| 197 | |
|---|
| 198 | int DMG_GetStrHeight(char *pstr); |
|---|
| 199 | int DMG_GetUStrHeight(UINT16 *pstr); |
|---|
| 200 | int DMG_GetUStrLineCount(int w, UINT16 *pstr, DMG_STR_RowInfo_t* return_str_info_t); |
|---|
| 201 | |
|---|
| 202 | |
|---|
| 203 | |
|---|
| 204 | /* font attr */ |
|---|
| 205 | void DMG_GetDefaultFontAttr(tDMG_FontAttr *pfont_attr); |
|---|
| 206 | void DMG_GetFontAttr(tDMG_FontAttr *pfont_attr); |
|---|
| 207 | void DMG_SetFontAttr(tDMG_FontAttr *pfont_attr); |
|---|
| 208 | |
|---|
| 209 | void DMG_SetFontSize(int size); |
|---|
| 210 | int DMG_GetFontSize(void); |
|---|
| 211 | |
|---|
| 212 | void DMG_SetTempFontSize(int size); |
|---|
| 213 | void DMG_RestoreFontSize(void); |
|---|
| 214 | |
|---|
| 215 | void DMG_SetLanguage(tDMG_Language lang); |
|---|
| 216 | int DMG_GetLanguage(void); |
|---|
| 217 | |
|---|
| 218 | void DMG_SetFont(tDMG_Font font); |
|---|
| 219 | |
|---|
| 220 | void DMG_SetInterLineGap(int gap); |
|---|
| 221 | |
|---|
| 222 | /* init */ |
|---|
| 223 | void DMG_DrawInit(void); |
|---|
| 224 | |
|---|
| 225 | |
|---|
| 226 | |
|---|
| 227 | |
|---|
| 228 | |
|---|
| 229 | |
|---|
| 230 | |
|---|
| 231 | |
|---|
| 232 | #endif |
|---|
| 233 | |
|---|
| 234 | /* end of file */ |
|---|