MiniGUI API Reference (MiniGUI-Standalone)  v5.0.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
gdi.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
57 /*
58  * $Id: gdi.h 13674 2010-12-06 06:45:01Z wanzheng $
59  *
60  * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
61  * pSOS, ThreadX, NuCleus, OSE, and Win32.
62  */
63 
64 #ifndef _MGUI_GDI_H
65  #define _MGUI_GDI_H
66 
67 #include "common.h"
68 
69 #include <stdio.h>
70 #include <stddef.h>
71 #include <stdlib.h>
72 
73 #include "endianrw.h"
74 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif /* __cplusplus */
78 
134 extern MG_EXPORT gal_pixel SysPixelIndex [];
135 
142 extern const MG_EXPORT RGB SysPixelColor [];
143 
145 enum {
180 };
181 
187 #define PIXEL_invalid 0
188 
194 #define PIXEL_transparent SysPixelIndex[0]
195 
201 #define PIXEL_darkblue SysPixelIndex[1]
202 
208 #define PIXEL_darkgreen SysPixelIndex[2]
209 
215 #define PIXEL_darkcyan SysPixelIndex[3]
216 
222 #define PIXEL_darkred SysPixelIndex[4]
223 
229 #define PIXEL_darkmagenta SysPixelIndex[5]
230 
236 #define PIXEL_darkyellow SysPixelIndex[6]
237 
243 #define PIXEL_darkgray SysPixelIndex[7]
244 
250 #define PIXEL_lightgray SysPixelIndex[8]
251 
257 #define PIXEL_blue SysPixelIndex[9]
258 
264 #define PIXEL_green SysPixelIndex[10]
265 
271 #define PIXEL_cyan SysPixelIndex[11]
272 
278 #define PIXEL_red SysPixelIndex[12]
279 
285 #define PIXEL_magenta SysPixelIndex[13]
286 
292 #define PIXEL_yellow SysPixelIndex[14]
293 
299 #define PIXEL_lightwhite SysPixelIndex[15]
300 
306 #define PIXEL_black SysPixelIndex[16]
307 
312 #define COLOR_invalid PIXEL_invalid
313 
318 #define COLOR_transparent PIXEL_transparent
319 
324 #define COLOR_darkred PIXEL_darkred
325 
330 #define COLOR_darkgreen PIXEL_darkgreen
331 
336 #define COLOR_darkyellow PIXEL_darkyellow
337 
342 #define COLOR_darkblue PIXEL_darkblue
343 
348 #define COLOR_darkmagenta PIXEL_darkmagenta
349 
354 #define COLOR_darkcyan PIXEL_darkcyan
355 
360 #define COLOR_lightgray PIXEL_lightgray
361 
366 #define COLOR_darkgray PIXEL_darkgray
367 
372 #define COLOR_red PIXEL_red
373 
378 #define COLOR_green PIXEL_green
379 
384 #define COLOR_yellow PIXEL_yellow
385 
390 #define COLOR_blue PIXEL_blue
391 
396 #define COLOR_magenta PIXEL_magenta
397 
402 #define COLOR_cyan PIXEL_cyan
403 
408 #define COLOR_lightwhite PIXEL_lightwhite
409 
414 #define COLOR_black PIXEL_black
415 
420 #define RGBA_transparent \
421  (MakeRGBA(SysPixelColor[0].r, SysPixelColor[0].g, \
422  SysPixelColor[0].b, SysPixelColor[0].a))
423 
428 #define RGBA_darkblue \
429  (MakeRGBA(SysPixelColor[1].r, SysPixelColor[1].g, \
430  SysPixelColor[1].b, SysPixelColor[1].a))
431 
436 #define RGBA_darkgreen \
437  (MakeRGBA(SysPixelColor[2].r, SysPixelColor[2].g, \
438  SysPixelColor[2].b, SysPixelColor[2].a))
439 
444 #define RGBA_darkcyan \
445  (MakeRGBA(SysPixelColor[3].r, SysPixelColor[3].g, \
446  SysPixelColor[3].b, SysPixelColor[3].a))
447 
452 #define RGBA_darkred \
453  (MakeRGBA(SysPixelColor[4].r, SysPixelColor[4].g, \
454  SysPixelColor[4].b, SysPixelColor[4].a))
455 
460 #define RGBA_darkmagenta \
461  (MakeRGBA(SysPixelColor[5].r, SysPixelColor[5].g, \
462  SysPixelColor[5].b, SysPixelColor[5].a))
463 
468 #define RGBA_darkyellow \
469  (MakeRGBA(SysPixelColor[6].r, SysPixelColor[6].g, \
470  SysPixelColor[6].b, SysPixelColor[6].a))
471 
476 #define RGBA_darkgray \
477  (MakeRGBA(SysPixelColor[7].r, SysPixelColor[7].g, \
478  SysPixelColor[7].b, SysPixelColor[7].a))
479 
484 #define RGBA_lightgray \
485  (MakeRGBA(SysPixelColor[8].r, SysPixelColor[8].g, \
486  SysPixelColor[8].b, SysPixelColor[8].a))
487 
492 #define RGBA_blue \
493  (MakeRGBA(SysPixelColor[9].r, SysPixelColor[9].g, \
494  SysPixelColor[9].b, SysPixelColor[9].a))
495 
500 #define RGBA_green \
501  (MakeRGBA(SysPixelColor[10].r, SysPixelColor[10].g, \
502  SysPixelColor[10].b, SysPixelColor[10].a))
503 
508 #define RGBA_cyan \
509  (MakeRGBA(SysPixelColor[11].r, SysPixelColor[11].g, \
510  SysPixelColor[11].b, SysPixelColor[11].a))
511 
516 #define RGBA_red \
517  (MakeRGBA(SysPixelColor[12].r, SysPixelColor[12].g, \
518  SysPixelColor[12].b, SysPixelColor[12].a))
519 
524 #define RGBA_magenta \
525  (MakeRGBA(SysPixelColor[13].r, SysPixelColor[13].g, \
526  SysPixelColor[13].b, SysPixelColor[13].a))
527 
532 #define RGBA_yellow \
533  (MakeRGBA(SysPixelColor[14].r, SysPixelColor[14].g, \
534  SysPixelColor[14].b, SysPixelColor[14].a))
535 
540 #define RGBA_lightwhite \
541  (MakeRGBA(SysPixelColor[15].r, SysPixelColor[15].g, \
542  SysPixelColor[15].b, SysPixelColor[15].a))
543 
548 #define RGBA_black \
549  (MakeRGBA(SysPixelColor[16].r, SysPixelColor[16].g, \
550  SysPixelColor[16].b, SysPixelColor[16].a))
551 
556 #define SysColorIndex SysPixelColor
557 
589 typedef struct _BLOCKHEAP
590 {
591 #ifdef _MGRM_THREADS
592  pthread_mutex_t lock;
593 #endif
594 
597  size_t bd_size;
601  size_t heap_size;
605  int free;
609  void* heap;
610 } BLOCKHEAP;
611 
619 
642 MG_EXPORT extern void InitBlockDataHeap (PBLOCKHEAP heap,
643  size_t bd_size, size_t heap_size);
644 
660 MG_EXPORT extern void* BlockDataAlloc (PBLOCKHEAP heap);
661 
675 MG_EXPORT extern void BlockDataFree (PBLOCKHEAP heap, void* data);
676 
685 MG_EXPORT extern void DestroyBlockDataHeap (PBLOCKHEAP heap);
686 
696 struct _BITMAP;
697 
702 typedef struct _BITMAP BITMAP;
703 
709 typedef BITMAP* PBITMAP;
710 
711 struct _MYBITMAP;
712 
717 typedef struct _MYBITMAP MYBITMAP;
718 
724 typedef struct _MYBITMAP* PMYBITMAP;
725 
726 
763 typedef struct _CLIPRECT
764 {
772  struct _CLIPRECT* next;
776  struct _CLIPRECT* prev;
777 } CLIPRECT;
778 typedef CLIPRECT* PCLIPRECT;
779 
780 /* Clipping Region */
781 #define NULLREGION 0x00
782 #define SIMPLEREGION 0x01
783 #define COMPLEXREGION 0x02
784 
788 typedef struct _CLIPRGN
789 {
803  BYTE reserved[3];
811  PCLIPRECT head;
815  PCLIPRECT tail;
820  PBLOCKHEAP heap;
821 } CLIPRGN;
822 
829 typedef CLIPRGN* PCLIPRGN;
830 
844 #define InitFreeClipRectList(heap, size) \
845  InitBlockDataHeap (heap, sizeof (CLIPRECT), size)
846 
857 #define ClipRectAlloc(heap) BlockDataAlloc (heap)
858 
871 #define FreeClipRect(heap, cr) BlockDataFree (heap, cr);
872 
884 #define DestroyFreeClipRectList(heap) DestroyBlockDataHeap (heap);
885 
906 MG_EXPORT void GUIAPI InitClipRgn (PCLIPRGN pRgn, PBLOCKHEAP pFreeList);
907 
918 MG_EXPORT void GUIAPI EmptyClipRgn (PCLIPRGN pRgn);
919 
929 MG_EXPORT PCLIPRGN GUIAPI CreateClipRgn (void);
930 
941 MG_EXPORT void GUIAPI DestroyClipRgn (PCLIPRGN pRgn);
942 
959 MG_EXPORT BOOL GUIAPI ClipRgnCopy (PCLIPRGN pDstRgn, const CLIPRGN* pSrcRgn);
960 
981 MG_EXPORT BOOL GUIAPI ClipRgnIntersect (PCLIPRGN pRstRgn,
982  const CLIPRGN* pRgn1, const CLIPRGN* pRgn2);
983 
996 MG_EXPORT void GUIAPI GetClipRgnBoundRect (PCLIPRGN pRgn, PRECT pRect);
997 
1014 MG_EXPORT BOOL GUIAPI SetClipRgn (PCLIPRGN pRgn, const RECT* pRect);
1015 
1029 MG_EXPORT BOOL GUIAPI IsEmptyClipRgn (const CLIPRGN* pRgn);
1030 
1044 MG_EXPORT BOOL GUIAPI AddClipRect (PCLIPRGN pRgn, const RECT* pRect);
1045 
1060 MG_EXPORT BOOL GUIAPI IntersectClipRect (PCLIPRGN pRgn, const RECT* pRect);
1061 
1076 MG_EXPORT BOOL GUIAPI SubtractClipRect (PCLIPRGN pRgn, const RECT* pRect);
1077 
1093 MG_EXPORT BOOL GUIAPI PtInRegion (const PCLIPRGN region, int x, int y);
1094 
1109 MG_EXPORT BOOL GUIAPI RectInRegion (const PCLIPRGN region, const RECT* rect);
1110 
1125 static inline
1126 BOOL GUIAPI AreRegionsIntersected (const PCLIPRGN s1, const PCLIPRGN s2)
1127 {
1128  PCLIPRECT crc = s1->head;
1129  while (crc) {
1130  if (RectInRegion (s2, &crc->rc))
1131  return TRUE;
1132  crc = crc->next;
1133  }
1134 
1135  return FALSE;
1136 }
1137 
1153 MG_EXPORT void GUIAPI OffsetRegionEx (PCLIPRGN region, const RECT *rcClient,
1154  const RECT *rcScroll, int x, int y);
1155 
1167 MG_EXPORT void GUIAPI OffsetRegion (PCLIPRGN region, int x, int y);
1168 
1185 MG_EXPORT BOOL GUIAPI UnionRegion (PCLIPRGN dst,
1186  const CLIPRGN* src1, const CLIPRGN* src2);
1187 
1203 MG_EXPORT BOOL GUIAPI SubtractRegion (CLIPRGN* rgnD,
1204  const CLIPRGN* rgnM, const CLIPRGN* rgnS);
1205 
1222 MG_EXPORT BOOL GUIAPI XorRegion (CLIPRGN *dst,
1223  const CLIPRGN *src1, const CLIPRGN *src2);
1224 
1230 #define UnionRectWithRegion AddClipRect
1231 
1237 #define CopyRegion ClipRgnCopy
1238 
1244 #define IntersectRegion ClipRgnIntersect
1245 
1259 MG_EXPORT BOOL GUIAPI InitCircleRegion (PCLIPRGN dst, int x, int y, int r);
1260 
1275 MG_EXPORT BOOL GUIAPI InitEllipseRegion (PCLIPRGN dst,
1276  int x, int y, int rx, int ry);
1277 
1290 MG_EXPORT BOOL GUIAPI InitPolygonRegion (PCLIPRGN dst,
1291  const POINT* pts, int vertices);
1292 
1366 #define HDC_SCREEN ((HDC)0)
1367 
1368 /*
1369  * \def HDC_SCREEN_SYS
1370  * \brief This is a system screen DC created for internal use.
1371  *
1372  * Under compositing schema, this DC stands for the surface of the
1373  * real screen. The compositor running in the server will
1374  * use this DC to compositing the surfaces created and rendered by
1375  * the server and the clients to the screen. For clients, this DC
1376  * essentially is HDC_SCREEN.
1377  *
1378  * Under MiniGUI-Standalone runmode, MiniGUI-Threads
1379  * runmode, and MiniGUI-Processes runmode with shared frame buffer schema,
1380  * MiniGUI uses it to draw popup menus and other global objects.
1381  *
1382  * \sa HDC_SCREEN
1383  */
1384 #define HDC_SCREEN_SYS ((HDC)1)
1385 
1390 #define HDC_INVALID ((HDC)-1)
1391 
1392 #define GDCAP_COLORNUM 0
1393 #define GDCAP_HPIXEL 1
1394 #define GDCAP_VPIXEL 2
1395 #define GDCAP_MAXX 3
1396 #define GDCAP_MAXY 4
1397 #define GDCAP_DEPTH 5
1398 #define GDCAP_BPP 6
1399 #define GDCAP_BITSPP 7
1400 #define GDCAP_RMASK 8
1401 #define GDCAP_GMASK 9
1402 #define GDCAP_BMASK 10
1403 #define GDCAP_AMASK 11
1404 #define GDCAP_PITCH 12
1405 #define GDCAP_DPI 13
1406  #define GDCAP_DPI_DEFAULT 96
1407  #define GDCAP_DPI_MINIMAL 36
1408 
1456 MG_EXPORT Uint32 GUIAPI GetGDCapability (HDC hdc, int iItem);
1457 
1479 MG_EXPORT HDC GUIAPI GetDCEx (HWND hWnd, BOOL bClient);
1480 
1498 static inline HDC GUIAPI GetDC (HWND hWnd)
1499 {
1500  return GetDCEx (hWnd, FALSE);
1501 }
1502 
1520 static inline HDC GUIAPI GetClientDC (HWND hWnd)
1521 {
1522  return GetDCEx (hWnd, TRUE);
1523 }
1524 
1549 MG_EXPORT HDC GUIAPI GetSubDC (HDC hdc, int off_x, int off_y, int width, int height);
1550 
1561 MG_EXPORT void GUIAPI ReleaseDC (HDC hdc);
1562 
1576 MG_EXPORT HWND GUIAPI WindowFromDC (HDC hdc);
1577 
1598 MG_EXPORT int GUIAPI SaveDC (HDC hdc);
1599 
1625 MG_EXPORT BOOL GUIAPI RestoreDC (HDC hdc, int saved_dc);
1626 
1627 #define MEMDC_FLAG_NONE 0x00000000 /* None. */
1628 #define MEMDC_FLAG_SWSURFACE 0x00000000 /* DC is in system memory */
1629 #define MEMDC_FLAG_HWSURFACE 0x00000001 /* DC is in video memory */
1630 #define MEMDC_FLAG_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
1631 #define MEMDC_FLAG_SRCALPHA 0x00010000 /* Blit uses source alpha blending*/
1632 #define MEMDC_FLAG_SRCPIXELALPHA 0x00020000 /* Blit uses source per-pixel alpha blending*/
1633 #define MEMDC_FLAG_RLEACCEL 0x00004000 /* Surface is RLE encoded */
1634 
1655 MG_EXPORT HDC GUIAPI CreateCompatibleDCEx (HDC hdc, int width, int height);
1656 
1671 MG_EXPORT BOOL GUIAPI IsCompatibleDC (HDC hdc1, HDC hdc2);
1672 
1685 MG_EXPORT BOOL GUIAPI IsMemDC (HDC hdc);
1686 
1699 MG_EXPORT BOOL GUIAPI IsScreenDC (HDC hdc);
1700 
1713 MG_EXPORT BOOL GUIAPI IsWindowDC (HDC hdc);
1714 
1758 MG_EXPORT HDC GUIAPI CreateMemDCEx (int width, int height, int depth, DWORD flags,
1759  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask,
1760  void* bits, int pitch);
1761 
1795 static inline HDC GUIAPI CreateMemDC (int width, int height, int depth, DWORD flags,
1796  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
1797 {
1798  return CreateMemDCEx (width, height, depth, flags, Rmask, Gmask, Bmask, Amask,
1799  NULL, 0);
1800 }
1801 
1826 MG_EXPORT HDC GUIAPI CreateSubMemDC (HDC parent, int off_x, int off_y,
1827  int width, int height, BOOL comp_to_parent);
1828 
1844 MG_EXPORT HDC GUIAPI CreateMemDCFromBitmap (HDC hdc, const BITMAP* bmp);
1845 
1871 MG_EXPORT HDC GUIAPI CreateMemDCFromMyBitmap (const MYBITMAP* my_bmp, const RGB* pal);
1872 
1896 MG_EXPORT BOOL GUIAPI ConvertMemDC (HDC mem_dc, HDC ref_dc, DWORD flags);
1897 
1927 MG_EXPORT BOOL GUIAPI SetMemDCAlpha (HDC mem_dc, DWORD flags, Uint8 alpha);
1928 
1948 MG_EXPORT BOOL GUIAPI SetMemDCColorKey (HDC mem_dc, DWORD flags,
1949  Uint32 color_key);
1950 
1963 MG_EXPORT void GUIAPI DeleteMemDC (HDC mem_dc);
1964 
1977 #define CreateCompatibleDC(hdc) CreateCompatibleDCEx(hdc, 0, 0)
1978 
1989 #define DeleteCompatibleDC(hdc) DeleteMemDC(hdc)
1990 
2028 MG_EXPORT Uint8* GUIAPI LockDC (HDC hdc, const RECT* rw_rc,
2029  int* width, int* height, int* pitch);
2030 
2047 typedef void (* CB_DIRECT_DRAW_RECT) (HDC hdc, Uint8 * pixels,
2048  int pitch, int bytesPerPixel, const RECT* rc, void* context);
2049 
2076 MG_EXPORT BOOL GUIAPI LockDCEx (HDC hdc, const PCLIPRGN region,
2077  void* context, CB_DIRECT_DRAW_RECT cb);
2078 
2087 MG_EXPORT void GUIAPI UnlockDC (HDC hdc);
2088 
2111 MG_EXPORT HDC GUIAPI CreatePrivateDC (HWND hwnd);
2112 
2136 MG_EXPORT HDC GUIAPI CreatePrivateClientDC (HWND hwnd);
2137 
2164 HDC GUIAPI CreatePrivateSubDC(HDC hdc, int off_x, int off_y,
2165  int width, int height);
2166 
2188 MG_EXPORT HDC GUIAPI GetPrivateClientDC (HWND hwnd);
2189 
2199 MG_EXPORT void GUIAPI DeletePrivateDC (HDC hdc);
2200 
2226 MG_EXPORT HDC GUIAPI CreateSecondaryDC (HWND hwnd);
2227 
2243 typedef int (* ON_UPDATE_SECONDARYDC)(HWND hwnd, HDC secondary_dc,
2244  HDC real_dc, const RECT* secondary_rc, const RECT* real_rc,
2245  const RECT* main_update_rc);
2246 
2247 #define ON_UPDSECDC_DEFAULT ((ON_UPDATE_SECONDARYDC)0)
2248 #define ON_UPDSECDC_DONOTHING ((ON_UPDATE_SECONDARYDC)-1)
2249 
2275 MG_EXPORT HDC GUIAPI SetSecondaryDC (HWND hwnd, HDC secondary_dc,
2276  ON_UPDATE_SECONDARYDC on_update_secondarydc);
2277 
2296 MG_EXPORT HDC GUIAPI GetSecondaryDC (HWND hwnd);
2297 
2319 MG_EXPORT HDC GUIAPI GetDCInSecondarySurface (HWND hWnd, BOOL bClient);
2320 
2340 static inline HDC GUIAPI GetSecondaryClientDC (HWND hwnd)
2341 {
2342  return GetDCInSecondarySurface (hwnd, TRUE);
2343 }
2344 
2356 static inline void GUIAPI ReleaseSecondaryDC (HWND hwnd, HDC hdc)
2357 {
2358  ReleaseDC (hdc);
2359 }
2360 
2369 MG_EXPORT void GUIAPI DeleteSecondaryDC (HWND hwnd);
2370 
2394 MG_EXPORT HDC GUIAPI GetEffectiveCDC (HWND hwnd);
2395 
2410 MG_EXPORT BOOL GUIAPI SyncUpdateDC (HDC hdc);
2411 
2425 MG_EXPORT BOOL GUIAPI SyncUpdateSurface (HWND hwnd);
2426 
2434 #define BM_TRANSPARENT 1
2435 #define BM_OPAQUE 0
2436 
2437 #define DC_ATTR_BK_COLOR 0
2438 #define DC_ATTR_PEN_COLOR 1
2439 #define DC_ATTR_BRUSH_COLOR 2
2440 #define DC_ATTR_TEXT_COLOR 3
2441 
2442 #define DC_ATTR_BK_MODE 4
2443 
2444 #define DC_ATTR_TAB_STOP 5
2445 #define DC_ATTR_CHAR_EXTRA 6
2446 #define DC_ATTR_WORD_EXTRA 7
2447 #define DC_ATTR_ALINE_EXTRA 8
2448 #define DC_ATTR_BLINE_EXTRA 9
2449 
2450 #define DC_ATTR_MAP_MODE 10
2451 
2452 #define DC_ATTR_TEXT_ALIGN 11
2453 
2454 #define DC_ATTR_BIDI_FLAGS 12
2455 
2456 #ifdef _MGHAVE_ADV_2DAPI
2457 # define DC_ATTR_PEN_TYPE 13
2458 # define DC_ATTR_PEN_CAP_STYLE 14
2459 # define DC_ATTR_PEN_JOIN_STYLE 15
2460 # define DC_ATTR_PEN_WIDTH 16
2461 # define DC_ATTR_BRUSH_TYPE 17
2462 # define NR_DC_ATTRS 18
2463 #else /* _MGHAVE_ADV_2DAPI */
2464 # define NR_DC_ATTRS 13
2465 #endif /* !_MGHAVE_ADV_2DAPI */
2466 
2467 
2515 MG_EXPORT Uint32 GUIAPI GetDCAttr (HDC hdc, int attr);
2516 
2530 MG_EXPORT Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value);
2531 
2541 #define GetBkColor(hdc) GetDCAttr (hdc, DC_ATTR_BK_COLOR)
2542 
2558 #define GetBkMode(hdc) GetDCAttr (hdc, DC_ATTR_BK_MODE)
2559 
2569 #define GetPenColor(hdc) GetDCAttr (hdc, DC_ATTR_PEN_COLOR)
2570 
2580 #define GetBrushColor(hdc) GetDCAttr (hdc, DC_ATTR_BRUSH_COLOR)
2581 
2591 #define GetTextColor(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_COLOR)
2592 
2602 #define GetTabStop(hdc) GetDCAttr (hdc, DC_ATTR_TAB_STOP)
2603 
2614 #define SetBkColor(hdc, color) \
2615  SetDCAttr (hdc, DC_ATTR_BK_COLOR, (DWORD) color)
2616 
2634 #define SetBkMode(hdc, mode) \
2635  SetDCAttr (hdc, DC_ATTR_BK_MODE, (DWORD) mode)
2636 
2647 #define SetPenColor(hdc, color) \
2648  SetDCAttr (hdc, DC_ATTR_PEN_COLOR, (DWORD) color)
2649 
2660 #define SetBrushColor(hdc, color) \
2661  SetDCAttr (hdc, DC_ATTR_BRUSH_COLOR, (DWORD) color)
2662 
2673 #define SetTextColor(hdc, color) \
2674  SetDCAttr (hdc, DC_ATTR_TEXT_COLOR, (DWORD) color)
2675 
2686 #define SetTabStop(hdc, value) \
2687  SetDCAttr (hdc, DC_ATTR_TAB_STOP, (DWORD) value)
2688 
2689 #define ROP_SET 0
2690 #define ROP_AND 1
2691 #define ROP_OR 2
2692 #define ROP_XOR 3
2693 #define ROP_COMPOSITE 4
2694 #define ROP_COMP_USER 0x0100
2695 /* Reserved for future
2696  * #define ROP_COMP_XXX 0x01XX
2697  */
2698 
2723 MG_EXPORT int GUIAPI GetRasterOperation (HDC hdc);
2724 
2752 MG_EXPORT int GUIAPI SetRasterOperation (HDC hdc, int rop);
2753 
2776 MG_EXPORT int GUIAPI GetPalette (HDC hdc, int start, int len, GAL_Color* cmap);
2777 
2792 MG_EXPORT BOOL GUIAPI SetPalette (HDC hdc, int start, int len, GAL_Color* cmap);
2793 
2805 MG_EXPORT BOOL GUIAPI SetColorfulPalette (HDC hdc);
2806 
2820 MG_EXPORT HPALETTE GUIAPI CreatePalette (GAL_Palette* pal);
2821 
2837 MG_EXPORT BOOL GUIAPI SelectPalette (HDC hdc, HPALETTE hpal, BOOL reserved);
2838 
2859 MG_EXPORT BOOL GUIAPI RealizePalette (HDC hdc);
2860 
2874 MG_EXPORT BOOL GUIAPI ResizePalette (HPALETTE hpal, int len);
2875 
2886 MG_EXPORT void GUIAPI DestroyPalette (HPALETTE hpal);
2887 
2896 MG_EXPORT HPALETTE GUIAPI GetDefaultPalette (void);
2897 
2914 MG_EXPORT int GUIAPI GetPaletteEntries (HPALETTE hpal,
2915  int start, int len, GAL_Color* cmap);
2916 
2933 MG_EXPORT int GUIAPI SetPaletteEntries (HPALETTE hpal,
2934  int start, int len, GAL_Color* cmap);
2935 
2954 MG_EXPORT UINT GUIAPI GetNearestPaletteIndex (HPALETTE hpal,
2955  Uint8 red, Uint8 green, Uint8 blue);
2956 
2974 MG_EXPORT RGBCOLOR GUIAPI GetNearestColor (HDC hdc,
2975  Uint8 red, Uint8 green, Uint8 blue);
2976 
3000 MG_EXPORT void GUIAPI SetPixel (HDC hdc, int x, int y, gal_pixel pixel);
3001 
3020 MG_EXPORT gal_pixel GUIAPI SetPixelRGB (HDC hdc, int x, int y,
3021  Uint8 r, Uint8 g, Uint8 b);
3022 
3043 MG_EXPORT gal_pixel GUIAPI SetPixelRGBA (HDC hdc, int x, int y,
3044  Uint8 r, Uint8 g, Uint8 b, Uint8 a);
3045 
3061 MG_EXPORT gal_pixel GUIAPI GetPixel (HDC hdc, int x, int y);
3062 
3084 MG_EXPORT gal_pixel GUIAPI GetPixelRGB (HDC hdc, int x, int y,
3085  Uint8* r, Uint8* g, Uint8* b);
3086 
3112 MG_EXPORT gal_pixel GUIAPI GetPixelRGBA (HDC hdc, int x, int y,
3113  Uint8* r, Uint8* g, Uint8* b, Uint8* a);
3114 
3129 MG_EXPORT void GUIAPI RGBA2Pixels (HDC hdc, const RGB* rgbs,
3130  gal_pixel* pixels, int count);
3131 
3150 static inline gal_pixel RGBA2Pixel (HDC hdc,
3151  Uint8 r, Uint8 g, Uint8 b, Uint8 a)
3152 {
3153  RGB rgb = {r, g, b, a};
3154  gal_pixel pixel;
3155 
3156  RGBA2Pixels (hdc, &rgb, &pixel, 1);
3157  return pixel;
3158 }
3159 
3174 MG_EXPORT void GUIAPI RGB2Pixels (HDC hdc, const RGB* rgbs,
3175  gal_pixel* pixels, int count);
3176 
3194 static inline gal_pixel RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b)
3195 {
3196  RGB rgb = {r, g, b, 0xFF};
3197  gal_pixel pixel;
3198 
3199  RGB2Pixels (hdc, &rgb, &pixel, 1);
3200  return pixel;
3201 }
3202 
3217 MG_EXPORT void GUIAPI Pixel2RGBs (HDC hdc, const gal_pixel* pixels,
3218  RGB* rgbs, int count);
3219 
3241 static inline void Pixel2RGB (HDC hdc, gal_pixel pixel,
3242  Uint8* r, Uint8* g, Uint8* b)
3243 {
3244  RGB rgb;
3245  Pixel2RGBs (hdc, &pixel, &rgb, 1);
3246  *r = rgb.r; *g = rgb.g, *b = rgb.b;
3247 }
3248 
3263 MG_EXPORT void GUIAPI Pixel2RGBAs (HDC hdc, const gal_pixel* pixels,
3264  RGB* rgbs, int count);
3265 
3289 static inline void Pixel2RGBA (HDC hdc, gal_pixel pixel,
3290  Uint8* r, Uint8* g, Uint8* b, Uint8* a)
3291 {
3292  RGB rgb;
3293  Pixel2RGBAs (hdc, &pixel, &rgb, 1);
3294  *r = rgb.r; *g = rgb.g, *b = rgb.b; *a = rgb.a;
3295 }
3296 
3307 static inline DWORD Pixel2DWORD (HDC hdc, gal_pixel pixel)
3308 {
3309  Uint8 r,g,b,a;
3310  Pixel2RGBA (hdc, pixel, &r, &g, &b, &a);
3311  return MakeRGBA (r, g, b, a);
3312 }
3313 
3314 #define PIXEL2DWORD(hdc, pixel) Pixel2DWORD(hdc, pixel)
3315 
3326 static inline gal_pixel DWORD2Pixel (HDC hdc, DWORD dword)
3327 {
3328  return RGBA2Pixel (hdc,
3329  GetRValue(dword), GetGValue(dword),
3330  GetBValue(dword), GetAValue(dword));
3331 }
3332 
3350 MG_EXPORT void GUIAPI FocusRect (HDC hdc, int x0, int y0, int x1, int y1);
3351 
3369 MG_EXPORT void GUIAPI DrawHVDotLine (HDC hdc, int x, int y, int w_h, BOOL H_V);
3370 
3387 #define DrawHDotLine(hdc, x, y, w) DrawHVDotLine (hdc, x, y, w, TRUE);
3388 
3405 #define DrawVDotLine(hdc, x, y, h) DrawHVDotLine (hdc, x, y, h, FALSE);
3406 
3436 MG_EXPORT BOOL GUIAPI LineClipper (const RECT* cliprc,
3437  int *_x0, int *_y0, int *_x1, int *_y1);
3438 
3443 typedef void (* CB_LINE) (void* context, int stepx, int stepy);
3444 
3467 MG_EXPORT void GUIAPI LineGenerator (void* context,
3468  int x1, int y1, int x2, int y2, CB_LINE cb);
3469 
3474 typedef void (* CB_CIRCLE) (void* context, int x1, int x2, int y);
3475 
3503 MG_EXPORT void GUIAPI CircleGenerator (void* context,
3504  int sx, int sy, int r, CB_CIRCLE cb);
3505 
3510 typedef void (* CB_ELLIPSE) (void* context, int x1, int x2, int y);
3511 
3536 MG_EXPORT void GUIAPI EllipseGenerator (void* context,
3537  int sx, int sy, int rx, int ry, CB_ELLIPSE cb);
3538 
3543 typedef void (* CB_ARC) (void* context, int x, int y);
3544 
3568 MG_EXPORT void GUIAPI CircleArcGenerator (void* context,
3569  int sx, int sy, int r, int ang1, int ang2, CB_ARC cb);
3570 
3575 typedef void (* CB_POLYGON) (void* context, int x1, int x2, int y);
3576 
3615 MG_EXPORT BOOL GUIAPI MonotoneVerticalPolygonGenerator (void* context,
3616  const POINT* pts, int vertices, CB_POLYGON cb);
3617 
3635 MG_EXPORT BOOL GUIAPI PolygonIsMonotoneVertical (const POINT* pts,
3636  int vertices);
3637 
3664 MG_EXPORT BOOL GUIAPI PolygonGeneratorEx (void* context,
3665  const POINT* pts, int vertices, CB_POLYGON cb, RECT* rc_output);
3675 #define PolygonGenerator(context, pts, vertices, cb) \
3676  PolygonGeneratorEx(context, pts, vertices, cb, NULL)
3677 
3682 typedef BOOL (* CB_EQUAL_PIXEL) (void* context, int x, int y);
3683 
3688 typedef void (* CB_FLOOD_FILL) (void* context, int x1, int x2, int y);
3689 
3710 MG_EXPORT BOOL GUIAPI FloodFillGenerator (void* context,
3711  const RECT* src_rc, int x, int y,
3712  CB_EQUAL_PIXEL cb_equal_pixel, CB_FLOOD_FILL cb_flood_fill);
3713 
3714 /* DDA algorithm */
3715 #define BITMAP_SCALER_DDA 0
3716 /* Bilinear interpolation algorithm */
3717 #define BITMAP_SCALER_BILINEAR 1
3718 
3733 MG_EXPORT int GUIAPI SetBitmapScalerType (HDC hdc, int scaler_type);
3734 
3748 MG_EXPORT void GUIAPI MoveTo (HDC hdc, int x, int y);
3749 
3764 MG_EXPORT void GUIAPI LineTo (HDC hdc, int x, int y);
3765 
3781 MG_EXPORT void GUIAPI Rectangle (HDC hdc, int x0, int y0, int x1, int y1);
3782 
3797 MG_EXPORT void GUIAPI PolyLineTo (HDC hdc, const POINT* pts, int vertices);
3798 
3813 MG_EXPORT void GUIAPI SplineTo (HDC hdc, const POINT* pts);
3814 
3829 MG_EXPORT void GUIAPI Circle (HDC hdc, int sx, int sy, int r);
3830 
3847 MG_EXPORT void GUIAPI Ellipse (HDC hdc, int sx, int sy, int rx, int ry);
3848 
3870 MG_EXPORT void GUIAPI CircleArc (HDC hdc, int sx, int sy, int r,
3871  int ang1, int ang2);
3872 
3887 MG_EXPORT void GUIAPI FillBox (HDC hdc, int x, int y, int w, int h);
3888 
3902 MG_EXPORT void GUIAPI FillCircle (HDC hdc, int sx, int sy, int r);
3903 
3920 MG_EXPORT void GUIAPI FillEllipse (HDC hdc, int sx, int sy, int rx, int ry);
3921 
3935 MG_EXPORT BOOL GUIAPI FillPolygon (HDC hdc, const POINT* pts, int vertices);
3936 
3950 MG_EXPORT BOOL GUIAPI FloodFill (HDC hdc, int x, int y);
3951 
3952 #ifdef _MGHAVE_ADV_2DAPI
3953 
3962 typedef enum
3963 {
3981 } PenType;
3982 
3992 #define GetPenType(hdc) \
3993  GetDCAttr (hdc, DC_ATTR_PEN_TYPE)
3994 
4005 #define SetPenType(hdc, type) \
4006  SetDCAttr (hdc, DC_ATTR_PEN_TYPE, (DWORD) type)
4007 
4027 MG_EXPORT void GUIAPI SetPenDashes (HDC hdc, int dash_offset,
4028  const unsigned char* dash_list, int n);
4029 
4033 typedef enum
4034 {
4050 } PTCapStyle;
4051 
4061 #define GetPenCapStyle(hdc) \
4062  GetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE)
4063 
4074 #define SetPenCapStyle(hdc, style) \
4075  SetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE, (DWORD) style)
4076 
4080 typedef enum
4081 {
4095 } PTJoinStyle;
4096 
4106 #define GetPenJoinStyle(hdc) GetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE)
4107 
4118 #define SetPenJoinStyle(hdc, style) \
4119  SetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE, (DWORD) style)
4120 
4130 #define GetPenWidth(hdc) \
4131  GetDCAttr (hdc, DC_ATTR_PEN_WIDTH)
4132 
4143 #define SetPenWidth(hdc, width) \
4144  SetDCAttr (hdc, DC_ATTR_PEN_WIDTH, (DWORD) width)
4145 
4153 typedef enum {
4176 } BrushType;
4177 
4187 #define GetBrushType(hdc) \
4188  GetDCAttr (hdc, DC_ATTR_BRUSH_TYPE)
4189 
4200 #define SetBrushType(hdc, type) \
4201  SetDCAttr (hdc, DC_ATTR_BRUSH_TYPE, (DWORD) type)
4202 
4204 typedef struct _STIPPLE
4205 {
4207  int width;
4209  int height;
4210 
4212  int pitch;
4213 
4215  size_t size;
4216 
4218  const unsigned char* bits;
4219 } STIPPLE;
4220 
4232 MG_EXPORT void GUIAPI SetBrushInfo (HDC hdc,
4233  const BITMAP* tile, const STIPPLE* stipple);
4234 
4249 MG_EXPORT void GUIAPI SetBrushOrigin (HDC hdc, int x, int y);
4250 
4268 MG_EXPORT void GUIAPI LineEx (HDC hdc, int x1, int y1, int x2, int y2);
4269 
4293 MG_EXPORT void GUIAPI ArcEx (HDC hdc, int x, int y, int width, int height,
4294  int ang1, int ang2);
4295 
4319 MG_EXPORT void GUIAPI FillArcEx (HDC hdc, int x, int y, int width, int height,
4320  int ang1, int ang2);
4321 
4334 MG_EXPORT void GUIAPI PolyLineEx (HDC hdc, const POINT* pts, int nr_pts);
4335 
4339 typedef struct _ARC
4340 {
4342  int x;
4344  int y;
4345 
4347  int width;
4349  int height;
4350 
4355  int angle1;
4359  int angle2;
4360 } ARC;
4361 
4374 MG_EXPORT void GUIAPI PolyArcEx (HDC hdc, const ARC* arcs, int nr_arcs);
4375 
4388 MG_EXPORT void GUIAPI PolyFillArcEx (HDC hdc, const ARC* arcs, int nr_arcs);
4389 
4408 MG_EXPORT BOOL GUIAPI RoundRect (HDC hdc, int x0, int y0, int x1, int y1, int cw, int ch);
4409 
4413 #endif
4414 
4460 #define MM_TEXT 0
4461 #define MM_ANISOTROPIC 1
4462 
4478 #define GetMapMode(hdc) GetDCAttr (hdc, DC_ATTR_MAP_MODE)
4479 
4495 #define SetMapMode(hdc, mapmode) \
4496  SetDCAttr (hdc, DC_ATTR_MAP_MODE, (DWORD)mapmode)
4497 
4522 MG_EXPORT void GUIAPI GetDCLCS (HDC hdc, int which, POINT* pt);
4523 
4548 MG_EXPORT void GUIAPI SetDCLCS (HDC hdc, int which, const POINT* pt);
4549 
4550 #define DC_LCS_VORG 0
4551 #define DC_LCS_VEXT 1
4552 #define DC_LCS_WORG 2
4553 #define DC_LCS_WEXT 3
4554 #define NR_DC_LCS_PTS 4
4555 
4569 #define GetViewportOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_VORG, pPt)
4570 
4584 #define GetViewportExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_VEXT, pPt)
4585 
4599 #define GetWindowOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_WORG, pPt)
4600 
4614 #define GetWindowExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_WEXT, pPt)
4615 
4629 #define SetViewportOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_VORG, pPt)
4630 
4644 #define SetViewportExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_VEXT, pPt)
4645 
4659 #define SetWindowOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_WORG, pPt)
4660 
4674 #define SetWindowExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_WEXT, pPt)
4675 
4694 MG_EXPORT void GUIAPI DPtoLP (HDC hdc, POINT* pPt);
4695 
4696 
4715 MG_EXPORT void GUIAPI LPtoDP (HDC hdc, POINT* pPt);
4716 
4735 MG_EXPORT void GUIAPI SPtoLP(HDC hdc, POINT* pPt);
4736 
4737 
4756 MG_EXPORT void GUIAPI LPtoSP(HDC hdc, POINT* pPt);
4757 
4778 MG_EXPORT void GUIAPI ExcludeClipRect (HDC hdc, const RECT* prc);
4779 
4793 MG_EXPORT void GUIAPI IncludeClipRect (HDC hdc, const RECT* prc);
4794 
4810 MG_EXPORT BOOL GUIAPI PtVisible (HDC hdc, int x, int y);
4811 
4824 MG_EXPORT void GUIAPI ClipRectIntersect (HDC hdc, const RECT* prc);
4825 
4838 MG_EXPORT void GUIAPI SelectClipRect (HDC hdc, const RECT* prc);
4839 
4840 #define RGN_COPY 0x00
4841 #define RGN_DIFF 0x01
4842 #define RGN_AND 0x02
4843 #define RGN_OR 0x03
4844 #define RGN_XOR 0x04
4845 
4899 MG_EXPORT int GUIAPI SelectClipRegionEx (HDC hdc, const CLIPRGN* pRgn,
4900  int fnMode);
4901 
4914 MG_EXPORT void GUIAPI SelectClipRegion (HDC hdc, const CLIPRGN* pRgn);
4915 
4938 MG_EXPORT int GUIAPI OffsetClipRegion (HDC hdc, int nXOffset, int nYOffset);
4939 
4952 MG_EXPORT void GUIAPI GetBoundsRect (HDC hdc, RECT* pRect);
4953 
4971 MG_EXPORT BOOL GUIAPI RectVisible (HDC hdc, const RECT* pRect);
4972 
4991 MG_EXPORT int GUIAPI GetClipBox (HDC hdc, RECT* clipbox);
4992 
5011 MG_EXPORT int GUIAPI GetClipRegion (HDC hdc, CLIPRGN* cliprgn);
5012 
5048 MG_EXPORT BOOL GUIAPI GetBitmapFromDC (HDC hdc,
5049  int x, int y, int w, int h, BITMAP* bmp);
5050 
5086 MG_EXPORT BOOL GUIAPI FillBoxWithBitmap (HDC hdc, int x, int y, int w, int h,
5087  const BITMAP *bmp);
5088 
5142 MG_EXPORT BOOL GUIAPI FillBoxWithBitmapPart (HDC hdc,
5143  int x, int y, int w, int h,
5144  int bw, int bh, const BITMAP* bmp, int xo, int yo);
5145 
5168 MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y,
5169  int box_w, int box_h, const BITMAP* pbmp, int bmp_x, int bmp_y,
5170  int bmp_w, int bmp_h);
5171 
5177 typedef enum {
5206 
5207  COLOR_BLEND_PD_FIRST = COLOR_BLEND_PD_SRC_OVER,
5208  COLOR_BLEND_PD_LAST = COLOR_BLEND_PD_MODULATE,
5209 
5270 
5271  COLOR_BLEND_SP_FIRST = COLOR_BLEND_SP_NORMAL,
5272  COLOR_BLEND_SP_LAST = COLOR_BLEND_SP_EXCLUSION,
5273 
5298 
5299  COLOR_BLEND_NS_FIRST = COLOR_BLEND_NS_HUE,
5300  COLOR_BLEND_NS_LAST = COLOR_BLEND_NS_LUMINOSITY,
5302 
5306 typedef enum {
5307  COLOR_LOGICOP_CLEAR = 0,
5308  COLOR_LOGICOP_NOR,
5309  COLOR_LOGICOP_AND_INVERTED,
5310  COLOR_LOGICOP_COPY_INVERTED,
5311  COLOR_LOGICOP_AND_REVERSE,
5312  COLOR_LOGICOP_INVERT,
5313  COLOR_LOGICOP_XOR,
5314  COLOR_LOGICOP_NAND,
5315  COLOR_LOGICOP_AND,
5316  COLOR_LOGICOP_EQUIV,
5317  COLOR_LOGICOP_NOOP0,
5318  COLOR_LOGICOP_OR_INVERTED1,
5319  COLOR_LOGICOP_COPY,
5320  COLOR_LOGICOP_OR_REVERSE,
5321  COLOR_LOGICOP_OR,
5322  COLOR_LOGICOP_SET,
5323 } ColorLogicalOp;
5324 
5359 MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
5360  HDC hddc, int dx, int dy, DWORD dwRop);
5361 
5401 MG_EXPORT void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh,
5402  HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop);
5403 
5423 MG_EXPORT BOOL GUIAPI ScaleBitmapEx (BITMAP* dst, const BITMAP* src,
5424  HDC ref_dc);
5425 
5426 #define ScaleBitmap(dst, src) ScaleBitmapEx(dst, src, HDC_SCREEN)
5427 
5449 MG_EXPORT gal_pixel GUIAPI GetPixelInBitmapEx (const BITMAP* bmp, int x, int y, Uint8* alpha);
5450 
5468 static inline gal_pixel GUIAPI GetPixelInBitmap (const BITMAP* bmp, int x, int y)
5469 {
5470  return GetPixelInBitmapEx (bmp, x, y, NULL);
5471 }
5472 
5497 MG_EXPORT BOOL GUIAPI SetPixelInBitmapEx (const BITMAP* bmp,
5498  int x, int y, gal_pixel pixel, const Uint8* alpha);
5499 
5520 static inline BOOL GUIAPI SetPixelInBitmap (const BITMAP* bmp,
5521  int x, int y, gal_pixel pixel)
5522 {
5523  return SetPixelInBitmapEx (bmp, x, y, pixel, NULL);
5524 }
5525 
5526 #ifdef _MGMISC_SAVESCREEN
5527 
5546 MG_EXPORT BOOL GUIAPI SaveScreenRectContent (const RECT* rcWin,
5547  const char* filename);
5548 
5566 MG_EXPORT BOOL GUIAPI SaveMainWindowContent (HWND hWnd, const char* filename);
5567 #endif
5568 
5594 MG_EXPORT HICON GUIAPI LoadIconFromFile (HDC hdc, const char* filename,
5595  int which);
5596 
5615 MG_EXPORT HICON GUIAPI LoadIconFromMem (HDC hdc, const void* area, int which);
5616 
5641 MG_EXPORT HICON GUIAPI CreateIconEx (HDC hdc, int w, int h,
5642  const BYTE* AndBits, const BYTE* XorBits, int colornum,
5643  const RGB* pal);
5648 #define CreateIcon(hdc, w, h, AndBits, XorBits, colornum) \
5649  CreateIconEx(hdc, w, h, AndBits, XorBits, colornum, NULL)
5650 
5666 MG_EXPORT HICON GUIAPI LoadBitmapIconEx (HDC hdc, MG_RWops* area,
5667  const char* ext);
5668 
5682 MG_EXPORT HICON GUIAPI LoadBitmapIconFromFile (HDC hdc,
5683  const char* file_name);
5684 
5702 MG_EXPORT HICON GUIAPI LoadBitmapIconFromMem (HDC hdc,
5703  const void* mem, size_t size, const char* ext);
5704 
5716 MG_EXPORT BOOL GUIAPI DestroyIcon (HICON hicon);
5717 
5731 MG_EXPORT BOOL GUIAPI GetIconSize (HICON hicon, int* w, int* h);
5732 
5750 MG_EXPORT void GUIAPI DrawIcon (HDC hdc,
5751  int x, int y, int w, int h, HICON hicon);
5752 
5774 static inline void SetRect (RECT* prc, int left, int top, int right, int bottom)
5775 {
5776  (prc)->left = left; (prc)->top = top;
5777  (prc)->right = right; (prc)->bottom = bottom;
5778 }
5779 
5793 static inline void SetRectEmpty (RECT* prc)
5794 {
5795  (prc)->left = (prc)->top = (prc)->right = (prc)->bottom = 0;
5796 }
5797 
5810 static inline void CopyRect (RECT* pdrc, const RECT* psrc)
5811 {
5812  (pdrc)->left = (psrc)->left; (pdrc)->top = (psrc)->top;
5813  (pdrc)->right = (psrc)->right; (pdrc)->bottom = (psrc)->bottom;
5814 }
5815 
5831 static inline void OffsetRect (RECT* prc, int x, int y)
5832 {
5833  (prc)->left += x; (prc)->top += y; (prc)->right += x; (prc)->bottom += y;
5834 }
5835 
5852 static inline void InflateRect (RECT* prc, int cx, int cy)
5853 {
5854  (prc)->left -= cx; (prc)->top -= cy;
5855  (prc)->right += cx; (prc)->bottom += cy;
5856 }
5857 
5871 static inline void InflateRectToPt (RECT* prc, int x, int y)
5872 {
5873  if ((x) < (prc)->left) (prc)->left = (x);
5874  if ((y) < (prc)->top) (prc)->top = (y);
5875  if ((x) > (prc)->right) (prc)->right = (x);
5876  if ((y) > (prc)->bottom) (prc)->bottom = (y);
5877 }
5878 
5894 static inline BOOL PtInRect(const RECT* prc, int x, int y)
5895 {
5896  if (x >= prc->left && x < prc->right && y >= prc->top && y < prc->bottom)
5897  return TRUE;
5898  return FALSE;
5899 }
5900 
5913 MG_EXPORT BOOL GUIAPI IsRectEmpty (const RECT* prc);
5914 
5927 MG_EXPORT BOOL GUIAPI EqualRect (const RECT* prc1, const RECT* prc2);
5928 
5938 MG_EXPORT void GUIAPI NormalizeRect (RECT* pRect);
5939 
5960 MG_EXPORT BOOL GUIAPI IntersectRect (RECT* pdrc,
5961  const RECT* psrc1, const RECT* psrc2);
5962 
5978 MG_EXPORT BOOL GUIAPI IsCovered (const RECT* prc1, const RECT* prc2);
5979 
5993 MG_EXPORT BOOL GUIAPI DoesIntersect (const RECT* psrc1, const RECT* psrc2);
5994 
6012 MG_EXPORT BOOL GUIAPI UnionRect (RECT* pdrc,
6013  const RECT* psrc1, const RECT* psrc2);
6014 
6030 MG_EXPORT void GUIAPI GetBoundRect (PRECT pdrc,
6031  const RECT* psrc1, const RECT* psrc2);
6032 
6049 MG_EXPORT int GUIAPI SubtractRect (RECT* rc, const RECT* psrc1, const RECT* psrc2);
6050 
6055 #define RECTWP(prc) ((prc)->right - (prc)->left)
6056 
6060 #define RECTHP(prc) ((prc)->bottom - (prc)->top)
6061 
6065 #define RECTW(rc) ((rc).right - (rc).left)
6066 
6070 #define RECTH(rc) ((rc).bottom - (rc).top)
6071 
6085 /* Font-related structures */
6086 #define LEN_LOGFONT_NAME_FIELD 31
6087 #define LEN_LOGFONT_FAMILY_FIELD (LEN_LOGFONT_NAME_FIELD*7+6)
6088 #define LEN_LOGFONT_NAME_FULL (LEN_LOGFONT_FAMILY_FIELD + 32)
6089 #define LEN_UNIDEVFONT_NAME 255
6090 
6091 #define LEN_FONT_NAME LEN_LOGFONT_NAME_FIELD
6092 #define LEN_DEVFONT_NAME LEN_UNIDEVFONT_NAME
6093 
6094 #define FONT_WEIGHT_NIL '\0'
6095 #define FONT_WEIGHT_ANY '*'
6096 #define FONT_WEIGHT_THIN 't'
6097 #define FONT_WEIGHT_EXTRA_LIGHT 'e'
6098 #define FONT_WEIGHT_LIGHT 'l'
6099 #define FONT_WEIGHT_NORMAL 'n'
6100 #define FONT_WEIGHT_REGULAR 'r'
6101 #define FONT_WEIGHT_MEDIUM 'm'
6102 #define FONT_WEIGHT_DEMIBOLD 'd'
6103 #define FONT_WEIGHT_BOLD 'b'
6104 #define FONT_WEIGHT_EXTRA_BOLD 'x'
6105 #define FONT_WEIGHT_BLACK 'c'
6106 
6107 /* Backward compatiblilty definitions.
6108  * deprecated since v4.0.0, use FS_RENDER_XXX/FONT_RENDER_XXX instead
6109  */
6110 #define FONT_WEIGHT_SUBPIXEL 's'
6111 #define FONT_WEIGHT_BOOK 'k'
6112 
6113 #define FS_WEIGHT_MASK 0x000000FF
6114 #define FS_WEIGHT_ANY 0
6115 #define FS_WEIGHT_THIN 10
6116 #define FS_WEIGHT_EXTRA_LIGHT 20
6117 #define FS_WEIGHT_LIGHT 30
6118 #define FS_WEIGHT_NORMAL 35
6119 #define FS_WEIGHT_REGULAR 40
6120 #define FS_WEIGHT_MEDIUM 50
6121 #define FS_WEIGHT_DEMIBOLD 60
6122 #define FS_WEIGHT_EXTRA_BOLD 70
6123 #define FS_WEIGHT_BOLD 80
6124 #define FS_WEIGHT_BLACK 90
6125 
6126 #define FONT_SLANT_NIL '\0'
6127 #define FONT_SLANT_ANY '*'
6128 #define FONT_SLANT_ROMAN 'r'
6129 #define FONT_SLANT_ITALIC 'i'
6130 #define FONT_SLANT_OBLIQUE 'o'
6131 
6132 #define FS_SLANT_MASK 0x00000F00
6133 #define FS_SLANT_ANY 0x00000000
6134 #define FS_SLANT_ROMAN 0x00000100
6135 #define FS_SLANT_ITALIC 0x00000200
6136 #define FS_SLANT_OBLIQUE 0x00000300
6137 
6138 #define FONT_FLIP_NONE 'n'
6139 #define FONT_FLIP_HORZ 'h'
6140 #define FONT_FLIP_VERT 'v'
6141 #define FONT_FLIP_HORZVERT 't'
6142 #define FONT_FLIP_NIL FONT_FLIP_NONE
6143 
6144 #define FS_FLIP_MASK 0x0000F000
6145 #define FS_FLIP_NONE 0x00000000
6146 #define FS_FLIP_HORZ 0x00001000
6147 #define FS_FLIP_VERT 0x00002000
6148 #define FS_FLIP_HORZVERT 0x00003000 /* HORZ | VERT */
6149 
6150 #define FONT_OTHER_NONE 'n'
6151 #define FONT_OTHER_AUTOSCALE 's'
6152 #define FONT_OTHER_TTFNOCACHE 'c'
6153 #define FONT_OTHER_TTFKERN 'k'
6154 #define FONT_OTHER_TTFNOCACHEKERN 'r'
6155 #define FONT_OTHER_NIL FONT_OTHER_NONE
6156 
6157 #define FS_OTHER_MASK 0x00F00000
6158 #define FS_OTHER_NONE 0x00000000
6159 #define FS_OTHER_AUTOSCALE 0x00100000
6160 #define FS_OTHER_TTFNOCACHE 0x00200000
6161 #define FS_OTHER_TTFKERN 0x00400000
6162 #define FS_OTHER_TTFNOCACHEKERN 0x00600000 /* KERN | NOCACHE */
6163 
6164 #define FONT_DECORATE_NIL '\0'
6165 #define FONT_DECORATE_NONE 'n'
6166 #define FONT_DECORATE_UNDERLINE 'u'
6167 #define FONT_DECORATE_STRUCKOUT 's'
6168 #define FONT_DECORATE_REVERSE 'r'
6169 #define FONT_DECORATE_OUTLINE 'o'
6170 #define FONT_DECORATE_US 'U' /* UNDERLINE | STRUCKOUT */
6171 
6172 #define FS_DECORATE_MASK 0x0F000000
6173 #define FS_DECORATE_NONE 0x00000000
6174 #define FS_DECORATE_UNDERLINE 0x01000000
6175 #define FS_DECORATE_STRUCKOUT 0x02000000
6176 #define FS_DECORATE_REVERSE 0x04000000
6177 #define FS_DECORATE_OUTLINE 0x08000000
6178 #define FS_DECORATE_US (FS_DECORATE_UNDERLINE | FS_DECORATE_STRUCKOUT)
6179 
6180 #define FONT_RENDER_NIL '\0'
6181 #define FONT_RENDER_ANY '*'
6182 #define FONT_RENDER_MONO 'n'
6183 #define FONT_RENDER_GREY 'g'
6184 #define FONT_RENDER_SUBPIXEL 's'
6185 
6186 #define FS_RENDER_MASK 0xF0000000
6187 #define FS_RENDER_MONO 0x00000000
6188 #define FS_RENDER_GREY 0x10000000
6189 #define FS_RENDER_SUBPIXEL 0x20000000
6190 #define FS_RENDER_ANY FS_RENDER_MONO
6191 
6192 /* Backward compatiblilty definitions; deprecated since v4.0.0 */
6193 #define FONT_OTHER_LCDPORTRAIT 'p'
6194 #define FONT_OTHER_LCDPORTRAITKERN 'q'
6195 
6196 #define FONT_WEIGHT_ALL FONT_WEIGHT_ANY
6197 #define FONT_SLANT_ALL FONT_SLANT_ANY
6198 #define FS_WEIGHT_ALL FS_WEIGHT_ANY
6199 #define FS_SLANT_ALL FS_SLANT_ANY
6200 
6201 /* Backward compatiblilty definitions; deprecated since v4.0.0
6202  * All FONT_SETWIDTH_* and FONT_SPACING_* types will
6203  * be treated as FONT_FLIP_NIL and FONT_OTHER_NIL respectively.
6204  */
6205 #define FONT_SETWIDTH_NIL '\0'
6206 #define FONT_SETWIDTH_ALL '*'
6207 #define FONT_SETWIDTH_BOLD 'b'
6208 #define FONT_SETWIDTH_CONDENSED 'c'
6209 #define FONT_SETWIDTH_SEMICONDENSED 's'
6210 #define FONT_SETWIDTH_NORMAL 'n'
6211 #define FONT_SETWIDTH_TTFNOCACHE 'w'
6212 
6213 #define FONT_SPACING_NIL '\0'
6214 #define FONT_SPACING_ALL '*'
6215 #define FONT_SPACING_MONOSPACING 'm'
6216 #define FONT_SPACING_PROPORTIONAL 'p'
6217 #define FONT_SPACING_CHARCELL 'c'
6218 
6219 #define FONT_UNDERLINE_NIL '\0'
6220 #define FONT_UNDERLINE_ALL '*'
6221 #define FONT_UNDERLINE_LINE 'u'
6222 #define FONT_UNDERLINE_NONE 'n'
6223 
6224 #define FONT_STRUCKOUT_NIL '\0'
6225 #define FONT_STRUCKOUT_ALL '*'
6226 #define FONT_STRUCKOUT_LINE 's'
6227 #define FONT_STRUCKOUT_NONE 'n'
6228 /******/
6229 
6230 #define FONT_TYPE_NAME_LEN 3
6231 #define FONT_TYPE_NAME_BITMAP_NUF "nuf"
6232 #define FONT_TYPE_NAME_BITMAP_RAW "rbf"
6233 #define FONT_TYPE_NAME_BITMAP_VAR "vbf"
6234 #define FONT_TYPE_NAME_BITMAP_QPF "qpf"
6235 #define FONT_TYPE_NAME_BITMAP_UPF "upf"
6236 #define FONT_TYPE_NAME_BITMAP_BMP "bmp"
6237 #define FONT_TYPE_NAME_SCALE_TTF "ttf"
6238 #define FONT_TYPE_NAME_SCALE_T1F "t1f"
6239 #define FONT_TYPE_NAME_ANY "*"
6240 #define FONT_TYPE_NAME_ALL FONT_TYPE_NAME_ANY
6241 
6242 #define FONT_ETC_SECTION_NAME_VBF "varbitmapfonts"
6243 #define FONT_ETC_SECTION_NAME_RBF "rawbitmapfonts"
6244 #define FONT_ETC_SECTION_NAME_UPF "upf"
6245 #define FONT_ETC_SECTION_NAME_QPF "qpf"
6246 #define FONT_ETC_SECTION_NAME_TTF "truetypefonts"
6247 
6248 #define FONT_TYPE_BITMAP_RAW 0x0001 /* "rbf" */
6249 #define FONT_TYPE_BITMAP_VAR 0x0002 /* "vbf" */
6250 #define FONT_TYPE_BITMAP_QPF 0x0003 /* "qpf" */
6251 #define FONT_TYPE_BITMAP_BMP 0x0004 /* "bmp" */
6252 #define FONT_TYPE_BITMAP_UPF 0x0005 /* "upf" */
6253 #define FONT_TYPE_SCALE_TTF 0x0010 /* "ttf" */
6254 #define FONT_TYPE_SCALE_T1F 0x0011 /* "t1f" */
6255 #define FONT_TYPE_ANY 0x0000 /* "any" */
6256 #define FONT_TYPE_ALL FONT_TYPE_ANY
6257 
6258 #define FONT_CHARSET_US_ASCII "US-ASCII"
6259 
6260 #define FONT_CHARSET_ISO8859_1 "ISO8859-1"
6261 #define FONT_CHARSET_ISO8859_2 "ISO8859-2"
6262 #define FONT_CHARSET_ISO8859_3 "ISO8859-3"
6263 #define FONT_CHARSET_ISO8859_4 "ISO8859-4"
6264 #define FONT_CHARSET_ISO8859_5 "ISO8859-5"
6265 #define FONT_CHARSET_ISO8859_6 "ISO8859-6"
6266 #define FONT_CHARSET_ISO8859_7 "ISO8859-7"
6267 #define FONT_CHARSET_ISO8859_8 "ISO8859-8"
6268 #define FONT_CHARSET_ISO8859_9 "ISO8859-9"
6269 #define FONT_CHARSET_ISO8859_10 "ISO8859-10"
6270 #define FONT_CHARSET_ISO8859_11 "ISO8859-11"
6271 #define FONT_CHARSET_ISO8859_12 "ISO8859-12"
6272 #define FONT_CHARSET_ISO8859_13 "ISO8859-13"
6273 #define FONT_CHARSET_ISO8859_14 "ISO8859-14"
6274 #define FONT_CHARSET_ISO8859_15 "ISO8859-15"
6275 #define FONT_CHARSET_ISO8859_16 "ISO8859-16"
6276 
6277 #define FONT_CHARSET_EUC_CN "EUC-CN"
6278 
6283 #define FONT_CHARSET_GB1988_0 "GB1988-0"
6284 
6289 #define FONT_CHARSET_GB2312_0 "GB2312-0"
6290 #define FONT_CHARSET_GBK "GBK"
6291 
6296 #define FONT_CHARSET_GB18030_0 "GB18030-0"
6297 #define FONT_CHARSET_BIG5 "BIG5"
6298 
6303 #define FONT_CHARSET_EUCTW "EUC-TW"
6304 #define FONT_CHARSET_EUCKR "EUC-KR"
6305 
6310 #define FONT_CHARSET_KSC5636_0 "KSC5636-0"
6311 
6316 #define FONT_CHARSET_KSC5601_0 "KSC5601-0"
6317 #define FONT_CHARSET_EUCJP "EUC-JP"
6318 
6323 #define FONT_CHARSET_JISX0201_0 "JISX0201-0"
6324 
6329 #define FONT_CHARSET_JISX0208_0 "JISX0208-0"
6330 #define FONT_CHARSET_SHIFTJIS "SHIFT-JIS"
6331 
6336 #define FONT_CHARSET_JISX0201_1 "JISX0201-1"
6337 
6342 #define FONT_CHARSET_JISX0208_1 "JISX0208-1"
6343 
6348 #define FONT_CHARSET_ISO_10646_1 "ISO-10646-1"
6349 
6354 #define FONT_CHARSET_UTF8 "UTF-8"
6355 
6360 #define FONT_CHARSET_UTF16LE "UTF-16LE"
6361 
6366 #define FONT_CHARSET_UTF16BE "UTF-16BE"
6367 
6368 #define FONT_MAX_SIZE 256
6369 #define FONT_MIN_SIZE 1
6370 #define MAXNR_DEVFONTS 8
6371 
6372 struct _DEVFONT;
6373 typedef struct _DEVFONT DEVFONT;
6374 
6379 typedef struct _LOGFONT {
6381  char* type;
6383  char* family;
6385  char* charset;
6389  int size;
6393  int ascent;
6395  int descent;
6398 
6399  /*
6400  * The following fields are internally used.
6401  * They may be changed in the future.
6402  */
6403 
6404  // The scale factors of devfonts
6405  unsigned short scales[MAXNR_DEVFONTS];
6406  // The devfonts for the logfont
6407  DEVFONT* devfonts[MAXNR_DEVFONTS];
6408 } LOGFONT;
6409 
6415 
6420 typedef const LOGFONT* CPLOGFONT;
6421 
6422 struct _WORDINFO;
6423 
6428 typedef struct _WORDINFO WORDINFO;
6429 
6430 #define MAX_LEN_MCHAR 6
6431 
6432 typedef Uint16 Uchar16;
6433 typedef Uint32 Uchar32;
6434 
6452 #define ACHARTYPE_BASIC_MASK 0x0000FFFF
6453 #define ACHARTYPE_CATEGORY_MASK 0x00FF0000
6454 #define ACHARTYPE_BREAK_MASK 0xFF000000
6455 
6460 #define ACHARTYPE_EXTRACT_BASIC(t) \
6461  (((t) & ACHARTYPE_BASIC_MASK))
6462 
6467 #define ACHARTYPE_EXTRACT_CATEGORY(t) \
6468  (((t) & ACHARTYPE_CATEGORY_MASK) >> 16)
6469 
6474 #define ACHARTYPE_EXTRACT_BREAK(t) \
6475  (((t) & ACHARTYPE_BREAK_MASK) >> 24)
6476 
6481 #define ACHARTYPE_UNKNOWN 0
6482 
6483 #define ACHAR_BASIC_NOSPACING_MARK 0x0001
6484 #define ACHAR_BASIC_ABOVE_MARK 0x0002
6485 #define ACHAR_BASIC_BELLOW_MARK 0x0004
6486 
6487 #define ACHAR_BASIC_UNKNOWN 0x0000
6488 #define ACHAR_BASIC_NUL (0x0000 | ACHAR_BASIC_NOSPACING_MARK)
6489 
6490 #define ACHAR_BASIC_CTRL1 0x0100
6491 
6492 #define ACHAR_BASIC_BEL 0x0200
6493 
6494 #define ACHAR_BASIC_BS 0x0300
6495 
6496 #define ACHAR_BASIC_HT 0x0400
6497 
6498 #define ACHAR_BASIC_LF 0x0500
6499 
6500 #define ACHAR_BASIC_VT 0x0600
6501 
6502 #define ACHAR_BASIC_FF 0x0700
6503 
6504 #define ACHAR_BASIC_CR 0x0800
6505 
6506 #define ACHAR_BASIC_CTRL2 0x0900
6507 
6508 #define ACHAR_BASIC_SPACE 0x0A00
6509 
6510 #define ACHAR_BASIC_ZEROWIDTH 0x0B00
6511 #define ACHAR_BASIC_GENERIC 0x0C00
6512 
6513 #define ACHAR_BASIC_LIGATURE (0x0D00 | ACHAR_BASIC_NOSPACING_MARK)
6514 #define ACHAR_BASIC_VOWEL (0x0E00 | ACHAR_BASIC_NOSPACING_MARK)
6515 #define ACHAR_BASIC_VOWEL_ABOVE (ACHAR_BASIC_VOWEL | ACHAR_BASIC_ABOVE_MARK)
6516 #define ACHAR_BASIC_VOWEL_BELLOW (ACHAR_BASIC_VOWEL | ACHAR_BASIC_BELLOW_MARK)
6517 
6518 /* Compatibility definitions */
6519 #define MCHAR_TYPE_UNKNOWN ACHAR_BASIC_UNKNOWN
6520 #define MCHAR_TYPE_NUL ACHAR_BASIC_NUL
6521 #define MCHAR_TYPE_CTRL1 ACHAR_BASIC_CTRL1
6522 #define MCHAR_TYPE_BEL ACHAR_BASIC_BEL
6523 #define MCHAR_TYPE_BS ACHAR_BASIC_BS
6524 #define MCHAR_TYPE_HT ACHAR_BASIC_HT
6525 #define MCHAR_TYPE_LF ACHAR_BASIC_LF
6526 #define MCHAR_TYPE_VT ACHAR_BASIC_VT
6527 #define MCHAR_TYPE_FF ACHAR_BASIC_FF
6528 #define MCHAR_TYPE_CR ACHAR_BASIC_CR
6529 #define MCHAR_TYPE_CTRL2 ACHAR_BASIC_CTRL2
6530 #define MCHAR_TYPE_SPACE ACHAR_BASIC_SPACE
6531 #define MCHAR_TYPE_ZEROWIDTH ACHAR_BASIC_ZEROWIDTH
6532 #define MCHAR_TYPE_GENERIC ACHAR_BASIC_GENERIC
6533 #define MCHAR_TYPE_NOSPACING_MARK ACHAR_BASIC_NOSPACING_MARK
6534 #define MCHAR_TYPE_LIGATURE ACHAR_BASIC_LIGATURE
6535 #define MCHAR_TYPE_VOWEL ACHAR_BASIC_VOWEL
6536 #define MCHAR_TYPE_VOWEL_ABOVE ACHAR_BASIC_VOWEL_ABOVE
6537 #define MCHAR_TYPE_VOWEL_BELLOW ACHAR_BASIC_VOWEL_BELLOW
6538 
6539 #if 0
6540 #define MCHAR_TYPE_ASCII 0x0080
6541 #define MCHAR_TYPE_LATIN1 0x0081
6542 #define MCHAR_TYPE_LATIN2 0x0082
6543 #define MCHAR_TYPE_LATIN3 0x0083
6544 #define MCHAR_TYPE_LATIN4 0x0084
6545 #define MCHAR_TYPE_LATIN5 0x0085
6546 #define MCHAR_TYPE_LATIN6 0x0086
6547 #define MCHAR_TYPE_LATIN7 0x0087
6548 #define MCHAR_TYPE_LATIN8 0x0088
6549 #define MCHAR_TYPE_LATIN9 0x0089
6550 #define MCHAR_TYPE_LATIN10 0x008A
6551 #define MCHAR_TYPE_CYRILLIC 0x008B
6552 #define MCHAR_TYPE_ARABIC 0x008C
6553 #define MCHAR_TYPE_GREEK 0x008D
6554 #define MCHAR_TYPE_HEBREW 0x008E
6555 #define MCHAR_TYPE_THAI 0x008F
6556 
6557 #define MCHAR_TYPE_DIGIT 0x0091
6558 #define MCHAR_TYPE_SYMBOL_PUNCT 0x0092
6559 #define MCHAR_TYPE_SYMBOL_MATH 0x0093
6560 #define MCHAR_TYPE_SYMBOL_OTHER 0x0094
6561 #define MCHAR_TYPE_FW_DIGIT 0x0095
6562 #define MCHAR_TYPE_FW_SYM_PUNCT 0x0096
6563 #define MCHAR_TYPE_FW_SYM_MATH 0x0097
6564 #define MCHAR_TYPE_FW_SYM_OTHER 0x0098
6565 
6566 #define MCHAR_TYPE_HANGUL 0x00A1
6567 #define MCHAR_TYPE_KATAKANA 0x00A2
6568 #define MCHAR_TYPE_CJK 0x00A3
6569 #endif
6570 
6609 typedef enum {
6610  UCHAR_CATEGORY_CONTROL,
6611  UCHAR_CATEGORY_FORMAT,
6612  UCHAR_CATEGORY_UNASSIGNED,
6613  UCHAR_CATEGORY_PRIVATE_USE,
6614  UCHAR_CATEGORY_SURROGATE,
6615  UCHAR_CATEGORY_LOWERCASE_LETTER,
6616  UCHAR_CATEGORY_MODIFIER_LETTER,
6617  UCHAR_CATEGORY_OTHER_LETTER,
6618  UCHAR_CATEGORY_TITLECASE_LETTER,
6619  UCHAR_CATEGORY_UPPERCASE_LETTER,
6620  UCHAR_CATEGORY_SPACING_MARK,
6621  UCHAR_CATEGORY_ENCLOSING_MARK,
6622  UCHAR_CATEGORY_NON_SPACING_MARK,
6623  UCHAR_CATEGORY_DECIMAL_NUMBER,
6624  UCHAR_CATEGORY_LETTER_NUMBER,
6625  UCHAR_CATEGORY_OTHER_NUMBER,
6626  UCHAR_CATEGORY_CONNECT_PUNCTUATION,
6627  UCHAR_CATEGORY_DASH_PUNCTUATION,
6628  UCHAR_CATEGORY_CLOSE_PUNCTUATION,
6629  UCHAR_CATEGORY_FINAL_PUNCTUATION,
6630  UCHAR_CATEGORY_INITIAL_PUNCTUATION,
6631  UCHAR_CATEGORY_OTHER_PUNCTUATION,
6632  UCHAR_CATEGORY_OPEN_PUNCTUATION,
6633  UCHAR_CATEGORY_CURRENCY_SYMBOL,
6634  UCHAR_CATEGORY_MODIFIER_SYMBOL,
6635  UCHAR_CATEGORY_MATH_SYMBOL,
6636  UCHAR_CATEGORY_OTHER_SYMBOL,
6637  UCHAR_CATEGORY_LINE_SEPARATOR,
6638  UCHAR_CATEGORY_PARAGRAPH_SEPARATOR,
6639  UCHAR_CATEGORY_SPACE_SEPARATOR
6641 
6696 typedef enum {
6697  UCHAR_BREAK_MANDATORY,
6698  UCHAR_BREAK_CARRIAGE_RETURN,
6699  UCHAR_BREAK_LINE_FEED,
6700  UCHAR_BREAK_COMBINING_MARK,
6701  UCHAR_BREAK_SURROGATE,
6702  UCHAR_BREAK_ZERO_WIDTH_SPACE,
6703  UCHAR_BREAK_INSEPARABLE,
6704  UCHAR_BREAK_NON_BREAKING_GLUE,
6705  UCHAR_BREAK_CONTINGENT,
6706  UCHAR_BREAK_SPACE,
6707  UCHAR_BREAK_AFTER,
6708  UCHAR_BREAK_BEFORE,
6709  UCHAR_BREAK_BEFORE_AND_AFTER,
6710  UCHAR_BREAK_HYPHEN,
6711  UCHAR_BREAK_NON_STARTER,
6712  UCHAR_BREAK_OPEN_PUNCTUATION,
6713  UCHAR_BREAK_CLOSE_PUNCTUATION,
6714  UCHAR_BREAK_QUOTATION,
6715  UCHAR_BREAK_EXCLAMATION,
6716  UCHAR_BREAK_IDEOGRAPHIC,
6717  UCHAR_BREAK_NUMERIC,
6718  UCHAR_BREAK_INFIX_SEPARATOR,
6719  UCHAR_BREAK_SYMBOL,
6720  UCHAR_BREAK_ALPHABETIC,
6721  UCHAR_BREAK_PREFIX,
6722  UCHAR_BREAK_POSTFIX,
6723  UCHAR_BREAK_COMPLEX_CONTEXT,
6724  UCHAR_BREAK_AMBIGUOUS,
6725  UCHAR_BREAK_UNKNOWN,
6726  UCHAR_BREAK_NEXT_LINE,
6727  UCHAR_BREAK_WORD_JOINER,
6728  UCHAR_BREAK_HANGUL_L_JAMO,
6729  UCHAR_BREAK_HANGUL_V_JAMO,
6730  UCHAR_BREAK_HANGUL_T_JAMO,
6731  UCHAR_BREAK_HANGUL_LV_SYLLABLE,
6732  UCHAR_BREAK_HANGUL_LVT_SYLLABLE,
6733  UCHAR_BREAK_CLOSE_PARANTHESIS,
6734  UCHAR_BREAK_CONDITIONAL_JAPANESE_STARTER,
6735  UCHAR_BREAK_HEBREW_LETTER,
6736  UCHAR_BREAK_REGIONAL_INDICATOR,
6737  UCHAR_BREAK_EMOJI_BASE,
6738  UCHAR_BREAK_EMOJI_MODIFIER,
6739  UCHAR_BREAK_ZERO_WIDTH_JOINER
6740 } UCharBreakType;
6741 
6914 typedef enum {
6915  SCRIPT_INVALID_CODE = 0xFF,
6916  SCRIPT_COMMON = 0, /* Zyyy */
6917  SCRIPT_INHERITED, /* Zinh (Qaai) */
6918  SCRIPT_ARABIC, /* Arab */
6919  SCRIPT_ARMENIAN, /* Armn */
6920  SCRIPT_BENGALI, /* Beng */
6921  SCRIPT_BOPOMOFO, /* Bopo */
6922  SCRIPT_CHEROKEE, /* Cher */
6923  SCRIPT_COPTIC, /* Copt (Qaac) */
6924  SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
6925  SCRIPT_DESERET, /* Dsrt */
6926  SCRIPT_DEVANAGARI, /* Deva */
6927  SCRIPT_ETHIOPIC, /* Ethi */
6928  SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
6929  SCRIPT_GOTHIC, /* Goth */
6930  SCRIPT_GREEK, /* Grek */
6931  SCRIPT_GUJARATI, /* Gujr */
6932  SCRIPT_GURMUKHI, /* Guru */
6933  SCRIPT_HAN, /* Hani */
6934  SCRIPT_HANGUL, /* Hang */
6935  SCRIPT_HEBREW, /* Hebr */
6936  SCRIPT_HIRAGANA, /* Hira */
6937  SCRIPT_KANNADA, /* Knda */
6938  SCRIPT_KATAKANA, /* Kana */
6939  SCRIPT_KHMER, /* Khmr */
6940  SCRIPT_LAO, /* Laoo */
6941  SCRIPT_LATIN, /* Latn (Latf, Latg) */
6942  SCRIPT_MALAYALAM, /* Mlym */
6943  SCRIPT_MONGOLIAN, /* Mong */
6944  SCRIPT_MYANMAR, /* Mymr */
6945  SCRIPT_OGHAM, /* Ogam */
6946  SCRIPT_OLD_ITALIC, /* Ital */
6947  SCRIPT_ORIYA, /* Orya */
6948  SCRIPT_RUNIC, /* Runr */
6949  SCRIPT_SINHALA, /* Sinh */
6950  SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
6951  SCRIPT_TAMIL, /* Taml */
6952  SCRIPT_TELUGU, /* Telu */
6953  SCRIPT_THAANA, /* Thaa */
6954  SCRIPT_THAI, /* Thai */
6955  SCRIPT_TIBETAN, /* Tibt */
6956  SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
6957  SCRIPT_YI, /* Yiii */
6958  SCRIPT_TAGALOG, /* Tglg */
6959  SCRIPT_HANUNOO, /* Hano */
6960  SCRIPT_BUHID, /* Buhd */
6961  SCRIPT_TAGBANWA, /* Tagb */
6962 
6963  /* Unicode-4.0 additions */
6964  SCRIPT_BRAILLE, /* Brai */
6965  SCRIPT_CYPRIOT, /* Cprt */
6966  SCRIPT_LIMBU, /* Limb */
6967  SCRIPT_OSMANYA, /* Osma */
6968  SCRIPT_SHAVIAN, /* Shaw */
6969  SCRIPT_LINEAR_B, /* Linb */
6970  SCRIPT_TAI_LE, /* Tale */
6971  SCRIPT_UGARITIC, /* Ugar */
6972 
6973  /* Unicode-4.1 additions */
6974  SCRIPT_NEW_TAI_LUE, /* Talu */
6975  SCRIPT_BUGINESE, /* Bugi */
6976  SCRIPT_GLAGOLITIC, /* Glag */
6977  SCRIPT_TIFINAGH, /* Tfng */
6978  SCRIPT_SYLOTI_NAGRI, /* Sylo */
6979  SCRIPT_OLD_PERSIAN, /* Xpeo */
6980  SCRIPT_KHAROSHTHI, /* Khar */
6981 
6982  /* Unicode-5.0 additions */
6983  SCRIPT_UNKNOWN, /* Zzzz */
6984  SCRIPT_BALINESE, /* Bali */
6985  SCRIPT_CUNEIFORM, /* Xsux */
6986  SCRIPT_PHOENICIAN, /* Phnx */
6987  SCRIPT_PHAGS_PA, /* Phag */
6988  SCRIPT_NKO, /* Nkoo */
6989 
6990  /* Unicode-5.1 additions */
6991  SCRIPT_KAYAH_LI, /* Kali */
6992  SCRIPT_LEPCHA, /* Lepc */
6993  SCRIPT_REJANG, /* Rjng */
6994  SCRIPT_SUNDANESE, /* Sund */
6995  SCRIPT_SAURASHTRA, /* Saur */
6996  SCRIPT_CHAM, /* Cham */
6997  SCRIPT_OL_CHIKI, /* Olck */
6998  SCRIPT_VAI, /* Vaii */
6999  SCRIPT_CARIAN, /* Cari */
7000  SCRIPT_LYCIAN, /* Lyci */
7001  SCRIPT_LYDIAN, /* Lydi */
7002 
7003  /* Unicode-5.2 additions */
7004  SCRIPT_AVESTAN, /* Avst */
7005  SCRIPT_BAMUM, /* Bamu */
7006  SCRIPT_EGYPTIAN_HIEROGLYPHS, /* Egyp */
7007  SCRIPT_IMPERIAL_ARAMAIC, /* Armi */
7008  SCRIPT_INSCRIPTIONAL_PAHLAVI, /* Phli */
7009  SCRIPT_INSCRIPTIONAL_PARTHIAN, /* Prti */
7010  SCRIPT_JAVANESE, /* Java */
7011  SCRIPT_KAITHI, /* Kthi */
7012  SCRIPT_LISU, /* Lisu */
7013  SCRIPT_MEETEI_MAYEK, /* Mtei */
7014  SCRIPT_OLD_SOUTH_ARABIAN, /* Sarb */
7015  SCRIPT_OLD_TURKIC, /* Orkh */
7016  SCRIPT_SAMARITAN, /* Samr */
7017  SCRIPT_TAI_THAM, /* Lana */
7018  SCRIPT_TAI_VIET, /* Tavt */
7019 
7020  /* Unicode-6.0 additions */
7021  SCRIPT_BATAK, /* Batk */
7022  SCRIPT_BRAHMI, /* Brah */
7023  SCRIPT_MANDAIC, /* Mand */
7024 
7025  /* Unicode-6.1 additions */
7026  SCRIPT_CHAKMA, /* Cakm */
7027  SCRIPT_MEROITIC_CURSIVE, /* Merc */
7028  SCRIPT_MEROITIC_HIEROGLYPHS, /* Mero */
7029  SCRIPT_MIAO, /* Plrd */
7030  SCRIPT_SHARADA, /* Shrd */
7031  SCRIPT_SORA_SOMPENG, /* Sora */
7032  SCRIPT_TAKRI, /* Takr */
7033 
7034  /* Unicode 7.0 additions */
7035  SCRIPT_BASSA_VAH, /* Bass */
7036  SCRIPT_CAUCASIAN_ALBANIAN, /* Aghb */
7037  SCRIPT_DUPLOYAN, /* Dupl */
7038  SCRIPT_ELBASAN, /* Elba */
7039  SCRIPT_GRANTHA, /* Gran */
7040  SCRIPT_KHOJKI, /* Khoj */
7041  SCRIPT_KHUDAWADI, /* Sind */
7042  SCRIPT_LINEAR_A, /* Lina */
7043  SCRIPT_MAHAJANI, /* Mahj */
7044  SCRIPT_MANICHAEAN, /* Manu */
7045  SCRIPT_MENDE_KIKAKUI, /* Mend */
7046  SCRIPT_MODI, /* Modi */
7047  SCRIPT_MRO, /* Mroo */
7048  SCRIPT_NABATAEAN, /* Nbat */
7049  SCRIPT_OLD_NORTH_ARABIAN, /* Narb */
7050  SCRIPT_OLD_PERMIC, /* Perm */
7051  SCRIPT_PAHAWH_HMONG, /* Hmng */
7052  SCRIPT_PALMYRENE, /* Palm */
7053  SCRIPT_PAU_CIN_HAU, /* Pauc */
7054  SCRIPT_PSALTER_PAHLAVI, /* Phlp */
7055  SCRIPT_SIDDHAM, /* Sidd */
7056  SCRIPT_TIRHUTA, /* Tirh */
7057  SCRIPT_WARANG_CITI, /* Wara */
7058 
7059  /* Unicode 8.0 additions */
7060  SCRIPT_AHOM, /* Ahom */
7061  SCRIPT_ANATOLIAN_HIEROGLYPHS, /* Hluw */
7062  SCRIPT_HATRAN, /* Hatr */
7063  SCRIPT_MULTANI, /* Mult */
7064  SCRIPT_OLD_HUNGARIAN, /* Hung */
7065  SCRIPT_SIGNWRITING, /* Sgnw */
7066 
7067  /* Unicode 9.0 additions */
7068  SCRIPT_ADLAM, /* Adlm */
7069  SCRIPT_BHAIKSUKI, /* Bhks */
7070  SCRIPT_MARCHEN, /* Marc */
7071  SCRIPT_NEWA, /* Newa */
7072  SCRIPT_OSAGE, /* Osge */
7073  SCRIPT_TANGUT, /* Tang */
7074 
7075  /* Unicode 10.0 additions */
7076  SCRIPT_MASARAM_GONDI, /* Gonm */
7077  SCRIPT_NUSHU, /* Nshu */
7078  SCRIPT_SOYOMBO, /* Soyo */
7079  SCRIPT_ZANABAZAR_SQUARE, /* Zanb */
7080 
7081  /* Unicode 11.0 additions */
7082  SCRIPT_DOGRA, /* Dogr */
7083  SCRIPT_GUNJALA_GONDI, /* Gong */
7084  SCRIPT_HANIFI_ROHINGYA, /* Rohg */
7085  SCRIPT_MAKASAR, /* Maka */
7086  SCRIPT_MEDEFAIDRIN, /* Medf */
7087  SCRIPT_OLD_SOGDIAN, /* Sogo */
7088  SCRIPT_SOGDIAN, /* Sogd */
7089 
7090  /* Unicode 12.0 additions */
7091  SCRIPT_ELYMAIC, /* Elymaic */
7092  SCRIPT_NANDINAGARI, /* Nandinagari */
7093  SCRIPT_NYIAKENG_PUACHUE_HMONG, /* Nyiakeng Puachue Hmong */
7094  SCRIPT_WANCHO, /* Wancho */
7095 } ScriptType;
7096 
7110 typedef enum {
7399 } LanguageCode;
7400 
7417 MG_EXPORT LanguageCode GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1);
7418 
7432 static inline LanguageCode GUIAPI LanguageCodeFromISO639s1Code(const char* iso639_1)
7433 {
7434  return LanguageCodeFromISO639s1(MAKEWORD16(iso639_1[1],
7435  iso639_1[0]));
7436 }
7437 
7439 MG_EXPORT const char* GUIAPI LanguageCodeToISO639s1(LanguageCode lc);
7440 
7442 MG_EXPORT LanguageCode GUIAPI GetSampleLanguageForScript(ScriptType st);
7443 
7445 MG_EXPORT const ScriptType* GUIAPI GetScriptsForLang(const char* lang_name,
7446  LanguageCode* lang_code, int* nr_scripts);
7447 
7449 MG_EXPORT ScriptType GUIAPI NormalizeScriptType(LanguageCode cl,
7450  ScriptType ws);
7451 
7454 struct _FONTOPS;
7455 struct _CHARSETOPS;
7456 
7457 typedef struct _FONTOPS FONTOPS;
7458 typedef struct _CHARSETOPS CHARSETOPS;
7459 
7464 struct _DEVFONT {
7475  char name [LEN_UNIDEVFONT_NAME + 1];
7476 
7479 
7480  /*
7481  * The following fields are internally used.
7482  * They may changed in the future.
7483  */
7484  // indicating if the data need to be unloaded before delete a devfont
7485  BOOL need_unload;
7486 
7487  // The pointer to font operation structure.
7488  FONTOPS* font_ops;
7489 
7490  // The pointer to character set operation structure.
7491  CHARSETOPS* charset_ops;
7492 
7493  // The pointer to next device font.
7494  struct _DEVFONT* next;
7495 
7496  // The device font used data.
7497  void* data;
7498 
7499  // The device font used relationship.
7500  void* relationship;
7501 };
7502 
7507 #define INV_LOGFONT 0
7508 
7510 typedef struct _FONTMETRICS {
7514  int ascent;
7516  int descent;
7517 
7522 } FONTMETRICS;
7523 
7538 MG_EXPORT void GUIAPI GetFontMetrics (LOGFONT* log_font,
7539  FONTMETRICS* font_metrics);
7540 
7542 typedef struct _GLYPHBITMAP {
7544  int bbox_x, bbox_y, bbox_w, bbox_h;
7546  int advance_x, advance_y;
7547 
7549  size_t bmp_size;
7553  const unsigned char* bits;
7554 } GLYPHBITMAP;
7555 
7585 MG_EXPORT void GUIAPI GetGlyphBitmap (LOGFONT* log_font,
7586  const char* mchar, int mchar_len,
7587  GLYPHBITMAP* glyph_bitmap);
7588 
7607 static inline BOOL GUIAPI InitVectorialFonts (void)
7608 {
7609  _WRN_PRINTF("deprecated\n");
7610  return TRUE;
7611 }
7612 
7627 static inline void GUIAPI TermVectorialFonts (void)
7628 {
7629  _WRN_PRINTF("deprecated\n");
7630 }
7631 
7756 MG_EXPORT PLOGFONT GUIAPI CreateLogFont (const char* type, const char* family,
7757  const char* charset, char weight, char slant, char flip,
7758  char other, char underline, char struckout,
7759  int size, int rotation);
7760 
7890 MG_EXPORT PLOGFONT GUIAPI CreateLogFontEx (const char* type, const char* family,
7891  const char* charset, char weight, char slant, char flip,
7892  char other, char decoration, char rendering,
7893  int size, int rotation);
7894 
7925 MG_EXPORT PLOGFONT GUIAPI CreateLogFontByName(const char* font_name);
7926 
7927 #ifdef _MGCHARSET_UNICODE
7928 
7945 MG_EXPORT PLOGFONT GUIAPI CreateLogFontForMChar2UChar(const char* charset);
7946 #endif /* _MGCHARSET_UNICODE */
7947 
7959 MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirect (LOGFONT* logfont);
7960 
7982 MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirectEx (LOGFONT* logfont,
7983  int rotation);
7984 
7995 MG_EXPORT void GUIAPI DestroyLogFont (PLOGFONT log_font);
7996 
8010 MG_EXPORT void GUIAPI GetLogFontInfo (HDC hdc, LOGFONT* log_font);
8011 
8024 MG_EXPORT PLOGFONT GUIAPI GetCurFont (HDC hdc);
8025 
8044 MG_EXPORT PLOGFONT GUIAPI SelectFont (HDC hdc, PLOGFONT log_font);
8045 
8056 MG_EXPORT const DEVFONT* GUIAPI GetNextDevFont (const DEVFONT* dev_font);
8057 
8058 #ifdef _MGFONT_FT2
8059 
8064 typedef enum {
8074  MG_SMOOTH_MAX /*do not remove*/
8075 } FT2LCDFilter;
8076 
8092 MG_EXPORT BOOL GUIAPI ft2SetLcdFilter (LOGFONT* logfont, FT2LCDFilter filter);
8093 
8094 #endif
8095 
8110 MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromIncoreData (const char *devfont_name,
8111  const void *data);
8112 
8129 MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name,
8130  const char *file_name);
8131 
8141 MG_EXPORT void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont);
8142 
8161 #define SYSLOGFONT_DEFAULT 0
8162 
8167 #define SYSLOGFONT_WCHAR_DEF 1
8168 
8173 #define SYSLOGFONT_FIXED 2
8174 
8179 #define SYSLOGFONT_CAPTION 3
8180 
8185 #define SYSLOGFONT_MENU 4
8186 
8191 #define SYSLOGFONT_CONTROL 5
8192 
8193 #define NR_SYSLOGFONTS 6
8194 
8195 
8196 extern MG_EXPORT PLOGFONT g_SysLogFont [];
8197 
8221 static inline PLOGFONT GUIAPI GetSystemFont (int font_id)
8222 {
8223  if (font_id >= 0 && font_id < NR_SYSLOGFONTS)
8224  return g_SysLogFont [font_id];
8225  else
8226  return (PLOGFONT)NULL;
8227 }
8228 
8243 MG_EXPORT int GUIAPI GetSysFontMaxWidth (int font_id);
8244 
8259 MG_EXPORT int GUIAPI GetSysFontAveWidth (int font_id);
8260 
8274 MG_EXPORT int GUIAPI GetSysFontHeight (int font_id);
8275 
8290 MG_EXPORT const char* GUIAPI GetSysCharset (BOOL wchar);
8291 
8306 MG_EXPORT int GUIAPI GetSysCharHeight (void);
8307 
8321 MG_EXPORT int GUIAPI GetSysCharWidth (void);
8322 
8334 MG_EXPORT int GUIAPI GetSysCCharWidth (void);
8335 
8350 {
8352  int len;
8354  unsigned char delimiter;
8357 };
8358 
8378 MG_EXPORT int GUIAPI GetTextMCharInfo (PLOGFONT log_font,
8379  const char* mstr, int len, int* pos_chars);
8380 
8404 MG_EXPORT int GUIAPI GetTextWordInfo (PLOGFONT log_font, const char* mstr,
8405  int len, int* pos_words, WORDINFO* info_words);
8406 
8422 MG_EXPORT int GUIAPI GetFirstMCharLen (PLOGFONT log_font,
8423  const char* mstr, int len);
8424 
8445 MG_EXPORT int GUIAPI GetFirstWord (PLOGFONT log_font,
8446  const char* mstr, int len, WORDINFO* word_info);
8447 
8479 MG_EXPORT int GUIAPI GetTextExtentPoint (HDC hdc, const char* text, int len,
8480  int max_extent, int* fit_chars, int* pos_chars,
8481  int* dx_chars, SIZE* size);
8482 
8491 MG_EXPORT int GUIAPI GetTabbedTextExtentPoint (HDC hdc,
8492  const char* text, int len, int max_extent,
8493  int* fit_chars, int* pos_chars, int* dx_chars, SIZE* size);
8494 
8495 #ifdef _MGCHARSET_UNICODE
8496 
8517 MG_EXPORT int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32,
8518  const unsigned char* mstr, int n);
8519 
8526 #define MB2WC(log_font, dest, mstr, n) \
8527  MB2WCEx (log_font, dest, sizeof(wchar_t) == 4, mstr, n)
8528 
8546 MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, Uchar32 wc);
8547 
8554 #define WC2MB(log_font, s, wc) \
8555  WC2MBEx (log_font, s, (Uchar32)wc)
8556 
8589 MG_EXPORT int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32,
8590  const unsigned char* mstr, int mstr_len, int n,
8591  int* conved_mstr_len);
8592 
8599 #define MBS2WCS(log_font, dest, mstr, mstr_len, n) \
8600  MBS2WCSEx(log_font, dest, sizeof (wchar_t) == 4, mstr, \
8601  mstr_len, n, NULL)
8602 
8635 MG_EXPORT int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest,
8636  const void *wcs, int wcs_len, BOOL wc32, int n,
8637  int* conved_wcs_len);
8638 
8645 #define WCS2MBS(log_font, dest, wcs, wcs_len, n) \
8646  WCS2MBSEx (log_font, dest, wcs, wcs_len, sizeof (wchar_t) == 4, \
8647  n, NULL)
8648 
8649 #endif /* _MGCHARSET_UNICODE */
8650 
8673 
8682 
8694 
8695 #define BIDI_FLAG_SHAPE_MIRRORING 0x00000001
8696 #define BIDI_FLAG_REORDER_NSM 0x00000002
8697 #define BIDI_FLAG_SHAPE_ARAB_PRES 0x00000100
8698 #define BIDI_FLAG_SHAPE_ARAB_LIGA 0x00000200
8699 #define BIDI_FLAG_SHAPE_ARAB_CONSOLE 0x00000400
8700 
8701 #define BIDI_FLAGS_DEFAULT \
8702  (BIDI_FLAG_REORDER_NSM | BIDI_FLAG_REMOVE_SPECIALS)
8703 
8704 #define BIDI_FLAGS_ARABIC \
8705  (BIDI_FLAG_SHAPE_ARAB_PRES | BIDI_FLAG_SHAPE_ARAB_LIGA)
8706 
8707 #define BIDI_FLAG_REMOVE_BIDI 0x00010000
8708 #define BIDI_FLAG_REMOVE_JOINING 0x00020000
8709 #define BIDI_FLAG_REMOVE_SPECIALS 0x00040000
8710 
8711 #define BIDI_BRACKET_NONE 0
8712 #define BIDI_BRACKET_OPEN_MASK 0x80000000
8713 #define BIDI_BRACKET_CHAR_MASK 0X7FFFFFFF
8714 #define BIDI_IS_BRACKET_OPEN(bt) ((bt & BIDI_BRACKET_OPEN_MASK)>0)
8715 #define BIDI_BRACKET_CHAR(bt) ((bt & BIDI_BRACKET_CHAR_MASK))
8716 
8717 /*
8718  * Define some bit masks, that character types are based on, each one has
8719  * only one bit on.
8720  */
8721 
8722 #define BIDI_TYPE_INVALID 0x0000
8723 
8724 #define BIDI_MASK_RTL 0x0001 /* Is right to left */
8725 #define BIDI_MASK_ARABIC 0x0002 /* Is arabic */
8726 #define BIDI_MASK_FIRST 0x0004 /* Is direction is determined by first strong */
8727 #define BIDI_MASK_SEPARATOR 0x0008 /* Is separator: BS, SS */
8728 
8729 #define BIDI_MASK_STRONG 0x0010 /* Is strong */
8730 #define BIDI_MASK_WEAK 0x0020 /* Is weak */
8731 #define BIDI_MASK_NEUTRAL 0x0040 /* Is neutral */
8732 #define BIDI_MASK_SENTINEL 0x0080 /* Is sentinel: SOT, EOT */
8733 
8734 /* Each char can be only one of the seven following: */
8735 #define BIDI_MASK_LETTER 0x0100 /* Is letter: L, R, AL */
8736 #define BIDI_MASK_NUMBER 0x0200 /* Is number: EN, AN */
8737 #define BIDI_MASK_NUMSEPTER 0x0300 /* Is number separator or terminator: ES, ET, CS */
8738 #define BIDI_MASK_SPACE 0x0400 /* Is space: BN, BS, SS, WS */
8739 #define BIDI_MASK_EXPLICIT 0x0500 /* Is expilict mark: LRE, RLE, LRO, RLO, PDF */
8740 #define BIDI_MASK_ISOLATE 0x0600 /* Is isolate mark: LRI, RLI, FSI, PDI */
8741 #define BIDI_MASK_NSM 0x0700 /* Is non spacing mark: NSM */
8742 # define BIDI_TYPE_MASK 0x0700
8743 
8744 #define BIDI_MASK_OVERRIDE 0x8000 /* Is explicit override: LRO, RLO */
8745 
8746 /* Each char can be only one of the seven following: */
8747 #define BIDI_MASK_ES 0x1000
8748 #define BIDI_MASK_CS 0x2000
8749 #define BIDI_MASK_ET 0x3000
8750 #define BIDI_MASK_BS 0x4000
8751 #define BIDI_MASK_SS 0x5000
8752 #define BIDI_MASK_BN 0x6000
8753 #define BIDI_MASK_WS 0x7000
8754 # define BIDI_MISC_MASK 0x7000
8755 
8756 /* Reserved for private use */
8757 #define BIDI_MASK_PRIVATE 0x8000
8758 
8763 #define BIDI_TYPE_LTR \
8764  (BIDI_MASK_STRONG | BIDI_MASK_LETTER)
8765 
8770 #define BIDI_TYPE_RTL \
8771  (BIDI_MASK_STRONG | BIDI_MASK_LETTER | BIDI_MASK_RTL)
8772 
8777 #define BIDI_TYPE_AL \
8778  (BIDI_MASK_STRONG | BIDI_MASK_LETTER | BIDI_MASK_RTL | BIDI_MASK_ARABIC)
8779 
8784 #define BIDI_TYPE_LRE \
8785  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT)
8786 
8791 #define BIDI_TYPE_RLE \
8792  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_RTL)
8793 
8798 #define BIDI_TYPE_LRO \
8799  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_OVERRIDE)
8800 
8805 #define BIDI_TYPE_RLO \
8806  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_RTL | BIDI_MASK_OVERRIDE)
8807 
8812 #define BIDI_TYPE_PDF \
8813  (BIDI_MASK_WEAK | BIDI_MASK_EXPLICIT)
8814 
8819 #define BIDI_TYPE_EN \
8820  (BIDI_MASK_WEAK | BIDI_MASK_NUMBER)
8821 
8826 #define BIDI_TYPE_AN \
8827  (BIDI_MASK_WEAK | BIDI_MASK_NUMBER | BIDI_MASK_ARABIC)
8828 
8833 #define BIDI_TYPE_ES \
8834  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_ES)
8835 
8840 #define BIDI_TYPE_ET \
8841  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_ET)
8842 
8847 #define BIDI_TYPE_CS \
8848  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_CS)
8849 
8854 #define BIDI_TYPE_NSM \
8855  (BIDI_MASK_WEAK | BIDI_MASK_NSM)
8856 
8861 #define BIDI_TYPE_BN \
8862  (BIDI_MASK_WEAK | BIDI_MASK_SPACE | BIDI_MASK_BN)
8863 
8868 #define BIDI_TYPE_BS \
8869  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_SEPARATOR | BIDI_MASK_BS)
8870 
8875 #define BIDI_TYPE_SS \
8876  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_SEPARATOR | BIDI_MASK_SS)
8877 
8882 #define BIDI_TYPE_WS \
8883  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_WS)
8884 
8889 #define BIDI_TYPE_ON \
8890  (BIDI_MASK_NEUTRAL)
8891 
8896 #define BIDI_TYPE_LRI \
8897  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE)
8898 
8903 #define BIDI_TYPE_RLI \
8904  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE | BIDI_MASK_RTL)
8905 
8910 #define BIDI_TYPE_FSI \
8911  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE | BIDI_MASK_FIRST)
8912 
8917 #define BIDI_TYPE_PDI \
8918  (BIDI_MASK_NEUTRAL | BIDI_MASK_WEAK | BIDI_MASK_ISOLATE)
8919 
8920 #define BIDI_TYPE_SENTINEL (BIDI_MASK_SENTINEL)
8921 
8922 /* The following are only used internally */
8923 
8924 /* Weak Left-To-Right */
8925 #define BIDI_TYPE_WLTR (BIDI_MASK_WEAK)
8926 /* Weak Right-To-Left */
8927 #define BIDI_TYPE_WRTL (BIDI_MASK_WEAK | BIDI_MASK_RTL)
8928 
8929 /* Start of text */
8930 #define BIDI_TYPE_SOT (BIDI_MASK_SENTINEL)
8931 /* End of text */
8932 #define BIDI_TYPE_EOT (BIDI_MASK_SENTINEL | BIDI_MASK_RTL)
8933 
8934 #define BIDI_TYPE_PRIVATE (BIDI_MASK_PRIVATE)
8935 
8936 /* Is private-use value? */
8937 #define BIDI_IS_PRIVATE(p) ((p) & BIDI_MASK_PRIVATE)
8938 
8939 /* Is right to left? */
8940 #define BIDI_IS_RTL(p) ((p) & BIDI_MASK_RTL)
8941 
8942 /* Is arabic? */
8943 #define BIDI_IS_ARABIC(p) ((p) & BIDI_MASK_ARABIC)
8944 
8945 /* Is right-to-left level? */
8946 #define BIDI_LEVEL_IS_RTL(lev) ((lev) & 1)
8947 
8948 /* Return the bidi type corresponding to the direction of the level number,
8949  BIDI_TYPE_LTR for evens and BIDI_TYPE_RTL for odds. */
8950 #define BIDI_LEVEL_TO_DIR(lev) \
8951  (BIDI_LEVEL_IS_RTL(lev) ? BIDI_TYPE_RTL : BIDI_TYPE_LTR)
8952 
8953 /* Return the minimum level of the direction, 0 for BIDI_TYPE_LTR and
8954  1 for BIDI_TYPE_RTL and BIDI_TYPE_AL. */
8955 #define BIDI_DIR_TO_LEVEL(dir) \
8956  ((BidiLevel) (BIDI_IS_RTL(dir) ? 1 : 0))
8957 
8958 /* Is strong? */
8959 #define BIDI_IS_STRONG(p) ((p) & BIDI_MASK_STRONG)
8960 /* Is weak? */
8961 #define BIDI_IS_WEAK(p) ((p) & BIDI_MASK_WEAK)
8962 /* Is neutral? */
8963 #define BIDI_IS_NEUTRAL(p) ((p) & BIDI_MASK_NEUTRAL)
8964 /* Is sentinel? */
8965 #define BIDI_IS_SENTINEL(p) ((p) & BIDI_MASK_SENTINEL)
8966 
8967 /* Is letter: L, R, AL? */
8968 #define BIDI_IS_LETTER(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_LETTER)
8969 
8970 /* Is number: EN, AN? */
8971 #define BIDI_IS_NUMBER(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NUMBER)
8972 
8973 /* Is number separator or terminator: ES, ET, CS? */
8974 #define BIDI_IS_NUMBER_SEPARATOR_OR_TERMINATOR(p) \
8975  (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NUMSEPTER)
8976 
8977 /* Is space: BN, BS, SS, WS? */
8978 #define BIDI_IS_SPACE(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_SPACE)
8979 /* Is explicit mark: LRE, RLE, LRO, RLO, PDF? */
8980 #define BIDI_IS_EXPLICIT(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT)
8981 
8982 /* Is test separator: BS, SS? */
8983 #define BIDI_IS_SEPARATOR(p) ((p) & BIDI_MASK_SEPARATOR)
8984 
8985 /* Is explicit override: LRO, RLO? */
8986 #define BIDI_IS_OVERRIDE(p) ((p) & BIDI_MASK_OVERRIDE)
8987 
8988 /* Is isolote: LRO, RLO? */
8989 #define BIDI_IS_ISOLATE(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_ISOLATE)
8990 
8991 /* Is left to right letter: LTR? */
8992 #define BIDI_IS_LTR_LETTER(p) \
8993  ((p) & (BIDI_MASK_LETTER | BIDI_MASK_RTL) == BIDI_MASK_LETTER)
8994 
8995 /* Is right to left letter: RTL, AL? */
8996 #define BIDI_IS_RTL_LETTER(p) \
8997  ((p) & (BIDI_MASK_LETTER | BIDI_MASK_RTL) \
8998  == (BIDI_MASK_LETTER | BIDI_MASK_RTL))
8999 
9000 /* Is ES or CS: ES, CS? */
9001 #define BIDI_IS_ES_OR_CS(p) \
9002  (((p) & BIDI_MISC_MASK) == BIDI_MASK_ES || \
9003  ((p) & BIDI_MISC_MASK) == BIDI_MASK_CS)
9004 
9005 /* Change numbers: EN, AN to RTL. */
9006 #define BIDI_NUMBER_TO_RTL(p) \
9007  (BIDI_IS_NUMBER(p) ? BIDI_TYPE_RTL : (p))
9008 
9009 /* Is explicit or BN: LRE, RLE, LRO, RLO, PDF, BN? */
9010 #define BIDI_IS_EXPLICIT_OR_BN(p) \
9011  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
9012  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN))
9013 
9014 /* Is explicit or BN or WS: LRE, RLE, LRO, RLO, PDF, BN, WS? */
9015 #define BIDI_IS_EXPLICIT_OR_BN_OR_WS(p) \
9016  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
9017  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN) || \
9018  (((p) & BIDI_MISC_MASK) == BIDI_MASK_WS))
9019 
9020 /* Is explicit or separator or BN or WS: LRE, RLE, LRO, RLO, PDF, BS, SS, BN, WS? */
9021 #define BIDI_IS_EXPLICIT_OR_SEPARATOR_OR_BN_OR_WS(p) \
9022  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
9023  ((p) & BIDI_MASK_SEPARATOR) || \
9024  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN) || \
9025  (((p) & BIDI_MISC_MASK) == BIDI_MASK_WS))
9026 
9027 /* Is explicit or BN or NSM: LRE, RLE, LRO, RLO, PDF, BN, NSM? */
9028 #define BIDI_IS_EXPLICIT_OR_BN_OR_NSM(p) \
9029  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
9030  (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NSM) || \
9031  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN))
9032 
9033 /* Override status of an explicit mark:
9034  * LRO,LRE->LTR, RLO,RLE->RTL, otherwise->ON. */
9035 #define BIDI_EXPLICIT_TO_OVERRIDE_DIR(p) \
9036  (BIDI_IS_OVERRIDE(p) ? BIDI_LEVEL_TO_DIR(BIDI_DIR_TO_LEVEL(p)) \
9037  : BIDI_TYPE_ON)
9038 
9039 /* Change numbers to RTL: EN,AN -> RTL. */
9040 #define BIDI_CHANGE_NUMBER_TO_RTL(p) \
9041  (BIDI_IS_NUMBER(p) ? BIDI_TYPE_RTL : (p))
9042 
9043 #define BIDI_PGDIR_LTR BIDI_TYPE_LTR
9044 #define BIDI_PGDIR_RTL BIDI_TYPE_RTL
9045 #define BIDI_PGDIR_WLTR BIDI_TYPE_WLTR
9046 #define BIDI_PGDIR_WRTL BIDI_TYPE_WRTL
9047 #define BIDI_PGDIR_ON BIDI_TYPE_ON
9048 
9049 /*
9050  * Define bit masks that joining types are based on, each mask has
9051  * only one bit set.
9052  */
9053 #define BIDI_MASK_JOINS_RIGHT 0x01 /* May join to right */
9054 #define BIDI_MASK_JOINS_LEFT 0x02 /* May join to right */
9055 #define BIDI_MASK_ARAB_SHAPES 0x04 /* May Arabic shape */
9056 #define BIDI_MASK_TRANSPARENT 0x08 /* Is transparent */
9057 #define BIDI_MASK_IGNORED 0x10 /* Is ignored */
9058 #define BIDI_MASK_LIGATURED 0x20 /* Is ligatured */
9059 
9060 /*
9061  * Define values for BidiJoiningType
9062  */
9063 
9064 /* nUn-joining */
9065 #define BIDI_JOINING_TYPE_U_VAL ( 0 )
9066 
9067 /* Right-joining */
9068 #define BIDI_JOINING_TYPE_R_VAL \
9069  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_ARAB_SHAPES )
9070 
9071 /* Dual-joining */
9072 #define BIDI_JOINING_TYPE_D_VAL \
9073  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
9074  | BIDI_MASK_ARAB_SHAPES )
9075 
9076 /* join-Causing */
9077 #define BIDI_JOINING_TYPE_C_VAL \
9078  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT )
9079 
9080 /* Left-joining */
9081 #define BIDI_JOINING_TYPE_L_VAL \
9082  ( BIDI_MASK_JOINS_LEFT | BIDI_MASK_ARAB_SHAPES )
9083 
9084 /* Transparent */
9085 #define BIDI_JOINING_TYPE_T_VAL \
9086  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_ARAB_SHAPES )
9087 
9088 /* iGnored */
9089 #define BIDI_JOINING_TYPE_G_VAL ( BIDI_MASK_IGNORED )
9090 
9091 /*
9092  * The equivalent of JoiningType values for ArabicProp
9093  */
9094 
9095 /* Primary Arabic Joining Classes (Table 8-2) */
9096 
9097 /* nUn-joining */
9098 #define BIDI_IS_JOINING_TYPE_U(p) \
9099  ( 0 == ( (p) & \
9100  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9101  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
9102 
9103 /* Right-joining */
9104 #define BIDI_IS_JOINING_TYPE_R(p) \
9105  ( BIDI_MASK_JOINS_RIGHT == ( (p) & \
9106  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9107  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
9108 
9109 /* Dual-joining */
9110 #define BIDI_IS_JOINING_TYPE_D(p) \
9111  ( ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
9112  | BIDI_MASK_ARAB_SHAPES ) == ( (p) & \
9113  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9114  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
9115  | BIDI_MASK_ARAB_SHAPES ) ) )
9116 
9117 /* join-Causing */
9118 #define BIDI_IS_JOINING_TYPE_C(p) \
9119  ( ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) == ( (p) & \
9120  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9121  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
9122  | BIDI_MASK_ARAB_SHAPES ) ) )
9123 
9124 /* Left-joining */
9125 #define BIDI_IS_JOINING_TYPE_L(p) \
9126  ( BIDI_MASK_JOINS_LEFT == ( (p) & \
9127  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9128  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
9129 
9130 /* Transparent */
9131 #define BIDI_IS_JOINING_TYPE_T(p) \
9132  ( BIDI_MASK_TRANSPARENT == ( (p) & \
9133  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED ) ) )
9134 
9135 /* iGnored */
9136 #define BIDI_IS_JOINING_TYPE_G(p) \
9137  ( BIDI_MASK_IGNORED == ( (p) & \
9138  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED ) ) )
9139 
9140 /* and for Derived Arabic Joining Classes (Table 8-3) */
9141 
9142 /* Right join-Causing */
9143 #define BIDI_IS_JOINING_TYPE_RC(p) \
9144  ( BIDI_MASK_JOINS_RIGHT == ( (p) & \
9145  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9146  | BIDI_MASK_JOINS_RIGHT ) ) )
9147 
9148 /* Left join-Causing */
9149 #define BIDI_IS_JOINING_TYPE_LC(p) \
9150  ( BIDI_MASK_JOINS_LEFT == ( (p) & \
9151  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9152  | BIDI_MASK_JOINS_LEFT ) ) )
9153 
9154 /*
9155  * Defining macros for needed queries, It is fully dependent on the
9156  * implementation of BidiJoiningType.
9157  */
9158 
9159 /* Joins to right: R, D, C? */
9160 #define BIDI_JOINS_RIGHT(p) ((p) & BIDI_MASK_JOINS_RIGHT)
9161 
9162 /* Joins to left: L, D, C? */
9163 #define BIDI_JOINS_LEFT(p) ((p) & BIDI_MASK_JOINS_LEFT)
9164 
9165 /* May shape: R, D, L, T? */
9166 #define BIDI_ARAB_SHAPES(p) ((p) & BIDI_MASK_ARAB_SHAPES)
9167 
9168 /* Is skipped in joining: T, G? */
9169 #define BIDI_IS_JOIN_SKIPPED(p) \
9170  ((p) & (BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED))
9171 
9172 /* Is base that will be shaped: R, D, L? */
9173 #define BIDI_IS_JOIN_BASE_SHAPES(p) \
9174  ( BIDI_MASK_ARAB_SHAPES == ( (p) & \
9175  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9176  | BIDI_MASK_ARAB_SHAPES ) ) )
9177 
9178 #define BIDI_JOINS_PRECEDING_MASK(level) \
9179  (BIDI_LEVEL_IS_RTL (level) ? BIDI_MASK_JOINS_RIGHT \
9180  : BIDI_MASK_JOINS_LEFT)
9181 
9182 #define BIDI_JOINS_FOLLOWING_MASK(level) \
9183  (BIDI_LEVEL_IS_RTL (level) ? BIDI_MASK_JOINS_LEFT \
9184  : BIDI_MASK_JOINS_RIGHT)
9185 
9186 #define BIDI_JOIN_SHAPE(p) \
9187  ((p) & ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ))
9188 
9191 #ifdef _MGCHARSET_UNICODE
9192 
9214 MG_EXPORT UCharGeneralCategory GUIAPI UCharGetCategory(Uchar32 uc);
9215 
9231 MG_EXPORT UCharBreakType GUIAPI UCharGetBreakType(Uchar32 uc);
9232 
9251 MG_EXPORT BidiType GUIAPI UCharGetBidiType(Uchar32 uc);
9252 
9269 MG_EXPORT void GUIAPI UStrGetBidiTypes(const Uchar32* ucs, int nr_ucs,
9270  BidiType* bdts);
9271 
9297 MG_EXPORT BidiBracketType GUIAPI UCharGetBracketType(Uchar32 ch);
9298 
9319 MG_EXPORT void GUIAPI UStrGetBracketTypes(const Uchar32 *ucs,
9320  const BidiType *bidi_types, int len_ucs,
9321  BidiBracketType *bracket_types);
9322 
9345 MG_EXPORT BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32* mirrored);
9346 
9371 MG_EXPORT BidiJoiningType GUIAPI UCharGetJoiningType(Uchar32 uc);
9372 
9391 MG_EXPORT void GUIAPI UStrGetJoiningTypes(const Uchar32 *ucs, int nr_ucs,
9392  BidiJoiningType *joining_types);
9393 
9420 MG_EXPORT BidiType GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len);
9421 
9461 MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevels(
9462  const BidiType *bidi_types,
9463  const BidiBracketType* bracket_types, int len,
9464  ParagraphDir *paragraph_dir, BidiLevel *embedding_levels);
9465 
9501 MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevelsAlt(
9502  const Uchar32* ucs, int nr_ucs,
9503  ParagraphDir *paragraph_dir, BidiLevel *embedding_levels);
9504 
9505 /*
9506  * \var typedef void (*CB_REVERSE_ARRAY) (void* extra, int len, int pos)
9507  * \brief The prototype of the user defined function to reverse an array.
9508  *
9509  * The function reverse an array pointed by \a extra from the position
9510  * specified by \a pos for the length specified by \a len.
9511  *
9512  * \sa UBidiReorderLine, BIDILogAChars2VisACharsEx
9513  */
9514 typedef void (*CB_REVERSE_ARRAY) (void* extra, int len, int pos);
9515 
9575 MG_EXPORT BidiLevel GUIAPI UBidiReorderLine(Uint32 bidi_flags,
9576  const BidiType *bidi_types, int len, int off,
9577  ParagraphDir paragraph_dir, BidiLevel *embedding_levels,
9578  Uchar32 *visual_str, int *indices_map,
9579  void* extra, CB_REVERSE_ARRAY cb_reverse_extra);
9580 
9603 MG_EXPORT void GUIAPI UBidiShapeMirroring(const BidiLevel *embedding_levels,
9604  int len, Uchar32* ucs);
9605 
9639 MG_EXPORT void GUIAPI UBidiJoinArabic(const BidiType *bidi_types,
9640  const BidiLevel *embedding_levels, int len,
9641  BidiArabicProp *ar_props);
9642 
9680 MG_EXPORT void GUIAPI UBidiShapeArabic(Uint32 shaping_flags,
9681  const BidiLevel *embedding_levels, int len,
9682  BidiArabicProp *ar_props, Uchar32* ucs);
9683 
9716 MG_EXPORT void GUIAPI UBidiShape(Uint32 shaping_flags,
9717  const BidiLevel *embedding_levels, int len,
9718  BidiArabicProp *ar_props, Uchar32* ucs);
9719 
9738 #define CTR_NONE 0x00
9739 
9740 #define CTR_CASE_MASK 0x0F
9741 
9748 #define CTR_CAPITALIZE 0x01
9749 
9755 #define CTR_UPPERCASE 0x02
9756 
9762 #define CTR_LOWERCASE 0x03
9763 
9772 #define CTR_FULL_WIDTH 0x10
9773 
9783 #define CTR_FULL_SIZE_KANA 0x20
9784 
9802 #define WBR_NORMAL 0x00
9803 
9809 #define WBR_BREAK_ALL 0x01
9810 
9816 #define WBR_KEEP_ALL 0x02
9817 
9835 #define LBP_NORMAL 0x00
9836 
9843 #define LBP_LOOSE 0x01
9844 
9850 #define LBP_STRICT 0x02
9851 
9862 #define LBP_ANYWHERE 0x03
9863 
9882 #define BOV_UNKNOWN 0x0000
9883 
9886 #define BOV_WHITESPACE 0x8000
9887 
9890 #define BOV_EXPANDABLE_SPACE 0x0800
9891 
9895 #define BOV_ZERO_WIDTH 0x0080
9896 
9897 #define BOV_GB_MASK 0x7000
9898 
9901 #define BOV_GB_CHAR_BREAK 0x1000
9902 
9906 #define BOV_GB_CURSOR_POS 0x2000
9907 
9911 #define BOV_GB_BACKSPACE_DEL_CH 0x4000
9912 
9913 #define BOV_WB_MASK 0x0700
9914 
9917 #define BOV_WB_WORD_BOUNDARY 0x0100
9918 
9921 #define BOV_WB_WORD_START 0x0200
9922 
9925 #define BOV_WB_WORD_END 0x0400
9926 
9927 #define BOV_SB_MASK 0x0070
9928 
9931 #define BOV_SB_SENTENCE_BOUNDARY 0x0010
9932 
9935 #define BOV_SB_SENTENCE_START 0x0020
9936 
9939 #define BOV_SB_SENTENCE_END 0x0040
9940 
9941 #define BOV_LB_MASK 0x000F
9942 #define BOV_LB_BREAK_FLAG 0x0004
9943 #define BOV_LB_MANDATORY_FLAG 0x0008
9944 
9947 #define BOV_LB_ALLOWED (BOV_LB_BREAK_FLAG | 0x0001)
9948 
9951 #define BOV_LB_MANDATORY (BOV_LB_BREAK_FLAG | BOV_LB_MANDATORY_FLAG | 0x0002)
9952 
9955 #define BOV_LB_NOTALLOWED 0x0003
9956 
9961 
10023 MG_EXPORT int GUIAPI UStrGetBreaks(LanguageCode lang_code,
10024  Uint8 ctr, Uint8 wbr, Uint8 lbp,
10025  Uchar32* ucs, int nr_ucs, BreakOppo** break_oppos);
10026 
10027 MG_EXPORT void GUIAPI UStrTailorBreaks(ScriptType writing_system,
10028  const Uchar32* ucs, int nr_ucs, BreakOppo* break_oppos);
10029 
10031 MG_EXPORT BOOL GUIAPI IsUCharAlnum(Uchar32 uc);
10032 
10034 MG_EXPORT BOOL GUIAPI IsUCharAlpha(Uchar32 uc);
10035 
10037 MG_EXPORT BOOL GUIAPI IsUCharControl(Uchar32 uc);
10038 
10040 MG_EXPORT BOOL GUIAPI IsUCharDigit(Uchar32 uc);
10041 
10043 MG_EXPORT BOOL GUIAPI IsUCharGraph(Uchar32 uc);
10044 
10046 MG_EXPORT BOOL GUIAPI IsUCharLowercase(Uchar32 uc);
10047 
10049 MG_EXPORT BOOL GUIAPI IsUCharPrint(Uchar32 uc);
10050 
10052 MG_EXPORT BOOL GUIAPI IsUCharUppercase(Uchar32 uc);
10053 
10055 MG_EXPORT BOOL GUIAPI IsUCharPunct(Uchar32 uc);
10056 
10059 MG_EXPORT BOOL GUIAPI IsUCharSpace(Uchar32 uc);
10060 
10063 MG_EXPORT BOOL GUIAPI IsUCharMark(Uchar32 uc);
10064 
10073 MG_EXPORT BOOL GUIAPI IsUCharTitle(Uchar32 uc);
10074 
10076 MG_EXPORT BOOL GUIAPI IsUCharXDigit(Uchar32 uc);
10077 
10079 MG_EXPORT BOOL GUIAPI IsUCharDefined(Uchar32 uc);
10080 
10082 MG_EXPORT BOOL GUIAPI IsUCharZeroWidth(Uchar32 uc);
10083 
10085 MG_EXPORT BOOL GUIAPI IsUCharWide(Uchar32 uc);
10086 
10095 MG_EXPORT BOOL GUIAPI IsUCharWideCJK(Uchar32 uc);
10096 
10098 MG_EXPORT Uchar32 UCharToUpper (Uchar32 uc);
10099 
10101 MG_EXPORT Uchar32 GUIAPI UCharToLower (Uchar32 uc);
10102 
10104 MG_EXPORT Uchar32 GUIAPI UCharToTitle (Uchar32 uc);
10105 
10107 MG_EXPORT Uchar32 GUIAPI UCharToFullWidth (Uchar32 uc);
10108 
10110 MG_EXPORT Uchar32 GUIAPI UCharToSingleWidth (Uchar32 uc);
10111 
10113 MG_EXPORT Uchar32 GUIAPI UCharToFullSizeKana (Uchar32 uc);
10114 
10116 MG_EXPORT Uchar32 GUIAPI UCharToSmallKana (Uchar32 uc);
10117 
10119 MG_EXPORT BOOL GUIAPI UCharIsArabicVowel(Uchar32 uc);
10120 
10122 MG_EXPORT int GUIAPI UCharCombiningClass (Uchar32 uc);
10123 
10130 MG_EXPORT void GUIAPI UCharCanonicalOrdering (Uchar32 *string, int len);
10131 
10133 MG_EXPORT BOOL GUIAPI UCharCompose (Uchar32 a, Uchar32 b, Uchar32 *ch);
10134 
10136 MG_EXPORT BOOL GUIAPI UCharDecompose (Uchar32 ch, Uchar32 *a, Uchar32 *b);
10137 
10148 MG_EXPORT int GUIAPI UCharFullyDecompose (Uchar32 ch, BOOL compat,
10149  Uchar32 *result, int result_len);
10150 
10167 MG_EXPORT ScriptType GUIAPI UCharGetScriptType (Uchar32 ch);
10168 
10194 MG_EXPORT Uint32 GUIAPI ScriptTypeToISO15924 (ScriptType script);
10195 
10221 MG_EXPORT ScriptType GUIAPI ScriptTypeFromISO15924 (Uint32 iso15924);
10222 
10244 static inline ScriptType GUIAPI ScriptTypeFromISO15924Code (const char* iso15924)
10245 {
10246  return ScriptTypeFromISO15924(MAKEDWORD32(iso15924[3],
10247  iso15924[2], iso15924[1], iso15924[0]));
10248 }
10249 
10250 typedef enum _UVerticalOrient {
10251  UCHAR_VOP_U = 0,
10252  UCHAR_VOP_R,
10253  UCHAR_VOP_TU,
10254  UCHAR_VOP_TR,
10255 } UVerticalOrient;
10256 
10257 typedef enum {
10258  GLYPH_RUN_DIR_LTR = 0,
10259  GLYPH_RUN_DIR_RTL,
10260  GLYPH_RUN_DIR_TTB,
10261  GLYPH_RUN_DIR_BTT,
10262 } GlyphRunDir;
10263 
10264 typedef enum {
10265  GLYPH_GRAVITY_SOUTH = 0,
10266  GLYPH_GRAVITY_EAST,
10267  GLYPH_GRAVITY_NORTH,
10268  GLYPH_GRAVITY_WEST,
10269  GLYPH_GRAVITY_AUTO,
10270 } GlyphGravity;
10271 
10272 typedef enum {
10273  GLYPH_GRAVITY_POLICY_NATURAL,
10274  GLYPH_GRAVITY_POLICY_STRONG,
10275  GLYPH_GRAVITY_POLICY_LINE,
10276  GLYPH_GRAVITY_POLICY_MIXED,
10277 } GlyphGravityPolicy;
10278 
10280 MG_EXPORT UVerticalOrient GUIAPI UCharGetVerticalOrientation(Uchar32 uc);
10281 
10302 MG_EXPORT GlyphGravity GUIAPI ScriptGetGlyphGravity(ScriptType script,
10303  BOOL vertical, GlyphGravity base_gravity, GlyphGravityPolicy policy);
10304 
10333 GlyphGravity ScriptGetGlyphGravityForWide (ScriptType script,
10334  BOOL vertical, BOOL wide,
10335  GlyphGravity base_gravity, GlyphGravityPolicy policy);
10336 
10339 #endif /* _MGCHARSET_UNICODE */
10340 
10358 MG_EXPORT int GUIAPI GetFontHeight (HDC hdc);
10359 
10373 MG_EXPORT int GUIAPI GetMaxFontWidth (HDC hdc);
10374 
10375 
10394 MG_EXPORT int GUIAPI GetTextExtent (HDC hdc,
10395  const char* spText, int len, SIZE* pSize);
10396 
10417 MG_EXPORT int GUIAPI GetTabbedTextExtent (HDC hdc,
10418  const char* spText, int len, SIZE* pSize);
10419 
10426 #define GetTextCharacterExtra(hdc) GetDCAttr (hdc, DC_ATTR_CHAR_EXTRA)
10427 
10434 #define GetTextWordExtra(hdc) GetDCAttr (hdc, DC_ATTR_WORD_EXTRA)
10435 
10442 #define GetTextAboveLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_ALINE_EXTRA)
10443 
10450 #define GetTextBellowLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_BLINE_EXTRA)
10451 
10459 #define SetTextCharacterExtra(hdc, extra) \
10460  SetDCAttr (hdc, DC_ATTR_CHAR_EXTRA, (DWORD) extra)
10461 
10469 #define SetTextWordExtra(hdc, extra) \
10470  SetDCAttr (hdc, DC_ATTR_WORD_EXTRA, (DWORD) extra)
10471 
10478 #define SetTextAboveLineExtra(hdc, extra) \
10479  SetDCAttr (hdc, DC_ATTR_ALINE_EXTRA, (DWORD) extra)
10480 
10487 #define SetTextBellowLineExtra(hdc, extra) \
10488  SetDCAttr (hdc, DC_ATTR_BLINE_EXTRA, (DWORD) extra)
10489 
10490 #define TA_LEFT 0x0000
10491 #define TA_RIGHT 0x0001
10492 #define TA_CENTER 0x0002
10493 #define TA_X_MASK 0x000F
10494 
10495 #define TA_TOP 0x0000
10496 #define TA_BASELINE 0x0010
10497 #define TA_BOTTOM 0x0020
10498 #define TA_Y_MASK 0x00F0
10499 
10500 #define TA_NOUPDATECP 0x0000
10501 #define TA_UPDATECP 0x0100
10502 #define TA_CP_MASK 0x0F00
10503 
10555 #define GetTextAlign(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_ALIGN)
10556 
10613 #define SetTextAlign(hdc, ta_flags) \
10614  SetDCAttr (hdc, DC_ATTR_TEXT_ALIGN, (DWORD)ta_flags)
10615 
10616 #define BIDI_FLAG_LTR 0x00
10617 #define BIDI_FLAG_RTL 0x10
10618 
10619 #define GetBIDIFlags(hdc) \
10620  GetDCAttr (hdc, DC_ATTR_BIDI_FLAGS)
10621 
10622 #define SetBIDIFlags(hdc, bidi_flags) \
10623  SetDCAttr (hdc, DC_ATTR_BIDI_FLAGS, (DWORD)bidi_flags)
10624 
10643 MG_EXPORT int GUIAPI TextOutLen (HDC hdc, int x, int y,
10644  const char* spText, int len);
10645 
10646 
10668 MG_EXPORT int GUIAPI TextOutOmitted (HDC hdc, int x, int y,
10669  const char *mtext, int len, int max_extent);
10670 
10692 MG_EXPORT int GUIAPI TabbedTextOutLen (HDC hdc, int x, int y,
10693  const char* spText, int len);
10694 
10721 MG_EXPORT int GUIAPI TabbedTextOutEx (HDC hdc, int x, int y,
10722  const char* spText, int nCount,
10723  int nTabPositions, int *pTabPositions, int nTabOrigin);
10724 
10734 MG_EXPORT void GUIAPI GetLastTextOutPos (HDC hdc, POINT* pt);
10735 
10744 #define TextOut(hdc, x, y, text) TextOutLen (hdc, x, y, text, -1)
10745 
10754 #define TabbedTextOut(hdc, x, y, text) TabbedTextOutLen (hdc, x, y, text, -1)
10755 
10756 #define DT_TOP 0x00000000
10757 #define DT_LEFT 0x00000000
10758 #define DT_CENTER 0x00000001
10759 #define DT_RIGHT 0x00000002
10760 #define DT_VCENTER 0x00000004
10761 #define DT_BOTTOM 0x00000008
10762 #define DT_WORDBREAK 0x00000010
10763 #define DT_SINGLELINE 0x00000020
10764 #define DT_EXPANDTABS 0x00000040
10765 #define DT_TABSTOP 0x00000080
10766 #define DT_NOCLIP 0x00000100
10767 #define DT_EXTERNALLPADING 0x00000200
10768 #define DT_CALCRECT 0x00000400
10769 #define DT_NOPREFIX 0x00000800
10770 #define DT_INTERNAL 0x00001000
10771 #define DT_CHARBREAK 0x00002000
10772 
10776 typedef struct _DTFIRSTLINE
10777 {
10781  int startx;
10783  int starty;
10785  int width;
10787  int height;
10788 } DTFIRSTLINE;
10789 
10865 MG_EXPORT int GUIAPI DrawTextEx2 (HDC hdc, const char* pText, int nCount,
10866  RECT* pRect, int nIndent, UINT nFormat, DTFIRSTLINE *firstline);
10867 
10877 #define DrawText(hdc, text, n, rc, format) \
10878  DrawTextEx2 (hdc, text, n, rc, 0, format, NULL)
10879 
10888 #define DrawTextEx(hdc, text, n, rc, indent, format) \
10889  DrawTextEx2 (hdc, text, n, rc, indent, format, NULL)
10890 
10901 #define MYBMP_TYPE_NORMAL 0x00000000
10902 #define MYBMP_TYPE_RLE4 0x00000001
10903 #define MYBMP_TYPE_RLE8 0x00000002
10904 #define MYBMP_TYPE_RGB 0x00000003
10905 #define MYBMP_TYPE_BGR 0x00000004
10906 #define MYBMP_TYPE_RGBA 0x00000005
10907 #define MYBMP_TYPE_MASK 0x0000000F
10908 
10909 #define MYBMP_FLOW_DOWN 0x00000010
10910 #define MYBMP_FLOW_UP 0x00000020
10911 #define MYBMP_FLOW_MASK 0x000000F0
10912 
10913 #define MYBMP_TRANSPARENT 0x00000100
10914 #define MYBMP_ALPHACHANNEL 0x00000200
10915 #define MYBMP_ALPHA 0x00000400
10916 
10917 #define MYBMP_RGBSIZE_3 0x00001000
10918 #define MYBMP_RGBSIZE_4 0x00002000
10919 
10920 #define MYBMP_LOAD_GRAYSCALE 0x00010000
10921 #define MYBMP_LOAD_ALLOCATE_ONE 0x00020000
10922 #define MYBMP_LOAD_NONE 0x00000000
10923 
10926 {
10958  int frames;
10963  Uint8 reserved [2];
10966 
10975 
10978 };
10979 
10980 #define BMP_TYPE_NORMAL 0x00
10981 #define BMP_TYPE_RLE 0x01
10982 #define BMP_TYPE_ALPHA 0x02
10983 #define BMP_TYPE_ALPHACHANNEL 0x04
10984 #define BMP_TYPE_COLORKEY 0x10
10985 #define BMP_TYPE_ALPHA_MASK 0x20
10986 #define BMP_TYPE_REPLACEKEY 0x40
10987 
10989 struct _BITMAP
10990 {
11034 
11043 
11044  /* Obsolte.
11045  The private pixel format
11046  void* bmAlphaPixelFormat; */
11047 
11050 
11053 };
11054 
11072 typedef BOOL (* CB_ALLOC_BITMAP_BUFF) (void* context, BITMAP* bmp);
11073 
11078 typedef void (* CB_ONE_SCANLINE) (void* context, MYBITMAP* my_bmp, int y);
11079 
11114 MG_EXPORT BOOL GUIAPI RegisterBitmapFileType (const char *ext,
11115  void* (*init) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal),
11116  int (*load) (MG_RWops* fp, void* init_info, MYBITMAP *my_bmp,
11117  CB_ONE_SCANLINE cb, void* context),
11118  void (*cleanup) (void* init_info),
11119  int (*save) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal),
11120  BOOL (*check) (MG_RWops* fp));
11121 
11137 MG_EXPORT const char* GUIAPI CheckBitmapType (MG_RWops* fp);
11138 
11180 #define MLS_BLENDMODE_NONE 0x00
11181 #define MLS_BLENDMODE_COLORKEY 0x01
11182 #define MLS_BLENDMODE_ALPHA 0x02
11183 
11184 #define MLS_INFOMASK_OFFSET 0x01
11185 #define MLS_INFOMASK_BLEND 0x02
11186 #define MLS_INFOMASK_ZORDER 0x04
11187 #define MLS_INFOMASK_ALL 0x07
11188 #define MLS_INFOMASK_ENABLE 0x08
11189 
11190 MG_EXPORT BOOL GUIAPI mlsSetSlaveScreenInfo (HDC dc_mls, DWORD mask, int offset_x, int offset_y,
11191  DWORD blend_flags, gal_pixel color_key, int alpha, int z_order);
11192 
11193 MG_EXPORT BOOL GUIAPI mlsGetSlaveScreenInfo (HDC dc_mls, DWORD mask, int* offset_x, int* offset_y,
11194  DWORD blend_flags, gal_pixel* color_key, int* alpha, int* z_order);
11208 MG_EXPORT BOOL GUIAPI mlsEnableSlaveScreen (HDC dc_mls, BOOL enable);
11209 
11210 #define ERR_BMP_OK 0
11211 #define ERR_BMP_IMAGE_TYPE -1
11212 #define ERR_BMP_UNKNOWN_TYPE -2
11213 #define ERR_BMP_CANT_READ -3
11214 #define ERR_BMP_CANT_SAVE -4
11215 #define ERR_BMP_NOT_SUPPORTED -5
11216 #define ERR_BMP_MEM -6
11217 #define ERR_BMP_LOAD -7
11218 #define ERR_BMP_FILEIO -8
11219 #define ERR_BMP_OTHER -9
11220 #define ERR_BMP_ERROR_SOURCE -10
11221 
11256 MG_EXPORT int GUIAPI LoadBitmapEx2 (HDC hdc, PBITMAP pBitmap,
11257  MG_RWops* area, const char* ext,
11258  CB_ALLOC_BITMAP_BUFF cb_alloc_buff, void* context);
11259 
11287 static inline int LoadBitmapEx (HDC hdc, PBITMAP pBitmap,
11288  MG_RWops* area, const char* ext) {
11289  return LoadBitmapEx2 (hdc, pBitmap, area, ext, NULL, NULL);
11290 }
11291 
11299 MG_EXPORT int GUIAPI LoadBitmapFromFile (HDC hdc, PBITMAP pBitmap,
11300  const char* spFileName);
11301 
11308 #define LoadBitmap LoadBitmapFromFile
11309 
11317 MG_EXPORT int GUIAPI LoadBitmapFromMem (HDC hdc, PBITMAP pBitmap,
11318  const void* mem, size_t size, const char* ext);
11319 
11331 MG_EXPORT void GUIAPI UnloadBitmap (PBITMAP pBitmap);
11332 
11351 MG_EXPORT int GUIAPI SetBitmapKeyColor (HDC hdc, PBITMAP bmp, Uint8 r, Uint8 g, Uint8 b);
11352 
11367 MG_EXPORT void GUIAPI ReplaceBitmapColor (HDC hdc, PBITMAP pBitmap,
11368  gal_pixel iOColor, gal_pixel iNColor);
11369 
11379 MG_EXPORT void GUIAPI HFlipBitmap (BITMAP* bmp, unsigned char* inter_buff);
11380 
11390 MG_EXPORT void GUIAPI VFlipBitmap (BITMAP* bmp, unsigned char* inter_buff);
11391 
11410 MG_EXPORT void* GUIAPI InitMyBitmapSL (MG_RWops* area,
11411  const char* ext, MYBITMAP* my_bmp, RGB* pal);
11412 
11431 MG_EXPORT int GUIAPI LoadMyBitmapSL (MG_RWops* area, void* load_info,
11432  MYBITMAP* my_bmp, CB_ONE_SCANLINE cb, void* context);
11433 
11448 MG_EXPORT int GUIAPI CleanupMyBitmapSL (MYBITMAP* my_bmp, void* load_info);
11449 
11465 MG_EXPORT int GUIAPI LoadMyBitmapEx (PMYBITMAP my_bmp, RGB* pal,
11466  MG_RWops* area, const char* ext);
11467 
11475 MG_EXPORT int GUIAPI LoadMyBitmapFromFile (PMYBITMAP my_bmp, RGB* pal,
11476  const char* file_name);
11477 
11484 #define LoadMyBitmap LoadMyBitmapFromFile
11485 
11501 MG_EXPORT int GUIAPI LoadMyBitmapFromMem (PMYBITMAP my_bmp, RGB* pal,
11502  const void* mem, size_t size, const char* ext);
11503 
11515 MG_EXPORT void GUIAPI UnloadMyBitmap (PMYBITMAP my_bmp);
11516 
11517 #ifdef _MGMISC_SAVEBITMAP
11518 
11535 MG_EXPORT int GUIAPI SaveMyBitmapToFile (PMYBITMAP my_bmp, RGB* pal,
11536  const char* spFileName);
11537 
11553 MG_EXPORT int GUIAPI SaveBitmapToFile (HDC hdc, PBITMAP pBitmap,
11554  const char* spFileName);
11555 #define SaveBitmap SaveBitmapToFile
11556 #endif
11557 
11579 MG_EXPORT BOOL GUIAPI InitBitmap (HDC hdc, Uint32 w, Uint32 h, Uint32 pitch,
11580  BYTE* bits, PBITMAP bmp);
11581 
11593 MG_EXPORT HDC GUIAPI InitSlaveScreenEx (const char* name, const char* mode, int dpi);
11594 
11604 static inline HDC InitSlaveScreen (const char* name, const char* mode)
11605 {
11606  return InitSlaveScreenEx(name, mode, GDCAP_DPI_DEFAULT);
11607 }
11608 
11616 MG_EXPORT void GUIAPI TerminateSlaveScreen (HDC hdc);
11632 MG_EXPORT BOOL GUIAPI InitBitmapPixelFormat (HDC hdc, PBITMAP bmp);
11633 
11643 MG_EXPORT void GUIAPI DeleteBitmapAlphaPixel (PBITMAP bmp);
11644 
11645 /* Everything in the pixel format structure is read-only */
11646 typedef struct GAL_PixelFormat {
11647  GAL_Palette *palette;
11648 
11649  Uint8 BitsPerPixel;
11650  Uint8 BytesPerPixel;
11651  /* The flag indicating dithered palette */
11652  Uint8 DitheredPalette;
11653  /* The flag indicating the Most Significant Bits (MSB)
11654  * is left when depth is less than 8. */
11655  Uint8 MSBLeft;
11656 
11657  Uint8 Rloss;
11658  Uint8 Gloss;
11659  Uint8 Bloss;
11660  Uint8 Aloss;
11661  Uint8 Rshift;
11662  Uint8 Gshift;
11663  Uint8 Bshift;
11664  Uint8 Ashift;
11665  Uint32 Rmask;
11666  Uint32 Gmask;
11667  Uint32 Bmask;
11668  Uint32 Amask;
11669 
11670  /* RGB color key information */
11671  gal_pixel colorkey;
11672  /* Alpha value information (per-surface alpha) */
11673  gal_uint8 alpha;
11674 } GAL_PixelFormat;
11675 
11676 #define _FILL_MYBITMAP
11677 
11678 #ifndef MYBITMAP_CONTXT
11679 typedef struct _MYBITMAP_CONTXT{
11680  Uint32 colorKey;
11681  Uint32 pitch;
11682  GAL_PixelFormat* AlphaPixelFormat;
11683  MYBITMAP* mybmp;
11684 }MYBITMAP_CONTXT;
11685 #endif
11686 
11687 typedef BYTE* (* CB_DRAW_PIXEL) (HDC hdc, MYBITMAP_CONTXT* mybmp, Uint32 pixel, BYTE* dest);
11688 
11704 MG_EXPORT int GUIAPI ExpandMyBitmap (HDC hdc, PBITMAP bmp,
11705  const MYBITMAP* my_bmp, const RGB* pal, int frame);
11706 
11729 MG_EXPORT void GUIAPI ExpandMonoBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11730  const BYTE* my_bits, Uint32 my_pitch,
11731  Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg);
11732 
11733 MG_EXPORT void GUIAPI Expand16CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11734  const BYTE* my_bits, Uint32 my_pitch,
11735  Uint32 w, Uint32 h, DWORD flags,
11736  const RGB* pal, BYTE use_pal_alpha, BYTE alpha);
11737 
11759 static inline void GUIAPI Expand16CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11760  const BYTE* my_bits, Uint32 my_pitch,
11761  Uint32 w, Uint32 h, DWORD flags, const RGB* pal)
11762 {
11763  Expand16CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11764  w, h, flags, pal, FALSE, 0xFF);
11765 }
11766 
11767 MG_EXPORT void GUIAPI Expand256CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11768  const BYTE* my_bits, Uint32 my_pitch,
11769  Uint32 w, Uint32 h, DWORD flags,
11770  const RGB* pal, BYTE use_pal_alpha, BYTE alpha,
11771  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11796 static inline void GUIAPI Expand256CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11797  const BYTE* my_bits, Uint32 my_pitch,
11798  Uint32 w, Uint32 h, DWORD flags, const RGB* pal,
11799  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp)
11800 {
11801  Expand256CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11802  w, h, flags, pal, FALSE, 0xFF, cb_draw, mybmp);
11803 }
11804 
11828 MG_EXPORT void GUIAPI CompileRGBABitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11829  const BYTE* my_bits, Uint32 my_pitch,
11830  Uint32 w, Uint32 h, DWORD flags, void* pixel_format,
11831  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11832 
11845 MG_EXPORT void GUIAPI CompileRGBABitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11846  const BYTE* my_bits, Uint32 my_pitch,
11847  Uint32 w, Uint32 h, DWORD flags, void* pixel_format,
11848  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp,
11849  BYTE* alpha_mask);
11850 
11851 #ifdef _FILL_MYBITMAP
11852 MG_EXPORT int GUIAPI FillBoxWithMyBitmap (HDC hdc, int x, int y, MYBITMAP* mybmp, RGB* pal);
11853 
11854 MG_EXPORT void GUIAPI ExpandPartMonoBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11855  const BYTE* my_bits, Uint32 my_pitch,
11856  Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg,
11857  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11858 
11859 MG_EXPORT void GUIAPI ExpandPart16CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11860  const BYTE* my_bits, Uint32 my_pitch,
11861  Uint32 w, Uint32 h, DWORD flags,
11862  const RGB* pal, BYTE use_pal_alpha, BYTE alpha,
11863  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11864 
11865 static inline void GUIAPI ExpandPart16CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11866  const BYTE* my_bits, Uint32 my_pitch,
11867  Uint32 w, Uint32 h, DWORD flags, const RGB* pal,
11868  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp)
11869 {
11870  ExpandPart16CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11871  w, h, flags, pal, FALSE, 0xFF, stepx, cb_draw, mybmp);
11872 }
11873 
11874 #endif
11875 
11876 #define CompileRGBBitmap CompileRGBABitmap
11877 
11906 MG_EXPORT int GUIAPI PaintImageEx (HDC hdc, int x, int y,
11907  MG_RWops* area, const char* ext);
11908 
11923 MG_EXPORT int GUIAPI PaintImageFromFile (HDC hdc, int x, int y,
11924  const char* spFileName);
11925 
11942 MG_EXPORT int GUIAPI PaintImageFromMem (HDC hdc, int x, int y,
11943  const void* mem, size_t size, const char* ext);
11944 
11976 MG_EXPORT int GUIAPI StretchPaintImageEx (HDC hdc, int x, int y, int w, int h,
11977  MG_RWops* area, const char* ext);
11978 
11995 MG_EXPORT int GUIAPI StretchPaintImageFromFile (HDC hdc, int x, int y,
11996  int w, int h, const char* spFileName);
11997 
12016 MG_EXPORT int GUIAPI StretchPaintImageFromMem (HDC hdc, int x, int y,
12017  int w, int h, const void* mem, size_t size, const char* ext);
12018 
12019 #ifdef _MGHAVE_FIXED_MATH
12020 
12036 MG_EXPORT void GUIAPI RotateBitmap (HDC hdc, const BITMAP *bmp,
12037  int lx, int ty, int angle);
12038 
12049 MG_EXPORT void GUIAPI RotateBitmapVFlip (HDC hdc, const BITMAP *bmp,
12050  int lx, int ty, int angle);
12051 
12060 MG_EXPORT void GUIAPI RotateBitmapHFlip (HDC hdc, const BITMAP *bmp,
12061  int lx, int ty, int angle);
12062 
12071 MG_EXPORT void GUIAPI RotateScaledBitmap (HDC hdc, const BITMAP *bmp,
12072  int lx, int ty, int angle, int w, int h);
12073 
12085 MG_EXPORT void GUIAPI RotateScaledBitmapVFlip (HDC hdc, const BITMAP *bmp,
12086  int lx, int ty, int angle, int w, int h);
12087 
12099 MG_EXPORT void GUIAPI RotateScaledBitmapHFlip (HDC hdc, const BITMAP *bmp,
12100  int lx, int ty, int angle, int w, int h);
12101 
12113 MG_EXPORT void GUIAPI PivotBitmap(HDC hdc, const BITMAP *bmp,
12114  int lx, int ty, int cx, int cy, int angle);
12115 
12142 MG_EXPORT void GUIAPI PivotScaledBitmapFlip (HDC hdc, const BITMAP *bmp,
12143  fixed x, fixed y, fixed cx, fixed cy, int angle, fixed scale_x,
12144  fixed scale_y, BOOL h_flip, BOOL v_flip);
12145 
12146 #endif /*_MGHAVE_FIXED_MATH*/
12147 
12154 #ifdef _MGFONT_BMPF
12155 
12173 MG_EXPORT DEVFONT* GUIAPI CreateBMPDevFont (const char *bmpfont_name,
12174  const BITMAP* glyph_bmp, const char* start_mchar, int nr_glyphs,
12175  int glyph_width);
12176 
12192 MG_EXPORT BOOL GUIAPI AddGlyphsToBMPFont (DEVFONT* dev_font, BITMAP* glyph_bmp,
12193  const char* start_mchar, int nr_glyphs, int glyph_width);
12194 
12205 MG_EXPORT void GUIAPI DestroyBMPFont (DEVFONT* dev_font);
12206 
12207 #endif /* end of _MGFONT_BMPF */
12208 
12271 typedef Uint32 Achar32;
12272 typedef Uint32 Glyph32;
12273 
12277 #define INV_ACHAR_VALUE 0xFFFFFFFF
12278 
12282 #define INV_GLYPH_VALUE 0xFFFFFFFF
12283 
12297 MG_EXPORT Achar32 GUIAPI GetACharValue (LOGFONT* logfont, const char* mchar,
12298  int mchar_len, const char* pre_mchar, int pre_len);
12299 
12300 #ifdef _MGCHARSET_UNICODE
12301 
12319 MG_EXPORT int GUIAPI GetNextUChar(LOGFONT* logfont, const char* mchar,
12320  int mchar_len, Uchar32* uc);
12321 
12322 #endif /* _MGCHARSET_UNICODE */
12323 
12351 MG_EXPORT Uint32 GUIAPI GetACharType (LOGFONT* logfont, Achar32 chv);
12352 
12357 typedef enum {
12358  ACHAR_ISOLATED,
12359  ACHAR_FINAL,
12360  ACHAR_INITIAL,
12361  ACHAR_MEDIAL
12362 } ACHARSHAPETYPE;
12363 
12385 MG_EXPORT Achar32 GUIAPI GetShapedAChar (LOGFONT* logfont, const char* mchar,
12386  int mchar_len, ACHARSHAPETYPE shape_type);
12387 
12409 MG_EXPORT BOOL GUIAPI GetMirrorAChar (LOGFONT* logfont, Achar32 chv,
12410  Achar32* mirrored);
12411 
12432 MG_EXPORT BidiType GUIAPI GetACharBidiType (LOGFONT* log_font, Achar32 chv);
12433 
12438 typedef struct _ACHARMAPINFO {
12440  int byte_index;
12442  int char_len;
12444  BOOL is_rtol;
12445 } ACHARMAPINFO;
12446 
12471 MG_EXPORT int GUIAPI BIDIGetTextLogicalAChars (LOGFONT* log_font,
12472  const char* text, int text_len, Achar32** achars,
12473  ACHARMAPINFO** achars_map);
12474 
12500 MG_EXPORT void GUIAPI BIDIGetTextRangesLog2Vis (LOGFONT* log_font,
12501  const char* text, int text_len, int start_index, int end_index,
12502  int** ranges, int* nr_ranges);
12503 
12528 MG_EXPORT int GUIAPI BIDIGetTextVisualAChars (LOGFONT* log_font,
12529  const char* text, int text_len, Achar32** achars,
12530  ACHARMAPINFO** achars_map);
12531 
12565 MG_EXPORT BOOL GUIAPI BIDILogAChars2VisACharsEx (LOGFONT* log_font,
12566  Achar32* achars, int nr_achars, int pel,
12567  void* extra, CB_REVERSE_ARRAY cb_reverse_extra);
12568 
12595 MG_EXPORT Achar32* GUIAPI BIDILogAChars2VisAChars (LOGFONT* log_font,
12596  Achar32* achars, int nr_achars, ACHARMAPINFO* achars_map);
12597 
12626 MG_EXPORT void GUIAPI BIDIGetLogicalEmbedLevelsEx (LOGFONT* log_font,
12627  Achar32* achars, int nr_achars, int pel, Uint8** embedding_levels);
12628 
12629 static inline void BIDIGetLogicalEmbeddLevels (LOGFONT* log_font,
12630  Achar32* achars, int nr_achars, Uint8** embedding_levels)
12631 {
12632  BIDIGetLogicalEmbedLevelsEx (log_font, achars, nr_achars, -1,
12633  embedding_levels);
12634 }
12635 
12667 MG_EXPORT void GUIAPI BIDIGetVisualEmbedLevelsEx (LOGFONT* log_font,
12668  Achar32* achars, int nr_achars, int pel, Uint8** embedding_levels);
12669 
12670 static inline void BIDIGetVisualEmbeddLevels (LOGFONT* log_font,
12671  Achar32* achars, int nr_achars, Uint8** embedding_levels)
12672 {
12673  BIDIGetVisualEmbedLevelsEx (log_font, achars, nr_achars, -1,
12674  embedding_levels);
12675 }
12676 
12677 /*
12678  * \fn int GUIAPI DrawACharString (HDC hdc, int x, int y,
12679  * Achar32* achars, int nr_achars, int* adv_x, int* adv_y);
12680  *
12681  * \brief Draw an abstract character string.
12682  *
12683  * This function draws an abstract character string to the specific
12684  * postion of a DC. Note that this function will ignore all breaks
12685  * in the Achar32 string.
12686  *
12687  * \param hdc The device context.
12688  * \param x The output start x position.
12689  * \param y The output start y position.
12690  * \param achars The pointer to the glyph string.
12691  * \param nr_achars The number of achars which will be draw.
12692  * \param adv_x The pointer used to return the advance in x-coordinate of
12693  * the glyph string, can be NULL.
12694  * \param adv_y The pointer used to return the advance in y-coordinate of
12695  * the glyph string, can be NULL.
12696  *
12697  * \return The advance on baseline.
12698  */
12699 MG_EXPORT int GUIAPI DrawACharString (HDC hdc, int x, int y, Achar32* achars,
12700  int nr_achars, int* adv_x, int* adv_y);
12701 
12717 MG_EXPORT int GUIAPI GetACharsExtent (HDC hdc, Achar32* achars, int nr_achars,
12718  SIZE* size);
12719 
12738 MG_EXPORT int GUIAPI GetACharsExtentPoint (HDC hdc, Achar32* achars,
12739  int nr_achars, int max_extent, SIZE* size);
12740 
12754 MG_EXPORT Glyph32 GUIAPI GetGlyphValue (LOGFONT* logfont, const char* mchar,
12755  int mchar_len, const char* pre_mchar, int pre_len);
12756 
12767 MG_EXPORT Glyph32 GUIAPI GetGlyphValueAlt(LOGFONT* logfont, Achar32 chv);
12768 
12787 MG_EXPORT int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
12788  int* adv_x, int* adv_y);
12789 
12790 /*
12791  * \fn int GUIAPI DrawGlyphString (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12792  * const POINT* pts);
12793  *
12794  * \brief Draw a glyph string at specified positions.
12795  *
12796  * This function draws a glyph string to the specific postions of a DC.
12797  * Note that this function will ignore all special type (such as zero-width)
12798  * in the glyph string.
12799  *
12800  * \param hdc The device context.
12801  * \param glyphs The pointer to the glyph string.
12802  * \param nr_glyphs The number of glyphs which will be draw.
12803  * \param pts The positions of every glyphs.
12804  *
12805  * \return The number of glyphs drawn.
12806  *
12807  * \sa DrawGlyphStringEx
12808  */
12809 MG_EXPORT int GUIAPI DrawGlyphString (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12810  const POINT* pts);
12811 
12829 MG_EXPORT int GUIAPI GetGlyphsExtent (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12830  SIZE* size);
12831 
12850 MG_EXPORT int GUIAPI GetGlyphsExtentPoint (HDC hdc, Glyph32* glyphs,
12851  int nr_glyphs, int max_extent, SIZE* size);
12852 
12853 #define GLYPH_INFO_METRICS 0x01
12854 #define GLYPH_INFO_BMP 0x02
12855 
12857 #define GLYPHBMP_TYPE_MONO 0x00
12858 
12859 #define GLYPHBMP_TYPE_GREY 0x01
12860 
12861 #define GLYPHBMP_TYPE_GREY4b 0x02
12862 
12863 #define GLYPHBMP_TYPE_SUBPIXEL 0x03
12864 
12865 #define GLYPHBMP_TYPE_PRERENDER 0x04
12866 
12871 typedef struct _GLYPHINFO {
12878  Uint32 mask;
12879 
12881  int bbox_x, bbox_y, bbox_w, bbox_h;
12883  int advance_x, advance_y;
12884 
12892  int bmp_type;
12893 
12895  int bmp_width;
12897  int bmp_height;
12898  /* The pitch of the glyph bitmap. */
12899  int bmp_pitch;
12900 
12902  const unsigned char* bits;
12903 
12908  BITMAP prbitmap;
12909 } GLYPHINFO;
12910 
12928 MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
12929  GLYPHINFO* glyph_info);
12930 
12931 #ifdef _MGCHARSET_UNICODE
12932 
12950 #define WSR_NORMAL 0x00
12951 
12960 #define WSR_PRE 0x01
12961 
12968 #define WSR_NOWRAP 0x02
12969 
12976 #define WSR_PRE_WRAP 0x03
12977 
12992 #define WSR_BREAK_SPACES 0x04
12993 
13001 #define WSR_PRE_LINE 0x05
13002 
13042 MG_EXPORT int GUIAPI GetUCharsUntilParagraphBoundary(LOGFONT* logfont,
13043  const char* mstr, int mstr_len, Uint8 wsr,
13044  Uchar32** uchars, int* nr_uchars);
13045 
13062 MG_EXPORT Uchar32 GUIAPI AChar2UChar(LOGFONT* logfont, Achar32 chv);
13063 
13082 MG_EXPORT int GUIAPI AChars2UChars(LOGFONT* logfont, const Achar32* chs,
13083  Uchar32* ucs, int n);
13084 
13096 #define UCHAR2ACHAR(uc) ((uc) | 0x80000000)
13097 
13120 MG_EXPORT BOOL GUIAPI UChar2AChar(LOGFONT* logfont, Uchar32 uc, Achar32* ac);
13121 
13142 MG_EXPORT int GUIAPI UChars2AChars(LOGFONT* logfont, const Uchar32* ucs,
13143  Achar32* acs, int n);
13144 
13161 #define GRF_WRITING_MODE_MASK 0xF0000000
13162 #define GRF_WRITING_MODE_VERTICAL_FLAG 0x20000000
13163 
13167 #define GRF_WRITING_MODE_HORIZONTAL_TB 0x00000000
13168 
13173 #define GRF_WRITING_MODE_HORIZONTAL_BT 0x10000000
13174 
13179 #define GRF_WRITING_MODE_VERTICAL_RL 0x20000000
13180 
13185 #define GRF_WRITING_MODE_VERTICAL_LR 0x30000000
13186 
13187 #define GRF_TEXT_ORIENTATION_MASK 0x0F000000
13188 
13192 #define GRF_TEXT_ORIENTATION_UPRIGHT 0x00000000
13193 
13197 #define GRF_TEXT_ORIENTATION_SIDEWAYS 0x01000000
13198 
13202 #define GRF_TEXT_ORIENTATION_UPSIDE_DOWN 0x02000000
13203 
13207 #define GRF_TEXT_ORIENTATION_SIDEWAYS_LEFT 0x03000000
13208 
13212 #define GRF_TEXT_ORIENTATION_AUTO 0x04000000
13213 
13220 #define GRF_TEXT_ORIENTATION_MIXED 0x05000000
13221 
13222 #define GRF_TEXT_ORIENTATION_LINE 0x06000000
13223 
13224 #define GRF_LINE_EXTENT_MASK 0x00C00000
13225 
13230 #define GRF_LINE_EXTENT_FIXED 0x00000000
13231 
13236 #define GRF_LINE_EXTENT_VARIABLE 0x00400000
13237 
13238 #define GRF_INDENT_MASK 0x00300000
13239 
13242 #define GRF_INDENT_NONE 0x00000000
13243 
13246 #define GRF_INDENT_FIRST_LINE 0x00100000
13247 
13250 #define GRF_INDENT_HANGING 0x00200000
13251 
13252 #define GRF_OVERFLOW_WRAP_MASK 0x000C0000
13253 
13256 #define GRF_OVERFLOW_WRAP_NORMAL 0x00000000
13257 
13260 #define GRF_OVERFLOW_WRAP_BREAK_WORD 0x00040000
13261 
13266 #define GRF_OVERFLOW_WRAP_ANYWHERE 0x00080000
13267 
13268 #define GRF_OVERFLOW_ELLIPSIZE_MASK 0x00030000
13269 
13272 #define GRF_OVERFLOW_ELLIPSIZE_NONE 0x00000000
13273 
13276 #define GRF_OVERFLOW_ELLIPSIZE_START 0x00010000
13277 
13280 #define GRF_OVERFLOW_ELLIPSIZE_MIDDLE 0x00020000
13281 
13284 #define GRF_OVERFLOW_ELLIPSIZE_END 0x00030000
13285 
13286 #define GRF_ALIGN_MASK 0x0000F000
13287 
13290 #define GRF_ALIGN_START 0x00000000
13291 
13294 #define GRF_ALIGN_END 0x00001000
13295 
13299 #define GRF_ALIGN_LEFT 0x00002000
13300 
13304 #define GRF_ALIGN_RIGHT 0x00003000
13305 
13308 #define GRF_ALIGN_CENTER 0x00004000
13309 
13316 #define GRF_ALIGN_JUSTIFY 0x00005000
13317 
13318 #define GRF_TEXT_JUSTIFY_MASK 0x00000F00
13319 
13322 #define GRF_TEXT_JUSTIFY_NONE 0x00000000
13323 
13328 #define GRF_TEXT_JUSTIFY_AUTO 0x00000100
13329 
13332 #define GRF_TEXT_JUSTIFY_INTER_WORD 0x00000200
13333 
13337 #define GRF_TEXT_JUSTIFY_INTER_CHAR 0x00000300
13338 
13339 #define GRF_HANGING_PUNC_MASK 0x000000F0
13340 
13343 #define GRF_HANGING_PUNC_NONE 0x00000000
13344 
13347 #define GRF_HANGING_PUNC_FORCE_END 0x00000010
13348 
13352 #define GRF_HANGING_PUNC_ALLOW_END 0x00000020
13353 
13356 #define GRF_HANGING_PUNC_OPEN 0x00000040
13357 
13360 #define GRF_HANGING_PUNC_CLOSE 0x00000080
13361 
13362 #define GRF_SPACES_MASK 0x0000000F
13363 
13366 #define GRF_SPACES_KEEP 0x00000000
13367 
13370 #define GRF_SPACES_REMOVE_START 0x00000001
13371 
13374 #define GRF_SPACES_REMOVE_END 0x00000002
13375 
13378 #define GRF_SPACES_HANGE_END 0x00000004
13379 
13382 typedef enum {
13383  GLYPH_ORIENT_UPRIGHT = GLYPH_GRAVITY_SOUTH,
13384  GLYPH_ORIENT_SIDEWAYS = GLYPH_GRAVITY_EAST,
13385  GLYPH_ORIENT_UPSIDE_DOWN = GLYPH_GRAVITY_NORTH,
13386  GLYPH_ORIENT_SIDEWAYS_LEFT = GLYPH_GRAVITY_WEST,
13387 } GlyphOrient;
13388 
13389 typedef enum {
13390  GLYPH_HANGED_NONE = 0,
13391  GLYPH_HANGED_START,
13392  GLYPH_HANGED_END,
13393 } GlyphHanged;
13394 
13398 typedef struct _GLYPHEXTINFO {
13400  int bbox_x, bbox_y, bbox_w, bbox_h;
13402  int adv_x, adv_y;
13404  int extra_x, extra_y;
13427 } GLYPHEXTINFO;
13428 
13432 typedef struct _GLYPHPOS {
13436  int x;
13440  int y;
13444  int x_off;
13448  int y_off;
13452  int advance;
13487 } GLYPHPOS;
13488 
13569 MG_EXPORT int GUIAPI GetGlyphsExtentFromUChars(LOGFONT* logfont_upright,
13570  const Achar32* uchars, int nr_uchars, const BreakOppo* break_oppos,
13571  Uint32 render_flags, int x, int y,
13572  int letter_spacing, int word_spacing, int tab_size, int max_extent,
13573  SIZE* line_size, Glyph32* glyphs, GLYPHEXTINFO* glyph_ext_info,
13574  GLYPHPOS* glyph_pos, LOGFONT** logfont_sideways);
13575 
13576 /*
13577  * \fn int GUIAPI DrawGlyphStringEx (HDC hdc,
13578  * LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
13579  * const Glyph32* glyphs, const GLYPHPOS* glyph_pos, int nr_glyphs)
13580  * \brief Draw a glyph string at the specified positions and text orientations.
13581  *
13582  * This function draws a glyph string to the specific positions and
13583  * orientations on a DC \a hdc with the logfonts specified by
13584  * \a logfont_upright and \a logfont_sideways.
13585  *
13586  * \param hdc The device context.
13587  * \param logfont_upright The LOGFONT object used for upright glyphs.
13588  * \param logfont_sideways The LOGFONT object used for sideways glyphs.
13589  * \param glyphs The pointer to the glyph string
13590  * \param glyph_pos The buffer holds the position information
13591  * of every glyph.
13592  * \param nr_glyphs The number of the glyphs should be drawn.
13593  *
13594  * \return The number of glyphs really drawn.
13595  *
13596  * \note The positions contained in \a glyph_pos are always aligned to
13597  * the top-left corner of the output rectangle.
13598  *
13599  * \sa GetGlyphsExtentFromUChars
13600  *
13601  * Since 4.0.0
13602  */
13603 MG_EXPORT int GUIAPI DrawGlyphStringEx (HDC hdc,
13604  LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
13605  const Glyph32* glyphs, const GLYPHPOS* glyph_pos,
13606  int nr_glyphs);
13607 
13612 typedef struct _TEXTRUNS TEXTRUNS;
13613 
13654 MG_EXPORT TEXTRUNS* GUIAPI CreateTextRuns(
13655  const Uchar32* ucs, int nr_ucs,
13656  LanguageCode lang_code, ParagraphDir base_dir,
13657  const char* logfont_name, RGBCOLOR color, RGBCOLOR bg_color,
13658  BreakOppo* break_oppos);
13659 
13677 MG_EXPORT BOOL GUIAPI SetFontNameInTextRuns(TEXTRUNS* truns,
13678  int start_index, int length, const char* logfont_name);
13679 
13685 MG_EXPORT const char* GUIAPI GetFontNameInTextRuns(
13686  const TEXTRUNS* truns, int index);
13687 
13705 MG_EXPORT BOOL GUIAPI SetTextColorInTextRuns(TEXTRUNS* truns,
13706  int start_index, int length, RGBCOLOR color);
13707 
13713 MG_EXPORT RGBCOLOR GUIAPI GetTextColorInTextRuns(
13714  const TEXTRUNS* truns, int index);
13715 
13736 MG_EXPORT BOOL GUIAPI SetBackgroundColorInTextRuns(TEXTRUNS* truns,
13737  int start_index, int length, RGBCOLOR color);
13738 
13744 MG_EXPORT RGBCOLOR GUIAPI GetBackgroundColorInTextRuns(
13745  const TEXTRUNS* truns, int index);
13746 
13765 MG_EXPORT BOOL GUIAPI DestroyTextRuns(TEXTRUNS* truns);
13766 
13798 MG_EXPORT BOOL GUIAPI InitBasicShapingEngine(TEXTRUNS* truns);
13799 
13800 #ifdef _MGCOMPLEX_SCRIPTS
13801 
13835 MG_EXPORT BOOL GUIAPI InitComplexShapingEngine(TEXTRUNS* truns);
13836 
13837 #endif /* _MGCOMPLEX_SCRIPTS */
13838 
13843 typedef struct _LAYOUT LAYOUT;
13844 
13849 typedef struct _LAYOUTLINE LAYOUTLINE;
13850 
13885 MG_EXPORT LAYOUT* GUIAPI CreateLayout(
13886  const TEXTRUNS* truns, Uint32 render_flags,
13887  const BreakOppo* break_oppos, BOOL persist_lines,
13888  int max_line_extent, int indent,
13889  int letter_spacing, int word_spacing, int tab_size,
13890  int* tabs, int nr_tabs);
13891 
13906 MG_EXPORT BOOL GUIAPI DestroyLayout(LAYOUT* layout);
13907 
13908 /*
13909  * \var typedef struct _RENDERDATA RENDERDATA
13910  * \brief The extra rendering data of the shaped glyph.
13911  */
13912 typedef struct _RENDERDATA {
13916  const TEXTRUNS* truns;
13917 
13921  const LAYOUT* layout;
13922 
13926  const LAYOUTLINE* line;
13927 
13931  LOGFONT* logfont;
13932 
13936  Uint32 ta;
13937 
13941  Uchar32 uc;
13942 
13947  int uc_index;
13948 } RENDERDATA;
13949 
13968 typedef BOOL (*CB_GLYPH_LAID_OUT) (GHANDLE ctxt,
13969  Glyph32 glyph_value, const GLYPHPOS* glyph_pos,
13970  const RENDERDATA* render_data);
13971 
14014 MG_EXPORT LAYOUTLINE* GUIAPI LayoutNextLine(LAYOUT* layout,
14015  LAYOUTLINE* prev_line, int max_extent, BOOL last_line,
14016  CB_GLYPH_LAID_OUT cb_laid_out, GHANDLE ctxt);
14017 
14034 MG_EXPORT BOOL GUIAPI GetLayoutLineSize(const LAYOUTLINE* line,
14035  SIZE* line_size);
14036 
14068 MG_EXPORT BOOL GUIAPI GetLayoutLineRect(const LAYOUTLINE* line,
14069  int* x, int* y, int line_height, RECT* line_rc);
14070 
14106 MG_EXPORT int GUIAPI CalcLayoutBoundingRect(LAYOUT* layout,
14107  int max_line_extent, int max_height, int line_height,
14108  int x, int y, RECT* bounding);
14109 
14139 MG_EXPORT BOOL DrawShapedGlyph(HDC hdc,
14140  Glyph32 glyph_value, const GLYPHPOS* glyph_pos,
14141  const RENDERDATA* render_data);
14142 
14174 MG_EXPORT int DrawLayoutLine(HDC hdc, const LAYOUTLINE* line,
14175  int x, int y);
14176 
14177 #ifdef _MGDEVEL_MODE
14178 typedef struct _TextRun TEXTRUN;
14179 
14180 MG_EXPORT TEXTRUN* GetNextTextRunInfo(TEXTRUNS* runinfo,
14181  TEXTRUN* prev,
14182  const char** fontname, int* start_index, int* length,
14183  LanguageCode* lang_code, ScriptType* script,
14184  BidiLevel* embedding_level, Uint8* flags);
14185 
14186 /* Get layout line information */
14187 MG_EXPORT BOOL GUIAPI GetLayoutLineInfo(LAYOUTLINE* line,
14188  int* max_extent, int* nr_chars, int* nr_glyphs,
14189  int** log_widths, int* width, int* height,
14190  BOOL* is_ellipsized, BOOL* is_wrapped);
14191 #endif
14192 
14193 #endif /* _MGCHARSET_UNICODE */
14194 
14197 /*
14198  * \var typedef struct _COMP_CTXT COMP_CTXT
14199  * \brief The context information of user defined color composition operators.
14200  *
14201  * \sa SetUserCompositionOps
14202  */
14203 typedef struct _COMP_CTXT {
14205  gal_uint8* cur_dst;
14206 
14208  void* user_comp_ctxt;
14209 
14211  gal_pixel skip_pixel;
14212 
14214  gal_pixel cur_pixel;
14215 
14217  int step;
14218 } COMP_CTXT;
14219 
14220 /*
14221  * \var typedef struct _SPAN_CTXT SPAN_CTXT
14222  * \brief span context
14223  */
14224 typedef struct _SPAN_CTXT {
14225  GAL_PixelFormat* dst_format; /* The pixel format of the destination pixels */
14226  GAL_PixelFormat* src_format; /* The pixel format of the source pixels */
14227  void * user_context; /* The user context passed to SetColorCompositeFunc */
14228 } SPAN_CTXT;
14229 
14230 /*
14231  * \var typedef struct _COMPOSITE_CTXT COMPOSITE_CTXT
14232  * \brief composite context
14233  */
14234 typedef struct _COMPOSITE_CTXT {
14235  HDC dst_dc;
14236  int comp_mode;
14237  const int *far_bkmode;
14238  const int *far_step;
14239  const gal_pixel *far_skip_pixel;
14240 } COMPOSITE_CTXT;
14241 
14242 /*
14243  * \var typedef void (*CB_COMP_SETPIXEL) (COMP_CTXT* comp_ctxt)
14244  * \brief The prototype of the user defined color composition setpixel.
14245  *
14246  * This operator sets a pixel on the \a cur_dst defined in \a comp_ctxt with
14247  * the cur_pixel defined in \a comp_ctxt.
14248  *
14249  * \sa SetUserCompositionOps, COMP_CTXT
14250  */
14251 typedef void (*CB_COMP_SETPIXEL) (COMP_CTXT* comp_ctxt);
14252 
14253 /*
14254  * \var typedef void (*CB_COMP_SETHLINE) (COMP_CTXT* comp_ctxt, int w)
14255  * \brief The prototype of the user defined color composition sethline.
14256  *
14257  * This operator sets a horizital line on the \a cur_dst defined in \a comp_ctxt
14258  * with the \a cur_pixel defined in \a comp_ctxt, totally \a w pixels.
14259  *
14260  * \sa SetUserCompositionOps, COMP_CTXT
14261  */
14262 typedef void (*CB_COMP_SETHLINE) (COMP_CTXT* comp_ctxt, int w);
14263 
14264 /*
14265  * \var typedef void (*CB_COMP_PUTHLINE) (COMP_CTXT* comp_ctxt, gal_uint8* src, int w)
14266  * \brief The prototype of the user defined color composition puthline.
14267  *
14268  * This operator puts the pixels in \a src to a horizital line on the \a cur_dst
14269  * defined in \a comp_ctxt, totally \a w pixels.
14270  *
14271  * \sa SetUserCompositionOps, COMP_CTXT
14272  */
14273 typedef void (*CB_COMP_PUTHLINE) (COMP_CTXT* comp_ctxt, gal_uint8* src, int bkmode, int w);
14274 
14296 MG_EXPORT int GUIAPI SetUserCompositionOps (HDC hdc,
14297  CB_COMP_SETPIXEL comp_setpixel,
14298  CB_COMP_SETHLINE comp_sethline,
14299  CB_COMP_PUTHLINE comp_puthline,
14300  void* user_comp_ctxt);
14301 
14312 MG_EXPORT GHANDLE GetVideoHandle (HDC hdc);
14313 
14314 #ifdef _MGGAL_DRM
14315 
14342 MG_EXPORT int drmGetDeviceFD (GHANDLE video);
14343 
14347 typedef struct _DrmSurfaceInfo {
14349  uint32_t handle;
14355  uint32_t name;
14358  uint32_t fb_id;
14359 
14361  uint32_t width;
14363  uint32_t height;
14365  uint32_t pitch;
14367  uint32_t drm_format;
14369  size_t size;
14371  off_t offset;
14372 } DrmSurfaceInfo;
14373 
14384 MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info);
14385 
14400 MG_EXPORT HDC drmCreateDCFromNameEx (GHANDLE video,
14401  uint32_t name, uint32_t drm_format, off_t offset,
14402  uint32_t width, uint32_t height, uint32_t pitch);
14403 
14404 static inline HDC drmCreateDCFromName (GHANDLE video,
14405  uint32_t name, uint32_t drm_format,
14406  uint32_t width, uint32_t height, uint32_t pitch)
14407 {
14408  return drmCreateDCFromNameEx (video,
14409  name, drm_format, 0, width, height, pitch);
14410 }
14411 
14427 MG_EXPORT HDC drmCreateDCFromPrimeFdEx (GHANDLE video,
14428  int prime_fd, size_t size, uint32_t drm_format, off_t offset,
14429  uint32_t width, uint32_t height, uint32_t pitch);
14430 
14431 static inline HDC drmCreateDCFromPrimeFd (GHANDLE video,
14432  int prime_fd, size_t size, uint32_t drm_format,
14433  uint32_t width, uint32_t height, uint32_t pitch)
14434 {
14435  return drmCreateDCFromPrimeFdEx (video,
14436  prime_fd, size, drm_format, 0, width, height, pitch);
14437 }
14438 
14454 MG_EXPORT HDC drmCreateDCFromHandleEx (GHANDLE video,
14455  uint32_t handle, size_t size, uint32_t drm_format, off_t offset,
14456  uint32_t width, uint32_t height, uint32_t pitch);
14457 
14458 static inline HDC drmCreateDCFromHandle (GHANDLE video,
14459  uint32_t handle, size_t size, uint32_t drm_format,
14460  uint32_t width, uint32_t height, uint32_t pitch)
14461 {
14462  return drmCreateDCFromHandleEx (video,
14463  handle, size, drm_format, 0, width, height, pitch);
14464 }
14465 
14468 #endif /* _MGGAL_DRM */
14469 
14472 #ifdef _MGGAL_HI3560
14473 
14474 /* screen attribute type */
14475 #define SCREEN_ATTR_ALPHA_CHANNEL 0x01 // alpha channel
14476 #define SCREEN_ATTR_COLORKEY 0x02 // colorkey
14477 #define SCREEN_ATTR_COLORSPACE 0x03 // colorspace
14478 #define SCREEN_ATTR_ALPHA 0x04
14479 #define SCREEN_NO_EXIST -99 // screen don't exist
14480 
14481 /* API speicific to Hi3560 GAL engines */
14482 MG_EXPORT int hi3560GetVideoFD (void);
14483 MG_EXPORT void* hi3560GetFBAddress (void);
14484 MG_EXPORT int hi3560SetScreenAttr (Uint8 siAttr, void* pValue);
14485 
14486 #endif /* _MGGAL_HI3560 */
14487 
14488 #ifdef __cplusplus
14489 }
14490 #endif /* __cplusplus */
14491 
14492 #endif /* _MGUI_GDI_H */
14493 
14494 
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)
Determine whether a point lies within an rectangle.
Definition: gdi.h:5894
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 a DC to screen. ...
MG_EXPORT LanguageCode GUIAPI LanguageCodeFromISO639s1(Uint16 iso639_1)
Get MiniGUI language code from an encoded ISO639-1 language code.
static HDC GUIAPI GetClientDC(HWND hWnd)
Get a client DC of a window.
Definition: gdi.h:1520
MG_EXPORT int GUIAPI GetSysFontHeight(int font_id)
Get 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:3326
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:13402
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:4033
int height
Definition: gdi.h:4209
unsigned char delimiter
Definition: gdi.h:8354
int x_off
Definition: gdi.h:13444
MG_EXPORT BOOL GUIAPI IsUCharTitle(Uchar32 uc)
Uint32 bmHeight
Definition: gdi.h:11038
DWORD32 style
Definition: gdi.h:6387
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)
Retrieve mapping parameters of a device context.
MG_EXPORT void GUIAPI UnloadMyBitmap(PMYBITMAP my_bmp)
Unloads a bitmap.
int x
Definition: gdi.h:4342
MG_EXPORT HDC GUIAPI GetEffectiveCDC(HWND hwnd)
Get the effective client DC of a window.
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:6389
Definition: common.h:966
int extra_x
Definition: gdi.h:13404
int starty
Definition: gdi.h:10783
Definition: gdi.h:4339
int descent
Definition: gdi.h:6395
void(* CB_ONE_SCANLINE)(void *context, MYBITMAP *my_bmp, int y)
The type of scanline loaded callback.
Definition: gdi.h:11078
size_t size
Definition: gdi.h:14369
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:11759
MG_EXPORT BOOL GUIAPI IsCovered(const RECT *prc1, const RECT *prc2)
Determine whether one rectangle is covered by another.
int BOOL
A type definition for boolean value.
Definition: common.h:343
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)
Get the alpha component from a RGBA quadruple value rgba.
Definition: common.h:897
MG_EXPORT BOOL GUIAPI DestroyLayout(LAYOUT *layout)
Destroy the specified layout information structure.
#define GetBValue(rgba)
Get the blue component from a RGBA quadruple value rgba.
Definition: common.h:888
char * type
Definition: gdi.h:6381
MG_EXPORT const char *GUIAPI CheckBitmapType(MG_RWops *fp)
Check the type of the bitmap in a data source.
Uint32 bmPitch
Definition: gdi.h:11040
Uint16 BreakOppo
Definition: gdi.h:9960
ACHARSHAPETYPE
Achar32 shape type.
Definition: gdi.h:12357
MG_EXPORT int GUIAPI UCharCombiningClass(Uchar32 uc)
Uint8 whitespace
Definition: gdi.h:13414
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:460
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)
Get the raster operation of a DC.
static BOOL GUIAPI InitVectorialFonts(void)
Initializes vectorial font renderer.
Definition: gdi.h:7607
struct _CLIPRECT * next
Definition: gdi.h:772
MG_EXPORT RGBCOLOR GUIAPI GetTextColorInTextRuns(const TEXTRUNS *truns, int index)
MG_EXPORT BOOL GUIAPI SetMemDCAlpha(HDC mem_dc, DWORD flags, Uint8 alpha)
Set the alpha value for the entire surface of a DC, as opposed to using the alpha component of each p...
MG_EXPORT BOOL GUIAPI SyncUpdateSurface(HWND hwnd)
Synchronize the update rectangles of the backing surface of a window to screen.
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)
Determine 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:4344
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)
Set a region to contain only one rect.
Definition: gdi.h:4157
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 DC for a main 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:14365
MG_EXPORT BOOL GUIAPI SetColorfulPalette(HDC hdc)
Set a DC with colorful palette.
static void CopyRect(RECT *pdrc, const RECT *psrc)
Copies one rectangle to another.
Definition: gdi.h:5810
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:10970
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)
Set palette entries of a DC.
MG_EXPORT Uint32 GUIAPI GetDCAttr(HDC hdc, int attr)
Get 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:5468
int y
Definition: gdi.h:13440
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:1021
RECT rcBound
Definition: gdi.h:807
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.
MG_EXPORT HDC GUIAPI GetDCEx(HWND hWnd, BOOL bClient)
Get a window or client DC of a window.
Uint8 bmType
Definition: gdi.h:11023
MG_EXPORT BOOL GUIAPI IsEmptyClipRgn(const CLIPRGN *pRgn)
Determine 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)
Get 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:11031
MG_EXPORT BOOL GUIAPI IsUCharXDigit(Uchar32 uc)
DWORD flags
Definition: gdi.h:10956
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:829
void * heap
Definition: gdi.h:609
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:13460
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:6696
MG_EXPORT HWND GUIAPI WindowFromDC(HDC hdc)
Get the window handle from DC.
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:2243
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:8064
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:8677
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)
Get palette entries of a logical palette.
#define MAKEWORD16(low, high)
Makes a 16-bit word from low byte and high byte.
Definition: common.h:745
uint32_t width
Definition: gdi.h:14361
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)
Set palette entries of a logical palette.
struct _CLIPRGN CLIPRGN
MG_EXPORT HICON GUIAPI LoadBitmapIconFromMem(HDC hdc, const void *mem, size_t size, const char *ext)
Load an icon from memory.
MG_EXPORT HDC GUIAPI GetSecondaryDC(HWND hwnd)
Retrieve and return the secondary DC of a specific window.
Uint8 bmBitsPerPixel
Definition: gdi.h:11025
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:936
int frames
Definition: gdi.h:10958
int len
Definition: gdi.h:8352
MG_EXPORT int GUIAPI LoadMyBitmapEx(PMYBITMAP my_bmp, RGB *pal, MG_RWops *area, const char *ext)
Load 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)
Set 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)
Get the nearest palette index in the logical palette for a spefici color.
MG_EXPORT ScriptType GUIAPI UCharGetScriptType(Uchar32 ch)
PTJoinStyle
Definition: gdi.h:4080
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:4349
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:7478
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:1106
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)
Set a rectangle.
Definition: gdi.h:5774
Uint8 ellipsis
Definition: gdi.h:13464
Uint32 bmAlphaPitch
Definition: gdi.h:11052
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)
Set the raster operation of a DC to a new value.
Uint8 hanged
Definition: gdi.h:13486
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)
Get 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)
Retrieve information of multi-byte words in a string.
char * charset
Definition: gdi.h:6385
MG_EXPORT int GUIAPI GetTextMCharInfo(PLOGFONT log_font, const char *mstr, int len, int *pos_chars)
Retrieve 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)
Get metrics information of a logical font.
uint32_t height
Definition: gdi.h:14363
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:167
LanguageCode
Definition: gdi.h:7110
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:4355
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:11029
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:3307
ColorBlendMethod
Definition: gdi.h:5177
MG_EXPORT void GUIAPI SelectClipRect(HDC hdc, const RECT *prc)
Set the visible region of a DC to be a rectangle.
MG_EXPORT Uchar32 UCharToUpper(Uchar32 uc)
MG_EXPORT int GUIAPI GetMaxFontWidth(HDC hdc)
Retrieve the maximal character width of the current logical font in a DC.
static int LoadBitmapEx(HDC hdc, PBITMAP pBitmap, MG_RWops *area, const char *ext)
Load a device-dependent bitmap from a general data source.
Definition: gdi.h:11287
signed char Sint8
A type definition for an 8-bit signed character.
Definition: common.h:162
MG_EXPORT int GUIAPI GetFontHeight(HDC hdc)
Retrieve the height of the current logical font in a DC.
MG_EXPORT const char *GUIAPI GetSysCharset(BOOL wchar)
Get the current system charset.
struct _GLYPHINFO GLYPHINFO
Data type of struct _GLYPHINFO.
Uint32 bmColorRep
Definition: gdi.h:11033
void(* CB_ARC)(void *context, int x, int y)
The type of arc generator callback.
Definition: gdi.h:3543
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:11796
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:13968
MG_EXPORT UVerticalOrient GUIAPI UCharGetVerticalOrientation(Uchar32 uc)
int ave_width
Definition: gdi.h:7521
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:3510
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 int GUIAPI LoadMyBitmapFromMem(PMYBITMAP my_bmp, RGB *pal, const void *mem, size_t size, const char *ext)
Load a MYBITMAP object from memory.
MG_EXPORT BOOL GUIAPI GetIconSize(HICON hicon, int *w, int *h)
Get 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:10960
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)
Get logical font information of a DC.
static void GUIAPI ReleaseSecondaryDC(HWND hwnd, HDC hdc)
Release the DC returned by GetSecondaryClientDC.
Definition: gdi.h:2356
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:412
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)
Set the visible region of a DC to be a region.
struct _LAYOUTLINE LAYOUTLINE
Definition: gdi.h:13849
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:13612
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:6391
MG_EXPORT void GUIAPI SetPenDashes(HDC hdc, int dash_offset, const unsigned char *dash_list, int n)
Set 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)
Get 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:13843
MG_EXPORT int GUIAPI LoadMyBitmapSL(MG_RWops *area, void *load_info, MYBITMAP *my_bmp, CB_ONE_SCANLINE cb, void *context)
Load MYBITMAP scanlines from a data source one by one.
Uint32 BidiBracketType
Definition: gdi.h:8672
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:11604
MG_EXPORT void GUIAPI DPtoLP(HDC hdc, POINT *pPt)
Converts device coordinates into logical coordinates.
off_t offset
Definition: gdi.h:14371
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:3474
MG_EXPORT BOOL GUIAPI PolygonIsMonotoneVertical(const POINT *pts, int vertices)
Check 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:13448
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:358
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:8664
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:4218
MG_EXPORT void GUIAPI GetLastTextOutPos(HDC hdc, POINT *pt)
Retrieve 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)
Get the color in RGBA quarter from a pixel value under a DC.
Definition: gdi.h:3289
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:1059
MG_EXPORT int GUIAPI GetFirstMCharLen(PLOGFONT log_font, const char *mstr, int len)
Retrieve the length of the first multi-byte character in a string.
BYTE type
Definition: gdi.h:799
int descent
Definition: gdi.h:7516
Uint8 orientation
Definition: gdi.h:13476
GHANDLE HWND
Handle to main window or control.
Definition: common.h:407
MG_EXPORT int GUIAPI LoadBitmapFromMem(HDC hdc, PBITMAP pBitmap, const void *mem, size_t size, const char *ext)
Load a device-dependent bitmap from memory.
MG_EXPORT BOOL GUIAPI PtInRegion(const PCLIPRGN region, int x, int y)
Determine whether a point is in a region.
static void SetRectEmpty(RECT *prc)
Empties a rectangle.
Definition: gdi.h:5793
MG_EXPORT gal_pixel GUIAPI SetPixelRGB(HDC hdc, int x, int y, Uint8 r, Uint8 g, Uint8 b)
Set the pixel by a RGB triple at the specified position on a DC.
MG_EXPORT HDC GUIAPI GetDCInSecondarySurface(HWND hWnd, BOOL bClient)
Get a window or client DC by using the secondary surface if possible.
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)
Get 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:4204
int width
Definition: gdi.h:4347
MG_EXPORT HICON GUIAPI LoadBitmapIconFromFile(HDC hdc, const char *file_name)
Load an icon from a bitmap file.
int line_adv
Definition: gdi.h:13406
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:4153
static LanguageCode GUIAPI LanguageCodeFromISO639s1Code(const char *iso639_1)
Get MiniGUI language code from an ISO639-1 language code string.
Definition: gdi.h:7432
Uint8 suppressed
Definition: gdi.h:13410
int free
Definition: gdi.h:605
MG_EXPORT int GUIAPI GetSysCharHeight(void)
Get 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:13436
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)
Get the pixel values from a color array in RGB triple under a DC.
Uint32 pitch
Definition: gdi.h:10972
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:2047
static ScriptType GUIAPI ScriptTypeFromISO15924Code(const char *iso15924)
Definition: gdi.h:10244
Uint8 * bmBits
Definition: gdi.h:11042
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)
Get 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:989
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:6397
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:3443
#define MakeRGBA(r, g, b, a)
Makes a RGBA quadruple value from red r, green g, blue b and alpha components.
Definition: common.h:909
struct _FONTMETRICS FONTMETRICS
Uint8 suppressed
Definition: gdi.h:13456
BOOL(* CB_EQUAL_PIXEL)(void *context, int x, int y)
Flodd filling generator&#39;s equation callback.
Definition: gdi.h:3682
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:14349
static void OffsetRect(RECT *prc, int x, int y)
Moves a rectangle by offsets.
Definition: gdi.h:5831
int ascent
Definition: gdi.h:6393
MG_EXPORT void GUIAPI PolyLineTo(HDC hdc, const POINT *pts, int vertices)
Draws a polyline.
MG_EXPORT gal_pixel SysPixelIndex[]
The pre-defined system pixel values.
RECT rc
Definition: gdi.h:768
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)
Load 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)
Get 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)
Get 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:369
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)
Get palette entries of a DC.
PVOID GHANDLE
General handle.
Definition: common.h:402
PenType
Definition: gdi.h:3962
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:3688
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:10968
MG_EXPORT int GUIAPI LoadBitmapEx2(HDC hdc, PBITMAP pBitmap, MG_RWops *area, const char *ext, CB_ALLOC_BITMAP_BUFF cb_alloc_buff, void *context)
Load a device-dependent bitmap from a general data source.
#define GetRValue(rgba)
Get the red component from a RGBA quadruple value rgba.
Definition: common.h:870
MG_EXPORT void GUIAPI FillCircle(HDC hdc, int sx, int sy, int r)
Fills a circle.
#define GetGValue(rgba)
Get the green component from a RGBA quadruple value rgba.
Definition: common.h:879
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)
Get the current clipping region of a DC.
Definition: gdi.h:788
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:157
int bmp_pitch
Definition: gdi.h:7551
int advance_x
Definition: gdi.h:7546
static gal_pixel RGB2Pixel(HDC hdc, Uint8 r, Uint8 g, Uint8 b)
Get the pixel value from a color in RGB triple under a DC.
Definition: gdi.h:3194
Uint32 bmWidth
Definition: gdi.h:11036
Uint8 alpha
Definition: gdi.h:10962
int bbox_x
Definition: gdi.h:13400
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:417
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)
Get the pixel value from a color in RGBA quarter under a DC.
Definition: gdi.h:3150
int bbox_x
Definition: gdi.h:7544
Uint32 transparent
Definition: gdi.h:10965
size_t bmp_size
Definition: gdi.h:7549
Definition: common.h:1012
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:4359
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:776
MG_EXPORT int GUIAPI GetClipBox(HDC hdc, RECT *clipbox)
Retrieve 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:11027
int width
Definition: gdi.h:4207
PCLIPRECT head
Definition: gdi.h:811
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:4212
const MG_EXPORT RGB SysPixelColor[]
The pre-defined system RGB colors.
uint32_t fb_id
Definition: gdi.h:14358
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)
Get the colors in RGBA quarter from a array of pixel values under a DC.
static HDC GUIAPI GetDC(HWND hWnd)
Get a window DC of a window.
Definition: gdi.h:1498
PBLOCKHEAP heap
Definition: gdi.h:820
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)
Set 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:5871
BYTE * bits
Definition: gdi.h:10977
MG_EXPORT void GUIAPI OffsetRegion(PCLIPRGN region, int x, int y)
Offsets the region.
Uint16 ParagraphDir
Definition: gdi.h:8693
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:754
MG_EXPORT void GUIAPI SetPixel(HDC hdc, int x, int y, gal_pixel pixel)
Set the pixel with a new pixel value at the specified position on a DC.
MG_EXPORT void GUIAPI GetBoundsRect(HDC hdc, RECT *pRect)
Retrieve 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:724
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:7553
long fixed
Data type of fixed point.
Definition: common.h:1117
ScriptType
Definition: gdi.h:6914
Uint8 * bmAlphaMask
Definition: gdi.h:11049
unsigned int Uint32
A type definition for a 32-bit unsigned integer.
Definition: common.h:177
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:13426
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:14367
int nr_chars
Definition: gdi.h:10779
size_t size
Definition: gdi.h:4215
MG_EXPORT HPALETTE GUIAPI GetDefaultPalette(void)
Get the system default logical palette.
Uint8 BidiArabicProp
Definition: gdi.h:8681
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:604
MG_EXPORT int GUIAPI GetFirstWord(PLOGFONT log_font, const char *mstr, int len, WORDINFO *word_info)
Retrieve 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:6414
Uint32 size
Definition: gdi.h:10974
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 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)
Get 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:6609
MG_EXPORT int GUIAPI LoadBitmapFromFile(HDC hdc, PBITMAP pBitmap, const char *spFileName)
Load a device-dependent bitmap from a file.
int startx
Definition: gdi.h:10781
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:940
MG_EXPORT RGBCOLOR GUIAPI GetNearestColor(HDC hdc, Uint8 red, Uint8 green, Uint8 blue)
Get the nearest color compliant to a DC for a spefici color.
Definition: gdi.h:10989
MG_EXPORT BOOL GUIAPI UCharCompose(Uchar32 a, Uchar32 b, Uchar32 *ch)
Definition: gdi.h:7464
MG_EXPORT int GUIAPI StretchPaintImageFromMem(HDC hdc, int x, int y, int w, int h, const void *mem, size_t size, const char *ext)
Paints an image from memory on device directly.
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)
Get the system logical font through an font identifier.
Definition: gdi.h:8221
MG_EXPORT RGBCOLOR GUIAPI GetBackgroundColorInTextRuns(const TEXTRUNS *truns, int index)
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:10787
static BOOL GUIAPI SetPixelInBitmap(const BITMAP *bmp, int x, int y, gal_pixel pixel)
Set pixel value in a BITMAP object.
Definition: gdi.h:5520
static void GUIAPI TermVectorialFonts(void)
Terminates vectorial font renderer.
Definition: gdi.h:7627
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:10785
This file includes macro definitions and typedefs that commonly used by MiniGUI.
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:7519
MG_EXPORT gal_pixel GUIAPI GetPixelRGB(HDC hdc, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b)
Get the pixel value at the specified position on a DC in RGB triple.
char * family
Definition: gdi.h:6383
MG_EXPORT BOOL GUIAPI IsRectEmpty(const RECT *prc)
Determine 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)
Determine 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:13452
#define FALSE
FALSE value, defined as 0 by MiniGUI.
Definition: common.h:351
MG_EXPORT void DestroyBlockDataHeap(PBLOCKHEAP heap)
Destroys a private block data heap.
MG_EXPORT int GUIAPI GetSysCharWidth(void)
Get the width of a single-byte character of the default system font.
Definition: gdi.h:6379
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.
static BOOL GUIAPI AreRegionsIntersected(const PCLIPRGN s1, const PCLIPRGN s2)
Determine whether two regions are intersected.
Definition: gdi.h:1126
Definition: gdi.h:3968
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:664
DWORD32 RGBCOLOR
A type definition for a RGB color value.
Definition: common.h:860
int font_height
Definition: gdi.h:7512
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:610
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:944
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)
Load 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.
ColorLogicalOp
Definition: gdi.h:5306
size_t heap_size
Definition: gdi.h:601
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:1025
MG_EXPORT void GUIAPI UStrGetJoiningTypes(const Uchar32 *ucs, int nr_ucs, BidiJoiningType *joining_types)
Get joining types for a string of Unicode characters.
static HDC GUIAPI GetSecondaryClientDC(HWND hwnd)
Get a client DC of a window by using the secondary surface if possible.
Definition: gdi.h:2340
MG_EXPORT Uint32 GUIAPI SetDCAttr(HDC hdc, int attr, Uint32 value)
Set a specified attribute value of a DC.
Definition: gdi.h:763
static void Pixel2RGB(HDC hdc, gal_pixel pixel, Uint8 *r, Uint8 *g, Uint8 *b)
Get the color in RGB triple from a pixel value under a DC.
Definition: gdi.h:3241
int prime_fd
Definition: gdi.h:14352
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:8356
MG_EXPORT void GUIAPI VFlipBitmap(BITMAP *bmp, unsigned char *inter_buff)
Vertical Flip the special Bitmap object.
MG_EXPORT int GUIAPI PaintImageFromMem(HDC hdc, int x, int y, const void *mem, size_t size, const char *ext)
Paints an image from memory on device directly.
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:597
BLOCKHEAP * PBLOCKHEAP
Data type of the pointer to a BLOCKHEAP.
Definition: gdi.h:618
MG_EXPORT BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32 *mirrored)
Get mirrored character.
Uint16 BidiType
Definition: gdi.h:8668
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:14355
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)
Load 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)
Check whether a point is visible.
MG_EXPORT void GUIAPI Pixel2RGBs(HDC hdc, const gal_pixel *pixels, RGB *rgbs, int count)
Get 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)
Set the color key (transparent pixel) of a memory DC.
MG_EXPORT PLOGFONT GUIAPI GetCurFont(HDC hdc)
Get the pointer to the current logical font of a DC.
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:6420
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)
Check 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:7514
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:1017
MG_EXPORT BOOL GUIAPI IsUCharDefined(Uchar32 uc)
Definition: gdi.h:4161
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:1795
BYTE a
Definition: common.h:1029
MG_EXPORT BOOL GUIAPI RectInRegion(const PCLIPRGN region, const RECT *rect)
Determine whether a rectangle is intersected with a region.
static void InflateRect(RECT *prc, int cx, int cy)
Increases or decreases the width and height of an rectangle.
Definition: gdi.h:5852
MG_EXPORT BOOL GUIAPI UChar2AChar(LOGFONT *logfont, Uchar32 uc, Achar32 *ac)
Get the LOGFONT Achar32 value from a Unicode character value.
BOOL(* CB_ALLOC_BITMAP_BUFF)(void *context, BITMAP *bmp)
The type of callback to allocate pixel buffer for BITMAP object.
Definition: gdi.h:11072
BITMAP * PBITMAP
Data type of pointer to a BITMAP.
Definition: gdi.h:709
void(* CB_POLYGON)(void *context, int x1, int x2, int y)
The type of polygon generator callback.
Definition: gdi.h:3575
MG_EXPORT int GUIAPI GetSysFontAveWidth(int font_id)
Get 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:427
PCLIPRECT tail
Definition: gdi.h:815
MG_EXPORT int GUIAPI GetSysFontMaxWidth(int font_id)
Get 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.