MiniGUI API Reference (MiniGUI-Processes)  v4.0.7
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 Uint32 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 
1404 MG_EXPORT BOOL GUIAPI IsMemDC (HDC hdc);
1405 
1418 MG_EXPORT BOOL GUIAPI IsScreenDC (HDC hdc);
1419 
1432 MG_EXPORT BOOL GUIAPI IsWindowDC (HDC hdc);
1433 
1477 MG_EXPORT HDC GUIAPI CreateMemDCEx (int width, int height, int depth, DWORD flags,
1478  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask,
1479  void* bits, int pitch);
1480 
1514 static inline HDC GUIAPI CreateMemDC (int width, int height, int depth, DWORD flags,
1515  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
1516 {
1517  return CreateMemDCEx (width, height, depth, flags, Rmask, Gmask, Bmask, Amask,
1518  NULL, 0);
1519 }
1520 
1545 MG_EXPORT HDC GUIAPI CreateSubMemDC (HDC parent, int off_x, int off_y,
1546  int width, int height, BOOL comp_to_parent);
1547 
1563 MG_EXPORT HDC GUIAPI CreateMemDCFromBitmap (HDC hdc, const BITMAP* bmp);
1564 
1590 MG_EXPORT HDC GUIAPI CreateMemDCFromMyBitmap (const MYBITMAP* my_bmp, const RGB* pal);
1591 
1615 MG_EXPORT BOOL GUIAPI ConvertMemDC (HDC mem_dc, HDC ref_dc, DWORD flags);
1616 
1646 MG_EXPORT BOOL GUIAPI SetMemDCAlpha (HDC mem_dc, DWORD flags, Uint8 alpha);
1647 
1667 MG_EXPORT BOOL GUIAPI SetMemDCColorKey (HDC mem_dc, DWORD flags,
1668  Uint32 color_key);
1669 
1682 MG_EXPORT void GUIAPI DeleteMemDC (HDC mem_dc);
1683 
1696 #define CreateCompatibleDC(hdc) CreateCompatibleDCEx(hdc, 0, 0)
1697 
1708 #define DeleteCompatibleDC(hdc) DeleteMemDC(hdc)
1709 
1747 MG_EXPORT Uint8* GUIAPI LockDC (HDC hdc, const RECT* rw_rc,
1748  int* width, int* height, int* pitch);
1749 
1766 typedef void (* CB_DIRECT_DRAW_RECT) (HDC hdc, Uint8 * pixels,
1767  int pitch, int bytesPerPixel, const RECT* rc, void* context);
1768 
1795 MG_EXPORT BOOL GUIAPI LockDCEx (HDC hdc, const PCLIPRGN region,
1796  void* context, CB_DIRECT_DRAW_RECT cb);
1797 
1806 MG_EXPORT void GUIAPI UnlockDC (HDC hdc);
1807 
1826 MG_EXPORT HDC GUIAPI CreatePrivateDC (HWND hwnd);
1827 
1847 MG_EXPORT HDC GUIAPI CreatePrivateClientDC (HWND hwnd);
1848 
1875 HDC GUIAPI CreatePrivateSubDC(HDC hdc, int off_x, int off_y,
1876  int width, int height);
1877 
1899 MG_EXPORT HDC GUIAPI GetPrivateClientDC (HWND hwnd);
1900 
1910 MG_EXPORT void GUIAPI DeletePrivateDC (HDC hdc);
1911 
1934 MG_EXPORT HDC GUIAPI CreateSecondaryDC (HWND hwnd);
1935 
1951 typedef int (* ON_UPDATE_SECONDARYDC)(HWND hwnd, HDC secondary_dc,
1952  HDC real_dc, const RECT* secondary_rc, const RECT* real_rc,
1953  const RECT* main_update_rc);
1954 
1955 #define ON_UPDSECDC_DEFAULT ((ON_UPDATE_SECONDARYDC)0)
1956 #define ON_UPDSECDC_DONOTHING ((ON_UPDATE_SECONDARYDC)-1)
1957 
1983 MG_EXPORT HDC GUIAPI SetSecondaryDC (HWND hwnd, HDC secondary_dc,
1984  ON_UPDATE_SECONDARYDC on_update_secondarydc);
1985 
2002 MG_EXPORT HDC GUIAPI GetSecondaryDC (HWND hwnd);
2003 
2020 MG_EXPORT HDC GUIAPI GetSecondaryClientDC (HWND hwnd);
2021 
2033 MG_EXPORT void GUIAPI ReleaseSecondaryDC (HWND hwnd, HDC hdc);
2034 
2043 MG_EXPORT void GUIAPI DeleteSecondaryDC (HWND hwnd);
2044 
2057 MG_EXPORT BOOL GUIAPI SyncUpdateDC (HDC hdc);
2058 
2066 #define BM_TRANSPARENT 1
2067 #define BM_OPAQUE 0
2068 
2069 #define DC_ATTR_BK_COLOR 0
2070 #define DC_ATTR_PEN_COLOR 1
2071 #define DC_ATTR_BRUSH_COLOR 2
2072 #define DC_ATTR_TEXT_COLOR 3
2073 
2074 #define DC_ATTR_BK_MODE 4
2075 
2076 #define DC_ATTR_TAB_STOP 5
2077 #define DC_ATTR_CHAR_EXTRA 6
2078 #define DC_ATTR_WORD_EXTRA 7
2079 #define DC_ATTR_ALINE_EXTRA 8
2080 #define DC_ATTR_BLINE_EXTRA 9
2081 
2082 #define DC_ATTR_MAP_MODE 10
2083 
2084 #define DC_ATTR_TEXT_ALIGN 11
2085 
2086 #define DC_ATTR_BIDI_FLAGS 12
2087 
2088 #ifdef _MGHAVE_ADV_2DAPI
2089 # define DC_ATTR_PEN_TYPE 13
2090 # define DC_ATTR_PEN_CAP_STYLE 14
2091 # define DC_ATTR_PEN_JOIN_STYLE 15
2092 # define DC_ATTR_PEN_WIDTH 16
2093 # define DC_ATTR_BRUSH_TYPE 17
2094 # define NR_DC_ATTRS 18
2095 #else /* _MGHAVE_ADV_2DAPI */
2096 # define NR_DC_ATTRS 13
2097 #endif /* !_MGHAVE_ADV_2DAPI */
2098 
2099 
2147 MG_EXPORT Uint32 GUIAPI GetDCAttr (HDC hdc, int attr);
2148 
2162 MG_EXPORT Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value);
2163 
2173 #define GetBkColor(hdc) GetDCAttr (hdc, DC_ATTR_BK_COLOR)
2174 
2190 #define GetBkMode(hdc) GetDCAttr (hdc, DC_ATTR_BK_MODE)
2191 
2201 #define GetPenColor(hdc) GetDCAttr (hdc, DC_ATTR_PEN_COLOR)
2202 
2212 #define GetBrushColor(hdc) GetDCAttr (hdc, DC_ATTR_BRUSH_COLOR)
2213 
2223 #define GetTextColor(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_COLOR)
2224 
2234 #define GetTabStop(hdc) GetDCAttr (hdc, DC_ATTR_TAB_STOP)
2235 
2246 #define SetBkColor(hdc, color) \
2247  SetDCAttr (hdc, DC_ATTR_BK_COLOR, (DWORD) color)
2248 
2266 #define SetBkMode(hdc, mode) \
2267  SetDCAttr (hdc, DC_ATTR_BK_MODE, (DWORD) mode)
2268 
2279 #define SetPenColor(hdc, color) \
2280  SetDCAttr (hdc, DC_ATTR_PEN_COLOR, (DWORD) color)
2281 
2292 #define SetBrushColor(hdc, color) \
2293  SetDCAttr (hdc, DC_ATTR_BRUSH_COLOR, (DWORD) color)
2294 
2305 #define SetTextColor(hdc, color) \
2306  SetDCAttr (hdc, DC_ATTR_TEXT_COLOR, (DWORD) color)
2307 
2318 #define SetTabStop(hdc, value) \
2319  SetDCAttr (hdc, DC_ATTR_TAB_STOP, (DWORD) value)
2320 
2321 #define ROP_SET 0
2322 #define ROP_AND 1
2323 #define ROP_OR 2
2324 #define ROP_XOR 3
2325 #define ROP_COMPOSITE 4
2326 #define ROP_COMP_USER 0x0100
2327 /* Reserved for future
2328  * #define ROP_COMP_XXX 0x01XX
2329  */
2330 
2355 MG_EXPORT int GUIAPI GetRasterOperation (HDC hdc);
2356 
2384 MG_EXPORT int GUIAPI SetRasterOperation (HDC hdc, int rop);
2385 
2408 MG_EXPORT int GUIAPI GetPalette (HDC hdc, int start, int len, GAL_Color* cmap);
2409 
2424 MG_EXPORT BOOL GUIAPI SetPalette (HDC hdc, int start, int len, GAL_Color* cmap);
2425 
2437 MG_EXPORT BOOL GUIAPI SetColorfulPalette (HDC hdc);
2438 
2452 MG_EXPORT HPALETTE GUIAPI CreatePalette (GAL_Palette* pal);
2453 
2469 MG_EXPORT BOOL GUIAPI SelectPalette (HDC hdc, HPALETTE hpal, BOOL reserved);
2470 
2492 MG_EXPORT BOOL GUIAPI RealizePalette (HDC hdc);
2493 
2507 MG_EXPORT BOOL GUIAPI ResizePalette (HPALETTE hpal, int len);
2508 
2519 MG_EXPORT void GUIAPI DestroyPalette (HPALETTE hpal);
2520 
2529 MG_EXPORT HPALETTE GUIAPI GetDefaultPalette (void);
2530 
2547 MG_EXPORT int GUIAPI GetPaletteEntries (HPALETTE hpal,
2548  int start, int len, GAL_Color* cmap);
2549 
2566 MG_EXPORT int GUIAPI SetPaletteEntries (HPALETTE hpal,
2567  int start, int len, GAL_Color* cmap);
2568 
2587 MG_EXPORT UINT GUIAPI GetNearestPaletteIndex (HPALETTE hpal,
2588  Uint8 red, Uint8 green, Uint8 blue);
2589 
2607 MG_EXPORT RGBCOLOR GUIAPI GetNearestColor (HDC hdc,
2608  Uint8 red, Uint8 green, Uint8 blue);
2609 
2633 MG_EXPORT void GUIAPI SetPixel (HDC hdc, int x, int y, gal_pixel pixel);
2634 
2653 MG_EXPORT gal_pixel GUIAPI SetPixelRGB (HDC hdc, int x, int y,
2654  Uint8 r, Uint8 g, Uint8 b);
2655 
2676 MG_EXPORT gal_pixel GUIAPI SetPixelRGBA (HDC hdc, int x, int y,
2677  Uint8 r, Uint8 g, Uint8 b, Uint8 a);
2678 
2694 MG_EXPORT gal_pixel GUIAPI GetPixel (HDC hdc, int x, int y);
2695 
2717 MG_EXPORT gal_pixel GUIAPI GetPixelRGB (HDC hdc, int x, int y,
2718  Uint8* r, Uint8* g, Uint8* b);
2719 
2745 MG_EXPORT gal_pixel GUIAPI GetPixelRGBA (HDC hdc, int x, int y,
2746  Uint8* r, Uint8* g, Uint8* b, Uint8* a);
2747 
2762 MG_EXPORT void GUIAPI RGBA2Pixels (HDC hdc, const RGB* rgbs,
2763  gal_pixel* pixels, int count);
2764 
2783 static inline gal_pixel RGBA2Pixel (HDC hdc,
2784  Uint8 r, Uint8 g, Uint8 b, Uint8 a)
2785 {
2786  RGB rgb = {r, g, b, a};
2787  gal_pixel pixel;
2788 
2789  RGBA2Pixels (hdc, &rgb, &pixel, 1);
2790  return pixel;
2791 }
2792 
2807 MG_EXPORT void GUIAPI RGB2Pixels (HDC hdc, const RGB* rgbs,
2808  gal_pixel* pixels, int count);
2809 
2827 static inline gal_pixel RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b)
2828 {
2829  RGB rgb = {r, g, b, 0xFF};
2830  gal_pixel pixel;
2831 
2832  RGB2Pixels (hdc, &rgb, &pixel, 1);
2833  return pixel;
2834 }
2835 
2850 MG_EXPORT void GUIAPI Pixel2RGBs (HDC hdc, const gal_pixel* pixels,
2851  RGB* rgbs, int count);
2852 
2874 static inline void Pixel2RGB (HDC hdc, gal_pixel pixel,
2875  Uint8* r, Uint8* g, Uint8* b)
2876 {
2877  RGB rgb;
2878  Pixel2RGBs (hdc, &pixel, &rgb, 1);
2879  *r = rgb.r; *g = rgb.g, *b = rgb.b;
2880 }
2881 
2896 MG_EXPORT void GUIAPI Pixel2RGBAs (HDC hdc, const gal_pixel* pixels,
2897  RGB* rgbs, int count);
2898 
2922 static inline void Pixel2RGBA (HDC hdc, gal_pixel pixel,
2923  Uint8* r, Uint8* g, Uint8* b, Uint8* a)
2924 {
2925  RGB rgb;
2926  Pixel2RGBAs (hdc, &pixel, &rgb, 1);
2927  *r = rgb.r; *g = rgb.g, *b = rgb.b; *a = rgb.a;
2928 }
2929 
2940 static inline DWORD Pixel2DWORD (HDC hdc, gal_pixel pixel)
2941 {
2942  Uint8 r,g,b,a;
2943  Pixel2RGBA (hdc, pixel, &r, &g, &b, &a);
2944  return MakeRGBA (r, g, b, a);
2945 }
2946 
2947 #define PIXEL2DWORD(hdc, pixel) Pixel2DWORD(hdc, pixel)
2948 
2959 static inline gal_pixel DWORD2Pixel (HDC hdc, DWORD dword)
2960 {
2961  return RGBA2Pixel (hdc,
2962  GetRValue(dword), GetGValue(dword),
2963  GetBValue(dword), GetAValue(dword));
2964 }
2965 
2983 MG_EXPORT void GUIAPI FocusRect (HDC hdc, int x0, int y0, int x1, int y1);
2984 
3002 MG_EXPORT void GUIAPI DrawHVDotLine (HDC hdc, int x, int y, int w_h, BOOL H_V);
3003 
3020 #define DrawHDotLine(hdc, x, y, w) DrawHVDotLine (hdc, x, y, w, TRUE);
3021 
3038 #define DrawVDotLine(hdc, x, y, h) DrawHVDotLine (hdc, x, y, h, FALSE);
3039 
3069 MG_EXPORT BOOL GUIAPI LineClipper (const RECT* cliprc,
3070  int *_x0, int *_y0, int *_x1, int *_y1);
3071 
3076 typedef void (* CB_LINE) (void* context, int stepx, int stepy);
3077 
3100 MG_EXPORT void GUIAPI LineGenerator (void* context,
3101  int x1, int y1, int x2, int y2, CB_LINE cb);
3102 
3107 typedef void (* CB_CIRCLE) (void* context, int x1, int x2, int y);
3108 
3136 MG_EXPORT void GUIAPI CircleGenerator (void* context,
3137  int sx, int sy, int r, CB_CIRCLE cb);
3138 
3143 typedef void (* CB_ELLIPSE) (void* context, int x1, int x2, int y);
3144 
3169 MG_EXPORT void GUIAPI EllipseGenerator (void* context,
3170  int sx, int sy, int rx, int ry, CB_ELLIPSE cb);
3171 
3176 typedef void (* CB_ARC) (void* context, int x, int y);
3177 
3201 MG_EXPORT void GUIAPI CircleArcGenerator (void* context,
3202  int sx, int sy, int r, int ang1, int ang2, CB_ARC cb);
3203 
3208 typedef void (* CB_POLYGON) (void* context, int x1, int x2, int y);
3209 
3248 MG_EXPORT BOOL GUIAPI MonotoneVerticalPolygonGenerator (void* context,
3249  const POINT* pts, int vertices, CB_POLYGON cb);
3250 
3268 MG_EXPORT BOOL GUIAPI PolygonIsMonotoneVertical (const POINT* pts,
3269  int vertices);
3270 
3297 MG_EXPORT BOOL GUIAPI PolygonGeneratorEx (void* context,
3298  const POINT* pts, int vertices, CB_POLYGON cb, RECT* rc_output);
3308 #define PolygonGenerator(context, pts, vertices, cb) \
3309  PolygonGeneratorEx(context, pts, vertices, cb, NULL)
3310 
3315 typedef BOOL (* CB_EQUAL_PIXEL) (void* context, int x, int y);
3316 
3321 typedef void (* CB_FLOOD_FILL) (void* context, int x1, int x2, int y);
3322 
3343 MG_EXPORT BOOL GUIAPI FloodFillGenerator (void* context,
3344  const RECT* src_rc, int x, int y,
3345  CB_EQUAL_PIXEL cb_equal_pixel, CB_FLOOD_FILL cb_flood_fill);
3346 
3347 /* DDA algorithm */
3348 #define BITMAP_SCALER_DDA 0
3349 /* Bilinear interpolation algorithm */
3350 #define BITMAP_SCALER_BILINEAR 1
3351 
3368 MG_EXPORT int GUIAPI SetBitmapScalerType (HDC hdc, int scaler_type);
3369 
3383 MG_EXPORT void GUIAPI MoveTo (HDC hdc, int x, int y);
3384 
3399 MG_EXPORT void GUIAPI LineTo (HDC hdc, int x, int y);
3400 
3416 MG_EXPORT void GUIAPI Rectangle (HDC hdc, int x0, int y0, int x1, int y1);
3417 
3432 MG_EXPORT void GUIAPI PolyLineTo (HDC hdc, const POINT* pts, int vertices);
3433 
3448 MG_EXPORT void GUIAPI SplineTo (HDC hdc, const POINT* pts);
3449 
3464 MG_EXPORT void GUIAPI Circle (HDC hdc, int sx, int sy, int r);
3465 
3482 MG_EXPORT void GUIAPI Ellipse (HDC hdc, int sx, int sy, int rx, int ry);
3483 
3505 MG_EXPORT void GUIAPI CircleArc (HDC hdc, int sx, int sy, int r,
3506  int ang1, int ang2);
3507 
3522 MG_EXPORT void GUIAPI FillBox (HDC hdc, int x, int y, int w, int h);
3523 
3537 MG_EXPORT void GUIAPI FillCircle (HDC hdc, int sx, int sy, int r);
3538 
3555 MG_EXPORT void GUIAPI FillEllipse (HDC hdc, int sx, int sy, int rx, int ry);
3556 
3570 MG_EXPORT BOOL GUIAPI FillPolygon (HDC hdc, const POINT* pts, int vertices);
3571 
3585 MG_EXPORT BOOL GUIAPI FloodFill (HDC hdc, int x, int y);
3586 
3587 #ifdef _MGHAVE_ADV_2DAPI
3588 
3597 typedef enum
3598 {
3616 } PenType;
3617 
3627 #define GetPenType(hdc) \
3628  GetDCAttr (hdc, DC_ATTR_PEN_TYPE)
3629 
3640 #define SetPenType(hdc, type) \
3641  SetDCAttr (hdc, DC_ATTR_PEN_TYPE, (DWORD) type)
3642 
3662 MG_EXPORT void GUIAPI SetPenDashes (HDC hdc, int dash_offset,
3663  const unsigned char* dash_list, int n);
3664 
3668 typedef enum
3669 {
3685 } PTCapStyle;
3686 
3696 #define GetPenCapStyle(hdc) \
3697  GetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE)
3698 
3709 #define SetPenCapStyle(hdc, style) \
3710  SetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE, (DWORD) style)
3711 
3715 typedef enum
3716 {
3730 } PTJoinStyle;
3731 
3741 #define GetPenJoinStyle(hdc) GetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE)
3742 
3753 #define SetPenJoinStyle(hdc, style) \
3754  SetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE, (DWORD) style)
3755 
3765 #define GetPenWidth(hdc) \
3766  GetDCAttr (hdc, DC_ATTR_PEN_WIDTH)
3767 
3778 #define SetPenWidth(hdc, width) \
3779  SetDCAttr (hdc, DC_ATTR_PEN_WIDTH, (DWORD) width)
3780 
3788 typedef enum
3789 {
3812 } BrushType;
3813 
3823 #define GetBrushType(hdc) \
3824  GetDCAttr (hdc, DC_ATTR_BRUSH_TYPE)
3825 
3836 #define SetBrushType(hdc, type) \
3837  SetDCAttr (hdc, DC_ATTR_BRUSH_TYPE, (DWORD) type)
3838 
3840 typedef struct _STIPPLE
3841 {
3843  int width;
3845  int height;
3846 
3848  int pitch;
3849 
3851  size_t size;
3852 
3854  const unsigned char* bits;
3855 } STIPPLE;
3856 
3868 MG_EXPORT void GUIAPI SetBrushInfo (HDC hdc,
3869  const BITMAP* tile, const STIPPLE* stipple);
3870 
3885 MG_EXPORT void GUIAPI SetBrushOrigin (HDC hdc, int x, int y);
3886 
3904 MG_EXPORT void GUIAPI LineEx (HDC hdc, int x1, int y1, int x2, int y2);
3905 
3929 MG_EXPORT void GUIAPI ArcEx (HDC hdc, int x, int y, int width, int height,
3930  int ang1, int ang2);
3931 
3955 MG_EXPORT void GUIAPI FillArcEx (HDC hdc, int x, int y, int width, int height,
3956  int ang1, int ang2);
3957 
3970 MG_EXPORT void GUIAPI PolyLineEx (HDC hdc, const POINT* pts, int nr_pts);
3971 
3975 typedef struct _ARC
3976 {
3978  int x;
3980  int y;
3981 
3983  int width;
3985  int height;
3986 
3991  int angle1;
3995  int angle2;
3996 } ARC;
3997 
4010 MG_EXPORT void GUIAPI PolyArcEx (HDC hdc, const ARC* arcs, int nr_arcs);
4011 
4024 MG_EXPORT void GUIAPI PolyFillArcEx (HDC hdc, const ARC* arcs, int nr_arcs);
4025 
4044 MG_EXPORT BOOL GUIAPI RoundRect (HDC hdc, int x0, int y0, int x1, int y1, int cw, int ch);
4045 
4049 #endif
4050 
4096 #define MM_TEXT 0
4097 #define MM_ANISOTROPIC 1
4098 
4114 #define GetMapMode(hdc) GetDCAttr (hdc, DC_ATTR_MAP_MODE)
4115 
4131 #define SetMapMode(hdc, mapmode) \
4132  SetDCAttr (hdc, DC_ATTR_MAP_MODE, (DWORD)mapmode)
4133 
4158 MG_EXPORT void GUIAPI GetDCLCS (HDC hdc, int which, POINT* pt);
4159 
4184 MG_EXPORT void GUIAPI SetDCLCS (HDC hdc, int which, const POINT* pt);
4185 
4186 #define DC_LCS_VORG 0
4187 #define DC_LCS_VEXT 1
4188 #define DC_LCS_WORG 2
4189 #define DC_LCS_WEXT 3
4190 #define NR_DC_LCS_PTS 4
4191 
4205 #define GetViewportOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_VORG, pPt)
4206 
4220 #define GetViewportExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_VEXT, pPt)
4221 
4235 #define GetWindowOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_WORG, pPt)
4236 
4250 #define GetWindowExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_WEXT, pPt)
4251 
4265 #define SetViewportOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_VORG, pPt)
4266 
4280 #define SetViewportExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_VEXT, pPt)
4281 
4295 #define SetWindowOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_WORG, pPt)
4296 
4310 #define SetWindowExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_WEXT, pPt)
4311 
4330 MG_EXPORT void GUIAPI DPtoLP (HDC hdc, POINT* pPt);
4331 
4332 
4351 MG_EXPORT void GUIAPI LPtoDP (HDC hdc, POINT* pPt);
4352 
4371 MG_EXPORT void GUIAPI SPtoLP(HDC hdc, POINT* pPt);
4372 
4373 
4392 MG_EXPORT void GUIAPI LPtoSP(HDC hdc, POINT* pPt);
4393 
4414 MG_EXPORT void GUIAPI ExcludeClipRect (HDC hdc, const RECT* prc);
4415 
4429 MG_EXPORT void GUIAPI IncludeClipRect (HDC hdc, const RECT* prc);
4430 
4446 MG_EXPORT BOOL GUIAPI PtVisible (HDC hdc, int x, int y);
4447 
4460 MG_EXPORT void GUIAPI ClipRectIntersect (HDC hdc, const RECT* prc);
4461 
4474 MG_EXPORT void GUIAPI SelectClipRect (HDC hdc, const RECT* prc);
4475 
4476 #define RGN_COPY 0x00
4477 #define RGN_DIFF 0x01
4478 #define RGN_AND 0x02
4479 #define RGN_OR 0x03
4480 #define RGN_XOR 0x04
4481 
4535 MG_EXPORT int GUIAPI SelectClipRegionEx (HDC hdc, const CLIPRGN* pRgn,
4536  int fnMode);
4537 
4550 MG_EXPORT void GUIAPI SelectClipRegion (HDC hdc, const CLIPRGN* pRgn);
4551 
4574 MG_EXPORT int GUIAPI OffsetClipRegion (HDC hdc, int nXOffset, int nYOffset);
4575 
4588 MG_EXPORT void GUIAPI GetBoundsRect (HDC hdc, RECT* pRect);
4589 
4607 MG_EXPORT BOOL GUIAPI RectVisible (HDC hdc, const RECT* pRect);
4608 
4627 MG_EXPORT int GUIAPI GetClipBox (HDC hdc, RECT* clipbox);
4628 
4647 MG_EXPORT int GUIAPI GetClipRegion (HDC hdc, CLIPRGN* cliprgn);
4648 
4684 MG_EXPORT BOOL GUIAPI GetBitmapFromDC (HDC hdc,
4685  int x, int y, int w, int h, BITMAP* bmp);
4686 
4722 MG_EXPORT BOOL GUIAPI FillBoxWithBitmap (HDC hdc, int x, int y, int w, int h,
4723  const BITMAP *bmp);
4724 
4778 MG_EXPORT BOOL GUIAPI FillBoxWithBitmapPart (HDC hdc,
4779  int x, int y, int w, int h,
4780  int bw, int bh, const BITMAP* bmp, int xo, int yo);
4781 
4804 MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y,
4805  int box_w, int box_h, const BITMAP* pbmp, int bmp_x, int bmp_y,
4806  int bmp_w, int bmp_h);
4807 
4841 MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
4842  HDC hddc, int dx, int dy, DWORD dwRop);
4843 
4882 MG_EXPORT void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh,
4883  HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop);
4884 
4904 MG_EXPORT BOOL GUIAPI ScaleBitmapEx (BITMAP* dst, const BITMAP* src,
4905  HDC ref_dc);
4906 
4907 #define ScaleBitmap(dst, src) ScaleBitmapEx(dst, src, HDC_SCREEN)
4908 
4930 MG_EXPORT gal_pixel GUIAPI GetPixelInBitmapEx (const BITMAP* bmp, int x, int y, Uint8* alpha);
4931 
4949 static inline gal_pixel GUIAPI GetPixelInBitmap (const BITMAP* bmp, int x, int y)
4950 {
4951  return GetPixelInBitmapEx (bmp, x, y, NULL);
4952 }
4953 
4978 MG_EXPORT BOOL GUIAPI SetPixelInBitmapEx (const BITMAP* bmp,
4979  int x, int y, gal_pixel pixel, const Uint8* alpha);
4980 
5001 static inline BOOL GUIAPI SetPixelInBitmap (const BITMAP* bmp,
5002  int x, int y, gal_pixel pixel)
5003 {
5004  return SetPixelInBitmapEx (bmp, x, y, pixel, NULL);
5005 }
5006 
5007 #ifdef _MGMISC_SAVESCREEN
5008 
5027 MG_EXPORT BOOL GUIAPI SaveScreenRectContent (const RECT* rcWin,
5028  const char* filename);
5029 
5047 MG_EXPORT BOOL GUIAPI SaveMainWindowContent (HWND hWnd, const char* filename);
5048 #endif
5049 
5074 MG_EXPORT HICON GUIAPI LoadIconFromFile (HDC hdc, const char* filename,
5075  int which);
5076 
5095 MG_EXPORT HICON GUIAPI LoadIconFromMem (HDC hdc, const void* area, int which);
5096 
5121 MG_EXPORT HICON GUIAPI CreateIconEx (HDC hdc, int w, int h,
5122  const BYTE* AndBits, const BYTE* XorBits, int colornum,
5123  const RGB* pal);
5128 #define CreateIcon(hdc, w, h, AndBits, XorBits, colornum) \
5129  CreateIconEx(hdc, w, h, AndBits, XorBits, colornum, NULL)
5130 
5131 
5143 MG_EXPORT BOOL GUIAPI DestroyIcon (HICON hicon);
5144 
5158 MG_EXPORT BOOL GUIAPI GetIconSize (HICON hicon, int* w, int* h);
5159 
5177 MG_EXPORT void GUIAPI DrawIcon (HDC hdc,
5178  int x, int y, int w, int h, HICON hicon);
5179 
5201 static inline void SetRect (RECT* prc, int left, int top, int right, int bottom)
5202 {
5203  (prc)->left = left; (prc)->top = top;
5204  (prc)->right = right; (prc)->bottom = bottom;
5205 }
5206 
5220 static inline void SetRectEmpty (RECT* prc)
5221 {
5222  (prc)->left = (prc)->top = (prc)->right = (prc)->bottom = 0;
5223 }
5224 
5237 static inline void CopyRect (RECT* pdrc, const RECT* psrc)
5238 {
5239  (pdrc)->left = (psrc)->left; (pdrc)->top = (psrc)->top;
5240  (pdrc)->right = (psrc)->right; (pdrc)->bottom = (psrc)->bottom;
5241 }
5242 
5258 static inline void OffsetRect (RECT* prc, int x, int y)
5259 {
5260  (prc)->left += x; (prc)->top += y; (prc)->right += x; (prc)->bottom += y;
5261 }
5262 
5279 static inline void InflateRect (RECT* prc, int cx, int cy)
5280 {
5281  (prc)->left -= cx; (prc)->top -= cy;
5282  (prc)->right += cx; (prc)->bottom += cy;
5283 }
5284 
5298 static inline void InflateRectToPt (RECT* prc, int x, int y)
5299 {
5300  if ((x) < (prc)->left) (prc)->left = (x);
5301  if ((y) < (prc)->top) (prc)->top = (y);
5302  if ((x) > (prc)->right) (prc)->right = (x);
5303  if ((y) > (prc)->bottom) (prc)->bottom = (y);
5304 }
5305 
5321 static inline BOOL PtInRect(const RECT* prc, int x, int y)
5322 {
5323  if (x >= prc->left && x < prc->right && y >= prc->top && y < prc->bottom)
5324  return TRUE;
5325  return FALSE;
5326 }
5327 
5340 MG_EXPORT BOOL GUIAPI IsRectEmpty (const RECT* prc);
5341 
5354 MG_EXPORT BOOL GUIAPI EqualRect (const RECT* prc1, const RECT* prc2);
5355 
5365 MG_EXPORT void GUIAPI NormalizeRect (RECT* pRect);
5366 
5387 MG_EXPORT BOOL GUIAPI IntersectRect (RECT* pdrc,
5388  const RECT* psrc1, const RECT* psrc2);
5389 
5405 MG_EXPORT BOOL GUIAPI IsCovered (const RECT* prc1, const RECT* prc2);
5406 
5420 MG_EXPORT BOOL GUIAPI DoesIntersect (const RECT* psrc1, const RECT* psrc2);
5421 
5439 MG_EXPORT BOOL GUIAPI UnionRect (RECT* pdrc,
5440  const RECT* psrc1, const RECT* psrc2);
5441 
5457 MG_EXPORT void GUIAPI GetBoundRect (PRECT pdrc,
5458  const RECT* psrc1, const RECT* psrc2);
5459 
5476 MG_EXPORT int GUIAPI SubtractRect (RECT* rc, const RECT* psrc1, const RECT* psrc2);
5477 
5482 #define RECTWP(prc) ((prc)->right - (prc)->left)
5483 
5487 #define RECTHP(prc) ((prc)->bottom - (prc)->top)
5488 
5492 #define RECTW(rc) ((rc).right - (rc).left)
5493 
5497 #define RECTH(rc) ((rc).bottom - (rc).top)
5498 
5512 /* Font-related structures */
5513 #define LEN_LOGFONT_NAME_FIELD 31
5514 #define LEN_LOGFONT_FAMILY_FIELD (LEN_LOGFONT_NAME_FIELD*7+6)
5515 #define LEN_LOGFONT_NAME_FULL (LEN_LOGFONT_FAMILY_FIELD + 32)
5516 #define LEN_UNIDEVFONT_NAME 255
5517 
5518 #define LEN_FONT_NAME LEN_LOGFONT_NAME_FIELD
5519 #define LEN_DEVFONT_NAME LEN_UNIDEVFONT_NAME
5520 
5521 #define FONT_WEIGHT_NIL '\0'
5522 #define FONT_WEIGHT_ANY '*'
5523 #define FONT_WEIGHT_THIN 't'
5524 #define FONT_WEIGHT_EXTRA_LIGHT 'e'
5525 #define FONT_WEIGHT_LIGHT 'l'
5526 #define FONT_WEIGHT_NORMAL 'n'
5527 #define FONT_WEIGHT_REGULAR 'r'
5528 #define FONT_WEIGHT_MEDIUM 'm'
5529 #define FONT_WEIGHT_DEMIBOLD 'd'
5530 #define FONT_WEIGHT_BOLD 'b'
5531 #define FONT_WEIGHT_EXTRA_BOLD 'x'
5532 #define FONT_WEIGHT_BLACK 'c'
5533 
5534 /* Backward compatiblilty definitions.
5535  * deprecated since v4.0.0, use FS_RENDER_XXX/FONT_RENDER_XXX instead
5536  */
5537 #define FONT_WEIGHT_SUBPIXEL 's'
5538 #define FONT_WEIGHT_BOOK 'k'
5539 
5540 #define FS_WEIGHT_MASK 0x000000FF
5541 #define FS_WEIGHT_ANY 0
5542 #define FS_WEIGHT_THIN 10
5543 #define FS_WEIGHT_EXTRA_LIGHT 20
5544 #define FS_WEIGHT_LIGHT 30
5545 #define FS_WEIGHT_NORMAL 35
5546 #define FS_WEIGHT_REGULAR 40
5547 #define FS_WEIGHT_MEDIUM 50
5548 #define FS_WEIGHT_DEMIBOLD 60
5549 #define FS_WEIGHT_EXTRA_BOLD 70
5550 #define FS_WEIGHT_BOLD 80
5551 #define FS_WEIGHT_BLACK 90
5552 
5553 #define FONT_SLANT_NIL '\0'
5554 #define FONT_SLANT_ANY '*'
5555 #define FONT_SLANT_ROMAN 'r'
5556 #define FONT_SLANT_ITALIC 'i'
5557 #define FONT_SLANT_OBLIQUE 'o'
5558 
5559 #define FS_SLANT_MASK 0x00000F00
5560 #define FS_SLANT_ANY 0x00000000
5561 #define FS_SLANT_ROMAN 0x00000100
5562 #define FS_SLANT_ITALIC 0x00000200
5563 #define FS_SLANT_OBLIQUE 0x00000300
5564 
5565 #define FONT_FLIP_NONE 'n'
5566 #define FONT_FLIP_HORZ 'h'
5567 #define FONT_FLIP_VERT 'v'
5568 #define FONT_FLIP_HORZVERT 't'
5569 #define FONT_FLIP_NIL FONT_FLIP_NONE
5570 
5571 #define FS_FLIP_MASK 0x0000F000
5572 #define FS_FLIP_NONE 0x00000000
5573 #define FS_FLIP_HORZ 0x00001000
5574 #define FS_FLIP_VERT 0x00002000
5575 #define FS_FLIP_HORZVERT 0x00003000 /* HORZ | VERT */
5576 
5577 #define FONT_OTHER_NONE 'n'
5578 #define FONT_OTHER_AUTOSCALE 's'
5579 #define FONT_OTHER_TTFNOCACHE 'c'
5580 #define FONT_OTHER_TTFKERN 'k'
5581 #define FONT_OTHER_TTFNOCACHEKERN 'r'
5582 #define FONT_OTHER_NIL FONT_OTHER_NONE
5583 
5584 #define FS_OTHER_MASK 0x00F00000
5585 #define FS_OTHER_NONE 0x00000000
5586 #define FS_OTHER_AUTOSCALE 0x00100000
5587 #define FS_OTHER_TTFNOCACHE 0x00200000
5588 #define FS_OTHER_TTFKERN 0x00400000
5589 #define FS_OTHER_TTFNOCACHEKERN 0x00600000 /* KERN | NOCACHE */
5590 
5591 #define FONT_DECORATE_NIL '\0'
5592 #define FONT_DECORATE_NONE 'n'
5593 #define FONT_DECORATE_UNDERLINE 'u'
5594 #define FONT_DECORATE_STRUCKOUT 's'
5595 #define FONT_DECORATE_REVERSE 'r'
5596 #define FONT_DECORATE_OUTLINE 'o'
5597 #define FONT_DECORATE_US 'U' /* UNDERLINE | STRUCKOUT */
5598 
5599 #define FS_DECORATE_MASK 0x0F000000
5600 #define FS_DECORATE_NONE 0x00000000
5601 #define FS_DECORATE_UNDERLINE 0x01000000
5602 #define FS_DECORATE_STRUCKOUT 0x02000000
5603 #define FS_DECORATE_REVERSE 0x04000000
5604 #define FS_DECORATE_OUTLINE 0x08000000
5605 #define FS_DECORATE_US (FS_DECORATE_UNDERLINE | FS_DECORATE_STRUCKOUT)
5606 
5607 #define FONT_RENDER_NIL '\0'
5608 #define FONT_RENDER_ANY '*'
5609 #define FONT_RENDER_MONO 'n'
5610 #define FONT_RENDER_GREY 'g'
5611 #define FONT_RENDER_SUBPIXEL 's'
5612 
5613 #define FS_RENDER_MASK 0xF0000000
5614 #define FS_RENDER_MONO 0x00000000
5615 #define FS_RENDER_GREY 0x10000000
5616 #define FS_RENDER_SUBPIXEL 0x20000000
5617 #define FS_RENDER_ANY FS_RENDER_MONO
5618 
5619 /* Backward compatiblilty definitions; deprecated since v4.0.0 */
5620 #define FONT_OTHER_LCDPORTRAIT 'p'
5621 #define FONT_OTHER_LCDPORTRAITKERN 'q'
5622 
5623 #define FONT_WEIGHT_ALL FONT_WEIGHT_ANY
5624 #define FONT_SLANT_ALL FONT_SLANT_ANY
5625 #define FS_WEIGHT_ALL FS_WEIGHT_ANY
5626 #define FS_SLANT_ALL FS_SLANT_ANY
5627 
5628 /* Backward compatiblilty definitions; deprecated since v4.0.0
5629  * All FONT_SETWIDTH_* and FONT_SPACING_* types will
5630  * be treated as FONT_FLIP_NIL and FONT_OTHER_NIL respectively.
5631  */
5632 #define FONT_SETWIDTH_NIL '\0'
5633 #define FONT_SETWIDTH_ALL '*'
5634 #define FONT_SETWIDTH_BOLD 'b'
5635 #define FONT_SETWIDTH_CONDENSED 'c'
5636 #define FONT_SETWIDTH_SEMICONDENSED 's'
5637 #define FONT_SETWIDTH_NORMAL 'n'
5638 #define FONT_SETWIDTH_TTFNOCACHE 'w'
5639 
5640 #define FONT_SPACING_NIL '\0'
5641 #define FONT_SPACING_ALL '*'
5642 #define FONT_SPACING_MONOSPACING 'm'
5643 #define FONT_SPACING_PROPORTIONAL 'p'
5644 #define FONT_SPACING_CHARCELL 'c'
5645 
5646 #define FONT_UNDERLINE_NIL '\0'
5647 #define FONT_UNDERLINE_ALL '*'
5648 #define FONT_UNDERLINE_LINE 'u'
5649 #define FONT_UNDERLINE_NONE 'n'
5650 
5651 #define FONT_STRUCKOUT_NIL '\0'
5652 #define FONT_STRUCKOUT_ALL '*'
5653 #define FONT_STRUCKOUT_LINE 's'
5654 #define FONT_STRUCKOUT_NONE 'n'
5655 /******/
5656 
5657 #define FONT_TYPE_NAME_LEN 3
5658 #define FONT_TYPE_NAME_BITMAP_NUF "nuf"
5659 #define FONT_TYPE_NAME_BITMAP_RAW "rbf"
5660 #define FONT_TYPE_NAME_BITMAP_VAR "vbf"
5661 #define FONT_TYPE_NAME_BITMAP_QPF "qpf"
5662 #define FONT_TYPE_NAME_BITMAP_UPF "upf"
5663 #define FONT_TYPE_NAME_BITMAP_BMP "bmp"
5664 #define FONT_TYPE_NAME_SCALE_TTF "ttf"
5665 #define FONT_TYPE_NAME_SCALE_T1F "t1f"
5666 #define FONT_TYPE_NAME_ANY "*"
5667 #define FONT_TYPE_NAME_ALL FONT_TYPE_NAME_ANY
5668 
5669 #define FONT_ETC_SECTION_NAME_VBF "varbitmapfonts"
5670 #define FONT_ETC_SECTION_NAME_RBF "rawbitmapfonts"
5671 #define FONT_ETC_SECTION_NAME_UPF "upf"
5672 #define FONT_ETC_SECTION_NAME_QPF "qpf"
5673 #define FONT_ETC_SECTION_NAME_TTF "truetypefonts"
5674 
5675 #define FONT_TYPE_BITMAP_RAW 0x0001 /* "rbf" */
5676 #define FONT_TYPE_BITMAP_VAR 0x0002 /* "vbf" */
5677 #define FONT_TYPE_BITMAP_QPF 0x0003 /* "qpf" */
5678 #define FONT_TYPE_BITMAP_BMP 0x0004 /* "bmp" */
5679 #define FONT_TYPE_BITMAP_UPF 0x0005 /* "upf" */
5680 #define FONT_TYPE_SCALE_TTF 0x0010 /* "ttf" */
5681 #define FONT_TYPE_SCALE_T1F 0x0011 /* "t1f" */
5682 #define FONT_TYPE_ANY 0x0000 /* "any" */
5683 #define FONT_TYPE_ALL FONT_TYPE_ANY
5684 
5685 #define FONT_CHARSET_US_ASCII "US-ASCII"
5686 
5687 #define FONT_CHARSET_ISO8859_1 "ISO8859-1"
5688 #define FONT_CHARSET_ISO8859_2 "ISO8859-2"
5689 #define FONT_CHARSET_ISO8859_3 "ISO8859-3"
5690 #define FONT_CHARSET_ISO8859_4 "ISO8859-4"
5691 #define FONT_CHARSET_ISO8859_5 "ISO8859-5"
5692 #define FONT_CHARSET_ISO8859_6 "ISO8859-6"
5693 #define FONT_CHARSET_ISO8859_7 "ISO8859-7"
5694 #define FONT_CHARSET_ISO8859_8 "ISO8859-8"
5695 #define FONT_CHARSET_ISO8859_9 "ISO8859-9"
5696 #define FONT_CHARSET_ISO8859_10 "ISO8859-10"
5697 #define FONT_CHARSET_ISO8859_11 "ISO8859-11"
5698 #define FONT_CHARSET_ISO8859_12 "ISO8859-12"
5699 #define FONT_CHARSET_ISO8859_13 "ISO8859-13"
5700 #define FONT_CHARSET_ISO8859_14 "ISO8859-14"
5701 #define FONT_CHARSET_ISO8859_15 "ISO8859-15"
5702 #define FONT_CHARSET_ISO8859_16 "ISO8859-16"
5703 
5704 #define FONT_CHARSET_EUC_CN "EUC-CN"
5705 
5710 #define FONT_CHARSET_GB1988_0 "GB1988-0"
5711 
5716 #define FONT_CHARSET_GB2312_0 "GB2312-0"
5717 #define FONT_CHARSET_GBK "GBK"
5718 
5723 #define FONT_CHARSET_GB18030_0 "GB18030-0"
5724 #define FONT_CHARSET_BIG5 "BIG5"
5725 
5730 #define FONT_CHARSET_EUCTW "EUC-TW"
5731 #define FONT_CHARSET_EUCKR "EUC-KR"
5732 
5737 #define FONT_CHARSET_KSC5636_0 "KSC5636-0"
5738 
5743 #define FONT_CHARSET_KSC5601_0 "KSC5601-0"
5744 #define FONT_CHARSET_EUCJP "EUC-JP"
5745 
5750 #define FONT_CHARSET_JISX0201_0 "JISX0201-0"
5751 
5756 #define FONT_CHARSET_JISX0208_0 "JISX0208-0"
5757 #define FONT_CHARSET_SHIFTJIS "SHIFT-JIS"
5758 
5763 #define FONT_CHARSET_JISX0201_1 "JISX0201-1"
5764 
5769 #define FONT_CHARSET_JISX0208_1 "JISX0208-1"
5770 
5775 #define FONT_CHARSET_ISO_10646_1 "ISO-10646-1"
5776 
5781 #define FONT_CHARSET_UTF8 "UTF-8"
5782 
5787 #define FONT_CHARSET_UTF16LE "UTF-16LE"
5788 
5793 #define FONT_CHARSET_UTF16BE "UTF-16BE"
5794 
5795 #define FONT_MAX_SIZE 256
5796 #define FONT_MIN_SIZE 1
5797 #define MAXNR_DEVFONTS 8
5798 
5799 struct _DEVFONT;
5800 typedef struct _DEVFONT DEVFONT;
5801 
5806 typedef struct _LOGFONT {
5808  char* type;
5810  char* family;
5812  char* charset;
5816  int size;
5820  int ascent;
5822  int descent;
5825 
5826  /*
5827  * The following fields are internally used.
5828  * They may be changed in the future.
5829  */
5830 
5831  // The scale factors of devfonts
5832  unsigned short scales[MAXNR_DEVFONTS];
5833  // The devfonts for the logfont
5834  DEVFONT* devfonts[MAXNR_DEVFONTS];
5835 } LOGFONT;
5836 
5842 
5847 typedef const LOGFONT* CPLOGFONT;
5848 
5849 struct _WORDINFO;
5850 
5855 typedef struct _WORDINFO WORDINFO;
5856 
5857 #define MAX_LEN_MCHAR 6
5858 
5859 typedef Uint16 Uchar16;
5860 typedef Uint32 Uchar32;
5861 
5879 #define ACHARTYPE_BASIC_MASK 0x0000FFFF
5880 #define ACHARTYPE_CATEGORY_MASK 0x00FF0000
5881 #define ACHARTYPE_BREAK_MASK 0xFF000000
5882 
5887 #define ACHARTYPE_EXTRACT_BASIC(t) \
5888  (((t) & ACHARTYPE_BASIC_MASK))
5889 
5894 #define ACHARTYPE_EXTRACT_CATEGORY(t) \
5895  (((t) & ACHARTYPE_CATEGORY_MASK) >> 16)
5896 
5901 #define ACHARTYPE_EXTRACT_BREAK(t) \
5902  (((t) & ACHARTYPE_BREAK_MASK) >> 24)
5903 
5908 #define ACHARTYPE_UNKNOWN 0
5909 
5910 #define ACHAR_BASIC_NOSPACING_MARK 0x0001
5911 #define ACHAR_BASIC_ABOVE_MARK 0x0002
5912 #define ACHAR_BASIC_BELLOW_MARK 0x0004
5913 
5914 #define ACHAR_BASIC_UNKNOWN 0x0000
5915 #define ACHAR_BASIC_NUL (0x0000 | ACHAR_BASIC_NOSPACING_MARK)
5916 
5917 #define ACHAR_BASIC_CTRL1 0x0100
5918 
5919 #define ACHAR_BASIC_BEL 0x0200
5920 
5921 #define ACHAR_BASIC_BS 0x0300
5922 
5923 #define ACHAR_BASIC_HT 0x0400
5924 
5925 #define ACHAR_BASIC_LF 0x0500
5926 
5927 #define ACHAR_BASIC_VT 0x0600
5928 
5929 #define ACHAR_BASIC_FF 0x0700
5930 
5931 #define ACHAR_BASIC_CR 0x0800
5932 
5933 #define ACHAR_BASIC_CTRL2 0x0900
5934 
5935 #define ACHAR_BASIC_SPACE 0x0A00
5936 
5937 #define ACHAR_BASIC_ZEROWIDTH 0x0B00
5938 #define ACHAR_BASIC_GENERIC 0x0C00
5939 
5940 #define ACHAR_BASIC_LIGATURE (0x0D00 | ACHAR_BASIC_NOSPACING_MARK)
5941 #define ACHAR_BASIC_VOWEL (0x0E00 | ACHAR_BASIC_NOSPACING_MARK)
5942 #define ACHAR_BASIC_VOWEL_ABOVE (ACHAR_BASIC_VOWEL | ACHAR_BASIC_ABOVE_MARK)
5943 #define ACHAR_BASIC_VOWEL_BELLOW (ACHAR_BASIC_VOWEL | ACHAR_BASIC_BELLOW_MARK)
5944 
5945 /* Compatibility definitions */
5946 #define MCHAR_TYPE_UNKNOWN ACHAR_BASIC_UNKNOWN
5947 #define MCHAR_TYPE_NUL ACHAR_BASIC_NUL
5948 #define MCHAR_TYPE_CTRL1 ACHAR_BASIC_CTRL1
5949 #define MCHAR_TYPE_BEL ACHAR_BASIC_BEL
5950 #define MCHAR_TYPE_BS ACHAR_BASIC_BS
5951 #define MCHAR_TYPE_HT ACHAR_BASIC_HT
5952 #define MCHAR_TYPE_LF ACHAR_BASIC_LF
5953 #define MCHAR_TYPE_VT ACHAR_BASIC_VT
5954 #define MCHAR_TYPE_FF ACHAR_BASIC_FF
5955 #define MCHAR_TYPE_CR ACHAR_BASIC_CR
5956 #define MCHAR_TYPE_CTRL2 ACHAR_BASIC_CTRL2
5957 #define MCHAR_TYPE_SPACE ACHAR_BASIC_SPACE
5958 #define MCHAR_TYPE_ZEROWIDTH ACHAR_BASIC_ZEROWIDTH
5959 #define MCHAR_TYPE_GENERIC ACHAR_BASIC_GENERIC
5960 #define MCHAR_TYPE_NOSPACING_MARK ACHAR_BASIC_NOSPACING_MARK
5961 #define MCHAR_TYPE_LIGATURE ACHAR_BASIC_LIGATURE
5962 #define MCHAR_TYPE_VOWEL ACHAR_BASIC_VOWEL
5963 #define MCHAR_TYPE_VOWEL_ABOVE ACHAR_BASIC_VOWEL_ABOVE
5964 #define MCHAR_TYPE_VOWEL_BELLOW ACHAR_BASIC_VOWEL_BELLOW
5965 
5966 #if 0
5967 #define MCHAR_TYPE_ASCII 0x0080
5968 #define MCHAR_TYPE_LATIN1 0x0081
5969 #define MCHAR_TYPE_LATIN2 0x0082
5970 #define MCHAR_TYPE_LATIN3 0x0083
5971 #define MCHAR_TYPE_LATIN4 0x0084
5972 #define MCHAR_TYPE_LATIN5 0x0085
5973 #define MCHAR_TYPE_LATIN6 0x0086
5974 #define MCHAR_TYPE_LATIN7 0x0087
5975 #define MCHAR_TYPE_LATIN8 0x0088
5976 #define MCHAR_TYPE_LATIN9 0x0089
5977 #define MCHAR_TYPE_LATIN10 0x008A
5978 #define MCHAR_TYPE_CYRILLIC 0x008B
5979 #define MCHAR_TYPE_ARABIC 0x008C
5980 #define MCHAR_TYPE_GREEK 0x008D
5981 #define MCHAR_TYPE_HEBREW 0x008E
5982 #define MCHAR_TYPE_THAI 0x008F
5983 
5984 #define MCHAR_TYPE_DIGIT 0x0091
5985 #define MCHAR_TYPE_SYMBOL_PUNCT 0x0092
5986 #define MCHAR_TYPE_SYMBOL_MATH 0x0093
5987 #define MCHAR_TYPE_SYMBOL_OTHER 0x0094
5988 #define MCHAR_TYPE_FW_DIGIT 0x0095
5989 #define MCHAR_TYPE_FW_SYM_PUNCT 0x0096
5990 #define MCHAR_TYPE_FW_SYM_MATH 0x0097
5991 #define MCHAR_TYPE_FW_SYM_OTHER 0x0098
5992 
5993 #define MCHAR_TYPE_HANGUL 0x00A1
5994 #define MCHAR_TYPE_KATAKANA 0x00A2
5995 #define MCHAR_TYPE_CJK 0x00A3
5996 #endif
5997 
6036 typedef enum {
6037  UCHAR_CATEGORY_CONTROL,
6038  UCHAR_CATEGORY_FORMAT,
6039  UCHAR_CATEGORY_UNASSIGNED,
6040  UCHAR_CATEGORY_PRIVATE_USE,
6041  UCHAR_CATEGORY_SURROGATE,
6042  UCHAR_CATEGORY_LOWERCASE_LETTER,
6043  UCHAR_CATEGORY_MODIFIER_LETTER,
6044  UCHAR_CATEGORY_OTHER_LETTER,
6045  UCHAR_CATEGORY_TITLECASE_LETTER,
6046  UCHAR_CATEGORY_UPPERCASE_LETTER,
6047  UCHAR_CATEGORY_SPACING_MARK,
6048  UCHAR_CATEGORY_ENCLOSING_MARK,
6049  UCHAR_CATEGORY_NON_SPACING_MARK,
6050  UCHAR_CATEGORY_DECIMAL_NUMBER,
6051  UCHAR_CATEGORY_LETTER_NUMBER,
6052  UCHAR_CATEGORY_OTHER_NUMBER,
6053  UCHAR_CATEGORY_CONNECT_PUNCTUATION,
6054  UCHAR_CATEGORY_DASH_PUNCTUATION,
6055  UCHAR_CATEGORY_CLOSE_PUNCTUATION,
6056  UCHAR_CATEGORY_FINAL_PUNCTUATION,
6057  UCHAR_CATEGORY_INITIAL_PUNCTUATION,
6058  UCHAR_CATEGORY_OTHER_PUNCTUATION,
6059  UCHAR_CATEGORY_OPEN_PUNCTUATION,
6060  UCHAR_CATEGORY_CURRENCY_SYMBOL,
6061  UCHAR_CATEGORY_MODIFIER_SYMBOL,
6062  UCHAR_CATEGORY_MATH_SYMBOL,
6063  UCHAR_CATEGORY_OTHER_SYMBOL,
6064  UCHAR_CATEGORY_LINE_SEPARATOR,
6065  UCHAR_CATEGORY_PARAGRAPH_SEPARATOR,
6066  UCHAR_CATEGORY_SPACE_SEPARATOR
6068 
6123 typedef enum {
6124  UCHAR_BREAK_MANDATORY,
6125  UCHAR_BREAK_CARRIAGE_RETURN,
6126  UCHAR_BREAK_LINE_FEED,
6127  UCHAR_BREAK_COMBINING_MARK,
6128  UCHAR_BREAK_SURROGATE,
6129  UCHAR_BREAK_ZERO_WIDTH_SPACE,
6130  UCHAR_BREAK_INSEPARABLE,
6131  UCHAR_BREAK_NON_BREAKING_GLUE,
6132  UCHAR_BREAK_CONTINGENT,
6133  UCHAR_BREAK_SPACE,
6134  UCHAR_BREAK_AFTER,
6135  UCHAR_BREAK_BEFORE,
6136  UCHAR_BREAK_BEFORE_AND_AFTER,
6137  UCHAR_BREAK_HYPHEN,
6138  UCHAR_BREAK_NON_STARTER,
6139  UCHAR_BREAK_OPEN_PUNCTUATION,
6140  UCHAR_BREAK_CLOSE_PUNCTUATION,
6141  UCHAR_BREAK_QUOTATION,
6142  UCHAR_BREAK_EXCLAMATION,
6143  UCHAR_BREAK_IDEOGRAPHIC,
6144  UCHAR_BREAK_NUMERIC,
6145  UCHAR_BREAK_INFIX_SEPARATOR,
6146  UCHAR_BREAK_SYMBOL,
6147  UCHAR_BREAK_ALPHABETIC,
6148  UCHAR_BREAK_PREFIX,
6149  UCHAR_BREAK_POSTFIX,
6150  UCHAR_BREAK_COMPLEX_CONTEXT,
6151  UCHAR_BREAK_AMBIGUOUS,
6152  UCHAR_BREAK_UNKNOWN,
6153  UCHAR_BREAK_NEXT_LINE,
6154  UCHAR_BREAK_WORD_JOINER,
6155  UCHAR_BREAK_HANGUL_L_JAMO,
6156  UCHAR_BREAK_HANGUL_V_JAMO,
6157  UCHAR_BREAK_HANGUL_T_JAMO,
6158  UCHAR_BREAK_HANGUL_LV_SYLLABLE,
6159  UCHAR_BREAK_HANGUL_LVT_SYLLABLE,
6160  UCHAR_BREAK_CLOSE_PARANTHESIS,
6161  UCHAR_BREAK_CONDITIONAL_JAPANESE_STARTER,
6162  UCHAR_BREAK_HEBREW_LETTER,
6163  UCHAR_BREAK_REGIONAL_INDICATOR,
6164  UCHAR_BREAK_EMOJI_BASE,
6165  UCHAR_BREAK_EMOJI_MODIFIER,
6166  UCHAR_BREAK_ZERO_WIDTH_JOINER
6167 } UCharBreakType;
6168 
6341 typedef enum {
6342  SCRIPT_INVALID_CODE = 0xFF,
6343  SCRIPT_COMMON = 0, /* Zyyy */
6344  SCRIPT_INHERITED, /* Zinh (Qaai) */
6345  SCRIPT_ARABIC, /* Arab */
6346  SCRIPT_ARMENIAN, /* Armn */
6347  SCRIPT_BENGALI, /* Beng */
6348  SCRIPT_BOPOMOFO, /* Bopo */
6349  SCRIPT_CHEROKEE, /* Cher */
6350  SCRIPT_COPTIC, /* Copt (Qaac) */
6351  SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
6352  SCRIPT_DESERET, /* Dsrt */
6353  SCRIPT_DEVANAGARI, /* Deva */
6354  SCRIPT_ETHIOPIC, /* Ethi */
6355  SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
6356  SCRIPT_GOTHIC, /* Goth */
6357  SCRIPT_GREEK, /* Grek */
6358  SCRIPT_GUJARATI, /* Gujr */
6359  SCRIPT_GURMUKHI, /* Guru */
6360  SCRIPT_HAN, /* Hani */
6361  SCRIPT_HANGUL, /* Hang */
6362  SCRIPT_HEBREW, /* Hebr */
6363  SCRIPT_HIRAGANA, /* Hira */
6364  SCRIPT_KANNADA, /* Knda */
6365  SCRIPT_KATAKANA, /* Kana */
6366  SCRIPT_KHMER, /* Khmr */
6367  SCRIPT_LAO, /* Laoo */
6368  SCRIPT_LATIN, /* Latn (Latf, Latg) */
6369  SCRIPT_MALAYALAM, /* Mlym */
6370  SCRIPT_MONGOLIAN, /* Mong */
6371  SCRIPT_MYANMAR, /* Mymr */
6372  SCRIPT_OGHAM, /* Ogam */
6373  SCRIPT_OLD_ITALIC, /* Ital */
6374  SCRIPT_ORIYA, /* Orya */
6375  SCRIPT_RUNIC, /* Runr */
6376  SCRIPT_SINHALA, /* Sinh */
6377  SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
6378  SCRIPT_TAMIL, /* Taml */
6379  SCRIPT_TELUGU, /* Telu */
6380  SCRIPT_THAANA, /* Thaa */
6381  SCRIPT_THAI, /* Thai */
6382  SCRIPT_TIBETAN, /* Tibt */
6383  SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
6384  SCRIPT_YI, /* Yiii */
6385  SCRIPT_TAGALOG, /* Tglg */
6386  SCRIPT_HANUNOO, /* Hano */
6387  SCRIPT_BUHID, /* Buhd */
6388  SCRIPT_TAGBANWA, /* Tagb */
6389 
6390  /* Unicode-4.0 additions */
6391  SCRIPT_BRAILLE, /* Brai */
6392  SCRIPT_CYPRIOT, /* Cprt */
6393  SCRIPT_LIMBU, /* Limb */
6394  SCRIPT_OSMANYA, /* Osma */
6395  SCRIPT_SHAVIAN, /* Shaw */
6396  SCRIPT_LINEAR_B, /* Linb */
6397  SCRIPT_TAI_LE, /* Tale */
6398  SCRIPT_UGARITIC, /* Ugar */
6399 
6400  /* Unicode-4.1 additions */
6401  SCRIPT_NEW_TAI_LUE, /* Talu */
6402  SCRIPT_BUGINESE, /* Bugi */
6403  SCRIPT_GLAGOLITIC, /* Glag */
6404  SCRIPT_TIFINAGH, /* Tfng */
6405  SCRIPT_SYLOTI_NAGRI, /* Sylo */
6406  SCRIPT_OLD_PERSIAN, /* Xpeo */
6407  SCRIPT_KHAROSHTHI, /* Khar */
6408 
6409  /* Unicode-5.0 additions */
6410  SCRIPT_UNKNOWN, /* Zzzz */
6411  SCRIPT_BALINESE, /* Bali */
6412  SCRIPT_CUNEIFORM, /* Xsux */
6413  SCRIPT_PHOENICIAN, /* Phnx */
6414  SCRIPT_PHAGS_PA, /* Phag */
6415  SCRIPT_NKO, /* Nkoo */
6416 
6417  /* Unicode-5.1 additions */
6418  SCRIPT_KAYAH_LI, /* Kali */
6419  SCRIPT_LEPCHA, /* Lepc */
6420  SCRIPT_REJANG, /* Rjng */
6421  SCRIPT_SUNDANESE, /* Sund */
6422  SCRIPT_SAURASHTRA, /* Saur */
6423  SCRIPT_CHAM, /* Cham */
6424  SCRIPT_OL_CHIKI, /* Olck */
6425  SCRIPT_VAI, /* Vaii */
6426  SCRIPT_CARIAN, /* Cari */
6427  SCRIPT_LYCIAN, /* Lyci */
6428  SCRIPT_LYDIAN, /* Lydi */
6429 
6430  /* Unicode-5.2 additions */
6431  SCRIPT_AVESTAN, /* Avst */
6432  SCRIPT_BAMUM, /* Bamu */
6433  SCRIPT_EGYPTIAN_HIEROGLYPHS, /* Egyp */
6434  SCRIPT_IMPERIAL_ARAMAIC, /* Armi */
6435  SCRIPT_INSCRIPTIONAL_PAHLAVI, /* Phli */
6436  SCRIPT_INSCRIPTIONAL_PARTHIAN, /* Prti */
6437  SCRIPT_JAVANESE, /* Java */
6438  SCRIPT_KAITHI, /* Kthi */
6439  SCRIPT_LISU, /* Lisu */
6440  SCRIPT_MEETEI_MAYEK, /* Mtei */
6441  SCRIPT_OLD_SOUTH_ARABIAN, /* Sarb */
6442  SCRIPT_OLD_TURKIC, /* Orkh */
6443  SCRIPT_SAMARITAN, /* Samr */
6444  SCRIPT_TAI_THAM, /* Lana */
6445  SCRIPT_TAI_VIET, /* Tavt */
6446 
6447  /* Unicode-6.0 additions */
6448  SCRIPT_BATAK, /* Batk */
6449  SCRIPT_BRAHMI, /* Brah */
6450  SCRIPT_MANDAIC, /* Mand */
6451 
6452  /* Unicode-6.1 additions */
6453  SCRIPT_CHAKMA, /* Cakm */
6454  SCRIPT_MEROITIC_CURSIVE, /* Merc */
6455  SCRIPT_MEROITIC_HIEROGLYPHS, /* Mero */
6456  SCRIPT_MIAO, /* Plrd */
6457  SCRIPT_SHARADA, /* Shrd */
6458  SCRIPT_SORA_SOMPENG, /* Sora */
6459  SCRIPT_TAKRI, /* Takr */
6460 
6461  /* Unicode 7.0 additions */
6462  SCRIPT_BASSA_VAH, /* Bass */
6463  SCRIPT_CAUCASIAN_ALBANIAN, /* Aghb */
6464  SCRIPT_DUPLOYAN, /* Dupl */
6465  SCRIPT_ELBASAN, /* Elba */
6466  SCRIPT_GRANTHA, /* Gran */
6467  SCRIPT_KHOJKI, /* Khoj */
6468  SCRIPT_KHUDAWADI, /* Sind */
6469  SCRIPT_LINEAR_A, /* Lina */
6470  SCRIPT_MAHAJANI, /* Mahj */
6471  SCRIPT_MANICHAEAN, /* Manu */
6472  SCRIPT_MENDE_KIKAKUI, /* Mend */
6473  SCRIPT_MODI, /* Modi */
6474  SCRIPT_MRO, /* Mroo */
6475  SCRIPT_NABATAEAN, /* Nbat */
6476  SCRIPT_OLD_NORTH_ARABIAN, /* Narb */
6477  SCRIPT_OLD_PERMIC, /* Perm */
6478  SCRIPT_PAHAWH_HMONG, /* Hmng */
6479  SCRIPT_PALMYRENE, /* Palm */
6480  SCRIPT_PAU_CIN_HAU, /* Pauc */
6481  SCRIPT_PSALTER_PAHLAVI, /* Phlp */
6482  SCRIPT_SIDDHAM, /* Sidd */
6483  SCRIPT_TIRHUTA, /* Tirh */
6484  SCRIPT_WARANG_CITI, /* Wara */
6485 
6486  /* Unicode 8.0 additions */
6487  SCRIPT_AHOM, /* Ahom */
6488  SCRIPT_ANATOLIAN_HIEROGLYPHS, /* Hluw */
6489  SCRIPT_HATRAN, /* Hatr */
6490  SCRIPT_MULTANI, /* Mult */
6491  SCRIPT_OLD_HUNGARIAN, /* Hung */
6492  SCRIPT_SIGNWRITING, /* Sgnw */
6493 
6494  /* Unicode 9.0 additions */
6495  SCRIPT_ADLAM, /* Adlm */
6496  SCRIPT_BHAIKSUKI, /* Bhks */
6497  SCRIPT_MARCHEN, /* Marc */
6498  SCRIPT_NEWA, /* Newa */
6499  SCRIPT_OSAGE, /* Osge */
6500  SCRIPT_TANGUT, /* Tang */
6501 
6502  /* Unicode 10.0 additions */
6503  SCRIPT_MASARAM_GONDI, /* Gonm */
6504  SCRIPT_NUSHU, /* Nshu */
6505  SCRIPT_SOYOMBO, /* Soyo */
6506  SCRIPT_ZANABAZAR_SQUARE, /* Zanb */
6507 
6508  /* Unicode 11.0 additions */
6509  SCRIPT_DOGRA, /* Dogr */
6510  SCRIPT_GUNJALA_GONDI, /* Gong */
6511  SCRIPT_HANIFI_ROHINGYA, /* Rohg */
6512  SCRIPT_MAKASAR, /* Maka */
6513  SCRIPT_MEDEFAIDRIN, /* Medf */
6514  SCRIPT_OLD_SOGDIAN, /* Sogo */
6515  SCRIPT_SOGDIAN, /* Sogd */
6516 
6517  /* Unicode 12.0 additions */
6518  SCRIPT_ELYMAIC, /* Elymaic */
6519  SCRIPT_NANDINAGARI, /* Nandinagari */
6520  SCRIPT_NYIAKENG_PUACHUE_HMONG, /* Nyiakeng Puachue Hmong */
6521  SCRIPT_WANCHO, /* Wancho */
6522 } ScriptType;
6523 
6537 typedef enum {
6826 } LanguageCode;
6827 
6844 MG_EXPORT LanguageCode GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1);
6845 
6859 static inline LanguageCode GUIAPI LanguageCodeFromISO639s1Code(const char* iso639_1)
6860 {
6861  return LanguageCodeFromISO639s1(MAKEWORD16(iso639_1[1],
6862  iso639_1[0]));
6863 }
6864 
6866 MG_EXPORT const char* GUIAPI LanguageCodeToISO639s1(LanguageCode lc);
6867 
6869 MG_EXPORT LanguageCode GUIAPI GetSampleLanguageForScript(ScriptType st);
6870 
6872 MG_EXPORT const ScriptType* GUIAPI GetScriptsForLang(const char* lang_name,
6873  LanguageCode* lang_code, int* nr_scripts);
6874 
6876 MG_EXPORT ScriptType GUIAPI NormalizeScriptType(LanguageCode cl,
6877  ScriptType ws);
6878 
6881 struct _FONTOPS;
6882 struct _CHARSETOPS;
6883 
6884 typedef struct _FONTOPS FONTOPS;
6885 typedef struct _CHARSETOPS CHARSETOPS;
6886 
6891 struct _DEVFONT {
6902  char name [LEN_UNIDEVFONT_NAME + 1];
6903 
6906 
6907  /*
6908  * The following fields are internally used.
6909  * They may changed in the future.
6910  */
6911  // indicating if the data need to be unloaded before delete a devfont
6912  BOOL need_unload;
6913 
6914  // The pointer to font operation structure.
6915  FONTOPS* font_ops;
6916 
6917  // The pointer to character set operation structure.
6918  CHARSETOPS* charset_ops;
6919 
6920  // The pointer to next device font.
6921  struct _DEVFONT* next;
6922 
6923  // The device font used data.
6924  void* data;
6925 
6926  // The device font used relationship.
6927  void* relationship;
6928 };
6929 
6934 #define INV_LOGFONT 0
6935 
6937 typedef struct _FONTMETRICS {
6941  int ascent;
6943  int descent;
6944 
6949 } FONTMETRICS;
6950 
6965 MG_EXPORT void GUIAPI GetFontMetrics (LOGFONT* log_font,
6966  FONTMETRICS* font_metrics);
6967 
6969 typedef struct _GLYPHBITMAP {
6971  int bbox_x, bbox_y, bbox_w, bbox_h;
6973  int advance_x, advance_y;
6974 
6976  size_t bmp_size;
6980  const unsigned char* bits;
6981 } GLYPHBITMAP;
6982 
7012 MG_EXPORT void GUIAPI GetGlyphBitmap (LOGFONT* log_font,
7013  const char* mchar, int mchar_len,
7014  GLYPHBITMAP* glyph_bitmap);
7015 
7016 #ifndef _MGRM_THREADS
7017 
7036 MG_EXPORT BOOL GUIAPI InitVectorialFonts (void);
7037 
7038 
7051 MG_EXPORT void GUIAPI TermVectorialFonts (void);
7052 
7053 #endif
7054 
7179 MG_EXPORT PLOGFONT GUIAPI CreateLogFont (const char* type, const char* family,
7180  const char* charset, char weight, char slant, char flip,
7181  char other, char underline, char struckout,
7182  int size, int rotation);
7183 
7313 MG_EXPORT PLOGFONT GUIAPI CreateLogFontEx (const char* type, const char* family,
7314  const char* charset, char weight, char slant, char flip,
7315  char other, char decoration, char rendering,
7316  int size, int rotation);
7317 
7348 MG_EXPORT PLOGFONT GUIAPI CreateLogFontByName(const char* font_name);
7349 
7350 #ifdef _MGCHARSET_UNICODE
7351 
7368 MG_EXPORT PLOGFONT GUIAPI CreateLogFontForMChar2UChar(const char* charset);
7369 #endif /* _MGCHARSET_UNICODE */
7370 
7382 MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirect (LOGFONT* logfont);
7383 
7405 MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirectEx (LOGFONT* logfont,
7406  int rotation);
7407 
7418 MG_EXPORT void GUIAPI DestroyLogFont (PLOGFONT log_font);
7419 
7433 MG_EXPORT void GUIAPI GetLogFontInfo (HDC hdc, LOGFONT* log_font);
7434 
7447 MG_EXPORT PLOGFONT GUIAPI GetCurFont (HDC hdc);
7448 
7467 MG_EXPORT PLOGFONT GUIAPI SelectFont (HDC hdc, PLOGFONT log_font);
7468 
7479 MG_EXPORT const DEVFONT* GUIAPI GetNextDevFont (const DEVFONT* dev_font);
7480 
7481 #ifdef _MGFONT_FT2
7482 
7487 typedef enum {
7497  MG_SMOOTH_MAX /*do not remove*/
7498 } FT2LCDFilter;
7499 
7515 MG_EXPORT BOOL GUIAPI ft2SetLcdFilter (LOGFONT* logfont, FT2LCDFilter filter);
7516 
7517 #endif
7518 
7533 MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromIncoreData (const char *devfont_name,
7534  const void *data);
7535 
7552 MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name,
7553  const char *file_name);
7554 
7564 MG_EXPORT void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont);
7565 
7584 #define SYSLOGFONT_DEFAULT 0
7585 
7590 #define SYSLOGFONT_WCHAR_DEF 1
7591 
7596 #define SYSLOGFONT_FIXED 2
7597 
7602 #define SYSLOGFONT_CAPTION 3
7603 
7608 #define SYSLOGFONT_MENU 4
7609 
7614 #define SYSLOGFONT_CONTROL 5
7615 
7616 #define NR_SYSLOGFONTS 6
7617 
7618 
7619 extern MG_EXPORT PLOGFONT g_SysLogFont [];
7620 
7644 static inline PLOGFONT GUIAPI GetSystemFont (int font_id)
7645 {
7646  if (font_id >= 0 && font_id < NR_SYSLOGFONTS)
7647  return g_SysLogFont [font_id];
7648  else
7649  return (PLOGFONT)NULL;
7650 }
7651 
7666 MG_EXPORT int GUIAPI GetSysFontMaxWidth (int font_id);
7667 
7682 MG_EXPORT int GUIAPI GetSysFontAveWidth (int font_id);
7683 
7697 MG_EXPORT int GUIAPI GetSysFontHeight (int font_id);
7698 
7713 MG_EXPORT const char* GUIAPI GetSysCharset (BOOL wchar);
7714 
7729 MG_EXPORT int GUIAPI GetSysCharHeight (void);
7730 
7744 MG_EXPORT int GUIAPI GetSysCharWidth (void);
7745 
7757 MG_EXPORT int GUIAPI GetSysCCharWidth (void);
7758 
7773 {
7775  int len;
7777  unsigned char delimiter;
7780 };
7781 
7801 MG_EXPORT int GUIAPI GetTextMCharInfo (PLOGFONT log_font,
7802  const char* mstr, int len, int* pos_chars);
7803 
7827 MG_EXPORT int GUIAPI GetTextWordInfo (PLOGFONT log_font, const char* mstr,
7828  int len, int* pos_words, WORDINFO* info_words);
7829 
7845 MG_EXPORT int GUIAPI GetFirstMCharLen (PLOGFONT log_font,
7846  const char* mstr, int len);
7847 
7868 MG_EXPORT int GUIAPI GetFirstWord (PLOGFONT log_font,
7869  const char* mstr, int len, WORDINFO* word_info);
7870 
7902 MG_EXPORT int GUIAPI GetTextExtentPoint (HDC hdc, const char* text, int len,
7903  int max_extent, int* fit_chars, int* pos_chars,
7904  int* dx_chars, SIZE* size);
7905 
7914 MG_EXPORT int GUIAPI GetTabbedTextExtentPoint (HDC hdc,
7915  const char* text, int len, int max_extent,
7916  int* fit_chars, int* pos_chars, int* dx_chars, SIZE* size);
7917 
7918 #ifdef _MGCHARSET_UNICODE
7919 
7920 #include <stddef.h>
7921 #include <stdlib.h>
7922 
7943 MG_EXPORT int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32,
7944  const unsigned char* mstr, int n);
7945 
7952 #define MB2WC(log_font, dest, mstr, n) \
7953  MB2WCEx (log_font, dest, sizeof(wchar_t) == 4, mstr, n)
7954 
7972 MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, Uchar32 wc);
7973 
7980 #define WC2MB(log_font, s, wc) \
7981  WC2MBEx (log_font, s, (Uchar32)wc)
7982 
8015 MG_EXPORT int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32,
8016  const unsigned char* mstr, int mstr_len, int n,
8017  int* conved_mstr_len);
8018 
8025 #define MBS2WCS(log_font, dest, mstr, mstr_len, n) \
8026  MBS2WCSEx(log_font, dest, sizeof (wchar_t) == 4, mstr, \
8027  mstr_len, n, NULL)
8028 
8061 MG_EXPORT int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest,
8062  const void *wcs, int wcs_len, BOOL wc32, int n,
8063  int* conved_wcs_len);
8064 
8071 #define WCS2MBS(log_font, dest, wcs, wcs_len, n) \
8072  WCS2MBSEx (log_font, dest, wcs, wcs_len, sizeof (wchar_t) == 4, \
8073  n, NULL)
8074 
8075 #endif /* _MGCHARSET_UNICODE */
8076 
8099 
8108 
8120 
8121 #define BIDI_FLAG_SHAPE_MIRRORING 0x00000001
8122 #define BIDI_FLAG_REORDER_NSM 0x00000002
8123 #define BIDI_FLAG_SHAPE_ARAB_PRES 0x00000100
8124 #define BIDI_FLAG_SHAPE_ARAB_LIGA 0x00000200
8125 #define BIDI_FLAG_SHAPE_ARAB_CONSOLE 0x00000400
8126 
8127 #define BIDI_FLAGS_DEFAULT \
8128  (BIDI_FLAG_REORDER_NSM | BIDI_FLAG_REMOVE_SPECIALS)
8129 
8130 #define BIDI_FLAGS_ARABIC \
8131  (BIDI_FLAG_SHAPE_ARAB_PRES | BIDI_FLAG_SHAPE_ARAB_LIGA)
8132 
8133 #define BIDI_FLAG_REMOVE_BIDI 0x00010000
8134 #define BIDI_FLAG_REMOVE_JOINING 0x00020000
8135 #define BIDI_FLAG_REMOVE_SPECIALS 0x00040000
8136 
8137 #define BIDI_BRACKET_NONE 0
8138 #define BIDI_BRACKET_OPEN_MASK 0x80000000
8139 #define BIDI_BRACKET_CHAR_MASK 0X7FFFFFFF
8140 #define BIDI_IS_BRACKET_OPEN(bt) ((bt & BIDI_BRACKET_OPEN_MASK)>0)
8141 #define BIDI_BRACKET_CHAR(bt) ((bt & BIDI_BRACKET_CHAR_MASK))
8142 
8143 /*
8144  * Define some bit masks, that character types are based on, each one has
8145  * only one bit on.
8146  */
8147 
8148 #define BIDI_TYPE_INVALID 0x0000
8149 
8150 #define BIDI_MASK_RTL 0x0001 /* Is right to left */
8151 #define BIDI_MASK_ARABIC 0x0002 /* Is arabic */
8152 #define BIDI_MASK_FIRST 0x0004 /* Is direction is determined by first strong */
8153 #define BIDI_MASK_SEPARATOR 0x0008 /* Is separator: BS, SS */
8154 
8155 #define BIDI_MASK_STRONG 0x0010 /* Is strong */
8156 #define BIDI_MASK_WEAK 0x0020 /* Is weak */
8157 #define BIDI_MASK_NEUTRAL 0x0040 /* Is neutral */
8158 #define BIDI_MASK_SENTINEL 0x0080 /* Is sentinel: SOT, EOT */
8159 
8160 /* Each char can be only one of the seven following: */
8161 #define BIDI_MASK_LETTER 0x0100 /* Is letter: L, R, AL */
8162 #define BIDI_MASK_NUMBER 0x0200 /* Is number: EN, AN */
8163 #define BIDI_MASK_NUMSEPTER 0x0300 /* Is number separator or terminator: ES, ET, CS */
8164 #define BIDI_MASK_SPACE 0x0400 /* Is space: BN, BS, SS, WS */
8165 #define BIDI_MASK_EXPLICIT 0x0500 /* Is expilict mark: LRE, RLE, LRO, RLO, PDF */
8166 #define BIDI_MASK_ISOLATE 0x0600 /* Is isolate mark: LRI, RLI, FSI, PDI */
8167 #define BIDI_MASK_NSM 0x0700 /* Is non spacing mark: NSM */
8168 # define BIDI_TYPE_MASK 0x0700
8169 
8170 #define BIDI_MASK_OVERRIDE 0x8000 /* Is explicit override: LRO, RLO */
8171 
8172 /* Each char can be only one of the seven following: */
8173 #define BIDI_MASK_ES 0x1000
8174 #define BIDI_MASK_CS 0x2000
8175 #define BIDI_MASK_ET 0x3000
8176 #define BIDI_MASK_BS 0x4000
8177 #define BIDI_MASK_SS 0x5000
8178 #define BIDI_MASK_BN 0x6000
8179 #define BIDI_MASK_WS 0x7000
8180 # define BIDI_MISC_MASK 0x7000
8181 
8182 /* Reserved for private use */
8183 #define BIDI_MASK_PRIVATE 0x8000
8184 
8189 #define BIDI_TYPE_LTR \
8190  (BIDI_MASK_STRONG | BIDI_MASK_LETTER)
8191 
8196 #define BIDI_TYPE_RTL \
8197  (BIDI_MASK_STRONG | BIDI_MASK_LETTER | BIDI_MASK_RTL)
8198 
8203 #define BIDI_TYPE_AL \
8204  (BIDI_MASK_STRONG | BIDI_MASK_LETTER | BIDI_MASK_RTL | BIDI_MASK_ARABIC)
8205 
8210 #define BIDI_TYPE_LRE \
8211  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT)
8212 
8217 #define BIDI_TYPE_RLE \
8218  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_RTL)
8219 
8224 #define BIDI_TYPE_LRO \
8225  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_OVERRIDE)
8226 
8231 #define BIDI_TYPE_RLO \
8232  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_RTL | BIDI_MASK_OVERRIDE)
8233 
8238 #define BIDI_TYPE_PDF \
8239  (BIDI_MASK_WEAK | BIDI_MASK_EXPLICIT)
8240 
8245 #define BIDI_TYPE_EN \
8246  (BIDI_MASK_WEAK | BIDI_MASK_NUMBER)
8247 
8252 #define BIDI_TYPE_AN \
8253  (BIDI_MASK_WEAK | BIDI_MASK_NUMBER | BIDI_MASK_ARABIC)
8254 
8259 #define BIDI_TYPE_ES \
8260  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_ES)
8261 
8266 #define BIDI_TYPE_ET \
8267  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_ET)
8268 
8273 #define BIDI_TYPE_CS \
8274  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_CS)
8275 
8280 #define BIDI_TYPE_NSM \
8281  (BIDI_MASK_WEAK | BIDI_MASK_NSM)
8282 
8287 #define BIDI_TYPE_BN \
8288  (BIDI_MASK_WEAK | BIDI_MASK_SPACE | BIDI_MASK_BN)
8289 
8294 #define BIDI_TYPE_BS \
8295  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_SEPARATOR | BIDI_MASK_BS)
8296 
8301 #define BIDI_TYPE_SS \
8302  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_SEPARATOR | BIDI_MASK_SS)
8303 
8308 #define BIDI_TYPE_WS \
8309  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_WS)
8310 
8315 #define BIDI_TYPE_ON \
8316  (BIDI_MASK_NEUTRAL)
8317 
8322 #define BIDI_TYPE_LRI \
8323  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE)
8324 
8329 #define BIDI_TYPE_RLI \
8330  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE | BIDI_MASK_RTL)
8331 
8336 #define BIDI_TYPE_FSI \
8337  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE | BIDI_MASK_FIRST)
8338 
8343 #define BIDI_TYPE_PDI \
8344  (BIDI_MASK_NEUTRAL | BIDI_MASK_WEAK | BIDI_MASK_ISOLATE)
8345 
8346 #define BIDI_TYPE_SENTINEL (BIDI_MASK_SENTINEL)
8347 
8348 /* The following are only used internally */
8349 
8350 /* Weak Left-To-Right */
8351 #define BIDI_TYPE_WLTR (BIDI_MASK_WEAK)
8352 /* Weak Right-To-Left */
8353 #define BIDI_TYPE_WRTL (BIDI_MASK_WEAK | BIDI_MASK_RTL)
8354 
8355 /* Start of text */
8356 #define BIDI_TYPE_SOT (BIDI_MASK_SENTINEL)
8357 /* End of text */
8358 #define BIDI_TYPE_EOT (BIDI_MASK_SENTINEL | BIDI_MASK_RTL)
8359 
8360 #define BIDI_TYPE_PRIVATE (BIDI_MASK_PRIVATE)
8361 
8362 /* Is private-use value? */
8363 #define BIDI_IS_PRIVATE(p) ((p) & BIDI_MASK_PRIVATE)
8364 
8365 /* Is right to left? */
8366 #define BIDI_IS_RTL(p) ((p) & BIDI_MASK_RTL)
8367 
8368 /* Is arabic? */
8369 #define BIDI_IS_ARABIC(p) ((p) & BIDI_MASK_ARABIC)
8370 
8371 /* Is right-to-left level? */
8372 #define BIDI_LEVEL_IS_RTL(lev) ((lev) & 1)
8373 
8374 /* Return the bidi type corresponding to the direction of the level number,
8375  BIDI_TYPE_LTR for evens and BIDI_TYPE_RTL for odds. */
8376 #define BIDI_LEVEL_TO_DIR(lev) \
8377  (BIDI_LEVEL_IS_RTL(lev) ? BIDI_TYPE_RTL : BIDI_TYPE_LTR)
8378 
8379 /* Return the minimum level of the direction, 0 for BIDI_TYPE_LTR and
8380  1 for BIDI_TYPE_RTL and BIDI_TYPE_AL. */
8381 #define BIDI_DIR_TO_LEVEL(dir) \
8382  ((BidiLevel) (BIDI_IS_RTL(dir) ? 1 : 0))
8383 
8384 /* Is strong? */
8385 #define BIDI_IS_STRONG(p) ((p) & BIDI_MASK_STRONG)
8386 /* Is weak? */
8387 #define BIDI_IS_WEAK(p) ((p) & BIDI_MASK_WEAK)
8388 /* Is neutral? */
8389 #define BIDI_IS_NEUTRAL(p) ((p) & BIDI_MASK_NEUTRAL)
8390 /* Is sentinel? */
8391 #define BIDI_IS_SENTINEL(p) ((p) & BIDI_MASK_SENTINEL)
8392 
8393 /* Is letter: L, R, AL? */
8394 #define BIDI_IS_LETTER(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_LETTER)
8395 
8396 /* Is number: EN, AN? */
8397 #define BIDI_IS_NUMBER(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NUMBER)
8398 
8399 /* Is number separator or terminator: ES, ET, CS? */
8400 #define BIDI_IS_NUMBER_SEPARATOR_OR_TERMINATOR(p) \
8401  (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NUMSEPTER)
8402 
8403 /* Is space: BN, BS, SS, WS? */
8404 #define BIDI_IS_SPACE(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_SPACE)
8405 /* Is explicit mark: LRE, RLE, LRO, RLO, PDF? */
8406 #define BIDI_IS_EXPLICIT(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT)
8407 
8408 /* Is test separator: BS, SS? */
8409 #define BIDI_IS_SEPARATOR(p) ((p) & BIDI_MASK_SEPARATOR)
8410 
8411 /* Is explicit override: LRO, RLO? */
8412 #define BIDI_IS_OVERRIDE(p) ((p) & BIDI_MASK_OVERRIDE)
8413 
8414 /* Is isolote: LRO, RLO? */
8415 #define BIDI_IS_ISOLATE(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_ISOLATE)
8416 
8417 /* Is left to right letter: LTR? */
8418 #define BIDI_IS_LTR_LETTER(p) \
8419  ((p) & (BIDI_MASK_LETTER | BIDI_MASK_RTL) == BIDI_MASK_LETTER)
8420 
8421 /* Is right to left letter: RTL, AL? */
8422 #define BIDI_IS_RTL_LETTER(p) \
8423  ((p) & (BIDI_MASK_LETTER | BIDI_MASK_RTL) \
8424  == (BIDI_MASK_LETTER | BIDI_MASK_RTL))
8425 
8426 /* Is ES or CS: ES, CS? */
8427 #define BIDI_IS_ES_OR_CS(p) \
8428  (((p) & BIDI_MISC_MASK) == BIDI_MASK_ES || \
8429  ((p) & BIDI_MISC_MASK) == BIDI_MASK_CS)
8430 
8431 /* Change numbers: EN, AN to RTL. */
8432 #define BIDI_NUMBER_TO_RTL(p) \
8433  (BIDI_IS_NUMBER(p) ? BIDI_TYPE_RTL : (p))
8434 
8435 /* Is explicit or BN: LRE, RLE, LRO, RLO, PDF, BN? */
8436 #define BIDI_IS_EXPLICIT_OR_BN(p) \
8437  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
8438  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN))
8439 
8440 /* Is explicit or BN or WS: LRE, RLE, LRO, RLO, PDF, BN, WS? */
8441 #define BIDI_IS_EXPLICIT_OR_BN_OR_WS(p) \
8442  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
8443  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN) || \
8444  (((p) & BIDI_MISC_MASK) == BIDI_MASK_WS))
8445 
8446 /* Is explicit or separator or BN or WS: LRE, RLE, LRO, RLO, PDF, BS, SS, BN, WS? */
8447 #define BIDI_IS_EXPLICIT_OR_SEPARATOR_OR_BN_OR_WS(p) \
8448  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
8449  ((p) & BIDI_MASK_SEPARATOR) || \
8450  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN) || \
8451  (((p) & BIDI_MISC_MASK) == BIDI_MASK_WS))
8452 
8453 /* Is explicit or BN or NSM: LRE, RLE, LRO, RLO, PDF, BN, NSM? */
8454 #define BIDI_IS_EXPLICIT_OR_BN_OR_NSM(p) \
8455  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
8456  (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NSM) || \
8457  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN))
8458 
8459 /* Override status of an explicit mark:
8460  * LRO,LRE->LTR, RLO,RLE->RTL, otherwise->ON. */
8461 #define BIDI_EXPLICIT_TO_OVERRIDE_DIR(p) \
8462  (BIDI_IS_OVERRIDE(p) ? BIDI_LEVEL_TO_DIR(BIDI_DIR_TO_LEVEL(p)) \
8463  : BIDI_TYPE_ON)
8464 
8465 /* Change numbers to RTL: EN,AN -> RTL. */
8466 #define BIDI_CHANGE_NUMBER_TO_RTL(p) \
8467  (BIDI_IS_NUMBER(p) ? BIDI_TYPE_RTL : (p))
8468 
8469 #define BIDI_PGDIR_LTR BIDI_TYPE_LTR
8470 #define BIDI_PGDIR_RTL BIDI_TYPE_RTL
8471 #define BIDI_PGDIR_WLTR BIDI_TYPE_WLTR
8472 #define BIDI_PGDIR_WRTL BIDI_TYPE_WRTL
8473 #define BIDI_PGDIR_ON BIDI_TYPE_ON
8474 
8475 /*
8476  * Define bit masks that joining types are based on, each mask has
8477  * only one bit set.
8478  */
8479 #define BIDI_MASK_JOINS_RIGHT 0x01 /* May join to right */
8480 #define BIDI_MASK_JOINS_LEFT 0x02 /* May join to right */
8481 #define BIDI_MASK_ARAB_SHAPES 0x04 /* May Arabic shape */
8482 #define BIDI_MASK_TRANSPARENT 0x08 /* Is transparent */
8483 #define BIDI_MASK_IGNORED 0x10 /* Is ignored */
8484 #define BIDI_MASK_LIGATURED 0x20 /* Is ligatured */
8485 
8486 /*
8487  * Define values for BidiJoiningType
8488  */
8489 
8490 /* nUn-joining */
8491 #define BIDI_JOINING_TYPE_U_VAL ( 0 )
8492 
8493 /* Right-joining */
8494 #define BIDI_JOINING_TYPE_R_VAL \
8495  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_ARAB_SHAPES )
8496 
8497 /* Dual-joining */
8498 #define BIDI_JOINING_TYPE_D_VAL \
8499  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
8500  | BIDI_MASK_ARAB_SHAPES )
8501 
8502 /* join-Causing */
8503 #define BIDI_JOINING_TYPE_C_VAL \
8504  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT )
8505 
8506 /* Left-joining */
8507 #define BIDI_JOINING_TYPE_L_VAL \
8508  ( BIDI_MASK_JOINS_LEFT | BIDI_MASK_ARAB_SHAPES )
8509 
8510 /* Transparent */
8511 #define BIDI_JOINING_TYPE_T_VAL \
8512  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_ARAB_SHAPES )
8513 
8514 /* iGnored */
8515 #define BIDI_JOINING_TYPE_G_VAL ( BIDI_MASK_IGNORED )
8516 
8517 /*
8518  * The equivalent of JoiningType values for ArabicProp
8519  */
8520 
8521 /* Primary Arabic Joining Classes (Table 8-2) */
8522 
8523 /* nUn-joining */
8524 #define BIDI_IS_JOINING_TYPE_U(p) \
8525  ( 0 == ( (p) & \
8526  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8527  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
8528 
8529 /* Right-joining */
8530 #define BIDI_IS_JOINING_TYPE_R(p) \
8531  ( BIDI_MASK_JOINS_RIGHT == ( (p) & \
8532  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8533  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
8534 
8535 /* Dual-joining */
8536 #define BIDI_IS_JOINING_TYPE_D(p) \
8537  ( ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
8538  | BIDI_MASK_ARAB_SHAPES ) == ( (p) & \
8539  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8540  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
8541  | BIDI_MASK_ARAB_SHAPES ) ) )
8542 
8543 /* join-Causing */
8544 #define BIDI_IS_JOINING_TYPE_C(p) \
8545  ( ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) == ( (p) & \
8546  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8547  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
8548  | BIDI_MASK_ARAB_SHAPES ) ) )
8549 
8550 /* Left-joining */
8551 #define BIDI_IS_JOINING_TYPE_L(p) \
8552  ( BIDI_MASK_JOINS_LEFT == ( (p) & \
8553  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8554  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
8555 
8556 /* Transparent */
8557 #define BIDI_IS_JOINING_TYPE_T(p) \
8558  ( BIDI_MASK_TRANSPARENT == ( (p) & \
8559  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED ) ) )
8560 
8561 /* iGnored */
8562 #define BIDI_IS_JOINING_TYPE_G(p) \
8563  ( BIDI_MASK_IGNORED == ( (p) & \
8564  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED ) ) )
8565 
8566 /* and for Derived Arabic Joining Classes (Table 8-3) */
8567 
8568 /* Right join-Causing */
8569 #define BIDI_IS_JOINING_TYPE_RC(p) \
8570  ( BIDI_MASK_JOINS_RIGHT == ( (p) & \
8571  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8572  | BIDI_MASK_JOINS_RIGHT ) ) )
8573 
8574 /* Left join-Causing */
8575 #define BIDI_IS_JOINING_TYPE_LC(p) \
8576  ( BIDI_MASK_JOINS_LEFT == ( (p) & \
8577  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8578  | BIDI_MASK_JOINS_LEFT ) ) )
8579 
8580 /*
8581  * Defining macros for needed queries, It is fully dependent on the
8582  * implementation of BidiJoiningType.
8583  */
8584 
8585 /* Joins to right: R, D, C? */
8586 #define BIDI_JOINS_RIGHT(p) ((p) & BIDI_MASK_JOINS_RIGHT)
8587 
8588 /* Joins to left: L, D, C? */
8589 #define BIDI_JOINS_LEFT(p) ((p) & BIDI_MASK_JOINS_LEFT)
8590 
8591 /* May shape: R, D, L, T? */
8592 #define BIDI_ARAB_SHAPES(p) ((p) & BIDI_MASK_ARAB_SHAPES)
8593 
8594 /* Is skipped in joining: T, G? */
8595 #define BIDI_IS_JOIN_SKIPPED(p) \
8596  ((p) & (BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED))
8597 
8598 /* Is base that will be shaped: R, D, L? */
8599 #define BIDI_IS_JOIN_BASE_SHAPES(p) \
8600  ( BIDI_MASK_ARAB_SHAPES == ( (p) & \
8601  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
8602  | BIDI_MASK_ARAB_SHAPES ) ) )
8603 
8604 #define BIDI_JOINS_PRECEDING_MASK(level) \
8605  (BIDI_LEVEL_IS_RTL (level) ? BIDI_MASK_JOINS_RIGHT \
8606  : BIDI_MASK_JOINS_LEFT)
8607 
8608 #define BIDI_JOINS_FOLLOWING_MASK(level) \
8609  (BIDI_LEVEL_IS_RTL (level) ? BIDI_MASK_JOINS_LEFT \
8610  : BIDI_MASK_JOINS_RIGHT)
8611 
8612 #define BIDI_JOIN_SHAPE(p) \
8613  ((p) & ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ))
8614 
8617 #ifdef _MGCHARSET_UNICODE
8618 
8640 MG_EXPORT UCharGeneralCategory GUIAPI UCharGetCategory(Uchar32 uc);
8641 
8657 MG_EXPORT UCharBreakType GUIAPI UCharGetBreakType(Uchar32 uc);
8658 
8677 MG_EXPORT BidiType GUIAPI UCharGetBidiType(Uchar32 uc);
8678 
8695 MG_EXPORT void GUIAPI UStrGetBidiTypes(const Uchar32* ucs, int nr_ucs,
8696  BidiType* bdts);
8697 
8723 MG_EXPORT BidiBracketType GUIAPI UCharGetBracketType(Uchar32 ch);
8724 
8745 MG_EXPORT void GUIAPI UStrGetBracketTypes(const Uchar32 *ucs,
8746  const BidiType *bidi_types, int len_ucs,
8747  BidiBracketType *bracket_types);
8748 
8771 MG_EXPORT BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32* mirrored);
8772 
8797 MG_EXPORT BidiJoiningType GUIAPI UCharGetJoiningType(Uchar32 uc);
8798 
8817 MG_EXPORT void GUIAPI UStrGetJoiningTypes(const Uchar32 *ucs, int nr_ucs,
8818  BidiJoiningType *joining_types);
8819 
8846 MG_EXPORT BidiType GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len);
8847 
8887 MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevels(
8888  const BidiType *bidi_types,
8889  const BidiBracketType* bracket_types, int len,
8890  ParagraphDir *paragraph_dir, BidiLevel *embedding_levels);
8891 
8927 MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevelsAlt(
8928  const Uchar32* ucs, int nr_ucs,
8929  ParagraphDir *paragraph_dir, BidiLevel *embedding_levels);
8930 
8931 /*
8932  * \var typedef void (*CB_REVERSE_ARRAY) (void* extra, int len, int pos)
8933  * \brief The prototype of the user defined function to reverse an array.
8934  *
8935  * The function reverse an array pointed by \a extra from the position
8936  * specified by \a pos for the length specified by \a len.
8937  *
8938  * \sa UBidiReorderLine, BIDILogAChars2VisACharsEx
8939  */
8940 typedef void (*CB_REVERSE_ARRAY) (void* extra, int len, int pos);
8941 
9001 MG_EXPORT BidiLevel GUIAPI UBidiReorderLine(Uint32 bidi_flags,
9002  const BidiType *bidi_types, int len, int off,
9003  ParagraphDir paragraph_dir, BidiLevel *embedding_levels,
9004  Uchar32 *visual_str, int *indices_map,
9005  void* extra, CB_REVERSE_ARRAY cb_reverse_extra);
9006 
9029 MG_EXPORT void GUIAPI UBidiShapeMirroring(const BidiLevel *embedding_levels,
9030  int len, Uchar32* ucs);
9031 
9065 MG_EXPORT void GUIAPI UBidiJoinArabic(const BidiType *bidi_types,
9066  const BidiLevel *embedding_levels, int len,
9067  BidiArabicProp *ar_props);
9068 
9106 MG_EXPORT void GUIAPI UBidiShapeArabic(Uint32 shaping_flags,
9107  const BidiLevel *embedding_levels, int len,
9108  BidiArabicProp *ar_props, Uchar32* ucs);
9109 
9142 MG_EXPORT void GUIAPI UBidiShape(Uint32 shaping_flags,
9143  const BidiLevel *embedding_levels, int len,
9144  BidiArabicProp *ar_props, Uchar32* ucs);
9145 
9164 #define CTR_NONE 0x00
9165 
9166 #define CTR_CASE_MASK 0x0F
9167 
9174 #define CTR_CAPITALIZE 0x01
9175 
9181 #define CTR_UPPERCASE 0x02
9182 
9188 #define CTR_LOWERCASE 0x03
9189 
9198 #define CTR_FULL_WIDTH 0x10
9199 
9209 #define CTR_FULL_SIZE_KANA 0x20
9210 
9228 #define WBR_NORMAL 0x00
9229 
9235 #define WBR_BREAK_ALL 0x01
9236 
9242 #define WBR_KEEP_ALL 0x02
9243 
9261 #define LBP_NORMAL 0x00
9262 
9269 #define LBP_LOOSE 0x01
9270 
9276 #define LBP_STRICT 0x02
9277 
9288 #define LBP_ANYWHERE 0x03
9289 
9308 #define BOV_UNKNOWN 0x0000
9309 
9312 #define BOV_WHITESPACE 0x8000
9313 
9316 #define BOV_EXPANDABLE_SPACE 0x0800
9317 
9321 #define BOV_ZERO_WIDTH 0x0080
9322 
9323 #define BOV_GB_MASK 0x7000
9324 
9327 #define BOV_GB_CHAR_BREAK 0x1000
9328 
9332 #define BOV_GB_CURSOR_POS 0x2000
9333 
9337 #define BOV_GB_BACKSPACE_DEL_CH 0x4000
9338 
9339 #define BOV_WB_MASK 0x0700
9340 
9343 #define BOV_WB_WORD_BOUNDARY 0x0100
9344 
9347 #define BOV_WB_WORD_START 0x0200
9348 
9351 #define BOV_WB_WORD_END 0x0400
9352 
9353 #define BOV_SB_MASK 0x0070
9354 
9357 #define BOV_SB_SENTENCE_BOUNDARY 0x0010
9358 
9361 #define BOV_SB_SENTENCE_START 0x0020
9362 
9365 #define BOV_SB_SENTENCE_END 0x0040
9366 
9367 #define BOV_LB_MASK 0x000F
9368 #define BOV_LB_BREAK_FLAG 0x0004
9369 #define BOV_LB_MANDATORY_FLAG 0x0008
9370 
9373 #define BOV_LB_ALLOWED (BOV_LB_BREAK_FLAG | 0x0001)
9374 
9377 #define BOV_LB_MANDATORY (BOV_LB_BREAK_FLAG | BOV_LB_MANDATORY_FLAG | 0x0002)
9378 
9381 #define BOV_LB_NOTALLOWED 0x0003
9382 
9387 
9449 MG_EXPORT int GUIAPI UStrGetBreaks(LanguageCode lang_code,
9450  Uint8 ctr, Uint8 wbr, Uint8 lbp,
9451  Uchar32* ucs, int nr_ucs, BreakOppo** break_oppos);
9452 
9453 MG_EXPORT void GUIAPI UStrTailorBreaks(ScriptType writing_system,
9454  const Uchar32* ucs, int nr_ucs, BreakOppo* break_oppos);
9455 
9457 MG_EXPORT BOOL GUIAPI IsUCharAlnum(Uchar32 uc);
9458 
9460 MG_EXPORT BOOL GUIAPI IsUCharAlpha(Uchar32 uc);
9461 
9463 MG_EXPORT BOOL GUIAPI IsUCharControl(Uchar32 uc);
9464 
9466 MG_EXPORT BOOL GUIAPI IsUCharDigit(Uchar32 uc);
9467 
9469 MG_EXPORT BOOL GUIAPI IsUCharGraph(Uchar32 uc);
9470 
9472 MG_EXPORT BOOL GUIAPI IsUCharLowercase(Uchar32 uc);
9473 
9475 MG_EXPORT BOOL GUIAPI IsUCharPrint(Uchar32 uc);
9476 
9478 MG_EXPORT BOOL GUIAPI IsUCharUppercase(Uchar32 uc);
9479 
9481 MG_EXPORT BOOL GUIAPI IsUCharPunct(Uchar32 uc);
9482 
9485 MG_EXPORT BOOL GUIAPI IsUCharSpace(Uchar32 uc);
9486 
9489 MG_EXPORT BOOL GUIAPI IsUCharMark(Uchar32 uc);
9490 
9499 MG_EXPORT BOOL GUIAPI IsUCharTitle(Uchar32 uc);
9500 
9502 MG_EXPORT BOOL GUIAPI IsUCharXDigit(Uchar32 uc);
9503 
9505 MG_EXPORT BOOL GUIAPI IsUCharDefined(Uchar32 uc);
9506 
9508 MG_EXPORT BOOL GUIAPI IsUCharZeroWidth(Uchar32 uc);
9509 
9511 MG_EXPORT BOOL GUIAPI IsUCharWide(Uchar32 uc);
9512 
9521 MG_EXPORT BOOL GUIAPI IsUCharWideCJK(Uchar32 uc);
9522 
9524 MG_EXPORT Uchar32 UCharToUpper (Uchar32 uc);
9525 
9527 MG_EXPORT Uchar32 GUIAPI UCharToLower (Uchar32 uc);
9528 
9530 MG_EXPORT Uchar32 GUIAPI UCharToTitle (Uchar32 uc);
9531 
9533 MG_EXPORT Uchar32 GUIAPI UCharToFullWidth (Uchar32 uc);
9534 
9536 MG_EXPORT Uchar32 GUIAPI UCharToSingleWidth (Uchar32 uc);
9537 
9539 MG_EXPORT Uchar32 GUIAPI UCharToFullSizeKana (Uchar32 uc);
9540 
9542 MG_EXPORT Uchar32 GUIAPI UCharToSmallKana (Uchar32 uc);
9543 
9545 MG_EXPORT BOOL GUIAPI UCharIsArabicVowel(Uchar32 uc);
9546 
9548 MG_EXPORT int GUIAPI UCharCombiningClass (Uchar32 uc);
9549 
9556 MG_EXPORT void GUIAPI UCharCanonicalOrdering (Uchar32 *string, int len);
9557 
9559 MG_EXPORT BOOL GUIAPI UCharCompose (Uchar32 a, Uchar32 b, Uchar32 *ch);
9560 
9562 MG_EXPORT BOOL GUIAPI UCharDecompose (Uchar32 ch, Uchar32 *a, Uchar32 *b);
9563 
9574 MG_EXPORT int GUIAPI UCharFullyDecompose (Uchar32 ch, BOOL compat,
9575  Uchar32 *result, int result_len);
9576 
9593 MG_EXPORT ScriptType GUIAPI UCharGetScriptType (Uchar32 ch);
9594 
9620 MG_EXPORT Uint32 GUIAPI ScriptTypeToISO15924 (ScriptType script);
9621 
9647 MG_EXPORT ScriptType GUIAPI ScriptTypeFromISO15924 (Uint32 iso15924);
9648 
9670 static inline ScriptType GUIAPI ScriptTypeFromISO15924Code (const char* iso15924)
9671 {
9672  return ScriptTypeFromISO15924(MAKEDWORD32(iso15924[3],
9673  iso15924[2], iso15924[1], iso15924[0]));
9674 }
9675 
9676 typedef enum _UVerticalOrient {
9677  UCHAR_VOP_U = 0,
9678  UCHAR_VOP_R,
9679  UCHAR_VOP_TU,
9680  UCHAR_VOP_TR,
9681 } UVerticalOrient;
9682 
9683 typedef enum {
9684  GLYPH_RUN_DIR_LTR = 0,
9685  GLYPH_RUN_DIR_RTL,
9686  GLYPH_RUN_DIR_TTB,
9687  GLYPH_RUN_DIR_BTT,
9688 } GlyphRunDir;
9689 
9690 typedef enum {
9691  GLYPH_GRAVITY_SOUTH = 0,
9692  GLYPH_GRAVITY_EAST,
9693  GLYPH_GRAVITY_NORTH,
9694  GLYPH_GRAVITY_WEST,
9695  GLYPH_GRAVITY_AUTO,
9696 } GlyphGravity;
9697 
9698 typedef enum {
9699  GLYPH_GRAVITY_POLICY_NATURAL,
9700  GLYPH_GRAVITY_POLICY_STRONG,
9701  GLYPH_GRAVITY_POLICY_LINE,
9702  GLYPH_GRAVITY_POLICY_MIXED,
9703 } GlyphGravityPolicy;
9704 
9706 MG_EXPORT UVerticalOrient GUIAPI UCharGetVerticalOrientation(Uchar32 uc);
9707 
9728 MG_EXPORT GlyphGravity GUIAPI ScriptGetGlyphGravity(ScriptType script,
9729  BOOL vertical, GlyphGravity base_gravity, GlyphGravityPolicy policy);
9730 
9759 GlyphGravity ScriptGetGlyphGravityForWide (ScriptType script,
9760  BOOL vertical, BOOL wide,
9761  GlyphGravity base_gravity, GlyphGravityPolicy policy);
9762 
9765 #endif /* _MGCHARSET_UNICODE */
9766 
9784 MG_EXPORT int GUIAPI GetFontHeight (HDC hdc);
9785 
9799 MG_EXPORT int GUIAPI GetMaxFontWidth (HDC hdc);
9800 
9801 
9820 MG_EXPORT int GUIAPI GetTextExtent (HDC hdc,
9821  const char* spText, int len, SIZE* pSize);
9822 
9843 MG_EXPORT int GUIAPI GetTabbedTextExtent (HDC hdc,
9844  const char* spText, int len, SIZE* pSize);
9845 
9852 #define GetTextCharacterExtra(hdc) GetDCAttr (hdc, DC_ATTR_CHAR_EXTRA)
9853 
9860 #define GetTextWordExtra(hdc) GetDCAttr (hdc, DC_ATTR_WORD_EXTRA)
9861 
9868 #define GetTextAboveLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_ALINE_EXTRA)
9869 
9876 #define GetTextBellowLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_BLINE_EXTRA)
9877 
9885 #define SetTextCharacterExtra(hdc, extra) \
9886  SetDCAttr (hdc, DC_ATTR_CHAR_EXTRA, (DWORD) extra)
9887 
9895 #define SetTextWordExtra(hdc, extra) \
9896  SetDCAttr (hdc, DC_ATTR_WORD_EXTRA, (DWORD) extra)
9897 
9904 #define SetTextAboveLineExtra(hdc, extra) \
9905  SetDCAttr (hdc, DC_ATTR_ALINE_EXTRA, (DWORD) extra)
9906 
9913 #define SetTextBellowLineExtra(hdc, extra) \
9914  SetDCAttr (hdc, DC_ATTR_BLINE_EXTRA, (DWORD) extra)
9915 
9916 #define TA_LEFT 0x0000
9917 #define TA_RIGHT 0x0001
9918 #define TA_CENTER 0x0002
9919 #define TA_X_MASK 0x000F
9920 
9921 #define TA_TOP 0x0000
9922 #define TA_BASELINE 0x0010
9923 #define TA_BOTTOM 0x0020
9924 #define TA_Y_MASK 0x00F0
9925 
9926 #define TA_NOUPDATECP 0x0000
9927 #define TA_UPDATECP 0x0100
9928 #define TA_CP_MASK 0x0F00
9929 
9981 #define GetTextAlign(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_ALIGN)
9982 
10039 #define SetTextAlign(hdc, ta_flags) \
10040  SetDCAttr (hdc, DC_ATTR_TEXT_ALIGN, (DWORD)ta_flags)
10041 
10042 #define BIDI_FLAG_LTR 0x00
10043 #define BIDI_FLAG_RTL 0x10
10044 
10045 #define GetBIDIFlags(hdc) \
10046  GetDCAttr (hdc, DC_ATTR_BIDI_FLAGS)
10047 
10048 #define SetBIDIFlags(hdc, bidi_flags) \
10049  SetDCAttr (hdc, DC_ATTR_BIDI_FLAGS, (DWORD)bidi_flags)
10050 
10069 MG_EXPORT int GUIAPI TextOutLen (HDC hdc, int x, int y,
10070  const char* spText, int len);
10071 
10072 
10094 MG_EXPORT int GUIAPI TextOutOmitted (HDC hdc, int x, int y,
10095  const char *mtext, int len, int max_extent);
10096 
10118 MG_EXPORT int GUIAPI TabbedTextOutLen (HDC hdc, int x, int y,
10119  const char* spText, int len);
10120 
10147 MG_EXPORT int GUIAPI TabbedTextOutEx (HDC hdc, int x, int y,
10148  const char* spText, int nCount,
10149  int nTabPositions, int *pTabPositions, int nTabOrigin);
10150 
10160 MG_EXPORT void GUIAPI GetLastTextOutPos (HDC hdc, POINT* pt);
10161 
10170 #define TextOut(hdc, x, y, text) TextOutLen (hdc, x, y, text, -1)
10171 
10180 #define TabbedTextOut(hdc, x, y, text) TabbedTextOutLen (hdc, x, y, text, -1)
10181 
10182 #define DT_TOP 0x00000000
10183 #define DT_LEFT 0x00000000
10184 #define DT_CENTER 0x00000001
10185 #define DT_RIGHT 0x00000002
10186 #define DT_VCENTER 0x00000004
10187 #define DT_BOTTOM 0x00000008
10188 #define DT_WORDBREAK 0x00000010
10189 #define DT_SINGLELINE 0x00000020
10190 #define DT_EXPANDTABS 0x00000040
10191 #define DT_TABSTOP 0x00000080
10192 #define DT_NOCLIP 0x00000100
10193 #define DT_EXTERNALLPADING 0x00000200
10194 #define DT_CALCRECT 0x00000400
10195 #define DT_NOPREFIX 0x00000800
10196 #define DT_INTERNAL 0x00001000
10197 #define DT_CHARBREAK 0x00002000
10198 
10202 typedef struct _DTFIRSTLINE
10203 {
10207  int startx;
10209  int starty;
10211  int width;
10213  int height;
10214 } DTFIRSTLINE;
10215 
10291 MG_EXPORT int GUIAPI DrawTextEx2 (HDC hdc, const char* pText, int nCount,
10292  RECT* pRect, int nIndent, UINT nFormat, DTFIRSTLINE *firstline);
10293 
10303 #define DrawText(hdc, text, n, rc, format) \
10304  DrawTextEx2 (hdc, text, n, rc, 0, format, NULL)
10305 
10314 #define DrawTextEx(hdc, text, n, rc, indent, format) \
10315  DrawTextEx2 (hdc, text, n, rc, indent, format, NULL)
10316 
10327 #define MYBMP_TYPE_NORMAL 0x00000000
10328 #define MYBMP_TYPE_RLE4 0x00000001
10329 #define MYBMP_TYPE_RLE8 0x00000002
10330 #define MYBMP_TYPE_RGB 0x00000003
10331 #define MYBMP_TYPE_BGR 0x00000004
10332 #define MYBMP_TYPE_RGBA 0x00000005
10333 #define MYBMP_TYPE_MASK 0x0000000F
10334 
10335 #define MYBMP_FLOW_DOWN 0x00000010
10336 #define MYBMP_FLOW_UP 0x00000020
10337 #define MYBMP_FLOW_MASK 0x000000F0
10338 
10339 #define MYBMP_TRANSPARENT 0x00000100
10340 #define MYBMP_ALPHACHANNEL 0x00000200
10341 #define MYBMP_ALPHA 0x00000400
10342 
10343 #define MYBMP_RGBSIZE_3 0x00001000
10344 #define MYBMP_RGBSIZE_4 0x00002000
10345 
10346 #define MYBMP_LOAD_GRAYSCALE 0x00010000
10347 #define MYBMP_LOAD_ALLOCATE_ONE 0x00020000
10348 #define MYBMP_LOAD_NONE 0x00000000
10349 
10352 {
10384  int frames;
10389  Uint8 reserved [2];
10392 
10401 
10404 };
10405 
10406 #define BMP_TYPE_NORMAL 0x00
10407 #define BMP_TYPE_RLE 0x01
10408 #define BMP_TYPE_ALPHA 0x02
10409 #define BMP_TYPE_ALPHACHANNEL 0x04
10410 #define BMP_TYPE_COLORKEY 0x10
10411 #define BMP_TYPE_ALPHA_MASK 0x20
10412 #define BMP_TYPE_REPLACEKEY 0x40
10413 
10415 struct _BITMAP
10416 {
10460 
10469 
10470  /* Obsolte.
10471  The private pixel format
10472  void* bmAlphaPixelFormat; */
10473 
10476 
10479 };
10480 
10492 #include <stdio.h>
10493 #include "endianrw.h"
10494 
10499 typedef void (* CB_ONE_SCANLINE) (void* context, MYBITMAP* my_bmp, int y);
10500 
10535 MG_EXPORT BOOL GUIAPI RegisterBitmapFileType (const char *ext,
10536  void* (*init) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal),
10537  int (*load) (MG_RWops* fp, void* init_info, MYBITMAP *my_bmp,
10538  CB_ONE_SCANLINE cb, void* context),
10539  void (*cleanup) (void* init_info),
10540  int (*save) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal),
10541  BOOL (*check) (MG_RWops* fp));
10542 
10558 MG_EXPORT const char* GUIAPI CheckBitmapType (MG_RWops* fp);
10559 
10601 #define MLS_BLENDMODE_NONE 0x00
10602 #define MLS_BLENDMODE_COLORKEY 0x01
10603 #define MLS_BLENDMODE_ALPHA 0x02
10604 
10605 #define MLS_INFOMASK_OFFSET 0x01
10606 #define MLS_INFOMASK_BLEND 0x02
10607 #define MLS_INFOMASK_ZORDER 0x04
10608 #define MLS_INFOMASK_ALL 0x07
10609 #define MLS_INFOMASK_ENABLE 0x08
10610 
10611 MG_EXPORT BOOL GUIAPI mlsSetSlaveScreenInfo (HDC dc_mls, DWORD mask, int offset_x, int offset_y,
10612  DWORD blend_flags, gal_pixel color_key, int alpha, int z_order);
10613 
10614 MG_EXPORT BOOL GUIAPI mlsGetSlaveScreenInfo (HDC dc_mls, DWORD mask, int* offset_x, int* offset_y,
10615  DWORD blend_flags, gal_pixel* color_key, int* alpha, int* z_order);
10629 MG_EXPORT BOOL GUIAPI mlsEnableSlaveScreen (HDC dc_mls, BOOL enable);
10630 
10631 
10632 #define ERR_BMP_OK 0
10633 #define ERR_BMP_IMAGE_TYPE -1
10634 #define ERR_BMP_UNKNOWN_TYPE -2
10635 #define ERR_BMP_CANT_READ -3
10636 #define ERR_BMP_CANT_SAVE -4
10637 #define ERR_BMP_NOT_SUPPORTED -5
10638 #define ERR_BMP_MEM -6
10639 #define ERR_BMP_LOAD -7
10640 #define ERR_BMP_FILEIO -8
10641 #define ERR_BMP_OTHER -9
10642 #define ERR_BMP_ERROR_SOURCE -10
10643 
10670 MG_EXPORT int GUIAPI LoadBitmapEx (HDC hdc, PBITMAP pBitmap,
10671  MG_RWops* area, const char* ext);
10672 
10680 MG_EXPORT int GUIAPI LoadBitmapFromFile (HDC hdc, PBITMAP pBitmap,
10681  const char* spFileName);
10682 
10689 #define LoadBitmap LoadBitmapFromFile
10690 
10698 MG_EXPORT int GUIAPI LoadBitmapFromMem (HDC hdc, PBITMAP pBitmap,
10699  const void* mem, int size, const char* ext);
10700 
10712 MG_EXPORT void GUIAPI UnloadBitmap (PBITMAP pBitmap);
10713 
10732 MG_EXPORT int GUIAPI SetBitmapKeyColor (HDC hdc, PBITMAP bmp, Uint8 r, Uint8 g, Uint8 b);
10733 
10748 MG_EXPORT void GUIAPI ReplaceBitmapColor (HDC hdc, PBITMAP pBitmap,
10749  gal_pixel iOColor, gal_pixel iNColor);
10750 
10760 MG_EXPORT void GUIAPI HFlipBitmap (BITMAP* bmp, unsigned char* inter_buff);
10761 
10771 MG_EXPORT void GUIAPI VFlipBitmap (BITMAP* bmp, unsigned char* inter_buff);
10772 
10791 MG_EXPORT void* GUIAPI InitMyBitmapSL (MG_RWops* area,
10792  const char* ext, MYBITMAP* my_bmp, RGB* pal);
10793 
10812 MG_EXPORT int GUIAPI LoadMyBitmapSL (MG_RWops* area, void* load_info,
10813  MYBITMAP* my_bmp, CB_ONE_SCANLINE cb, void* context);
10814 
10829 MG_EXPORT int GUIAPI CleanupMyBitmapSL (MYBITMAP* my_bmp, void* load_info);
10830 
10846 MG_EXPORT int GUIAPI LoadMyBitmapEx (PMYBITMAP my_bmp, RGB* pal,
10847  MG_RWops* area, const char* ext);
10848 
10856 MG_EXPORT int GUIAPI LoadMyBitmapFromFile (PMYBITMAP my_bmp, RGB* pal,
10857  const char* file_name);
10858 
10865 #define LoadMyBitmap LoadMyBitmapFromFile
10866 
10882 MG_EXPORT int GUIAPI LoadMyBitmapFromMem (PMYBITMAP my_bmp, RGB* pal,
10883  const void* mem, int size, const char* ext);
10884 
10896 MG_EXPORT void GUIAPI UnloadMyBitmap (PMYBITMAP my_bmp);
10897 
10898 #ifdef _MGMISC_SAVEBITMAP
10899 
10916 MG_EXPORT int GUIAPI SaveMyBitmapToFile (PMYBITMAP my_bmp, RGB* pal,
10917  const char* spFileName);
10918 
10934 MG_EXPORT int GUIAPI SaveBitmapToFile (HDC hdc, PBITMAP pBitmap,
10935  const char* spFileName);
10936 #define SaveBitmap SaveBitmapToFile
10937 #endif
10938 
10960 MG_EXPORT BOOL GUIAPI InitBitmap (HDC hdc, Uint32 w, Uint32 h, Uint32 pitch,
10961  BYTE* bits, PBITMAP bmp);
10962 
10974 MG_EXPORT HDC GUIAPI InitSlaveScreenEx (const char* name, const char* mode, int dpi);
10975 
10985 static inline HDC InitSlaveScreen (const char* name, const char* mode)
10986 {
10987  return InitSlaveScreenEx(name, mode, GDCAP_DPI_DEFAULT);
10988 }
10989 
10997 MG_EXPORT void GUIAPI TerminateSlaveScreen (HDC hdc);
11013 MG_EXPORT BOOL GUIAPI InitBitmapPixelFormat (HDC hdc, PBITMAP bmp);
11014 
11024 MG_EXPORT void GUIAPI DeleteBitmapAlphaPixel (PBITMAP bmp);
11025 
11026 /* Everything in the pixel format structure is read-only */
11027 typedef struct GAL_PixelFormat {
11028  GAL_Palette *palette;
11029 
11030  Uint8 BitsPerPixel;
11031  Uint8 BytesPerPixel;
11032  /* The flag indicating dithered palette */
11033  Uint8 DitheredPalette;
11034  /* The flag indicating the Most Significant Bits (MSB)
11035  * is left when depth is less than 8. */
11036  Uint8 MSBLeft;
11037 
11038  Uint8 Rloss;
11039  Uint8 Gloss;
11040  Uint8 Bloss;
11041  Uint8 Aloss;
11042  Uint8 Rshift;
11043  Uint8 Gshift;
11044  Uint8 Bshift;
11045  Uint8 Ashift;
11046  Uint32 Rmask;
11047  Uint32 Gmask;
11048  Uint32 Bmask;
11049  Uint32 Amask;
11050 
11051  /* RGB color key information */
11052  gal_pixel colorkey;
11053  /* Alpha value information (per-surface alpha) */
11054  gal_uint8 alpha;
11055 } GAL_PixelFormat;
11056 
11057 #define _FILL_MYBITMAP
11058 
11059 #ifndef MYBITMAP_CONTXT
11060 typedef struct _MYBITMAP_CONTXT{
11061  Uint32 colorKey;
11062  Uint32 pitch;
11063  GAL_PixelFormat* AlphaPixelFormat;
11064  MYBITMAP* mybmp;
11065 }MYBITMAP_CONTXT;
11066 #endif
11067 
11068 typedef BYTE* (* CB_DRAW_PIXEL) (HDC hdc, MYBITMAP_CONTXT* mybmp, Uint32 pixel, BYTE* dest);
11069 
11085 MG_EXPORT int GUIAPI ExpandMyBitmap (HDC hdc, PBITMAP bmp,
11086  const MYBITMAP* my_bmp, const RGB* pal, int frame);
11087 
11110 MG_EXPORT void GUIAPI ExpandMonoBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11111  const BYTE* my_bits, Uint32 my_pitch,
11112  Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg);
11113 
11114 MG_EXPORT void GUIAPI Expand16CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11115  const BYTE* my_bits, Uint32 my_pitch,
11116  Uint32 w, Uint32 h, DWORD flags,
11117  const RGB* pal, BYTE use_pal_alpha, BYTE alpha);
11118 
11140 static inline void GUIAPI Expand16CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11141  const BYTE* my_bits, Uint32 my_pitch,
11142  Uint32 w, Uint32 h, DWORD flags, const RGB* pal)
11143 {
11144  Expand16CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11145  w, h, flags, pal, FALSE, 0xFF);
11146 }
11147 
11148 MG_EXPORT void GUIAPI Expand256CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11149  const BYTE* my_bits, Uint32 my_pitch,
11150  Uint32 w, Uint32 h, DWORD flags,
11151  const RGB* pal, BYTE use_pal_alpha, BYTE alpha,
11152  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11177 static inline void GUIAPI Expand256CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11178  const BYTE* my_bits, Uint32 my_pitch,
11179  Uint32 w, Uint32 h, DWORD flags, const RGB* pal,
11180  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp)
11181 {
11182  Expand256CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11183  w, h, flags, pal, FALSE, 0xFF, cb_draw, mybmp);
11184 }
11185 
11209 MG_EXPORT void GUIAPI CompileRGBABitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11210  const BYTE* my_bits, Uint32 my_pitch,
11211  Uint32 w, Uint32 h, DWORD flags, void* pixel_format,
11212  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11213 
11226 MG_EXPORT void GUIAPI CompileRGBABitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11227  const BYTE* my_bits, Uint32 my_pitch,
11228  Uint32 w, Uint32 h, DWORD flags, void* pixel_format,
11229  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp,
11230  BYTE* alpha_mask);
11231 
11232 #ifdef _FILL_MYBITMAP
11233 MG_EXPORT int GUIAPI FillBoxWithMyBitmap (HDC hdc, int x, int y, MYBITMAP* mybmp, RGB* pal);
11234 
11235 MG_EXPORT void GUIAPI ExpandPartMonoBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11236  const BYTE* my_bits, Uint32 my_pitch,
11237  Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg,
11238  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11239 
11240 MG_EXPORT void GUIAPI ExpandPart16CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11241  const BYTE* my_bits, Uint32 my_pitch,
11242  Uint32 w, Uint32 h, DWORD flags,
11243  const RGB* pal, BYTE use_pal_alpha, BYTE alpha,
11244  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11245 
11246 static inline void GUIAPI ExpandPart16CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11247  const BYTE* my_bits, Uint32 my_pitch,
11248  Uint32 w, Uint32 h, DWORD flags, const RGB* pal,
11249  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp)
11250 {
11251  ExpandPart16CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11252  w, h, flags, pal, FALSE, 0xFF, stepx, cb_draw, mybmp);
11253 }
11254 
11255 #endif
11256 
11257 #define CompileRGBBitmap CompileRGBABitmap
11258 
11287 MG_EXPORT int GUIAPI PaintImageEx (HDC hdc, int x, int y,
11288  MG_RWops* area, const char* ext);
11289 
11304 MG_EXPORT int GUIAPI PaintImageFromFile (HDC hdc, int x, int y,
11305  const char* spFileName);
11306 
11323 MG_EXPORT int GUIAPI PaintImageFromMem (HDC hdc, int x, int y,
11324  const void* mem, int size, const char* ext);
11325 
11357 MG_EXPORT int GUIAPI StretchPaintImageEx (HDC hdc, int x, int y, int w, int h,
11358  MG_RWops* area, const char* ext);
11359 
11376 MG_EXPORT int GUIAPI StretchPaintImageFromFile (HDC hdc, int x, int y,
11377  int w, int h, const char* spFileName);
11378 
11397 MG_EXPORT int GUIAPI StretchPaintImageFromMem (HDC hdc, int x, int y,
11398  int w, int h, const void* mem, int size, const char* ext);
11399 
11400 #ifdef _MGHAVE_FIXED_MATH
11401 
11417 MG_EXPORT void GUIAPI RotateBitmap (HDC hdc, const BITMAP *bmp,
11418  int lx, int ty, int angle);
11419 
11430 MG_EXPORT void GUIAPI RotateBitmapVFlip (HDC hdc, const BITMAP *bmp,
11431  int lx, int ty, int angle);
11432 
11441 MG_EXPORT void GUIAPI RotateBitmapHFlip (HDC hdc, const BITMAP *bmp,
11442  int lx, int ty, int angle);
11443 
11452 MG_EXPORT void GUIAPI RotateScaledBitmap (HDC hdc, const BITMAP *bmp,
11453  int lx, int ty, int angle, int w, int h);
11454 
11466 MG_EXPORT void GUIAPI RotateScaledBitmapVFlip (HDC hdc, const BITMAP *bmp,
11467  int lx, int ty, int angle, int w, int h);
11468 
11480 MG_EXPORT void GUIAPI RotateScaledBitmapHFlip (HDC hdc, const BITMAP *bmp,
11481  int lx, int ty, int angle, int w, int h);
11482 
11494 MG_EXPORT void GUIAPI PivotBitmap(HDC hdc, const BITMAP *bmp,
11495  int lx, int ty, int cx, int cy, int angle);
11496 
11523 MG_EXPORT void GUIAPI PivotScaledBitmapFlip (HDC hdc, const BITMAP *bmp,
11524  fixed x, fixed y, fixed cx, fixed cy, int angle, fixed scale_x,
11525  fixed scale_y, BOOL h_flip, BOOL v_flip);
11526 
11527 #endif /*_MGHAVE_FIXED_MATH*/
11528 
11535 #ifdef _MGFONT_BMPF
11536 
11554 MG_EXPORT DEVFONT* GUIAPI CreateBMPDevFont (const char *bmpfont_name,
11555  const BITMAP* glyph_bmp, const char* start_mchar, int nr_glyphs,
11556  int glyph_width);
11557 
11573 MG_EXPORT BOOL GUIAPI AddGlyphsToBMPFont (DEVFONT* dev_font, BITMAP* glyph_bmp,
11574  const char* start_mchar, int nr_glyphs, int glyph_width);
11575 
11586 MG_EXPORT void GUIAPI DestroyBMPFont (DEVFONT* dev_font);
11587 
11588 #endif /* end of _MGFONT_BMPF */
11589 
11652 typedef Uint32 Achar32;
11653 typedef Uint32 Glyph32;
11654 
11658 #define INV_ACHAR_VALUE 0xFFFFFFFF
11659 
11663 #define INV_GLYPH_VALUE 0xFFFFFFFF
11664 
11678 MG_EXPORT Achar32 GUIAPI GetACharValue (LOGFONT* logfont, const char* mchar,
11679  int mchar_len, const char* pre_mchar, int pre_len);
11680 
11681 #ifdef _MGCHARSET_UNICODE
11682 
11700 MG_EXPORT int GUIAPI GetNextUChar(LOGFONT* logfont, const char* mchar,
11701  int mchar_len, Uchar32* uc);
11702 
11703 #endif /* _MGCHARSET_UNICODE */
11704 
11732 MG_EXPORT Uint32 GUIAPI GetACharType (LOGFONT* logfont, Achar32 chv);
11733 
11738 typedef enum {
11739  ACHAR_ISOLATED,
11740  ACHAR_FINAL,
11741  ACHAR_INITIAL,
11742  ACHAR_MEDIAL
11743 } ACHARSHAPETYPE;
11744 
11766 MG_EXPORT Achar32 GUIAPI GetShapedAChar (LOGFONT* logfont, const char* mchar,
11767  int mchar_len, ACHARSHAPETYPE shape_type);
11768 
11790 MG_EXPORT BOOL GUIAPI GetMirrorAChar (LOGFONT* logfont, Achar32 chv,
11791  Achar32* mirrored);
11792 
11813 MG_EXPORT BidiType GUIAPI GetACharBidiType (LOGFONT* log_font, Achar32 chv);
11814 
11819 typedef struct _ACHARMAPINFO {
11821  int byte_index;
11823  int char_len;
11825  BOOL is_rtol;
11826 } ACHARMAPINFO;
11827 
11852 MG_EXPORT int GUIAPI BIDIGetTextLogicalAChars (LOGFONT* log_font,
11853  const char* text, int text_len, Achar32** achars,
11854  ACHARMAPINFO** achars_map);
11855 
11881 MG_EXPORT void GUIAPI BIDIGetTextRangesLog2Vis (LOGFONT* log_font,
11882  const char* text, int text_len, int start_index, int end_index,
11883  int** ranges, int* nr_ranges);
11884 
11909 MG_EXPORT int GUIAPI BIDIGetTextVisualAChars (LOGFONT* log_font,
11910  const char* text, int text_len, Achar32** achars,
11911  ACHARMAPINFO** achars_map);
11912 
11946 MG_EXPORT BOOL GUIAPI BIDILogAChars2VisACharsEx (LOGFONT* log_font,
11947  Achar32* achars, int nr_achars, int pel,
11948  void* extra, CB_REVERSE_ARRAY cb_reverse_extra);
11949 
11976 MG_EXPORT Achar32* GUIAPI BIDILogAChars2VisAChars (LOGFONT* log_font,
11977  Achar32* achars, int nr_achars, ACHARMAPINFO* achars_map);
11978 
12007 MG_EXPORT void GUIAPI BIDIGetLogicalEmbedLevelsEx (LOGFONT* log_font,
12008  Achar32* achars, int nr_achars, int pel, Uint8** embedding_levels);
12009 
12010 static inline void BIDIGetLogicalEmbeddLevels (LOGFONT* log_font,
12011  Achar32* achars, int nr_achars, Uint8** embedding_levels)
12012 {
12013  BIDIGetLogicalEmbedLevelsEx (log_font, achars, nr_achars, -1,
12014  embedding_levels);
12015 }
12016 
12048 MG_EXPORT void GUIAPI BIDIGetVisualEmbedLevelsEx (LOGFONT* log_font,
12049  Achar32* achars, int nr_achars, int pel, Uint8** embedding_levels);
12050 
12051 static inline void BIDIGetVisualEmbeddLevels (LOGFONT* log_font,
12052  Achar32* achars, int nr_achars, Uint8** embedding_levels)
12053 {
12054  BIDIGetVisualEmbedLevelsEx (log_font, achars, nr_achars, -1,
12055  embedding_levels);
12056 }
12057 
12058 /*
12059  * \fn int GUIAPI DrawACharString (HDC hdc, int x, int y,
12060  * Achar32* achars, int nr_achars, int* adv_x, int* adv_y);
12061  *
12062  * \brief Draw an abstract character string.
12063  *
12064  * This function draws an abstract character string to the specific
12065  * postion of a DC. Note that this function will ignore all breaks
12066  * in the Achar32 string.
12067  *
12068  * \param hdc The device context.
12069  * \param x The output start x position.
12070  * \param y The output start y position.
12071  * \param achars The pointer to the glyph string.
12072  * \param nr_achars The number of achars which will be draw.
12073  * \param adv_x The pointer used to return the advance in x-coordinate of
12074  * the glyph string, can be NULL.
12075  * \param adv_y The pointer used to return the advance in y-coordinate of
12076  * the glyph string, can be NULL.
12077  *
12078  * \return The advance on baseline.
12079  */
12080 MG_EXPORT int GUIAPI DrawACharString (HDC hdc, int x, int y, Achar32* achars,
12081  int nr_achars, int* adv_x, int* adv_y);
12082 
12098 MG_EXPORT int GUIAPI GetACharsExtent (HDC hdc, Achar32* achars, int nr_achars,
12099  SIZE* size);
12100 
12119 MG_EXPORT int GUIAPI GetACharsExtentPoint (HDC hdc, Achar32* achars,
12120  int nr_achars, int max_extent, SIZE* size);
12121 
12135 MG_EXPORT Glyph32 GUIAPI GetGlyphValue (LOGFONT* logfont, const char* mchar,
12136  int mchar_len, const char* pre_mchar, int pre_len);
12137 
12148 MG_EXPORT Glyph32 GUIAPI GetGlyphValueAlt(LOGFONT* logfont, Achar32 chv);
12149 
12168 MG_EXPORT int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
12169  int* adv_x, int* adv_y);
12170 
12171 /*
12172  * \fn int GUIAPI DrawGlyphString (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12173  * const POINT* pts);
12174  *
12175  * \brief Draw a glyph string at specified positions.
12176  *
12177  * This function draws a glyph string to the specific postions of a DC.
12178  * Note that this function will ignore all special type (such as zero-width)
12179  * in the glyph string.
12180  *
12181  * \param hdc The device context.
12182  * \param glyphs The pointer to the glyph string.
12183  * \param nr_glyphs The number of glyphs which will be draw.
12184  * \param pts The positions of every glyphs.
12185  *
12186  * \return The number of glyphs drawn.
12187  *
12188  * \sa DrawGlyphStringEx
12189  */
12190 MG_EXPORT int GUIAPI DrawGlyphString (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12191  const POINT* pts);
12192 
12210 MG_EXPORT int GUIAPI GetGlyphsExtent (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12211  SIZE* size);
12212 
12231 MG_EXPORT int GUIAPI GetGlyphsExtentPoint (HDC hdc, Glyph32* glyphs,
12232  int nr_glyphs, int max_extent, SIZE* size);
12233 
12234 #define GLYPH_INFO_METRICS 0x01
12235 #define GLYPH_INFO_BMP 0x02
12236 
12238 #define GLYPHBMP_TYPE_MONO 0x00
12239 
12240 #define GLYPHBMP_TYPE_GREY 0x01
12241 
12242 #define GLYPHBMP_TYPE_GREY4b 0x02
12243 
12244 #define GLYPHBMP_TYPE_SUBPIXEL 0x03
12245 
12246 #define GLYPHBMP_TYPE_PRERENDER 0x04
12247 
12252 typedef struct _GLYPHINFO {
12259  Uint32 mask;
12260 
12262  int bbox_x, bbox_y, bbox_w, bbox_h;
12264  int advance_x, advance_y;
12265 
12273  int bmp_type;
12274 
12276  int bmp_width;
12278  int bmp_height;
12279  /* The pitch of the glyph bitmap. */
12280  int bmp_pitch;
12281 
12283  const unsigned char* bits;
12284 
12289  BITMAP prbitmap;
12290 } GLYPHINFO;
12291 
12309 MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
12310  GLYPHINFO* glyph_info);
12311 
12312 #ifdef _MGCHARSET_UNICODE
12313 
12331 #define WSR_NORMAL 0x00
12332 
12341 #define WSR_PRE 0x01
12342 
12349 #define WSR_NOWRAP 0x02
12350 
12357 #define WSR_PRE_WRAP 0x03
12358 
12373 #define WSR_BREAK_SPACES 0x04
12374 
12382 #define WSR_PRE_LINE 0x05
12383 
12423 MG_EXPORT int GUIAPI GetUCharsUntilParagraphBoundary(LOGFONT* logfont,
12424  const char* mstr, int mstr_len, Uint8 wsr,
12425  Uchar32** uchars, int* nr_uchars);
12426 
12443 MG_EXPORT Uchar32 GUIAPI AChar2UChar(LOGFONT* logfont, Achar32 chv);
12444 
12463 MG_EXPORT int GUIAPI AChars2UChars(LOGFONT* logfont, const Achar32* chs,
12464  Uchar32* ucs, int n);
12465 
12477 #define UCHAR2ACHAR(uc) ((uc) | 0x80000000)
12478 
12501 MG_EXPORT BOOL GUIAPI UChar2AChar(LOGFONT* logfont, Uchar32 uc, Achar32* ac);
12502 
12523 MG_EXPORT int GUIAPI UChars2AChars(LOGFONT* logfont, const Uchar32* ucs,
12524  Achar32* acs, int n);
12525 
12542 #define GRF_WRITING_MODE_MASK 0xF0000000
12543 #define GRF_WRITING_MODE_VERTICAL_FLAG 0x20000000
12544 
12548 #define GRF_WRITING_MODE_HORIZONTAL_TB 0x00000000
12549 
12554 #define GRF_WRITING_MODE_HORIZONTAL_BT 0x10000000
12555 
12560 #define GRF_WRITING_MODE_VERTICAL_RL 0x20000000
12561 
12566 #define GRF_WRITING_MODE_VERTICAL_LR 0x30000000
12567 
12568 #define GRF_TEXT_ORIENTATION_MASK 0x0F000000
12569 
12573 #define GRF_TEXT_ORIENTATION_UPRIGHT 0x00000000
12574 
12578 #define GRF_TEXT_ORIENTATION_SIDEWAYS 0x01000000
12579 
12583 #define GRF_TEXT_ORIENTATION_UPSIDE_DOWN 0x02000000
12584 
12588 #define GRF_TEXT_ORIENTATION_SIDEWAYS_LEFT 0x03000000
12589 
12593 #define GRF_TEXT_ORIENTATION_AUTO 0x04000000
12594 
12601 #define GRF_TEXT_ORIENTATION_MIXED 0x05000000
12602 
12603 #define GRF_TEXT_ORIENTATION_LINE 0x06000000
12604 
12605 #define GRF_LINE_EXTENT_MASK 0x00C00000
12606 
12611 #define GRF_LINE_EXTENT_FIXED 0x00000000
12612 
12617 #define GRF_LINE_EXTENT_VARIABLE 0x00400000
12618 
12619 #define GRF_INDENT_MASK 0x00300000
12620 
12623 #define GRF_INDENT_NONE 0x00000000
12624 
12627 #define GRF_INDENT_FIRST_LINE 0x00100000
12628 
12631 #define GRF_INDENT_HANGING 0x00200000
12632 
12633 #define GRF_OVERFLOW_WRAP_MASK 0x000C0000
12634 
12637 #define GRF_OVERFLOW_WRAP_NORMAL 0x00000000
12638 
12641 #define GRF_OVERFLOW_WRAP_BREAK_WORD 0x00040000
12642 
12647 #define GRF_OVERFLOW_WRAP_ANYWHERE 0x00080000
12648 
12649 #define GRF_OVERFLOW_ELLIPSIZE_MASK 0x00030000
12650 
12653 #define GRF_OVERFLOW_ELLIPSIZE_NONE 0x00000000
12654 
12657 #define GRF_OVERFLOW_ELLIPSIZE_START 0x00010000
12658 
12661 #define GRF_OVERFLOW_ELLIPSIZE_MIDDLE 0x00020000
12662 
12665 #define GRF_OVERFLOW_ELLIPSIZE_END 0x00030000
12666 
12667 #define GRF_ALIGN_MASK 0x0000F000
12668 
12671 #define GRF_ALIGN_START 0x00000000
12672 
12675 #define GRF_ALIGN_END 0x00001000
12676 
12680 #define GRF_ALIGN_LEFT 0x00002000
12681 
12685 #define GRF_ALIGN_RIGHT 0x00003000
12686 
12689 #define GRF_ALIGN_CENTER 0x00004000
12690 
12697 #define GRF_ALIGN_JUSTIFY 0x00005000
12698 
12699 #define GRF_TEXT_JUSTIFY_MASK 0x00000F00
12700 
12703 #define GRF_TEXT_JUSTIFY_NONE 0x00000000
12704 
12709 #define GRF_TEXT_JUSTIFY_AUTO 0x00000100
12710 
12713 #define GRF_TEXT_JUSTIFY_INTER_WORD 0x00000200
12714 
12718 #define GRF_TEXT_JUSTIFY_INTER_CHAR 0x00000300
12719 
12720 #define GRF_HANGING_PUNC_MASK 0x000000F0
12721 
12724 #define GRF_HANGING_PUNC_NONE 0x00000000
12725 
12728 #define GRF_HANGING_PUNC_FORCE_END 0x00000010
12729 
12733 #define GRF_HANGING_PUNC_ALLOW_END 0x00000020
12734 
12737 #define GRF_HANGING_PUNC_OPEN 0x00000040
12738 
12741 #define GRF_HANGING_PUNC_CLOSE 0x00000080
12742 
12743 #define GRF_SPACES_MASK 0x0000000F
12744 
12747 #define GRF_SPACES_KEEP 0x00000000
12748 
12751 #define GRF_SPACES_REMOVE_START 0x00000001
12752 
12755 #define GRF_SPACES_REMOVE_END 0x00000002
12756 
12759 #define GRF_SPACES_HANGE_END 0x00000004
12760 
12763 typedef enum {
12764  GLYPH_ORIENT_UPRIGHT = GLYPH_GRAVITY_SOUTH,
12765  GLYPH_ORIENT_SIDEWAYS = GLYPH_GRAVITY_EAST,
12766  GLYPH_ORIENT_UPSIDE_DOWN = GLYPH_GRAVITY_NORTH,
12767  GLYPH_ORIENT_SIDEWAYS_LEFT = GLYPH_GRAVITY_WEST,
12768 } GlyphOrient;
12769 
12770 typedef enum {
12771  GLYPH_HANGED_NONE = 0,
12772  GLYPH_HANGED_START,
12773  GLYPH_HANGED_END,
12774 } GlyphHanged;
12775 
12779 typedef struct _GLYPHEXTINFO {
12781  int bbox_x, bbox_y, bbox_w, bbox_h;
12783  int adv_x, adv_y;
12785  int extra_x, extra_y;
12808 } GLYPHEXTINFO;
12809 
12813 typedef struct _GLYPHPOS {
12817  int x;
12821  int y;
12825  int x_off;
12829  int y_off;
12833  int advance;
12868 } GLYPHPOS;
12869 
12950 MG_EXPORT int GUIAPI GetGlyphsExtentFromUChars(LOGFONT* logfont_upright,
12951  const Achar32* uchars, int nr_uchars, const BreakOppo* break_oppos,
12952  Uint32 render_flags, int x, int y,
12953  int letter_spacing, int word_spacing, int tab_size, int max_extent,
12954  SIZE* line_size, Glyph32* glyphs, GLYPHEXTINFO* glyph_ext_info,
12955  GLYPHPOS* glyph_pos, LOGFONT** logfont_sideways);
12956 
12957 /*
12958  * \fn int GUIAPI DrawGlyphStringEx (HDC hdc,
12959  * LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
12960  * const Glyph32* glyphs, const GLYPHPOS* glyph_pos, int nr_glyphs)
12961  * \brief Draw a glyph string at the specified positions and text orientations.
12962  *
12963  * This function draws a glyph string to the specific positions and
12964  * orientations on a DC \a hdc with the logfonts specified by
12965  * \a logfont_upright and \a logfont_sideways.
12966  *
12967  * \param hdc The device context.
12968  * \param logfont_upright The LOGFONT object used for upright glyphs.
12969  * \param logfont_sideways The LOGFONT object used for sideways glyphs.
12970  * \param glyphs The pointer to the glyph string
12971  * \param glyph_pos The buffer holds the position information
12972  * of every glyph.
12973  * \param nr_glyphs The number of the glyphs should be drawn.
12974  *
12975  * \return The number of glyphs really drawn.
12976  *
12977  * \note The positions contained in \a glyph_pos are always aligned to
12978  * the top-left corner of the output rectangle.
12979  *
12980  * \sa GetGlyphsExtentFromUChars
12981  *
12982  * Since 4.0.0
12983  */
12984 MG_EXPORT int GUIAPI DrawGlyphStringEx (HDC hdc,
12985  LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
12986  const Glyph32* glyphs, const GLYPHPOS* glyph_pos,
12987  int nr_glyphs);
12988 
12993 typedef struct _TEXTRUNS TEXTRUNS;
12994 
13035 MG_EXPORT TEXTRUNS* GUIAPI CreateTextRuns(
13036  const Uchar32* ucs, int nr_ucs,
13037  LanguageCode lang_code, ParagraphDir base_dir,
13038  const char* logfont_name, RGBCOLOR color, RGBCOLOR bg_color,
13039  BreakOppo* break_oppos);
13040 
13058 MG_EXPORT BOOL GUIAPI SetFontNameInTextRuns(TEXTRUNS* truns,
13059  int start_index, int length, const char* logfont_name);
13060 
13066 MG_EXPORT const char* GUIAPI GetFontNameInTextRuns(
13067  const TEXTRUNS* truns, int index);
13068 
13086 MG_EXPORT BOOL GUIAPI SetTextColorInTextRuns(TEXTRUNS* truns,
13087  int start_index, int length, RGBCOLOR color);
13088 
13094 MG_EXPORT RGBCOLOR GUIAPI GetTextColorInTextRuns(
13095  const TEXTRUNS* truns, int index);
13096 
13117 MG_EXPORT BOOL GUIAPI SetBackgroundColorInTextRuns(TEXTRUNS* truns,
13118  int start_index, int length, RGBCOLOR color);
13119 
13125 MG_EXPORT RGBCOLOR GUIAPI GetBackgroundColorInTextRuns(
13126  const TEXTRUNS* truns, int index);
13127 
13146 MG_EXPORT BOOL GUIAPI DestroyTextRuns(TEXTRUNS* truns);
13147 
13179 MG_EXPORT BOOL GUIAPI InitBasicShapingEngine(TEXTRUNS* truns);
13180 
13181 #ifdef _MGCOMPLEX_SCRIPTS
13182 
13216 MG_EXPORT BOOL GUIAPI InitComplexShapingEngine(TEXTRUNS* truns);
13217 
13218 #endif /* _MGCOMPLEX_SCRIPTS */
13219 
13224 typedef struct _LAYOUT LAYOUT;
13225 
13230 typedef struct _LAYOUTLINE LAYOUTLINE;
13231 
13266 MG_EXPORT LAYOUT* GUIAPI CreateLayout(
13267  const TEXTRUNS* truns, Uint32 render_flags,
13268  const BreakOppo* break_oppos, BOOL persist_lines,
13269  int max_line_extent, int indent,
13270  int letter_spacing, int word_spacing, int tab_size,
13271  int* tabs, int nr_tabs);
13272 
13287 MG_EXPORT BOOL GUIAPI DestroyLayout(LAYOUT* layout);
13288 
13289 /*
13290  * \var typedef struct _RENDERDATA RENDERDATA
13291  * \brief The extra rendering data of the shaped glyph.
13292  */
13293 typedef struct _RENDERDATA {
13297  const TEXTRUNS* truns;
13298 
13302  const LAYOUT* layout;
13303 
13307  const LAYOUTLINE* line;
13308 
13312  LOGFONT* logfont;
13313 
13317  Uint32 ta;
13318 
13322  Uchar32 uc;
13323 
13328  int uc_index;
13329 } RENDERDATA;
13330 
13349 typedef BOOL (*CB_GLYPH_LAID_OUT) (GHANDLE ctxt,
13350  Glyph32 glyph_value, const GLYPHPOS* glyph_pos,
13351  const RENDERDATA* render_data);
13352 
13395 MG_EXPORT LAYOUTLINE* GUIAPI LayoutNextLine(LAYOUT* layout,
13396  LAYOUTLINE* prev_line, int max_extent, BOOL last_line,
13397  CB_GLYPH_LAID_OUT cb_laid_out, GHANDLE ctxt);
13398 
13415 MG_EXPORT BOOL GUIAPI GetLayoutLineSize(const LAYOUTLINE* line,
13416  SIZE* line_size);
13417 
13449 MG_EXPORT BOOL GUIAPI GetLayoutLineRect(const LAYOUTLINE* line,
13450  int* x, int* y, int line_height, RECT* line_rc);
13451 
13487 MG_EXPORT int GUIAPI CalcLayoutBoundingRect(LAYOUT* layout,
13488  int max_line_extent, int max_height, int line_height,
13489  int x, int y, RECT* bounding);
13490 
13520 MG_EXPORT BOOL DrawShapedGlyph(HDC hdc,
13521  Glyph32 glyph_value, const GLYPHPOS* glyph_pos,
13522  const RENDERDATA* render_data);
13523 
13555 MG_EXPORT int DrawLayoutLine(HDC hdc, const LAYOUTLINE* line,
13556  int x, int y);
13557 
13558 #ifdef _MGDEVEL_MODE
13559 typedef struct _TextRun TEXTRUN;
13560 
13561 MG_EXPORT TEXTRUN* GetNextTextRunInfo(TEXTRUNS* runinfo,
13562  TEXTRUN* prev,
13563  const char** fontname, int* start_index, int* length,
13564  LanguageCode* lang_code, ScriptType* script,
13565  BidiLevel* embedding_level, Uint8* flags);
13566 
13567 /* Get layout line information */
13568 MG_EXPORT BOOL GUIAPI GetLayoutLineInfo(LAYOUTLINE* line,
13569  int* max_extent, int* nr_chars, int* nr_glyphs,
13570  int** log_widths, int* width, int* height,
13571  BOOL* is_ellipsized, BOOL* is_wrapped);
13572 #endif
13573 
13574 #endif /* _MGCHARSET_UNICODE */
13575 
13578 /*
13579  * \var typedef struct _COMP_CTXT COMP_CTXT
13580  * \brief The context information of user defined color composition operators.
13581  *
13582  * \sa SetUserCompositionOps
13583  */
13584 typedef struct _COMP_CTXT {
13586  gal_uint8* cur_dst;
13587 
13589  void* user_comp_ctxt;
13590 
13592  gal_pixel skip_pixel;
13593 
13595  gal_pixel cur_pixel;
13596 
13598  int step;
13599 } COMP_CTXT;
13600 
13601 /*
13602  * \var typedef struct _SPAN_CTXT SPAN_CTXT
13603  * \brief span context
13604  */
13605 typedef struct _SPAN_CTXT {
13606  GAL_PixelFormat* dst_format; /* The pixel format of the destination pixels */
13607  GAL_PixelFormat* src_format; /* The pixel format of the source pixels */
13608  void * user_context; /* The user context passed to SetColorCompositeFunc */
13609 } SPAN_CTXT;
13610 
13611 /*
13612  * \var typedef struct _COMPOSITE_CTXT COMPOSITE_CTXT
13613  * \brief composite context
13614  */
13615 typedef struct _COMPOSITE_CTXT {
13616  HDC dst_dc;
13617  int comp_mode;
13618  const int *far_bkmode;
13619  const int *far_step;
13620  const gal_pixel *far_skip_pixel;
13621 } COMPOSITE_CTXT;
13622 
13623 /*
13624  * \var typedef struct _RASTER_CTXT RASTER_CTXT
13625  * \brief raster context
13626  */
13627 typedef struct _RASTER_CTXT {
13628  HDC dst_dc;
13629 } RASTER_CTXT;
13630 
13631 /*
13632  * \var typedef void (*CB_COMP_SETPIXEL) (COMP_CTXT* comp_ctxt)
13633  * \brief The prototype of the user defined color composition setpixel.
13634  *
13635  * This operator sets a pixel on the \a cur_dst defined in \a comp_ctxt with
13636  * the cur_pixel defined in \a comp_ctxt.
13637  *
13638  * \sa SetUserCompositionOps, COMP_CTXT
13639  */
13640 typedef void (*CB_COMP_SETPIXEL) (COMP_CTXT* comp_ctxt);
13641 
13642 /*
13643  * \var typedef void (*CB_COMP_SETHLINE) (COMP_CTXT* comp_ctxt, int w)
13644  * \brief The prototype of the user defined color composition sethline.
13645  *
13646  * This operator sets a horizital line on the \a cur_dst defined in \a comp_ctxt
13647  * with the \a cur_pixel defined in \a comp_ctxt, totally \a w pixels.
13648  *
13649  * \sa SetUserCompositionOps, COMP_CTXT
13650  */
13651 typedef void (*CB_COMP_SETHLINE) (COMP_CTXT* comp_ctxt, int w);
13652 
13653 /*
13654  * \var typedef void (*CB_COMP_PUTHLINE) (COMP_CTXT* comp_ctxt, gal_uint8* src, int w)
13655  * \brief The prototype of the user defined color composition puthline.
13656  *
13657  * This operator puts the pixels in \a src to a horizital line on the \a cur_dst
13658  * defined in \a comp_ctxt, totally \a w pixels.
13659  *
13660  * \sa SetUserCompositionOps, COMP_CTXT
13661  */
13662 typedef void (*CB_COMP_PUTHLINE) (COMP_CTXT* comp_ctxt, gal_uint8* src, int bkmode, int w);
13663 
13685 MG_EXPORT int GUIAPI SetUserCompositionOps (HDC hdc,
13686  CB_COMP_SETPIXEL comp_setpixel,
13687  CB_COMP_SETHLINE comp_sethline,
13688  CB_COMP_PUTHLINE comp_puthline,
13689  void* user_comp_ctxt);
13690 
13701 MG_EXPORT GHANDLE GetVideoHandle (HDC hdc);
13702 
13703 #ifdef _MGGAL_DRM
13704 
13731 MG_EXPORT int drmGetDeviceFD (GHANDLE video);
13732 
13736 typedef struct _DrmSurfaceInfo {
13738  uint32_t handle;
13744  uint32_t name;
13747  uint32_t fb_id;
13748 
13750  uint32_t width;
13752  uint32_t height;
13754  uint32_t pitch;
13756  uint32_t drm_format;
13758  size_t size;
13760  off_t offset;
13761 } DrmSurfaceInfo;
13762 
13773 MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info);
13774 
13789 MG_EXPORT HDC drmCreateDCFromNameEx (GHANDLE video,
13790  uint32_t name, uint32_t drm_format, off_t offset,
13791  uint32_t width, uint32_t height, uint32_t pitch);
13792 
13793 static inline HDC drmCreateDCFromName (GHANDLE video,
13794  uint32_t name, uint32_t drm_format,
13795  uint32_t width, uint32_t height, uint32_t pitch)
13796 {
13797  return drmCreateDCFromNameEx (video,
13798  name, drm_format, 0, width, height, pitch);
13799 }
13800 
13816 MG_EXPORT HDC drmCreateDCFromPrimeFdEx (GHANDLE video,
13817  int prime_fd, size_t size, uint32_t drm_format, off_t offset,
13818  uint32_t width, uint32_t height, uint32_t pitch);
13819 
13820 static inline HDC drmCreateDCFromPrimeFd (GHANDLE video,
13821  int prime_fd, size_t size, uint32_t drm_format,
13822  uint32_t width, uint32_t height, uint32_t pitch)
13823 {
13824  return drmCreateDCFromPrimeFdEx (video,
13825  prime_fd, size, drm_format, 0, width, height, pitch);
13826 }
13827 
13843 MG_EXPORT HDC drmCreateDCFromHandleEx (GHANDLE video,
13844  uint32_t handle, size_t size, uint32_t drm_format, off_t offset,
13845  uint32_t width, uint32_t height, uint32_t pitch);
13846 
13847 static inline HDC drmCreateDCFromHandle (GHANDLE video,
13848  uint32_t handle, size_t size, uint32_t drm_format,
13849  uint32_t width, uint32_t height, uint32_t pitch)
13850 {
13851  return drmCreateDCFromHandleEx (video,
13852  handle, size, drm_format, 0, width, height, pitch);
13853 }
13854 
13857 #endif /* _MGGAL_DRM */
13858 
13861 #ifdef _MGGAL_HI3560
13862 
13863 //#include <hi_api.h>
13864 
13865 /* API speicific to Hi3560 GAL engines */
13866 MG_EXPORT int hi3560GetVideoFD (void);
13867 MG_EXPORT void* hi3560GetFBAddress (void);
13868 MG_EXPORT int hi3560SetScreenAttr (Uint8 siAttr, void* pValue);
13869 
13870 #endif /* _MGGAL_HI3560 */
13871 
13872 #ifdef __cplusplus
13873 }
13874 #endif /* __cplusplus */
13875 
13876 #endif /* _MGUI_GDI_H */
13877 
13878 
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:5321
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 BOOL GUIAPI IsMemDC(HDC hdc)
Check whether a given DC is a memory DC.
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:2959
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:12783
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:3668
int height
Definition: gdi.h:3845
unsigned char delimiter
Definition: gdi.h:7777
int x_off
Definition: gdi.h:12825
MG_EXPORT BOOL GUIAPI IsUCharTitle(Uchar32 uc)
Uint32 bmHeight
Definition: gdi.h:10464
DWORD32 style
Definition: gdi.h:5814
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:3978
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:5816
Definition: common.h:956
int extra_x
Definition: gdi.h:12785
int starty
Definition: gdi.h:10209
Definition: gdi.h:3975
int descent
Definition: gdi.h:5822
void(* CB_ONE_SCANLINE)(void *context, MYBITMAP *my_bmp, int y)
The type of scanline loaded callback.
Definition: gdi.h:10499
size_t size
Definition: gdi.h:13758
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:11140
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:339
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:887
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:878
char * type
Definition: gdi.h:5808
MG_EXPORT const char *GUIAPI CheckBitmapType(MG_RWops *fp)
Checks the type of the bitmap in a data source.
Uint32 bmPitch
Definition: gdi.h:10466
Uint16 BreakOppo
Definition: gdi.h:9386
ACHARSHAPETYPE
Achar32 shape type.
Definition: gdi.h:11738
MG_EXPORT int GUIAPI UCharCombiningClass(Uchar32 uc)
Uint8 whitespace
Definition: gdi.h:12795
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:456
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 HDC drmCreateDCFromNameEx(GHANDLE video, uint32_t name, uint32_t drm_format, off_t offset, uint32_t width, uint32_t height, uint32_t pitch)
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:3980
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:3793
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 GHANDLE GetVideoHandle(HDC hdc)
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.
uint32_t pitch
Definition: gdi.h:13754
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:5237
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:10396
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:4949
int y
Definition: gdi.h:12821
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:1011
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:10449
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:10457
MG_EXPORT BOOL GUIAPI IsUCharXDigit(Uchar32 uc)
DWORD flags
Definition: gdi.h:10382
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.
MG_EXPORT Uint32 GUIAPI GetGDCapability(HDC hdc, int iItem)
Returns a capability of a DC.
Uint8 whitespace
Definition: gdi.h:12841
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:6123
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:1951
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:7487
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:8103
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 BOOL GUIAPI IsScreenDC(HDC hdc)
Check whether a given DC is a screen DC.
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:740
uint32_t width
Definition: gdi.h:13750
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:10451
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:926
int frames
Definition: gdi.h:10384
int len
Definition: gdi.h:7775
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:3715
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:3985
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:6905
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:1096
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:5201
Uint8 ellipsis
Definition: gdi.h:12845
Uint32 bmAlphaPitch
Definition: gdi.h:10478
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:12867
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:5812
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.
uint32_t height
Definition: gdi.h:13752
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:6537
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:3991
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:10455
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:2940
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:850
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:10459
void(* CB_ARC)(void *context, int x, int y)
The type of arc generator callback.
Definition: gdi.h:3176
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:11177
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:13349
MG_EXPORT UVerticalOrient GUIAPI UCharGetVerticalOrientation(Uchar32 uc)
int ave_width
Definition: gdi.h:6948
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:3143
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:10386
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 BOOL GUIAPI IsWindowDC(HDC hdc)
Check whether a given DC is a window DC.
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:408
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:13230
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:12993
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:5818
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:13224
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:8098
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:10985
MG_EXPORT void GUIAPI DPtoLP(HDC hdc, POINT *pPt)
Converts device coordinates into logical coordinates.
off_t offset
Definition: gdi.h:13760
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:3107
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:12829
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:354
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:8090
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:3854
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:2922
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:1049
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:6943
Uint8 orientation
Definition: gdi.h:12857
GHANDLE HWND
Handle to main window or control.
Definition: common.h:403
static void SetRectEmpty(RECT *prc)
Empties a rectangle.
Definition: gdi.h:5220
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:3840
int width
Definition: gdi.h:3983
int line_adv
Definition: gdi.h:12787
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:3788
static LanguageCode GUIAPI LanguageCodeFromISO639s1Code(const char *iso639_1)
Get MiniGUI language code from an ISO639-1 language code string.
Definition: gdi.h:6859
Uint8 suppressed
Definition: gdi.h:12791
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.
MG_EXPORT BOOL drmGetSurfaceInfo(GHANDLE video, HDC hdc, DrmSurfaceInfo *info)
int x
Definition: gdi.h:12817
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:10398
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:1766
static ScriptType GUIAPI ScriptTypeFromISO15924Code(const char *iso15924)
Definition: gdi.h:9670
Uint8 * bmBits
Definition: gdi.h:10468
MG_EXPORT HDC drmCreateDCFromHandleEx(GHANDLE video, uint32_t handle, size_t size, uint32_t drm_format, off_t offset, uint32_t width, uint32_t height, uint32_t pitch)
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:979
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:5824
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:3076
#define MakeRGBA(r, g, b, a)
Makes a RGBA triple value from red r, green g, blue b and alpha components.
Definition: common.h:899
struct _FONTMETRICS FONTMETRICS
Uint8 suppressed
Definition: gdi.h:12837
BOOL(* CB_EQUAL_PIXEL)(void *context, int x, int y)
Flodd filling generator&#39;s equation callback.
Definition: gdi.h:3315
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.
uint32_t handle
Definition: gdi.h:13738
static void OffsetRect(RECT *prc, int x, int y)
Moves a rectangle by offsets.
Definition: gdi.h:5258
int ascent
Definition: gdi.h:5820
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:365
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:398
PenType
Definition: gdi.h:3597
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:3321
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:10394
#define GetRValue(rgba)
Gets the red component from a RGBA triple value rgba.
Definition: common.h:860
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:869
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:6978
int advance_x
Definition: gdi.h:6973
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:2827
Uint32 bmWidth
Definition: gdi.h:10462
Uint8 alpha
Definition: gdi.h:10388
int bbox_x
Definition: gdi.h:12781
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:413
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:2783
int bbox_x
Definition: gdi.h:6971
Uint32 transparent
Definition: gdi.h:10391
size_t bmp_size
Definition: gdi.h:6976
Definition: common.h:1002
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:3995
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 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:10453
int width
Definition: gdi.h:3843
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:3848
const MG_EXPORT RGB SysPixelColor[]
The pre-defined system RGB colors.
uint32_t fb_id
Definition: gdi.h:13747
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:5298
BYTE * bits
Definition: gdi.h:10403
MG_EXPORT void GUIAPI OffsetRegion(PCLIPRGN region, int x, int y)
Offsets the region.
Uint16 ParagraphDir
Definition: gdi.h:8119
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:748
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:6980
long fixed
Data type of fixed point.
Definition: common.h:1107
ScriptType
Definition: gdi.h:6341
Uint8 * bmAlphaMask
Definition: gdi.h:10475
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:12807
MG_EXPORT void GUIAPI ExcludeClipRect(HDC hdc, const RECT *prc)
Excludes the specified rectangle from the current visible region of a DC.
uint32_t drm_format
Definition: gdi.h:13756
int nr_chars
Definition: gdi.h:10205
size_t size
Definition: gdi.h:3851
MG_EXPORT HPALETTE GUIAPI GetDefaultPalette(void)
Gets the system default logical palette.
Uint8 BidiArabicProp
Definition: gdi.h:8107
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:600
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:5841
Uint32 size
Definition: gdi.h:10400
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:6036
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:10207
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:930
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:10415
MG_EXPORT BOOL GUIAPI UCharCompose(Uchar32 a, Uchar32 b, Uchar32 *ch)
Definition: gdi.h:6891
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:7644
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:10213
static BOOL GUIAPI SetPixelInBitmap(const BITMAP *bmp, int x, int y, gal_pixel pixel)
Sets pixel value in a BITMAP object.
Definition: gdi.h:5001
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:10211
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:6946
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:5810
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:12833
#define FALSE
FALSE value, defined as 0 by MiniGUI.
Definition: common.h:347
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:5806
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:3603
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:660
int font_height
Definition: gdi.h:6939
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:606
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 HDC drmCreateDCFromPrimeFdEx(GHANDLE video, int prime_fd, size_t size, uint32_t drm_format, off_t offset, uint32_t width, uint32_t height, uint32_t pitch)
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:934
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:1015
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:2874
int prime_fd
Definition: gdi.h:13741
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:7779
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:8094
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.
uint32_t name
Definition: gdi.h:13744
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).
struct _DrmSurfaceInfo DrmSurfaceInfo
const LOGFONT * CPLOGFONT
Data type of pointer to a LOGFONT.
Definition: gdi.h:5847
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:6941
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:1007
MG_EXPORT BOOL GUIAPI IsUCharDefined(Uchar32 uc)
Definition: gdi.h:3797
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:1514
BYTE a
Definition: common.h:1019
static void InflateRect(RECT *prc, int cx, int cy)
Increases or decreases the width and height of an rectangle.
Definition: gdi.h:5279
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:3208
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 int drmGetDeviceFD(GHANDLE video)
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:423
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.