MiniGUI API Reference (MiniGUI-Standalone)  v4.0.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
gdi.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
57 /*
58  * $Id: gdi.h 13674 2010-12-06 06:45:01Z wanzheng $
59  *
60  * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
61  * pSOS, ThreadX, NuCleus, OSE, and Win32.
62  */
63 
64 #ifndef _MGUI_GDI_H
65  #define _MGUI_GDI_H
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif /* __cplusplus */
70 
122 extern MG_EXPORT gal_pixel SysPixelIndex [];
123 
130 extern const MG_EXPORT RGB SysPixelColor [];
131 
137 #define PIXEL_invalid 0
138 
144 #define PIXEL_transparent SysPixelIndex[0]
145 
151 #define PIXEL_darkblue SysPixelIndex[1]
152 
158 #define PIXEL_darkgreen SysPixelIndex[2]
159 
165 #define PIXEL_darkcyan SysPixelIndex[3]
166 
172 #define PIXEL_darkred SysPixelIndex[4]
173 
179 #define PIXEL_darkmagenta SysPixelIndex[5]
180 
186 #define PIXEL_darkyellow SysPixelIndex[6]
187 
193 #define PIXEL_darkgray SysPixelIndex[7]
194 
200 #define PIXEL_lightgray SysPixelIndex[8]
201 
207 #define PIXEL_blue SysPixelIndex[9]
208 
214 #define PIXEL_green SysPixelIndex[10]
215 
221 #define PIXEL_cyan SysPixelIndex[11]
222 
228 #define PIXEL_red SysPixelIndex[12]
229 
235 #define PIXEL_magenta SysPixelIndex[13]
236 
242 #define PIXEL_yellow SysPixelIndex[14]
243 
249 #define PIXEL_lightwhite SysPixelIndex[15]
250 
256 #define PIXEL_black SysPixelIndex[16]
257 
258 /* Compatiblity definitions */
263 #define COLOR_invalid PIXEL_invalid
264 
269 #define COLOR_transparent PIXEL_transparent
270 
275 #define COLOR_darkred PIXEL_darkred
276 
281 #define COLOR_darkgreen PIXEL_darkgreen
282 
287 #define COLOR_darkyellow PIXEL_darkyellow
288 
293 #define COLOR_darkblue PIXEL_darkblue
294 
299 #define COLOR_darkmagenta PIXEL_darkmagenta
300 
305 #define COLOR_darkcyan PIXEL_darkcyan
306 
311 #define COLOR_lightgray PIXEL_lightgray
312 
317 #define COLOR_darkgray PIXEL_darkgray
318 
323 #define COLOR_red PIXEL_red
324 
329 #define COLOR_green PIXEL_green
330 
335 #define COLOR_yellow PIXEL_yellow
336 
341 #define COLOR_blue PIXEL_blue
342 
347 #define COLOR_magenta PIXEL_magenta
348 
353 #define COLOR_cyan PIXEL_cyan
354 
359 #define COLOR_lightwhite PIXEL_lightwhite
360 
365 #define COLOR_black PIXEL_black
366 
371 #define SysColorIndex SysPixelIndex
372 
404 typedef struct _BLOCKHEAP
405 {
406 #ifdef _MGRM_THREADS
407  pthread_mutex_t lock;
408 #endif
409 
412  size_t bd_size;
416  size_t heap_size;
420  int free;
424  void* heap;
425 } BLOCKHEAP;
426 
434 
457 MG_EXPORT extern void InitBlockDataHeap (PBLOCKHEAP heap,
458  size_t bd_size, size_t heap_size);
459 
475 MG_EXPORT extern void* BlockDataAlloc (PBLOCKHEAP heap);
476 
490 MG_EXPORT extern void BlockDataFree (PBLOCKHEAP heap, void* data);
491 
500 MG_EXPORT extern void DestroyBlockDataHeap (PBLOCKHEAP heap);
501 
511 struct _BITMAP;
512 
517 typedef struct _BITMAP BITMAP;
518 
524 typedef BITMAP* PBITMAP;
525 
526 struct _MYBITMAP;
527 
532 typedef struct _MYBITMAP MYBITMAP;
533 
539 typedef struct _MYBITMAP* PMYBITMAP;
540 
541 
578 typedef struct _CLIPRECT
579 {
587  struct _CLIPRECT* next;
591  struct _CLIPRECT* prev;
592 } CLIPRECT;
593 typedef CLIPRECT* PCLIPRECT;
594 
595 /* Clipping Region */
596 #define NULLREGION 0x00
597 #define SIMPLEREGION 0x01
598 #define COMPLEXREGION 0x02
599 
603 typedef struct _CLIPRGN
604 {
618  BYTE reserved[3];
626  PCLIPRECT head;
630  PCLIPRECT tail;
635  PBLOCKHEAP heap;
636 } CLIPRGN;
637 
644 typedef CLIPRGN* PCLIPRGN;
645 
659 #define InitFreeClipRectList(heap, size) \
660  InitBlockDataHeap (heap, sizeof (CLIPRECT), size)
661 
672 #define ClipRectAlloc(heap) BlockDataAlloc (heap)
673 
686 #define FreeClipRect(heap, cr) BlockDataFree (heap, cr);
687 
699 #define DestroyFreeClipRectList(heap) DestroyBlockDataHeap (heap);
700 
721 MG_EXPORT void GUIAPI InitClipRgn (PCLIPRGN pRgn, PBLOCKHEAP pFreeList);
722 
733 MG_EXPORT void GUIAPI EmptyClipRgn (PCLIPRGN pRgn);
734 
744 MG_EXPORT PCLIPRGN GUIAPI CreateClipRgn (void);
745 
756 MG_EXPORT void GUIAPI DestroyClipRgn (PCLIPRGN pRgn);
757 
774 MG_EXPORT BOOL GUIAPI ClipRgnCopy (PCLIPRGN pDstRgn, const CLIPRGN* pSrcRgn);
775 
796 MG_EXPORT BOOL GUIAPI ClipRgnIntersect (PCLIPRGN pRstRgn,
797  const CLIPRGN* pRgn1, const CLIPRGN* pRgn2);
798 
811 MG_EXPORT void GUIAPI GetClipRgnBoundRect (PCLIPRGN pRgn, PRECT pRect);
812 
829 MG_EXPORT BOOL GUIAPI SetClipRgn (PCLIPRGN pRgn, const RECT* pRect);
830 
844 MG_EXPORT BOOL GUIAPI IsEmptyClipRgn (const CLIPRGN* pRgn);
845 
859 MG_EXPORT BOOL GUIAPI AddClipRect (PCLIPRGN pRgn, const RECT* pRect);
860 
875 MG_EXPORT BOOL GUIAPI IntersectClipRect (PCLIPRGN pRgn, const RECT* pRect);
876 
891 MG_EXPORT BOOL GUIAPI SubtractClipRect (PCLIPRGN pRgn, const RECT* pRect);
892 
908 MG_EXPORT BOOL GUIAPI PtInRegion (PCLIPRGN region, int x, int y);
909 
924 MG_EXPORT BOOL GUIAPI RectInRegion (PCLIPRGN region, const RECT* rect);
925 
941 MG_EXPORT void GUIAPI OffsetRegionEx (PCLIPRGN region, const RECT *rcClient,
942  const RECT *rcScroll, int x, int y);
943 
955 MG_EXPORT void GUIAPI OffsetRegion (PCLIPRGN region, int x, int y);
956 
973 MG_EXPORT BOOL GUIAPI UnionRegion (PCLIPRGN dst,
974  const CLIPRGN* src1, const CLIPRGN* src2);
975 
991 MG_EXPORT BOOL GUIAPI SubtractRegion (CLIPRGN* rgnD,
992  const CLIPRGN* rgnM, const CLIPRGN* rgnS);
993 
1010 MG_EXPORT BOOL GUIAPI XorRegion (CLIPRGN *dst,
1011  const CLIPRGN *src1, const CLIPRGN *src2);
1012 
1018 #define UnionRectWithRegion AddClipRect
1019 
1025 #define CopyRegion ClipRgnCopy
1026 
1032 #define IntersectRegion ClipRgnIntersect
1033 
1047 MG_EXPORT BOOL GUIAPI InitCircleRegion (PCLIPRGN dst, int x, int y, int r);
1048 
1063 MG_EXPORT BOOL GUIAPI InitEllipseRegion (PCLIPRGN dst,
1064  int x, int y, int rx, int ry);
1065 
1078 MG_EXPORT BOOL GUIAPI InitPolygonRegion (PCLIPRGN dst,
1079  const POINT* pts, int vertices);
1080 
1126 #define HDC_SCREEN ((HDC)0)
1127 
1128 /*
1129  * This is a system screen DC create for MiniGUI internal usage, for example,
1130  * menu and z-order operations
1131  */
1132 #define HDC_SCREEN_SYS ((HDC)1)
1133 
1138 #define HDC_INVALID ((HDC)-1)
1139 
1140 #define GDCAP_COLORNUM 0
1141 #define GDCAP_HPIXEL 1
1142 #define GDCAP_VPIXEL 2
1143 #define GDCAP_MAXX 3
1144 #define GDCAP_MAXY 4
1145 #define GDCAP_DEPTH 5
1146 #define GDCAP_BPP 6
1147 #define GDCAP_BITSPP 7
1148 #define GDCAP_RMASK 8
1149 #define GDCAP_GMASK 9
1150 #define GDCAP_BMASK 10
1151 #define GDCAP_AMASK 11
1152 #define GDCAP_PITCH 12
1153 #define GDCAP_DPI 13
1154  #define GDCAP_DPI_DEFAULT 96
1155  #define GDCAP_DPI_MINIMAL 36
1156 
1204 MG_EXPORT unsigned int GUIAPI GetGDCapability (HDC hdc, int iItem);
1205 
1223 MG_EXPORT HDC GUIAPI GetDC (HWND hwnd);
1224 
1242 MG_EXPORT HDC GUIAPI GetClientDC (HWND hwnd);
1243 
1268 MG_EXPORT HDC GUIAPI GetSubDC (HDC hdc, int off_x, int off_y, int width, int height);
1269 
1280 MG_EXPORT void GUIAPI ReleaseDC (HDC hdc);
1281 
1295 MG_EXPORT HWND GUIAPI WindowFromDC (HDC hdc);
1296 
1317 MG_EXPORT int GUIAPI SaveDC (HDC hdc);
1318 
1344 MG_EXPORT BOOL GUIAPI RestoreDC (HDC hdc, int saved_dc);
1345 
1346 #define MEMDC_FLAG_NONE 0x00000000 /* None. */
1347 #define MEMDC_FLAG_SWSURFACE 0x00000000 /* DC is in system memory */
1348 #define MEMDC_FLAG_HWSURFACE 0x00000001 /* DC is in video memory */
1349 #define MEMDC_FLAG_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
1350 #define MEMDC_FLAG_SRCALPHA 0x00010000 /* Blit uses source alpha blending*/
1351 #define MEMDC_FLAG_SRCPIXELALPHA 0x00020000 /* Blit uses source per-pixel alpha blending*/
1352 #define MEMDC_FLAG_RLEACCEL 0x00004000 /* Surface is RLE encoded */
1353 
1374 MG_EXPORT HDC GUIAPI CreateCompatibleDCEx (HDC hdc, int width, int height);
1375 
1390 MG_EXPORT BOOL GUIAPI IsCompatibleDC (HDC hdc1, HDC hdc2);
1391 
1435 MG_EXPORT HDC GUIAPI CreateMemDCEx (int width, int height, int depth, DWORD flags,
1436  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask,
1437  void* bits, int pitch);
1438 
1472 static inline HDC GUIAPI CreateMemDC (int width, int height, int depth, DWORD flags,
1473  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
1474 {
1475  return CreateMemDCEx (width, height, depth, flags, Rmask, Gmask, Bmask, Amask,
1476  NULL, 0);
1477 }
1478 
1503 MG_EXPORT HDC GUIAPI CreateSubMemDC (HDC parent, int off_x, int off_y,
1504  int width, int height, BOOL comp_to_parent);
1505 
1521 MG_EXPORT HDC GUIAPI CreateMemDCFromBitmap (HDC hdc, const BITMAP* bmp);
1522 
1548 MG_EXPORT HDC GUIAPI CreateMemDCFromMyBitmap (const MYBITMAP* my_bmp, const RGB* pal);
1549 
1573 MG_EXPORT BOOL GUIAPI ConvertMemDC (HDC mem_dc, HDC ref_dc, DWORD flags);
1574 
1604 MG_EXPORT BOOL GUIAPI SetMemDCAlpha (HDC mem_dc, DWORD flags, Uint8 alpha);
1605 
1625 MG_EXPORT BOOL GUIAPI SetMemDCColorKey (HDC mem_dc, DWORD flags,
1626  Uint32 color_key);
1627 
1640 MG_EXPORT void GUIAPI DeleteMemDC (HDC mem_dc);
1641 
1654 #define CreateCompatibleDC(hdc) CreateCompatibleDCEx(hdc, 0, 0)
1655 
1666 #define DeleteCompatibleDC(hdc) DeleteMemDC(hdc)
1667 
1705 MG_EXPORT Uint8* GUIAPI LockDC (HDC hdc, const RECT* rw_rc,
1706  int* width, int* height, int* pitch);
1707 
1724 typedef void (* CB_DIRECT_DRAW_RECT) (HDC hdc, Uint8 * pixels,
1725  int pitch, int bytesPerPixel, const RECT* rc, void* context);
1726 
1753 MG_EXPORT BOOL GUIAPI LockDCEx (HDC hdc, const PCLIPRGN region,
1754  void* context, CB_DIRECT_DRAW_RECT cb);
1755 
1764 MG_EXPORT void GUIAPI UnlockDC (HDC hdc);
1765 
1784 MG_EXPORT HDC GUIAPI CreatePrivateDC (HWND hwnd);
1785 
1805 MG_EXPORT HDC GUIAPI CreatePrivateClientDC (HWND hwnd);
1806 
1833 HDC GUIAPI CreatePrivateSubDC(HDC hdc, int off_x, int off_y,
1834  int width, int height);
1835 
1857 MG_EXPORT HDC GUIAPI GetPrivateClientDC (HWND hwnd);
1858 
1868 MG_EXPORT void GUIAPI DeletePrivateDC (HDC hdc);
1869 
1892 MG_EXPORT HDC GUIAPI CreateSecondaryDC (HWND hwnd);
1893 
1909 typedef int (* ON_UPDATE_SECONDARYDC)(HWND hwnd, HDC secondary_dc,
1910  HDC real_dc, const RECT* secondary_rc, const RECT* real_rc,
1911  const RECT* main_update_rc);
1912 
1913 #define ON_UPDSECDC_DEFAULT ((ON_UPDATE_SECONDARYDC)0)
1914 #define ON_UPDSECDC_DONOTHING ((ON_UPDATE_SECONDARYDC)0xFFFFFFFF)
1915 
1941 MG_EXPORT HDC GUIAPI SetSecondaryDC (HWND hwnd, HDC secondary_dc,
1942  ON_UPDATE_SECONDARYDC on_update_secondarydc);
1943 
1960 MG_EXPORT HDC GUIAPI GetSecondaryDC (HWND hwnd);
1961 
1978 MG_EXPORT HDC GUIAPI GetSecondaryClientDC (HWND hwnd);
1979 
1991 MG_EXPORT void GUIAPI ReleaseSecondaryDC (HWND hwnd, HDC hdc);
1992 
2001 MG_EXPORT void GUIAPI DeleteSecondaryDC (HWND hwnd);
2002 
2015 MG_EXPORT BOOL GUIAPI SyncUpdateDC (HDC hdc);
2016 
2024 #define BM_TRANSPARENT 1
2025 #define BM_OPAQUE 0
2026 
2027 #define DC_ATTR_BK_COLOR 0
2028 #define DC_ATTR_PEN_COLOR 1
2029 #define DC_ATTR_BRUSH_COLOR 2
2030 #define DC_ATTR_TEXT_COLOR 3
2031 
2032 #define DC_ATTR_BK_MODE 4
2033 
2034 #define DC_ATTR_TAB_STOP 5
2035 #define DC_ATTR_CHAR_EXTRA 6
2036 #define DC_ATTR_WORD_EXTRA 7
2037 #define DC_ATTR_ALINE_EXTRA 8
2038 #define DC_ATTR_BLINE_EXTRA 9
2039 
2040 #define DC_ATTR_MAP_MODE 10
2041 
2042 #define DC_ATTR_TEXT_ALIGN 11
2043 
2044 #define DC_ATTR_BIDI_FLAGS 12
2045 
2046 #ifdef _MGHAVE_ADV_2DAPI
2047 # define DC_ATTR_PEN_TYPE 13
2048 # define DC_ATTR_PEN_CAP_STYLE 14
2049 # define DC_ATTR_PEN_JOIN_STYLE 15
2050 # define DC_ATTR_PEN_WIDTH 16
2051 # define DC_ATTR_BRUSH_TYPE 17
2052 # define NR_DC_ATTRS 18
2053 #else /* _MGHAVE_ADV_2DAPI */
2054 # define NR_DC_ATTRS 13
2055 #endif /* !_MGHAVE_ADV_2DAPI */
2056 
2057 
2105 MG_EXPORT Uint32 GUIAPI GetDCAttr (HDC hdc, int attr);
2106 
2120 MG_EXPORT Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value);
2121 
2131 #define GetBkColor(hdc) GetDCAttr (hdc, DC_ATTR_BK_COLOR)
2132 
2148 #define GetBkMode(hdc) GetDCAttr (hdc, DC_ATTR_BK_MODE)
2149 
2159 #define GetPenColor(hdc) GetDCAttr (hdc, DC_ATTR_PEN_COLOR)
2160 
2170 #define GetBrushColor(hdc) GetDCAttr (hdc, DC_ATTR_BRUSH_COLOR)
2171 
2181 #define GetTextColor(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_COLOR)
2182 
2192 #define GetTabStop(hdc) GetDCAttr (hdc, DC_ATTR_TAB_STOP)
2193 
2204 #define SetBkColor(hdc, color) \
2205  SetDCAttr (hdc, DC_ATTR_BK_COLOR, (DWORD) color)
2206 
2224 #define SetBkMode(hdc, mode) \
2225  SetDCAttr (hdc, DC_ATTR_BK_MODE, (DWORD) mode)
2226 
2237 #define SetPenColor(hdc, color) \
2238  SetDCAttr (hdc, DC_ATTR_PEN_COLOR, (DWORD) color)
2239 
2250 #define SetBrushColor(hdc, color) \
2251  SetDCAttr (hdc, DC_ATTR_BRUSH_COLOR, (DWORD) color)
2252 
2263 #define SetTextColor(hdc, color) \
2264  SetDCAttr (hdc, DC_ATTR_TEXT_COLOR, (DWORD) color)
2265 
2276 #define SetTabStop(hdc, value) \
2277  SetDCAttr (hdc, DC_ATTR_TAB_STOP, (DWORD) value)
2278 
2279 #define ROP_SET 0
2280 #define ROP_AND 1
2281 #define ROP_OR 2
2282 #define ROP_XOR 3
2283 #define ROP_COMPOSITE 4
2284 #define ROP_COMP_USER 0x0100
2285 /* Reserved for future
2286  * #define ROP_COMP_XXX 0x01XX
2287  */
2288 
2313 MG_EXPORT int GUIAPI GetRasterOperation (HDC hdc);
2314 
2342 MG_EXPORT int GUIAPI SetRasterOperation (HDC hdc, int rop);
2343 
2366 MG_EXPORT int GUIAPI GetPalette (HDC hdc, int start, int len, GAL_Color* cmap);
2367 
2382 MG_EXPORT BOOL GUIAPI SetPalette (HDC hdc, int start, int len, GAL_Color* cmap);
2383 
2395 MG_EXPORT BOOL GUIAPI SetColorfulPalette (HDC hdc);
2396 
2410 MG_EXPORT HPALETTE GUIAPI CreatePalette (GAL_Palette* pal);
2411 
2427 MG_EXPORT BOOL GUIAPI SelectPalette (HDC hdc, HPALETTE hpal, BOOL reserved);
2428 
2450 MG_EXPORT BOOL GUIAPI RealizePalette (HDC hdc);
2451 
2465 MG_EXPORT BOOL GUIAPI ResizePalette (HPALETTE hpal, int len);
2466 
2477 MG_EXPORT void GUIAPI DestroyPalette (HPALETTE hpal);
2478 
2487 MG_EXPORT HPALETTE GUIAPI GetDefaultPalette (void);
2488 
2505 MG_EXPORT int GUIAPI GetPaletteEntries (HPALETTE hpal,
2506  int start, int len, GAL_Color* cmap);
2507 
2524 MG_EXPORT int GUIAPI SetPaletteEntries (HPALETTE hpal,
2525  int start, int len, GAL_Color* cmap);
2526 
2545 MG_EXPORT UINT GUIAPI GetNearestPaletteIndex (HPALETTE hpal,
2546  Uint8 red, Uint8 green, Uint8 blue);
2547 
2565 MG_EXPORT RGBCOLOR GUIAPI GetNearestColor (HDC hdc,
2566  Uint8 red, Uint8 green, Uint8 blue);
2567 
2591 MG_EXPORT void GUIAPI SetPixel (HDC hdc, int x, int y, gal_pixel pixel);
2592 
2611 MG_EXPORT gal_pixel GUIAPI SetPixelRGB (HDC hdc, int x, int y,
2612  Uint8 r, Uint8 g, Uint8 b);
2613 
2634 MG_EXPORT gal_pixel GUIAPI SetPixelRGBA (HDC hdc, int x, int y,
2635  Uint8 r, Uint8 g, Uint8 b, Uint8 a);
2636 
2652 MG_EXPORT gal_pixel GUIAPI GetPixel (HDC hdc, int x, int y);
2653 
2675 MG_EXPORT gal_pixel GUIAPI GetPixelRGB (HDC hdc, int x, int y,
2676  Uint8* r, Uint8* g, Uint8* b);
2677 
2703 MG_EXPORT gal_pixel GUIAPI GetPixelRGBA (HDC hdc, int x, int y,
2704  Uint8* r, Uint8* g, Uint8* b, Uint8* a);
2705 
2720 MG_EXPORT void GUIAPI RGBA2Pixels (HDC hdc, const RGB* rgbs,
2721  gal_pixel* pixels, int count);
2722 
2741 static inline gal_pixel RGBA2Pixel (HDC hdc,
2742  Uint8 r, Uint8 g, Uint8 b, Uint8 a)
2743 {
2744  RGB rgb = {r, g, b, a};
2745  gal_pixel pixel;
2746 
2747  RGBA2Pixels (hdc, &rgb, &pixel, 1);
2748  return pixel;
2749 }
2750 
2765 MG_EXPORT void GUIAPI RGB2Pixels (HDC hdc, const RGB* rgbs,
2766  gal_pixel* pixels, int count);
2767 
2785 static inline gal_pixel RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b)
2786 {
2787  RGB rgb = {r, g, b, 0xFF};
2788  gal_pixel pixel;
2789 
2790  RGB2Pixels (hdc, &rgb, &pixel, 1);
2791  return pixel;
2792 }
2793 
2808 MG_EXPORT void GUIAPI Pixel2RGBs (HDC hdc, const gal_pixel* pixels,
2809  RGB* rgbs, int count);
2810 
2832 static inline void Pixel2RGB (HDC hdc, gal_pixel pixel,
2833  Uint8* r, Uint8* g, Uint8* b)
2834 {
2835  RGB rgb;
2836  Pixel2RGBs (hdc, &pixel, &rgb, 1);
2837  *r = rgb.r; *g = rgb.g, *b = rgb.b;
2838 }
2839 
2854 MG_EXPORT void GUIAPI Pixel2RGBAs (HDC hdc, const gal_pixel* pixels,
2855  RGB* rgbs, int count);
2856 
2880 static inline void Pixel2RGBA (HDC hdc, gal_pixel pixel,
2881  Uint8* r, Uint8* g, Uint8* b, Uint8* a)
2882 {
2883  RGB rgb;
2884  Pixel2RGBAs (hdc, &pixel, &rgb, 1);
2885  *r = rgb.r; *g = rgb.g, *b = rgb.b; *a = rgb.a;
2886 }
2887 
2898 static inline DWORD Pixel2DWORD (HDC hdc, gal_pixel pixel)
2899 {
2900  Uint8 r,g,b,a;
2901  Pixel2RGBA (hdc, pixel, &r, &g, &b, &a);
2902  return MakeRGBA (r, g, b, a);
2903 }
2904 
2905 #define PIXEL2DWORD(hdc, pixel) Pixel2DWORD(hdc, pixel)
2906 
2917 static inline gal_pixel DWORD2Pixel (HDC hdc, DWORD dword)
2918 {
2919  return RGBA2Pixel (hdc,
2920  GetRValue(dword), GetGValue(dword),
2921  GetBValue(dword), GetAValue(dword));
2922 }
2923 
2941 MG_EXPORT void GUIAPI FocusRect (HDC hdc, int x0, int y0, int x1, int y1);
2942 
2960 MG_EXPORT void GUIAPI DrawHVDotLine (HDC hdc, int x, int y, int w_h, BOOL H_V);
2961 
2978 #define DrawHDotLine(hdc, x, y, w) DrawHVDotLine (hdc, x, y, w, TRUE);
2979 
2996 #define DrawVDotLine(hdc, x, y, h) DrawHVDotLine (hdc, x, y, h, FALSE);
2997 
3027 MG_EXPORT BOOL GUIAPI LineClipper (const RECT* cliprc,
3028  int *_x0, int *_y0, int *_x1, int *_y1);
3029 
3034 typedef void (* CB_LINE) (void* context, int stepx, int stepy);
3035 
3058 MG_EXPORT void GUIAPI LineGenerator (void* context,
3059  int x1, int y1, int x2, int y2, CB_LINE cb);
3060 
3065 typedef void (* CB_CIRCLE) (void* context, int x1, int x2, int y);
3066 
3094 MG_EXPORT void GUIAPI CircleGenerator (void* context,
3095  int sx, int sy, int r, CB_CIRCLE cb);
3096 
3101 typedef void (* CB_ELLIPSE) (void* context, int x1, int x2, int y);
3102 
3127 MG_EXPORT void GUIAPI EllipseGenerator (void* context,
3128  int sx, int sy, int rx, int ry, CB_ELLIPSE cb);
3129 
3134 typedef void (* CB_ARC) (void* context, int x, int y);
3135 
3159 MG_EXPORT void GUIAPI CircleArcGenerator (void* context,
3160  int sx, int sy, int r, int ang1, int ang2, CB_ARC cb);
3161 
3166 typedef void (* CB_POLYGON) (void* context, int x1, int x2, int y);
3167 
3206 MG_EXPORT BOOL GUIAPI MonotoneVerticalPolygonGenerator (void* context,
3207  const POINT* pts, int vertices, CB_POLYGON cb);
3208 
3226 MG_EXPORT BOOL GUIAPI PolygonIsMonotoneVertical (const POINT* pts,
3227  int vertices);
3228 
3255 MG_EXPORT BOOL GUIAPI PolygonGeneratorEx (void* context,
3256  const POINT* pts, int vertices, CB_POLYGON cb, RECT* rc_output);
3266 #define PolygonGenerator(context, pts, vertices, cb) \
3267  PolygonGeneratorEx(context, pts, vertices, cb, NULL)
3268 
3273 typedef BOOL (* CB_EQUAL_PIXEL) (void* context, int x, int y);
3274 
3279 typedef void (* CB_FLOOD_FILL) (void* context, int x1, int x2, int y);
3280 
3301 MG_EXPORT BOOL GUIAPI FloodFillGenerator (void* context,
3302  const RECT* src_rc, int x, int y,
3303  CB_EQUAL_PIXEL cb_equal_pixel, CB_FLOOD_FILL cb_flood_fill);
3304 
3305 /* DDA algorithm */
3306 #define BITMAP_SCALER_DDA 0
3307 /* Bilinear interpolation algorithm */
3308 #define BITMAP_SCALER_BILINEAR 1
3309 
3326 MG_EXPORT int GUIAPI SetBitmapScalerType (HDC hdc, int scaler_type);
3327 
3341 MG_EXPORT void GUIAPI MoveTo (HDC hdc, int x, int y);
3342 
3357 MG_EXPORT void GUIAPI LineTo (HDC hdc, int x, int y);
3358 
3374 MG_EXPORT void GUIAPI Rectangle (HDC hdc, int x0, int y0, int x1, int y1);
3375 
3390 MG_EXPORT void GUIAPI PolyLineTo (HDC hdc, const POINT* pts, int vertices);
3391 
3406 MG_EXPORT void GUIAPI SplineTo (HDC hdc, const POINT* pts);
3407 
3422 MG_EXPORT void GUIAPI Circle (HDC hdc, int sx, int sy, int r);
3423 
3440 MG_EXPORT void GUIAPI Ellipse (HDC hdc, int sx, int sy, int rx, int ry);
3441 
3463 MG_EXPORT void GUIAPI CircleArc (HDC hdc, int sx, int sy, int r,
3464  int ang1, int ang2);
3465 
3480 MG_EXPORT void GUIAPI FillBox (HDC hdc, int x, int y, int w, int h);
3481 
3495 MG_EXPORT void GUIAPI FillCircle (HDC hdc, int sx, int sy, int r);
3496 
3513 MG_EXPORT void GUIAPI FillEllipse (HDC hdc, int sx, int sy, int rx, int ry);
3514 
3528 MG_EXPORT BOOL GUIAPI FillPolygon (HDC hdc, const POINT* pts, int vertices);
3529 
3543 MG_EXPORT BOOL GUIAPI FloodFill (HDC hdc, int x, int y);
3544 
3545 #ifdef _MGHAVE_ADV_2DAPI
3546 
3555 typedef enum
3556 {
3574 } PenType;
3575 
3585 #define GetPenType(hdc) \
3586  GetDCAttr (hdc, DC_ATTR_PEN_TYPE)
3587 
3598 #define SetPenType(hdc, type) \
3599  SetDCAttr (hdc, DC_ATTR_PEN_TYPE, (DWORD) type)
3600 
3620 MG_EXPORT void GUIAPI SetPenDashes (HDC hdc, int dash_offset,
3621  const unsigned char* dash_list, int n);
3622 
3626 typedef enum
3627 {
3643 } PTCapStyle;
3644 
3654 #define GetPenCapStyle(hdc) \
3655  GetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE)
3656 
3667 #define SetPenCapStyle(hdc, style) \
3668  SetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE, (DWORD) style)
3669 
3673 typedef enum
3674 {
3688 } PTJoinStyle;
3689 
3699 #define GetPenJoinStyle(hdc) GetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE)
3700 
3711 #define SetPenJoinStyle(hdc, style) \
3712  SetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE, (DWORD) style)
3713 
3723 #define GetPenWidth(hdc) \
3724  GetDCAttr (hdc, DC_ATTR_PEN_WIDTH)
3725 
3736 #define SetPenWidth(hdc, width) \
3737  SetDCAttr (hdc, DC_ATTR_PEN_WIDTH, (DWORD) width)
3738 
3746 typedef enum
3747 {
3770 } BrushType;
3771 
3781 #define GetBrushType(hdc) \
3782  GetDCAttr (hdc, DC_ATTR_BRUSH_TYPE)
3783 
3794 #define SetBrushType(hdc, type) \
3795  SetDCAttr (hdc, DC_ATTR_BRUSH_TYPE, (DWORD) type)
3796 
3798 typedef struct _STIPPLE
3799 {
3801  int width;
3803  int height;
3804 
3806  int pitch;
3807 
3809  size_t size;
3810 
3812  const unsigned char* bits;
3813 } STIPPLE;
3814 
3826 MG_EXPORT void GUIAPI SetBrushInfo (HDC hdc,
3827  const BITMAP* tile, const STIPPLE* stipple);
3828 
3843 MG_EXPORT void GUIAPI SetBrushOrigin (HDC hdc, int x, int y);
3844 
3862 MG_EXPORT void GUIAPI LineEx (HDC hdc, int x1, int y1, int x2, int y2);
3863 
3887 MG_EXPORT void GUIAPI ArcEx (HDC hdc, int x, int y, int width, int height,
3888  int ang1, int ang2);
3889 
3913 MG_EXPORT void GUIAPI FillArcEx (HDC hdc, int x, int y, int width, int height,
3914  int ang1, int ang2);
3915 
3928 MG_EXPORT void GUIAPI PolyLineEx (HDC hdc, const POINT* pts, int nr_pts);
3929 
3933 typedef struct _ARC
3934 {
3936  int x;
3938  int y;
3939 
3941  int width;
3943  int height;
3944 
3949  int angle1;
3953  int angle2;
3954 } ARC;
3955 
3968 MG_EXPORT void GUIAPI PolyArcEx (HDC hdc, const ARC* arcs, int nr_arcs);
3969 
3982 MG_EXPORT void GUIAPI PolyFillArcEx (HDC hdc, const ARC* arcs, int nr_arcs);
3983 
4002 MG_EXPORT BOOL GUIAPI RoundRect (HDC hdc, int x0, int y0, int x1, int y1, int cw, int ch);
4003 
4007 #endif
4008 
4054 #define MM_TEXT 0
4055 #define MM_ANISOTROPIC 1
4056 
4072 #define GetMapMode(hdc) GetDCAttr (hdc, DC_ATTR_MAP_MODE)
4073 
4089 #define SetMapMode(hdc, mapmode) \
4090  SetDCAttr (hdc, DC_ATTR_MAP_MODE, (DWORD)mapmode)
4091 
4116 MG_EXPORT void GUIAPI GetDCLCS (HDC hdc, int which, POINT* pt);
4117 
4142 MG_EXPORT void GUIAPI SetDCLCS (HDC hdc, int which, const POINT* pt);
4143 
4144 #define DC_LCS_VORG 0
4145 #define DC_LCS_VEXT 1
4146 #define DC_LCS_WORG 2
4147 #define DC_LCS_WEXT 3
4148 #define NR_DC_LCS_PTS 4
4149 
4163 #define GetViewportOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_VORG, pPt)
4164 
4178 #define GetViewportExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_VEXT, pPt)
4179 
4193 #define GetWindowOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_WORG, pPt)
4194 
4208 #define GetWindowExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_WEXT, pPt)
4209 
4223 #define SetViewportOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_VORG, pPt)
4224 
4238 #define SetViewportExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_VEXT, pPt)
4239 
4253 #define SetWindowOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_WORG, pPt)
4254 
4268 #define SetWindowExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_WEXT, pPt)
4269 
4288 MG_EXPORT void GUIAPI DPtoLP (HDC hdc, POINT* pPt);
4289 
4290 
4309 MG_EXPORT void GUIAPI LPtoDP (HDC hdc, POINT* pPt);
4310 
4329 MG_EXPORT void GUIAPI SPtoLP(HDC hdc, POINT* pPt);
4330 
4331 
4350 MG_EXPORT void GUIAPI LPtoSP(HDC hdc, POINT* pPt);
4351 
4372 MG_EXPORT void GUIAPI ExcludeClipRect (HDC hdc, const RECT* prc);
4373 
4387 MG_EXPORT void GUIAPI IncludeClipRect (HDC hdc, const RECT* prc);
4388 
4404 MG_EXPORT BOOL GUIAPI PtVisible (HDC hdc, int x, int y);
4405 
4418 MG_EXPORT void GUIAPI ClipRectIntersect (HDC hdc, const RECT* prc);
4419 
4432 MG_EXPORT void GUIAPI SelectClipRect (HDC hdc, const RECT* prc);
4433 
4434 #define RGN_COPY 0x00
4435 #define RGN_DIFF 0x01
4436 #define RGN_AND 0x02
4437 #define RGN_OR 0x03
4438 #define RGN_XOR 0x04
4439 
4493 MG_EXPORT int GUIAPI SelectClipRegionEx (HDC hdc, const CLIPRGN* pRgn,
4494  int fnMode);
4495 
4508 MG_EXPORT void GUIAPI SelectClipRegion (HDC hdc, const CLIPRGN* pRgn);
4509 
4532 MG_EXPORT int GUIAPI OffsetClipRegion (HDC hdc, int nXOffset, int nYOffset);
4533 
4546 MG_EXPORT void GUIAPI GetBoundsRect (HDC hdc, RECT* pRect);
4547 
4565 MG_EXPORT BOOL GUIAPI RectVisible (HDC hdc, const RECT* pRect);
4566 
4585 MG_EXPORT int GUIAPI GetClipBox (HDC hdc, RECT* clipbox);
4586 
4605 MG_EXPORT int GUIAPI GetClipRegion (HDC hdc, CLIPRGN* cliprgn);
4606 
4642 MG_EXPORT BOOL GUIAPI GetBitmapFromDC (HDC hdc,
4643  int x, int y, int w, int h, BITMAP* bmp);
4644 
4680 MG_EXPORT BOOL GUIAPI FillBoxWithBitmap (HDC hdc, int x, int y, int w, int h,
4681  const BITMAP *bmp);
4682 
4736 MG_EXPORT BOOL GUIAPI FillBoxWithBitmapPart (HDC hdc,
4737  int x, int y, int w, int h,
4738  int bw, int bh, const BITMAP* bmp, int xo, int yo);
4739 
4762 MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y,
4763  int box_w, int box_h, const BITMAP* pbmp, int bmp_x, int bmp_y,
4764  int bmp_w, int bmp_h);
4765 
4799 MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
4800  HDC hddc, int dx, int dy, DWORD dwRop);
4801 
4840 MG_EXPORT void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh,
4841  HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop);
4842 
4862 MG_EXPORT BOOL GUIAPI ScaleBitmapEx (BITMAP* dst, const BITMAP* src,
4863  HDC ref_dc);
4864 
4865 #define ScaleBitmap(dst, src) ScaleBitmapEx(dst, src, HDC_SCREEN)
4866 
4888 MG_EXPORT gal_pixel GUIAPI GetPixelInBitmapEx (const BITMAP* bmp, int x, int y, Uint8* alpha);
4889 
4907 static inline gal_pixel GUIAPI GetPixelInBitmap (const BITMAP* bmp, int x, int y)
4908 {
4909  return GetPixelInBitmapEx (bmp, x, y, NULL);
4910 }
4911 
4936 MG_EXPORT BOOL GUIAPI SetPixelInBitmapEx (const BITMAP* bmp,
4937  int x, int y, gal_pixel pixel, const Uint8* alpha);
4938 
4959 static inline BOOL GUIAPI SetPixelInBitmap (const BITMAP* bmp,
4960  int x, int y, gal_pixel pixel)
4961 {
4962  return SetPixelInBitmapEx (bmp, x, y, pixel, NULL);
4963 }
4964 
4965 #ifdef _MGMISC_SAVESCREEN
4966 
4985 MG_EXPORT BOOL GUIAPI SaveScreenRectContent (const RECT* rcWin,
4986  const char* filename);
4987 
5005 MG_EXPORT BOOL GUIAPI SaveMainWindowContent (HWND hWnd, const char* filename);
5006 #endif
5007 
5032 MG_EXPORT HICON GUIAPI LoadIconFromFile (HDC hdc, const char* filename,
5033  int which);
5034 
5053 MG_EXPORT HICON GUIAPI LoadIconFromMem (HDC hdc, const void* area, int which);
5054 
5079 MG_EXPORT HICON GUIAPI CreateIconEx (HDC hdc, int w, int h,
5080  const BYTE* AndBits, const BYTE* XorBits, int colornum,
5081  const RGB* pal);
5086 #define CreateIcon(hdc, w, h, AndBits, XorBits, colornum) \
5087  CreateIconEx(hdc, w, h, AndBits, XorBits, colornum, NULL)
5088 
5089 
5101 MG_EXPORT BOOL GUIAPI DestroyIcon (HICON hicon);
5102 
5116 MG_EXPORT BOOL GUIAPI GetIconSize (HICON hicon, int* w, int* h);
5117 
5135 MG_EXPORT void GUIAPI DrawIcon (HDC hdc,
5136  int x, int y, int w, int h, HICON hicon);
5137 
5159 static inline void SetRect (RECT* prc, int left, int top, int right, int bottom)
5160 {
5161  (prc)->left = left; (prc)->top = top;
5162  (prc)->right = right; (prc)->bottom = bottom;
5163 }
5164 
5178 static inline void SetRectEmpty (RECT* prc)
5179 {
5180  (prc)->left = (prc)->top = (prc)->right = (prc)->bottom = 0;
5181 }
5182 
5195 static inline void CopyRect (RECT* pdrc, const RECT* psrc)
5196 {
5197  (pdrc)->left = (psrc)->left; (pdrc)->top = (psrc)->top;
5198  (pdrc)->right = (psrc)->right; (pdrc)->bottom = (psrc)->bottom;
5199 }
5200 
5216 static inline void OffsetRect (RECT* prc, int x, int y)
5217 {
5218  (prc)->left += x; (prc)->top += y; (prc)->right += x; (prc)->bottom += y;
5219 }
5220 
5237 static inline void InflateRect (RECT* prc, int cx, int cy)
5238 {
5239  (prc)->left -= cx; (prc)->top -= cy;
5240  (prc)->right += cx; (prc)->bottom += cy;
5241 }
5242 
5256 static inline void InflateRectToPt (RECT* prc, int x, int y)
5257 {
5258  if ((x) < (prc)->left) (prc)->left = (x);
5259  if ((y) < (prc)->top) (prc)->top = (y);
5260  if ((x) > (prc)->right) (prc)->right = (x);
5261  if ((y) > (prc)->bottom) (prc)->bottom = (y);
5262 }
5263 
5279 static inline BOOL PtInRect(const RECT* prc, int x, int y)
5280 {
5281  if (x >= prc->left && x < prc->right && y >= prc->top && y < prc->bottom)
5282  return TRUE;
5283  return FALSE;
5284 }
5285 
5298 MG_EXPORT BOOL GUIAPI IsRectEmpty (const RECT* prc);
5299 
5312 MG_EXPORT BOOL GUIAPI EqualRect (const RECT* prc1, const RECT* prc2);
5313 
5323 MG_EXPORT void GUIAPI NormalizeRect (RECT* pRect);
5324 
5345 MG_EXPORT BOOL GUIAPI IntersectRect (RECT* pdrc,
5346  const RECT* psrc1, const RECT* psrc2);
5347 
5363 MG_EXPORT BOOL GUIAPI IsCovered (const RECT* prc1, const RECT* prc2);
5364 
5378 MG_EXPORT BOOL GUIAPI DoesIntersect (const RECT* psrc1, const RECT* psrc2);
5379 
5397 MG_EXPORT BOOL GUIAPI UnionRect (RECT* pdrc,
5398  const RECT* psrc1, const RECT* psrc2);
5399 
5415 MG_EXPORT void GUIAPI GetBoundRect (PRECT pdrc,
5416  const RECT* psrc1, const RECT* psrc2);
5417 
5434 MG_EXPORT int GUIAPI SubtractRect (RECT* rc, const RECT* psrc1, const RECT* psrc2);
5435 
5440 #define RECTWP(prc) ((prc)->right - (prc)->left)
5441 
5445 #define RECTHP(prc) ((prc)->bottom - (prc)->top)
5446 
5450 #define RECTW(rc) ((rc).right - (rc).left)
5451 
5455 #define RECTH(rc) ((rc).bottom - (rc).top)
5456 
5470 /* Font-related structures */
5471 #define LEN_LOGFONT_NAME_FIELD 31
5472 #define LEN_LOGFONT_FAMILY_FIELD (LEN_LOGFONT_NAME_FIELD*7+6)
5473 #define LEN_LOGFONT_NAME_FULL (LEN_LOGFONT_FAMILY_FIELD + 32)
5474 #define LEN_UNIDEVFONT_NAME 255
5475 
5476 #define LEN_FONT_NAME LEN_LOGFONT_NAME_FIELD
5477 #define LEN_DEVFONT_NAME LEN_UNIDEVFONT_NAME
5478 
5479 #define FONT_WEIGHT_NIL '\0'
5480 #define FONT_WEIGHT_ANY '*'
5481 #define FONT_WEIGHT_THIN 't'
5482 #define FONT_WEIGHT_EXTRA_LIGHT 'e'
5483 #define FONT_WEIGHT_LIGHT 'l'
5484 #define FONT_WEIGHT_NORMAL 'n'
5485 #define FONT_WEIGHT_REGULAR 'r'
5486 #define FONT_WEIGHT_MEDIUM 'm'
5487 #define FONT_WEIGHT_DEMIBOLD 'd'
5488 #define FONT_WEIGHT_BOLD 'b'
5489 #define FONT_WEIGHT_EXTRA_BOLD 'x'
5490 #define FONT_WEIGHT_BLACK 'c'
5491 
5492 /* Backward compatiblilty definitions.
5493  * deprecated since v4.0.0, use FS_RENDER_XXX/FONT_RENDER_XXX instead
5494  */
5495 #define FONT_WEIGHT_SUBPIXEL 's'
5496 #define FONT_WEIGHT_BOOK 'k'
5497 
5498 #define FS_WEIGHT_MASK 0x000000FF
5499 #define FS_WEIGHT_ANY 0
5500 #define FS_WEIGHT_THIN 10
5501 #define FS_WEIGHT_EXTRA_LIGHT 20
5502 #define FS_WEIGHT_LIGHT 30
5503 #define FS_WEIGHT_NORMAL 35
5504 #define FS_WEIGHT_REGULAR 40
5505 #define FS_WEIGHT_MEDIUM 50
5506 #define FS_WEIGHT_DEMIBOLD 60
5507 #define FS_WEIGHT_EXTRA_BOLD 70
5508 #define FS_WEIGHT_BOLD 80
5509 #define FS_WEIGHT_BLACK 90
5510 
5511 #define FONT_SLANT_NIL '\0'
5512 #define FONT_SLANT_ANY '*'
5513 #define FONT_SLANT_ROMAN 'r'
5514 #define FONT_SLANT_ITALIC 'i'
5515 #define FONT_SLANT_OBLIQUE 'o'
5516 
5517 #define FS_SLANT_MASK 0x00000F00
5518 #define FS_SLANT_ANY 0x00000000
5519 #define FS_SLANT_ROMAN 0x00000100
5520 #define FS_SLANT_ITALIC 0x00000200
5521 #define FS_SLANT_OBLIQUE 0x00000300
5522 
5523 #define FONT_FLIP_NONE 'n'
5524 #define FONT_FLIP_HORZ 'h'
5525 #define FONT_FLIP_VERT 'v'
5526 #define FONT_FLIP_HORZVERT 't'
5527 #define FONT_FLIP_NIL FONT_FLIP_NONE
5528 
5529 #define FS_FLIP_MASK 0x0000F000
5530 #define FS_FLIP_NONE 0x00000000
5531 #define FS_FLIP_HORZ 0x00001000
5532 #define FS_FLIP_VERT 0x00002000
5533 #define FS_FLIP_HORZVERT 0x00003000 /* HORZ | VERT */
5534 
5535 #define FONT_OTHER_NONE 'n'
5536 #define FONT_OTHER_AUTOSCALE 's'
5537 #define FONT_OTHER_TTFNOCACHE 'c'
5538 #define FONT_OTHER_TTFKERN 'k'
5539 #define FONT_OTHER_TTFNOCACHEKERN 'r'
5540 #define FONT_OTHER_NIL FONT_OTHER_NONE
5541 
5542 #define FS_OTHER_MASK 0x00F00000
5543 #define FS_OTHER_NONE 0x00000000
5544 #define FS_OTHER_AUTOSCALE 0x00100000
5545 #define FS_OTHER_TTFNOCACHE 0x00200000
5546 #define FS_OTHER_TTFKERN 0x00400000
5547 #define FS_OTHER_TTFNOCACHEKERN 0x00600000 /* KERN | NOCACHE */
5548 
5549 #define FONT_DECORATE_NIL '\0'
5550 #define FONT_DECORATE_NONE 'n'
5551 #define FONT_DECORATE_UNDERLINE 'u'
5552 #define FONT_DECORATE_STRUCKOUT 's'
5553 #define FONT_DECORATE_REVERSE 'r'
5554 #define FONT_DECORATE_OUTLINE 'o'
5555 #define FONT_DECORATE_US 'U' /* UNDERLINE | STRUCKOUT */
5556 
5557 #define FS_DECORATE_MASK 0x0F000000
5558 #define FS_DECORATE_NONE 0x00000000
5559 #define FS_DECORATE_UNDERLINE 0x01000000
5560 #define FS_DECORATE_STRUCKOUT 0x02000000
5561 #define FS_DECORATE_REVERSE 0x04000000
5562 #define FS_DECORATE_OUTLINE 0x08000000
5563 #define FS_DECORATE_US (FS_DECORATE_UNDERLINE | FS_DECORATE_STRUCKOUT)
5564 
5565 #define FONT_RENDER_NIL '\0'
5566 #define FONT_RENDER_ANY '*'
5567 #define FONT_RENDER_MONO 'n'
5568 #define FONT_RENDER_GREY 'g'
5569 #define FONT_RENDER_SUBPIXEL 's'
5570 
5571 #define FS_RENDER_MASK 0xF0000000
5572 #define FS_RENDER_MONO 0x00000000
5573 #define FS_RENDER_GREY 0x10000000
5574 #define FS_RENDER_SUBPIXEL 0x20000000
5575 #define FS_RENDER_ANY FS_RENDER_MONO
5576 
5577 /* Backward compatiblilty definitions; deprecated since v4.0.0 */
5578 #define FONT_OTHER_LCDPORTRAIT 'p'
5579 #define FONT_OTHER_LCDPORTRAITKERN 'q'
5580 
5581 #define FONT_WEIGHT_ALL FONT_WEIGHT_ANY
5582 #define FONT_SLANT_ALL FONT_SLANT_ANY
5583 #define FS_WEIGHT_ALL FS_WEIGHT_ANY
5584 #define FS_SLANT_ALL FS_SLANT_ANY
5585 
5586 /* Backward compatiblilty definitions; deprecated since v4.0.0
5587  * All FONT_SETWIDTH_* and FONT_SPACING_* types will
5588  * be treated as FONT_FLIP_NIL and FONT_OTHER_NIL respectively.
5589  */
5590 #define FONT_SETWIDTH_NIL '\0'
5591 #define FONT_SETWIDTH_ALL '*'
5592 #define FONT_SETWIDTH_BOLD 'b'
5593 #define FONT_SETWIDTH_CONDENSED 'c'
5594 #define FONT_SETWIDTH_SEMICONDENSED 's'
5595 #define FONT_SETWIDTH_NORMAL 'n'
5596 #define FONT_SETWIDTH_TTFNOCACHE 'w'
5597 
5598 #define FONT_SPACING_NIL '\0'
5599 #define FONT_SPACING_ALL '*'
5600 #define FONT_SPACING_MONOSPACING 'm'
5601 #define FONT_SPACING_PROPORTIONAL 'p'
5602 #define FONT_SPACING_CHARCELL 'c'
5603 
5604 #define FONT_UNDERLINE_NIL '\0'
5605 #define FONT_UNDERLINE_ALL '*'
5606 #define FONT_UNDERLINE_LINE 'u'
5607 #define FONT_UNDERLINE_NONE 'n'
5608 
5609 #define FONT_STRUCKOUT_NIL '\0'
5610 #define FONT_STRUCKOUT_ALL '*'
5611 #define FONT_STRUCKOUT_LINE 's'
5612 #define FONT_STRUCKOUT_NONE 'n'
5613 /******/
5614 
5615 #define FONT_TYPE_NAME_LEN 3
5616 #define FONT_TYPE_NAME_BITMAP_NUF "nuf"
5617 #define FONT_TYPE_NAME_BITMAP_RAW "rbf"
5618 #define FONT_TYPE_NAME_BITMAP_VAR "vbf"
5619 #define FONT_TYPE_NAME_BITMAP_QPF "qpf"
5620 #define FONT_TYPE_NAME_BITMAP_UPF "upf"
5621 #define FONT_TYPE_NAME_BITMAP_BMP "bmp"
5622 #define FONT_TYPE_NAME_SCALE_TTF "ttf"
5623 #define FONT_TYPE_NAME_SCALE_T1F "t1f"
5624 #define FONT_TYPE_NAME_ANY "*"
5625 #define FONT_TYPE_NAME_ALL FONT_TYPE_NAME_ANY
5626 
5627 #define FONT_ETC_SECTION_NAME_VBF "varbitmapfonts"
5628 #define FONT_ETC_SECTION_NAME_RBF "rawbitmapfonts"
5629 #define FONT_ETC_SECTION_NAME_UPF "upf"
5630 #define FONT_ETC_SECTION_NAME_QPF "qpf"
5631 #define FONT_ETC_SECTION_NAME_TTF "truetypefonts"
5632 
5633 #define FONT_TYPE_BITMAP_RAW 0x0001 /* "rbf" */
5634 #define FONT_TYPE_BITMAP_VAR 0x0002 /* "vbf" */
5635 #define FONT_TYPE_BITMAP_QPF 0x0003 /* "qpf" */
5636 #define FONT_TYPE_BITMAP_BMP 0x0004 /* "bmp" */
5637 #define FONT_TYPE_BITMAP_UPF 0x0005 /* "upf" */
5638 #define FONT_TYPE_SCALE_TTF 0x0010 /* "ttf" */
5639 #define FONT_TYPE_SCALE_T1F 0x0011 /* "t1f" */
5640 #define FONT_TYPE_ANY 0x0000 /* "any" */
5641 #define FONT_TYPE_ALL FONT_TYPE_ANY
5642 
5643 #define FONT_CHARSET_US_ASCII "US-ASCII"
5644 
5645 #define FONT_CHARSET_ISO8859_1 "ISO8859-1"
5646 #define FONT_CHARSET_ISO8859_2 "ISO8859-2"
5647 #define FONT_CHARSET_ISO8859_3 "ISO8859-3"
5648 #define FONT_CHARSET_ISO8859_4 "ISO8859-4"
5649 #define FONT_CHARSET_ISO8859_5 "ISO8859-5"
5650 #define FONT_CHARSET_ISO8859_6 "ISO8859-6"
5651 #define FONT_CHARSET_ISO8859_7 "ISO8859-7"
5652 #define FONT_CHARSET_ISO8859_8 "ISO8859-8"
5653 #define FONT_CHARSET_ISO8859_9 "ISO8859-9"
5654 #define FONT_CHARSET_ISO8859_10 "ISO8859-10"
5655 #define FONT_CHARSET_ISO8859_11 "ISO8859-11"
5656 #define FONT_CHARSET_ISO8859_12 "ISO8859-12"
5657 #define FONT_CHARSET_ISO8859_13 "ISO8859-13"
5658 #define FONT_CHARSET_ISO8859_14 "ISO8859-14"
5659 #define FONT_CHARSET_ISO8859_15 "ISO8859-15"
5660 #define FONT_CHARSET_ISO8859_16 "ISO8859-16"
5661 
5662 #define FONT_CHARSET_EUC_CN "EUC-CN"
5663 
5668 #define FONT_CHARSET_GB1988_0 "GB1988-0"
5669 
5674 #define FONT_CHARSET_GB2312_0 "GB2312-0"
5675 #define FONT_CHARSET_GBK "GBK"
5676 
5681 #define FONT_CHARSET_GB18030_0 "GB18030-0"
5682 #define FONT_CHARSET_BIG5 "BIG5"
5683 
5688 #define FONT_CHARSET_EUCTW "EUC-TW"
5689 #define FONT_CHARSET_EUCKR "EUC-KR"
5690 
5695 #define FONT_CHARSET_KSC5636_0 "KSC5636-0"
5696 
5701 #define FONT_CHARSET_KSC5601_0 "KSC5601-0"
5702 #define FONT_CHARSET_EUCJP "EUC-JP"
5703 
5708 #define FONT_CHARSET_JISX0201_0 "JISX0201-0"
5709 
5714 #define FONT_CHARSET_JISX0208_0 "JISX0208-0"
5715 #define FONT_CHARSET_SHIFTJIS "SHIFT-JIS"
5716 
5721 #define FONT_CHARSET_JISX0201_1 "JISX0201-1"
5722 
5727 #define FONT_CHARSET_JISX0208_1 "JISX0208-1"
5728 
5733 #define FONT_CHARSET_ISO_10646_1 "ISO-10646-1"
5734 
5739 #define FONT_CHARSET_UTF8 "UTF-8"
5740 
5745 #define FONT_CHARSET_UTF16LE "UTF-16LE"
5746 
5751 #define FONT_CHARSET_UTF16BE "UTF-16BE"
5752 
5753 #define FONT_MAX_SIZE 256
5754 #define FONT_MIN_SIZE 1
5755 #define MAXNR_DEVFONTS 8
5756 
5757 struct _DEVFONT;
5758 typedef struct _DEVFONT DEVFONT;
5759 
5764 typedef struct _LOGFONT {
5766  char* type;
5768  char* family;
5770  char* charset;
5774  int size;
5778  int ascent;
5780  int descent;
5783 
5784  /*
5785  * The following fields are internally used.
5786  * They may be changed in the future.
5787  */
5788 
5789  // The scale factors of devfonts
5790  unsigned short scales[MAXNR_DEVFONTS];
5791  // The devfonts for the logfont
5792  DEVFONT* devfonts[MAXNR_DEVFONTS];
5793 } LOGFONT;
5794 
5800 
5805 typedef const LOGFONT* CPLOGFONT;
5806 
5807 struct _WORDINFO;
5808 
5813 typedef struct _WORDINFO WORDINFO;
5814 
5815 #define MAX_LEN_MCHAR 6
5816 
5817 typedef Uint16 Uchar16;
5818 typedef Uint32 Uchar32;
5819 
5837 #define ACHARTYPE_BASIC_MASK 0x0000FFFF
5838 #define ACHARTYPE_CATEGORY_MASK 0x00FF0000
5839 #define ACHARTYPE_BREAK_MASK 0xFF000000
5840 
5845 #define ACHARTYPE_EXTRACT_BASIC(t) \
5846  (((t) & ACHARTYPE_BASIC_MASK))
5847 
5852 #define ACHARTYPE_EXTRACT_CATEGORY(t) \
5853  (((t) & ACHARTYPE_CATEGORY_MASK) >> 16)
5854 
5859 #define ACHARTYPE_EXTRACT_BREAK(t) \
5860  (((t) & ACHARTYPE_BREAK_MASK) >> 24)
5861 
5866 #define ACHARTYPE_UNKNOWN 0
5867 
5868 #define ACHAR_BASIC_NOSPACING_MARK 0x0001
5869 #define ACHAR_BASIC_ABOVE_MARK 0x0002
5870 #define ACHAR_BASIC_BELLOW_MARK 0x0004
5871 
5872 #define ACHAR_BASIC_UNKNOWN 0x0000
5873 #define ACHAR_BASIC_NUL (0x0000 | ACHAR_BASIC_NOSPACING_MARK)
5874 
5875 #define ACHAR_BASIC_CTRL1 0x0100
5876 
5877 #define ACHAR_BASIC_BEL 0x0200
5878 
5879 #define ACHAR_BASIC_BS 0x0300
5880 
5881 #define ACHAR_BASIC_HT 0x0400
5882 
5883 #define ACHAR_BASIC_LF 0x0500
5884 
5885 #define ACHAR_BASIC_VT 0x0600
5886 
5887 #define ACHAR_BASIC_FF 0x0700
5888 
5889 #define ACHAR_BASIC_CR 0x0800
5890 
5891 #define ACHAR_BASIC_CTRL2 0x0900
5892 
5893 #define ACHAR_BASIC_SPACE 0x0A00
5894 
5895 #define ACHAR_BASIC_ZEROWIDTH 0x0B00
5896 #define ACHAR_BASIC_GENERIC 0x0C00
5897 
5898 #define ACHAR_BASIC_LIGATURE (0x0D00 | ACHAR_BASIC_NOSPACING_MARK)
5899 #define ACHAR_BASIC_VOWEL (0x0E00 | ACHAR_BASIC_NOSPACING_MARK)
5900 #define ACHAR_BASIC_VOWEL_ABOVE (ACHAR_BASIC_VOWEL | ACHAR_BASIC_ABOVE_MARK)
5901 #define ACHAR_BASIC_VOWEL_BELLOW (ACHAR_BASIC_VOWEL | ACHAR_BASIC_BELLOW_MARK)
5902 
5903 /* Compatibility definitions */
5904 #define MCHAR_TYPE_UNKNOWN ACHAR_BASIC_UNKNOWN
5905 #define MCHAR_TYPE_NUL ACHAR_BASIC_NUL
5906 #define MCHAR_TYPE_CTRL1 ACHAR_BASIC_CTRL1
5907 #define MCHAR_TYPE_BEL ACHAR_BASIC_BEL
5908 #define MCHAR_TYPE_BS ACHAR_BASIC_BS
5909 #define MCHAR_TYPE_HT ACHAR_BASIC_HT
5910 #define MCHAR_TYPE_LF ACHAR_BASIC_LF
5911 #define MCHAR_TYPE_VT ACHAR_BASIC_VT
5912 #define MCHAR_TYPE_FF ACHAR_BASIC_FF
5913 #define MCHAR_TYPE_CR ACHAR_BASIC_CR
5914 #define MCHAR_TYPE_CTRL2 ACHAR_BASIC_CTRL2
5915 #define MCHAR_TYPE_SPACE ACHAR_BASIC_SPACE
5916 #define MCHAR_TYPE_ZEROWIDTH ACHAR_BASIC_ZEROWIDTH
5917 #define MCHAR_TYPE_GENERIC ACHAR_BASIC_GENERIC
5918 #define MCHAR_TYPE_NOSPACING_MARK ACHAR_BASIC_NOSPACING_MARK
5919 #define MCHAR_TYPE_LIGATURE ACHAR_BASIC_LIGATURE
5920 #define MCHAR_TYPE_VOWEL ACHAR_BASIC_VOWEL
5921 #define MCHAR_TYPE_VOWEL_ABOVE ACHAR_BASIC_VOWEL_ABOVE
5922 #define MCHAR_TYPE_VOWEL_BELLOW ACHAR_BASIC_VOWEL_BELLOW
5923 
5924 #if 0
5925 #define MCHAR_TYPE_ASCII 0x0080
5926 #define MCHAR_TYPE_LATIN1 0x0081
5927 #define MCHAR_TYPE_LATIN2 0x0082
5928 #define MCHAR_TYPE_LATIN3 0x0083
5929 #define MCHAR_TYPE_LATIN4 0x0084
5930 #define MCHAR_TYPE_LATIN5 0x0085
5931 #define MCHAR_TYPE_LATIN6 0x0086
5932 #define MCHAR_TYPE_LATIN7 0x0087
5933 #define MCHAR_TYPE_LATIN8 0x0088
5934 #define MCHAR_TYPE_LATIN9 0x0089
5935 #define MCHAR_TYPE_LATIN10 0x008A
5936 #define MCHAR_TYPE_CYRILLIC 0x008B
5937 #define MCHAR_TYPE_ARABIC 0x008C
5938 #define MCHAR_TYPE_GREEK 0x008D
5939 #define MCHAR_TYPE_HEBREW 0x008E
5940 #define MCHAR_TYPE_THAI 0x008F
5941 
5942 #define MCHAR_TYPE_DIGIT 0x0091
5943 #define MCHAR_TYPE_SYMBOL_PUNCT 0x0092
5944 #define MCHAR_TYPE_SYMBOL_MATH 0x0093
5945 #define MCHAR_TYPE_SYMBOL_OTHER 0x0094
5946 #define MCHAR_TYPE_FW_DIGIT 0x0095
5947 #define MCHAR_TYPE_FW_SYM_PUNCT 0x0096
5948 #define MCHAR_TYPE_FW_SYM_MATH 0x0097
5949 #define MCHAR_TYPE_FW_SYM_OTHER 0x0098
5950 
5951 #define MCHAR_TYPE_HANGUL 0x00A1
5952 #define MCHAR_TYPE_KATAKANA 0x00A2
5953 #define MCHAR_TYPE_CJK 0x00A3
5954 #endif
5955 
5994 typedef enum {
5995  UCHAR_CATEGORY_CONTROL,
5996  UCHAR_CATEGORY_FORMAT,
5997  UCHAR_CATEGORY_UNASSIGNED,
5998  UCHAR_CATEGORY_PRIVATE_USE,
5999  UCHAR_CATEGORY_SURROGATE,
6000  UCHAR_CATEGORY_LOWERCASE_LETTER,
6001  UCHAR_CATEGORY_MODIFIER_LETTER,
6002  UCHAR_CATEGORY_OTHER_LETTER,
6003  UCHAR_CATEGORY_TITLECASE_LETTER,
6004  UCHAR_CATEGORY_UPPERCASE_LETTER,
6005  UCHAR_CATEGORY_SPACING_MARK,
6006  UCHAR_CATEGORY_ENCLOSING_MARK,
6007  UCHAR_CATEGORY_NON_SPACING_MARK,
6008  UCHAR_CATEGORY_DECIMAL_NUMBER,
6009  UCHAR_CATEGORY_LETTER_NUMBER,
6010  UCHAR_CATEGORY_OTHER_NUMBER,
6011  UCHAR_CATEGORY_CONNECT_PUNCTUATION,
6012  UCHAR_CATEGORY_DASH_PUNCTUATION,
6013  UCHAR_CATEGORY_CLOSE_PUNCTUATION,
6014  UCHAR_CATEGORY_FINAL_PUNCTUATION,
6015  UCHAR_CATEGORY_INITIAL_PUNCTUATION,
6016  UCHAR_CATEGORY_OTHER_PUNCTUATION,
6017  UCHAR_CATEGORY_OPEN_PUNCTUATION,
6018  UCHAR_CATEGORY_CURRENCY_SYMBOL,
6019  UCHAR_CATEGORY_MODIFIER_SYMBOL,
6020  UCHAR_CATEGORY_MATH_SYMBOL,
6021  UCHAR_CATEGORY_OTHER_SYMBOL,
6022  UCHAR_CATEGORY_LINE_SEPARATOR,
6023  UCHAR_CATEGORY_PARAGRAPH_SEPARATOR,
6024  UCHAR_CATEGORY_SPACE_SEPARATOR
6026 
6081 typedef enum {
6082  UCHAR_BREAK_MANDATORY,
6083  UCHAR_BREAK_CARRIAGE_RETURN,
6084  UCHAR_BREAK_LINE_FEED,
6085  UCHAR_BREAK_COMBINING_MARK,
6086  UCHAR_BREAK_SURROGATE,
6087  UCHAR_BREAK_ZERO_WIDTH_SPACE,
6088  UCHAR_BREAK_INSEPARABLE,
6089  UCHAR_BREAK_NON_BREAKING_GLUE,
6090  UCHAR_BREAK_CONTINGENT,
6091  UCHAR_BREAK_SPACE,
6092  UCHAR_BREAK_AFTER,
6093  UCHAR_BREAK_BEFORE,
6094  UCHAR_BREAK_BEFORE_AND_AFTER,
6095  UCHAR_BREAK_HYPHEN,
6096  UCHAR_BREAK_NON_STARTER,
6097  UCHAR_BREAK_OPEN_PUNCTUATION,
6098  UCHAR_BREAK_CLOSE_PUNCTUATION,
6099  UCHAR_BREAK_QUOTATION,
6100  UCHAR_BREAK_EXCLAMATION,
6101  UCHAR_BREAK_IDEOGRAPHIC,
6102  UCHAR_BREAK_NUMERIC,
6103  UCHAR_BREAK_INFIX_SEPARATOR,
6104  UCHAR_BREAK_SYMBOL,
6105  UCHAR_BREAK_ALPHABETIC,
6106  UCHAR_BREAK_PREFIX,
6107  UCHAR_BREAK_POSTFIX,
6108  UCHAR_BREAK_COMPLEX_CONTEXT,
6109  UCHAR_BREAK_AMBIGUOUS,
6110  UCHAR_BREAK_UNKNOWN,
6111  UCHAR_BREAK_NEXT_LINE,
6112  UCHAR_BREAK_WORD_JOINER,
6113  UCHAR_BREAK_HANGUL_L_JAMO,
6114  UCHAR_BREAK_HANGUL_V_JAMO,
6115  UCHAR_BREAK_HANGUL_T_JAMO,
6116  UCHAR_BREAK_HANGUL_LV_SYLLABLE,
6117  UCHAR_BREAK_HANGUL_LVT_SYLLABLE,
6118  UCHAR_BREAK_CLOSE_PARANTHESIS,
6119  UCHAR_BREAK_CONDITIONAL_JAPANESE_STARTER,
6120  UCHAR_BREAK_HEBREW_LETTER,
6121  UCHAR_BREAK_REGIONAL_INDICATOR,
6122  UCHAR_BREAK_EMOJI_BASE,
6123  UCHAR_BREAK_EMOJI_MODIFIER,
6124  UCHAR_BREAK_ZERO_WIDTH_JOINER
6125 } UCharBreakType;
6126 
6299 typedef enum {
6300  SCRIPT_INVALID_CODE = 0xFF,
6301  SCRIPT_COMMON = 0, /* Zyyy */
6302  SCRIPT_INHERITED, /* Zinh (Qaai) */
6303  SCRIPT_ARABIC, /* Arab */
6304  SCRIPT_ARMENIAN, /* Armn */
6305  SCRIPT_BENGALI, /* Beng */
6306  SCRIPT_BOPOMOFO, /* Bopo */
6307  SCRIPT_CHEROKEE, /* Cher */
6308  SCRIPT_COPTIC, /* Copt (Qaac) */
6309  SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
6310  SCRIPT_DESERET, /* Dsrt */
6311  SCRIPT_DEVANAGARI, /* Deva */
6312  SCRIPT_ETHIOPIC, /* Ethi */
6313  SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
6314  SCRIPT_GOTHIC, /* Goth */
6315  SCRIPT_GREEK, /* Grek */
6316  SCRIPT_GUJARATI, /* Gujr */
6317  SCRIPT_GURMUKHI, /* Guru */
6318  SCRIPT_HAN, /* Hani */
6319  SCRIPT_HANGUL, /* Hang */
6320  SCRIPT_HEBREW, /* Hebr */
6321  SCRIPT_HIRAGANA, /* Hira */
6322  SCRIPT_KANNADA, /* Knda */
6323  SCRIPT_KATAKANA, /* Kana */
6324  SCRIPT_KHMER, /* Khmr */
6325  SCRIPT_LAO, /* Laoo */
6326  SCRIPT_LATIN, /* Latn (Latf, Latg) */
6327  SCRIPT_MALAYALAM, /* Mlym */
6328  SCRIPT_MONGOLIAN, /* Mong */
6329  SCRIPT_MYANMAR, /* Mymr */
6330  SCRIPT_OGHAM, /* Ogam */
6331  SCRIPT_OLD_ITALIC, /* Ital */
6332  SCRIPT_ORIYA, /* Orya */
6333  SCRIPT_RUNIC, /* Runr */
6334  SCRIPT_SINHALA, /* Sinh */
6335  SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
6336  SCRIPT_TAMIL, /* Taml */
6337  SCRIPT_TELUGU, /* Telu */
6338  SCRIPT_THAANA, /* Thaa */
6339  SCRIPT_THAI, /* Thai */
6340  SCRIPT_TIBETAN, /* Tibt */
6341  SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
6342  SCRIPT_YI, /* Yiii */
6343  SCRIPT_TAGALOG, /* Tglg */
6344  SCRIPT_HANUNOO, /* Hano */
6345  SCRIPT_BUHID, /* Buhd */
6346  SCRIPT_TAGBANWA, /* Tagb */
6347 
6348  /* Unicode-4.0 additions */
6349  SCRIPT_BRAILLE, /* Brai */
6350  SCRIPT_CYPRIOT, /* Cprt */
6351  SCRIPT_LIMBU, /* Limb */
6352  SCRIPT_OSMANYA, /* Osma */
6353  SCRIPT_SHAVIAN, /* Shaw */
6354  SCRIPT_LINEAR_B, /* Linb */
6355  SCRIPT_TAI_LE, /* Tale */
6356  SCRIPT_UGARITIC, /* Ugar */
6357 
6358  /* Unicode-4.1 additions */
6359  SCRIPT_NEW_TAI_LUE, /* Talu */
6360  SCRIPT_BUGINESE, /* Bugi */
6361  SCRIPT_GLAGOLITIC, /* Glag */
6362  SCRIPT_TIFINAGH, /* Tfng */
6363  SCRIPT_SYLOTI_NAGRI, /* Sylo */
6364  SCRIPT_OLD_PERSIAN, /* Xpeo */
6365  SCRIPT_KHAROSHTHI, /* Khar */
6366 
6367  /* Unicode-5.0 additions */
6368  SCRIPT_UNKNOWN, /* Zzzz */
6369  SCRIPT_BALINESE, /* Bali */
6370  SCRIPT_CUNEIFORM, /* Xsux */
6371  SCRIPT_PHOENICIAN, /* Phnx */
6372  SCRIPT_PHAGS_PA, /* Phag */
6373  SCRIPT_NKO, /* Nkoo */
6374 
6375  /* Unicode-5.1 additions */
6376  SCRIPT_KAYAH_LI, /* Kali */
6377  SCRIPT_LEPCHA, /* Lepc */
6378  SCRIPT_REJANG, /* Rjng */
6379  SCRIPT_SUNDANESE, /* Sund */
6380  SCRIPT_SAURASHTRA, /* Saur */
6381  SCRIPT_CHAM, /* Cham */
6382  SCRIPT_OL_CHIKI, /* Olck */
6383  SCRIPT_VAI, /* Vaii */
6384  SCRIPT_CARIAN, /* Cari */
6385  SCRIPT_LYCIAN, /* Lyci */
6386  SCRIPT_LYDIAN, /* Lydi */
6387 
6388  /* Unicode-5.2 additions */
6389  SCRIPT_AVESTAN, /* Avst */
6390  SCRIPT_BAMUM, /* Bamu */
6391  SCRIPT_EGYPTIAN_HIEROGLYPHS, /* Egyp */
6392  SCRIPT_IMPERIAL_ARAMAIC, /* Armi */
6393  SCRIPT_INSCRIPTIONAL_PAHLAVI, /* Phli */
6394  SCRIPT_INSCRIPTIONAL_PARTHIAN, /* Prti */
6395  SCRIPT_JAVANESE, /* Java */
6396  SCRIPT_KAITHI, /* Kthi */
6397  SCRIPT_LISU, /* Lisu */
6398  SCRIPT_MEETEI_MAYEK, /* Mtei */
6399  SCRIPT_OLD_SOUTH_ARABIAN, /* Sarb */
6400  SCRIPT_OLD_TURKIC, /* Orkh */
6401  SCRIPT_SAMARITAN, /* Samr */
6402  SCRIPT_TAI_THAM, /* Lana */
6403  SCRIPT_TAI_VIET, /* Tavt */
6404 
6405  /* Unicode-6.0 additions */
6406  SCRIPT_BATAK, /* Batk */
6407  SCRIPT_BRAHMI, /* Brah */
6408  SCRIPT_MANDAIC, /* Mand */
6409 
6410  /* Unicode-6.1 additions */
6411  SCRIPT_CHAKMA, /* Cakm */
6412  SCRIPT_MEROITIC_CURSIVE, /* Merc */
6413  SCRIPT_MEROITIC_HIEROGLYPHS, /* Mero */
6414  SCRIPT_MIAO, /* Plrd */
6415  SCRIPT_SHARADA, /* Shrd */
6416  SCRIPT_SORA_SOMPENG, /* Sora */
6417  SCRIPT_TAKRI, /* Takr */
6418 
6419  /* Unicode 7.0 additions */
6420  SCRIPT_BASSA_VAH, /* Bass */
6421  SCRIPT_CAUCASIAN_ALBANIAN, /* Aghb */
6422  SCRIPT_DUPLOYAN, /* Dupl */
6423  SCRIPT_ELBASAN, /* Elba */
6424  SCRIPT_GRANTHA, /* Gran */
6425  SCRIPT_KHOJKI, /* Khoj */
6426  SCRIPT_KHUDAWADI, /* Sind */
6427  SCRIPT_LINEAR_A, /* Lina */
6428  SCRIPT_MAHAJANI, /* Mahj */
6429  SCRIPT_MANICHAEAN, /* Manu */
6430  SCRIPT_MENDE_KIKAKUI, /* Mend */
6431  SCRIPT_MODI, /* Modi */
6432  SCRIPT_MRO, /* Mroo */
6433  SCRIPT_NABATAEAN, /* Nbat */
6434  SCRIPT_OLD_NORTH_ARABIAN, /* Narb */
6435  SCRIPT_OLD_PERMIC, /* Perm */
6436  SCRIPT_PAHAWH_HMONG, /* Hmng */
6437  SCRIPT_PALMYRENE, /* Palm */
6438  SCRIPT_PAU_CIN_HAU, /* Pauc */
6439  SCRIPT_PSALTER_PAHLAVI, /* Phlp */
6440  SCRIPT_SIDDHAM, /* Sidd */
6441  SCRIPT_TIRHUTA, /* Tirh */
6442  SCRIPT_WARANG_CITI, /* Wara */
6443 
6444  /* Unicode 8.0 additions */
6445  SCRIPT_AHOM, /* Ahom */
6446  SCRIPT_ANATOLIAN_HIEROGLYPHS, /* Hluw */
6447  SCRIPT_HATRAN, /* Hatr */
6448  SCRIPT_MULTANI, /* Mult */
6449  SCRIPT_OLD_HUNGARIAN, /* Hung */
6450  SCRIPT_SIGNWRITING, /* Sgnw */
6451 
6452  /* Unicode 9.0 additions */
6453  SCRIPT_ADLAM, /* Adlm */
6454  SCRIPT_BHAIKSUKI, /* Bhks */
6455  SCRIPT_MARCHEN, /* Marc */
6456  SCRIPT_NEWA, /* Newa */
6457  SCRIPT_OSAGE, /* Osge */
6458  SCRIPT_TANGUT, /* Tang */
6459 
6460  /* Unicode 10.0 additions */
6461  SCRIPT_MASARAM_GONDI, /* Gonm */
6462  SCRIPT_NUSHU, /* Nshu */
6463  SCRIPT_SOYOMBO, /* Soyo */
6464  SCRIPT_ZANABAZAR_SQUARE, /* Zanb */
6465 
6466  /* Unicode 11.0 additions */
6467  SCRIPT_DOGRA, /* Dogr */
6468  SCRIPT_GUNJALA_GONDI, /* Gong */
6469  SCRIPT_HANIFI_ROHINGYA, /* Rohg */
6470  SCRIPT_MAKASAR, /* Maka */
6471  SCRIPT_MEDEFAIDRIN, /* Medf */
6472  SCRIPT_OLD_SOGDIAN, /* Sogo */
6473  SCRIPT_SOGDIAN, /* Sogd */
6474 
6475  /* Unicode 12.0 additions */
6476  SCRIPT_ELYMAIC, /* Elymaic */
6477  SCRIPT_NANDINAGARI, /* Nandinagari */
6478  SCRIPT_NYIAKENG_PUACHUE_HMONG, /* Nyiakeng Puachue Hmong */
6479  SCRIPT_WANCHO, /* Wancho */
6480 } ScriptType;
6481 
6495 typedef enum {
6784 } LanguageCode;
6785 
6802 MG_EXPORT LanguageCode GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1);
6803 
6817 static inline LanguageCode GUIAPI LanguageCodeFromISO639s1Code(const char* iso639_1)
6818 {
6819  return LanguageCodeFromISO639s1(MAKEWORD16(iso639_1[1],
6820  iso639_1[0]));
6821 }
6822 
6824 MG_EXPORT const char* GUIAPI LanguageCodeToISO639s1(LanguageCode lc);
6825 
6827 MG_EXPORT LanguageCode GUIAPI GetSampleLanguageForScript(ScriptType st);
6828 
6830 MG_EXPORT const ScriptType* GUIAPI GetScriptsForLang(const char* lang_name,
6831  LanguageCode* lang_code, int* nr_scripts);
6832 
6834 MG_EXPORT ScriptType GUIAPI NormalizeScriptType(LanguageCode cl,
6835  ScriptType ws);
6836 
6839 struct _FONTOPS;
6840 struct _CHARSETOPS;
6841 
6842 typedef struct _FONTOPS FONTOPS;
6843 typedef struct _CHARSETOPS CHARSETOPS;
6844 
6849 struct _DEVFONT {
6860  char name [LEN_UNIDEVFONT_NAME + 1];
6861 
6864 
6865  /*
6866  * The following fields are internally used.
6867  * They may changed in the future.
6868  */
6869  // indicating if the data need to be unloaded before delete a devfont
6870  BOOL need_unload;
6871 
6872  // The pointer to font operation structure.
6873  FONTOPS* font_ops;
6874 
6875  // The pointer to character set operation structure.
6876  CHARSETOPS* charset_ops;
6877 
6878  // The pointer to next device font.
6879  struct _DEVFONT* next;
6880 
6881  // The device font used data.
6882  void* data;
6883 
6884  // The device font used relationship.
6885  void* relationship;
6886 };
6887 
6892 #define INV_LOGFONT 0
6893 
6895 typedef struct _FONTMETRICS {
6899  int ascent;
6901  int descent;
6902 
6907 } FONTMETRICS;
6908 
6923 MG_EXPORT void GUIAPI GetFontMetrics (LOGFONT* log_font,
6924  FONTMETRICS* font_metrics);
6925 
6927 typedef struct _GLYPHBITMAP {
6929  int bbox_x, bbox_y, bbox_w, bbox_h;
6931  int advance_x, advance_y;
6932 
6934  size_t bmp_size;
6938  const unsigned char* bits;
6939 } GLYPHBITMAP;
6940 
6970 MG_EXPORT void GUIAPI GetGlyphBitmap (LOGFONT* log_font,
6971  const char* mchar, int mchar_len,
6972  GLYPHBITMAP* glyph_bitmap);
6973 
6974 #ifndef _MGRM_THREADS
6975 
6994 MG_EXPORT BOOL GUIAPI InitVectorialFonts (void);
6995 
6996 
7009 MG_EXPORT void GUIAPI TermVectorialFonts (void);
7010 
7011 #endif
7012 
7137 MG_EXPORT PLOGFONT GUIAPI CreateLogFont (const char* type, const char* family,
7138  const char* charset, char weight, char slant, char flip,
7139  char other, char underline, char struckout,
7140  int size, int rotation);
7141 
7271 MG_EXPORT PLOGFONT GUIAPI CreateLogFontEx (const char* type, const char* family,
7272  const char* charset, char weight, char slant, char flip,
7273  char other, char decoration, char rendering,
7274  int size, int rotation);
7275 
7306 MG_EXPORT PLOGFONT GUIAPI CreateLogFontByName(const char* font_name);
7307 
7308 #ifdef _MGCHARSET_UNICODE
7309 
7326 MG_EXPORT PLOGFONT GUIAPI CreateLogFontForMChar2UChar(const char* charset);
7327 #endif /* _MGCHARSET_UNICODE */
7328 
7340 MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirect (LOGFONT* logfont);
7341 
7363 MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirectEx (LOGFONT* logfont,
7364  int rotation);
7365 
7376 MG_EXPORT void GUIAPI DestroyLogFont (PLOGFONT log_font);
7377 
7391 MG_EXPORT void GUIAPI GetLogFontInfo (HDC hdc, LOGFONT* log_font);
7392 
7405 MG_EXPORT PLOGFONT GUIAPI GetCurFont (HDC hdc);
7406 
7425 MG_EXPORT PLOGFONT GUIAPI SelectFont (HDC hdc, PLOGFONT log_font);
7426 
7437 MG_EXPORT const DEVFONT* GUIAPI GetNextDevFont (const DEVFONT* dev_font);
7438 
7439 #ifdef _MGFONT_FT2
7440 
7445 typedef enum {
7455  MG_SMOOTH_MAX /*do not remove*/
7456 } FT2LCDFilter;
7457 
7473 MG_EXPORT BOOL GUIAPI ft2SetLcdFilter (LOGFONT* logfont, FT2LCDFilter filter);
7474 
7475 #endif
7476 
7491 MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromIncoreData (const char *devfont_name,
7492  const void *data);
7493 
7510 MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name,
7511  const char *file_name);
7512 
7522 MG_EXPORT void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont);
7523 
7542 #define SYSLOGFONT_DEFAULT 0
7543 
7548 #define SYSLOGFONT_WCHAR_DEF 1
7549 
7554 #define SYSLOGFONT_FIXED 2
7555 
7560 #define SYSLOGFONT_CAPTION 3
7561 
7566 #define SYSLOGFONT_MENU 4
7567 
7572 #define SYSLOGFONT_CONTROL 5
7573 
7574 #define NR_SYSLOGFONTS 6
7575 
7576 
7577 extern MG_EXPORT PLOGFONT g_SysLogFont [];
7578 
7602 static inline PLOGFONT GUIAPI GetSystemFont (int font_id)
7603 {
7604  if (font_id >= 0 && font_id < NR_SYSLOGFONTS)
7605  return g_SysLogFont [font_id];
7606  else
7607  return (PLOGFONT)NULL;
7608 }
7609 
7624 MG_EXPORT int GUIAPI GetSysFontMaxWidth (int font_id);
7625 
7640 MG_EXPORT int GUIAPI GetSysFontAveWidth (int font_id);
7641 
7655 MG_EXPORT int GUIAPI GetSysFontHeight (int font_id);
7656 
7671 MG_EXPORT const char* GUIAPI GetSysCharset (BOOL wchar);
7672 
7687 MG_EXPORT int GUIAPI GetSysCharHeight (void);
7688 
7702 MG_EXPORT int GUIAPI GetSysCharWidth (void);
7703 
7715 MG_EXPORT int GUIAPI GetSysCCharWidth (void);
7716 
7731 {
7733  int len;
7735  unsigned char delimiter;
7738 };
7739 
7759 MG_EXPORT int GUIAPI GetTextMCharInfo (PLOGFONT log_font,
7760  const char* mstr, int len, int* pos_chars);
7761 
7785 MG_EXPORT int GUIAPI GetTextWordInfo (PLOGFONT log_font, const char* mstr,
7786  int len, int* pos_words, WORDINFO* info_words);
7787 
7803 MG_EXPORT int GUIAPI GetFirstMCharLen (PLOGFONT log_font,
7804  const char* mstr, int len);
7805 
7826 MG_EXPORT int GUIAPI GetFirstWord (PLOGFONT log_font,
7827  const char* mstr, int len, WORDINFO* word_info);
7828 
7860 MG_EXPORT int GUIAPI GetTextExtentPoint (HDC hdc, const char* text, int len,
7861  int max_extent, int* fit_chars, int* pos_chars,
7862  int* dx_chars, SIZE* size);
7863 
7872 MG_EXPORT int GUIAPI GetTabbedTextExtentPoint (HDC hdc,
7873  const char* text, int len, int max_extent,
7874  int* fit_chars, int* pos_chars, int* dx_chars, SIZE* size);
7875 
7876 #ifdef _MGCHARSET_UNICODE
7877 
7878 #include <stddef.h>
7879 #include <stdlib.h>
7880 
7901 MG_EXPORT int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32,
7902  const unsigned char* mstr, int n);
7903 
7910 #define MB2WC(log_font, dest, mstr, n) \
7911  MB2WCEx (log_font, dest, sizeof(wchar_t) == 4, mstr, n)
7912 
7930 MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, Uchar32 wc);
7931 
7938 #define WC2MB(log_font, s, wc) \
7939  WC2MBEx (log_font, s, (Uchar32)wc)
7940 
7973 MG_EXPORT int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32,
7974  const unsigned char* mstr, int mstr_len, int n,
7975  int* conved_mstr_len);
7976 
7983 #define MBS2WCS(log_font, dest, mstr, mstr_len, n) \
7984  MBS2WCSEx(log_font, dest, sizeof (wchar_t) == 4, mstr, \
7985  mstr_len, n, NULL)
7986 
8019 MG_EXPORT int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest,
8020  const void *wcs, int wcs_len, BOOL wc32, int n,
8021  int* conved_wcs_len);
8022 
8029 #define WCS2MBS(log_font, dest, wcs, wcs_len, n) \
8030  WCS2MBSEx (log_font, dest, wcs, wcs_len, sizeof (wchar_t) == 4, \
8031  n, NULL)
8032 
8033 #endif /* _MGCHARSET_UNICODE */
8034 
8057 
8066 
8078 
8079 #define BIDI_FLAG_SHAPE_MIRRORING 0x00000001
8080 #define BIDI_FLAG_REORDER_NSM 0x00000002
8081 #define BIDI_FLAG_SHAPE_ARAB_PRES 0x00000100
8082 #define BIDI_FLAG_SHAPE_ARAB_LIGA 0x00000200
8083 #define BIDI_FLAG_SHAPE_ARAB_CONSOLE 0x00000400
8084 
8085 #define BIDI_FLAGS_DEFAULT \
8086  (BIDI_FLAG_REORDER_NSM | BIDI_FLAG_REMOVE_SPECIALS)
8087 
8088 #define BIDI_FLAGS_ARABIC \
8089  (BIDI_FLAG_SHAPE_ARAB_PRES | BIDI_FLAG_SHAPE_ARAB_LIGA)
8090 
8091 #define BIDI_FLAG_REMOVE_BIDI 0x00010000
8092 #define BIDI_FLAG_REMOVE_JOINING 0x00020000
8093 #define BIDI_FLAG_REMOVE_SPECIALS 0x00040000
8094 
8095 #define BIDI_BRACKET_NONE 0
8096 #define BIDI_BRACKET_OPEN_MASK 0x80000000
8097 #define BIDI_BRACKET_CHAR_MASK 0X7FFFFFFF
8098 #define BIDI_IS_BRACKET_OPEN(bt) ((bt & BIDI_BRACKET_OPEN_MASK)>0)
8099 #define BIDI_BRACKET_CHAR(bt) ((bt & BIDI_BRACKET_CHAR_MASK))
8100 
8101 /*
8102  * Define some bit masks, that character types are based on, each one has
8103  * only one bit on.
8104  */
8105 
8106 #define BIDI_TYPE_INVALID 0x0000
8107 
8108 #define BIDI_MASK_RTL 0x0001 /* Is right to left */
8109 #define BIDI_MASK_ARABIC 0x0002 /* Is arabic */
8110 #define BIDI_MASK_FIRST 0x0004 /* Is direction is determined by first strong */
8111 #define BIDI_MASK_SEPARATOR 0x0008 /* Is separator: BS, SS */
8112 
8113 #define BIDI_MASK_STRONG 0x0010 /* Is strong */
8114 #define BIDI_MASK_WEAK 0x0020 /* Is weak */
8115 #define BIDI_MASK_NEUTRAL 0x0040 /* Is neutral */
8116 #define BIDI_MASK_SENTINEL 0x0080 /* Is sentinel: SOT, EOT */
8117 
8118 /* Each char can be only one of the seven following: */
8119 #define BIDI_MASK_LETTER 0x0100 /* Is letter: L, R, AL */
8120 #define BIDI_MASK_NUMBER 0x0200 /* Is number: EN, AN */
8121 #define BIDI_MASK_NUMSEPTER 0x0300 /* Is number separator or terminator: ES, ET, CS */
8122 #define BIDI_MASK_SPACE 0x0400 /* Is space: BN, BS, SS, WS */
8123 #define BIDI_MASK_EXPLICIT 0x0500 /* Is expilict mark: LRE, RLE, LRO, RLO, PDF */
8124 #define BIDI_MASK_ISOLATE 0x0600 /* Is isolate mark: LRI, RLI, FSI, PDI */
8125 #define BIDI_MASK_NSM 0x0700 /* Is non spacing mark: NSM */
8126 # define BIDI_TYPE_MASK 0x0700
8127 
8128 #define BIDI_MASK_OVERRIDE 0x8000 /* Is explicit override: LRO, RLO */
8129 
8130 /* Each char can be only one of the seven following: */
8131 #define BIDI_MASK_ES 0x1000
8132 #define BIDI_MASK_CS 0x2000
8133 #define BIDI_MASK_ET 0x3000
8134 #define BIDI_MASK_BS 0x4000
8135 #define BIDI_MASK_SS 0x5000
8136 #define BIDI_MASK_BN 0x6000
8137 #define BIDI_MASK_WS 0x7000
8138 # define BIDI_MISC_MASK 0x7000
8139 
8140 /* Reserved for private use */
8141 #define BIDI_MASK_PRIVATE 0x8000
8142 
8147 #define BIDI_TYPE_LTR \
8148  (BIDI_MASK_STRONG | BIDI_MASK_LETTER)
8149 
8154 #define BIDI_TYPE_RTL \
8155  (BIDI_MASK_STRONG | BIDI_MASK_LETTER | BIDI_MASK_RTL)
8156 
8161 #define BIDI_TYPE_AL \
8162  (BIDI_MASK_STRONG | BIDI_MASK_LETTER | BIDI_MASK_RTL | BIDI_MASK_ARABIC)
8163 
8168 #define BIDI_TYPE_LRE \
8169  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT)
8170 
8175 #define BIDI_TYPE_RLE \
8176  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_RTL)
8177 
8182 #define BIDI_TYPE_LRO \
8183  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_OVERRIDE)
8184 
8189 #define BIDI_TYPE_RLO \
8190  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_RTL | BIDI_MASK_OVERRIDE)
8191 
8196 #define BIDI_TYPE_PDF \
8197  (BIDI_MASK_WEAK | BIDI_MASK_EXPLICIT)
8198 
8203 #define BIDI_TYPE_EN \
8204  (BIDI_MASK_WEAK | BIDI_MASK_NUMBER)
8205 
8210 #define BIDI_TYPE_AN \
8211  (BIDI_MASK_WEAK | BIDI_MASK_NUMBER | BIDI_MASK_ARABIC)
8212 
8217 #define BIDI_TYPE_ES \
8218  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_ES)
8219 
8224 #define BIDI_TYPE_ET \
8225  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_ET)
8226 
8231 #define BIDI_TYPE_CS \
8232  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_CS)
8233 
8238 #define BIDI_TYPE_NSM \
8239  (BIDI_MASK_WEAK | BIDI_MASK_NSM)
8240 
8245 #define BIDI_TYPE_BN \
8246  (BIDI_MASK_WEAK | BIDI_MASK_SPACE | BIDI_MASK_BN)
8247 
8252 #define BIDI_TYPE_BS \
8253  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_SEPARATOR | BIDI_MASK_BS)
8254 
8259 #define BIDI_TYPE_SS \
8260  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_SEPARATOR | BIDI_MASK_SS)
8261 
8266 #define BIDI_TYPE_WS \
8267  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_WS)
8268 
8273 #define BIDI_TYPE_ON \
8274  (BIDI_MASK_NEUTRAL)
8275 
8280 #define BIDI_TYPE_LRI \
8281  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE)
8282 
8287 #define BIDI_TYPE_RLI \
8288  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE | BIDI_MASK_RTL)
8289 
8294 #define BIDI_TYPE_FSI \
8295  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE | BIDI_MASK_FIRST)
8296 
8301 #define BIDI_TYPE_PDI \
8302  (BIDI_MASK_NEUTRAL | BIDI_MASK_WEAK | BIDI_MASK_ISOLATE)
8303 
8304 #define BIDI_TYPE_SENTINEL (BIDI_MASK_SENTINEL)
8305 
8306 /* The following are only used internally */
8307 
8308 /* Weak Left-To-Right */
8309 #define BIDI_TYPE_WLTR (BIDI_MASK_WEAK)
8310 /* Weak Right-To-Left */
8311 #define BIDI_TYPE_WRTL (BIDI_MASK_WEAK | BIDI_MASK_RTL)
8312 
8313 /* Start of text */
8314 #define BIDI_TYPE_SOT (BIDI_MASK_SENTINEL)
8315 /* End of text */
8316 #define BIDI_TYPE_EOT (BIDI_MASK_SENTINEL | BIDI_MASK_RTL)
8317 
8318 #define BIDI_TYPE_PRIVATE (BIDI_MASK_PRIVATE)
8319 
8320 /* Is private-use value? */
8321 #define BIDI_IS_PRIVATE(p) ((p) & BIDI_MASK_PRIVATE)
8322 
8323 /* Is right to left? */
8324 #define BIDI_IS_RTL(p) ((p) & BIDI_MASK_RTL)
8325 
8326 /* Is arabic? */
8327 #define BIDI_IS_ARABIC(p) ((p) & BIDI_MASK_ARABIC)
8328 
8329 /* Is right-to-left level? */
8330 #define BIDI_LEVEL_IS_RTL(lev) ((lev) & 1)
8331 
8332 /* Return the bidi type corresponding to the direction of the level number,
8333  BIDI_TYPE_LTR for evens and BIDI_TYPE_RTL for odds. */
8334 #define BIDI_LEVEL_TO_DIR(lev) \
8335  (BIDI_LEVEL_IS_RTL(lev) ? BIDI_TYPE_RTL : BIDI_TYPE_LTR)
8336 
8337 /* Return the minimum level of the direction, 0 for BIDI_TYPE_LTR and
8338  1 for BIDI_TYPE_RTL and BIDI_TYPE_AL. */
8339 #define BIDI_DIR_TO_LEVEL(dir) \
8340  ((BidiLevel) (BIDI_IS_RTL(dir) ? 1 : 0))
8341 
8342 /* Is strong? */
8343 #define BIDI_IS_STRONG(p) ((p) & BIDI_MASK_STRONG)
8344 /* Is weak? */
8345 #define BIDI_IS_WEAK(p) ((p) & BIDI_MASK_WEAK)
8346 /* Is neutral? */
8347 #define BIDI_IS_NEUTRAL(p) ((p) & BIDI_MASK_NEUTRAL)
8348 /* Is sentinel? */
8349 #define BIDI_IS_SENTINEL(p) ((p) & BIDI_MASK_SENTINEL)
8350 
8351 /* Is letter: L, R, AL? */
8352 #define BIDI_IS_LETTER(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_LETTER)
8353 
8354 /* Is number: EN, AN? */
8355 #define BIDI_IS_NUMBER(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NUMBER)
8356 
8357 /* Is number separator or terminator: ES, ET, CS? */
8358 #define BIDI_IS_NUMBER_SEPARATOR_OR_TERMINATOR(p) \
8359  (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NUMSEPTER)
8360 
8361 /* Is space: BN, BS, SS, WS? */
8362 #define BIDI_IS_SPACE(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_SPACE)
8363 /* Is explicit mark: LRE, RLE, LRO, RLO, PDF? */
8364 #define BIDI_IS_EXPLICIT(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT)
8365 
8366 /* Is test separator: BS, SS? */
8367 #define BIDI_IS_SEPARATOR(p) ((p) & BIDI_MASK_SEPARATOR)
8368 
8369 /* Is explicit override: LRO, RLO? */
8370 #define BIDI_IS_OVERRIDE(p) ((p) & BIDI_MASK_OVERRIDE)
8371 
8372 /* Is isolote: LRO, RLO? */
8373 #define BIDI_IS_ISOLATE(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_ISOLATE)
8374 
8375 /* Is left to right letter: LTR? */
8376 #define BIDI_IS_LTR_LETTER(p) \
8377  ((p) & (BIDI_MASK_LETTER | BIDI_MASK_RTL) == BIDI_MASK_LETTER)
8378 
8379 /* Is right to left letter: RTL, AL? */
8380 #define BIDI_IS_RTL_LETTER(p) \
8381  ((p) & (BIDI_MASK_LETTER | BIDI_MASK_RTL) \
8382  == (BIDI_MASK_LETTER | BIDI_MASK_RTL))
8383 
8384 /* Is ES or CS: ES, CS? */
8385 #define BIDI_IS_ES_OR_CS(p) \
8386  (((p) & BIDI_MISC_MASK) == BIDI_MASK_ES || \
8387  ((p) & BIDI_MISC_MASK) == BIDI_MASK_CS)
8388 
8389 /* Change numbers: EN, AN to RTL. */
8390 #define BIDI_NUMBER_TO_RTL(p) \
8391  (BIDI_IS_NUMBER(p) ? BIDI_TYPE_RTL : (p))
8392 
8393 /* Is explicit or BN: LRE, RLE, LRO, RLO, PDF, BN? */
8394 #define BIDI_IS_EXPLICIT_OR_BN(p) \
8395  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
8396  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN))
8397 
8398 /* Is explicit or BN or WS: LRE, RLE, LRO, RLO, PDF, BN, WS? */
8399 #define BIDI_IS_EXPLICIT_OR_BN_OR_WS(p) \
8400  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
8401  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN) || \
8402  (((p) & BIDI_MISC_MASK) == BIDI_MASK_WS))
8403 
8404 /* Is explicit or separator or BN or WS: LRE, RLE, LRO, RLO, PDF, BS, SS, BN, WS? */
8405 #define BIDI_IS_EXPLICIT_OR_SEPARATOR_OR_BN_OR_WS(p) \
8406  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
8407  ((p) & BIDI_MASK_SEPARATOR) || \
8408  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN) || \
8409  (((p) & BIDI_MISC_MASK) == BIDI_MASK_WS))
8410 
8411 /* Is explicit or BN or NSM: LRE, RLE, LRO, RLO, PDF, BN, NSM? */
8412 #define BIDI_IS_EXPLICIT_OR_BN_OR_NSM(p) \
8413  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
8414  (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NSM) || \
8415  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN))
8416 
8417 /* Override status of an explicit mark:
8418  * LRO,LRE->LTR, RLO,RLE->RTL, otherwise->ON. */
8419 #define BIDI_EXPLICIT_TO_OVERRIDE_DIR(p) \
8420  (BIDI_IS_OVERRIDE(p) ? BIDI_LEVEL_TO_DIR(BIDI_DIR_TO_LEVEL(p)) \
8421  : BIDI_TYPE_ON)
8422 
8423 /* Change numbers to RTL: EN,AN -> RTL. */
8424 #define BIDI_CHANGE_NUMBER_TO_RTL(p) \
8425  (BIDI_IS_NUMBER(p) ? BIDI_TYPE_RTL : (p))
8426 
8427 #define BIDI_PGDIR_LTR BIDI_TYPE_LTR
8428 #define BIDI_PGDIR_RTL BIDI_TYPE_RTL
8429 #define BIDI_PGDIR_WLTR BIDI_TYPE_WLTR
8430 #define BIDI_PGDIR_WRTL BIDI_TYPE_WRTL
8431 #define BIDI_PGDIR_ON BIDI_TYPE_ON
8432 
8433 /*
8434  * Define bit masks that joining types are based on, each mask has
8435  * only one bit set.
8436  */
8437 #define BIDI_MASK_JOINS_RIGHT 0x01 /* May join to right */
8438 #define BIDI_MASK_JOINS_LEFT 0x02 /* May join to right */
8439 #define BIDI_MASK_ARAB_SHAPES 0x04 /* May Arabic shape */
8440 #define BIDI_MASK_TRANSPARENT 0x08 /* Is transparent */
8441 #define BIDI_MASK_IGNORED 0x10 /* Is ignored */
8442 #define BIDI_MASK_LIGATURED 0x20 /* Is ligatured */
8443 
8444 /*
8445  * Define values for BidiJoiningType
8446  */
8447 
8448 /* nUn-joining */
8449 #define BIDI_JOINING_TYPE_U_VAL ( 0 )
8450 
8451 /* Right-joining */
8452 #define BIDI_JOINING_TYPE_R_VAL \
8453  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_ARAB_SHAPES )
8454 
8455 /* Dual-joining */
8456 #define BIDI_JOINING_TYPE_D_VAL \
8457  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
8458  | BIDI_MASK_ARAB_SHAPES )
8459 
8460 /* join-Causing */
8461 #define BIDI_JOINING_TYPE_C_VAL \
8462  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT )
8463 
8464 /* Left-joining */
8465 #define BIDI_JOINING_TYPE_L_VAL \
8466  ( BIDI_MASK_JOINS_LEFT | BIDI_MASK_ARAB_SHAPES )
8467 
8468 /* Transparent */
8469 #define BIDI_JOINING_TYPE_T_VAL \
8470  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_ARAB_SHAPES )
8471 
8472 /* iGnored */
8473 #define BIDI_JOINING_TYPE_G_VAL ( BIDI_MASK_IGNORED )
8474 
8475 /*
8476  * The equivalent of JoiningType values for ArabicProp
8477  */
8478 
8479 /* Primary Arabic Joining Classes (Table 8-2) */
8480 
8481 /* nUn-joining */
8482 #define BIDI_IS_JOINING_TYPE_U(p) \
8483  ( 0 == ( (p) & \
8484  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8485  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
8486 
8487 /* Right-joining */
8488 #define BIDI_IS_JOINING_TYPE_R(p) \
8489  ( BIDI_MASK_JOINS_RIGHT == ( (p) & \
8490  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8491  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
8492 
8493 /* Dual-joining */
8494 #define BIDI_IS_JOINING_TYPE_D(p) \
8495  ( ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
8496  | BIDI_MASK_ARAB_SHAPES ) == ( (p) & \
8497  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8498  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
8499  | BIDI_MASK_ARAB_SHAPES ) ) )
8500 
8501 /* join-Causing */
8502 #define BIDI_IS_JOINING_TYPE_C(p) \
8503  ( ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) == ( (p) & \
8504  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8505  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
8506  | BIDI_MASK_ARAB_SHAPES ) ) )
8507 
8508 /* Left-joining */
8509 #define BIDI_IS_JOINING_TYPE_L(p) \
8510  ( BIDI_MASK_JOINS_LEFT == ( (p) & \
8511  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8512  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
8513 
8514 /* Transparent */
8515 #define BIDI_IS_JOINING_TYPE_T(p) \
8516  ( BIDI_MASK_TRANSPARENT == ( (p) & \
8517  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED ) ) )
8518 
8519 /* iGnored */
8520 #define BIDI_IS_JOINING_TYPE_G(p) \
8521  ( BIDI_MASK_IGNORED == ( (p) & \
8522  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED ) ) )
8523 
8524 /* and for Derived Arabic Joining Classes (Table 8-3) */
8525 
8526 /* Right join-Causing */
8527 #define BIDI_IS_JOINING_TYPE_RC(p) \
8528  ( BIDI_MASK_JOINS_RIGHT == ( (p) & \
8529  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8530  | BIDI_MASK_JOINS_RIGHT ) ) )
8531 
8532 /* Left join-Causing */
8533 #define BIDI_IS_JOINING_TYPE_LC(p) \
8534  ( BIDI_MASK_JOINS_LEFT == ( (p) & \
8535  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8536  | BIDI_MASK_JOINS_LEFT ) ) )
8537 
8538 /*
8539  * Defining macros for needed queries, It is fully dependent on the
8540  * implementation of BidiJoiningType.
8541  */
8542 
8543 /* Joins to right: R, D, C? */
8544 #define BIDI_JOINS_RIGHT(p) ((p) & BIDI_MASK_JOINS_RIGHT)
8545 
8546 /* Joins to left: L, D, C? */
8547 #define BIDI_JOINS_LEFT(p) ((p) & BIDI_MASK_JOINS_LEFT)
8548 
8549 /* May shape: R, D, L, T? */
8550 #define BIDI_ARAB_SHAPES(p) ((p) & BIDI_MASK_ARAB_SHAPES)
8551 
8552 /* Is skipped in joining: T, G? */
8553 #define BIDI_IS_JOIN_SKIPPED(p) \
8554  ((p) & (BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED))
8555 
8556 /* Is base that will be shaped: R, D, L? */
8557 #define BIDI_IS_JOIN_BASE_SHAPES(p) \
8558  ( BIDI_MASK_ARAB_SHAPES == ( (p) & \
8559  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8560  | BIDI_MASK_ARAB_SHAPES ) ) )
8561 
8562 #define BIDI_JOINS_PRECEDING_MASK(level) \
8563  (BIDI_LEVEL_IS_RTL (level) ? BIDI_MASK_JOINS_RIGHT \
8564  : BIDI_MASK_JOINS_LEFT)
8565 
8566 #define BIDI_JOINS_FOLLOWING_MASK(level) \
8567  (BIDI_LEVEL_IS_RTL (level) ? BIDI_MASK_JOINS_LEFT \
8568  : BIDI_MASK_JOINS_RIGHT)
8569 
8570 #define BIDI_JOIN_SHAPE(p) \
8571  ((p) & ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ))
8572 
8575 #ifdef _MGCHARSET_UNICODE
8576 
8598 MG_EXPORT UCharGeneralCategory GUIAPI UCharGetCategory(Uchar32 uc);
8599 
8615 MG_EXPORT UCharBreakType GUIAPI UCharGetBreakType(Uchar32 uc);
8616 
8635 MG_EXPORT BidiType GUIAPI UCharGetBidiType(Uchar32 uc);
8636 
8653 MG_EXPORT void GUIAPI UStrGetBidiTypes(const Uchar32* ucs, int nr_ucs,
8654  BidiType* bdts);
8655 
8681 MG_EXPORT BidiBracketType GUIAPI UCharGetBracketType(Uchar32 ch);
8682 
8703 MG_EXPORT void GUIAPI UStrGetBracketTypes(const Uchar32 *ucs,
8704  const BidiType *bidi_types, int len_ucs,
8705  BidiBracketType *bracket_types);
8706 
8729 MG_EXPORT BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32* mirrored);
8730 
8755 MG_EXPORT BidiJoiningType GUIAPI UCharGetJoiningType(Uchar32 uc);
8756 
8775 MG_EXPORT void GUIAPI UStrGetJoiningTypes(const Uchar32 *ucs, int nr_ucs,
8776  BidiJoiningType *joining_types);
8777 
8804 MG_EXPORT BidiType GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len);
8805 
8845 MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevels(
8846  const BidiType *bidi_types,
8847  const BidiBracketType* bracket_types, int len,
8848  ParagraphDir *paragraph_dir, BidiLevel *embedding_levels);
8849 
8885 MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevelsAlt(
8886  const Uchar32* ucs, int nr_ucs,
8887  ParagraphDir *paragraph_dir, BidiLevel *embedding_levels);
8888 
8889 /*
8890  * \var typedef void (*CB_REVERSE_ARRAY) (void* extra, int len, int pos)
8891  * \brief The prototype of the user defined function to reverse an array.
8892  *
8893  * The function reverse an array pointed by \a extra from the position
8894  * specified by \a pos for the length specified by \a len.
8895  *
8896  * \sa UBidiReorderLine, BIDILogAChars2VisACharsEx
8897  */
8898 typedef void (*CB_REVERSE_ARRAY) (void* extra, int len, int pos);
8899 
8959 MG_EXPORT BidiLevel GUIAPI UBidiReorderLine(Uint32 bidi_flags,
8960  const BidiType *bidi_types, int len, int off,
8961  ParagraphDir paragraph_dir, BidiLevel *embedding_levels,
8962  Uchar32 *visual_str, int *indices_map,
8963  void* extra, CB_REVERSE_ARRAY cb_reverse_extra);
8964 
8987 MG_EXPORT void GUIAPI UBidiShapeMirroring(const BidiLevel *embedding_levels,
8988  int len, Uchar32* ucs);
8989 
9023 MG_EXPORT void GUIAPI UBidiJoinArabic(const BidiType *bidi_types,
9024  const BidiLevel *embedding_levels, int len,
9025  BidiArabicProp *ar_props);
9026 
9064 MG_EXPORT void GUIAPI UBidiShapeArabic(Uint32 shaping_flags,
9065  const BidiLevel *embedding_levels, int len,
9066  BidiArabicProp *ar_props, Uchar32* ucs);
9067 
9100 MG_EXPORT void GUIAPI UBidiShape(Uint32 shaping_flags,
9101  const BidiLevel *embedding_levels, int len,
9102  BidiArabicProp *ar_props, Uchar32* ucs);
9103 
9122 #define CTR_NONE 0x00
9123 
9124 #define CTR_CASE_MASK 0x0F
9125 
9132 #define CTR_CAPITALIZE 0x01
9133 
9139 #define CTR_UPPERCASE 0x02
9140 
9146 #define CTR_LOWERCASE 0x03
9147 
9156 #define CTR_FULL_WIDTH 0x10
9157 
9167 #define CTR_FULL_SIZE_KANA 0x20
9168 
9186 #define WBR_NORMAL 0x00
9187 
9193 #define WBR_BREAK_ALL 0x01
9194 
9200 #define WBR_KEEP_ALL 0x02
9201 
9219 #define LBP_NORMAL 0x00
9220 
9227 #define LBP_LOOSE 0x01
9228 
9234 #define LBP_STRICT 0x02
9235 
9246 #define LBP_ANYWHERE 0x03
9247 
9266 #define BOV_UNKNOWN 0x0000
9267 
9270 #define BOV_WHITESPACE 0x8000
9271 
9274 #define BOV_EXPANDABLE_SPACE 0x0800
9275 
9279 #define BOV_ZERO_WIDTH 0x0080
9280 
9281 #define BOV_GB_MASK 0x7000
9282 
9285 #define BOV_GB_CHAR_BREAK 0x1000
9286 
9290 #define BOV_GB_CURSOR_POS 0x2000
9291 
9295 #define BOV_GB_BACKSPACE_DEL_CH 0x4000
9296 
9297 #define BOV_WB_MASK 0x0700
9298 
9301 #define BOV_WB_WORD_BOUNDARY 0x0100
9302 
9305 #define BOV_WB_WORD_START 0x0200
9306 
9309 #define BOV_WB_WORD_END 0x0400
9310 
9311 #define BOV_SB_MASK 0x0070
9312 
9315 #define BOV_SB_SENTENCE_BOUNDARY 0x0010
9316 
9319 #define BOV_SB_SENTENCE_START 0x0020
9320 
9323 #define BOV_SB_SENTENCE_END 0x0040
9324 
9325 #define BOV_LB_MASK 0x000F
9326 #define BOV_LB_BREAK_FLAG 0x0004
9327 #define BOV_LB_MANDATORY_FLAG 0x0008
9328 
9331 #define BOV_LB_ALLOWED (BOV_LB_BREAK_FLAG | 0x0001)
9332 
9335 #define BOV_LB_MANDATORY (BOV_LB_BREAK_FLAG | BOV_LB_MANDATORY_FLAG | 0x0002)
9336 
9339 #define BOV_LB_NOTALLOWED 0x0003
9340 
9345 
9407 MG_EXPORT int GUIAPI UStrGetBreaks(LanguageCode lang_code,
9408  Uint8 ctr, Uint8 wbr, Uint8 lbp,
9409  Uchar32* ucs, int nr_ucs, BreakOppo** break_oppos);
9410 
9411 MG_EXPORT void GUIAPI UStrTailorBreaks(ScriptType writing_system,
9412  const Uchar32* ucs, int nr_ucs, BreakOppo* break_oppos);
9413 
9415 MG_EXPORT BOOL GUIAPI IsUCharAlnum(Uchar32 uc);
9416 
9418 MG_EXPORT BOOL GUIAPI IsUCharAlpha(Uchar32 uc);
9419 
9421 MG_EXPORT BOOL GUIAPI IsUCharControl(Uchar32 uc);
9422 
9424 MG_EXPORT BOOL GUIAPI IsUCharDigit(Uchar32 uc);
9425 
9427 MG_EXPORT BOOL GUIAPI IsUCharGraph(Uchar32 uc);
9428 
9430 MG_EXPORT BOOL GUIAPI IsUCharLowercase(Uchar32 uc);
9431 
9433 MG_EXPORT BOOL GUIAPI IsUCharPrint(Uchar32 uc);
9434 
9436 MG_EXPORT BOOL GUIAPI IsUCharUppercase(Uchar32 uc);
9437 
9439 MG_EXPORT BOOL GUIAPI IsUCharPunct(Uchar32 uc);
9440 
9443 MG_EXPORT BOOL GUIAPI IsUCharSpace(Uchar32 uc);
9444 
9447 MG_EXPORT BOOL GUIAPI IsUCharMark(Uchar32 uc);
9448 
9457 MG_EXPORT BOOL GUIAPI IsUCharTitle(Uchar32 uc);
9458 
9460 MG_EXPORT BOOL GUIAPI IsUCharXDigit(Uchar32 uc);
9461 
9463 MG_EXPORT BOOL GUIAPI IsUCharDefined(Uchar32 uc);
9464 
9466 MG_EXPORT BOOL GUIAPI IsUCharZeroWidth(Uchar32 uc);
9467 
9469 MG_EXPORT BOOL GUIAPI IsUCharWide(Uchar32 uc);
9470 
9479 MG_EXPORT BOOL GUIAPI IsUCharWideCJK(Uchar32 uc);
9480 
9482 MG_EXPORT Uchar32 UCharToUpper (Uchar32 uc);
9483 
9485 MG_EXPORT Uchar32 GUIAPI UCharToLower (Uchar32 uc);
9486 
9488 MG_EXPORT Uchar32 GUIAPI UCharToTitle (Uchar32 uc);
9489 
9491 MG_EXPORT Uchar32 GUIAPI UCharToFullWidth (Uchar32 uc);
9492 
9494 MG_EXPORT Uchar32 GUIAPI UCharToSingleWidth (Uchar32 uc);
9495 
9497 MG_EXPORT Uchar32 GUIAPI UCharToFullSizeKana (Uchar32 uc);
9498 
9500 MG_EXPORT Uchar32 GUIAPI UCharToSmallKana (Uchar32 uc);
9501 
9503 MG_EXPORT BOOL GUIAPI UCharIsArabicVowel(Uchar32 uc);
9504 
9506 MG_EXPORT int GUIAPI UCharCombiningClass (Uchar32 uc);
9507 
9514 MG_EXPORT void GUIAPI UCharCanonicalOrdering (Uchar32 *string, int len);
9515 
9517 MG_EXPORT BOOL GUIAPI UCharCompose (Uchar32 a, Uchar32 b, Uchar32 *ch);
9518 
9520 MG_EXPORT BOOL GUIAPI UCharDecompose (Uchar32 ch, Uchar32 *a, Uchar32 *b);
9521 
9532 MG_EXPORT int GUIAPI UCharFullyDecompose (Uchar32 ch, BOOL compat,
9533  Uchar32 *result, int result_len);
9534 
9551 MG_EXPORT ScriptType GUIAPI UCharGetScriptType (Uchar32 ch);
9552 
9578 MG_EXPORT Uint32 GUIAPI ScriptTypeToISO15924 (ScriptType script);
9579 
9605 MG_EXPORT ScriptType GUIAPI ScriptTypeFromISO15924 (Uint32 iso15924);
9606 
9628 static inline ScriptType GUIAPI ScriptTypeFromISO15924Code (const char* iso15924)
9629 {
9630  return ScriptTypeFromISO15924(MAKEDWORD32(iso15924[3],
9631  iso15924[2], iso15924[1], iso15924[0]));
9632 }
9633 
9634 typedef enum _UVerticalOrient {
9635  UCHAR_VOP_U = 0,
9636  UCHAR_VOP_R,
9637  UCHAR_VOP_TU,
9638  UCHAR_VOP_TR,
9639 } UVerticalOrient;
9640 
9641 typedef enum {
9642  GLYPH_RUN_DIR_LTR = 0,
9643  GLYPH_RUN_DIR_RTL,
9644  GLYPH_RUN_DIR_TTB,
9645  GLYPH_RUN_DIR_BTT,
9646 } GlyphRunDir;
9647 
9648 typedef enum {
9649  GLYPH_GRAVITY_SOUTH = 0,
9650  GLYPH_GRAVITY_EAST,
9651  GLYPH_GRAVITY_NORTH,
9652  GLYPH_GRAVITY_WEST,
9653  GLYPH_GRAVITY_AUTO,
9654 } GlyphGravity;
9655 
9656 typedef enum {
9657  GLYPH_GRAVITY_POLICY_NATURAL,
9658  GLYPH_GRAVITY_POLICY_STRONG,
9659  GLYPH_GRAVITY_POLICY_LINE,
9660  GLYPH_GRAVITY_POLICY_MIXED,
9661 } GlyphGravityPolicy;
9662 
9664 MG_EXPORT UVerticalOrient GUIAPI UCharGetVerticalOrientation(Uchar32 uc);
9665 
9686 MG_EXPORT GlyphGravity GUIAPI ScriptGetGlyphGravity(ScriptType script,
9687  BOOL vertical, GlyphGravity base_gravity, GlyphGravityPolicy policy);
9688 
9717 GlyphGravity ScriptGetGlyphGravityForWide (ScriptType script,
9718  BOOL vertical, BOOL wide,
9719  GlyphGravity base_gravity, GlyphGravityPolicy policy);
9720 
9723 #endif /* _MGCHARSET_UNICODE */
9724 
9742 MG_EXPORT int GUIAPI GetFontHeight (HDC hdc);
9743 
9757 MG_EXPORT int GUIAPI GetMaxFontWidth (HDC hdc);
9758 
9759 
9778 MG_EXPORT int GUIAPI GetTextExtent (HDC hdc,
9779  const char* spText, int len, SIZE* pSize);
9780 
9801 MG_EXPORT int GUIAPI GetTabbedTextExtent (HDC hdc,
9802  const char* spText, int len, SIZE* pSize);
9803 
9810 #define GetTextCharacterExtra(hdc) GetDCAttr (hdc, DC_ATTR_CHAR_EXTRA)
9811 
9818 #define GetTextWordExtra(hdc) GetDCAttr (hdc, DC_ATTR_WORD_EXTRA)
9819 
9826 #define GetTextAboveLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_ALINE_EXTRA)
9827 
9834 #define GetTextBellowLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_BLINE_EXTRA)
9835 
9843 #define SetTextCharacterExtra(hdc, extra) \
9844  SetDCAttr (hdc, DC_ATTR_CHAR_EXTRA, (DWORD) extra)
9845 
9853 #define SetTextWordExtra(hdc, extra) \
9854  SetDCAttr (hdc, DC_ATTR_WORD_EXTRA, (DWORD) extra)
9855 
9862 #define SetTextAboveLineExtra(hdc, extra) \
9863  SetDCAttr (hdc, DC_ATTR_ALINE_EXTRA, (DWORD) extra)
9864 
9871 #define SetTextBellowLineExtra(hdc, extra) \
9872  SetDCAttr (hdc, DC_ATTR_BLINE_EXTRA, (DWORD) extra)
9873 
9874 #define TA_LEFT 0x0000
9875 #define TA_RIGHT 0x0001
9876 #define TA_CENTER 0x0002
9877 #define TA_X_MASK 0x000F
9878 
9879 #define TA_TOP 0x0000
9880 #define TA_BASELINE 0x0010
9881 #define TA_BOTTOM 0x0020
9882 #define TA_Y_MASK 0x00F0
9883 
9884 #define TA_NOUPDATECP 0x0000
9885 #define TA_UPDATECP 0x0100
9886 #define TA_CP_MASK 0x0F00
9887 
9939 #define GetTextAlign(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_ALIGN)
9940 
9997 #define SetTextAlign(hdc, ta_flags) \
9998  SetDCAttr (hdc, DC_ATTR_TEXT_ALIGN, (DWORD)ta_flags)
9999 
10000 #define BIDI_FLAG_LTR 0x00
10001 #define BIDI_FLAG_RTL 0x10
10002 
10003 #define GetBIDIFlags(hdc) \
10004  GetDCAttr (hdc, DC_ATTR_BIDI_FLAGS)
10005 
10006 #define SetBIDIFlags(hdc, bidi_flags) \
10007  SetDCAttr (hdc, DC_ATTR_BIDI_FLAGS, (DWORD)bidi_flags)
10008 
10027 MG_EXPORT int GUIAPI TextOutLen (HDC hdc, int x, int y,
10028  const char* spText, int len);
10029 
10030 
10052 MG_EXPORT int GUIAPI TextOutOmitted (HDC hdc, int x, int y,
10053  const char *mtext, int len, int max_extent);
10054 
10076 MG_EXPORT int GUIAPI TabbedTextOutLen (HDC hdc, int x, int y,
10077  const char* spText, int len);
10078 
10105 MG_EXPORT int GUIAPI TabbedTextOutEx (HDC hdc, int x, int y,
10106  const char* spText, int nCount,
10107  int nTabPositions, int *pTabPositions, int nTabOrigin);
10108 
10118 MG_EXPORT void GUIAPI GetLastTextOutPos (HDC hdc, POINT* pt);
10119 
10128 #define TextOut(hdc, x, y, text) TextOutLen (hdc, x, y, text, -1)
10129 
10138 #define TabbedTextOut(hdc, x, y, text) TabbedTextOutLen (hdc, x, y, text, -1)
10139 
10140 #define DT_TOP 0x00000000
10141 #define DT_LEFT 0x00000000
10142 #define DT_CENTER 0x00000001
10143 #define DT_RIGHT 0x00000002
10144 #define DT_VCENTER 0x00000004
10145 #define DT_BOTTOM 0x00000008
10146 #define DT_WORDBREAK 0x00000010
10147 #define DT_SINGLELINE 0x00000020
10148 #define DT_EXPANDTABS 0x00000040
10149 #define DT_TABSTOP 0x00000080
10150 #define DT_NOCLIP 0x00000100
10151 #define DT_EXTERNALLPADING 0x00000200
10152 #define DT_CALCRECT 0x00000400
10153 #define DT_NOPREFIX 0x00000800
10154 #define DT_INTERNAL 0x00001000
10155 #define DT_CHARBREAK 0x00002000
10156 
10160 typedef struct _DTFIRSTLINE
10161 {
10165  int startx;
10167  int starty;
10169  int width;
10171  int height;
10172 } DTFIRSTLINE;
10173 
10249 MG_EXPORT int GUIAPI DrawTextEx2 (HDC hdc, const char* pText, int nCount,
10250  RECT* pRect, int nIndent, UINT nFormat, DTFIRSTLINE *firstline);
10251 
10261 #define DrawText(hdc, text, n, rc, format) \
10262  DrawTextEx2 (hdc, text, n, rc, 0, format, NULL)
10263 
10272 #define DrawTextEx(hdc, text, n, rc, indent, format) \
10273  DrawTextEx2 (hdc, text, n, rc, indent, format, NULL)
10274 
10285 #define MYBMP_TYPE_NORMAL 0x00000000
10286 #define MYBMP_TYPE_RLE4 0x00000001
10287 #define MYBMP_TYPE_RLE8 0x00000002
10288 #define MYBMP_TYPE_RGB 0x00000003
10289 #define MYBMP_TYPE_BGR 0x00000004
10290 #define MYBMP_TYPE_RGBA 0x00000005
10291 #define MYBMP_TYPE_MASK 0x0000000F
10292 
10293 #define MYBMP_FLOW_DOWN 0x00000010
10294 #define MYBMP_FLOW_UP 0x00000020
10295 #define MYBMP_FLOW_MASK 0x000000F0
10296 
10297 #define MYBMP_TRANSPARENT 0x00000100
10298 #define MYBMP_ALPHACHANNEL 0x00000200
10299 #define MYBMP_ALPHA 0x00000400
10300 
10301 #define MYBMP_RGBSIZE_3 0x00001000
10302 #define MYBMP_RGBSIZE_4 0x00002000
10303 
10304 #define MYBMP_LOAD_GRAYSCALE 0x00010000
10305 #define MYBMP_LOAD_ALLOCATE_ONE 0x00020000
10306 #define MYBMP_LOAD_NONE 0x00000000
10307 
10310 {
10342  int frames;
10347  Uint8 reserved [2];
10350 
10359 
10362 };
10363 
10364 #define BMP_TYPE_NORMAL 0x00
10365 #define BMP_TYPE_RLE 0x01
10366 #define BMP_TYPE_ALPHA 0x02
10367 #define BMP_TYPE_ALPHACHANNEL 0x04
10368 #define BMP_TYPE_COLORKEY 0x10
10369 #define BMP_TYPE_ALPHA_MASK 0x20
10370 #define BMP_TYPE_REPLACEKEY 0x40
10371 
10373 struct _BITMAP
10374 {
10418 
10427 
10428  /* Obsolte.
10429  The private pixel format
10430  void* bmAlphaPixelFormat; */
10431 
10434 
10437 };
10438 
10450 #include <stdio.h>
10451 #include "endianrw.h"
10452 
10457 typedef void (* CB_ONE_SCANLINE) (void* context, MYBITMAP* my_bmp, int y);
10458 
10493 MG_EXPORT BOOL GUIAPI RegisterBitmapFileType (const char *ext,
10494  void* (*init) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal),
10495  int (*load) (MG_RWops* fp, void* init_info, MYBITMAP *my_bmp,
10496  CB_ONE_SCANLINE cb, void* context),
10497  void (*cleanup) (void* init_info),
10498  int (*save) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal),
10499  BOOL (*check) (MG_RWops* fp));
10500 
10516 MG_EXPORT const char* GUIAPI CheckBitmapType (MG_RWops* fp);
10517 
10559 #define MLS_BLENDMODE_NONE 0x00
10560 #define MLS_BLENDMODE_COLORKEY 0x01
10561 #define MLS_BLENDMODE_ALPHA 0x02
10562 
10563 #define MLS_INFOMASK_OFFSET 0x01
10564 #define MLS_INFOMASK_BLEND 0x02
10565 #define MLS_INFOMASK_ZORDER 0x04
10566 #define MLS_INFOMASK_ALL 0x07
10567 #define MLS_INFOMASK_ENABLE 0x08
10568 
10569 MG_EXPORT BOOL GUIAPI mlsSetSlaveScreenInfo (HDC dc_mls, DWORD mask, int offset_x, int offset_y,
10570  DWORD blend_flags, gal_pixel color_key, int alpha, int z_order);
10571 
10572 MG_EXPORT BOOL GUIAPI mlsGetSlaveScreenInfo (HDC dc_mls, DWORD mask, int* offset_x, int* offset_y,
10573  DWORD blend_flags, gal_pixel* color_key, int* alpha, int* z_order);
10587 MG_EXPORT BOOL GUIAPI mlsEnableSlaveScreen (HDC dc_mls, BOOL enable);
10588 
10589 
10590 #define ERR_BMP_OK 0
10591 #define ERR_BMP_IMAGE_TYPE -1
10592 #define ERR_BMP_UNKNOWN_TYPE -2
10593 #define ERR_BMP_CANT_READ -3
10594 #define ERR_BMP_CANT_SAVE -4
10595 #define ERR_BMP_NOT_SUPPORTED -5
10596 #define ERR_BMP_MEM -6
10597 #define ERR_BMP_LOAD -7
10598 #define ERR_BMP_FILEIO -8
10599 #define ERR_BMP_OTHER -9
10600 #define ERR_BMP_ERROR_SOURCE -10
10601 
10628 MG_EXPORT int GUIAPI LoadBitmapEx (HDC hdc, PBITMAP pBitmap,
10629  MG_RWops* area, const char* ext);
10630 
10638 MG_EXPORT int GUIAPI LoadBitmapFromFile (HDC hdc, PBITMAP pBitmap,
10639  const char* spFileName);
10640 
10647 #define LoadBitmap LoadBitmapFromFile
10648 
10656 MG_EXPORT int GUIAPI LoadBitmapFromMem (HDC hdc, PBITMAP pBitmap,
10657  const void* mem, int size, const char* ext);
10658 
10670 MG_EXPORT void GUIAPI UnloadBitmap (PBITMAP pBitmap);
10671 
10690 MG_EXPORT int GUIAPI SetBitmapKeyColor (HDC hdc, PBITMAP bmp, Uint8 r, Uint8 g, Uint8 b);
10691 
10706 MG_EXPORT void GUIAPI ReplaceBitmapColor (HDC hdc, PBITMAP pBitmap,
10707  gal_pixel iOColor, gal_pixel iNColor);
10708 
10718 MG_EXPORT void GUIAPI HFlipBitmap (BITMAP* bmp, unsigned char* inter_buff);
10719 
10729 MG_EXPORT void GUIAPI VFlipBitmap (BITMAP* bmp, unsigned char* inter_buff);
10730 
10749 MG_EXPORT void* GUIAPI InitMyBitmapSL (MG_RWops* area,
10750  const char* ext, MYBITMAP* my_bmp, RGB* pal);
10751 
10770 MG_EXPORT int GUIAPI LoadMyBitmapSL (MG_RWops* area, void* load_info,
10771  MYBITMAP* my_bmp, CB_ONE_SCANLINE cb, void* context);
10772 
10787 MG_EXPORT int GUIAPI CleanupMyBitmapSL (MYBITMAP* my_bmp, void* load_info);
10788 
10804 MG_EXPORT int GUIAPI LoadMyBitmapEx (PMYBITMAP my_bmp, RGB* pal,
10805  MG_RWops* area, const char* ext);
10806 
10814 MG_EXPORT int GUIAPI LoadMyBitmapFromFile (PMYBITMAP my_bmp, RGB* pal,
10815  const char* file_name);
10816 
10823 #define LoadMyBitmap LoadMyBitmapFromFile
10824 
10840 MG_EXPORT int GUIAPI LoadMyBitmapFromMem (PMYBITMAP my_bmp, RGB* pal,
10841  const void* mem, int size, const char* ext);
10842 
10854 MG_EXPORT void GUIAPI UnloadMyBitmap (PMYBITMAP my_bmp);
10855 
10856 #ifdef _MGMISC_SAVEBITMAP
10857 
10874 MG_EXPORT int GUIAPI SaveMyBitmapToFile (PMYBITMAP my_bmp, RGB* pal,
10875  const char* spFileName);
10876 
10892 MG_EXPORT int GUIAPI SaveBitmapToFile (HDC hdc, PBITMAP pBitmap,
10893  const char* spFileName);
10894 #define SaveBitmap SaveBitmapToFile
10895 #endif
10896 
10918 MG_EXPORT BOOL GUIAPI InitBitmap (HDC hdc, Uint32 w, Uint32 h, Uint32 pitch,
10919  BYTE* bits, PBITMAP bmp);
10920 
10932 MG_EXPORT HDC GUIAPI InitSlaveScreenEx (const char* name, const char* mode, int dpi);
10933 
10943 static inline HDC InitSlaveScreen (const char* name, const char* mode)
10944 {
10945  return InitSlaveScreenEx(name, mode, GDCAP_DPI_DEFAULT);
10946 }
10947 
10955 MG_EXPORT void GUIAPI TerminateSlaveScreen (HDC hdc);
10971 MG_EXPORT BOOL GUIAPI InitBitmapPixelFormat (HDC hdc, PBITMAP bmp);
10972 
10982 MG_EXPORT void GUIAPI DeleteBitmapAlphaPixel (PBITMAP bmp);
10983 
10984 /* Everything in the pixel format structure is read-only */
10985 typedef struct GAL_PixelFormat {
10986  GAL_Palette *palette;
10987 
10988  Uint8 BitsPerPixel;
10989  Uint8 BytesPerPixel;
10990  /* The flag indicating dithered palette */
10991  Uint8 DitheredPalette;
10992  /* The flag indicating the Most Significant Bits (MSB)
10993  * is left when depth is less than 8. */
10994  Uint8 MSBLeft;
10995 
10996  Uint8 Rloss;
10997  Uint8 Gloss;
10998  Uint8 Bloss;
10999  Uint8 Aloss;
11000  Uint8 Rshift;
11001  Uint8 Gshift;
11002  Uint8 Bshift;
11003  Uint8 Ashift;
11004  Uint32 Rmask;
11005  Uint32 Gmask;
11006  Uint32 Bmask;
11007  Uint32 Amask;
11008 
11009  /* RGB color key information */
11010  gal_pixel colorkey;
11011  /* Alpha value information (per-surface alpha) */
11012  gal_uint8 alpha;
11013 } GAL_PixelFormat;
11014 
11015 #define _FILL_MYBITMAP
11016 
11017 #ifndef MYBITMAP_CONTXT
11018 typedef struct _MYBITMAP_CONTXT{
11019  Uint32 colorKey;
11020  Uint32 pitch;
11021  GAL_PixelFormat* AlphaPixelFormat;
11022  MYBITMAP* mybmp;
11023 }MYBITMAP_CONTXT;
11024 #endif
11025 
11026 typedef BYTE* (* CB_DRAW_PIXEL) (HDC hdc, MYBITMAP_CONTXT* mybmp, Uint32 pixel, BYTE* dest);
11027 
11043 MG_EXPORT int GUIAPI ExpandMyBitmap (HDC hdc, PBITMAP bmp,
11044  const MYBITMAP* my_bmp, const RGB* pal, int frame);
11045 
11068 MG_EXPORT void GUIAPI ExpandMonoBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11069  const BYTE* my_bits, Uint32 my_pitch,
11070  Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg);
11071 
11072 MG_EXPORT void GUIAPI Expand16CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11073  const BYTE* my_bits, Uint32 my_pitch,
11074  Uint32 w, Uint32 h, DWORD flags,
11075  const RGB* pal, BYTE use_pal_alpha, BYTE alpha);
11076 
11098 static inline void GUIAPI Expand16CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11099  const BYTE* my_bits, Uint32 my_pitch,
11100  Uint32 w, Uint32 h, DWORD flags, const RGB* pal)
11101 {
11102  Expand16CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11103  w, h, flags, pal, FALSE, 0xFF);
11104 }
11105 
11106 MG_EXPORT void GUIAPI Expand256CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11107  const BYTE* my_bits, Uint32 my_pitch,
11108  Uint32 w, Uint32 h, DWORD flags,
11109  const RGB* pal, BYTE use_pal_alpha, BYTE alpha,
11110  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11135 static inline void GUIAPI Expand256CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11136  const BYTE* my_bits, Uint32 my_pitch,
11137  Uint32 w, Uint32 h, DWORD flags, const RGB* pal,
11138  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp)
11139 {
11140  Expand256CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11141  w, h, flags, pal, FALSE, 0xFF, cb_draw, mybmp);
11142 }
11143 
11167 MG_EXPORT void GUIAPI CompileRGBABitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11168  const BYTE* my_bits, Uint32 my_pitch,
11169  Uint32 w, Uint32 h, DWORD flags, void* pixel_format,
11170  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11171 
11184 MG_EXPORT void GUIAPI CompileRGBABitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11185  const BYTE* my_bits, Uint32 my_pitch,
11186  Uint32 w, Uint32 h, DWORD flags, void* pixel_format,
11187  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp,
11188  BYTE* alpha_mask);
11189 
11190 #ifdef _FILL_MYBITMAP
11191 MG_EXPORT int GUIAPI FillBoxWithMyBitmap (HDC hdc, int x, int y, MYBITMAP* mybmp, RGB* pal);
11192 
11193 MG_EXPORT void GUIAPI ExpandPartMonoBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11194  const BYTE* my_bits, Uint32 my_pitch,
11195  Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg,
11196  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11197 
11198 MG_EXPORT void GUIAPI ExpandPart16CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11199  const BYTE* my_bits, Uint32 my_pitch,
11200  Uint32 w, Uint32 h, DWORD flags,
11201  const RGB* pal, BYTE use_pal_alpha, BYTE alpha,
11202  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11203 
11204 static inline void GUIAPI ExpandPart16CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11205  const BYTE* my_bits, Uint32 my_pitch,
11206  Uint32 w, Uint32 h, DWORD flags, const RGB* pal,
11207  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp)
11208 {
11209  ExpandPart16CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11210  w, h, flags, pal, FALSE, 0xFF, stepx, cb_draw, mybmp);
11211 }
11212 
11213 #endif
11214 
11215 #define CompileRGBBitmap CompileRGBABitmap
11216 
11245 MG_EXPORT int GUIAPI PaintImageEx (HDC hdc, int x, int y,
11246  MG_RWops* area, const char* ext);
11247 
11262 MG_EXPORT int GUIAPI PaintImageFromFile (HDC hdc, int x, int y,
11263  const char* spFileName);
11264 
11281 MG_EXPORT int GUIAPI PaintImageFromMem (HDC hdc, int x, int y,
11282  const void* mem, int size, const char* ext);
11283 
11315 MG_EXPORT int GUIAPI StretchPaintImageEx (HDC hdc, int x, int y, int w, int h,
11316  MG_RWops* area, const char* ext);
11317 
11334 MG_EXPORT int GUIAPI StretchPaintImageFromFile (HDC hdc, int x, int y,
11335  int w, int h, const char* spFileName);
11336 
11355 MG_EXPORT int GUIAPI StretchPaintImageFromMem (HDC hdc, int x, int y,
11356  int w, int h, const void* mem, int size, const char* ext);
11357 
11358 #ifdef _MGHAVE_FIXED_MATH
11359 
11375 MG_EXPORT void GUIAPI RotateBitmap (HDC hdc, const BITMAP *bmp,
11376  int lx, int ty, int angle);
11377 
11388 MG_EXPORT void GUIAPI RotateBitmapVFlip (HDC hdc, const BITMAP *bmp,
11389  int lx, int ty, int angle);
11390 
11399 MG_EXPORT void GUIAPI RotateBitmapHFlip (HDC hdc, const BITMAP *bmp,
11400  int lx, int ty, int angle);
11401 
11410 MG_EXPORT void GUIAPI RotateScaledBitmap (HDC hdc, const BITMAP *bmp,
11411  int lx, int ty, int angle, int w, int h);
11412 
11424 MG_EXPORT void GUIAPI RotateScaledBitmapVFlip (HDC hdc, const BITMAP *bmp,
11425  int lx, int ty, int angle, int w, int h);
11426 
11438 MG_EXPORT void GUIAPI RotateScaledBitmapHFlip (HDC hdc, const BITMAP *bmp,
11439  int lx, int ty, int angle, int w, int h);
11440 
11452 MG_EXPORT void GUIAPI PivotBitmap(HDC hdc, const BITMAP *bmp,
11453  int lx, int ty, int cx, int cy, int angle);
11454 
11481 MG_EXPORT void GUIAPI PivotScaledBitmapFlip (HDC hdc, const BITMAP *bmp,
11482  fixed x, fixed y, fixed cx, fixed cy, int angle, fixed scale_x,
11483  fixed scale_y, BOOL h_flip, BOOL v_flip);
11484 
11485 #endif /*_MGHAVE_FIXED_MATH*/
11486 
11493 #ifdef _MGFONT_BMPF
11494 
11512 MG_EXPORT DEVFONT* GUIAPI CreateBMPDevFont (const char *bmpfont_name,
11513  const BITMAP* glyph_bmp, const char* start_mchar, int nr_glyphs,
11514  int glyph_width);
11515 
11531 MG_EXPORT BOOL GUIAPI AddGlyphsToBMPFont (DEVFONT* dev_font, BITMAP* glyph_bmp,
11532  const char* start_mchar, int nr_glyphs, int glyph_width);
11533 
11544 MG_EXPORT void GUIAPI DestroyBMPFont (DEVFONT* dev_font);
11545 
11546 #endif /* end of _MGFONT_BMPF */
11547 
11610 typedef Uint32 Achar32;
11611 typedef Uint32 Glyph32;
11612 
11616 #define INV_ACHAR_VALUE 0xFFFFFFFF
11617 
11621 #define INV_GLYPH_VALUE 0xFFFFFFFF
11622 
11636 MG_EXPORT Achar32 GUIAPI GetACharValue (LOGFONT* logfont, const char* mchar,
11637  int mchar_len, const char* pre_mchar, int pre_len);
11638 
11639 #ifdef _MGCHARSET_UNICODE
11640 
11658 MG_EXPORT int GUIAPI GetNextUChar(LOGFONT* logfont, const char* mchar,
11659  int mchar_len, Uchar32* uc);
11660 
11661 #endif /* _MGCHARSET_UNICODE */
11662 
11690 MG_EXPORT Uint32 GUIAPI GetACharType (LOGFONT* logfont, Achar32 chv);
11691 
11696 typedef enum {
11697  ACHAR_ISOLATED,
11698  ACHAR_FINAL,
11699  ACHAR_INITIAL,
11700  ACHAR_MEDIAL
11701 } ACHARSHAPETYPE;
11702 
11724 MG_EXPORT Achar32 GUIAPI GetShapedAChar (LOGFONT* logfont, const char* mchar,
11725  int mchar_len, ACHARSHAPETYPE shape_type);
11726 
11748 MG_EXPORT BOOL GUIAPI GetMirrorAChar (LOGFONT* logfont, Achar32 chv,
11749  Achar32* mirrored);
11750 
11771 MG_EXPORT BidiType GUIAPI GetACharBidiType (LOGFONT* log_font, Achar32 chv);
11772 
11777 typedef struct _ACHARMAPINFO {
11779  int byte_index;
11781  int char_len;
11783  BOOL is_rtol;
11784 } ACHARMAPINFO;
11785 
11810 MG_EXPORT int GUIAPI BIDIGetTextLogicalAChars (LOGFONT* log_font,
11811  const char* text, int text_len, Achar32** achars,
11812  ACHARMAPINFO** achars_map);
11813 
11839 MG_EXPORT void GUIAPI BIDIGetTextRangesLog2Vis (LOGFONT* log_font,
11840  const char* text, int text_len, int start_index, int end_index,
11841  int** ranges, int* nr_ranges);
11842 
11867 MG_EXPORT int GUIAPI BIDIGetTextVisualAChars (LOGFONT* log_font,
11868  const char* text, int text_len, Achar32** achars,
11869  ACHARMAPINFO** achars_map);
11870 
11904 MG_EXPORT BOOL GUIAPI BIDILogAChars2VisACharsEx (LOGFONT* log_font,
11905  Achar32* achars, int nr_achars, int pel,
11906  void* extra, CB_REVERSE_ARRAY cb_reverse_extra);
11907 
11934 MG_EXPORT Achar32* GUIAPI BIDILogAChars2VisAChars (LOGFONT* log_font,
11935  Achar32* achars, int nr_achars, ACHARMAPINFO* achars_map);
11936 
11965 MG_EXPORT void GUIAPI BIDIGetLogicalEmbedLevelsEx (LOGFONT* log_font,
11966  Achar32* achars, int nr_achars, int pel, Uint8** embedding_levels);
11967 
11968 static inline void BIDIGetLogicalEmbeddLevels (LOGFONT* log_font,
11969  Achar32* achars, int nr_achars, Uint8** embedding_levels)
11970 {
11971  BIDIGetLogicalEmbedLevelsEx (log_font, achars, nr_achars, -1,
11972  embedding_levels);
11973 }
11974 
12006 MG_EXPORT void GUIAPI BIDIGetVisualEmbedLevelsEx (LOGFONT* log_font,
12007  Achar32* achars, int nr_achars, int pel, Uint8** embedding_levels);
12008 
12009 static inline void BIDIGetVisualEmbeddLevels (LOGFONT* log_font,
12010  Achar32* achars, int nr_achars, Uint8** embedding_levels)
12011 {
12012  BIDIGetVisualEmbedLevelsEx (log_font, achars, nr_achars, -1,
12013  embedding_levels);
12014 }
12015 
12016 /*
12017  * \fn int GUIAPI DrawACharString (HDC hdc, int x, int y,
12018  * Achar32* achars, int nr_achars, int* adv_x, int* adv_y);
12019  *
12020  * \brief Draw an abstract character string.
12021  *
12022  * This function draws an abstract character string to the specific
12023  * postion of a DC. Note that this function will ignore all breaks
12024  * in the Achar32 string.
12025  *
12026  * \param hdc The device context.
12027  * \param x The output start x position.
12028  * \param y The output start y position.
12029  * \param achars The pointer to the glyph string.
12030  * \param nr_achars The number of achars which will be draw.
12031  * \param adv_x The pointer used to return the advance in x-coordinate of
12032  * the glyph string, can be NULL.
12033  * \param adv_y The pointer used to return the advance in y-coordinate of
12034  * the glyph string, can be NULL.
12035  *
12036  * \return The advance on baseline.
12037  */
12038 MG_EXPORT int GUIAPI DrawACharString (HDC hdc, int x, int y, Achar32* achars,
12039  int nr_achars, int* adv_x, int* adv_y);
12040 
12056 MG_EXPORT int GUIAPI GetACharsExtent (HDC hdc, Achar32* achars, int nr_achars,
12057  SIZE* size);
12058 
12077 MG_EXPORT int GUIAPI GetACharsExtentPoint (HDC hdc, Achar32* achars,
12078  int nr_achars, int max_extent, SIZE* size);
12079 
12093 MG_EXPORT Glyph32 GUIAPI GetGlyphValue (LOGFONT* logfont, const char* mchar,
12094  int mchar_len, const char* pre_mchar, int pre_len);
12095 
12106 MG_EXPORT Glyph32 GUIAPI GetGlyphValueAlt(LOGFONT* logfont, Achar32 chv);
12107 
12126 MG_EXPORT int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
12127  int* adv_x, int* adv_y);
12128 
12129 /*
12130  * \fn int GUIAPI DrawGlyphString (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12131  * const POINT* pts);
12132  *
12133  * \brief Draw a glyph string at specified positions.
12134  *
12135  * This function draws a glyph string to the specific postions of a DC.
12136  * Note that this function will ignore all special type (such as zero-width)
12137  * in the glyph string.
12138  *
12139  * \param hdc The device context.
12140  * \param glyphs The pointer to the glyph string.
12141  * \param nr_glyphs The number of glyphs which will be draw.
12142  * \param pts The positions of every glyphs.
12143  *
12144  * \return The number of glyphs drawn.
12145  *
12146  * \sa DrawGlyphStringEx
12147  */
12148 MG_EXPORT int GUIAPI DrawGlyphString (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12149  const POINT* pts);
12150 
12168 MG_EXPORT int GUIAPI GetGlyphsExtent (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12169  SIZE* size);
12170 
12189 MG_EXPORT int GUIAPI GetGlyphsExtentPoint (HDC hdc, Glyph32* glyphs,
12190  int nr_glyphs, int max_extent, SIZE* size);
12191 
12192 #define GLYPH_INFO_METRICS 0x01
12193 #define GLYPH_INFO_BMP 0x02
12194 
12196 #define GLYPHBMP_TYPE_MONO 0x00
12197 
12198 #define GLYPHBMP_TYPE_GREY 0x01
12199 
12200 #define GLYPHBMP_TYPE_GREY4b 0x02
12201 
12202 #define GLYPHBMP_TYPE_SUBPIXEL 0x03
12203 
12204 #define GLYPHBMP_TYPE_PRERENDER 0x04
12205 
12210 typedef struct _GLYPHINFO {
12217  Uint32 mask;
12218 
12220  int bbox_x, bbox_y, bbox_w, bbox_h;
12222  int advance_x, advance_y;
12223 
12231  int bmp_type;
12232 
12234  int bmp_width;
12236  int bmp_height;
12237  /* The pitch of the glyph bitmap. */
12238  int bmp_pitch;
12239 
12241  const unsigned char* bits;
12242 
12247  BITMAP prbitmap;
12248 } GLYPHINFO;
12249 
12267 MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
12268  GLYPHINFO* glyph_info);
12269 
12270 #ifdef _MGCHARSET_UNICODE
12271 
12289 #define WSR_NORMAL 0x00
12290 
12299 #define WSR_PRE 0x01
12300 
12307 #define WSR_NOWRAP 0x02
12308 
12315 #define WSR_PRE_WRAP 0x03
12316 
12331 #define WSR_BREAK_SPACES 0x04
12332 
12340 #define WSR_PRE_LINE 0x05
12341 
12381 MG_EXPORT int GUIAPI GetUCharsUntilParagraphBoundary(LOGFONT* logfont,
12382  const char* mstr, int mstr_len, Uint8 wsr,
12383  Uchar32** uchars, int* nr_uchars);
12384 
12401 MG_EXPORT Uchar32 GUIAPI AChar2UChar(LOGFONT* logfont, Achar32 chv);
12402 
12421 MG_EXPORT int GUIAPI AChars2UChars(LOGFONT* logfont, const Achar32* chs,
12422  Uchar32* ucs, int n);
12423 
12435 #define UCHAR2ACHAR(uc) ((uc) | 0x80000000)
12436 
12459 MG_EXPORT BOOL GUIAPI UChar2AChar(LOGFONT* logfont, Uchar32 uc, Achar32* ac);
12460 
12481 MG_EXPORT int GUIAPI UChars2AChars(LOGFONT* logfont, const Uchar32* ucs,
12482  Achar32* acs, int n);
12483 
12500 #define GRF_WRITING_MODE_MASK 0xF0000000
12501 #define GRF_WRITING_MODE_VERTICAL_FLAG 0x20000000
12502 
12506 #define GRF_WRITING_MODE_HORIZONTAL_TB 0x00000000
12507 
12512 #define GRF_WRITING_MODE_HORIZONTAL_BT 0x10000000
12513 
12518 #define GRF_WRITING_MODE_VERTICAL_RL 0x20000000
12519 
12524 #define GRF_WRITING_MODE_VERTICAL_LR 0x30000000
12525 
12526 #define GRF_TEXT_ORIENTATION_MASK 0x0F000000
12527 
12531 #define GRF_TEXT_ORIENTATION_UPRIGHT 0x00000000
12532 
12536 #define GRF_TEXT_ORIENTATION_SIDEWAYS 0x01000000
12537 
12541 #define GRF_TEXT_ORIENTATION_UPSIDE_DOWN 0x02000000
12542 
12546 #define GRF_TEXT_ORIENTATION_SIDEWAYS_LEFT 0x03000000
12547 
12551 #define GRF_TEXT_ORIENTATION_AUTO 0x04000000
12552 
12559 #define GRF_TEXT_ORIENTATION_MIXED 0x05000000
12560 
12561 #define GRF_TEXT_ORIENTATION_LINE 0x06000000
12562 
12563 #define GRF_LINE_EXTENT_MASK 0x00C00000
12564 
12569 #define GRF_LINE_EXTENT_FIXED 0x00000000
12570 
12575 #define GRF_LINE_EXTENT_VARIABLE 0x00400000
12576 
12577 #define GRF_INDENT_MASK 0x00300000
12578 
12581 #define GRF_INDENT_NONE 0x00000000
12582 
12585 #define GRF_INDENT_FIRST_LINE 0x00100000
12586 
12589 #define GRF_INDENT_HANGING 0x00200000
12590 
12591 #define GRF_OVERFLOW_WRAP_MASK 0x000C0000
12592 
12595 #define GRF_OVERFLOW_WRAP_NORMAL 0x00000000
12596 
12599 #define GRF_OVERFLOW_WRAP_BREAK_WORD 0x00040000
12600 
12605 #define GRF_OVERFLOW_WRAP_ANYWHERE 0x00080000
12606 
12607 #define GRF_OVERFLOW_ELLIPSIZE_MASK 0x00030000
12608 
12611 #define GRF_OVERFLOW_ELLIPSIZE_NONE 0x00000000
12612 
12615 #define GRF_OVERFLOW_ELLIPSIZE_START 0x00010000
12616 
12619 #define GRF_OVERFLOW_ELLIPSIZE_MIDDLE 0x00020000
12620 
12623 #define GRF_OVERFLOW_ELLIPSIZE_END 0x00030000
12624 
12625 #define GRF_ALIGN_MASK 0x0000F000
12626 
12629 #define GRF_ALIGN_START 0x00000000
12630 
12633 #define GRF_ALIGN_END 0x00001000
12634 
12638 #define GRF_ALIGN_LEFT 0x00002000
12639 
12643 #define GRF_ALIGN_RIGHT 0x00003000
12644 
12647 #define GRF_ALIGN_CENTER 0x00004000
12648 
12655 #define GRF_ALIGN_JUSTIFY 0x00005000
12656 
12657 #define GRF_TEXT_JUSTIFY_MASK 0x00000F00
12658 
12661 #define GRF_TEXT_JUSTIFY_NONE 0x00000000
12662 
12667 #define GRF_TEXT_JUSTIFY_AUTO 0x00000100
12668 
12671 #define GRF_TEXT_JUSTIFY_INTER_WORD 0x00000200
12672 
12676 #define GRF_TEXT_JUSTIFY_INTER_CHAR 0x00000300
12677 
12678 #define GRF_HANGING_PUNC_MASK 0x000000F0
12679 
12682 #define GRF_HANGING_PUNC_NONE 0x00000000
12683 
12686 #define GRF_HANGING_PUNC_FORCE_END 0x00000010
12687 
12691 #define GRF_HANGING_PUNC_ALLOW_END 0x00000020
12692 
12695 #define GRF_HANGING_PUNC_OPEN 0x00000040
12696 
12699 #define GRF_HANGING_PUNC_CLOSE 0x00000080
12700 
12701 #define GRF_SPACES_MASK 0x0000000F
12702 
12705 #define GRF_SPACES_KEEP 0x00000000
12706 
12709 #define GRF_SPACES_REMOVE_START 0x00000001
12710 
12713 #define GRF_SPACES_REMOVE_END 0x00000002
12714 
12717 #define GRF_SPACES_HANGE_END 0x00000004
12718 
12721 typedef enum {
12722  GLYPH_ORIENT_UPRIGHT = GLYPH_GRAVITY_SOUTH,
12723  GLYPH_ORIENT_SIDEWAYS = GLYPH_GRAVITY_EAST,
12724  GLYPH_ORIENT_UPSIDE_DOWN = GLYPH_GRAVITY_NORTH,
12725  GLYPH_ORIENT_SIDEWAYS_LEFT = GLYPH_GRAVITY_WEST,
12726 } GlyphOrient;
12727 
12728 typedef enum {
12729  GLYPH_HANGED_NONE = 0,
12730  GLYPH_HANGED_START,
12731  GLYPH_HANGED_END,
12732 } GlyphHanged;
12733 
12737 typedef struct _GLYPHEXTINFO {
12739  int bbox_x, bbox_y, bbox_w, bbox_h;
12741  int adv_x, adv_y;
12743  int extra_x, extra_y;
12766 } GLYPHEXTINFO;
12767 
12771 typedef struct _GLYPHPOS {
12775  int x;
12779  int y;
12783  int x_off;
12787  int y_off;
12791  int advance;
12826 } GLYPHPOS;
12827 
12908 MG_EXPORT int GUIAPI GetGlyphsExtentFromUChars(LOGFONT* logfont_upright,
12909  const Achar32* uchars, int nr_uchars, const BreakOppo* break_oppos,
12910  Uint32 render_flags, int x, int y,
12911  int letter_spacing, int word_spacing, int tab_size, int max_extent,
12912  SIZE* line_size, Glyph32* glyphs, GLYPHEXTINFO* glyph_ext_info,
12913  GLYPHPOS* glyph_pos, LOGFONT** logfont_sideways);
12914 
12915 /*
12916  * \fn int GUIAPI DrawGlyphStringEx (HDC hdc,
12917  * LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
12918  * const Glyph32* glyphs, const GLYPHPOS* glyph_pos, int nr_glyphs)
12919  * \brief Draw a glyph string at the specified positions and text orientations.
12920  *
12921  * This function draws a glyph string to the specific positions and
12922  * orientations on a DC \a hdc with the logfonts specified by
12923  * \a logfont_upright and \a logfont_sideways.
12924  *
12925  * \param hdc The device context.
12926  * \param logfont_upright The LOGFONT object used for upright glyphs.
12927  * \param logfont_sideways The LOGFONT object used for sideways glyphs.
12928  * \param glyphs The pointer to the glyph string
12929  * \param glyph_pos The buffer holds the position information
12930  * of every glyph.
12931  * \param nr_glyphs The number of the glyphs should be drawn.
12932  *
12933  * \return The number of glyphs really drawn.
12934  *
12935  * \note The positions contained in \a glyph_pos are always aligned to
12936  * the top-left corner of the output rectangle.
12937  *
12938  * \sa GetGlyphsExtentFromUChars
12939  *
12940  * Since 4.0.0
12941  */
12942 MG_EXPORT int GUIAPI DrawGlyphStringEx (HDC hdc,
12943  LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
12944  const Glyph32* glyphs, const GLYPHPOS* glyph_pos,
12945  int nr_glyphs);
12946 
12951 typedef struct _TEXTRUNS TEXTRUNS;
12952 
12993 MG_EXPORT TEXTRUNS* GUIAPI CreateTextRuns(
12994  const Uchar32* ucs, int nr_ucs,
12995  LanguageCode lang_code, ParagraphDir base_dir,
12996  const char* logfont_name, RGBCOLOR color, RGBCOLOR bg_color,
12997  BreakOppo* break_oppos);
12998 
13016 MG_EXPORT BOOL GUIAPI SetFontNameInTextRuns(TEXTRUNS* truns,
13017  int start_index, int length, const char* logfont_name);
13018 
13024 MG_EXPORT const char* GUIAPI GetFontNameInTextRuns(
13025  const TEXTRUNS* truns, int index);
13026 
13044 MG_EXPORT BOOL GUIAPI SetTextColorInTextRuns(TEXTRUNS* truns,
13045  int start_index, int length, RGBCOLOR color);
13046 
13052 MG_EXPORT RGBCOLOR GUIAPI GetTextColorInTextRuns(
13053  const TEXTRUNS* truns, int index);
13054 
13075 MG_EXPORT BOOL GUIAPI SetBackgroundColorInTextRuns(TEXTRUNS* truns,
13076  int start_index, int length, RGBCOLOR color);
13077 
13083 MG_EXPORT RGBCOLOR GUIAPI GetBackgroundColorInTextRuns(
13084  const TEXTRUNS* truns, int index);
13085 
13104 MG_EXPORT BOOL GUIAPI DestroyTextRuns(TEXTRUNS* truns);
13105 
13137 MG_EXPORT BOOL GUIAPI InitBasicShapingEngine(TEXTRUNS* truns);
13138 
13139 #ifdef _MGCOMPLEX_SCRIPTS
13140 
13174 MG_EXPORT BOOL GUIAPI InitComplexShapingEngine(TEXTRUNS* truns);
13175 
13176 #endif /* _MGCOMPLEX_SCRIPTS */
13177 
13182 typedef struct _LAYOUT LAYOUT;
13183 
13188 typedef struct _LAYOUTLINE LAYOUTLINE;
13189 
13224 MG_EXPORT LAYOUT* GUIAPI CreateLayout(
13225  const TEXTRUNS* truns, Uint32 render_flags,
13226  const BreakOppo* break_oppos, BOOL persist_lines,
13227  int max_line_extent, int indent,
13228  int letter_spacing, int word_spacing, int tab_size,
13229  int* tabs, int nr_tabs);
13230 
13245 MG_EXPORT BOOL GUIAPI DestroyLayout(LAYOUT* layout);
13246 
13247 /*
13248  * \var typedef struct _RENDERDATA RENDERDATA
13249  * \brief The extra rendering data of the shaped glyph.
13250  */
13251 typedef struct _RENDERDATA {
13255  const TEXTRUNS* truns;
13256 
13260  const LAYOUT* layout;
13261 
13265  const LAYOUTLINE* line;
13266 
13270  LOGFONT* logfont;
13271 
13275  Uint32 ta;
13276 
13280  Uchar32 uc;
13281 
13286  int uc_index;
13287 } RENDERDATA;
13288 
13307 typedef BOOL (*CB_GLYPH_LAID_OUT) (GHANDLE ctxt,
13308  Glyph32 glyph_value, const GLYPHPOS* glyph_pos,
13309  const RENDERDATA* render_data);
13310 
13353 MG_EXPORT LAYOUTLINE* GUIAPI LayoutNextLine(LAYOUT* layout,
13354  LAYOUTLINE* prev_line, int max_extent, BOOL last_line,
13355  CB_GLYPH_LAID_OUT cb_laid_out, GHANDLE ctxt);
13356 
13373 MG_EXPORT BOOL GUIAPI GetLayoutLineSize(const LAYOUTLINE* line,
13374  SIZE* line_size);
13375 
13407 MG_EXPORT BOOL GUIAPI GetLayoutLineRect(const LAYOUTLINE* line,
13408  int* x, int* y, int line_height, RECT* line_rc);
13409 
13445 MG_EXPORT int GUIAPI CalcLayoutBoundingRect(LAYOUT* layout,
13446  int max_line_extent, int max_height, int line_height,
13447  int x, int y, RECT* bounding);
13448 
13478 MG_EXPORT BOOL DrawShapedGlyph(HDC hdc,
13479  Glyph32 glyph_value, const GLYPHPOS* glyph_pos,
13480  const RENDERDATA* render_data);
13481 
13513 MG_EXPORT int DrawLayoutLine(HDC hdc, const LAYOUTLINE* line,
13514  int x, int y);
13515 
13516 #ifdef _MGDEVEL_MODE
13517 typedef struct _TextRun TEXTRUN;
13518 
13519 MG_EXPORT TEXTRUN* GetNextTextRunInfo(TEXTRUNS* runinfo,
13520  TEXTRUN* prev,
13521  const char** fontname, int* start_index, int* length,
13522  LanguageCode* lang_code, ScriptType* script,
13523  BidiLevel* embedding_level, Uint8* flags);
13524 
13525 /* Get layout line information */
13526 MG_EXPORT BOOL GUIAPI GetLayoutLineInfo(LAYOUTLINE* line,
13527  int* max_extent, int* nr_chars, int* nr_glyphs,
13528  int** log_widths, int* width, int* height,
13529  BOOL* is_ellipsized, BOOL* is_wrapped);
13530 #endif
13531 
13532 #endif /* _MGCHARSET_UNICODE */
13533 
13536 /*
13537  * \var typedef struct _COMP_CTXT COMP_CTXT
13538  * \brief The context information of user defined color composition operators.
13539  *
13540  * \sa SetUserCompositionOps
13541  */
13542 typedef struct _COMP_CTXT {
13544  gal_uint8* cur_dst;
13545 
13547  void* user_comp_ctxt;
13548 
13550  gal_pixel skip_pixel;
13551 
13553  gal_pixel cur_pixel;
13554 
13556  int step;
13557 } COMP_CTXT;
13558 
13559 /*
13560  * \var typedef struct _SPAN_CTXT SPAN_CTXT
13561  * \brief span context
13562  */
13563 typedef struct _SPAN_CTXT {
13564  GAL_PixelFormat* dst_format; /* The pixel format of the destination pixels */
13565  GAL_PixelFormat* src_format; /* The pixel format of the source pixels */
13566  void * user_context; /* The user context passed to SetColorCompositeFunc */
13567 } SPAN_CTXT;
13568 
13569 /*
13570  * \var typedef struct _COMPOSITE_CTXT COMPOSITE_CTXT
13571  * \brief composite context
13572  */
13573 typedef struct _COMPOSITE_CTXT {
13574  HDC dst_dc;
13575  int comp_mode;
13576  const int *far_bkmode;
13577  const int *far_step;
13578  const gal_pixel *far_skip_pixel;
13579 } COMPOSITE_CTXT;
13580 
13581 /*
13582  * \var typedef struct _RASTER_CTXT RASTER_CTXT
13583  * \brief raster context
13584  */
13585 typedef struct _RASTER_CTXT {
13586  HDC dst_dc;
13587 } RASTER_CTXT;
13588 
13589 /*
13590  * \var typedef void (*CB_COMP_SETPIXEL) (COMP_CTXT* comp_ctxt)
13591  * \brief The prototype of the user defined color composition setpixel.
13592  *
13593  * This operator sets a pixel on the \a cur_dst defined in \a comp_ctxt with
13594  * the cur_pixel defined in \a comp_ctxt.
13595  *
13596  * \sa SetUserCompositionOps, COMP_CTXT
13597  */
13598 typedef void (*CB_COMP_SETPIXEL) (COMP_CTXT* comp_ctxt);
13599 
13600 /*
13601  * \var typedef void (*CB_COMP_SETHLINE) (COMP_CTXT* comp_ctxt, int w)
13602  * \brief The prototype of the user defined color composition sethline.
13603  *
13604  * This operator sets a horizital line on the \a cur_dst defined in \a comp_ctxt
13605  * with the \a cur_pixel defined in \a comp_ctxt, totally \a w pixels.
13606  *
13607  * \sa SetUserCompositionOps, COMP_CTXT
13608  */
13609 typedef void (*CB_COMP_SETHLINE) (COMP_CTXT* comp_ctxt, int w);
13610 
13611 /*
13612  * \var typedef void (*CB_COMP_PUTHLINE) (COMP_CTXT* comp_ctxt, gal_uint8* src, int w)
13613  * \brief The prototype of the user defined color composition puthline.
13614  *
13615  * This operator puts the pixels in \a src to a horizital line on the \a cur_dst
13616  * defined in \a comp_ctxt, totally \a w pixels.
13617  *
13618  * \sa SetUserCompositionOps, COMP_CTXT
13619  */
13620 typedef void (*CB_COMP_PUTHLINE) (COMP_CTXT* comp_ctxt, gal_uint8* src, int bkmode, int w);
13621 
13643 MG_EXPORT int GUIAPI SetUserCompositionOps (HDC hdc,
13644  CB_COMP_SETPIXEL comp_setpixel,
13645  CB_COMP_SETHLINE comp_sethline,
13646  CB_COMP_PUTHLINE comp_puthline,
13647  void* user_comp_ctxt);
13648 
13651 #ifdef _MGGAL_HI3560
13652 
13653 //#include <hi_api.h>
13654 
13655 /* API speicific to Hi3560 GAL engines */
13656 MG_EXPORT int hi3560GetVideoFD (void);
13657 MG_EXPORT void* hi3560GetFBAddress (void);
13658 MG_EXPORT int hi3560SetScreenAttr (Uint8 siAttr, void* pValue);
13659 
13660 #endif /* _MGGAL_HI3560 */
13661 
13662 #ifdef __cplusplus
13663 }
13664 #endif /* __cplusplus */
13665 
13666 #endif /* _MGUI_GDI_H */
13667 
13668 
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.
static BOOL PtInRect(const RECT *prc, int x, int y)
Determines whether a point lies within an rectangle.
Definition: gdi.h:5279
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 BOOL GUIAPI SyncUpdateDC(HDC hdc)
Synchronize the update rectangles of the surface corresponding to hdc to screen.
MG_EXPORT LanguageCode GUIAPI LanguageCodeFromISO639s1(Uint16 iso639_1)
Get MiniGUI language code from an encoded ISO639-1 language code.
MG_EXPORT int GUIAPI GetSysFontHeight(int font_id)
Gets the height of a single-byte character of a system font.
MG_EXPORT void GUIAPI UBidiShape(Uint32 shaping_flags, const BidiLevel *embedding_levels, int len, BidiArabicProp *ar_props, Uchar32 *ucs)
Do bidi-aware shaping.
MG_EXPORT BOOL GUIAPI SetBackgroundColorInTextRuns(TEXTRUNS *truns, int start_index, int length, RGBCOLOR color)
Set background color in a TEXTRUNS object.
static gal_pixel DWORD2Pixel(HDC hdc, DWORD dword)
An inline function to convert DWORD color to gal_pixel.
Definition: gdi.h:2917
MG_EXPORT int GUIAPI PaintImageFromFile(HDC hdc, int x, int y, const char *spFileName)
Paints an image from file on device directly.
MG_EXPORT BOOL GUIAPI RealizePalette(HDC hdc)
This function maps palette entries from the current logical palette to the system palette...
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.
int adv_x
Definition: gdi.h:12741
MG_EXPORT BOOL GUIAPI RestoreDC(HDC hdc, int saved_dc)
Restores a device context (DC) to the specified state.
MG_EXPORT BOOL GUIAPI InitComplexShapingEngine(TEXTRUNS *truns)
Initialize the complex shaping engine for a TEXTRUNS object.
MG_EXPORT BOOL GUIAPI DestroyIcon(HICON hicon)
Destroys an icon object.
MG_EXPORT void GUIAPI LPtoSP(HDC hdc, POINT *pPt)
Converts logical coordinates into screen coordinates.
MG_EXPORT Uchar32 GUIAPI UCharToSingleWidth(Uchar32 uc)
struct _ARC ARC
MG_EXPORT BOOL GUIAPI SetFontNameInTextRuns(TEXTRUNS *truns, int start_index, int length, const char *logfont_name)
Set logfont name of text runs.
PTCapStyle
Definition: gdi.h:3626
int height
Definition: gdi.h:3803
unsigned char delimiter
Definition: gdi.h:7735
int x_off
Definition: gdi.h:12783
MG_EXPORT BOOL GUIAPI IsUCharTitle(Uchar32 uc)
Uint32 bmHeight
Definition: gdi.h:10422
DWORD32 style
Definition: gdi.h:5772
MG_EXPORT DEVFONT *GUIAPI LoadDevFontFromIncoreData(const char *devfont_name, const void *data)
Load device font from incore data.
MG_EXPORT void GUIAPI GetDCLCS(HDC hdc, int which, POINT *pt)
Retrieves mapping parameters of a device context.
MG_EXPORT void GUIAPI UnloadMyBitmap(PMYBITMAP my_bmp)
Unloads a bitmap.
int x
Definition: gdi.h:3936
MG_EXPORT void GUIAPI UBidiShapeArabic(Uint32 shaping_flags, const BidiLevel *embedding_levels, int len, BidiArabicProp *ar_props, Uchar32 *ucs)
Do Arabic shaping.
MG_EXPORT int GUIAPI GetGlyphsExtent(HDC hdc, Glyph32 *glyphs, int nr_glyphs, SIZE *size)
Get visual extent value of a glyph string.
int size
Definition: gdi.h:5774
Definition: common.h:955
int extra_x
Definition: gdi.h:12743
int starty
Definition: gdi.h:10167
Definition: gdi.h:3933
int descent
Definition: gdi.h:5780
void(* CB_ONE_SCANLINE)(void *context, MYBITMAP *my_bmp, int y)
The type of scanline loaded callback.
Definition: gdi.h:10457
static 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.
Definition: gdi.h:11098
MG_EXPORT BOOL GUIAPI IsCovered(const RECT *prc1, const RECT *prc2)
Determines whether one rectangle is covered by another.
int BOOL
A type definition for boolean value.
Definition: common.h:338
struct _GLYPHPOS GLYPHPOS
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 t...
MG_EXPORT HDC GUIAPI GetPrivateClientDC(HWND hwnd)
Returns the private client DC of a window.
#define GetAValue(rgba)
Gets the alpha component from a RGBA triple value rgba.
Definition: common.h:886
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 BOOL GUIAPI DestroyLayout(LAYOUT *layout)
Destroy the specified layout information structure.
#define GetBValue(rgba)
Gets the blue component from a RGBA triple value rgba.
Definition: common.h:877
char * type
Definition: gdi.h:5766
MG_EXPORT const char *GUIAPI CheckBitmapType(MG_RWops *fp)
Checks the type of the bitmap in a data source.
Uint32 bmPitch
Definition: gdi.h:10424
Uint16 BreakOppo
Definition: gdi.h:9344
ACHARSHAPETYPE
Achar32 shape type.
Definition: gdi.h:11696
MG_EXPORT int GUIAPI UCharCombiningClass(Uchar32 uc)
Uint8 whitespace
Definition: gdi.h:12753
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:455
MG_EXPORT int GUIAPI GetGlyphsExtentFromUChars(LOGFONT *logfont_upright, const Achar32 *uchars, int nr_uchars, const BreakOppo *break_oppos, Uint32 render_flags, int x, int y, int letter_spacing, int word_spacing, int tab_size, int max_extent, SIZE *line_size, Glyph32 *glyphs, GLYPHEXTINFO *glyph_ext_info, GLYPHPOS *glyph_pos, LOGFONT **logfont_sideways)
Get the visual extent info of all glyphs fitting in the specified maximal output extent.
MG_EXPORT int GUIAPI GetRasterOperation(HDC hdc)
Gets the raster operation of a DC.
MG_EXPORT BOOL GUIAPI InitVectorialFonts(void)
Initializes vectorial font renderer.
struct _CLIPRECT * next
Definition: gdi.h:587
MG_EXPORT RGBCOLOR GUIAPI GetTextColorInTextRuns(const TEXTRUNS *truns, int index)
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 ...
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.
struct _LOGFONT LOGFONT
MG_EXPORT BOOL GUIAPI DoesIntersect(const RECT *psrc1, const RECT *psrc2)
Determines whether two rectangles intersect.
struct _DTFIRSTLINE DTFIRSTLINE
MG_EXPORT void GUIAPI Circle(HDC hdc, int sx, int sy, int r)
Draws a circle.
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 necessar...
MG_EXPORT BOOL GUIAPI UnionRect(RECT *pdrc, const RECT *psrc1, const RECT *psrc2)
Unions two source rectangles.
MG_EXPORT void GUIAPI MoveTo(HDC hdc, int x, int y)
Moves the current zero pen position.
MG_EXPORT HDC GUIAPI InitSlaveScreenEx(const char *name, const char *mode, int dpi)
Initializes slave screen.
int y
Definition: gdi.h:3938
MG_EXPORT int GUIAPI UStrGetBreaks(LanguageCode lang_code, Uint8 ctr, Uint8 wbr, Uint8 lbp, Uchar32 *ucs, int nr_ucs, BreakOppo **break_oppos)
Calculate the breaking opportunities of a Uchar32 string under the specified rules and line breaking ...
struct _ACHARMAPINFO ACHARMAPINFO
Data type of struct _ACHARMAPINFO.
MG_EXPORT void GUIAPI ClipRectIntersect(HDC hdc, const RECT *prc)
Intersects the specified rectangle with the visible region of the DC.
MG_EXPORT BOOL GUIAPI SetClipRgn(PCLIPRGN pRgn, const RECT *pRect)
Sets a region to contain only one rect.
Definition: gdi.h:3751
MG_EXPORT BOOL GUIAPI IsUCharWide(Uchar32 uc)
MG_EXPORT BOOL GUIAPI InitCircleRegion(PCLIPRGN dst, int x, int y, int r)
Initializes a region to be an enclosed circle.
MG_EXPORT HDC GUIAPI CreateSecondaryDC(HWND hwnd)
Creates a secondary window DC of a window.
MG_EXPORT int GUIAPI UCharFullyDecompose(Uchar32 ch, BOOL compat, Uchar32 *result, int result_len)
MG_EXPORT void GUIAPI DestroyBMPFont(DEVFONT *dev_font)
Destroy the bitmap device font.
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 HDC GUIAPI CreatePrivateClientDC(HWND hwnd)
Creates a private client DC of a window.
MG_EXPORT BOOL GUIAPI SetColorfulPalette(HDC hdc)
Sets a DC with colorfule palette.
static void CopyRect(RECT *pdrc, const RECT *psrc)
Copies one rectangle to another.
Definition: gdi.h:5195
MG_EXPORT BOOL GUIAPI SaveMainWindowContent(HWND hWnd, const char *filename)
Saves content of a main window to a file.
MG_EXPORT void GUIAPI RotateBitmapVFlip(HDC hdc, const BITMAP *bmp, int lx, int ty, int angle)
Flips vertically and rotates a bitmap object.
Uint32 h
Definition: gdi.h:10354
MG_EXPORT void GUIAPI SPtoLP(HDC hdc, POINT *pPt)
Converts screen coordinates into logical coordinates.
MG_EXPORT BOOL GUIAPI SetPalette(HDC hdc, int start, int len, GAL_Color *cmap)
Sets palette entries of a DC.
MG_EXPORT Uint32 GUIAPI GetDCAttr(HDC hdc, int attr)
Gets a specified attribute value of a DC.
static gal_pixel GUIAPI GetPixelInBitmap(const BITMAP *bmp, int x, int y)
Returns the pixel value in a BITMAP object.
Definition: gdi.h:4907
int y
Definition: gdi.h:12779
MG_EXPORT void GUIAPI SetBrushOrigin(HDC hdc, int x, int y)
Set the origin when using tiles or stipples with the DC.
MG_EXPORT Glyph32 GUIAPI GetGlyphValueAlt(LOGFONT *logfont, Achar32 chv)
Get the LOGFONT glyph value of an abstract character.
BYTE g
Definition: common.h:1010
RECT rcBound
Definition: gdi.h:622
MG_EXPORT Achar32 GUIAPI GetACharValue(LOGFONT *logfont, const char *mchar, int mchar_len, const char *pre_mchar, int pre_len)
Get the character value of a multi-byte character.
Uint8 bmType
Definition: gdi.h:10407
MG_EXPORT BOOL GUIAPI IsEmptyClipRgn(const CLIPRGN *pRgn)
Determines whether a region is an empty region.
MG_EXPORT BOOL GUIAPI DestroyTextRuns(TEXTRUNS *truns)
Destroy the glyph run info object. It also frees all data allocated for shapping and layouting the gl...
MG_EXPORT BOOL GUIAPI AddClipRect(PCLIPRGN pRgn, const RECT *pRect)
Unions one rectangle to a region.
MG_EXPORT int GUIAPI GetSysCCharWidth(void)
Gets the width of a multi-byte character of the default system font.
HDC GUIAPI CreatePrivateSubDC(HDC hdc, int off_x, int off_y, int width, int height)
Creates a private SubDC of a window.
Uint32 bmColorKey
Definition: gdi.h:10415
MG_EXPORT BOOL GUIAPI IsUCharXDigit(Uchar32 uc)
DWORD flags
Definition: gdi.h:10340
MG_EXPORT void GUIAPI LPtoDP(HDC hdc, POINT *pPt)
Converts logical coordinates into device coordinates.
MG_EXPORT Uchar32 GUIAPI AChar2UChar(LOGFONT *logfont, Achar32 chv)
Get Uchar32 value (Unicode wide character value) from a LOGFONT abstract character value...
CLIPRGN * PCLIPRGN
Data type of the pointer to a CLIPRGN.
Definition: gdi.h:644
void * heap
Definition: gdi.h:424
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.
Uint8 whitespace
Definition: gdi.h:12799
MG_EXPORT Achar32 *GUIAPI BIDILogAChars2VisAChars(LOGFONT *log_font, Achar32 *achars, int nr_achars, ACHARMAPINFO *achars_map)
Reorder the specified logical glyph string in visual order and reorder glyph map if specified...
MG_EXPORT BOOL GUIAPI IsUCharSpace(Uchar32 uc)
UCharBreakType
Definition: gdi.h:6081
MG_EXPORT HWND GUIAPI WindowFromDC(HDC hdc)
Get the window handle from DC.
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.
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.
Definition: gdi.h:1909
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.
struct _GLYPHBITMAP GLYPHBITMAP
FT2LCDFilter
Definition: gdi.h:7445
MG_EXPORT TEXTRUNS *GUIAPI CreateTextRuns(const Uchar32 *ucs, int nr_ucs, LanguageCode lang_code, ParagraphDir base_dir, const char *logfont_name, RGBCOLOR color, RGBCOLOR bg_color, BreakOppo *break_oppos)
Split a Uchar32 paragraph string in mixed scripts into text runs.
Uint8 BidiJoiningType
Definition: gdi.h:8061
MG_EXPORT PLOGFONT GUIAPI CreateLogFontEx(const char *type, const char *family, const char *charset, char weight, char slant, char flip, char other, char decoration, char rendering, int size, int rotation)
Creates a logical font.
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 void GUIAPI DeleteBitmapAlphaPixel(PBITMAP bmp)
Deletes the bitmap alpha pixel format information of a BITMAP object.
MG_EXPORT Uchar32 GUIAPI UCharToFullWidth(Uchar32 uc)
MG_EXPORT ScriptType GUIAPI NormalizeScriptType(LanguageCode cl, ScriptType ws)
MG_EXPORT int GUIAPI GetPaletteEntries(HPALETTE hpal, int start, int len, GAL_Color *cmap)
Gets palette entries of a logical palette.
#define MAKEWORD16(low, high)
Makes a 16-bit word from low byte and high byte.
Definition: common.h:739
MG_EXPORT HPALETTE GUIAPI CreatePalette(GAL_Palette *pal)
Creates 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 BOOL GUIAPI RectInRegion(PCLIPRGN region, const RECT *rect)
Determines whether a rectangle is intersected with a region.
struct _CLIPRGN CLIPRGN
MG_EXPORT HDC GUIAPI GetSecondaryDC(HWND hwnd)
Retrives and returns the secondary DC of a specific window.
Uint8 bmBitsPerPixel
Definition: gdi.h:10409
MG_EXPORT Uchar32 GUIAPI UCharToSmallKana(Uchar32 uc)
MG_EXPORT void * BlockDataAlloc(PBLOCKHEAP heap)
Allocates a data block from private heap.
struct _BLOCKHEAP BLOCKHEAP
Definition: common.h:925
int frames
Definition: gdi.h:10342
int len
Definition: gdi.h:7733
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 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 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 ScriptType GUIAPI UCharGetScriptType(Uchar32 ch)
PTJoinStyle
Definition: gdi.h:3673
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 OffsetClipRegion(HDC hdc, int nXOffset, int nYOffset)
Moves the clipping region of a device context by the specified offsets.
int height
Definition: gdi.h:3943
MG_EXPORT int GUIAPI GetNextUChar(LOGFONT *logfont, const char *mchar, int mchar_len, Uchar32 *uc)
Get the Uchar32 value (Unicode code point) of a multi-byte character in specified LOGFONT object...
MG_EXPORT int GUIAPI SubtractRect(RECT *rc, const RECT *psrc1, const RECT *psrc2)
Obtains the rectangles when substracting one rectangle from another.
DWORD32 style
Definition: gdi.h:6863
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.
Uint32 gal_pixel
Data type of pixel value.
Definition: common.h:1095
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 BOOL GUIAPI IsCompatibleDC(HDC hdc1, HDC hdc2)
Check whether a given DC is compliant to a specific DC.
static void SetRect(RECT *prc, int left, int top, int right, int bottom)
Sets a rectangle.
Definition: gdi.h:5159
Uint8 ellipsis
Definition: gdi.h:12803
Uint32 bmAlphaPitch
Definition: gdi.h:10436
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 int GUIAPI SetRasterOperation(HDC hdc, int rop)
Sets the raster operation of a DC to a new value.
Uint8 hanged
Definition: gdi.h:12825
MG_EXPORT void InitBlockDataHeap(PBLOCKHEAP heap, size_t bd_size, size_t heap_size)
Initializes a private block data heap.
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 GetBoundRect(PRECT pdrc, const RECT *psrc1, const RECT *psrc2)
Gets the bound rectangle of two source rectangles.
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.
char * charset
Definition: gdi.h:5770
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 void GUIAPI FillBox(HDC hdc, int x, int y, int w, int h)
Fills a rectangle box.
MG_EXPORT HDC GUIAPI CreateMemDCFromBitmap(HDC hdc, const BITMAP *bmp)
Creates a memory DC from a reference DC and a BITMAP object.
MG_EXPORT void GUIAPI GetFontMetrics(LOGFONT *log_font, FONTMETRICS *font_metrics)
Gets metrics information of a logical font.
MG_EXPORT void GUIAPI UCharCanonicalOrdering(Uchar32 *string, int len)
MG_EXPORT BOOL GUIAPI IntersectClipRect(PCLIPRGN pRgn, const RECT *pRect)
Intersects a rectangle with a region.
MG_EXPORT void GUIAPI Rectangle(HDC hdc, int x0, int y0, int x1, int y1)
Draws a rectangle.
MG_EXPORT int GUIAPI SaveDC(HDC hdc)
Saves the current state of a device context.
unsigned short Uint16
A type definition for a 16-bit unsigned integer.
Definition: common.h:164
LanguageCode
Definition: gdi.h:6495
MG_EXPORT BOOL GUIAPI LineClipper(const RECT *cliprc, int *_x0, int *_y0, int *_x1, int *_y1)
The line clipper using Cohen-Sutherland algorithm.
int angle1
Definition: gdi.h:3949
MG_EXPORT BOOL GUIAPI IsUCharWideCJK(Uchar32 uc)
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.
Uint8 bmAlpha
Definition: gdi.h:10413
MG_EXPORT BOOL GUIAPI UCharDecompose(Uchar32 ch, Uchar32 *a, Uchar32 *b)
static DWORD Pixel2DWORD(HDC hdc, gal_pixel pixel)
An inline function to convert pixel value to DWORD color.
Definition: gdi.h:2898
MG_EXPORT void GUIAPI SelectClipRect(HDC hdc, const RECT *prc)
Sets the visible region of a DC to be a rectangle.
MG_EXPORT Uchar32 UCharToUpper(Uchar32 uc)
DWORD32 RGBCOLOR
A type definition for a RGB color.
Definition: common.h:849
MG_EXPORT int GUIAPI GetMaxFontWidth(HDC hdc)
Retrieves the maximal character width of the current logical font in a DC.
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.
signed char Sint8
A type definition for an 8-bit signed character.
Definition: common.h:159
MG_EXPORT int GUIAPI GetFontHeight(HDC hdc)
Retrieves the height of the current logical font in a DC.
MG_EXPORT const char *GUIAPI GetSysCharset(BOOL wchar)
Gets the current system charset.
struct _GLYPHINFO GLYPHINFO
Data type of struct _GLYPHINFO.
Uint32 bmColorRep
Definition: gdi.h:10417
void(* CB_ARC)(void *context, int x, int y)
The type of arc generator callback.
Definition: gdi.h:3134
static void GUIAPI Expand256CBitmap(HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, const RGB *pal, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT *mybmp)
Convert a 256 color MYBITMAP pixel data to a BITMAP pixel data.
Definition: gdi.h:11135
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.
BOOL(* CB_GLYPH_LAID_OUT)(GHANDLE ctxt, Glyph32 glyph_value, const GLYPHPOS *glyph_pos, const RENDERDATA *render_data)
The prototype of callback function for LayoutNextLine.
Definition: gdi.h:13307
MG_EXPORT UVerticalOrient GUIAPI UCharGetVerticalOrientation(Uchar32 uc)
int ave_width
Definition: gdi.h:6906
MG_EXPORT BOOL GUIAPI UCharIsArabicVowel(Uchar32 uc)
MG_EXPORT BOOL GUIAPI UnionRegion(PCLIPRGN dst, const CLIPRGN *src1, const CLIPRGN *src2)
Unions two regions.
void(* CB_ELLIPSE)(void *context, int x1, int x2, int y)
The type of ellipse generator callback.
Definition: gdi.h:3101
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 lo...
MG_EXPORT BOOL GUIAPI ClipRgnIntersect(PCLIPRGN pRstRgn, const CLIPRGN *pRgn1, const CLIPRGN *pRgn2)
Intersects two region.
MG_EXPORT BOOL GUIAPI GetIconSize(HICON hicon, int *w, int *h)
Gets the size of an icon object.
MG_EXPORT PLOGFONT GUIAPI CreateLogFontForMChar2UChar(const char *charset)
Create a logical font for conversion from multi-byte character string to Uchar32 string.
MG_EXPORT int GUIAPI GetGlyphsExtentPoint(HDC hdc, Glyph32 *glyphs, int nr_glyphs, int max_extent, SIZE *size)
Get the visual extent value of an glyph string.
Uint8 depth
Definition: gdi.h:10344
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 BidiLevel GUIAPI UBidiReorderLine(Uint32 bidi_flags, const BidiType *bidi_types, int len, int off, ParagraphDir paragraph_dir, BidiLevel *embedding_levels, Uchar32 *visual_str, int *indices_map, void *extra, CB_REVERSE_ARRAY cb_reverse_extra)
Reorder a line of logical string to visual string.
MG_EXPORT void GUIAPI DestroyDynamicDevFont(DEVFONT **devfont)
Destroy device font loaded dynamically from font file.
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 BidiType GUIAPI UCharGetBidiType(Uchar32 uc)
Get bidi type of a Unicode character.
MG_EXPORT void BlockDataFree(PBLOCKHEAP heap, void *data)
Frees an allocated data block.
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 BOOL GUIAPI IsUCharAlnum(Uchar32 uc)
MG_EXPORT LAYOUTLINE *GUIAPI LayoutNextLine(LAYOUT *layout, LAYOUTLINE *prev_line, int max_extent, BOOL last_line, CB_GLYPH_LAID_OUT cb_laid_out, GHANDLE ctxt)
Layout the next line of a paragraph according to the layout information.
MG_EXPORT void GUIAPI GetLogFontInfo(HDC hdc, LOGFONT *log_font)
Gets logical font information of a DC.
MG_EXPORT void GUIAPI ReleaseSecondaryDC(HWND hwnd, HDC hdc)
Release the DC returned by GetSecondaryDC or GetSecondaryClientDC.
MG_EXPORT BOOL GUIAPI IsUCharDigit(Uchar32 uc)
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 BidiType GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len)
Get the base paragraph direction.
GHANDLE HDC
Handle to device context.
Definition: common.h:407
MG_EXPORT BOOL GUIAPI GetMirrorAChar(LOGFONT *logfont, Achar32 chv, Achar32 *mirrored)
Get the mirrored abstract character if possible.
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 int GUIAPI GetACharsExtentPoint(HDC hdc, Achar32 *achars, int nr_achars, int max_extent, SIZE *size)
Get the visual extent value of an achar string.
MG_EXPORT Uint32 GUIAPI GetACharType(LOGFONT *logfont, Achar32 chv)
Retrieve the basic type, the general cateory of Unicode, and the break class of Unicode of an abstrac...
MG_EXPORT void GUIAPI SelectClipRegion(HDC hdc, const CLIPRGN *pRgn)
Sets the visible region of a DC to be a region.
struct _LAYOUTLINE LAYOUTLINE
Definition: gdi.h:13188
MG_EXPORT void GUIAPI FocusRect(HDC hdc, int x0, int y0, int x1, int y1)
Draws a focus rectangle.
MG_EXPORT Achar32 GUIAPI GetShapedAChar(LOGFONT *logfont, const char *mchar, int mchar_len, ACHARSHAPETYPE shape_type)
Get the glyph shape of a character.
MG_EXPORT UCharBreakType GUIAPI UCharGetBreakType(Uchar32 uc)
Get the break property of a Unicode character.
MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirect(LOGFONT *logfont)
Creates a logical font indirectly from a LOGFONT structure.
struct _STIPPLE STIPPLE
MG_EXPORT BOOL GUIAPI SaveScreenRectContent(const RECT *rcWin, const char *filename)
Saves content of a rectangle in the screen to a file.
struct _TEXTRUNS TEXTRUNS
Definition: gdi.h:12951
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.
int rotation
Definition: gdi.h:5776
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 int GUIAPI GetGlyphInfo(LOGFONT *logfont, Glyph32 glyph_value, GLYPHINFO *glyph_info)
Retrieve the information of a glyph.
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 int GUIAPI BIDIGetTextVisualAChars(LOGFONT *log_font, const char *text, int text_len, Achar32 **achars, ACHARMAPINFO **achars_map)
Get visual achars and glyph_map info relative with logical string byte index.
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 UStrGetBracketTypes(const Uchar32 *ucs, const BidiType *bidi_types, int len_ucs, BidiBracketType *bracket_types)
Get bracketed characters of a Uchar32 string.
struct _LAYOUT LAYOUT
Definition: gdi.h:13182
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.
Uint32 BidiBracketType
Definition: gdi.h:8056
MG_EXPORT DEVFONT *GUIAPI LoadDevFontFromFile(const char *devfont_name, const char *file_name)
Load device font from font file.
static HDC InitSlaveScreen(const char *name, const char *mode)
Initializes slave screen.
Definition: gdi.h:10943
MG_EXPORT void GUIAPI DPtoLP(HDC hdc, POINT *pPt)
Converts device coordinates into logical coordinates.
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.
void(* CB_CIRCLE)(void *context, int x1, int x2, int y)
The type of circle generator callback.
Definition: gdi.h:3065
MG_EXPORT BOOL GUIAPI PolygonIsMonotoneVertical(const POINT *pts, int vertices)
Checks a polygon is monotone vertical or not.
MG_EXPORT void GUIAPI DeleteSecondaryDC(HWND hwnd)
Deletes the secondary DC of the window.
MG_EXPORT int GUIAPI TabbedTextOutLen(HDC hdc, int x, int y, const char *spText, int len)
Outputs a formatted text.
MG_EXPORT void GUIAPI EmptyClipRgn(PCLIPRGN pRgn)
Empties a clipping region.
int y_off
Definition: gdi.h:12787
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:353
MG_EXPORT BOOL GUIAPI IsUCharGraph(Uchar32 uc)
MG_EXPORT void GUIAPI SetBrushInfo(HDC hdc, const BITMAP *tile, const STIPPLE *stipple)
Set the tile or stipple with the DC.
MG_EXPORT BOOL GUIAPI mlsEnableSlaveScreen(HDC dc_mls, BOOL enable)
Enable or Disable a MLShadow slave screen.
Sint8 BidiLevel
Definition: gdi.h:8048
MG_EXPORT void GUIAPI UBidiJoinArabic(const BidiType *bidi_types, const BidiLevel *embedding_levels, int len, BidiArabicProp *ar_props)
Do Arabic joining.
MG_EXPORT BidiType GUIAPI GetACharBidiType(LOGFONT *log_font, Achar32 chv)
Retrieve the BIDI type of an abstract character.
MG_EXPORT void GUIAPI CircleGenerator(void *context, int sx, int sy, int r, CB_CIRCLE cb)
A circle generator.
const unsigned char * bits
Definition: gdi.h:3812
MG_EXPORT void GUIAPI GetLastTextOutPos(HDC hdc, POINT *pt)
Retrieves the last text output position.
MG_EXPORT BOOL GUIAPI ResizePalette(HPALETTE hpal, int len)
Resizes a logical palette.
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.
Definition: gdi.h:2880
MG_EXPORT void GUIAPI DestroyClipRgn(PCLIPRGN pRgn)
Empties and destroys a clipping region.
MG_EXPORT void GUIAPI BIDIGetTextRangesLog2Vis(LOGFONT *log_font, const 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.
Uint8 gal_uint8
Data type of 8-bit unsigned integer.
Definition: common.h:1048
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.
BYTE type
Definition: gdi.h:614
int descent
Definition: gdi.h:6901
Uint8 orientation
Definition: gdi.h:12815
GHANDLE HWND
Handle to main window or control.
Definition: common.h:402
static void SetRectEmpty(RECT *prc)
Empties a rectangle.
Definition: gdi.h:5178
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 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 BOOL GUIAPI ClipRgnCopy(PCLIPRGN pDstRgn, const CLIPRGN *pSrcRgn)
Copies one region to another.
MG_EXPORT void GUIAPI GetClipRgnBoundRect(PCLIPRGN pRgn, PRECT pRect)
Gets the bounding rectangle of a region.
MG_EXPORT int GUIAPI GetACharsExtent(HDC hdc, Achar32 *achars, int nr_achars, SIZE *size)
Get visual extent value of an achar string.
MG_EXPORT const DEVFONT *GUIAPI GetNextDevFont(const DEVFONT *dev_font)
Get next devfont information.
MG_EXPORT BOOL GUIAPI SelectPalette(HDC hdc, HPALETTE hpal, BOOL reserved)
Selects a palette for a DC.
Definition: gdi.h:3798
int width
Definition: gdi.h:3941
int line_adv
Definition: gdi.h:12745
MG_EXPORT void GUIAPI OffsetRegionEx(PCLIPRGN region, const RECT *rcClient, const RECT *rcScroll, int x, int y)
Offsets the region in the specified window&#39;s scroll area.
MG_EXPORT LanguageCode GUIAPI GetSampleLanguageForScript(ScriptType st)
BrushType
Definition: gdi.h:3746
static LanguageCode GUIAPI LanguageCodeFromISO639s1Code(const char *iso639_1)
Get MiniGUI language code from an ISO639-1 language code string.
Definition: gdi.h:6817
Uint8 suppressed
Definition: gdi.h:12749
int free
Definition: gdi.h:420
MG_EXPORT int GUIAPI GetSysCharHeight(void)
Gets the height of a character of the default system font.
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.
int x
Definition: gdi.h:12775
MG_EXPORT BOOL GUIAPI InitPolygonRegion(PCLIPRGN dst, const POINT *pts, int vertices)
Initializes a region to be an enclosed polygon.
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.
Uint32 pitch
Definition: gdi.h:10356
MG_EXPORT int GUIAPI GetTabbedTextExtent(HDC hdc, const char *spText, int len, SIZE *pSize)
Computes the output extent of a formatted text.
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.
Definition: gdi.h:1724
static ScriptType GUIAPI ScriptTypeFromISO15924Code(const char *iso15924)
Definition: gdi.h:9628
Uint8 * bmBits
Definition: gdi.h:10426
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 multi-byte character...
MG_EXPORT gal_pixel GUIAPI GetPixelInBitmapEx(const BITMAP *bmp, int x, int y, Uint8 *alpha)
Returns the pixel value in a BITMAP object.
Definition: common.h:978
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 void GUIAPI PivotBitmap(HDC hdc, const BITMAP *bmp, int lx, int ty, int cx, int cy, int angle)
Pivot a bitmap object.
int size_request
Definition: gdi.h:5782
MG_EXPORT void GUIAPI ReleaseDC(HDC hdc)
Releases a DC from DC pool.
void(* CB_LINE)(void *context, int stepx, int stepy)
The type of line generator callback.
Definition: gdi.h:3034
#define MakeRGBA(r, g, b, a)
Makes a RGBA triple value from red r, green g, blue b and alpha components.
Definition: common.h:898
struct _FONTMETRICS FONTMETRICS
Uint8 suppressed
Definition: gdi.h:12795
BOOL(* CB_EQUAL_PIXEL)(void *context, int x, int y)
Flodd filling generator&#39;s equation callback.
Definition: gdi.h:3273
MG_EXPORT BOOL GUIAPI IntersectRect(RECT *pdrc, const RECT *psrc1, const RECT *psrc2)
Calculates the intersection of two rectangles.
MG_EXPORT void GUIAPI LineTo(HDC hdc, int x, int y)
Draws a zero line to a position.
MG_EXPORT BOOL GUIAPI InitBitmapPixelFormat(HDC hdc, PBITMAP bmp)
Initializes the bitmap pixel format information of a BITMAP object.
MG_EXPORT const char *GUIAPI LanguageCodeToISO639s1(LanguageCode lc)
MG_EXPORT void GUIAPI EllipseGenerator(void *context, int sx, int sy, int rx, int ry, CB_ELLIPSE cb)
An ellipse generator.
static void OffsetRect(RECT *prc, int x, int y)
Moves a rectangle by offsets.
Definition: gdi.h:5216
int ascent
Definition: gdi.h:5778
MG_EXPORT void GUIAPI PolyLineTo(HDC hdc, const POINT *pts, int vertices)
Draws a polyline.
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 gal_pixel SysPixelIndex[]
The pre-defined system pixel values.
RECT rc
Definition: gdi.h:583
MG_EXPORT void GUIAPI InitClipRgn(PCLIPRGN pRgn, PBLOCKHEAP pFreeList)
Initializes a clipping region.
MG_EXPORT BOOL GUIAPI SubtractRegion(CLIPRGN *rgnD, const CLIPRGN *rgnM, const CLIPRGN *rgnS)
Substrcts a region from another.
MG_EXPORT int GUIAPI LoadMyBitmapFromFile(PMYBITMAP my_bmp, RGB *pal, const char *file_name)
Loads a MYBITMAP object from a file.
MG_EXPORT void GUIAPI Ellipse(HDC hdc, int sx, int sy, int rx, int ry)
Draws a ellipse.
MG_EXPORT Uchar32 GUIAPI UCharToTitle(Uchar32 uc)
MG_EXPORT void GUIAPI UBidiShapeMirroring(const BidiLevel *embedding_levels, int len, Uchar32 *ucs)
Do mirroring shaping.
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.
MG_EXPORT int GUIAPI AChars2UChars(LOGFONT *logfont, const Achar32 *chs, Uchar32 *ucs, int n)
Convert an Achar32 array to Unicode character array.
MG_EXPORT BidiJoiningType GUIAPI UCharGetJoiningType(Uchar32 uc)
Get character joining type.
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 BOOL GUIAPI IsUCharControl(Uchar32 uc)
#define NULL
A value indicates null pointer.
Definition: common.h:364
MG_EXPORT void GUIAPI UnlockDC(HDC hdc)
Unlocks a locked DC.
MG_EXPORT int GUIAPI GetPalette(HDC hdc, int start, int len, GAL_Color *cmap)
Gets palette entries of a DC.
PVOID GHANDLE
General handle.
Definition: common.h:397
PenType
Definition: gdi.h:3555
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 InitBitmap(HDC hdc, Uint32 w, Uint32 h, Uint32 pitch, BYTE *bits, PBITMAP bmp)
Initializes a BITMAP object as a normal bitmap.
void(* CB_FLOOD_FILL)(void *context, int x1, int x2, int y)
Flodd filling generator&#39;s scan line callback.
Definition: gdi.h:3279
MG_EXPORT HDC GUIAPI GetClientDC(HWND hwnd)
Gets a client DC of a window.
MG_EXPORT BOOL GUIAPI MonotoneVerticalPolygonGenerator(void *context, const POINT *pts, int vertices, CB_POLYGON cb)
A monotone vertical polygon generator.
MG_EXPORT int GUIAPI CalcLayoutBoundingRect(LAYOUT *layout, int max_line_extent, int max_height, int line_height, int x, int y, RECT *bounding)
Calculate the bounding rectangle of a layout.
Uint32 w
Definition: gdi.h:10352
#define GetRValue(rgba)
Gets the red component from a RGBA triple value rgba.
Definition: common.h:859
MG_EXPORT void GUIAPI FillCircle(HDC hdc, int sx, int sy, int r)
Fills a circle.
#define GetGValue(rgba)
Gets the green component from a RGBA triple value rgba.
Definition: common.h:868
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 int GUIAPI GetClipRegion(HDC hdc, CLIPRGN *cliprgn)
Gets the current clipping region of a DC.
Definition: gdi.h:603
MG_EXPORT int GUIAPI BIDIGetTextLogicalAChars(LOGFONT *log_font, const char *text, int text_len, Achar32 **achars, ACHARMAPINFO **achars_map)
Get logical achars string of the text.
MG_EXPORT BOOL GUIAPI IsUCharPrint(Uchar32 uc)
MG_EXPORT int GUIAPI GetUCharsUntilParagraphBoundary(LOGFONT *logfont, const char *mstr, int mstr_len, Uint8 wsr, Uchar32 **uchars, int *nr_uchars)
Convert a multi-byte character string to a Unicode character (Uchar32) string until the end of text (...
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:154
int bmp_pitch
Definition: gdi.h:6936
int advance_x
Definition: gdi.h:6931
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.
Definition: gdi.h:2785
Uint32 bmWidth
Definition: gdi.h:10420
Uint8 alpha
Definition: gdi.h:10346
int bbox_x
Definition: gdi.h:12739
MG_EXPORT BOOL GUIAPI XorRegion(CLIPRGN *dst, const CLIPRGN *src1, const CLIPRGN *src2)
Does the XOR operation between two regions.
GHANDLE HPALETTE
Handle to a logical palette.
Definition: common.h:412
MG_EXPORT void GUIAPI PolyLineEx(HDC hdc, const POINT *pts, int nr_pts)
Draws a polyline with the current pen in 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.
Definition: gdi.h:2741
int bbox_x
Definition: gdi.h:6929
Uint32 transparent
Definition: gdi.h:10349
size_t bmp_size
Definition: gdi.h:6934
Definition: common.h:1001
MG_EXPORT void GUIAPI FillEllipse(HDC hdc, int sx, int sy, int rx, int ry)
Fills an ellipse.
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 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 IsUCharUppercase(Uchar32 uc)
MG_EXPORT BOOL GUIAPI PolygonGeneratorEx(void *context, const POINT *pts, int vertices, CB_POLYGON cb, RECT *rc_output)
A general polygon generator.
int angle2
Definition: gdi.h:3953
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 unsigned int GUIAPI GetGDCapability(HDC hdc, int iItem)
Returns a capability of a DC.
MG_EXPORT BOOL GUIAPI SetTextColorInTextRuns(TEXTRUNS *truns, int start_index, int length, RGBCOLOR color)
Set text color in a TEXTRUNS object.
MG_EXPORT void GUIAPI DestroyPalette(HPALETTE hpal)
Destroy a logical palette.
struct _CLIPRECT * prev
Definition: gdi.h:591
MG_EXPORT int GUIAPI GetClipBox(HDC hdc, RECT *clipbox)
Retrieves the bounding rectangle of the current clipping region of a DC.
MG_EXPORT void GUIAPI DrawIcon(HDC hdc, int x, int y, int w, int h, HICON hicon)
Draws an icon into a box.
MG_EXPORT BOOL GUIAPI IsUCharPunct(Uchar32 uc)
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...
Uint8 bmBytesPerPixel
Definition: gdi.h:10411
int width
Definition: gdi.h:3801
PCLIPRECT head
Definition: gdi.h:626
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.
int pitch
Definition: gdi.h:3806
const MG_EXPORT RGB SysPixelColor[]
The pre-defined system RGB colors.
MG_EXPORT BOOL GUIAPI GetLayoutLineSize(const LAYOUTLINE *line, SIZE *line_size)
Get the size of a layout line.
MG_EXPORT void GUIAPI HFlipBitmap(BITMAP *bmp, unsigned char *inter_buff)
Horizontal Flip the special Bitmap object.
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.
PBLOCKHEAP heap
Definition: gdi.h:635
MG_EXPORT PCLIPRGN GUIAPI CreateClipRgn(void)
Creates a clipping region.
MG_EXPORT UCharGeneralCategory GUIAPI UCharGetCategory(Uchar32 uc)
Get the general category of a Unicode character.
MG_EXPORT void GUIAPI SetDCLCS(HDC hdc, int which, const POINT *pt)
Sets mapping parameters of a device context.
MG_EXPORT LAYOUT *GUIAPI CreateLayout(const TEXTRUNS *truns, Uint32 render_flags, const BreakOppo *break_oppos, BOOL persist_lines, int max_line_extent, int indent, int letter_spacing, int word_spacing, int tab_size, int *tabs, int nr_tabs)
Create layout information structure for laying out a paragraph.
static void InflateRectToPt(RECT *prc, int x, int y)
Inflates a rectangle to contain a point.
Definition: gdi.h:5256
BYTE * bits
Definition: gdi.h:10361
MG_EXPORT void GUIAPI OffsetRegion(PCLIPRGN region, int x, int y)
Offsets the region.
Uint16 ParagraphDir
Definition: gdi.h:8077
MG_EXPORT void GUIAPI RotateBitmap(HDC hdc, const BITMAP *bmp, int lx, int ty, int angle)
Rotate a bitmap object.
#define MAKEDWORD32(first, second, third, fourth)
Makes a WORD32 value with four bytes.
Definition: common.h:747
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 void GUIAPI GetBoundsRect(HDC hdc, RECT *pRect)
Retrieves the bounding rectangle of the current visible region of a 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 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...
MG_EXPORT PLOGFONT GUIAPI CreateLogFontByName(const char *font_name)
Creates a logical font by a font name.
MG_EXPORT void GUIAPI DeletePrivateDC(HDC hdc)
Deletes the DC returned by CreatePrivateDC or CreatePrivateClientDC or CreatePrivateSubDC.
struct _MYBITMAP * PMYBITMAP
Data type of pointer to a struct _MYBITMAP.
Definition: gdi.h:539
MG_EXPORT int GUIAPI SetBitmapKeyColor(HDC hdc, PBITMAP bmp, Uint8 r, Uint8 g, Uint8 b)
Set the bitmap color key.
MG_EXPORT BidiBracketType GUIAPI UCharGetBracketType(Uchar32 ch)
Get bracketed character.
const unsigned char * bits
Definition: gdi.h:6938
long fixed
Data type of fixed point.
Definition: common.h:1106
ScriptType
Definition: gdi.h:6299
Uint8 * bmAlphaMask
Definition: gdi.h:10433
unsigned int Uint32
A type definition for a 32-bit unsigned integer.
Definition: common.h:174
MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevelsAlt(const Uchar32 *ucs, int nr_ucs, ParagraphDir *paragraph_dir, BidiLevel *embedding_levels)
An alternative of UBidiGetParagraphEmbeddingLevels().
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.
Uint8 orientation
Definition: gdi.h:12765
MG_EXPORT void GUIAPI ExcludeClipRect(HDC hdc, const RECT *prc)
Excludes the specified rectangle from the current visible region of a DC.
int nr_chars
Definition: gdi.h:10163
size_t size
Definition: gdi.h:3809
MG_EXPORT HPALETTE GUIAPI GetDefaultPalette(void)
Gets the system default logical palette.
Uint8 BidiArabicProp
Definition: gdi.h:8065
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:599
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.
LOGFONT * PLOGFONT
Data type of pointer to a LOGFONT.
Definition: gdi.h:5799
Uint32 size
Definition: gdi.h:10358
MG_EXPORT BOOL GUIAPI IsUCharLowercase(Uchar32 uc)
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 LoadMyBitmapFromMem(PMYBITMAP my_bmp, RGB *pal, const void *mem, int size, const char *ext)
Loads a MYBITMAP object from memory.
MG_EXPORT const ScriptType *GUIAPI GetScriptsForLang(const char *lang_name, LanguageCode *lang_code, int *nr_scripts)
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.
This file includes functions for reading and writing data from general sources, such as file...
UCharGeneralCategory
Definition: gdi.h:5994
MG_EXPORT int GUIAPI LoadBitmapFromFile(HDC hdc, PBITMAP pBitmap, const char *spFileName)
Loads a device-dependent bitmap from a file.
int startx
Definition: gdi.h:10165
MG_EXPORT int GUIAPI UChars2AChars(LOGFONT *logfont, const Uchar32 *ucs, Achar32 *acs, int n)
Convert an Uchar32 array to Unicode character array.
int left
Definition: common.h:929
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.
Definition: gdi.h:10373
MG_EXPORT BOOL GUIAPI UCharCompose(Uchar32 a, Uchar32 b, Uchar32 *ch)
Definition: gdi.h:6849
MG_EXPORT void GUIAPI UStrGetBidiTypes(const Uchar32 *ucs, int nr_ucs, BidiType *bdts)
Get bidi types for an string of Unicode characters.
MG_EXPORT BOOL GUIAPI BIDILogAChars2VisACharsEx(LOGFONT *log_font, Achar32 *achars, int nr_achars, int pel, void *extra, CB_REVERSE_ARRAY cb_reverse_extra)
Reorder the specified logical glyph string in visual order and reorder an extra array to reflect the ...
static PLOGFONT GUIAPI GetSystemFont(int font_id)
Gets the system logical font through an font identifier.
Definition: gdi.h:7602
MG_EXPORT RGBCOLOR GUIAPI GetBackgroundColorInTextRuns(const TEXTRUNS *truns, int index)
MG_EXPORT HDC GUIAPI GetDC(HWND hwnd)
Gets a window DC of a window.
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 lo...
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 Uchar32 GUIAPI UCharToFullSizeKana(Uchar32 uc)
MG_EXPORT PLOGFONT GUIAPI SelectFont(HDC hdc, PLOGFONT log_font)
Selects a logical font into a DC.
MG_EXPORT Uchar32 GUIAPI UCharToLower(Uchar32 uc)
MG_EXPORT void GUIAPI NormalizeRect(RECT *pRect)
Normalizes a rectangle.
int height
Definition: gdi.h:10171
static BOOL GUIAPI SetPixelInBitmap(const BITMAP *bmp, int x, int y, gal_pixel pixel)
Sets pixel value in a BITMAP object.
Definition: gdi.h:4959
MG_EXPORT void GUIAPI TermVectorialFonts(void)
Terminates vectorial font renderer.
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 t...
int width
Definition: gdi.h:10169
MG_EXPORT BOOL GUIAPI SubtractClipRect(PCLIPRGN pRgn, const RECT *pRect)
Subtracts a rectangle from a region.
MG_EXPORT BOOL GUIAPI ft2SetLcdFilter(LOGFONT *logfont, FT2LCDFilter filter)
Set freetype2 smooth mode.
MG_EXPORT void GUIAPI TerminateSlaveScreen(HDC hdc)
Terminates slave screen.
MG_EXPORT BOOL GUIAPI InitBasicShapingEngine(TEXTRUNS *truns)
Initialize the base shaping engine for a TEXTRUNS object.
int max_width
Definition: gdi.h:6904
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.
char * family
Definition: gdi.h:5768
MG_EXPORT BOOL GUIAPI IsRectEmpty(const RECT *prc)
Determines whether an rectangle is empty.
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 BOOL GUIAPI EqualRect(const RECT *prc1, const RECT *prc2)
Determines whether two rectangles are equal.
MG_EXPORT void GUIAPI PolyFillArcEx(HDC hdc, const ARC *arcs, int nr_arcs)
Fill a polyarc with the current brush in a DC.
int advance
Definition: gdi.h:12791
#define FALSE
FALSE value, defined as 0 by MiniGUI.
Definition: common.h:346
MG_EXPORT void DestroyBlockDataHeap(PBLOCKHEAP heap)
Destroys a private block data heap.
MG_EXPORT int GUIAPI GetSysCharWidth(void)
Gets the width of a single-byte character of the default system font.
Definition: gdi.h:5764
MG_EXPORT HDC GUIAPI SetSecondaryDC(HWND hwnd, HDC secondary_dc, ON_UPDATE_SECONDARYDC on_update_secondarydc)
Set a window&#39;s secondary DC and the callback procedure for the secondary DC update.
Definition: gdi.h:3561
MG_EXPORT void GUIAPI PolyArcEx(HDC hdc, const ARC *arcs, int nr_arcs)
Draws a polyarc with the current pen in a DC.
unsigned int UINT
A type definition for unsigned integer.
Definition: common.h:659
int font_height
Definition: gdi.h:6897
struct _CLIPRECT CLIPRECT
MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirectEx(LOGFONT *logfont, int rotation)
Creates a new logical font indirectly from a LOGFONT structure with a rotation degrees.
unsigned int DWORD32
A type definition for a 32-bit unsigned integer.
Definition: common.h:605
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 void GUIAPI CircleArc(HDC hdc, int sx, int sy, int r, int ang1, int ang2)
Draws an arc.
MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types, const BidiBracketType *bracket_types, int len, ParagraphDir *paragraph_dir, BidiLevel *embedding_levels)
Get bidi embedding levels of a paragraph.
int top
Definition: common.h:933
MG_EXPORT HDC GUIAPI CreatePrivateDC(HWND hwnd)
Creates a private window DC of a window.
MG_EXPORT void GUIAPI UnloadBitmap(PBITMAP pBitmap)
Unloads a bitmap.
MG_EXPORT HICON GUIAPI LoadIconFromMem(HDC hdc, const void *area, int which)
Loads an icon from a memory area.
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.
size_t heap_size
Definition: gdi.h:416
MG_EXPORT int DrawLayoutLine(HDC hdc, const LAYOUTLINE *line, int x, int y)
Draw a laid out line at the specific position.
MG_EXPORT BOOL GUIAPI FillPolygon(HDC hdc, const POINT *pts, int vertices)
Fills an polygon.
BYTE b
Definition: common.h:1014
MG_EXPORT void GUIAPI UStrGetJoiningTypes(const Uchar32 *ucs, int nr_ucs, BidiJoiningType *joining_types)
Get joining types for a string of Unicode characters.
MG_EXPORT HDC GUIAPI GetSecondaryClientDC(HWND hwnd)
Retrives and returns the client secondary DC of a specific window.
MG_EXPORT Uint32 GUIAPI SetDCAttr(HDC hdc, int attr, Uint32 value)
Sets a specified attribute value of a DC.
Definition: gdi.h:578
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.
Definition: gdi.h:2832
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.
struct _GLYPHEXTINFO GLYPHEXTINFO
int nr_delimiters
Definition: gdi.h:7737
MG_EXPORT void GUIAPI VFlipBitmap(BITMAP *bmp, unsigned char *inter_buff)
Vertical Flip the special Bitmap object.
MG_EXPORT int GUIAPI CleanupMyBitmapSL(MYBITMAP *my_bmp, void *load_info)
Cleanups the scanline loader.
MG_EXPORT void GUIAPI IncludeClipRect(HDC hdc, const RECT *prc)
Includes the specified rectangle to the current visible region of a DC.
size_t bd_size
Definition: gdi.h:412
BLOCKHEAP * PBLOCKHEAP
Data type of the pointer to a BLOCKHEAP.
Definition: gdi.h:433
MG_EXPORT BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32 *mirrored)
Get mirrored character.
Uint16 BidiType
Definition: gdi.h:8052
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 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 BOOL GUIAPI IsUCharMark(Uchar32 uc)
MG_EXPORT int GUIAPI TextOutLen(HDC hdc, int x, int y, const char *spText, int len)
Outputs a string of text.
MG_EXPORT HICON GUIAPI LoadIconFromFile(HDC hdc, const char *filename, int which)
Loads an icon from a Windows ICO file.
MG_EXPORT BOOL GUIAPI IsUCharZeroWidth(Uchar32 uc)
MG_EXPORT BOOL GUIAPI PtVisible(HDC hdc, int x, int y)
Checks whether a point is visible.
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.
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 PLOGFONT GUIAPI GetCurFont(HDC hdc)
Gets the pointer to the current logical font of a DC.
MG_EXPORT BOOL GUIAPI PtInRegion(PCLIPRGN region, int x, int y)
Determines whether a point is in a region.
MG_EXPORT BOOL GUIAPI FloodFill(HDC hdc, int x, int y)
Fills an enclosed area starting at point (x,y).
const LOGFONT * CPLOGFONT
Data type of pointer to a LOGFONT.
Definition: gdi.h:5805
MG_EXPORT BOOL GUIAPI IsUCharAlpha(Uchar32 uc)
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 BOOL GUIAPI RectVisible(HDC hdc, const RECT *pRect)
Checks whether the specified rectangle is visible.
MG_EXPORT void GUIAPI SplineTo(HDC hdc, const POINT *pts)
Draws a bezier spline.
int ascent
Definition: gdi.h:6899
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.
BYTE r
Definition: common.h:1006
MG_EXPORT BOOL GUIAPI IsUCharDefined(Uchar32 uc)
Definition: gdi.h:3755
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 int GUIAPI GetTextExtent(HDC hdc, const char *spText, int len, SIZE *pSize)
Computes the output extent of a string of text.
MG_EXPORT Uint32 GUIAPI ScriptTypeToISO15924(ScriptType script)
static HDC GUIAPI CreateMemDC(int width, int height, int depth, DWORD flags, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
Creates a memory DC.
Definition: gdi.h:1472
BYTE a
Definition: common.h:1018
static void InflateRect(RECT *prc, int cx, int cy)
Increases or decreases the width and height of an rectangle.
Definition: gdi.h:5237
MG_EXPORT BOOL GUIAPI UChar2AChar(LOGFONT *logfont, Uchar32 uc, Achar32 *ac)
Get the LOGFONT Achar32 value from a Unicode character value.
BITMAP * PBITMAP
Data type of pointer to a BITMAP.
Definition: gdi.h:524
void(* CB_POLYGON)(void *context, int x1, int x2, int y)
The type of polygon generator callback.
Definition: gdi.h:3166
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 SaveBitmapToFile(HDC hdc, PBITMAP pBitmap, const char *spFileName)
Saves a BITMAP object to a bitmap file.
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 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 int GUIAPI SetBitmapScalerType(HDC hdc, int scaler_type)
set bitmap scaler algorithm callback of DC according by scaler_type.
MG_EXPORT void GUIAPI DestroyLogFont(PLOGFONT log_font)
Destroys a logical font.
GHANDLE HICON
Handle to icon.
Definition: common.h:422
PCLIPRECT tail
Definition: gdi.h:630
MG_EXPORT int GUIAPI GetSysFontMaxWidth(int font_id)
Gets the maximal width of a single-byte character of a system font.
MG_EXPORT const char *GUIAPI GetFontNameInTextRuns(const TEXTRUNS *truns, int index)
MG_EXPORT ScriptType GUIAPI ScriptTypeFromISO15924(Uint32 iso15924)
Get the ScriptType value from an encoded ISO15924 script code.
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.