MiniGUI API Reference (MiniGUI-Standalone)  v5.0.6
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 #ifdef _MGRM_THREADS
591  pthread_mutex_t lock;
592 #endif
593 
594  size_t sz_block;
596  size_t sz_heap;
598  size_t nr_alloc;
600  size_t sz_usage_bmp;
601 
603  unsigned char* heap;
605  unsigned char* usage_bmp;
606 } BLOCKHEAP;
607 
615 
634 MG_EXPORT BOOL InitBlockDataHeap (PBLOCKHEAP heap,
635  size_t bd_size, size_t heap_size);
636 
652 MG_EXPORT void* BlockDataAlloc (PBLOCKHEAP heap);
653 
667 MG_EXPORT void BlockDataFree (PBLOCKHEAP heap, void* data);
668 
677 MG_EXPORT void DestroyBlockDataHeap (PBLOCKHEAP heap);
678 
688 struct _BITMAP;
689 
694 typedef struct _BITMAP BITMAP;
695 
701 typedef BITMAP* PBITMAP;
702 
703 struct _MYBITMAP;
704 
709 typedef struct _MYBITMAP MYBITMAP;
710 
716 typedef struct _MYBITMAP* PMYBITMAP;
717 
718 
755 typedef struct _CLIPRECT
756 {
764  struct _CLIPRECT* next;
768  struct _CLIPRECT* prev;
769 } CLIPRECT;
770 typedef CLIPRECT* PCLIPRECT;
771 
772 /* Clipping Region */
773 #define NULLREGION 0x00
774 #define SIMPLEREGION 0x01
775 #define COMPLEXREGION 0x02
776 
780 typedef struct _CLIPRGN
781 {
813 } CLIPRGN;
814 
821 typedef CLIPRGN* PCLIPRGN;
822 
836 #define InitFreeClipRectList(heap, size) \
837  InitBlockDataHeap (heap, sizeof (CLIPRECT), size)
838 
849 #define ClipRectAlloc(heap) BlockDataAlloc (heap)
850 
863 #define FreeClipRect(heap, cr) BlockDataFree (heap, cr);
864 
876 #define DestroyFreeClipRectList(heap) DestroyBlockDataHeap (heap);
877 
898 MG_EXPORT void GUIAPI InitClipRgn (PCLIPRGN pRgn, PBLOCKHEAP pFreeList);
899 
910 MG_EXPORT void GUIAPI EmptyClipRgn (PCLIPRGN pRgn);
911 
921 MG_EXPORT PCLIPRGN GUIAPI CreateClipRgn (void);
922 
933 MG_EXPORT void GUIAPI DestroyClipRgn (PCLIPRGN pRgn);
934 
951 MG_EXPORT BOOL GUIAPI ClipRgnCopy (PCLIPRGN pDstRgn, const CLIPRGN* pSrcRgn);
952 
973 MG_EXPORT BOOL GUIAPI ClipRgnIntersect (PCLIPRGN pRstRgn,
974  const CLIPRGN* pRgn1, const CLIPRGN* pRgn2);
975 
988 MG_EXPORT void GUIAPI GetClipRgnBoundRect (PCLIPRGN pRgn, PRECT pRect);
989 
1006 MG_EXPORT BOOL GUIAPI SetClipRgn (PCLIPRGN pRgn, const RECT* pRect);
1007 
1021 MG_EXPORT BOOL GUIAPI IsEmptyClipRgn (const CLIPRGN* pRgn);
1022 
1036 MG_EXPORT BOOL GUIAPI AddClipRect (PCLIPRGN pRgn, const RECT* pRect);
1037 
1052 MG_EXPORT BOOL GUIAPI IntersectClipRect (PCLIPRGN pRgn, const RECT* pRect);
1053 
1068 MG_EXPORT BOOL GUIAPI SubtractClipRect (PCLIPRGN pRgn, const RECT* pRect);
1069 
1085 MG_EXPORT BOOL GUIAPI PtInRegion (const PCLIPRGN region, int x, int y);
1086 
1101 MG_EXPORT BOOL GUIAPI RectInRegion (const PCLIPRGN region, const RECT* rect);
1102 
1117 static inline
1118 BOOL GUIAPI AreRegionsIntersected (const PCLIPRGN s1, const PCLIPRGN s2)
1119 {
1120  PCLIPRECT crc = s1->head;
1121  while (crc) {
1122  if (RectInRegion (s2, &crc->rc))
1123  return TRUE;
1124  crc = crc->next;
1125  }
1126 
1127  return FALSE;
1128 }
1129 
1145 MG_EXPORT void GUIAPI OffsetRegionEx (PCLIPRGN region, const RECT *rcClient,
1146  const RECT *rcScroll, int x, int y);
1147 
1159 MG_EXPORT void GUIAPI OffsetRegion (PCLIPRGN region, int x, int y);
1160 
1177 MG_EXPORT BOOL GUIAPI UnionRegion (PCLIPRGN dst,
1178  const CLIPRGN* src1, const CLIPRGN* src2);
1179 
1195 MG_EXPORT BOOL GUIAPI SubtractRegion (CLIPRGN* rgnD,
1196  const CLIPRGN* rgnM, const CLIPRGN* rgnS);
1197 
1214 MG_EXPORT BOOL GUIAPI XorRegion (CLIPRGN *dst,
1215  const CLIPRGN *src1, const CLIPRGN *src2);
1216 
1222 #define UnionRectWithRegion AddClipRect
1223 
1229 #define CopyRegion ClipRgnCopy
1230 
1236 #define IntersectRegion ClipRgnIntersect
1237 
1251 MG_EXPORT BOOL GUIAPI InitCircleRegion (PCLIPRGN dst, int x, int y, int r);
1252 
1267 MG_EXPORT BOOL GUIAPI InitEllipseRegion (PCLIPRGN dst,
1268  int x, int y, int rx, int ry);
1269 
1282 MG_EXPORT BOOL GUIAPI InitPolygonRegion (PCLIPRGN dst,
1283  const POINT* pts, int vertices);
1284 
1358 #define HDC_SCREEN ((HDC)0)
1359 
1360 /*
1361  * \def HDC_SCREEN_SYS
1362  * \brief This is a system screen DC created for internal use.
1363  *
1364  * Under compositing schema, this DC stands for the surface of the
1365  * real screen. The compositor running in the server will
1366  * use this DC to compositing the surfaces created and rendered by
1367  * the server and the clients to the screen. For clients, this DC
1368  * essentially is HDC_SCREEN.
1369  *
1370  * Under MiniGUI-Standalone runmode, MiniGUI-Threads
1371  * runmode, and MiniGUI-Processes runmode with shared frame buffer schema,
1372  * MiniGUI uses it to draw popup menus and other global objects.
1373  *
1374  * \sa HDC_SCREEN
1375  */
1376 #define HDC_SCREEN_SYS ((HDC)1)
1377 
1382 #define HDC_INVALID ((HDC)-1)
1383 
1384 #define GDCAP_COLORNUM 0
1385 #define GDCAP_HPIXEL 1
1386 #define GDCAP_VPIXEL 2
1387 #define GDCAP_MAXX 3
1388 #define GDCAP_MAXY 4
1389 #define GDCAP_DEPTH 5
1390 #define GDCAP_BPP 6
1391 #define GDCAP_BITSPP 7
1392 #define GDCAP_RMASK 8
1393 #define GDCAP_GMASK 9
1394 #define GDCAP_BMASK 10
1395 #define GDCAP_AMASK 11
1396 #define GDCAP_PITCH 12
1397 #define GDCAP_DPI 13
1398  #define GDCAP_DPI_DEFAULT 96
1399  #define GDCAP_DPI_MINIMAL 36
1400 
1448 MG_EXPORT Uint32 GUIAPI GetGDCapability (HDC hdc, int iItem);
1449 
1471 MG_EXPORT HDC GUIAPI GetDCEx (HWND hWnd, BOOL bClient);
1472 
1490 static inline HDC GUIAPI GetDC (HWND hWnd)
1491 {
1492  return GetDCEx (hWnd, FALSE);
1493 }
1494 
1512 static inline HDC GUIAPI GetClientDC (HWND hWnd)
1513 {
1514  return GetDCEx (hWnd, TRUE);
1515 }
1516 
1541 MG_EXPORT HDC GUIAPI GetSubDC (HDC hdc, int off_x, int off_y, int width, int height);
1542 
1553 MG_EXPORT void GUIAPI ReleaseDC (HDC hdc);
1554 
1568 MG_EXPORT HWND GUIAPI WindowFromDC (HDC hdc);
1569 
1590 MG_EXPORT int GUIAPI SaveDC (HDC hdc);
1591 
1617 MG_EXPORT BOOL GUIAPI RestoreDC (HDC hdc, int saved_dc);
1618 
1619 #define MEMDC_FLAG_NONE 0x00000000 /* None. */
1620 #define MEMDC_FLAG_SWSURFACE 0x00000000 /* DC is in system memory */
1621 #define MEMDC_FLAG_HWSURFACE 0x00000001 /* DC is in video memory */
1622 #define MEMDC_FLAG_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
1623 #define MEMDC_FLAG_SRCALPHA 0x00010000 /* Blit uses source alpha blending*/
1624 #define MEMDC_FLAG_SRCPIXELALPHA 0x00020000 /* Blit uses source per-pixel alpha blending*/
1625 #define MEMDC_FLAG_RLEACCEL 0x00004000 /* Surface is RLE encoded */
1626 
1647 MG_EXPORT HDC GUIAPI CreateCompatibleDCEx (HDC hdc, int width, int height);
1648 
1663 MG_EXPORT BOOL GUIAPI IsCompatibleDC (HDC hdc1, HDC hdc2);
1664 
1677 MG_EXPORT BOOL GUIAPI IsMemDC (HDC hdc);
1678 
1691 MG_EXPORT BOOL GUIAPI IsScreenDC (HDC hdc);
1692 
1705 MG_EXPORT BOOL GUIAPI IsWindowDC (HDC hdc);
1706 
1750 MG_EXPORT HDC GUIAPI CreateMemDCEx (int width, int height, int depth, DWORD flags,
1751  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask,
1752  void* bits, int pitch);
1753 
1787 static inline HDC GUIAPI CreateMemDC (int width, int height, int depth, DWORD flags,
1788  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
1789 {
1790  return CreateMemDCEx (width, height, depth, flags, Rmask, Gmask, Bmask, Amask,
1791  NULL, 0);
1792 }
1793 
1818 MG_EXPORT HDC GUIAPI CreateSubMemDC (HDC parent, int off_x, int off_y,
1819  int width, int height, BOOL comp_to_parent);
1820 
1836 MG_EXPORT HDC GUIAPI CreateMemDCFromBitmap (HDC hdc, const BITMAP* bmp);
1837 
1863 MG_EXPORT HDC GUIAPI CreateMemDCFromMyBitmap (const MYBITMAP* my_bmp, const RGB* pal);
1864 
1888 MG_EXPORT BOOL GUIAPI ConvertMemDC (HDC mem_dc, HDC ref_dc, DWORD flags);
1889 
1919 MG_EXPORT BOOL GUIAPI SetMemDCAlpha (HDC mem_dc, DWORD flags, Uint8 alpha);
1920 
1940 MG_EXPORT BOOL GUIAPI SetMemDCColorKey (HDC mem_dc, DWORD flags,
1941  Uint32 color_key);
1942 
1955 MG_EXPORT void GUIAPI DeleteMemDC (HDC mem_dc);
1956 
1969 #define CreateCompatibleDC(hdc) CreateCompatibleDCEx(hdc, 0, 0)
1970 
1981 #define DeleteCompatibleDC(hdc) DeleteMemDC(hdc)
1982 
2020 MG_EXPORT Uint8* GUIAPI LockDC (HDC hdc, const RECT* rw_rc,
2021  int* width, int* height, int* pitch);
2022 
2039 typedef void (* CB_DIRECT_DRAW_RECT) (HDC hdc, Uint8 * pixels,
2040  int pitch, int bytesPerPixel, const RECT* rc, void* context);
2041 
2068 MG_EXPORT BOOL GUIAPI LockDCEx (HDC hdc, const PCLIPRGN region,
2069  void* context, CB_DIRECT_DRAW_RECT cb);
2070 
2079 MG_EXPORT void GUIAPI UnlockDC (HDC hdc);
2080 
2103 MG_EXPORT HDC GUIAPI CreatePrivateDC (HWND hwnd);
2104 
2128 MG_EXPORT HDC GUIAPI CreatePrivateClientDC (HWND hwnd);
2129 
2156 HDC GUIAPI CreatePrivateSubDC(HDC hdc, int off_x, int off_y,
2157  int width, int height);
2158 
2180 MG_EXPORT HDC GUIAPI GetPrivateClientDC (HWND hwnd);
2181 
2191 MG_EXPORT void GUIAPI DeletePrivateDC (HDC hdc);
2192 
2218 MG_EXPORT HDC GUIAPI CreateSecondaryDC (HWND hwnd);
2219 
2235 typedef int (* ON_UPDATE_SECONDARYDC)(HWND hwnd, HDC secondary_dc,
2236  HDC real_dc, const RECT* secondary_rc, const RECT* real_rc,
2237  const RECT* main_update_rc);
2238 
2239 #define ON_UPDSECDC_DEFAULT ((ON_UPDATE_SECONDARYDC)0)
2240 #define ON_UPDSECDC_DONOTHING ((ON_UPDATE_SECONDARYDC)-1)
2241 
2267 MG_EXPORT HDC GUIAPI SetSecondaryDC (HWND hwnd, HDC secondary_dc,
2268  ON_UPDATE_SECONDARYDC on_update_secondarydc);
2269 
2288 MG_EXPORT HDC GUIAPI GetSecondaryDC (HWND hwnd);
2289 
2311 MG_EXPORT HDC GUIAPI GetDCInSecondarySurface (HWND hWnd, BOOL bClient);
2312 
2332 static inline HDC GUIAPI GetSecondaryClientDC (HWND hwnd)
2333 {
2334  return GetDCInSecondarySurface (hwnd, TRUE);
2335 }
2336 
2348 static inline void GUIAPI ReleaseSecondaryDC (HWND hwnd, HDC hdc)
2349 {
2350  ReleaseDC (hdc);
2351 }
2352 
2361 MG_EXPORT void GUIAPI DeleteSecondaryDC (HWND hwnd);
2362 
2386 MG_EXPORT HDC GUIAPI GetEffectiveCDC (HWND hwnd);
2387 
2402 MG_EXPORT BOOL GUIAPI SyncUpdateDC (HDC hdc);
2403 
2417 MG_EXPORT BOOL GUIAPI SyncUpdateSurface (HWND hwnd);
2418 
2426 #define BM_TRANSPARENT 1
2427 #define BM_OPAQUE 0
2428 
2429 #define DC_ATTR_BK_COLOR 0
2430 #define DC_ATTR_PEN_COLOR 1
2431 #define DC_ATTR_BRUSH_COLOR 2
2432 #define DC_ATTR_TEXT_COLOR 3
2433 
2434 #define DC_ATTR_BK_MODE 4
2435 
2436 #define DC_ATTR_TAB_STOP 5
2437 #define DC_ATTR_CHAR_EXTRA 6
2438 #define DC_ATTR_WORD_EXTRA 7
2439 #define DC_ATTR_ALINE_EXTRA 8
2440 #define DC_ATTR_BLINE_EXTRA 9
2441 
2442 #define DC_ATTR_MAP_MODE 10
2443 
2444 #define DC_ATTR_TEXT_ALIGN 11
2445 
2446 #define DC_ATTR_BIDI_FLAGS 12
2447 
2448 #ifdef _MGHAVE_ADV_2DAPI
2449 # define DC_ATTR_PEN_TYPE 13
2450 # define DC_ATTR_PEN_CAP_STYLE 14
2451 # define DC_ATTR_PEN_JOIN_STYLE 15
2452 # define DC_ATTR_PEN_WIDTH 16
2453 # define DC_ATTR_BRUSH_TYPE 17
2454 # define NR_DC_ATTRS 18
2455 #else /* _MGHAVE_ADV_2DAPI */
2456 # define NR_DC_ATTRS 13
2457 #endif /* !_MGHAVE_ADV_2DAPI */
2458 
2459 
2507 MG_EXPORT Uint32 GUIAPI GetDCAttr (HDC hdc, int attr);
2508 
2522 MG_EXPORT Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value);
2523 
2533 #define GetBkColor(hdc) GetDCAttr (hdc, DC_ATTR_BK_COLOR)
2534 
2550 #define GetBkMode(hdc) GetDCAttr (hdc, DC_ATTR_BK_MODE)
2551 
2561 #define GetPenColor(hdc) GetDCAttr (hdc, DC_ATTR_PEN_COLOR)
2562 
2572 #define GetBrushColor(hdc) GetDCAttr (hdc, DC_ATTR_BRUSH_COLOR)
2573 
2583 #define GetTextColor(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_COLOR)
2584 
2594 #define GetTabStop(hdc) GetDCAttr (hdc, DC_ATTR_TAB_STOP)
2595 
2606 #define SetBkColor(hdc, color) \
2607  SetDCAttr (hdc, DC_ATTR_BK_COLOR, (DWORD) color)
2608 
2626 #define SetBkMode(hdc, mode) \
2627  SetDCAttr (hdc, DC_ATTR_BK_MODE, (DWORD) mode)
2628 
2639 #define SetPenColor(hdc, color) \
2640  SetDCAttr (hdc, DC_ATTR_PEN_COLOR, (DWORD) color)
2641 
2652 #define SetBrushColor(hdc, color) \
2653  SetDCAttr (hdc, DC_ATTR_BRUSH_COLOR, (DWORD) color)
2654 
2665 #define SetTextColor(hdc, color) \
2666  SetDCAttr (hdc, DC_ATTR_TEXT_COLOR, (DWORD) color)
2667 
2678 #define SetTabStop(hdc, value) \
2679  SetDCAttr (hdc, DC_ATTR_TAB_STOP, (DWORD) value)
2680 
2681 #define ROP_SET 0
2682 #define ROP_AND 1
2683 #define ROP_OR 2
2684 #define ROP_XOR 3
2685 #define ROP_COMPOSITE 4
2686 #define ROP_COMP_USER 0x0100
2687 /* Reserved for future
2688  * #define ROP_COMP_XXX 0x01XX
2689  */
2690 
2715 MG_EXPORT int GUIAPI GetRasterOperation (HDC hdc);
2716 
2744 MG_EXPORT int GUIAPI SetRasterOperation (HDC hdc, int rop);
2745 
2768 MG_EXPORT int GUIAPI GetPalette (HDC hdc, int start, int len, GAL_Color* cmap);
2769 
2784 MG_EXPORT BOOL GUIAPI SetPalette (HDC hdc, int start, int len, GAL_Color* cmap);
2785 
2797 MG_EXPORT BOOL GUIAPI SetColorfulPalette (HDC hdc);
2798 
2812 MG_EXPORT HPALETTE GUIAPI CreatePalette (GAL_Palette* pal);
2813 
2829 MG_EXPORT BOOL GUIAPI SelectPalette (HDC hdc, HPALETTE hpal, BOOL reserved);
2830 
2851 MG_EXPORT BOOL GUIAPI RealizePalette (HDC hdc);
2852 
2866 MG_EXPORT BOOL GUIAPI ResizePalette (HPALETTE hpal, int len);
2867 
2878 MG_EXPORT void GUIAPI DestroyPalette (HPALETTE hpal);
2879 
2888 MG_EXPORT HPALETTE GUIAPI GetDefaultPalette (void);
2889 
2906 MG_EXPORT int GUIAPI GetPaletteEntries (HPALETTE hpal,
2907  int start, int len, GAL_Color* cmap);
2908 
2925 MG_EXPORT int GUIAPI SetPaletteEntries (HPALETTE hpal,
2926  int start, int len, GAL_Color* cmap);
2927 
2946 MG_EXPORT UINT GUIAPI GetNearestPaletteIndex (HPALETTE hpal,
2947  Uint8 red, Uint8 green, Uint8 blue);
2948 
2966 MG_EXPORT RGBCOLOR GUIAPI GetNearestColor (HDC hdc,
2967  Uint8 red, Uint8 green, Uint8 blue);
2968 
2992 MG_EXPORT void GUIAPI SetPixel (HDC hdc, int x, int y, gal_pixel pixel);
2993 
3012 MG_EXPORT gal_pixel GUIAPI SetPixelRGB (HDC hdc, int x, int y,
3013  Uint8 r, Uint8 g, Uint8 b);
3014 
3035 MG_EXPORT gal_pixel GUIAPI SetPixelRGBA (HDC hdc, int x, int y,
3036  Uint8 r, Uint8 g, Uint8 b, Uint8 a);
3037 
3053 MG_EXPORT gal_pixel GUIAPI GetPixel (HDC hdc, int x, int y);
3054 
3076 MG_EXPORT gal_pixel GUIAPI GetPixelRGB (HDC hdc, int x, int y,
3077  Uint8* r, Uint8* g, Uint8* b);
3078 
3104 MG_EXPORT gal_pixel GUIAPI GetPixelRGBA (HDC hdc, int x, int y,
3105  Uint8* r, Uint8* g, Uint8* b, Uint8* a);
3106 
3121 MG_EXPORT void GUIAPI RGBA2Pixels (HDC hdc, const RGB* rgbs,
3122  gal_pixel* pixels, int count);
3123 
3142 static inline gal_pixel RGBA2Pixel (HDC hdc,
3143  Uint8 r, Uint8 g, Uint8 b, Uint8 a)
3144 {
3145  RGB rgb = {r, g, b, a};
3146  gal_pixel pixel;
3147 
3148  RGBA2Pixels (hdc, &rgb, &pixel, 1);
3149  return pixel;
3150 }
3151 
3166 MG_EXPORT void GUIAPI RGB2Pixels (HDC hdc, const RGB* rgbs,
3167  gal_pixel* pixels, int count);
3168 
3186 static inline gal_pixel RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b)
3187 {
3188  RGB rgb = {r, g, b, 0xFF};
3189  gal_pixel pixel;
3190 
3191  RGB2Pixels (hdc, &rgb, &pixel, 1);
3192  return pixel;
3193 }
3194 
3209 MG_EXPORT void GUIAPI Pixel2RGBs (HDC hdc, const gal_pixel* pixels,
3210  RGB* rgbs, int count);
3211 
3233 static inline void Pixel2RGB (HDC hdc, gal_pixel pixel,
3234  Uint8* r, Uint8* g, Uint8* b)
3235 {
3236  RGB rgb;
3237  Pixel2RGBs (hdc, &pixel, &rgb, 1);
3238  *r = rgb.r; *g = rgb.g, *b = rgb.b;
3239 }
3240 
3255 MG_EXPORT void GUIAPI Pixel2RGBAs (HDC hdc, const gal_pixel* pixels,
3256  RGB* rgbs, int count);
3257 
3281 static inline void Pixel2RGBA (HDC hdc, gal_pixel pixel,
3282  Uint8* r, Uint8* g, Uint8* b, Uint8* a)
3283 {
3284  RGB rgb;
3285  Pixel2RGBAs (hdc, &pixel, &rgb, 1);
3286  *r = rgb.r; *g = rgb.g, *b = rgb.b; *a = rgb.a;
3287 }
3288 
3299 static inline DWORD Pixel2DWORD (HDC hdc, gal_pixel pixel)
3300 {
3301  Uint8 r,g,b,a;
3302  Pixel2RGBA (hdc, pixel, &r, &g, &b, &a);
3303  return MakeRGBA (r, g, b, a);
3304 }
3305 
3306 #define PIXEL2DWORD(hdc, pixel) Pixel2DWORD(hdc, pixel)
3307 
3318 static inline gal_pixel DWORD2Pixel (HDC hdc, DWORD dword)
3319 {
3320  return RGBA2Pixel (hdc,
3321  GetRValue(dword), GetGValue(dword),
3322  GetBValue(dword), GetAValue(dword));
3323 }
3324 
3342 MG_EXPORT void GUIAPI FocusRect (HDC hdc, int x0, int y0, int x1, int y1);
3343 
3361 MG_EXPORT void GUIAPI DrawHVDotLine (HDC hdc, int x, int y, int w_h, BOOL H_V);
3362 
3379 #define DrawHDotLine(hdc, x, y, w) DrawHVDotLine (hdc, x, y, w, TRUE);
3380 
3397 #define DrawVDotLine(hdc, x, y, h) DrawHVDotLine (hdc, x, y, h, FALSE);
3398 
3428 MG_EXPORT BOOL GUIAPI LineClipper (const RECT* cliprc,
3429  int *_x0, int *_y0, int *_x1, int *_y1);
3430 
3435 typedef void (* CB_LINE) (void* context, int stepx, int stepy);
3436 
3459 MG_EXPORT void GUIAPI LineGenerator (void* context,
3460  int x1, int y1, int x2, int y2, CB_LINE cb);
3461 
3466 typedef void (* CB_CIRCLE) (void* context, int x1, int x2, int y);
3467 
3495 MG_EXPORT void GUIAPI CircleGenerator (void* context,
3496  int sx, int sy, int r, CB_CIRCLE cb);
3497 
3502 typedef void (* CB_ELLIPSE) (void* context, int x1, int x2, int y);
3503 
3528 MG_EXPORT void GUIAPI EllipseGenerator (void* context,
3529  int sx, int sy, int rx, int ry, CB_ELLIPSE cb);
3530 
3535 typedef void (* CB_ARC) (void* context, int x, int y);
3536 
3560 MG_EXPORT void GUIAPI CircleArcGenerator (void* context,
3561  int sx, int sy, int r, int ang1, int ang2, CB_ARC cb);
3562 
3567 typedef void (* CB_POLYGON) (void* context, int x1, int x2, int y);
3568 
3607 MG_EXPORT BOOL GUIAPI MonotoneVerticalPolygonGenerator (void* context,
3608  const POINT* pts, int vertices, CB_POLYGON cb);
3609 
3627 MG_EXPORT BOOL GUIAPI PolygonIsMonotoneVertical (const POINT* pts,
3628  int vertices);
3629 
3656 MG_EXPORT BOOL GUIAPI PolygonGeneratorEx (void* context,
3657  const POINT* pts, int vertices, CB_POLYGON cb, RECT* rc_output);
3667 #define PolygonGenerator(context, pts, vertices, cb) \
3668  PolygonGeneratorEx(context, pts, vertices, cb, NULL)
3669 
3674 typedef BOOL (* CB_EQUAL_PIXEL) (void* context, int x, int y);
3675 
3680 typedef void (* CB_FLOOD_FILL) (void* context, int x1, int x2, int y);
3681 
3702 MG_EXPORT BOOL GUIAPI FloodFillGenerator (void* context,
3703  const RECT* src_rc, int x, int y,
3704  CB_EQUAL_PIXEL cb_equal_pixel, CB_FLOOD_FILL cb_flood_fill);
3705 
3706 /* DDA algorithm */
3707 #define BITMAP_SCALER_DDA 0
3708 /* Bilinear interpolation algorithm */
3709 #define BITMAP_SCALER_BILINEAR 1
3710 
3726 MG_EXPORT int GUIAPI SetBitmapScalerType (HDC hdc, int scaler_type);
3727 
3741 MG_EXPORT void GUIAPI MoveTo (HDC hdc, int x, int y);
3742 
3757 MG_EXPORT void GUIAPI LineTo (HDC hdc, int x, int y);
3758 
3774 MG_EXPORT void GUIAPI Rectangle (HDC hdc, int x0, int y0, int x1, int y1);
3775 
3790 MG_EXPORT void GUIAPI PolyLineTo (HDC hdc, const POINT* pts, int vertices);
3791 
3806 MG_EXPORT void GUIAPI SplineTo (HDC hdc, const POINT* pts);
3807 
3822 MG_EXPORT void GUIAPI Circle (HDC hdc, int sx, int sy, int r);
3823 
3840 MG_EXPORT void GUIAPI Ellipse (HDC hdc, int sx, int sy, int rx, int ry);
3841 
3863 MG_EXPORT void GUIAPI CircleArc (HDC hdc, int sx, int sy, int r,
3864  int ang1, int ang2);
3865 
3880 MG_EXPORT void GUIAPI FillBox (HDC hdc, int x, int y, int w, int h);
3881 
3895 MG_EXPORT void GUIAPI FillCircle (HDC hdc, int sx, int sy, int r);
3896 
3913 MG_EXPORT void GUIAPI FillEllipse (HDC hdc, int sx, int sy, int rx, int ry);
3914 
3928 MG_EXPORT BOOL GUIAPI FillPolygon (HDC hdc, const POINT* pts, int vertices);
3929 
3943 MG_EXPORT BOOL GUIAPI FloodFill (HDC hdc, int x, int y);
3944 
3945 #ifdef _MGHAVE_ADV_2DAPI
3946 
3955 typedef enum
3956 {
3974 } PenType;
3975 
3985 #define GetPenType(hdc) \
3986  GetDCAttr (hdc, DC_ATTR_PEN_TYPE)
3987 
3998 #define SetPenType(hdc, type) \
3999  SetDCAttr (hdc, DC_ATTR_PEN_TYPE, (DWORD) type)
4000 
4020 MG_EXPORT void GUIAPI SetPenDashes (HDC hdc, int dash_offset,
4021  const unsigned char* dash_list, int n);
4022 
4026 typedef enum
4027 {
4043 } PTCapStyle;
4044 
4054 #define GetPenCapStyle(hdc) \
4055  GetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE)
4056 
4067 #define SetPenCapStyle(hdc, style) \
4068  SetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE, (DWORD) style)
4069 
4073 typedef enum
4074 {
4088 } PTJoinStyle;
4089 
4099 #define GetPenJoinStyle(hdc) GetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE)
4100 
4111 #define SetPenJoinStyle(hdc, style) \
4112  SetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE, (DWORD) style)
4113 
4123 #define GetPenWidth(hdc) \
4124  GetDCAttr (hdc, DC_ATTR_PEN_WIDTH)
4125 
4136 #define SetPenWidth(hdc, width) \
4137  SetDCAttr (hdc, DC_ATTR_PEN_WIDTH, (DWORD) width)
4138 
4146 typedef enum {
4169 } BrushType;
4170 
4180 #define GetBrushType(hdc) \
4181  GetDCAttr (hdc, DC_ATTR_BRUSH_TYPE)
4182 
4193 #define SetBrushType(hdc, type) \
4194  SetDCAttr (hdc, DC_ATTR_BRUSH_TYPE, (DWORD) type)
4195 
4197 typedef struct _STIPPLE
4198 {
4200  int width;
4202  int height;
4203 
4205  int pitch;
4206 
4208  size_t size;
4209 
4211  const unsigned char* bits;
4212 } STIPPLE;
4213 
4225 MG_EXPORT void GUIAPI SetBrushInfo (HDC hdc,
4226  const BITMAP* tile, const STIPPLE* stipple);
4227 
4242 MG_EXPORT void GUIAPI SetBrushOrigin (HDC hdc, int x, int y);
4243 
4261 MG_EXPORT void GUIAPI LineEx (HDC hdc, int x1, int y1, int x2, int y2);
4262 
4286 MG_EXPORT void GUIAPI ArcEx (HDC hdc, int x, int y, int width, int height,
4287  int ang1, int ang2);
4288 
4312 MG_EXPORT void GUIAPI FillArcEx (HDC hdc, int x, int y, int width, int height,
4313  int ang1, int ang2);
4314 
4327 MG_EXPORT void GUIAPI PolyLineEx (HDC hdc, const POINT* pts, int nr_pts);
4328 
4332 typedef struct _ARC
4333 {
4335  int x;
4337  int y;
4338 
4340  int width;
4342  int height;
4343 
4348  int angle1;
4352  int angle2;
4353 } ARC;
4354 
4367 MG_EXPORT void GUIAPI PolyArcEx (HDC hdc, const ARC* arcs, int nr_arcs);
4368 
4381 MG_EXPORT void GUIAPI PolyFillArcEx (HDC hdc, const ARC* arcs, int nr_arcs);
4382 
4401 MG_EXPORT BOOL GUIAPI RoundRect (HDC hdc, int x0, int y0, int x1, int y1, int cw, int ch);
4402 
4406 #endif
4407 
4453 #define MM_TEXT 0
4454 #define MM_ANISOTROPIC 1
4455 
4471 #define GetMapMode(hdc) GetDCAttr (hdc, DC_ATTR_MAP_MODE)
4472 
4488 #define SetMapMode(hdc, mapmode) \
4489  SetDCAttr (hdc, DC_ATTR_MAP_MODE, (DWORD)mapmode)
4490 
4515 MG_EXPORT void GUIAPI GetDCLCS (HDC hdc, int which, POINT* pt);
4516 
4541 MG_EXPORT void GUIAPI SetDCLCS (HDC hdc, int which, const POINT* pt);
4542 
4543 #define DC_LCS_VORG 0
4544 #define DC_LCS_VEXT 1
4545 #define DC_LCS_WORG 2
4546 #define DC_LCS_WEXT 3
4547 #define NR_DC_LCS_PTS 4
4548 
4562 #define GetViewportOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_VORG, pPt)
4563 
4577 #define GetViewportExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_VEXT, pPt)
4578 
4592 #define GetWindowOrg(hdc, pPt) GetDCLCS(hdc, DC_LCS_WORG, pPt)
4593 
4607 #define GetWindowExt(hdc, pPt) GetDCLCS(hdc, DC_LCS_WEXT, pPt)
4608 
4622 #define SetViewportOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_VORG, pPt)
4623 
4637 #define SetViewportExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_VEXT, pPt)
4638 
4652 #define SetWindowOrg(hdc, pPt) SetDCLCS(hdc, DC_LCS_WORG, pPt)
4653 
4667 #define SetWindowExt(hdc, pPt) SetDCLCS(hdc, DC_LCS_WEXT, pPt)
4668 
4687 MG_EXPORT void GUIAPI DPtoLP (HDC hdc, POINT* pPt);
4688 
4689 
4708 MG_EXPORT void GUIAPI LPtoDP (HDC hdc, POINT* pPt);
4709 
4728 MG_EXPORT void GUIAPI SPtoLP(HDC hdc, POINT* pPt);
4729 
4730 
4749 MG_EXPORT void GUIAPI LPtoSP(HDC hdc, POINT* pPt);
4750 
4771 MG_EXPORT void GUIAPI ExcludeClipRect (HDC hdc, const RECT* prc);
4772 
4786 MG_EXPORT void GUIAPI IncludeClipRect (HDC hdc, const RECT* prc);
4787 
4803 MG_EXPORT BOOL GUIAPI PtVisible (HDC hdc, int x, int y);
4804 
4817 MG_EXPORT void GUIAPI ClipRectIntersect (HDC hdc, const RECT* prc);
4818 
4831 MG_EXPORT void GUIAPI SelectClipRect (HDC hdc, const RECT* prc);
4832 
4833 #define RGN_COPY 0x00
4834 #define RGN_DIFF 0x01
4835 #define RGN_AND 0x02
4836 #define RGN_OR 0x03
4837 #define RGN_XOR 0x04
4838 
4892 MG_EXPORT int GUIAPI SelectClipRegionEx (HDC hdc, const CLIPRGN* pRgn,
4893  int fnMode);
4894 
4907 MG_EXPORT void GUIAPI SelectClipRegion (HDC hdc, const CLIPRGN* pRgn);
4908 
4931 MG_EXPORT int GUIAPI OffsetClipRegion (HDC hdc, int nXOffset, int nYOffset);
4932 
4945 MG_EXPORT void GUIAPI GetBoundsRect (HDC hdc, RECT* pRect);
4946 
4964 MG_EXPORT BOOL GUIAPI RectVisible (HDC hdc, const RECT* pRect);
4965 
4984 MG_EXPORT int GUIAPI GetClipBox (HDC hdc, RECT* clipbox);
4985 
5004 MG_EXPORT int GUIAPI GetClipRegion (HDC hdc, CLIPRGN* cliprgn);
5005 
5041 MG_EXPORT BOOL GUIAPI GetBitmapFromDC (HDC hdc,
5042  int x, int y, int w, int h, BITMAP* bmp);
5043 
5079 MG_EXPORT BOOL GUIAPI FillBoxWithBitmap (HDC hdc, int x, int y, int w, int h,
5080  const BITMAP *bmp);
5081 
5135 MG_EXPORT BOOL GUIAPI FillBoxWithBitmapPart (HDC hdc,
5136  int x, int y, int w, int h,
5137  int bw, int bh, const BITMAP* bmp, int xo, int yo);
5138 
5161 MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y,
5162  int box_w, int box_h, const BITMAP* pbmp, int bmp_x, int bmp_y,
5163  int bmp_w, int bmp_h);
5164 
5171 typedef enum {
5172  COLOR_BLEND_LEGACY = 0,
5173  COLOR_BLEND_FLAGS_MASK = 0x00FF,
5174 
5176  COLOR_BLEND_PD_CLEAR = 0x0100, // PIXMAN_OP_CLEAR = 0x00
5178  COLOR_BLEND_PD_SRC = 0x0101, // PIXMAN_OP_SRC = 0x01
5180  COLOR_BLEND_PD_DST = 0x0102, // PIXMAN_OP_DST = 0x02
5182  COLOR_BLEND_PD_SRC_OVER = 0x0103, // PIXMAN_OP_OVER = 0x03
5184  COLOR_BLEND_PD_DST_OVER = 0x0104, // PIXMAN_OP_OVER_REVERSE = 0x04
5186  COLOR_BLEND_PD_SRC_IN = 0x0105, // PIXMAN_OP_IN = 0x05
5188  COLOR_BLEND_PD_DST_IN = 0x0106, // PIXMAN_OP_IN_REVERSE = 0x06
5190  COLOR_BLEND_PD_SRC_OUT = 0x0107, // PIXMAN_OP_OUT = 0x07
5192  COLOR_BLEND_PD_DST_OUT = 0x0108, // PIXMAN_OP_OUT_REVERSE = 0x08
5194  COLOR_BLEND_PD_SRC_ATOP = 0x0109, // PIXMAN_OP_ATOP = 0x09
5196  COLOR_BLEND_PD_DST_ATOP = 0x010a, // PIXMAN_OP_ATOP_REVERSE = 0x0a
5198  COLOR_BLEND_PD_XOR = 0x010b, // PIXMAN_OP_XOR = 0x0b
5200  COLOR_BLEND_PD_PLUS = 0x010c, // PIXMAN_OP_ADD = 0x0c
5202  COLOR_BLEND_PD_MODULATE = 0x010d, // PIXMAN_OP_SATURATE = 0x0d
5203 
5204  COLOR_BLEND_PD_FLAG = 0x0100,
5205  COLOR_BLEND_PD_FIRST = COLOR_BLEND_PD_CLEAR,
5206  COLOR_BLEND_PD_LAST = COLOR_BLEND_PD_MODULATE,
5207 
5217  COLOR_BLEND_SP_MULTIPLY = 0x0830, // PIXMAN_OP_MULTIPLY = 0x30
5222  COLOR_BLEND_SP_SCREEN = 0x0831, // PIXMAN_OP_SCREEN = 0x31
5227  COLOR_BLEND_SP_OVERLAY = 0x0832, // PIXMAN_OP_OVERLAY = 0x32
5232  COLOR_BLEND_SP_DARKEN = 0x0833, // PIXMAN_OP_DARKEN = 0x33
5237  COLOR_BLEND_SP_LIGHTEN = 0x0834, // PIXMAN_OP_LIGHTEN = 0x34
5242  COLOR_BLEND_SP_COLOR_DODGE = 0x0835, // PIXMAN_OP_COLOR_DODGE = 0x35,
5247  COLOR_BLEND_SP_COLOR_BURN = 0x0836, // PIXMAN_OP_COLOR_BURN = 0x36,
5252  COLOR_BLEND_SP_HARD_LIGHT = 0x0837, // PIXMAN_OP_HARD_LIGHT = 0x37,
5257  COLOR_BLEND_SP_SOFT_LIGHT = 0x0838, // PIXMAN_OP_SOFT_LIGHT = 0x38
5262  COLOR_BLEND_SP_DIFFERENCE = 0x0839, // PIXMAN_OP_DIFFERENCE = 0x39
5267  COLOR_BLEND_SP_EXCLUSION = 0x083a, // PIXMAN_OP_EXCLUSION = 0x3a
5268 
5269  COLOR_BLEND_SP_FLAG = 0x0800,
5270  COLOR_BLEND_SP_FIRST = COLOR_BLEND_SP_NORMAL,
5271  COLOR_BLEND_SP_LAST = COLOR_BLEND_SP_EXCLUSION,
5272 
5278  COLOR_BLEND_NS_HUE = 0x103b, // PIXMAN_OP_HSL_HUE = 0x3b
5284  COLOR_BLEND_NS_SATURATION = 0x103c, // PIXMAN_OP_HSL_SATURATION = 0x3c
5290  COLOR_BLEND_NS_COLOR = 0x103d, // PIXMAN_OP_HSL_COLOR = 0x3d
5291 
5297  COLOR_BLEND_NS_LUMINOSITY = 0x103e, // PIXMAN_OP_HSL_LUMINOSITY = 0x3e
5298 
5299  COLOR_BLEND_NS_FLAG = 0x1000,
5300  COLOR_BLEND_NS_FIRST = COLOR_BLEND_NS_HUE,
5301  COLOR_BLEND_NS_LAST = COLOR_BLEND_NS_LUMINOSITY,
5302 
5303  COLOR_BLEND_FIRST = COLOR_BLEND_PD_CLEAR,
5304  COLOR_BLEND_LAST = COLOR_BLEND_NS_LAST,
5306 
5310 typedef enum {
5311  COLOR_LOGICOP_CLEAR = 0,
5312  COLOR_LOGICOP_NOR,
5313  COLOR_LOGICOP_AND_INVERTED,
5314  COLOR_LOGICOP_COPY_INVERTED,
5315  COLOR_LOGICOP_AND_REVERSE,
5316  COLOR_LOGICOP_INVERT,
5317  COLOR_LOGICOP_XOR,
5318  COLOR_LOGICOP_NAND,
5319  COLOR_LOGICOP_AND,
5320  COLOR_LOGICOP_EQUIV,
5321  COLOR_LOGICOP_NOOP0,
5322  COLOR_LOGICOP_OR_INVERTED1,
5323  COLOR_LOGICOP_COPY,
5324  COLOR_LOGICOP_OR_REVERSE,
5325  COLOR_LOGICOP_OR,
5326  COLOR_LOGICOP_SET,
5327 } ColorLogicalOp;
5328 
5366 MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
5367  HDC hddc, int dx, int dy, DWORD dwRop);
5368 
5372 typedef enum {
5374  SCALING_FILTER_FAST = 0x00000000,
5376  SCALING_FILTER_GOOD = 0x00010000,
5378  SCALING_FILTER_BEST = 0x00020000,
5385  SCALING_FILTER_SHIFT = 16,
5386 } ScalingFilter;
5387 
5393 typedef struct _STRETCH_EXTRA_INFO {
5395  int version;
5396 
5399 
5403  int cx;
5406  int cy;
5408 
5453 MG_EXPORT BOOL GUIAPI StretchBltEx (HDC hsdc, int sx, int sy, int sw, int sh,
5454  HDC hddc, int dx, int dy, int dw, int dh,
5455  const STRETCH_EXTRA_INFO *sei, DWORD dwRop);
5456 
5493 static inline void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh,
5494  HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop)
5495 {
5496  StretchBltEx (hsdc, sx, sy, sw, sh, hddc, dx, dy, dw, dh, NULL, dwRop);
5497 }
5498 
5499 /* Use this if you want to have the legacy manner of StretchBlt */
5500 MG_EXPORT void GUIAPI StretchBltLegacy (HDC hsdc, int sx, int sy, int sw, int sh,
5501  HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop);
5502 
5522 MG_EXPORT BOOL GUIAPI ScaleBitmapEx (BITMAP* dst, const BITMAP* src,
5523  HDC ref_dc);
5524 
5525 #define ScaleBitmap(dst, src) ScaleBitmapEx(dst, src, HDC_SCREEN)
5526 
5548 MG_EXPORT gal_pixel GUIAPI GetPixelInBitmapEx (const BITMAP* bmp, int x, int y, Uint8* alpha);
5549 
5567 static inline gal_pixel GUIAPI GetPixelInBitmap (const BITMAP* bmp, int x, int y)
5568 {
5569  return GetPixelInBitmapEx (bmp, x, y, NULL);
5570 }
5571 
5596 MG_EXPORT BOOL GUIAPI SetPixelInBitmapEx (const BITMAP* bmp,
5597  int x, int y, gal_pixel pixel, const Uint8* alpha);
5598 
5619 static inline BOOL GUIAPI SetPixelInBitmap (const BITMAP* bmp,
5620  int x, int y, gal_pixel pixel)
5621 {
5622  return SetPixelInBitmapEx (bmp, x, y, pixel, NULL);
5623 }
5624 
5625 #ifdef _MGMISC_SAVESCREEN
5626 
5645 MG_EXPORT BOOL GUIAPI SaveScreenRectContent (const RECT* rcWin,
5646  const char* filename);
5647 
5665 MG_EXPORT BOOL GUIAPI SaveMainWindowContent (HWND hWnd, const char* filename);
5666 #endif
5667 
5693 MG_EXPORT HICON GUIAPI LoadIconFromFile (HDC hdc, const char* filename,
5694  int which);
5695 
5714 MG_EXPORT HICON GUIAPI LoadIconFromMem (HDC hdc, const void* area, int which);
5715 
5740 MG_EXPORT HICON GUIAPI CreateIconEx (HDC hdc, int w, int h,
5741  const BYTE* AndBits, const BYTE* XorBits, int colornum,
5742  const RGB* pal);
5747 #define CreateIcon(hdc, w, h, AndBits, XorBits, colornum) \
5748  CreateIconEx(hdc, w, h, AndBits, XorBits, colornum, NULL)
5749 
5765 MG_EXPORT HICON GUIAPI LoadBitmapIconEx (HDC hdc, MG_RWops* area,
5766  const char* ext);
5767 
5781 MG_EXPORT HICON GUIAPI LoadBitmapIconFromFile (HDC hdc,
5782  const char* file_name);
5783 
5801 MG_EXPORT HICON GUIAPI LoadBitmapIconFromMem (HDC hdc,
5802  const void* mem, size_t size, const char* ext);
5803 
5815 MG_EXPORT BOOL GUIAPI DestroyIcon (HICON hicon);
5816 
5830 MG_EXPORT BOOL GUIAPI GetIconSize (HICON hicon, int* w, int* h);
5831 
5849 MG_EXPORT void GUIAPI DrawIcon (HDC hdc,
5850  int x, int y, int w, int h, HICON hicon);
5851 
5873 static inline void SetRect (RECT* prc, int left, int top, int right, int bottom)
5874 {
5875  (prc)->left = left; (prc)->top = top;
5876  (prc)->right = right; (prc)->bottom = bottom;
5877 }
5878 
5892 static inline void SetRectEmpty (RECT* prc)
5893 {
5894  (prc)->left = (prc)->top = (prc)->right = (prc)->bottom = 0;
5895 }
5896 
5909 static inline void CopyRect (RECT* pdrc, const RECT* psrc)
5910 {
5911  (pdrc)->left = (psrc)->left; (pdrc)->top = (psrc)->top;
5912  (pdrc)->right = (psrc)->right; (pdrc)->bottom = (psrc)->bottom;
5913 }
5914 
5930 static inline void OffsetRect (RECT* prc, int x, int y)
5931 {
5932  (prc)->left += x; (prc)->top += y; (prc)->right += x; (prc)->bottom += y;
5933 }
5934 
5951 static inline void InflateRect (RECT* prc, int cx, int cy)
5952 {
5953  (prc)->left -= cx; (prc)->top -= cy;
5954  (prc)->right += cx; (prc)->bottom += cy;
5955 }
5956 
5970 static inline void InflateRectToPt (RECT* prc, int x, int y)
5971 {
5972  if ((x) < (prc)->left) (prc)->left = (x);
5973  if ((y) < (prc)->top) (prc)->top = (y);
5974  if ((x) > (prc)->right) (prc)->right = (x);
5975  if ((y) > (prc)->bottom) (prc)->bottom = (y);
5976 }
5977 
5993 static inline BOOL PtInRect(const RECT* prc, int x, int y)
5994 {
5995  if (x >= prc->left && x < prc->right && y >= prc->top && y < prc->bottom)
5996  return TRUE;
5997  return FALSE;
5998 }
5999 
6012 MG_EXPORT BOOL GUIAPI IsRectEmpty (const RECT* prc);
6013 
6026 MG_EXPORT BOOL GUIAPI EqualRect (const RECT* prc1, const RECT* prc2);
6027 
6037 MG_EXPORT void GUIAPI NormalizeRect (RECT* pRect);
6038 
6059 MG_EXPORT BOOL GUIAPI IntersectRect (RECT* pdrc,
6060  const RECT* psrc1, const RECT* psrc2);
6061 
6077 MG_EXPORT BOOL GUIAPI IsCovered (const RECT* prc1, const RECT* prc2);
6078 
6092 MG_EXPORT BOOL GUIAPI DoesIntersect (const RECT* psrc1, const RECT* psrc2);
6093 
6111 MG_EXPORT BOOL GUIAPI UnionRect (RECT* pdrc,
6112  const RECT* psrc1, const RECT* psrc2);
6113 
6129 MG_EXPORT void GUIAPI GetBoundRect (PRECT pdrc,
6130  const RECT* psrc1, const RECT* psrc2);
6131 
6148 MG_EXPORT int GUIAPI SubtractRect (RECT* rc, const RECT* psrc1, const RECT* psrc2);
6149 
6154 #define RECTWP(prc) ((prc)->right - (prc)->left)
6155 
6159 #define RECTHP(prc) ((prc)->bottom - (prc)->top)
6160 
6164 #define RECTW(rc) ((rc).right - (rc).left)
6165 
6169 #define RECTH(rc) ((rc).bottom - (rc).top)
6170 
6184 /* Font-related structures */
6185 #define LEN_LOGFONT_NAME_FIELD 31
6186 #define LEN_LOGFONT_FAMILY_FIELD (LEN_LOGFONT_NAME_FIELD*7+6)
6187 #define LEN_LOGFONT_NAME_FULL (LEN_LOGFONT_FAMILY_FIELD + 32)
6188 #define LEN_UNIDEVFONT_NAME 255
6189 
6190 #define LEN_FONT_NAME LEN_LOGFONT_NAME_FIELD
6191 #define LEN_DEVFONT_NAME LEN_UNIDEVFONT_NAME
6192 
6193 #define FONT_WEIGHT_NIL '\0'
6194 #define FONT_WEIGHT_ANY '*'
6195 #define FONT_WEIGHT_THIN 't'
6196 #define FONT_WEIGHT_EXTRA_LIGHT 'e'
6197 #define FONT_WEIGHT_LIGHT 'l'
6198 #define FONT_WEIGHT_NORMAL 'n'
6199 #define FONT_WEIGHT_REGULAR 'r'
6200 #define FONT_WEIGHT_MEDIUM 'm'
6201 #define FONT_WEIGHT_DEMIBOLD 'd'
6202 #define FONT_WEIGHT_BOLD 'b'
6203 #define FONT_WEIGHT_EXTRA_BOLD 'x'
6204 #define FONT_WEIGHT_BLACK 'c'
6205 
6206 /* Backward compatiblilty definitions.
6207  * deprecated since v4.0.0, use FS_RENDER_XXX/FONT_RENDER_XXX instead
6208  */
6209 #define FONT_WEIGHT_SUBPIXEL 's'
6210 #define FONT_WEIGHT_BOOK 'k'
6211 
6212 #define FS_WEIGHT_MASK 0x000000FF
6213 #define FS_WEIGHT_ANY 0
6214 #define FS_WEIGHT_THIN 10
6215 #define FS_WEIGHT_EXTRA_LIGHT 20
6216 #define FS_WEIGHT_LIGHT 30
6217 #define FS_WEIGHT_NORMAL 35
6218 #define FS_WEIGHT_REGULAR 40
6219 #define FS_WEIGHT_MEDIUM 50
6220 #define FS_WEIGHT_DEMIBOLD 60
6221 #define FS_WEIGHT_EXTRA_BOLD 70
6222 #define FS_WEIGHT_BOLD 80
6223 #define FS_WEIGHT_BLACK 90
6224 
6225 #define FONT_SLANT_NIL '\0'
6226 #define FONT_SLANT_ANY '*'
6227 #define FONT_SLANT_ROMAN 'r'
6228 #define FONT_SLANT_ITALIC 'i'
6229 #define FONT_SLANT_OBLIQUE 'o'
6230 
6231 #define FS_SLANT_MASK 0x00000F00
6232 #define FS_SLANT_ANY 0x00000000
6233 #define FS_SLANT_ROMAN 0x00000100
6234 #define FS_SLANT_ITALIC 0x00000200
6235 #define FS_SLANT_OBLIQUE 0x00000300
6236 
6237 #define FONT_FLIP_NONE 'n'
6238 #define FONT_FLIP_HORZ 'h'
6239 #define FONT_FLIP_VERT 'v'
6240 #define FONT_FLIP_HORZVERT 't'
6241 #define FONT_FLIP_NIL FONT_FLIP_NONE
6242 
6243 #define FS_FLIP_MASK 0x0000F000
6244 #define FS_FLIP_NONE 0x00000000
6245 #define FS_FLIP_HORZ 0x00001000
6246 #define FS_FLIP_VERT 0x00002000
6247 #define FS_FLIP_HORZVERT 0x00003000 /* HORZ | VERT */
6248 
6249 #define FONT_OTHER_NONE 'n'
6250 #define FONT_OTHER_AUTOSCALE 's'
6251 #define FONT_OTHER_TTFNOCACHE 'c'
6252 #define FONT_OTHER_TTFKERN 'k'
6253 #define FONT_OTHER_TTFNOCACHEKERN 'r'
6254 #define FONT_OTHER_NIL FONT_OTHER_NONE
6255 
6256 #define FS_OTHER_MASK 0x00F00000
6257 #define FS_OTHER_NONE 0x00000000
6258 #define FS_OTHER_AUTOSCALE 0x00100000
6259 #define FS_OTHER_TTFNOCACHE 0x00200000
6260 #define FS_OTHER_TTFKERN 0x00400000
6261 #define FS_OTHER_TTFNOCACHEKERN 0x00600000 /* KERN | NOCACHE */
6262 
6263 #define FONT_DECORATE_NIL '\0'
6264 #define FONT_DECORATE_NONE 'n'
6265 #define FONT_DECORATE_UNDERLINE 'u'
6266 #define FONT_DECORATE_STRUCKOUT 's'
6267 #define FONT_DECORATE_REVERSE 'r'
6268 #define FONT_DECORATE_OUTLINE 'o'
6269 #define FONT_DECORATE_US 'U' /* UNDERLINE | STRUCKOUT */
6270 
6271 #define FS_DECORATE_MASK 0x0F000000
6272 #define FS_DECORATE_NONE 0x00000000
6273 #define FS_DECORATE_UNDERLINE 0x01000000
6274 #define FS_DECORATE_STRUCKOUT 0x02000000
6275 #define FS_DECORATE_REVERSE 0x04000000
6276 #define FS_DECORATE_OUTLINE 0x08000000
6277 #define FS_DECORATE_US (FS_DECORATE_UNDERLINE | FS_DECORATE_STRUCKOUT)
6278 
6279 #define FONT_RENDER_NIL '\0'
6280 #define FONT_RENDER_ANY '*'
6281 #define FONT_RENDER_MONO 'n'
6282 #define FONT_RENDER_GREY 'g'
6283 #define FONT_RENDER_SUBPIXEL 's'
6284 
6285 #define FS_RENDER_MASK 0xF0000000
6286 #define FS_RENDER_MONO 0x00000000
6287 #define FS_RENDER_GREY 0x10000000
6288 #define FS_RENDER_SUBPIXEL 0x20000000
6289 #define FS_RENDER_ANY FS_RENDER_MONO
6290 
6291 /* Backward compatiblilty definitions; deprecated since v4.0.0 */
6292 #define FONT_OTHER_LCDPORTRAIT 'p'
6293 #define FONT_OTHER_LCDPORTRAITKERN 'q'
6294 
6295 #define FONT_WEIGHT_ALL FONT_WEIGHT_ANY
6296 #define FONT_SLANT_ALL FONT_SLANT_ANY
6297 #define FS_WEIGHT_ALL FS_WEIGHT_ANY
6298 #define FS_SLANT_ALL FS_SLANT_ANY
6299 
6300 /* Backward compatiblilty definitions; deprecated since v4.0.0
6301  * All FONT_SETWIDTH_* and FONT_SPACING_* types will
6302  * be treated as FONT_FLIP_NIL and FONT_OTHER_NIL respectively.
6303  */
6304 #define FONT_SETWIDTH_NIL '\0'
6305 #define FONT_SETWIDTH_ALL '*'
6306 #define FONT_SETWIDTH_BOLD 'b'
6307 #define FONT_SETWIDTH_CONDENSED 'c'
6308 #define FONT_SETWIDTH_SEMICONDENSED 's'
6309 #define FONT_SETWIDTH_NORMAL 'n'
6310 #define FONT_SETWIDTH_TTFNOCACHE 'w'
6311 
6312 #define FONT_SPACING_NIL '\0'
6313 #define FONT_SPACING_ALL '*'
6314 #define FONT_SPACING_MONOSPACING 'm'
6315 #define FONT_SPACING_PROPORTIONAL 'p'
6316 #define FONT_SPACING_CHARCELL 'c'
6317 
6318 #define FONT_UNDERLINE_NIL '\0'
6319 #define FONT_UNDERLINE_ALL '*'
6320 #define FONT_UNDERLINE_LINE 'u'
6321 #define FONT_UNDERLINE_NONE 'n'
6322 
6323 #define FONT_STRUCKOUT_NIL '\0'
6324 #define FONT_STRUCKOUT_ALL '*'
6325 #define FONT_STRUCKOUT_LINE 's'
6326 #define FONT_STRUCKOUT_NONE 'n'
6327 /******/
6328 
6329 #define FONT_TYPE_NAME_LEN 3
6330 #define FONT_TYPE_NAME_BITMAP_NUF "nuf"
6331 #define FONT_TYPE_NAME_BITMAP_RAW "rbf"
6332 #define FONT_TYPE_NAME_BITMAP_VAR "vbf"
6333 #define FONT_TYPE_NAME_BITMAP_QPF "qpf"
6334 #define FONT_TYPE_NAME_BITMAP_UPF "upf"
6335 #define FONT_TYPE_NAME_BITMAP_BMP "bmp"
6336 #define FONT_TYPE_NAME_SCALE_TTF "ttf"
6337 #define FONT_TYPE_NAME_SCALE_T1F "t1f"
6338 #define FONT_TYPE_NAME_ANY "*"
6339 #define FONT_TYPE_NAME_ALL FONT_TYPE_NAME_ANY
6340 
6341 #define FONT_ETC_SECTION_NAME_VBF "varbitmapfonts"
6342 #define FONT_ETC_SECTION_NAME_RBF "rawbitmapfonts"
6343 #define FONT_ETC_SECTION_NAME_UPF "upf"
6344 #define FONT_ETC_SECTION_NAME_QPF "qpf"
6345 #define FONT_ETC_SECTION_NAME_TTF "truetypefonts"
6346 
6347 #define FONT_TYPE_BITMAP_RAW 0x0001 /* "rbf" */
6348 #define FONT_TYPE_BITMAP_VAR 0x0002 /* "vbf" */
6349 #define FONT_TYPE_BITMAP_QPF 0x0003 /* "qpf" */
6350 #define FONT_TYPE_BITMAP_BMP 0x0004 /* "bmp" */
6351 #define FONT_TYPE_BITMAP_UPF 0x0005 /* "upf" */
6352 #define FONT_TYPE_SCALE_TTF 0x0010 /* "ttf" */
6353 #define FONT_TYPE_SCALE_T1F 0x0011 /* "t1f" */
6354 #define FONT_TYPE_ANY 0x0000 /* "any" */
6355 #define FONT_TYPE_ALL FONT_TYPE_ANY
6356 
6357 #define FONT_CHARSET_US_ASCII "US-ASCII"
6358 
6359 #define FONT_CHARSET_ISO8859_1 "ISO8859-1"
6360 #define FONT_CHARSET_ISO8859_2 "ISO8859-2"
6361 #define FONT_CHARSET_ISO8859_3 "ISO8859-3"
6362 #define FONT_CHARSET_ISO8859_4 "ISO8859-4"
6363 #define FONT_CHARSET_ISO8859_5 "ISO8859-5"
6364 #define FONT_CHARSET_ISO8859_6 "ISO8859-6"
6365 #define FONT_CHARSET_ISO8859_7 "ISO8859-7"
6366 #define FONT_CHARSET_ISO8859_8 "ISO8859-8"
6367 #define FONT_CHARSET_ISO8859_9 "ISO8859-9"
6368 #define FONT_CHARSET_ISO8859_10 "ISO8859-10"
6369 #define FONT_CHARSET_ISO8859_11 "ISO8859-11"
6370 #define FONT_CHARSET_ISO8859_12 "ISO8859-12"
6371 #define FONT_CHARSET_ISO8859_13 "ISO8859-13"
6372 #define FONT_CHARSET_ISO8859_14 "ISO8859-14"
6373 #define FONT_CHARSET_ISO8859_15 "ISO8859-15"
6374 #define FONT_CHARSET_ISO8859_16 "ISO8859-16"
6375 
6376 #define FONT_CHARSET_EUC_CN "EUC-CN"
6377 
6382 #define FONT_CHARSET_GB1988_0 "GB1988-0"
6383 
6388 #define FONT_CHARSET_GB2312_0 "GB2312-0"
6389 #define FONT_CHARSET_GBK "GBK"
6390 
6395 #define FONT_CHARSET_GB18030_0 "GB18030-0"
6396 #define FONT_CHARSET_BIG5 "BIG5"
6397 
6402 #define FONT_CHARSET_EUCTW "EUC-TW"
6403 #define FONT_CHARSET_EUCKR "EUC-KR"
6404 
6409 #define FONT_CHARSET_KSC5636_0 "KSC5636-0"
6410 
6415 #define FONT_CHARSET_KSC5601_0 "KSC5601-0"
6416 #define FONT_CHARSET_EUCJP "EUC-JP"
6417 
6422 #define FONT_CHARSET_JISX0201_0 "JISX0201-0"
6423 
6428 #define FONT_CHARSET_JISX0208_0 "JISX0208-0"
6429 #define FONT_CHARSET_SHIFTJIS "SHIFT-JIS"
6430 
6435 #define FONT_CHARSET_JISX0201_1 "JISX0201-1"
6436 
6441 #define FONT_CHARSET_JISX0208_1 "JISX0208-1"
6442 
6447 #define FONT_CHARSET_ISO_10646_1 "ISO-10646-1"
6448 
6453 #define FONT_CHARSET_UTF8 "UTF-8"
6454 
6459 #define FONT_CHARSET_UTF16LE "UTF-16LE"
6460 
6465 #define FONT_CHARSET_UTF16BE "UTF-16BE"
6466 
6467 #define FONT_MAX_SIZE 256
6468 #define FONT_MIN_SIZE 1
6469 #define MAXNR_DEVFONTS 8
6470 
6471 struct _DEVFONT;
6472 typedef struct _DEVFONT DEVFONT;
6473 
6478 typedef struct _LOGFONT {
6480  char* type;
6482  char* family;
6484  char* charset;
6488  int size;
6492  int ascent;
6494  int descent;
6497 
6498  /*
6499  * The following fields are internally used.
6500  * They may be changed in the future.
6501  */
6502 
6503  // The scale factors of devfonts
6504  unsigned short scales[MAXNR_DEVFONTS];
6505  // The devfonts for the logfont
6506  DEVFONT* devfonts[MAXNR_DEVFONTS];
6507 } LOGFONT;
6508 
6514 
6519 typedef const LOGFONT* CPLOGFONT;
6520 
6521 struct _WORDINFO;
6522 
6527 typedef struct _WORDINFO WORDINFO;
6528 
6529 #define MAX_LEN_MCHAR 6
6530 
6531 typedef Uint16 Uchar16;
6532 typedef Uint32 Uchar32;
6533 
6551 #define ACHARTYPE_BASIC_MASK 0x0000FFFF
6552 #define ACHARTYPE_CATEGORY_MASK 0x00FF0000
6553 #define ACHARTYPE_BREAK_MASK 0xFF000000
6554 
6559 #define ACHARTYPE_EXTRACT_BASIC(t) \
6560  (((t) & ACHARTYPE_BASIC_MASK))
6561 
6566 #define ACHARTYPE_EXTRACT_CATEGORY(t) \
6567  (((t) & ACHARTYPE_CATEGORY_MASK) >> 16)
6568 
6573 #define ACHARTYPE_EXTRACT_BREAK(t) \
6574  (((t) & ACHARTYPE_BREAK_MASK) >> 24)
6575 
6580 #define ACHARTYPE_UNKNOWN 0
6581 
6582 #define ACHAR_BASIC_NOSPACING_MARK 0x0001
6583 #define ACHAR_BASIC_ABOVE_MARK 0x0002
6584 #define ACHAR_BASIC_BELLOW_MARK 0x0004
6585 
6586 #define ACHAR_BASIC_UNKNOWN 0x0000
6587 #define ACHAR_BASIC_NUL (0x0000 | ACHAR_BASIC_NOSPACING_MARK)
6588 
6589 #define ACHAR_BASIC_CTRL1 0x0100
6590 
6591 #define ACHAR_BASIC_BEL 0x0200
6592 
6593 #define ACHAR_BASIC_BS 0x0300
6594 
6595 #define ACHAR_BASIC_HT 0x0400
6596 
6597 #define ACHAR_BASIC_LF 0x0500
6598 
6599 #define ACHAR_BASIC_VT 0x0600
6600 
6601 #define ACHAR_BASIC_FF 0x0700
6602 
6603 #define ACHAR_BASIC_CR 0x0800
6604 
6605 #define ACHAR_BASIC_CTRL2 0x0900
6606 
6607 #define ACHAR_BASIC_SPACE 0x0A00
6608 
6609 #define ACHAR_BASIC_ZEROWIDTH 0x0B00
6610 #define ACHAR_BASIC_GENERIC 0x0C00
6611 
6612 #define ACHAR_BASIC_LIGATURE (0x0D00 | ACHAR_BASIC_NOSPACING_MARK)
6613 #define ACHAR_BASIC_VOWEL (0x0E00 | ACHAR_BASIC_NOSPACING_MARK)
6614 #define ACHAR_BASIC_VOWEL_ABOVE (ACHAR_BASIC_VOWEL | ACHAR_BASIC_ABOVE_MARK)
6615 #define ACHAR_BASIC_VOWEL_BELLOW (ACHAR_BASIC_VOWEL | ACHAR_BASIC_BELLOW_MARK)
6616 
6617 /* Compatibility definitions */
6618 #define MCHAR_TYPE_UNKNOWN ACHAR_BASIC_UNKNOWN
6619 #define MCHAR_TYPE_NUL ACHAR_BASIC_NUL
6620 #define MCHAR_TYPE_CTRL1 ACHAR_BASIC_CTRL1
6621 #define MCHAR_TYPE_BEL ACHAR_BASIC_BEL
6622 #define MCHAR_TYPE_BS ACHAR_BASIC_BS
6623 #define MCHAR_TYPE_HT ACHAR_BASIC_HT
6624 #define MCHAR_TYPE_LF ACHAR_BASIC_LF
6625 #define MCHAR_TYPE_VT ACHAR_BASIC_VT
6626 #define MCHAR_TYPE_FF ACHAR_BASIC_FF
6627 #define MCHAR_TYPE_CR ACHAR_BASIC_CR
6628 #define MCHAR_TYPE_CTRL2 ACHAR_BASIC_CTRL2
6629 #define MCHAR_TYPE_SPACE ACHAR_BASIC_SPACE
6630 #define MCHAR_TYPE_ZEROWIDTH ACHAR_BASIC_ZEROWIDTH
6631 #define MCHAR_TYPE_GENERIC ACHAR_BASIC_GENERIC
6632 #define MCHAR_TYPE_NOSPACING_MARK ACHAR_BASIC_NOSPACING_MARK
6633 #define MCHAR_TYPE_LIGATURE ACHAR_BASIC_LIGATURE
6634 #define MCHAR_TYPE_VOWEL ACHAR_BASIC_VOWEL
6635 #define MCHAR_TYPE_VOWEL_ABOVE ACHAR_BASIC_VOWEL_ABOVE
6636 #define MCHAR_TYPE_VOWEL_BELLOW ACHAR_BASIC_VOWEL_BELLOW
6637 
6638 #if 0
6639 #define MCHAR_TYPE_ASCII 0x0080
6640 #define MCHAR_TYPE_LATIN1 0x0081
6641 #define MCHAR_TYPE_LATIN2 0x0082
6642 #define MCHAR_TYPE_LATIN3 0x0083
6643 #define MCHAR_TYPE_LATIN4 0x0084
6644 #define MCHAR_TYPE_LATIN5 0x0085
6645 #define MCHAR_TYPE_LATIN6 0x0086
6646 #define MCHAR_TYPE_LATIN7 0x0087
6647 #define MCHAR_TYPE_LATIN8 0x0088
6648 #define MCHAR_TYPE_LATIN9 0x0089
6649 #define MCHAR_TYPE_LATIN10 0x008A
6650 #define MCHAR_TYPE_CYRILLIC 0x008B
6651 #define MCHAR_TYPE_ARABIC 0x008C
6652 #define MCHAR_TYPE_GREEK 0x008D
6653 #define MCHAR_TYPE_HEBREW 0x008E
6654 #define MCHAR_TYPE_THAI 0x008F
6655 
6656 #define MCHAR_TYPE_DIGIT 0x0091
6657 #define MCHAR_TYPE_SYMBOL_PUNCT 0x0092
6658 #define MCHAR_TYPE_SYMBOL_MATH 0x0093
6659 #define MCHAR_TYPE_SYMBOL_OTHER 0x0094
6660 #define MCHAR_TYPE_FW_DIGIT 0x0095
6661 #define MCHAR_TYPE_FW_SYM_PUNCT 0x0096
6662 #define MCHAR_TYPE_FW_SYM_MATH 0x0097
6663 #define MCHAR_TYPE_FW_SYM_OTHER 0x0098
6664 
6665 #define MCHAR_TYPE_HANGUL 0x00A1
6666 #define MCHAR_TYPE_KATAKANA 0x00A2
6667 #define MCHAR_TYPE_CJK 0x00A3
6668 #endif
6669 
6708 typedef enum {
6709  UCHAR_CATEGORY_CONTROL,
6710  UCHAR_CATEGORY_FORMAT,
6711  UCHAR_CATEGORY_UNASSIGNED,
6712  UCHAR_CATEGORY_PRIVATE_USE,
6713  UCHAR_CATEGORY_SURROGATE,
6714  UCHAR_CATEGORY_LOWERCASE_LETTER,
6715  UCHAR_CATEGORY_MODIFIER_LETTER,
6716  UCHAR_CATEGORY_OTHER_LETTER,
6717  UCHAR_CATEGORY_TITLECASE_LETTER,
6718  UCHAR_CATEGORY_UPPERCASE_LETTER,
6719  UCHAR_CATEGORY_SPACING_MARK,
6720  UCHAR_CATEGORY_ENCLOSING_MARK,
6721  UCHAR_CATEGORY_NON_SPACING_MARK,
6722  UCHAR_CATEGORY_DECIMAL_NUMBER,
6723  UCHAR_CATEGORY_LETTER_NUMBER,
6724  UCHAR_CATEGORY_OTHER_NUMBER,
6725  UCHAR_CATEGORY_CONNECT_PUNCTUATION,
6726  UCHAR_CATEGORY_DASH_PUNCTUATION,
6727  UCHAR_CATEGORY_CLOSE_PUNCTUATION,
6728  UCHAR_CATEGORY_FINAL_PUNCTUATION,
6729  UCHAR_CATEGORY_INITIAL_PUNCTUATION,
6730  UCHAR_CATEGORY_OTHER_PUNCTUATION,
6731  UCHAR_CATEGORY_OPEN_PUNCTUATION,
6732  UCHAR_CATEGORY_CURRENCY_SYMBOL,
6733  UCHAR_CATEGORY_MODIFIER_SYMBOL,
6734  UCHAR_CATEGORY_MATH_SYMBOL,
6735  UCHAR_CATEGORY_OTHER_SYMBOL,
6736  UCHAR_CATEGORY_LINE_SEPARATOR,
6737  UCHAR_CATEGORY_PARAGRAPH_SEPARATOR,
6738  UCHAR_CATEGORY_SPACE_SEPARATOR
6740 
6795 typedef enum {
6796  UCHAR_BREAK_MANDATORY,
6797  UCHAR_BREAK_CARRIAGE_RETURN,
6798  UCHAR_BREAK_LINE_FEED,
6799  UCHAR_BREAK_COMBINING_MARK,
6800  UCHAR_BREAK_SURROGATE,
6801  UCHAR_BREAK_ZERO_WIDTH_SPACE,
6802  UCHAR_BREAK_INSEPARABLE,
6803  UCHAR_BREAK_NON_BREAKING_GLUE,
6804  UCHAR_BREAK_CONTINGENT,
6805  UCHAR_BREAK_SPACE,
6806  UCHAR_BREAK_AFTER,
6807  UCHAR_BREAK_BEFORE,
6808  UCHAR_BREAK_BEFORE_AND_AFTER,
6809  UCHAR_BREAK_HYPHEN,
6810  UCHAR_BREAK_NON_STARTER,
6811  UCHAR_BREAK_OPEN_PUNCTUATION,
6812  UCHAR_BREAK_CLOSE_PUNCTUATION,
6813  UCHAR_BREAK_QUOTATION,
6814  UCHAR_BREAK_EXCLAMATION,
6815  UCHAR_BREAK_IDEOGRAPHIC,
6816  UCHAR_BREAK_NUMERIC,
6817  UCHAR_BREAK_INFIX_SEPARATOR,
6818  UCHAR_BREAK_SYMBOL,
6819  UCHAR_BREAK_ALPHABETIC,
6820  UCHAR_BREAK_PREFIX,
6821  UCHAR_BREAK_POSTFIX,
6822  UCHAR_BREAK_COMPLEX_CONTEXT,
6823  UCHAR_BREAK_AMBIGUOUS,
6824  UCHAR_BREAK_UNKNOWN,
6825  UCHAR_BREAK_NEXT_LINE,
6826  UCHAR_BREAK_WORD_JOINER,
6827  UCHAR_BREAK_HANGUL_L_JAMO,
6828  UCHAR_BREAK_HANGUL_V_JAMO,
6829  UCHAR_BREAK_HANGUL_T_JAMO,
6830  UCHAR_BREAK_HANGUL_LV_SYLLABLE,
6831  UCHAR_BREAK_HANGUL_LVT_SYLLABLE,
6832  UCHAR_BREAK_CLOSE_PARANTHESIS,
6833  UCHAR_BREAK_CONDITIONAL_JAPANESE_STARTER,
6834  UCHAR_BREAK_HEBREW_LETTER,
6835  UCHAR_BREAK_REGIONAL_INDICATOR,
6836  UCHAR_BREAK_EMOJI_BASE,
6837  UCHAR_BREAK_EMOJI_MODIFIER,
6838  UCHAR_BREAK_ZERO_WIDTH_JOINER
6839 } UCharBreakType;
6840 
7013 typedef enum {
7014  SCRIPT_INVALID_CODE = 0xFF,
7015  SCRIPT_COMMON = 0, /* Zyyy */
7016  SCRIPT_INHERITED, /* Zinh (Qaai) */
7017  SCRIPT_ARABIC, /* Arab */
7018  SCRIPT_ARMENIAN, /* Armn */
7019  SCRIPT_BENGALI, /* Beng */
7020  SCRIPT_BOPOMOFO, /* Bopo */
7021  SCRIPT_CHEROKEE, /* Cher */
7022  SCRIPT_COPTIC, /* Copt (Qaac) */
7023  SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
7024  SCRIPT_DESERET, /* Dsrt */
7025  SCRIPT_DEVANAGARI, /* Deva */
7026  SCRIPT_ETHIOPIC, /* Ethi */
7027  SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
7028  SCRIPT_GOTHIC, /* Goth */
7029  SCRIPT_GREEK, /* Grek */
7030  SCRIPT_GUJARATI, /* Gujr */
7031  SCRIPT_GURMUKHI, /* Guru */
7032  SCRIPT_HAN, /* Hani */
7033  SCRIPT_HANGUL, /* Hang */
7034  SCRIPT_HEBREW, /* Hebr */
7035  SCRIPT_HIRAGANA, /* Hira */
7036  SCRIPT_KANNADA, /* Knda */
7037  SCRIPT_KATAKANA, /* Kana */
7038  SCRIPT_KHMER, /* Khmr */
7039  SCRIPT_LAO, /* Laoo */
7040  SCRIPT_LATIN, /* Latn (Latf, Latg) */
7041  SCRIPT_MALAYALAM, /* Mlym */
7042  SCRIPT_MONGOLIAN, /* Mong */
7043  SCRIPT_MYANMAR, /* Mymr */
7044  SCRIPT_OGHAM, /* Ogam */
7045  SCRIPT_OLD_ITALIC, /* Ital */
7046  SCRIPT_ORIYA, /* Orya */
7047  SCRIPT_RUNIC, /* Runr */
7048  SCRIPT_SINHALA, /* Sinh */
7049  SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
7050  SCRIPT_TAMIL, /* Taml */
7051  SCRIPT_TELUGU, /* Telu */
7052  SCRIPT_THAANA, /* Thaa */
7053  SCRIPT_THAI, /* Thai */
7054  SCRIPT_TIBETAN, /* Tibt */
7055  SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
7056  SCRIPT_YI, /* Yiii */
7057  SCRIPT_TAGALOG, /* Tglg */
7058  SCRIPT_HANUNOO, /* Hano */
7059  SCRIPT_BUHID, /* Buhd */
7060  SCRIPT_TAGBANWA, /* Tagb */
7061 
7062  /* Unicode-4.0 additions */
7063  SCRIPT_BRAILLE, /* Brai */
7064  SCRIPT_CYPRIOT, /* Cprt */
7065  SCRIPT_LIMBU, /* Limb */
7066  SCRIPT_OSMANYA, /* Osma */
7067  SCRIPT_SHAVIAN, /* Shaw */
7068  SCRIPT_LINEAR_B, /* Linb */
7069  SCRIPT_TAI_LE, /* Tale */
7070  SCRIPT_UGARITIC, /* Ugar */
7071 
7072  /* Unicode-4.1 additions */
7073  SCRIPT_NEW_TAI_LUE, /* Talu */
7074  SCRIPT_BUGINESE, /* Bugi */
7075  SCRIPT_GLAGOLITIC, /* Glag */
7076  SCRIPT_TIFINAGH, /* Tfng */
7077  SCRIPT_SYLOTI_NAGRI, /* Sylo */
7078  SCRIPT_OLD_PERSIAN, /* Xpeo */
7079  SCRIPT_KHAROSHTHI, /* Khar */
7080 
7081  /* Unicode-5.0 additions */
7082  SCRIPT_UNKNOWN, /* Zzzz */
7083  SCRIPT_BALINESE, /* Bali */
7084  SCRIPT_CUNEIFORM, /* Xsux */
7085  SCRIPT_PHOENICIAN, /* Phnx */
7086  SCRIPT_PHAGS_PA, /* Phag */
7087  SCRIPT_NKO, /* Nkoo */
7088 
7089  /* Unicode-5.1 additions */
7090  SCRIPT_KAYAH_LI, /* Kali */
7091  SCRIPT_LEPCHA, /* Lepc */
7092  SCRIPT_REJANG, /* Rjng */
7093  SCRIPT_SUNDANESE, /* Sund */
7094  SCRIPT_SAURASHTRA, /* Saur */
7095  SCRIPT_CHAM, /* Cham */
7096  SCRIPT_OL_CHIKI, /* Olck */
7097  SCRIPT_VAI, /* Vaii */
7098  SCRIPT_CARIAN, /* Cari */
7099  SCRIPT_LYCIAN, /* Lyci */
7100  SCRIPT_LYDIAN, /* Lydi */
7101 
7102  /* Unicode-5.2 additions */
7103  SCRIPT_AVESTAN, /* Avst */
7104  SCRIPT_BAMUM, /* Bamu */
7105  SCRIPT_EGYPTIAN_HIEROGLYPHS, /* Egyp */
7106  SCRIPT_IMPERIAL_ARAMAIC, /* Armi */
7107  SCRIPT_INSCRIPTIONAL_PAHLAVI, /* Phli */
7108  SCRIPT_INSCRIPTIONAL_PARTHIAN, /* Prti */
7109  SCRIPT_JAVANESE, /* Java */
7110  SCRIPT_KAITHI, /* Kthi */
7111  SCRIPT_LISU, /* Lisu */
7112  SCRIPT_MEETEI_MAYEK, /* Mtei */
7113  SCRIPT_OLD_SOUTH_ARABIAN, /* Sarb */
7114  SCRIPT_OLD_TURKIC, /* Orkh */
7115  SCRIPT_SAMARITAN, /* Samr */
7116  SCRIPT_TAI_THAM, /* Lana */
7117  SCRIPT_TAI_VIET, /* Tavt */
7118 
7119  /* Unicode-6.0 additions */
7120  SCRIPT_BATAK, /* Batk */
7121  SCRIPT_BRAHMI, /* Brah */
7122  SCRIPT_MANDAIC, /* Mand */
7123 
7124  /* Unicode-6.1 additions */
7125  SCRIPT_CHAKMA, /* Cakm */
7126  SCRIPT_MEROITIC_CURSIVE, /* Merc */
7127  SCRIPT_MEROITIC_HIEROGLYPHS, /* Mero */
7128  SCRIPT_MIAO, /* Plrd */
7129  SCRIPT_SHARADA, /* Shrd */
7130  SCRIPT_SORA_SOMPENG, /* Sora */
7131  SCRIPT_TAKRI, /* Takr */
7132 
7133  /* Unicode 7.0 additions */
7134  SCRIPT_BASSA_VAH, /* Bass */
7135  SCRIPT_CAUCASIAN_ALBANIAN, /* Aghb */
7136  SCRIPT_DUPLOYAN, /* Dupl */
7137  SCRIPT_ELBASAN, /* Elba */
7138  SCRIPT_GRANTHA, /* Gran */
7139  SCRIPT_KHOJKI, /* Khoj */
7140  SCRIPT_KHUDAWADI, /* Sind */
7141  SCRIPT_LINEAR_A, /* Lina */
7142  SCRIPT_MAHAJANI, /* Mahj */
7143  SCRIPT_MANICHAEAN, /* Manu */
7144  SCRIPT_MENDE_KIKAKUI, /* Mend */
7145  SCRIPT_MODI, /* Modi */
7146  SCRIPT_MRO, /* Mroo */
7147  SCRIPT_NABATAEAN, /* Nbat */
7148  SCRIPT_OLD_NORTH_ARABIAN, /* Narb */
7149  SCRIPT_OLD_PERMIC, /* Perm */
7150  SCRIPT_PAHAWH_HMONG, /* Hmng */
7151  SCRIPT_PALMYRENE, /* Palm */
7152  SCRIPT_PAU_CIN_HAU, /* Pauc */
7153  SCRIPT_PSALTER_PAHLAVI, /* Phlp */
7154  SCRIPT_SIDDHAM, /* Sidd */
7155  SCRIPT_TIRHUTA, /* Tirh */
7156  SCRIPT_WARANG_CITI, /* Wara */
7157 
7158  /* Unicode 8.0 additions */
7159  SCRIPT_AHOM, /* Ahom */
7160  SCRIPT_ANATOLIAN_HIEROGLYPHS, /* Hluw */
7161  SCRIPT_HATRAN, /* Hatr */
7162  SCRIPT_MULTANI, /* Mult */
7163  SCRIPT_OLD_HUNGARIAN, /* Hung */
7164  SCRIPT_SIGNWRITING, /* Sgnw */
7165 
7166  /* Unicode 9.0 additions */
7167  SCRIPT_ADLAM, /* Adlm */
7168  SCRIPT_BHAIKSUKI, /* Bhks */
7169  SCRIPT_MARCHEN, /* Marc */
7170  SCRIPT_NEWA, /* Newa */
7171  SCRIPT_OSAGE, /* Osge */
7172  SCRIPT_TANGUT, /* Tang */
7173 
7174  /* Unicode 10.0 additions */
7175  SCRIPT_MASARAM_GONDI, /* Gonm */
7176  SCRIPT_NUSHU, /* Nshu */
7177  SCRIPT_SOYOMBO, /* Soyo */
7178  SCRIPT_ZANABAZAR_SQUARE, /* Zanb */
7179 
7180  /* Unicode 11.0 additions */
7181  SCRIPT_DOGRA, /* Dogr */
7182  SCRIPT_GUNJALA_GONDI, /* Gong */
7183  SCRIPT_HANIFI_ROHINGYA, /* Rohg */
7184  SCRIPT_MAKASAR, /* Maka */
7185  SCRIPT_MEDEFAIDRIN, /* Medf */
7186  SCRIPT_OLD_SOGDIAN, /* Sogo */
7187  SCRIPT_SOGDIAN, /* Sogd */
7188 
7189  /* Unicode 12.0 additions */
7190  SCRIPT_ELYMAIC, /* Elymaic */
7191  SCRIPT_NANDINAGARI, /* Nandinagari */
7192  SCRIPT_NYIAKENG_PUACHUE_HMONG, /* Nyiakeng Puachue Hmong */
7193  SCRIPT_WANCHO, /* Wancho */
7194 } ScriptType;
7195 
7209 typedef enum {
7498 } LanguageCode;
7499 
7516 MG_EXPORT LanguageCode GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1);
7517 
7531 static inline LanguageCode GUIAPI LanguageCodeFromISO639s1Code(const char* iso639_1)
7532 {
7533  return LanguageCodeFromISO639s1(MAKEWORD16(iso639_1[1],
7534  iso639_1[0]));
7535 }
7536 
7538 MG_EXPORT const char* GUIAPI LanguageCodeToISO639s1(LanguageCode lc);
7539 
7542 
7544 MG_EXPORT const ScriptType* GUIAPI GetScriptsForLang(const char* lang_name,
7545  LanguageCode* lang_code, int* nr_scripts);
7546 
7548 MG_EXPORT ScriptType GUIAPI NormalizeScriptType(LanguageCode cl,
7549  ScriptType ws);
7550 
7553 struct _FONTOPS;
7554 struct _CHARSETOPS;
7555 
7556 typedef struct _FONTOPS FONTOPS;
7557 typedef struct _CHARSETOPS CHARSETOPS;
7558 
7563 struct _DEVFONT {
7574  char name [LEN_UNIDEVFONT_NAME + 1];
7575 
7578 
7579  /*
7580  * The following fields are internally used.
7581  * They may changed in the future.
7582  */
7583  // indicating if the data need to be unloaded before delete a devfont
7584  BOOL need_unload;
7585 
7586  // The pointer to font operation structure.
7587  FONTOPS* font_ops;
7588 
7589  // The pointer to character set operation structure.
7590  CHARSETOPS* charset_ops;
7591 
7592  // The pointer to next device font.
7593  struct _DEVFONT* next;
7594 
7595  // The device font used data.
7596  void* data;
7597 
7598  // The device font used relationship.
7599  void* relationship;
7600 };
7601 
7606 #define INV_LOGFONT 0
7607 
7609 typedef struct _FONTMETRICS {
7613  int ascent;
7615  int descent;
7616 
7621 } FONTMETRICS;
7622 
7637 MG_EXPORT void GUIAPI GetFontMetrics (LOGFONT* log_font,
7638  FONTMETRICS* font_metrics);
7639 
7641 typedef struct _GLYPHBITMAP {
7643  int bbox_x, bbox_y, bbox_w, bbox_h;
7645  int advance_x, advance_y;
7646 
7648  size_t bmp_size;
7652  const unsigned char* bits;
7653 } GLYPHBITMAP;
7654 
7684 MG_EXPORT void GUIAPI GetGlyphBitmap (LOGFONT* log_font,
7685  const char* mchar, int mchar_len,
7686  GLYPHBITMAP* glyph_bitmap);
7687 
7706 static inline BOOL GUIAPI InitVectorialFonts (void)
7707 {
7708  _WRN_PRINTF("deprecated\n");
7709  return TRUE;
7710 }
7711 
7726 static inline void GUIAPI TermVectorialFonts (void)
7727 {
7728  _WRN_PRINTF("deprecated\n");
7729 }
7730 
7855 MG_EXPORT PLOGFONT GUIAPI CreateLogFont (const char* type, const char* family,
7856  const char* charset, char weight, char slant, char flip,
7857  char other, char underline, char struckout,
7858  int size, int rotation);
7859 
7989 MG_EXPORT PLOGFONT GUIAPI CreateLogFontEx (const char* type, const char* family,
7990  const char* charset, char weight, char slant, char flip,
7991  char other, char decoration, char rendering,
7992  int size, int rotation);
7993 
8024 MG_EXPORT PLOGFONT GUIAPI CreateLogFontByName(const char* font_name);
8025 
8026 #ifdef _MGCHARSET_UNICODE
8027 
8044 MG_EXPORT PLOGFONT GUIAPI CreateLogFontForMChar2UChar(const char* charset);
8045 #endif /* _MGCHARSET_UNICODE */
8046 
8058 MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirect (LOGFONT* logfont);
8059 
8081 MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirectEx (LOGFONT* logfont,
8082  int rotation);
8083 
8094 MG_EXPORT void GUIAPI DestroyLogFont (PLOGFONT log_font);
8095 
8109 MG_EXPORT void GUIAPI GetLogFontInfo (HDC hdc, LOGFONT* log_font);
8110 
8123 MG_EXPORT PLOGFONT GUIAPI GetCurFont (HDC hdc);
8124 
8143 MG_EXPORT PLOGFONT GUIAPI SelectFont (HDC hdc, PLOGFONT log_font);
8144 
8155 MG_EXPORT const DEVFONT* GUIAPI GetNextDevFont (const DEVFONT* dev_font);
8156 
8157 #ifdef _MGFONT_FT2
8158 
8163 typedef enum {
8173  MG_SMOOTH_MAX /*do not remove*/
8174 } FT2LCDFilter;
8175 
8191 MG_EXPORT BOOL GUIAPI ft2SetLcdFilter (LOGFONT* logfont, FT2LCDFilter filter);
8192 
8193 #endif
8194 
8209 MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromIncoreData (const char *devfont_name,
8210  const void *data);
8211 
8228 MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name,
8229  const char *file_name);
8230 
8240 MG_EXPORT void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont);
8241 
8260 #define SYSLOGFONT_DEFAULT 0
8261 
8266 #define SYSLOGFONT_WCHAR_DEF 1
8267 
8272 #define SYSLOGFONT_FIXED 2
8273 
8278 #define SYSLOGFONT_CAPTION 3
8279 
8284 #define SYSLOGFONT_MENU 4
8285 
8290 #define SYSLOGFONT_CONTROL 5
8291 
8292 #define NR_SYSLOGFONTS 6
8293 
8294 
8295 extern MG_EXPORT PLOGFONT g_SysLogFont [];
8296 
8320 static inline PLOGFONT GUIAPI GetSystemFont (int font_id)
8321 {
8322  if (font_id >= 0 && font_id < NR_SYSLOGFONTS)
8323  return g_SysLogFont [font_id];
8324  else
8325  return (PLOGFONT)NULL;
8326 }
8327 
8342 MG_EXPORT int GUIAPI GetSysFontMaxWidth (int font_id);
8343 
8358 MG_EXPORT int GUIAPI GetSysFontAveWidth (int font_id);
8359 
8373 MG_EXPORT int GUIAPI GetSysFontHeight (int font_id);
8374 
8389 MG_EXPORT const char* GUIAPI GetSysCharset (BOOL wchar);
8390 
8405 MG_EXPORT int GUIAPI GetSysCharHeight (void);
8406 
8420 MG_EXPORT int GUIAPI GetSysCharWidth (void);
8421 
8433 MG_EXPORT int GUIAPI GetSysCCharWidth (void);
8434 
8449 {
8451  int len;
8453  unsigned char delimiter;
8456 };
8457 
8477 MG_EXPORT int GUIAPI GetTextMCharInfo (PLOGFONT log_font,
8478  const char* mstr, int len, int* pos_chars);
8479 
8503 MG_EXPORT int GUIAPI GetTextWordInfo (PLOGFONT log_font, const char* mstr,
8504  int len, int* pos_words, WORDINFO* info_words);
8505 
8521 MG_EXPORT int GUIAPI GetFirstMCharLen (PLOGFONT log_font,
8522  const char* mstr, int len);
8523 
8544 MG_EXPORT int GUIAPI GetFirstWord (PLOGFONT log_font,
8545  const char* mstr, int len, WORDINFO* word_info);
8546 
8578 MG_EXPORT int GUIAPI GetTextExtentPoint (HDC hdc, const char* text, int len,
8579  int max_extent, int* fit_chars, int* pos_chars,
8580  int* dx_chars, SIZE* size);
8581 
8590 MG_EXPORT int GUIAPI GetTabbedTextExtentPoint (HDC hdc,
8591  const char* text, int len, int max_extent,
8592  int* fit_chars, int* pos_chars, int* dx_chars, SIZE* size);
8593 
8594 #ifdef _MGCHARSET_UNICODE
8595 
8616 MG_EXPORT int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32,
8617  const unsigned char* mstr, int n);
8618 
8625 #define MB2WC(log_font, dest, mstr, n) \
8626  MB2WCEx (log_font, dest, sizeof(wchar_t) == 4, mstr, n)
8627 
8645 MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, Uchar32 wc);
8646 
8653 #define WC2MB(log_font, s, wc) \
8654  WC2MBEx (log_font, s, (Uchar32)wc)
8655 
8688 MG_EXPORT int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32,
8689  const unsigned char* mstr, int mstr_len, int n,
8690  int* conved_mstr_len);
8691 
8698 #define MBS2WCS(log_font, dest, mstr, mstr_len, n) \
8699  MBS2WCSEx(log_font, dest, sizeof (wchar_t) == 4, mstr, \
8700  mstr_len, n, NULL)
8701 
8734 MG_EXPORT int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest,
8735  const void *wcs, int wcs_len, BOOL wc32, int n,
8736  int* conved_wcs_len);
8737 
8744 #define WCS2MBS(log_font, dest, wcs, wcs_len, n) \
8745  WCS2MBSEx (log_font, dest, wcs, wcs_len, sizeof (wchar_t) == 4, \
8746  n, NULL)
8747 
8748 #endif /* _MGCHARSET_UNICODE */
8749 
8772 
8781 
8793 
8794 #define BIDI_FLAG_SHAPE_MIRRORING 0x00000001
8795 #define BIDI_FLAG_REORDER_NSM 0x00000002
8796 #define BIDI_FLAG_SHAPE_ARAB_PRES 0x00000100
8797 #define BIDI_FLAG_SHAPE_ARAB_LIGA 0x00000200
8798 #define BIDI_FLAG_SHAPE_ARAB_CONSOLE 0x00000400
8799 
8800 #define BIDI_FLAGS_DEFAULT \
8801  (BIDI_FLAG_REORDER_NSM | BIDI_FLAG_REMOVE_SPECIALS)
8802 
8803 #define BIDI_FLAGS_ARABIC \
8804  (BIDI_FLAG_SHAPE_ARAB_PRES | BIDI_FLAG_SHAPE_ARAB_LIGA)
8805 
8806 #define BIDI_FLAG_REMOVE_BIDI 0x00010000
8807 #define BIDI_FLAG_REMOVE_JOINING 0x00020000
8808 #define BIDI_FLAG_REMOVE_SPECIALS 0x00040000
8809 
8810 #define BIDI_BRACKET_NONE 0
8811 #define BIDI_BRACKET_OPEN_MASK 0x80000000
8812 #define BIDI_BRACKET_CHAR_MASK 0X7FFFFFFF
8813 #define BIDI_IS_BRACKET_OPEN(bt) ((bt & BIDI_BRACKET_OPEN_MASK)>0)
8814 #define BIDI_BRACKET_CHAR(bt) ((bt & BIDI_BRACKET_CHAR_MASK))
8815 
8816 /*
8817  * Define some bit masks, that character types are based on, each one has
8818  * only one bit on.
8819  */
8820 
8821 #define BIDI_TYPE_INVALID 0x0000
8822 
8823 #define BIDI_MASK_RTL 0x0001 /* Is right to left */
8824 #define BIDI_MASK_ARABIC 0x0002 /* Is arabic */
8825 #define BIDI_MASK_FIRST 0x0004 /* Is direction is determined by first strong */
8826 #define BIDI_MASK_SEPARATOR 0x0008 /* Is separator: BS, SS */
8827 
8828 #define BIDI_MASK_STRONG 0x0010 /* Is strong */
8829 #define BIDI_MASK_WEAK 0x0020 /* Is weak */
8830 #define BIDI_MASK_NEUTRAL 0x0040 /* Is neutral */
8831 #define BIDI_MASK_SENTINEL 0x0080 /* Is sentinel: SOT, EOT */
8832 
8833 /* Each char can be only one of the seven following: */
8834 #define BIDI_MASK_LETTER 0x0100 /* Is letter: L, R, AL */
8835 #define BIDI_MASK_NUMBER 0x0200 /* Is number: EN, AN */
8836 #define BIDI_MASK_NUMSEPTER 0x0300 /* Is number separator or terminator: ES, ET, CS */
8837 #define BIDI_MASK_SPACE 0x0400 /* Is space: BN, BS, SS, WS */
8838 #define BIDI_MASK_EXPLICIT 0x0500 /* Is expilict mark: LRE, RLE, LRO, RLO, PDF */
8839 #define BIDI_MASK_ISOLATE 0x0600 /* Is isolate mark: LRI, RLI, FSI, PDI */
8840 #define BIDI_MASK_NSM 0x0700 /* Is non spacing mark: NSM */
8841 # define BIDI_TYPE_MASK 0x0700
8842 
8843 #define BIDI_MASK_OVERRIDE 0x8000 /* Is explicit override: LRO, RLO */
8844 
8845 /* Each char can be only one of the seven following: */
8846 #define BIDI_MASK_ES 0x1000
8847 #define BIDI_MASK_CS 0x2000
8848 #define BIDI_MASK_ET 0x3000
8849 #define BIDI_MASK_BS 0x4000
8850 #define BIDI_MASK_SS 0x5000
8851 #define BIDI_MASK_BN 0x6000
8852 #define BIDI_MASK_WS 0x7000
8853 # define BIDI_MISC_MASK 0x7000
8854 
8855 /* Reserved for private use */
8856 #define BIDI_MASK_PRIVATE 0x8000
8857 
8862 #define BIDI_TYPE_LTR \
8863  (BIDI_MASK_STRONG | BIDI_MASK_LETTER)
8864 
8869 #define BIDI_TYPE_RTL \
8870  (BIDI_MASK_STRONG | BIDI_MASK_LETTER | BIDI_MASK_RTL)
8871 
8876 #define BIDI_TYPE_AL \
8877  (BIDI_MASK_STRONG | BIDI_MASK_LETTER | BIDI_MASK_RTL | BIDI_MASK_ARABIC)
8878 
8883 #define BIDI_TYPE_LRE \
8884  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT)
8885 
8890 #define BIDI_TYPE_RLE \
8891  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_RTL)
8892 
8897 #define BIDI_TYPE_LRO \
8898  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_OVERRIDE)
8899 
8904 #define BIDI_TYPE_RLO \
8905  (BIDI_MASK_STRONG | BIDI_MASK_EXPLICIT | BIDI_MASK_RTL | BIDI_MASK_OVERRIDE)
8906 
8911 #define BIDI_TYPE_PDF \
8912  (BIDI_MASK_WEAK | BIDI_MASK_EXPLICIT)
8913 
8918 #define BIDI_TYPE_EN \
8919  (BIDI_MASK_WEAK | BIDI_MASK_NUMBER)
8920 
8925 #define BIDI_TYPE_AN \
8926  (BIDI_MASK_WEAK | BIDI_MASK_NUMBER | BIDI_MASK_ARABIC)
8927 
8932 #define BIDI_TYPE_ES \
8933  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_ES)
8934 
8939 #define BIDI_TYPE_ET \
8940  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_ET)
8941 
8946 #define BIDI_TYPE_CS \
8947  (BIDI_MASK_WEAK | BIDI_MASK_NUMSEPTER | BIDI_MASK_CS)
8948 
8953 #define BIDI_TYPE_NSM \
8954  (BIDI_MASK_WEAK | BIDI_MASK_NSM)
8955 
8960 #define BIDI_TYPE_BN \
8961  (BIDI_MASK_WEAK | BIDI_MASK_SPACE | BIDI_MASK_BN)
8962 
8967 #define BIDI_TYPE_BS \
8968  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_SEPARATOR | BIDI_MASK_BS)
8969 
8974 #define BIDI_TYPE_SS \
8975  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_SEPARATOR | BIDI_MASK_SS)
8976 
8981 #define BIDI_TYPE_WS \
8982  (BIDI_MASK_NEUTRAL | BIDI_MASK_SPACE | BIDI_MASK_WS)
8983 
8988 #define BIDI_TYPE_ON \
8989  (BIDI_MASK_NEUTRAL)
8990 
8995 #define BIDI_TYPE_LRI \
8996  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE)
8997 
9002 #define BIDI_TYPE_RLI \
9003  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE | BIDI_MASK_RTL)
9004 
9009 #define BIDI_TYPE_FSI \
9010  (BIDI_MASK_NEUTRAL | BIDI_MASK_ISOLATE | BIDI_MASK_FIRST)
9011 
9016 #define BIDI_TYPE_PDI \
9017  (BIDI_MASK_NEUTRAL | BIDI_MASK_WEAK | BIDI_MASK_ISOLATE)
9018 
9019 #define BIDI_TYPE_SENTINEL (BIDI_MASK_SENTINEL)
9020 
9021 /* The following are only used internally */
9022 
9023 /* Weak Left-To-Right */
9024 #define BIDI_TYPE_WLTR (BIDI_MASK_WEAK)
9025 /* Weak Right-To-Left */
9026 #define BIDI_TYPE_WRTL (BIDI_MASK_WEAK | BIDI_MASK_RTL)
9027 
9028 /* Start of text */
9029 #define BIDI_TYPE_SOT (BIDI_MASK_SENTINEL)
9030 /* End of text */
9031 #define BIDI_TYPE_EOT (BIDI_MASK_SENTINEL | BIDI_MASK_RTL)
9032 
9033 #define BIDI_TYPE_PRIVATE (BIDI_MASK_PRIVATE)
9034 
9035 /* Is private-use value? */
9036 #define BIDI_IS_PRIVATE(p) ((p) & BIDI_MASK_PRIVATE)
9037 
9038 /* Is right to left? */
9039 #define BIDI_IS_RTL(p) ((p) & BIDI_MASK_RTL)
9040 
9041 /* Is arabic? */
9042 #define BIDI_IS_ARABIC(p) ((p) & BIDI_MASK_ARABIC)
9043 
9044 /* Is right-to-left level? */
9045 #define BIDI_LEVEL_IS_RTL(lev) ((lev) & 1)
9046 
9047 /* Return the bidi type corresponding to the direction of the level number,
9048  BIDI_TYPE_LTR for evens and BIDI_TYPE_RTL for odds. */
9049 #define BIDI_LEVEL_TO_DIR(lev) \
9050  (BIDI_LEVEL_IS_RTL(lev) ? BIDI_TYPE_RTL : BIDI_TYPE_LTR)
9051 
9052 /* Return the minimum level of the direction, 0 for BIDI_TYPE_LTR and
9053  1 for BIDI_TYPE_RTL and BIDI_TYPE_AL. */
9054 #define BIDI_DIR_TO_LEVEL(dir) \
9055  ((BidiLevel) (BIDI_IS_RTL(dir) ? 1 : 0))
9056 
9057 /* Is strong? */
9058 #define BIDI_IS_STRONG(p) ((p) & BIDI_MASK_STRONG)
9059 /* Is weak? */
9060 #define BIDI_IS_WEAK(p) ((p) & BIDI_MASK_WEAK)
9061 /* Is neutral? */
9062 #define BIDI_IS_NEUTRAL(p) ((p) & BIDI_MASK_NEUTRAL)
9063 /* Is sentinel? */
9064 #define BIDI_IS_SENTINEL(p) ((p) & BIDI_MASK_SENTINEL)
9065 
9066 /* Is letter: L, R, AL? */
9067 #define BIDI_IS_LETTER(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_LETTER)
9068 
9069 /* Is number: EN, AN? */
9070 #define BIDI_IS_NUMBER(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NUMBER)
9071 
9072 /* Is number separator or terminator: ES, ET, CS? */
9073 #define BIDI_IS_NUMBER_SEPARATOR_OR_TERMINATOR(p) \
9074  (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NUMSEPTER)
9075 
9076 /* Is space: BN, BS, SS, WS? */
9077 #define BIDI_IS_SPACE(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_SPACE)
9078 /* Is explicit mark: LRE, RLE, LRO, RLO, PDF? */
9079 #define BIDI_IS_EXPLICIT(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT)
9080 
9081 /* Is test separator: BS, SS? */
9082 #define BIDI_IS_SEPARATOR(p) ((p) & BIDI_MASK_SEPARATOR)
9083 
9084 /* Is explicit override: LRO, RLO? */
9085 #define BIDI_IS_OVERRIDE(p) ((p) & BIDI_MASK_OVERRIDE)
9086 
9087 /* Is isolote: LRO, RLO? */
9088 #define BIDI_IS_ISOLATE(p) (((p) & BIDI_TYPE_MASK) == BIDI_MASK_ISOLATE)
9089 
9090 /* Is left to right letter: LTR? */
9091 #define BIDI_IS_LTR_LETTER(p) \
9092  ((p) & (BIDI_MASK_LETTER | BIDI_MASK_RTL) == BIDI_MASK_LETTER)
9093 
9094 /* Is right to left letter: RTL, AL? */
9095 #define BIDI_IS_RTL_LETTER(p) \
9096  ((p) & (BIDI_MASK_LETTER | BIDI_MASK_RTL) \
9097  == (BIDI_MASK_LETTER | BIDI_MASK_RTL))
9098 
9099 /* Is ES or CS: ES, CS? */
9100 #define BIDI_IS_ES_OR_CS(p) \
9101  (((p) & BIDI_MISC_MASK) == BIDI_MASK_ES || \
9102  ((p) & BIDI_MISC_MASK) == BIDI_MASK_CS)
9103 
9104 /* Change numbers: EN, AN to RTL. */
9105 #define BIDI_NUMBER_TO_RTL(p) \
9106  (BIDI_IS_NUMBER(p) ? BIDI_TYPE_RTL : (p))
9107 
9108 /* Is explicit or BN: LRE, RLE, LRO, RLO, PDF, BN? */
9109 #define BIDI_IS_EXPLICIT_OR_BN(p) \
9110  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
9111  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN))
9112 
9113 /* Is explicit or BN or WS: LRE, RLE, LRO, RLO, PDF, BN, WS? */
9114 #define BIDI_IS_EXPLICIT_OR_BN_OR_WS(p) \
9115  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
9116  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN) || \
9117  (((p) & BIDI_MISC_MASK) == BIDI_MASK_WS))
9118 
9119 /* Is explicit or separator or BN or WS: LRE, RLE, LRO, RLO, PDF, BS, SS, BN, WS? */
9120 #define BIDI_IS_EXPLICIT_OR_SEPARATOR_OR_BN_OR_WS(p) \
9121  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
9122  ((p) & BIDI_MASK_SEPARATOR) || \
9123  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN) || \
9124  (((p) & BIDI_MISC_MASK) == BIDI_MASK_WS))
9125 
9126 /* Is explicit or BN or NSM: LRE, RLE, LRO, RLO, PDF, BN, NSM? */
9127 #define BIDI_IS_EXPLICIT_OR_BN_OR_NSM(p) \
9128  ((((p) & BIDI_TYPE_MASK) == BIDI_MASK_EXPLICIT) || \
9129  (((p) & BIDI_TYPE_MASK) == BIDI_MASK_NSM) || \
9130  (((p) & BIDI_MISC_MASK) == BIDI_MASK_BN))
9131 
9132 /* Override status of an explicit mark:
9133  * LRO,LRE->LTR, RLO,RLE->RTL, otherwise->ON. */
9134 #define BIDI_EXPLICIT_TO_OVERRIDE_DIR(p) \
9135  (BIDI_IS_OVERRIDE(p) ? BIDI_LEVEL_TO_DIR(BIDI_DIR_TO_LEVEL(p)) \
9136  : BIDI_TYPE_ON)
9137 
9138 /* Change numbers to RTL: EN,AN -> RTL. */
9139 #define BIDI_CHANGE_NUMBER_TO_RTL(p) \
9140  (BIDI_IS_NUMBER(p) ? BIDI_TYPE_RTL : (p))
9141 
9142 #define BIDI_PGDIR_LTR BIDI_TYPE_LTR
9143 #define BIDI_PGDIR_RTL BIDI_TYPE_RTL
9144 #define BIDI_PGDIR_WLTR BIDI_TYPE_WLTR
9145 #define BIDI_PGDIR_WRTL BIDI_TYPE_WRTL
9146 #define BIDI_PGDIR_ON BIDI_TYPE_ON
9147 
9148 /*
9149  * Define bit masks that joining types are based on, each mask has
9150  * only one bit set.
9151  */
9152 #define BIDI_MASK_JOINS_RIGHT 0x01 /* May join to right */
9153 #define BIDI_MASK_JOINS_LEFT 0x02 /* May join to right */
9154 #define BIDI_MASK_ARAB_SHAPES 0x04 /* May Arabic shape */
9155 #define BIDI_MASK_TRANSPARENT 0x08 /* Is transparent */
9156 #define BIDI_MASK_IGNORED 0x10 /* Is ignored */
9157 #define BIDI_MASK_LIGATURED 0x20 /* Is ligatured */
9158 
9159 /*
9160  * Define values for BidiJoiningType
9161  */
9162 
9163 /* nUn-joining */
9164 #define BIDI_JOINING_TYPE_U_VAL ( 0 )
9165 
9166 /* Right-joining */
9167 #define BIDI_JOINING_TYPE_R_VAL \
9168  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_ARAB_SHAPES )
9169 
9170 /* Dual-joining */
9171 #define BIDI_JOINING_TYPE_D_VAL \
9172  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
9173  | BIDI_MASK_ARAB_SHAPES )
9174 
9175 /* join-Causing */
9176 #define BIDI_JOINING_TYPE_C_VAL \
9177  ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT )
9178 
9179 /* Left-joining */
9180 #define BIDI_JOINING_TYPE_L_VAL \
9181  ( BIDI_MASK_JOINS_LEFT | BIDI_MASK_ARAB_SHAPES )
9182 
9183 /* Transparent */
9184 #define BIDI_JOINING_TYPE_T_VAL \
9185  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_ARAB_SHAPES )
9186 
9187 /* iGnored */
9188 #define BIDI_JOINING_TYPE_G_VAL ( BIDI_MASK_IGNORED )
9189 
9190 /*
9191  * The equivalent of JoiningType values for ArabicProp
9192  */
9193 
9194 /* Primary Arabic Joining Classes (Table 8-2) */
9195 
9196 /* nUn-joining */
9197 #define BIDI_IS_JOINING_TYPE_U(p) \
9198  ( 0 == ( (p) & \
9199  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9200  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
9201 
9202 /* Right-joining */
9203 #define BIDI_IS_JOINING_TYPE_R(p) \
9204  ( BIDI_MASK_JOINS_RIGHT == ( (p) & \
9205  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9206  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
9207 
9208 /* Dual-joining */
9209 #define BIDI_IS_JOINING_TYPE_D(p) \
9210  ( ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
9211  | BIDI_MASK_ARAB_SHAPES ) == ( (p) & \
9212  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9213  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
9214  | BIDI_MASK_ARAB_SHAPES ) ) )
9215 
9216 /* join-Causing */
9217 #define BIDI_IS_JOINING_TYPE_C(p) \
9218  ( ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) == ( (p) & \
9219  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9220  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT \
9221  | BIDI_MASK_ARAB_SHAPES ) ) )
9222 
9223 /* Left-joining */
9224 #define BIDI_IS_JOINING_TYPE_L(p) \
9225  ( BIDI_MASK_JOINS_LEFT == ( (p) & \
9226  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9227  | BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ) ) )
9228 
9229 /* Transparent */
9230 #define BIDI_IS_JOINING_TYPE_T(p) \
9231  ( BIDI_MASK_TRANSPARENT == ( (p) & \
9232  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED ) ) )
9233 
9234 /* iGnored */
9235 #define BIDI_IS_JOINING_TYPE_G(p) \
9236  ( BIDI_MASK_IGNORED == ( (p) & \
9237  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED ) ) )
9238 
9239 /* and for Derived Arabic Joining Classes (Table 8-3) */
9240 
9241 /* Right join-Causing */
9242 #define BIDI_IS_JOINING_TYPE_RC(p) \
9243  ( BIDI_MASK_JOINS_RIGHT == ( (p) & \
9244  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9245  | BIDI_MASK_JOINS_RIGHT ) ) )
9246 
9247 /* Left join-Causing */
9248 #define BIDI_IS_JOINING_TYPE_LC(p) \
9249  ( BIDI_MASK_JOINS_LEFT == ( (p) & \
9250  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9251  | BIDI_MASK_JOINS_LEFT ) ) )
9252 
9253 /*
9254  * Defining macros for needed queries, It is fully dependent on the
9255  * implementation of BidiJoiningType.
9256  */
9257 
9258 /* Joins to right: R, D, C? */
9259 #define BIDI_JOINS_RIGHT(p) ((p) & BIDI_MASK_JOINS_RIGHT)
9260 
9261 /* Joins to left: L, D, C? */
9262 #define BIDI_JOINS_LEFT(p) ((p) & BIDI_MASK_JOINS_LEFT)
9263 
9264 /* May shape: R, D, L, T? */
9265 #define BIDI_ARAB_SHAPES(p) ((p) & BIDI_MASK_ARAB_SHAPES)
9266 
9267 /* Is skipped in joining: T, G? */
9268 #define BIDI_IS_JOIN_SKIPPED(p) \
9269  ((p) & (BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED))
9270 
9271 /* Is base that will be shaped: R, D, L? */
9272 #define BIDI_IS_JOIN_BASE_SHAPES(p) \
9273  ( BIDI_MASK_ARAB_SHAPES == ( (p) & \
9274  ( BIDI_MASK_TRANSPARENT | BIDI_MASK_IGNORED \
9275  | BIDI_MASK_ARAB_SHAPES ) ) )
9276 
9277 #define BIDI_JOINS_PRECEDING_MASK(level) \
9278  (BIDI_LEVEL_IS_RTL (level) ? BIDI_MASK_JOINS_RIGHT \
9279  : BIDI_MASK_JOINS_LEFT)
9280 
9281 #define BIDI_JOINS_FOLLOWING_MASK(level) \
9282  (BIDI_LEVEL_IS_RTL (level) ? BIDI_MASK_JOINS_LEFT \
9283  : BIDI_MASK_JOINS_RIGHT)
9284 
9285 #define BIDI_JOIN_SHAPE(p) \
9286  ((p) & ( BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT ))
9287 
9290 #ifdef _MGCHARSET_UNICODE
9291 
9313 MG_EXPORT UCharGeneralCategory GUIAPI UCharGetCategory(Uchar32 uc);
9314 
9330 MG_EXPORT UCharBreakType GUIAPI UCharGetBreakType(Uchar32 uc);
9331 
9350 MG_EXPORT BidiType GUIAPI UCharGetBidiType(Uchar32 uc);
9351 
9368 MG_EXPORT void GUIAPI UStrGetBidiTypes(const Uchar32* ucs, int nr_ucs,
9369  BidiType* bdts);
9370 
9396 MG_EXPORT BidiBracketType GUIAPI UCharGetBracketType(Uchar32 ch);
9397 
9418 MG_EXPORT void GUIAPI UStrGetBracketTypes(const Uchar32 *ucs,
9419  const BidiType *bidi_types, int len_ucs,
9420  BidiBracketType *bracket_types);
9421 
9444 MG_EXPORT BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32* mirrored);
9445 
9470 MG_EXPORT BidiJoiningType GUIAPI UCharGetJoiningType(Uchar32 uc);
9471 
9490 MG_EXPORT void GUIAPI UStrGetJoiningTypes(const Uchar32 *ucs, int nr_ucs,
9491  BidiJoiningType *joining_types);
9492 
9519 MG_EXPORT BidiType GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len);
9520 
9560 MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevels(
9561  const BidiType *bidi_types,
9562  const BidiBracketType* bracket_types, int len,
9563  ParagraphDir *paragraph_dir, BidiLevel *embedding_levels);
9564 
9601  const Uchar32* ucs, int nr_ucs,
9602  ParagraphDir *paragraph_dir, BidiLevel *embedding_levels);
9603 
9604 /*
9605  * \var typedef void (*CB_REVERSE_ARRAY) (void* extra, int len, int pos)
9606  * \brief The prototype of the user defined function to reverse an array.
9607  *
9608  * The function reverse an array pointed by \a extra from the position
9609  * specified by \a pos for the length specified by \a len.
9610  *
9611  * \sa UBidiReorderLine, BIDILogAChars2VisACharsEx
9612  */
9613 typedef void (*CB_REVERSE_ARRAY) (void* extra, int len, int pos);
9614 
9674 MG_EXPORT BidiLevel GUIAPI UBidiReorderLine(Uint32 bidi_flags,
9675  const BidiType *bidi_types, int len, int off,
9676  ParagraphDir paragraph_dir, BidiLevel *embedding_levels,
9677  Uchar32 *visual_str, int *indices_map,
9678  void* extra, CB_REVERSE_ARRAY cb_reverse_extra);
9679 
9702 MG_EXPORT void GUIAPI UBidiShapeMirroring(const BidiLevel *embedding_levels,
9703  int len, Uchar32* ucs);
9704 
9738 MG_EXPORT void GUIAPI UBidiJoinArabic(const BidiType *bidi_types,
9739  const BidiLevel *embedding_levels, int len,
9740  BidiArabicProp *ar_props);
9741 
9779 MG_EXPORT void GUIAPI UBidiShapeArabic(Uint32 shaping_flags,
9780  const BidiLevel *embedding_levels, int len,
9781  BidiArabicProp *ar_props, Uchar32* ucs);
9782 
9815 MG_EXPORT void GUIAPI UBidiShape(Uint32 shaping_flags,
9816  const BidiLevel *embedding_levels, int len,
9817  BidiArabicProp *ar_props, Uchar32* ucs);
9818 
9837 #define CTR_NONE 0x00
9838 
9839 #define CTR_CASE_MASK 0x0F
9840 
9847 #define CTR_CAPITALIZE 0x01
9848 
9854 #define CTR_UPPERCASE 0x02
9855 
9861 #define CTR_LOWERCASE 0x03
9862 
9871 #define CTR_FULL_WIDTH 0x10
9872 
9882 #define CTR_FULL_SIZE_KANA 0x20
9883 
9901 #define WBR_NORMAL 0x00
9902 
9908 #define WBR_BREAK_ALL 0x01
9909 
9915 #define WBR_KEEP_ALL 0x02
9916 
9934 #define LBP_NORMAL 0x00
9935 
9942 #define LBP_LOOSE 0x01
9943 
9949 #define LBP_STRICT 0x02
9950 
9961 #define LBP_ANYWHERE 0x03
9962 
9981 #define BOV_UNKNOWN 0x0000
9982 
9985 #define BOV_WHITESPACE 0x8000
9986 
9989 #define BOV_EXPANDABLE_SPACE 0x0800
9990 
9994 #define BOV_ZERO_WIDTH 0x0080
9995 
9996 #define BOV_GB_MASK 0x7000
9997 
10000 #define BOV_GB_CHAR_BREAK 0x1000
10001 
10005 #define BOV_GB_CURSOR_POS 0x2000
10006 
10010 #define BOV_GB_BACKSPACE_DEL_CH 0x4000
10011 
10012 #define BOV_WB_MASK 0x0700
10013 
10016 #define BOV_WB_WORD_BOUNDARY 0x0100
10017 
10020 #define BOV_WB_WORD_START 0x0200
10021 
10024 #define BOV_WB_WORD_END 0x0400
10025 
10026 #define BOV_SB_MASK 0x0070
10027 
10030 #define BOV_SB_SENTENCE_BOUNDARY 0x0010
10031 
10034 #define BOV_SB_SENTENCE_START 0x0020
10035 
10038 #define BOV_SB_SENTENCE_END 0x0040
10039 
10040 #define BOV_LB_MASK 0x000F
10041 #define BOV_LB_BREAK_FLAG 0x0004
10042 #define BOV_LB_MANDATORY_FLAG 0x0008
10043 
10046 #define BOV_LB_ALLOWED (BOV_LB_BREAK_FLAG | 0x0001)
10047 
10050 #define BOV_LB_MANDATORY (BOV_LB_BREAK_FLAG | BOV_LB_MANDATORY_FLAG | 0x0002)
10051 
10054 #define BOV_LB_NOTALLOWED 0x0003
10055 
10060 
10122 MG_EXPORT int GUIAPI UStrGetBreaks(LanguageCode lang_code,
10123  Uint8 ctr, Uint8 wbr, Uint8 lbp,
10124  Uchar32* ucs, int nr_ucs, BreakOppo** break_oppos);
10125 
10126 MG_EXPORT void GUIAPI UStrTailorBreaks(ScriptType writing_system,
10127  const Uchar32* ucs, int nr_ucs, BreakOppo* break_oppos);
10128 
10130 MG_EXPORT BOOL GUIAPI IsUCharAlnum(Uchar32 uc);
10131 
10133 MG_EXPORT BOOL GUIAPI IsUCharAlpha(Uchar32 uc);
10134 
10136 MG_EXPORT BOOL GUIAPI IsUCharControl(Uchar32 uc);
10137 
10139 MG_EXPORT BOOL GUIAPI IsUCharDigit(Uchar32 uc);
10140 
10142 MG_EXPORT BOOL GUIAPI IsUCharGraph(Uchar32 uc);
10143 
10145 MG_EXPORT BOOL GUIAPI IsUCharLowercase(Uchar32 uc);
10146 
10148 MG_EXPORT BOOL GUIAPI IsUCharPrint(Uchar32 uc);
10149 
10151 MG_EXPORT BOOL GUIAPI IsUCharUppercase(Uchar32 uc);
10152 
10154 MG_EXPORT BOOL GUIAPI IsUCharPunct(Uchar32 uc);
10155 
10158 MG_EXPORT BOOL GUIAPI IsUCharSpace(Uchar32 uc);
10159 
10162 MG_EXPORT BOOL GUIAPI IsUCharMark(Uchar32 uc);
10163 
10172 MG_EXPORT BOOL GUIAPI IsUCharTitle(Uchar32 uc);
10173 
10175 MG_EXPORT BOOL GUIAPI IsUCharXDigit(Uchar32 uc);
10176 
10178 MG_EXPORT BOOL GUIAPI IsUCharDefined(Uchar32 uc);
10179 
10181 MG_EXPORT BOOL GUIAPI IsUCharZeroWidth(Uchar32 uc);
10182 
10184 MG_EXPORT BOOL GUIAPI IsUCharWide(Uchar32 uc);
10185 
10194 MG_EXPORT BOOL GUIAPI IsUCharWideCJK(Uchar32 uc);
10195 
10197 MG_EXPORT Uchar32 UCharToUpper (Uchar32 uc);
10198 
10200 MG_EXPORT Uchar32 GUIAPI UCharToLower (Uchar32 uc);
10201 
10203 MG_EXPORT Uchar32 GUIAPI UCharToTitle (Uchar32 uc);
10204 
10206 MG_EXPORT Uchar32 GUIAPI UCharToFullWidth (Uchar32 uc);
10207 
10209 MG_EXPORT Uchar32 GUIAPI UCharToSingleWidth (Uchar32 uc);
10210 
10212 MG_EXPORT Uchar32 GUIAPI UCharToFullSizeKana (Uchar32 uc);
10213 
10215 MG_EXPORT Uchar32 GUIAPI UCharToSmallKana (Uchar32 uc);
10216 
10218 MG_EXPORT BOOL GUIAPI UCharIsArabicVowel(Uchar32 uc);
10219 
10221 MG_EXPORT int GUIAPI UCharCombiningClass (Uchar32 uc);
10222 
10229 MG_EXPORT void GUIAPI UCharCanonicalOrdering (Uchar32 *string, int len);
10230 
10232 MG_EXPORT BOOL GUIAPI UCharCompose (Uchar32 a, Uchar32 b, Uchar32 *ch);
10233 
10235 MG_EXPORT BOOL GUIAPI UCharDecompose (Uchar32 ch, Uchar32 *a, Uchar32 *b);
10236 
10247 MG_EXPORT int GUIAPI UCharFullyDecompose (Uchar32 ch, BOOL compat,
10248  Uchar32 *result, int result_len);
10249 
10266 MG_EXPORT ScriptType GUIAPI UCharGetScriptType (Uchar32 ch);
10267 
10293 MG_EXPORT Uint32 GUIAPI ScriptTypeToISO15924 (ScriptType script);
10294 
10320 MG_EXPORT ScriptType GUIAPI ScriptTypeFromISO15924 (Uint32 iso15924);
10321 
10343 static inline ScriptType GUIAPI ScriptTypeFromISO15924Code (const char* iso15924)
10344 {
10345  return ScriptTypeFromISO15924(MAKEDWORD32(iso15924[3],
10346  iso15924[2], iso15924[1], iso15924[0]));
10347 }
10348 
10349 typedef enum _UVerticalOrient {
10350  UCHAR_VOP_U = 0,
10351  UCHAR_VOP_R,
10352  UCHAR_VOP_TU,
10353  UCHAR_VOP_TR,
10354 } UVerticalOrient;
10355 
10356 typedef enum {
10357  GLYPH_RUN_DIR_LTR = 0,
10358  GLYPH_RUN_DIR_RTL,
10359  GLYPH_RUN_DIR_TTB,
10360  GLYPH_RUN_DIR_BTT,
10361 } GlyphRunDir;
10362 
10363 typedef enum {
10364  GLYPH_GRAVITY_SOUTH = 0,
10365  GLYPH_GRAVITY_EAST,
10366  GLYPH_GRAVITY_NORTH,
10367  GLYPH_GRAVITY_WEST,
10368  GLYPH_GRAVITY_AUTO,
10369 } GlyphGravity;
10370 
10371 typedef enum {
10372  GLYPH_GRAVITY_POLICY_NATURAL,
10373  GLYPH_GRAVITY_POLICY_STRONG,
10374  GLYPH_GRAVITY_POLICY_LINE,
10375  GLYPH_GRAVITY_POLICY_MIXED,
10376 } GlyphGravityPolicy;
10377 
10379 MG_EXPORT UVerticalOrient GUIAPI UCharGetVerticalOrientation(Uchar32 uc);
10380 
10401 MG_EXPORT GlyphGravity GUIAPI ScriptGetGlyphGravity(ScriptType script,
10402  BOOL vertical, GlyphGravity base_gravity, GlyphGravityPolicy policy);
10403 
10432 GlyphGravity ScriptGetGlyphGravityForWide (ScriptType script,
10433  BOOL vertical, BOOL wide,
10434  GlyphGravity base_gravity, GlyphGravityPolicy policy);
10435 
10438 #endif /* _MGCHARSET_UNICODE */
10439 
10457 MG_EXPORT int GUIAPI GetFontHeight (HDC hdc);
10458 
10472 MG_EXPORT int GUIAPI GetMaxFontWidth (HDC hdc);
10473 
10474 
10493 MG_EXPORT int GUIAPI GetTextExtent (HDC hdc,
10494  const char* spText, int len, SIZE* pSize);
10495 
10516 MG_EXPORT int GUIAPI GetTabbedTextExtent (HDC hdc,
10517  const char* spText, int len, SIZE* pSize);
10518 
10525 #define GetTextCharacterExtra(hdc) GetDCAttr (hdc, DC_ATTR_CHAR_EXTRA)
10526 
10533 #define GetTextWordExtra(hdc) GetDCAttr (hdc, DC_ATTR_WORD_EXTRA)
10534 
10541 #define GetTextAboveLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_ALINE_EXTRA)
10542 
10549 #define GetTextBellowLineExtra(hdc) GetDCAttr (hdc, DC_ATTR_BLINE_EXTRA)
10550 
10558 #define SetTextCharacterExtra(hdc, extra) \
10559  SetDCAttr (hdc, DC_ATTR_CHAR_EXTRA, (DWORD) extra)
10560 
10568 #define SetTextWordExtra(hdc, extra) \
10569  SetDCAttr (hdc, DC_ATTR_WORD_EXTRA, (DWORD) extra)
10570 
10577 #define SetTextAboveLineExtra(hdc, extra) \
10578  SetDCAttr (hdc, DC_ATTR_ALINE_EXTRA, (DWORD) extra)
10579 
10586 #define SetTextBellowLineExtra(hdc, extra) \
10587  SetDCAttr (hdc, DC_ATTR_BLINE_EXTRA, (DWORD) extra)
10588 
10589 #define TA_LEFT 0x0000
10590 #define TA_RIGHT 0x0001
10591 #define TA_CENTER 0x0002
10592 #define TA_X_MASK 0x000F
10593 
10594 #define TA_TOP 0x0000
10595 #define TA_BASELINE 0x0010
10596 #define TA_BOTTOM 0x0020
10597 #define TA_Y_MASK 0x00F0
10598 
10599 #define TA_NOUPDATECP 0x0000
10600 #define TA_UPDATECP 0x0100
10601 #define TA_CP_MASK 0x0F00
10602 
10654 #define GetTextAlign(hdc) GetDCAttr (hdc, DC_ATTR_TEXT_ALIGN)
10655 
10712 #define SetTextAlign(hdc, ta_flags) \
10713  SetDCAttr (hdc, DC_ATTR_TEXT_ALIGN, (DWORD)ta_flags)
10714 
10715 #define BIDI_FLAG_LTR 0x00
10716 #define BIDI_FLAG_RTL 0x10
10717 
10718 #define GetBIDIFlags(hdc) \
10719  GetDCAttr (hdc, DC_ATTR_BIDI_FLAGS)
10720 
10721 #define SetBIDIFlags(hdc, bidi_flags) \
10722  SetDCAttr (hdc, DC_ATTR_BIDI_FLAGS, (DWORD)bidi_flags)
10723 
10742 MG_EXPORT int GUIAPI TextOutLen (HDC hdc, int x, int y,
10743  const char* spText, int len);
10744 
10745 
10767 MG_EXPORT int GUIAPI TextOutOmitted (HDC hdc, int x, int y,
10768  const char *mtext, int len, int max_extent);
10769 
10791 MG_EXPORT int GUIAPI TabbedTextOutLen (HDC hdc, int x, int y,
10792  const char* spText, int len);
10793 
10820 MG_EXPORT int GUIAPI TabbedTextOutEx (HDC hdc, int x, int y,
10821  const char* spText, int nCount,
10822  int nTabPositions, int *pTabPositions, int nTabOrigin);
10823 
10833 MG_EXPORT void GUIAPI GetLastTextOutPos (HDC hdc, POINT* pt);
10834 
10843 #define TextOut(hdc, x, y, text) TextOutLen (hdc, x, y, text, -1)
10844 
10853 #define TabbedTextOut(hdc, x, y, text) TabbedTextOutLen (hdc, x, y, text, -1)
10854 
10855 #define DT_TOP 0x00000000
10856 #define DT_LEFT 0x00000000
10857 #define DT_CENTER 0x00000001
10858 #define DT_RIGHT 0x00000002
10859 #define DT_VCENTER 0x00000004
10860 #define DT_BOTTOM 0x00000008
10861 #define DT_WORDBREAK 0x00000010
10862 #define DT_SINGLELINE 0x00000020
10863 #define DT_EXPANDTABS 0x00000040
10864 #define DT_TABSTOP 0x00000080
10865 #define DT_NOCLIP 0x00000100
10866 #define DT_EXTERNALLPADING 0x00000200
10867 #define DT_CALCRECT 0x00000400
10868 #define DT_NOPREFIX 0x00000800
10869 #define DT_INTERNAL 0x00001000
10870 #define DT_CHARBREAK 0x00002000
10871 
10875 typedef struct _DTFIRSTLINE
10876 {
10880  int startx;
10882  int starty;
10884  int width;
10886  int height;
10887 } DTFIRSTLINE;
10888 
10964 MG_EXPORT int GUIAPI DrawTextEx2 (HDC hdc, const char* pText, int nCount,
10965  RECT* pRect, int nIndent, UINT nFormat, DTFIRSTLINE *firstline);
10966 
10976 #define DrawText(hdc, text, n, rc, format) \
10977  DrawTextEx2 (hdc, text, n, rc, 0, format, NULL)
10978 
10987 #define DrawTextEx(hdc, text, n, rc, indent, format) \
10988  DrawTextEx2 (hdc, text, n, rc, indent, format, NULL)
10989 
11000 #define MYBMP_TYPE_NORMAL 0x00000000
11001 #define MYBMP_TYPE_RLE4 0x00000001
11002 #define MYBMP_TYPE_RLE8 0x00000002
11003 #define MYBMP_TYPE_RGB 0x00000003
11004 #define MYBMP_TYPE_BGR 0x00000004
11005 #define MYBMP_TYPE_RGBA 0x00000005
11006 #define MYBMP_TYPE_MASK 0x0000000F
11007 
11008 #define MYBMP_FLOW_DOWN 0x00000010
11009 #define MYBMP_FLOW_UP 0x00000020
11010 #define MYBMP_FLOW_MASK 0x000000F0
11011 
11012 #define MYBMP_TRANSPARENT 0x00000100
11013 #define MYBMP_ALPHACHANNEL 0x00000200
11014 #define MYBMP_ALPHA 0x00000400
11015 
11016 #define MYBMP_RGBSIZE_3 0x00001000
11017 #define MYBMP_RGBSIZE_4 0x00002000
11018 
11019 #define MYBMP_LOAD_GRAYSCALE 0x00010000
11020 #define MYBMP_LOAD_ALLOCATE_ONE 0x00020000
11021 #define MYBMP_LOAD_NONE 0x00000000
11022 
11025 {
11057  int frames;
11062  Uint8 reserved [2];
11065 
11074 
11077 };
11078 
11079 #define BMP_TYPE_NORMAL 0x00
11080 #define BMP_TYPE_RLE 0x01
11081 #define BMP_TYPE_ALPHA 0x02
11082 #define BMP_TYPE_ALPHACHANNEL 0x04
11083 #define BMP_TYPE_COLORKEY 0x10
11084 #define BMP_TYPE_ALPHA_MASK 0x20
11085 #define BMP_TYPE_REPLACEKEY 0x40
11086 
11088 struct _BITMAP
11089 {
11133 
11142 
11143  /* Obsolte.
11144  The private pixel format
11145  void* bmAlphaPixelFormat; */
11146 
11149 
11152 };
11153 
11171 typedef BOOL (* CB_ALLOC_BITMAP_BUFF) (void* context, BITMAP* bmp);
11172 
11177 typedef void (* CB_ONE_SCANLINE) (void* context, MYBITMAP* my_bmp, int y);
11178 
11213 MG_EXPORT BOOL GUIAPI RegisterBitmapFileType (const char *ext,
11214  void* (*init) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal),
11215  int (*load) (MG_RWops* fp, void* init_info, MYBITMAP *my_bmp,
11216  CB_ONE_SCANLINE cb, void* context),
11217  void (*cleanup) (void* init_info),
11218  int (*save) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal),
11219  BOOL (*check) (MG_RWops* fp));
11220 
11236 MG_EXPORT const char* GUIAPI CheckBitmapType (MG_RWops* fp);
11237 
11279 #define MLS_BLENDMODE_NONE 0x00
11280 #define MLS_BLENDMODE_COLORKEY 0x01
11281 #define MLS_BLENDMODE_ALPHA 0x02
11282 
11283 #define MLS_INFOMASK_OFFSET 0x01
11284 #define MLS_INFOMASK_BLEND 0x02
11285 #define MLS_INFOMASK_ZORDER 0x04
11286 #define MLS_INFOMASK_ALL 0x07
11287 #define MLS_INFOMASK_ENABLE 0x08
11288 
11289 MG_EXPORT BOOL GUIAPI mlsSetSlaveScreenInfo (HDC dc_mls, DWORD mask, int offset_x, int offset_y,
11290  DWORD blend_flags, gal_pixel color_key, int alpha, int z_order);
11291 
11292 MG_EXPORT BOOL GUIAPI mlsGetSlaveScreenInfo (HDC dc_mls, DWORD mask, int* offset_x, int* offset_y,
11293  DWORD blend_flags, gal_pixel* color_key, int* alpha, int* z_order);
11307 MG_EXPORT BOOL GUIAPI mlsEnableSlaveScreen (HDC dc_mls, BOOL enable);
11308 
11309 #define ERR_BMP_OK 0
11310 #define ERR_BMP_IMAGE_TYPE -1
11311 #define ERR_BMP_UNKNOWN_TYPE -2
11312 #define ERR_BMP_CANT_READ -3
11313 #define ERR_BMP_CANT_SAVE -4
11314 #define ERR_BMP_NOT_SUPPORTED -5
11315 #define ERR_BMP_MEM -6
11316 #define ERR_BMP_LOAD -7
11317 #define ERR_BMP_FILEIO -8
11318 #define ERR_BMP_OTHER -9
11319 #define ERR_BMP_ERROR_SOURCE -10
11320 
11355 MG_EXPORT int GUIAPI LoadBitmapEx2 (HDC hdc, PBITMAP pBitmap,
11356  MG_RWops* area, const char* ext,
11357  CB_ALLOC_BITMAP_BUFF cb_alloc_buff, void* context);
11358 
11386 static inline int LoadBitmapEx (HDC hdc, PBITMAP pBitmap,
11387  MG_RWops* area, const char* ext) {
11388  return LoadBitmapEx2 (hdc, pBitmap, area, ext, NULL, NULL);
11389 }
11390 
11398 MG_EXPORT int GUIAPI LoadBitmapFromFile (HDC hdc, PBITMAP pBitmap,
11399  const char* spFileName);
11400 
11407 #define LoadBitmap LoadBitmapFromFile
11408 
11416 MG_EXPORT int GUIAPI LoadBitmapFromMem (HDC hdc, PBITMAP pBitmap,
11417  const void* mem, size_t size, const char* ext);
11418 
11430 MG_EXPORT void GUIAPI UnloadBitmap (PBITMAP pBitmap);
11431 
11450 MG_EXPORT int GUIAPI SetBitmapKeyColor (HDC hdc, PBITMAP bmp, Uint8 r, Uint8 g, Uint8 b);
11451 
11466 MG_EXPORT void GUIAPI ReplaceBitmapColor (HDC hdc, PBITMAP pBitmap,
11467  gal_pixel iOColor, gal_pixel iNColor);
11468 
11478 MG_EXPORT void GUIAPI HFlipBitmap (BITMAP* bmp, unsigned char* inter_buff);
11479 
11489 MG_EXPORT void GUIAPI VFlipBitmap (BITMAP* bmp, unsigned char* inter_buff);
11490 
11509 MG_EXPORT void* GUIAPI InitMyBitmapSL (MG_RWops* area,
11510  const char* ext, MYBITMAP* my_bmp, RGB* pal);
11511 
11530 MG_EXPORT int GUIAPI LoadMyBitmapSL (MG_RWops* area, void* load_info,
11531  MYBITMAP* my_bmp, CB_ONE_SCANLINE cb, void* context);
11532 
11547 MG_EXPORT int GUIAPI CleanupMyBitmapSL (MYBITMAP* my_bmp, void* load_info);
11548 
11564 MG_EXPORT int GUIAPI LoadMyBitmapEx (PMYBITMAP my_bmp, RGB* pal,
11565  MG_RWops* area, const char* ext);
11566 
11574 MG_EXPORT int GUIAPI LoadMyBitmapFromFile (PMYBITMAP my_bmp, RGB* pal,
11575  const char* file_name);
11576 
11583 #define LoadMyBitmap LoadMyBitmapFromFile
11584 
11600 MG_EXPORT int GUIAPI LoadMyBitmapFromMem (PMYBITMAP my_bmp, RGB* pal,
11601  const void* mem, size_t size, const char* ext);
11602 
11614 MG_EXPORT void GUIAPI UnloadMyBitmap (PMYBITMAP my_bmp);
11615 
11616 #ifdef _MGMISC_SAVEBITMAP
11617 
11634 MG_EXPORT int GUIAPI SaveMyBitmapToFile (PMYBITMAP my_bmp, RGB* pal,
11635  const char* spFileName);
11636 
11652 MG_EXPORT int GUIAPI SaveBitmapToFile (HDC hdc, PBITMAP pBitmap,
11653  const char* spFileName);
11654 #define SaveBitmap SaveBitmapToFile
11655 #endif
11656 
11678 MG_EXPORT BOOL GUIAPI InitBitmap (HDC hdc, Uint32 w, Uint32 h, Uint32 pitch,
11679  BYTE* bits, PBITMAP bmp);
11680 
11692 MG_EXPORT HDC GUIAPI InitSlaveScreenEx (const char* name, const char* mode, int dpi);
11693 
11703 static inline HDC InitSlaveScreen (const char* name, const char* mode)
11704 {
11705  return InitSlaveScreenEx(name, mode, GDCAP_DPI_DEFAULT);
11706 }
11707 
11715 MG_EXPORT void GUIAPI TerminateSlaveScreen (HDC hdc);
11731 MG_EXPORT BOOL GUIAPI InitBitmapPixelFormat (HDC hdc, PBITMAP bmp);
11732 
11742 MG_EXPORT void GUIAPI DeleteBitmapAlphaPixel (PBITMAP bmp);
11743 
11744 /* Everything in the pixel format structure is read-only */
11745 typedef struct GAL_PixelFormat {
11746  GAL_Palette *palette;
11747 
11748  Uint8 BitsPerPixel;
11749  Uint8 BytesPerPixel;
11750  /* The flag indicating dithered palette */
11751  Uint8 DitheredPalette;
11752  /* The flag indicating the Most Significant Bits (MSB)
11753  * is left when depth is less than 8. */
11754  Uint8 MSBLeft;
11755 
11756  Uint8 Rloss;
11757  Uint8 Gloss;
11758  Uint8 Bloss;
11759  Uint8 Aloss;
11760  Uint8 Rshift;
11761  Uint8 Gshift;
11762  Uint8 Bshift;
11763  Uint8 Ashift;
11764  Uint32 Rmask;
11765  Uint32 Gmask;
11766  Uint32 Bmask;
11767  Uint32 Amask;
11768 
11769  /* RGB color key information */
11770  gal_pixel colorkey;
11771  /* Alpha value information (per-surface alpha) */
11772  gal_uint8 alpha;
11773 } GAL_PixelFormat;
11774 
11775 #define _FILL_MYBITMAP
11776 
11777 #ifndef MYBITMAP_CONTXT
11778 typedef struct _MYBITMAP_CONTXT{
11779  Uint32 colorKey;
11780  Uint32 pitch;
11781  GAL_PixelFormat* AlphaPixelFormat;
11782  MYBITMAP* mybmp;
11783 }MYBITMAP_CONTXT;
11784 #endif
11785 
11786 typedef BYTE* (* CB_DRAW_PIXEL) (HDC hdc, MYBITMAP_CONTXT* mybmp, Uint32 pixel, BYTE* dest);
11787 
11803 MG_EXPORT int GUIAPI ExpandMyBitmap (HDC hdc, PBITMAP bmp,
11804  const MYBITMAP* my_bmp, const RGB* pal, int frame);
11805 
11828 MG_EXPORT void GUIAPI ExpandMonoBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11829  const BYTE* my_bits, Uint32 my_pitch,
11830  Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg);
11831 
11832 MG_EXPORT void GUIAPI Expand16CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11833  const BYTE* my_bits, Uint32 my_pitch,
11834  Uint32 w, Uint32 h, DWORD flags,
11835  const RGB* pal, BYTE use_pal_alpha, BYTE alpha);
11836 
11858 static inline void GUIAPI Expand16CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11859  const BYTE* my_bits, Uint32 my_pitch,
11860  Uint32 w, Uint32 h, DWORD flags, const RGB* pal)
11861 {
11862  Expand16CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11863  w, h, flags, pal, FALSE, 0xFF);
11864 }
11865 
11866 MG_EXPORT void GUIAPI Expand256CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11867  const BYTE* my_bits, Uint32 my_pitch,
11868  Uint32 w, Uint32 h, DWORD flags,
11869  const RGB* pal, BYTE use_pal_alpha, BYTE alpha,
11870  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11895 static inline void GUIAPI Expand256CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11896  const BYTE* my_bits, Uint32 my_pitch,
11897  Uint32 w, Uint32 h, DWORD flags, const RGB* pal,
11898  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp)
11899 {
11900  Expand256CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11901  w, h, flags, pal, FALSE, 0xFF, cb_draw, mybmp);
11902 }
11903 
11927 MG_EXPORT void GUIAPI CompileRGBABitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11928  const BYTE* my_bits, Uint32 my_pitch,
11929  Uint32 w, Uint32 h, DWORD flags, void* pixel_format,
11930  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11931 
11944 MG_EXPORT void GUIAPI CompileRGBABitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11945  const BYTE* my_bits, Uint32 my_pitch,
11946  Uint32 w, Uint32 h, DWORD flags, void* pixel_format,
11947  CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp,
11948  BYTE* alpha_mask);
11949 
11950 #ifdef _FILL_MYBITMAP
11951 MG_EXPORT int GUIAPI FillBoxWithMyBitmap (HDC hdc, int x, int y, MYBITMAP* mybmp, RGB* pal);
11952 
11953 MG_EXPORT void GUIAPI ExpandPartMonoBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11954  const BYTE* my_bits, Uint32 my_pitch,
11955  Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg,
11956  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11957 
11958 MG_EXPORT void GUIAPI ExpandPart16CBitmapEx (HDC hdc, BYTE* bits, Uint32 pitch,
11959  const BYTE* my_bits, Uint32 my_pitch,
11960  Uint32 w, Uint32 h, DWORD flags,
11961  const RGB* pal, BYTE use_pal_alpha, BYTE alpha,
11962  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp);
11963 
11964 static inline void GUIAPI ExpandPart16CBitmap (HDC hdc, BYTE* bits, Uint32 pitch,
11965  const BYTE* my_bits, Uint32 my_pitch,
11966  Uint32 w, Uint32 h, DWORD flags, const RGB* pal,
11967  int stepx, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT* mybmp)
11968 {
11969  ExpandPart16CBitmapEx (hdc, bits, pitch, my_bits, my_pitch,
11970  w, h, flags, pal, FALSE, 0xFF, stepx, cb_draw, mybmp);
11971 }
11972 
11973 #endif
11974 
11975 #define CompileRGBBitmap CompileRGBABitmap
11976 
12005 MG_EXPORT int GUIAPI PaintImageEx (HDC hdc, int x, int y,
12006  MG_RWops* area, const char* ext);
12007 
12022 MG_EXPORT int GUIAPI PaintImageFromFile (HDC hdc, int x, int y,
12023  const char* spFileName);
12024 
12041 MG_EXPORT int GUIAPI PaintImageFromMem (HDC hdc, int x, int y,
12042  const void* mem, size_t size, const char* ext);
12043 
12075 MG_EXPORT int GUIAPI StretchPaintImageEx (HDC hdc, int x, int y, int w, int h,
12076  MG_RWops* area, const char* ext);
12077 
12094 MG_EXPORT int GUIAPI StretchPaintImageFromFile (HDC hdc, int x, int y,
12095  int w, int h, const char* spFileName);
12096 
12115 MG_EXPORT int GUIAPI StretchPaintImageFromMem (HDC hdc, int x, int y,
12116  int w, int h, const void* mem, size_t size, const char* ext);
12117 
12118 #ifdef _MGHAVE_FIXED_MATH
12119 
12135 MG_EXPORT void GUIAPI RotateBitmap (HDC hdc, const BITMAP *bmp,
12136  int lx, int ty, int angle);
12137 
12148 MG_EXPORT void GUIAPI RotateBitmapVFlip (HDC hdc, const BITMAP *bmp,
12149  int lx, int ty, int angle);
12150 
12159 MG_EXPORT void GUIAPI RotateBitmapHFlip (HDC hdc, const BITMAP *bmp,
12160  int lx, int ty, int angle);
12161 
12170 MG_EXPORT void GUIAPI RotateScaledBitmap (HDC hdc, const BITMAP *bmp,
12171  int lx, int ty, int angle, int w, int h);
12172 
12184 MG_EXPORT void GUIAPI RotateScaledBitmapVFlip (HDC hdc, const BITMAP *bmp,
12185  int lx, int ty, int angle, int w, int h);
12186 
12198 MG_EXPORT void GUIAPI RotateScaledBitmapHFlip (HDC hdc, const BITMAP *bmp,
12199  int lx, int ty, int angle, int w, int h);
12200 
12212 MG_EXPORT void GUIAPI PivotBitmap(HDC hdc, const BITMAP *bmp,
12213  int lx, int ty, int cx, int cy, int angle);
12214 
12241 MG_EXPORT void GUIAPI PivotScaledBitmapFlip (HDC hdc, const BITMAP *bmp,
12242  fixed x, fixed y, fixed cx, fixed cy, int angle, fixed scale_x,
12243  fixed scale_y, BOOL h_flip, BOOL v_flip);
12244 
12245 #endif /*_MGHAVE_FIXED_MATH*/
12246 
12253 #ifdef _MGFONT_BMPF
12254 
12272 MG_EXPORT DEVFONT* GUIAPI CreateBMPDevFont (const char *bmpfont_name,
12273  const BITMAP* glyph_bmp, const char* start_mchar, int nr_glyphs,
12274  int glyph_width);
12275 
12291 MG_EXPORT BOOL GUIAPI AddGlyphsToBMPFont (DEVFONT* dev_font, BITMAP* glyph_bmp,
12292  const char* start_mchar, int nr_glyphs, int glyph_width);
12293 
12304 MG_EXPORT void GUIAPI DestroyBMPFont (DEVFONT* dev_font);
12305 
12306 #endif /* end of _MGFONT_BMPF */
12307 
12370 typedef Uint32 Achar32;
12371 typedef Uint32 Glyph32;
12372 
12376 #define INV_ACHAR_VALUE 0xFFFFFFFF
12377 
12381 #define INV_GLYPH_VALUE 0xFFFFFFFF
12382 
12396 MG_EXPORT Achar32 GUIAPI GetACharValue (LOGFONT* logfont, const char* mchar,
12397  int mchar_len, const char* pre_mchar, int pre_len);
12398 
12399 #ifdef _MGCHARSET_UNICODE
12400 
12418 MG_EXPORT int GUIAPI GetNextUChar(LOGFONT* logfont, const char* mchar,
12419  int mchar_len, Uchar32* uc);
12420 
12421 #endif /* _MGCHARSET_UNICODE */
12422 
12450 MG_EXPORT Uint32 GUIAPI GetACharType (LOGFONT* logfont, Achar32 chv);
12451 
12456 typedef enum {
12457  ACHAR_ISOLATED,
12458  ACHAR_FINAL,
12459  ACHAR_INITIAL,
12460  ACHAR_MEDIAL
12461 } ACHARSHAPETYPE;
12462 
12484 MG_EXPORT Achar32 GUIAPI GetShapedAChar (LOGFONT* logfont, const char* mchar,
12485  int mchar_len, ACHARSHAPETYPE shape_type);
12486 
12508 MG_EXPORT BOOL GUIAPI GetMirrorAChar (LOGFONT* logfont, Achar32 chv,
12509  Achar32* mirrored);
12510 
12531 MG_EXPORT BidiType GUIAPI GetACharBidiType (LOGFONT* log_font, Achar32 chv);
12532 
12537 typedef struct _ACHARMAPINFO {
12539  int byte_index;
12541  int char_len;
12543  BOOL is_rtol;
12544 } ACHARMAPINFO;
12545 
12570 MG_EXPORT int GUIAPI BIDIGetTextLogicalAChars (LOGFONT* log_font,
12571  const char* text, int text_len, Achar32** achars,
12572  ACHARMAPINFO** achars_map);
12573 
12599 MG_EXPORT void GUIAPI BIDIGetTextRangesLog2Vis (LOGFONT* log_font,
12600  const char* text, int text_len, int start_index, int end_index,
12601  int** ranges, int* nr_ranges);
12602 
12627 MG_EXPORT int GUIAPI BIDIGetTextVisualAChars (LOGFONT* log_font,
12628  const char* text, int text_len, Achar32** achars,
12629  ACHARMAPINFO** achars_map);
12630 
12664 MG_EXPORT BOOL GUIAPI BIDILogAChars2VisACharsEx (LOGFONT* log_font,
12665  Achar32* achars, int nr_achars, int pel,
12666  void* extra, CB_REVERSE_ARRAY cb_reverse_extra);
12667 
12694 MG_EXPORT Achar32* GUIAPI BIDILogAChars2VisAChars (LOGFONT* log_font,
12695  Achar32* achars, int nr_achars, ACHARMAPINFO* achars_map);
12696 
12725 MG_EXPORT void GUIAPI BIDIGetLogicalEmbedLevelsEx (LOGFONT* log_font,
12726  Achar32* achars, int nr_achars, int pel, Uint8** embedding_levels);
12727 
12728 static inline void BIDIGetLogicalEmbeddLevels (LOGFONT* log_font,
12729  Achar32* achars, int nr_achars, Uint8** embedding_levels)
12730 {
12731  BIDIGetLogicalEmbedLevelsEx (log_font, achars, nr_achars, -1,
12732  embedding_levels);
12733 }
12734 
12766 MG_EXPORT void GUIAPI BIDIGetVisualEmbedLevelsEx (LOGFONT* log_font,
12767  Achar32* achars, int nr_achars, int pel, Uint8** embedding_levels);
12768 
12769 static inline void BIDIGetVisualEmbeddLevels (LOGFONT* log_font,
12770  Achar32* achars, int nr_achars, Uint8** embedding_levels)
12771 {
12772  BIDIGetVisualEmbedLevelsEx (log_font, achars, nr_achars, -1,
12773  embedding_levels);
12774 }
12775 
12776 /*
12777  * \fn int GUIAPI DrawACharString (HDC hdc, int x, int y,
12778  * Achar32* achars, int nr_achars, int* adv_x, int* adv_y);
12779  *
12780  * \brief Draw an abstract character string.
12781  *
12782  * This function draws an abstract character string to the specific
12783  * postion of a DC. Note that this function will ignore all breaks
12784  * in the Achar32 string.
12785  *
12786  * \param hdc The device context.
12787  * \param x The output start x position.
12788  * \param y The output start y position.
12789  * \param achars The pointer to the glyph string.
12790  * \param nr_achars The number of achars which will be draw.
12791  * \param adv_x The pointer used to return the advance in x-coordinate of
12792  * the glyph string, can be NULL.
12793  * \param adv_y The pointer used to return the advance in y-coordinate of
12794  * the glyph string, can be NULL.
12795  *
12796  * \return The advance on baseline.
12797  */
12798 MG_EXPORT int GUIAPI DrawACharString (HDC hdc, int x, int y, Achar32* achars,
12799  int nr_achars, int* adv_x, int* adv_y);
12800 
12816 MG_EXPORT int GUIAPI GetACharsExtent (HDC hdc, Achar32* achars, int nr_achars,
12817  SIZE* size);
12818 
12837 MG_EXPORT int GUIAPI GetACharsExtentPoint (HDC hdc, Achar32* achars,
12838  int nr_achars, int max_extent, SIZE* size);
12839 
12853 MG_EXPORT Glyph32 GUIAPI GetGlyphValue (LOGFONT* logfont, const char* mchar,
12854  int mchar_len, const char* pre_mchar, int pre_len);
12855 
12866 MG_EXPORT Glyph32 GUIAPI GetGlyphValueAlt(LOGFONT* logfont, Achar32 chv);
12867 
12886 MG_EXPORT int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
12887  int* adv_x, int* adv_y);
12888 
12889 /*
12890  * \fn int GUIAPI DrawGlyphString (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12891  * const POINT* pts);
12892  *
12893  * \brief Draw a glyph string at specified positions.
12894  *
12895  * This function draws a glyph string to the specific postions of a DC.
12896  * Note that this function will ignore all special type (such as zero-width)
12897  * in the glyph string.
12898  *
12899  * \param hdc The device context.
12900  * \param glyphs The pointer to the glyph string.
12901  * \param nr_glyphs The number of glyphs which will be draw.
12902  * \param pts The positions of every glyphs.
12903  *
12904  * \return The number of glyphs drawn.
12905  *
12906  * \sa DrawGlyphStringEx
12907  */
12908 MG_EXPORT int GUIAPI DrawGlyphString (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12909  const POINT* pts);
12910 
12928 MG_EXPORT int GUIAPI GetGlyphsExtent (HDC hdc, Glyph32* glyphs, int nr_glyphs,
12929  SIZE* size);
12930 
12949 MG_EXPORT int GUIAPI GetGlyphsExtentPoint (HDC hdc, Glyph32* glyphs,
12950  int nr_glyphs, int max_extent, SIZE* size);
12951 
12952 #define GLYPH_INFO_METRICS 0x01
12953 #define GLYPH_INFO_BMP 0x02
12954 #define GLYPH_INFO_FACE 0x04
12955 
12957 #define GLYPHBMP_TYPE_MONO 0x00
12958 
12959 #define GLYPHBMP_TYPE_GREY 0x01
12960 
12961 #define GLYPHBMP_TYPE_GREY4b 0x02
12962 
12963 #define GLYPHBMP_TYPE_SUBPIXEL 0x03
12964 
12965 #define GLYPHBMP_TYPE_PRERENDER 0x04
12966 
12971 typedef struct _GLYPHINFO {
12979  Uint32 mask;
12980 
12982  int bbox_x, bbox_y, bbox_w, bbox_h;
12984  int advance_x, advance_y;
12985 
12993  int bmp_type;
12994 
12996  int bmp_width;
12998  int bmp_height;
12999  /* The pitch of the glyph bitmap. */
13000  int bmp_pitch;
13001 
13003  const unsigned char* bits;
13004 
13009  BITMAP prbitmap;
13010 
13017  void* ft_face;
13018  const char* file_path;
13019  Uint32 index;
13020 } GLYPHINFO;
13021 
13039 MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
13040  GLYPHINFO* glyph_info);
13041 
13042 #ifdef _MGCHARSET_UNICODE
13043 
13061 #define WSR_NORMAL 0x00
13062 
13071 #define WSR_PRE 0x01
13072 
13079 #define WSR_NOWRAP 0x02
13080 
13087 #define WSR_PRE_WRAP 0x03
13088 
13103 #define WSR_BREAK_SPACES 0x04
13104 
13112 #define WSR_PRE_LINE 0x05
13113 
13153 MG_EXPORT int GUIAPI GetUCharsUntilParagraphBoundary(LOGFONT* logfont,
13154  const char* mstr, int mstr_len, Uint8 wsr,
13155  Uchar32** uchars, int* nr_uchars);
13156 
13173 MG_EXPORT Uchar32 GUIAPI AChar2UChar(LOGFONT* logfont, Achar32 chv);
13174 
13193 MG_EXPORT int GUIAPI AChars2UChars(LOGFONT* logfont, const Achar32* chs,
13194  Uchar32* ucs, int n);
13195 
13207 #define UCHAR2ACHAR(uc) ((uc) | 0x80000000)
13208 
13231 MG_EXPORT BOOL GUIAPI UChar2AChar(LOGFONT* logfont, Uchar32 uc, Achar32* ac);
13232 
13253 MG_EXPORT int GUIAPI UChars2AChars(LOGFONT* logfont, const Uchar32* ucs,
13254  Achar32* acs, int n);
13255 
13272 #define GRF_WRITING_MODE_MASK 0xF0000000
13273 #define GRF_WRITING_MODE_VERTICAL_FLAG 0x20000000
13274 
13278 #define GRF_WRITING_MODE_HORIZONTAL_TB 0x00000000
13279 
13284 #define GRF_WRITING_MODE_HORIZONTAL_BT 0x10000000
13285 
13290 #define GRF_WRITING_MODE_VERTICAL_RL 0x20000000
13291 
13296 #define GRF_WRITING_MODE_VERTICAL_LR 0x30000000
13297 
13298 #define GRF_TEXT_ORIENTATION_MASK 0x0F000000
13299 
13303 #define GRF_TEXT_ORIENTATION_UPRIGHT 0x00000000
13304 
13308 #define GRF_TEXT_ORIENTATION_SIDEWAYS 0x01000000
13309 
13313 #define GRF_TEXT_ORIENTATION_UPSIDE_DOWN 0x02000000
13314 
13318 #define GRF_TEXT_ORIENTATION_SIDEWAYS_LEFT 0x03000000
13319 
13323 #define GRF_TEXT_ORIENTATION_AUTO 0x04000000
13324 
13331 #define GRF_TEXT_ORIENTATION_MIXED 0x05000000
13332 
13333 #define GRF_TEXT_ORIENTATION_LINE 0x06000000
13334 
13335 #define GRF_LINE_EXTENT_MASK 0x00C00000
13336 
13341 #define GRF_LINE_EXTENT_FIXED 0x00000000
13342 
13347 #define GRF_LINE_EXTENT_VARIABLE 0x00400000
13348 
13349 #define GRF_INDENT_MASK 0x00300000
13350 
13353 #define GRF_INDENT_NONE 0x00000000
13354 
13357 #define GRF_INDENT_FIRST_LINE 0x00100000
13358 
13361 #define GRF_INDENT_HANGING 0x00200000
13362 
13363 #define GRF_OVERFLOW_WRAP_MASK 0x000C0000
13364 
13367 #define GRF_OVERFLOW_WRAP_NORMAL 0x00000000
13368 
13371 #define GRF_OVERFLOW_WRAP_BREAK_WORD 0x00040000
13372 
13377 #define GRF_OVERFLOW_WRAP_ANYWHERE 0x00080000
13378 
13379 #define GRF_OVERFLOW_ELLIPSIZE_MASK 0x00030000
13380 
13383 #define GRF_OVERFLOW_ELLIPSIZE_NONE 0x00000000
13384 
13387 #define GRF_OVERFLOW_ELLIPSIZE_START 0x00010000
13388 
13391 #define GRF_OVERFLOW_ELLIPSIZE_MIDDLE 0x00020000
13392 
13395 #define GRF_OVERFLOW_ELLIPSIZE_END 0x00030000
13396 
13397 #define GRF_ALIGN_MASK 0x0000F000
13398 
13401 #define GRF_ALIGN_START 0x00000000
13402 
13405 #define GRF_ALIGN_END 0x00001000
13406 
13410 #define GRF_ALIGN_LEFT 0x00002000
13411 
13415 #define GRF_ALIGN_RIGHT 0x00003000
13416 
13419 #define GRF_ALIGN_CENTER 0x00004000
13420 
13427 #define GRF_ALIGN_JUSTIFY 0x00005000
13428 
13429 #define GRF_TEXT_JUSTIFY_MASK 0x00000F00
13430 
13433 #define GRF_TEXT_JUSTIFY_NONE 0x00000000
13434 
13439 #define GRF_TEXT_JUSTIFY_AUTO 0x00000100
13440 
13443 #define GRF_TEXT_JUSTIFY_INTER_WORD 0x00000200
13444 
13448 #define GRF_TEXT_JUSTIFY_INTER_CHAR 0x00000300
13449 
13450 #define GRF_HANGING_PUNC_MASK 0x000000F0
13451 
13454 #define GRF_HANGING_PUNC_NONE 0x00000000
13455 
13458 #define GRF_HANGING_PUNC_FORCE_END 0x00000010
13459 
13463 #define GRF_HANGING_PUNC_ALLOW_END 0x00000020
13464 
13467 #define GRF_HANGING_PUNC_OPEN 0x00000040
13468 
13471 #define GRF_HANGING_PUNC_CLOSE 0x00000080
13472 
13473 #define GRF_SPACES_MASK 0x0000000F
13474 
13477 #define GRF_SPACES_KEEP 0x00000000
13478 
13481 #define GRF_SPACES_REMOVE_START 0x00000001
13482 
13485 #define GRF_SPACES_REMOVE_END 0x00000002
13486 
13489 #define GRF_SPACES_HANGE_END 0x00000004
13490 
13493 typedef enum {
13494  GLYPH_ORIENT_UPRIGHT = GLYPH_GRAVITY_SOUTH,
13495  GLYPH_ORIENT_SIDEWAYS = GLYPH_GRAVITY_EAST,
13496  GLYPH_ORIENT_UPSIDE_DOWN = GLYPH_GRAVITY_NORTH,
13497  GLYPH_ORIENT_SIDEWAYS_LEFT = GLYPH_GRAVITY_WEST,
13498 } GlyphOrient;
13499 
13500 typedef enum {
13501  GLYPH_HANGED_NONE = 0,
13502  GLYPH_HANGED_START,
13503  GLYPH_HANGED_END,
13504 } GlyphHanged;
13505 
13509 typedef struct _GLYPHEXTINFO {
13511  int bbox_x, bbox_y, bbox_w, bbox_h;
13513  int adv_x, adv_y;
13515  int extra_x, extra_y;
13538 } GLYPHEXTINFO;
13539 
13543 typedef struct _GLYPHPOS {
13547  int x;
13551  int y;
13555  int x_off;
13559  int y_off;
13563  int advance;
13598 } GLYPHPOS;
13599 
13680 MG_EXPORT int GUIAPI GetGlyphsExtentFromUChars(LOGFONT* logfont_upright,
13681  const Achar32* uchars, int nr_uchars, const BreakOppo* break_oppos,
13682  Uint32 render_flags, int x, int y,
13683  int letter_spacing, int word_spacing, int tab_size, int max_extent,
13684  SIZE* line_size, Glyph32* glyphs, GLYPHEXTINFO* glyph_ext_info,
13685  GLYPHPOS* glyph_pos, LOGFONT** logfont_sideways);
13686 
13687 /*
13688  * \fn int GUIAPI DrawGlyphStringEx (HDC hdc,
13689  * LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
13690  * const Glyph32* glyphs, const GLYPHPOS* glyph_pos, int nr_glyphs)
13691  * \brief Draw a glyph string at the specified positions and text orientations.
13692  *
13693  * This function draws a glyph string to the specific positions and
13694  * orientations on a DC \a hdc with the logfonts specified by
13695  * \a logfont_upright and \a logfont_sideways.
13696  *
13697  * \param hdc The device context.
13698  * \param logfont_upright The LOGFONT object used for upright glyphs.
13699  * \param logfont_sideways The LOGFONT object used for sideways glyphs.
13700  * \param glyphs The pointer to the glyph string
13701  * \param glyph_pos The buffer holds the position information
13702  * of every glyph.
13703  * \param nr_glyphs The number of the glyphs should be drawn.
13704  *
13705  * \return The number of glyphs really drawn.
13706  *
13707  * \note The positions contained in \a glyph_pos are always aligned to
13708  * the top-left corner of the output rectangle.
13709  *
13710  * \sa GetGlyphsExtentFromUChars
13711  *
13712  * Since 4.0.0
13713  */
13714 MG_EXPORT int GUIAPI DrawGlyphStringEx (HDC hdc,
13715  LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
13716  const Glyph32* glyphs, const GLYPHPOS* glyph_pos,
13717  int nr_glyphs);
13718 
13723 typedef struct _TEXTRUNS TEXTRUNS;
13724 
13765 MG_EXPORT TEXTRUNS* GUIAPI CreateTextRuns(
13766  const Uchar32* ucs, int nr_ucs,
13767  LanguageCode lang_code, ParagraphDir base_dir,
13768  const char* logfont_name, RGBCOLOR color, RGBCOLOR bg_color,
13769  BreakOppo* break_oppos);
13770 
13788 MG_EXPORT BOOL GUIAPI SetFontNameInTextRuns(TEXTRUNS* truns,
13789  int start_index, int length, const char* logfont_name);
13790 
13796 MG_EXPORT const char* GUIAPI GetFontNameInTextRuns(
13797  const TEXTRUNS* truns, int index);
13798 
13816 MG_EXPORT BOOL GUIAPI SetTextColorInTextRuns(TEXTRUNS* truns,
13817  int start_index, int length, RGBCOLOR color);
13818 
13824 MG_EXPORT RGBCOLOR GUIAPI GetTextColorInTextRuns(
13825  const TEXTRUNS* truns, int index);
13826 
13847 MG_EXPORT BOOL GUIAPI SetBackgroundColorInTextRuns(TEXTRUNS* truns,
13848  int start_index, int length, RGBCOLOR color);
13849 
13855 MG_EXPORT RGBCOLOR GUIAPI GetBackgroundColorInTextRuns(
13856  const TEXTRUNS* truns, int index);
13857 
13876 MG_EXPORT BOOL GUIAPI DestroyTextRuns(TEXTRUNS* truns);
13877 
13909 MG_EXPORT BOOL GUIAPI InitBasicShapingEngine(TEXTRUNS* truns);
13910 
13911 #ifdef _MGCOMPLEX_SCRIPTS
13912 
13946 MG_EXPORT BOOL GUIAPI InitComplexShapingEngine(TEXTRUNS* truns);
13947 
13948 #endif /* _MGCOMPLEX_SCRIPTS */
13949 
13954 typedef struct _LAYOUT LAYOUT;
13955 
13960 typedef struct _LAYOUTLINE LAYOUTLINE;
13961 
13996 MG_EXPORT LAYOUT* GUIAPI CreateLayout(
13997  const TEXTRUNS* truns, Uint32 render_flags,
13998  const BreakOppo* break_oppos, BOOL persist_lines,
13999  int max_line_extent, int indent,
14000  int letter_spacing, int word_spacing, int tab_size,
14001  int* tabs, int nr_tabs);
14002 
14017 MG_EXPORT BOOL GUIAPI DestroyLayout(LAYOUT* layout);
14018 
14019 /*
14020  * \var typedef struct _RENDERDATA RENDERDATA
14021  * \brief The extra rendering data of the shaped glyph.
14022  */
14023 typedef struct _RENDERDATA {
14027  const TEXTRUNS* truns;
14028 
14032  const LAYOUT* layout;
14033 
14037  const LAYOUTLINE* line;
14038 
14042  LOGFONT* logfont;
14043 
14047  Uint32 ta;
14048 
14052  Uchar32 uc;
14053 
14058  int uc_index;
14059 } RENDERDATA;
14060 
14079 typedef BOOL (*CB_GLYPH_LAID_OUT) (GHANDLE ctxt,
14080  Glyph32 glyph_value, const GLYPHPOS* glyph_pos,
14081  const RENDERDATA* render_data);
14082 
14125 MG_EXPORT LAYOUTLINE* GUIAPI LayoutNextLine(LAYOUT* layout,
14126  LAYOUTLINE* prev_line, int max_extent, BOOL last_line,
14127  CB_GLYPH_LAID_OUT cb_laid_out, GHANDLE ctxt);
14128 
14145 MG_EXPORT BOOL GUIAPI GetLayoutLineSize(const LAYOUTLINE* line,
14146  SIZE* line_size);
14147 
14179 MG_EXPORT BOOL GUIAPI GetLayoutLineRect(const LAYOUTLINE* line,
14180  int* x, int* y, int line_height, RECT* line_rc);
14181 
14217 MG_EXPORT int GUIAPI CalcLayoutBoundingRect(LAYOUT* layout,
14218  int max_line_extent, int max_height, int line_height,
14219  int x, int y, RECT* bounding);
14220 
14250 MG_EXPORT BOOL DrawShapedGlyph(HDC hdc,
14251  Glyph32 glyph_value, const GLYPHPOS* glyph_pos,
14252  const RENDERDATA* render_data);
14253 
14285 MG_EXPORT int DrawLayoutLine(HDC hdc, const LAYOUTLINE* line,
14286  int x, int y);
14287 
14288 #ifdef _MGDEVEL_MODE
14289 typedef struct _TextRun TEXTRUN;
14290 
14291 MG_EXPORT TEXTRUN* GetNextTextRunInfo(TEXTRUNS* runinfo,
14292  TEXTRUN* prev,
14293  const char** fontname, int* start_index, int* length,
14294  LanguageCode* lang_code, ScriptType* script,
14295  BidiLevel* embedding_level, Uint8* flags);
14296 
14297 /* Get layout line information */
14298 MG_EXPORT BOOL GUIAPI GetLayoutLineInfo(LAYOUTLINE* line,
14299  int* max_extent, int* nr_chars, int* nr_glyphs,
14300  int** log_widths, int* width, int* height,
14301  BOOL* is_ellipsized, BOOL* is_wrapped);
14302 #endif
14303 
14304 #endif /* _MGCHARSET_UNICODE */
14305 
14308 /*
14309  * \var typedef struct _COMP_CTXT COMP_CTXT
14310  * \brief The context information of user defined color composition operators.
14311  *
14312  * \sa SetUserCompositionOps
14313  */
14314 typedef struct _COMP_CTXT {
14316  gal_uint8* cur_dst;
14317 
14319  void* user_comp_ctxt;
14320 
14322  gal_pixel skip_pixel;
14323 
14325  gal_pixel cur_pixel;
14326 
14328  int step;
14329 } COMP_CTXT;
14330 
14331 /*
14332  * \var typedef struct _SPAN_CTXT SPAN_CTXT
14333  * \brief span context
14334  */
14335 typedef struct _SPAN_CTXT {
14336  GAL_PixelFormat* dst_format; /* The pixel format of the destination pixels */
14337  GAL_PixelFormat* src_format; /* The pixel format of the source pixels */
14338  void * user_context; /* The user context passed to SetColorCompositeFunc */
14339 } SPAN_CTXT;
14340 
14341 /*
14342  * \var typedef struct _COMPOSITE_CTXT COMPOSITE_CTXT
14343  * \brief composite context
14344  */
14345 typedef struct _COMPOSITE_CTXT {
14346  HDC dst_dc;
14347  int comp_mode;
14348  const int *far_bkmode;
14349  const int *far_step;
14350  const gal_pixel *far_skip_pixel;
14351 } COMPOSITE_CTXT;
14352 
14353 /*
14354  * \var typedef void (*CB_COMP_SETPIXEL) (COMP_CTXT* comp_ctxt)
14355  * \brief The prototype of the user defined color composition setpixel.
14356  *
14357  * This operator sets a pixel on the \a cur_dst defined in \a comp_ctxt with
14358  * the cur_pixel defined in \a comp_ctxt.
14359  *
14360  * \sa SetUserCompositionOps, COMP_CTXT
14361  */
14362 typedef void (*CB_COMP_SETPIXEL) (COMP_CTXT* comp_ctxt);
14363 
14364 /*
14365  * \var typedef void (*CB_COMP_SETHLINE) (COMP_CTXT* comp_ctxt, int w)
14366  * \brief The prototype of the user defined color composition sethline.
14367  *
14368  * This operator sets a horizital line on the \a cur_dst defined in \a comp_ctxt
14369  * with the \a cur_pixel defined in \a comp_ctxt, totally \a w pixels.
14370  *
14371  * \sa SetUserCompositionOps, COMP_CTXT
14372  */
14373 typedef void (*CB_COMP_SETHLINE) (COMP_CTXT* comp_ctxt, int w);
14374 
14375 /*
14376  * \var typedef void (*CB_COMP_PUTHLINE) (COMP_CTXT* comp_ctxt, gal_uint8* src, int w)
14377  * \brief The prototype of the user defined color composition puthline.
14378  *
14379  * This operator puts the pixels in \a src to a horizital line on the \a cur_dst
14380  * defined in \a comp_ctxt, totally \a w pixels.
14381  *
14382  * \sa SetUserCompositionOps, COMP_CTXT
14383  */
14384 typedef void (*CB_COMP_PUTHLINE) (COMP_CTXT* comp_ctxt, gal_uint8* src, int bkmode, int w);
14385 
14407 MG_EXPORT int GUIAPI SetUserCompositionOps (HDC hdc,
14408  CB_COMP_SETPIXEL comp_setpixel,
14409  CB_COMP_SETHLINE comp_sethline,
14410  CB_COMP_PUTHLINE comp_puthline,
14411  void* user_comp_ctxt);
14412 
14423 MG_EXPORT GHANDLE GetVideoHandle (HDC hdc);
14424 
14425 #ifdef _MGGAL_DRM
14426 
14453 MG_EXPORT int drmGetDeviceFD (GHANDLE video);
14454 
14458 typedef struct _DrmSurfaceInfo {
14460  uint32_t handle;
14466  uint32_t name;
14469  uint32_t fb_id;
14470 
14472  uint32_t width;
14474  uint32_t height;
14476  uint32_t pitch;
14478  uint32_t drm_format;
14480  size_t size;
14482  off_t offset;
14483 } DrmSurfaceInfo;
14484 
14495 MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info);
14496 
14511 MG_EXPORT HDC drmCreateDCFromNameEx (GHANDLE video,
14512  uint32_t name, uint32_t drm_format, off_t offset,
14513  uint32_t width, uint32_t height, uint32_t pitch);
14514 
14515 static inline HDC drmCreateDCFromName (GHANDLE video,
14516  uint32_t name, uint32_t drm_format,
14517  uint32_t width, uint32_t height, uint32_t pitch)
14518 {
14519  return drmCreateDCFromNameEx (video,
14520  name, drm_format, 0, width, height, pitch);
14521 }
14522 
14538 MG_EXPORT HDC drmCreateDCFromPrimeFdEx (GHANDLE video,
14539  int prime_fd, size_t size, uint32_t drm_format, off_t offset,
14540  uint32_t width, uint32_t height, uint32_t pitch);
14541 
14542 static inline HDC drmCreateDCFromPrimeFd (GHANDLE video,
14543  int prime_fd, size_t size, uint32_t drm_format,
14544  uint32_t width, uint32_t height, uint32_t pitch)
14545 {
14546  return drmCreateDCFromPrimeFdEx (video,
14547  prime_fd, size, drm_format, 0, width, height, pitch);
14548 }
14549 
14565 MG_EXPORT HDC drmCreateDCFromHandleEx (GHANDLE video,
14566  uint32_t handle, size_t size, uint32_t drm_format, off_t offset,
14567  uint32_t width, uint32_t height, uint32_t pitch);
14568 
14569 static inline HDC drmCreateDCFromHandle (GHANDLE video,
14570  uint32_t handle, size_t size, uint32_t drm_format,
14571  uint32_t width, uint32_t height, uint32_t pitch)
14572 {
14573  return drmCreateDCFromHandleEx (video,
14574  handle, size, drm_format, 0, width, height, pitch);
14575 }
14576 
14579 #endif /* _MGGAL_DRM */
14580 
14583 #ifdef _MGGAL_HI3560
14584 
14585 /* screen attribute type */
14586 #define SCREEN_ATTR_ALPHA_CHANNEL 0x01 // alpha channel
14587 #define SCREEN_ATTR_COLORKEY 0x02 // colorkey
14588 #define SCREEN_ATTR_COLORSPACE 0x03 // colorspace
14589 #define SCREEN_ATTR_ALPHA 0x04
14590 #define SCREEN_NO_EXIST -99 // screen don't exist
14591 
14592 /* API speicific to Hi3560 GAL engines */
14593 MG_EXPORT int hi3560GetVideoFD (void);
14594 MG_EXPORT void* hi3560GetFBAddress (void);
14595 MG_EXPORT int hi3560SetScreenAttr (Uint8 siAttr, void* pValue);
14596 
14597 #endif /* _MGGAL_HI3560 */
14598 
14599 #ifdef __cplusplus
14600 }
14601 #endif /* __cplusplus */
14602 
14603 #endif /* _MGUI_GDI_H */
14604 
14605 
SetMemDCColorKey
MG_EXPORT BOOL GUIAPI SetMemDCColorKey(HDC mem_dc, DWORD flags, Uint32 color_key)
Set the color key (transparent pixel) of a memory DC.
_LOGFONT::descent
int descent
Definition: gdi.h:6494
LANGCODE_eo
@ LANGCODE_eo
Definition: gdi.h:7265
_STRETCH_EXTRA_INFO::rotation
int rotation
Definition: gdi.h:5398
SetSecondaryDC
MG_EXPORT HDC GUIAPI SetSecondaryDC(HWND hwnd, HDC secondary_dc, ON_UPDATE_SECONDARYDC on_update_secondarydc)
Set a window's secondary DC and the callback procedure for the secondary DC update.
LANGCODE_hy
@ LANGCODE_hy
Definition: gdi.h:7305
_FONTMETRICS::font_height
int font_height
Definition: gdi.h:7611
_POINT
Definition: common.h:966
_ARC::width
int width
Definition: gdi.h:4340
LANGCODE_co
@ LANGCODE_co
Definition: gdi.h:7247
DWORD2Pixel
static gal_pixel DWORD2Pixel(HDC hdc, DWORD dword)
An inline function to convert DWORD color to gal_pixel.
Definition: gdi.h:3318
CreateLogFontEx
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.
GetClipBox
MG_EXPORT int GUIAPI GetClipBox(HDC hdc, RECT *clipbox)
Retrieve the bounding rectangle of the current clipping region of a DC.
DoesIntersect
MG_EXPORT BOOL GUIAPI DoesIntersect(const RECT *psrc1, const RECT *psrc2)
Determine whether two rectangles intersect.
ClipRgnIntersect
MG_EXPORT BOOL GUIAPI ClipRgnIntersect(PCLIPRGN pRstRgn, const CLIPRGN *pRgn1, const CLIPRGN *pRgn2)
Intersects two region.
LOGFONT
struct _LOGFONT LOGFONT
FT2LCDFilter
FT2LCDFilter
Definition: gdi.h:8163
UCharToLower
MG_EXPORT Uchar32 GUIAPI UCharToLower(Uchar32 uc)
StretchPaintImageFromFile
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.
Pixel2RGBA
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:3281
LANGCODE_ln
@ LANGCODE_ln
Definition: gdi.h:7351
_MYBITMAP::flags
DWORD flags
Definition: gdi.h:11055
CreateMemDC
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:1787
LANGCODE_bg
@ LANGCODE_bg
Definition: gdi.h:7233
CompileRGBABitmap
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.
LoadBitmapFromFile
MG_EXPORT int GUIAPI LoadBitmapFromFile(HDC hdc, PBITMAP pBitmap, const char *spFileName)
Load a device-dependent bitmap from a file.
RGB2Pixel
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:3186
NULL
#define NULL
A value indicates null pointer.
Definition: common.h:369
LayoutNextLine
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.
LANGCODE_vo
@ LANGCODE_vo
Definition: gdi.h:7483
LANGCODE_ko
@ LANGCODE_ko
Definition: gdi.h:7341
CreatePrivateDC
MG_EXPORT HDC GUIAPI CreatePrivateDC(HWND hwnd)
Creates a private window DC of a window.
ConvertMemDC
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.
BT_STIPPLED
@ BT_STIPPLED
Definition: gdi.h:4161
AddGlyphsToBMPFont
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.
DWORD
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:604
ScriptTypeFromISO15924Code
static ScriptType GUIAPI ScriptTypeFromISO15924Code(const char *iso15924)
Definition: gdi.h:10343
PT_CAP_PROJECTING
@ PT_CAP_PROJECTING
Definition: gdi.h:4042
StretchBlt
static 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...
Definition: gdi.h:5493
LANGCODE_to
@ LANGCODE_to
Definition: gdi.h:7463
SetPenDashes
MG_EXPORT void GUIAPI SetPenDashes(HDC hdc, int dash_offset, const unsigned char *dash_list, int n)
Set the way dashed-lines are drawn.
LANGCODE_xh
@ LANGCODE_xh
Definition: gdi.h:7487
OffsetRect
static void OffsetRect(RECT *prc, int x, int y)
Moves a rectangle by offsets.
Definition: gdi.h:5930
fixed
long fixed
Data type of fixed point.
Definition: common.h:1117
RealizePalette
MG_EXPORT BOOL GUIAPI RealizePalette(HDC hdc)
This function maps palette entries from the current logical palette to the system palette.
COLOR_BLEND_PD_CLEAR
@ COLOR_BLEND_PD_CLEAR
Definition: gdi.h:5176
GetTextExtentPoint
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.
COLOR_BLEND_SP_DARKEN
@ COLOR_BLEND_SP_DARKEN
Definition: gdi.h:5232
_WORDINFO::len
int len
Definition: gdi.h:8451
AChars2UChars
MG_EXPORT int GUIAPI AChars2UChars(LOGFONT *logfont, const Achar32 *chs, Uchar32 *ucs, int n)
Convert an Achar32 array to Unicode character array.
CreatePrivateClientDC
MG_EXPORT HDC GUIAPI CreatePrivateClientDC(HWND hwnd)
Creates a private client DC of a window.
GetGlyphInfo
MG_EXPORT int GUIAPI GetGlyphInfo(LOGFONT *logfont, Glyph32 glyph_value, GLYPHINFO *glyph_info)
Retrieve the information of a glyph.
AddClipRect
MG_EXPORT BOOL GUIAPI AddClipRect(PCLIPRGN pRgn, const RECT *pRect)
Unions one rectangle to a region.
SCALING_FILTER_BILINEAR
@ SCALING_FILTER_BILINEAR
Definition: gdi.h:5382
LANGCODE_ur
@ LANGCODE_ur
Definition: gdi.h:7477
PenType
PenType
Definition: gdi.h:3955
HWND
GHANDLE HWND
Handle to main window or control.
Definition: common.h:407
DestroyBlockDataHeap
MG_EXPORT void DestroyBlockDataHeap(PBLOCKHEAP heap)
Destroys a private block data heap.
BIDIGetTextVisualAChars
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.
GetClientDC
static HDC GUIAPI GetClientDC(HWND hWnd)
Get a client DC of a window.
Definition: gdi.h:1512
GetTabbedTextExtent
MG_EXPORT int GUIAPI GetTabbedTextExtent(HDC hdc, const char *spText, int len, SIZE *pSize)
Computes the output extent of a formatted text.
GLYPHEXTINFO
struct _GLYPHEXTINFO GLYPHEXTINFO
IsCompatibleDC
MG_EXPORT BOOL GUIAPI IsCompatibleDC(HDC hdc1, HDC hdc2)
Check whether a given DC is compliant to a specific DC.
LANGCODE_sv
@ LANGCODE_sv
Definition: gdi.h:7443
COLOR_BLEND_PD_PLUS
@ COLOR_BLEND_PD_PLUS
Definition: gdi.h:5200
_BLOCKHEAP::nr_alloc
size_t nr_alloc
Definition: gdi.h:598
FillBoxWithBitmap
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.
RestoreDC
MG_EXPORT BOOL GUIAPI RestoreDC(HDC hdc, int saved_dc)
Restores a device context (DC) to the specified state.
_DEVFONT
Definition: gdi.h:7563
_MYBITMAP::h
Uint32 h
Definition: gdi.h:11069
LANGCODE_tr
@ LANGCODE_tr
Definition: gdi.h:7465
LANGCODE_uk
@ LANGCODE_uk
Definition: gdi.h:7475
COLOR_BLEND_SP_LIGHTEN
@ COLOR_BLEND_SP_LIGHTEN
Definition: gdi.h:5237
HDC
GHANDLE HDC
Handle to device context.
Definition: common.h:412
SaveMainWindowContent
MG_EXPORT BOOL GUIAPI SaveMainWindowContent(HWND hWnd, const char *filename)
Saves content of a main window to a file.
SetPalette
MG_EXPORT BOOL GUIAPI SetPalette(HDC hdc, int start, int len, GAL_Color *cmap)
Set palette entries of a DC.
_STIPPLE::size
size_t size
Definition: gdi.h:4208
_GLYPHPOS::hanged
Uint8 hanged
Definition: gdi.h:13597
GetFontHeight
MG_EXPORT int GUIAPI GetFontHeight(HDC hdc)
Retrieve the height of the current logical font in a DC.
GetDCAttr
MG_EXPORT Uint32 GUIAPI GetDCAttr(HDC hdc, int attr)
Get a specified attribute value of a DC.
LANGCODE_ro
@ LANGCODE_ro
Definition: gdi.h:7407
GetDCLCS
MG_EXPORT void GUIAPI GetDCLCS(HDC hdc, int which, POINT *pt)
Retrieve mapping parameters of a device context.
Circle
MG_EXPORT void GUIAPI Circle(HDC hdc, int sx, int sy, int r)
Draws a circle.
GetPixelInBitmap
static gal_pixel GUIAPI GetPixelInBitmap(const BITMAP *bmp, int x, int y)
Returns the pixel value in a BITMAP object.
Definition: gdi.h:5567
GetDCEx
MG_EXPORT HDC GUIAPI GetDCEx(HWND hWnd, BOOL bClient)
Get a window or client DC of a window.
UCharGetCategory
MG_EXPORT UCharGeneralCategory GUIAPI UCharGetCategory(Uchar32 uc)
Get the general category of a Unicode character.
CalcLayoutBoundingRect
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.
GetUCharsUntilParagraphBoundary
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 (...
GetGDCapability
MG_EXPORT Uint32 GUIAPI GetGDCapability(HDC hdc, int iItem)
Returns a capability of a DC.
_ARC::angle1
int angle1
Definition: gdi.h:4348
CreateClipRgn
MG_EXPORT PCLIPRGN GUIAPI CreateClipRgn(void)
Creates a clipping region.
SetPixel
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.
GetMaxFontWidth
MG_EXPORT int GUIAPI GetMaxFontWidth(HDC hdc)
Retrieve the maximal character width of the current logical font in a DC.
BreakOppo
Uint16 BreakOppo
Definition: gdi.h:10059
BidiBracketType
Uint32 BidiBracketType
Definition: gdi.h:8771
DestroyLogFont
MG_EXPORT void GUIAPI DestroyLogFont(PLOGFONT log_font)
Destroys a logical font.
BidiArabicProp
Uint8 BidiArabicProp
Definition: gdi.h:8780
SaveDC
MG_EXPORT int GUIAPI SaveDC(HDC hdc)
Saves the current state of a device context.
InitBasicShapingEngine
MG_EXPORT BOOL GUIAPI InitBasicShapingEngine(TEXTRUNS *truns)
Initialize the base shaping engine for a TEXTRUNS object.
MG_SMOOTH_LIGHT
@ MG_SMOOTH_LIGHT
Definition: gdi.h:8169
LineTo
MG_EXPORT void GUIAPI LineTo(HDC hdc, int x, int y)
Draws a zero line to a position.
LANGCODE_ji
@ LANGCODE_ji
Definition: gdi.h:7327
UCharGetBidiType
MG_EXPORT BidiType GUIAPI UCharGetBidiType(Uchar32 uc)
Get bidi type of a Unicode character.
InitClipRgn
MG_EXPORT void GUIAPI InitClipRgn(PCLIPRGN pRgn, PBLOCKHEAP pFreeList)
Initializes a clipping region.
_BITMAP::bmHeight
Uint32 bmHeight
Definition: gdi.h:11137
UnionRect
MG_EXPORT BOOL GUIAPI UnionRect(RECT *pdrc, const RECT *psrc1, const RECT *psrc2)
Unions two source rectangles.
TabbedTextOutEx
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...
_LOGFONT::size
int size
Definition: gdi.h:6488
LANGCODE_sq
@ LANGCODE_sq
Definition: gdi.h:7433
IsUCharAlnum
MG_EXPORT BOOL GUIAPI IsUCharAlnum(Uchar32 uc)
_GLYPHPOS::whitespace
Uint8 whitespace
Definition: gdi.h:13571
SetTextColorInTextRuns
MG_EXPORT BOOL GUIAPI SetTextColorInTextRuns(TEXTRUNS *truns, int start_index, int length, RGBCOLOR color)
Set text color in a TEXTRUNS object.
LANGCODE_ik
@ LANGCODE_ik
Definition: gdi.h:7313
IDX_COLOR_yellow
@ IDX_COLOR_yellow
Definition: gdi.h:175
PtInRegion
MG_EXPORT BOOL GUIAPI PtInRegion(const PCLIPRGN region, int x, int y)
Determine whether a point is in a region.
LANGCODE_sn
@ LANGCODE_sn
Definition: gdi.h:7429
IsScreenDC
MG_EXPORT BOOL GUIAPI IsScreenDC(HDC hdc)
Check whether a given DC is a screen DC.
NormalizeScriptType
MG_EXPORT ScriptType GUIAPI NormalizeScriptType(LanguageCode cl, ScriptType ws)
_CLIPRECT::next
struct _CLIPRECT * next
Definition: gdi.h:764
_BITMAP::bmBitsPerPixel
Uint8 bmBitsPerPixel
Definition: gdi.h:11124
endianrw.h
This file includes functions for reading and writing data from general sources, such as file,...
_LOGFONT
Definition: gdi.h:6478
BT_SOLID
@ BT_SOLID
Definition: gdi.h:4150
PivotScaledBitmapFlip
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.
LANGCODE_hr
@ LANGCODE_hr
Definition: gdi.h:7301
_FONTMETRICS::ave_width
int ave_width
Definition: gdi.h:7620
IsUCharAlpha
MG_EXPORT BOOL GUIAPI IsUCharAlpha(Uchar32 uc)
_MYBITMAP::frames
int frames
Definition: gdi.h:11057
SyncUpdateSurface
MG_EXPORT BOOL GUIAPI SyncUpdateSurface(HWND hwnd)
Synchronize the update rectangles of the backing surface of a window to screen.
PolyArcEx
MG_EXPORT void GUIAPI PolyArcEx(HDC hdc, const ARC *arcs, int nr_arcs)
Draws a polyarc with the current pen in a DC.
SyncUpdateDC
MG_EXPORT BOOL GUIAPI SyncUpdateDC(HDC hdc)
Synchronize the update rectangles of the surface corresponding to a DC to screen.
RGBA2Pixels
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.
SetBrushOrigin
MG_EXPORT void GUIAPI SetBrushOrigin(HDC hdc, int x, int y)
Set the origin when using tiles or stipples with the DC.
_GLYPHBITMAP::advance_x
int advance_x
Definition: gdi.h:7645
CreatePalette
MG_EXPORT HPALETTE GUIAPI CreatePalette(GAL_Palette *pal)
Creates a logical palette.
SCALING_FILTER_NEAREST
@ SCALING_FILTER_NEAREST
Definition: gdi.h:5380
IDX_COLOR_lightgray
@ IDX_COLOR_lightgray
Definition: gdi.h:163
XorRegion
MG_EXPORT BOOL GUIAPI XorRegion(CLIPRGN *dst, const CLIPRGN *src1, const CLIPRGN *src2)
Does the XOR operation between two regions.
StretchPaintImageEx
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.
InitCircleRegion
MG_EXPORT BOOL GUIAPI InitCircleRegion(PCLIPRGN dst, int x, int y, int r)
Initializes a region to be an enclosed circle.
IsMemDC
MG_EXPORT BOOL GUIAPI IsMemDC(HDC hdc)
Check whether a given DC is a memory DC.
LANGCODE_id
@ LANGCODE_id
Definition: gdi.h:7309
LANGCODE_pl
@ LANGCODE_pl
Definition: gdi.h:7395
_GAL_Palette
Definition: common.h:1147
LoadMyBitmapEx
MG_EXPORT int GUIAPI LoadMyBitmapEx(PMYBITMAP my_bmp, RGB *pal, MG_RWops *area, const char *ext)
Load a MYBITMAP object from a data source.
GetVideoHandle
MG_EXPORT GHANDLE GetVideoHandle(HDC hdc)
GetBValue
#define GetBValue(rgba)
Get the blue component from a RGBA quadruple value rgba.
Definition: common.h:888
SetColorfulPalette
MG_EXPORT BOOL GUIAPI SetColorfulPalette(HDC hdc)
Set a DC with colorful palette.
TextOutOmitted
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.
LANGCODE_gl
@ LANGCODE_gl
Definition: gdi.h:7289
SPtoLP
MG_EXPORT void GUIAPI SPtoLP(HDC hdc, POINT *pPt)
Converts screen coordinates into logical coordinates.
CreateLayout
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.
LANGCODE_sd
@ LANGCODE_sd
Definition: gdi.h:7415
PT_DOUBLE_DASH
@ PT_DOUBLE_DASH
Definition: gdi.h:3973
_DrmSurfaceInfo::size
size_t size
Definition: gdi.h:14480
_LOGFONT::style
DWORD32 style
Definition: gdi.h:6486
CircleArcGenerator
MG_EXPORT void GUIAPI CircleArcGenerator(void *context, int sx, int sy, int r, int ang1, int ang2, CB_ARC cb)
An arc generator.
LANGCODE_kl
@ LANGCODE_kl
Definition: gdi.h:7335
_MYBITMAP::depth
Uint8 depth
Definition: gdi.h:11059
LANGCODE_mn
@ LANGCODE_mn
Definition: gdi.h:7367
_GLYPHPOS::y
int y
Definition: gdi.h:13551
LANGCODE_uz
@ LANGCODE_uz
Definition: gdi.h:7479
UnloadMyBitmap
MG_EXPORT void GUIAPI UnloadMyBitmap(PMYBITMAP my_bmp)
Unloads a bitmap.
_GLYPHEXTINFO
Definition: gdi.h:13509
GHANDLE
PVOID GHANDLE
General handle.
Definition: common.h:402
UINT
unsigned int UINT
A type definition for unsigned integer.
Definition: common.h:664
COLOR_BLEND_SP_SCREEN
@ COLOR_BLEND_SP_SCREEN
Definition: gdi.h:5222
GetSysCharHeight
MG_EXPORT int GUIAPI GetSysCharHeight(void)
Get the height of a character of the default system font.
BYTE
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:460
LANGCODE_ay
@ LANGCODE_ay
Definition: gdi.h:7225
_GLYPHPOS::ellipsis
Uint8 ellipsis
Definition: gdi.h:13575
GetTextExtent
MG_EXPORT int GUIAPI GetTextExtent(HDC hdc, const char *spText, int len, SIZE *pSize)
Computes the output extent of a string of text.
GetEffectiveCDC
MG_EXPORT HDC GUIAPI GetEffectiveCDC(HWND hwnd)
Get the effective client DC of a window.
RGBA2Pixel
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:3142
IsUCharSpace
MG_EXPORT BOOL GUIAPI IsUCharSpace(Uchar32 uc)
LPtoDP
MG_EXPORT void GUIAPI LPtoDP(HDC hdc, POINT *pPt)
Converts logical coordinates into device coordinates.
GetPrivateClientDC
MG_EXPORT HDC GUIAPI GetPrivateClientDC(HWND hwnd)
Returns the private client DC of a window.
_LOGFONT::type
char * type
Definition: gdi.h:6480
MG_SMOOTH_NONE
@ MG_SMOOTH_NONE
Definition: gdi.h:8165
GetTabbedTextExtentPoint
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.
LoadIconFromFile
MG_EXPORT HICON GUIAPI LoadIconFromFile(HDC hdc, const char *filename, int which)
Load an icon from a Windows ICO file.
SubtractClipRect
MG_EXPORT BOOL GUIAPI SubtractClipRect(PCLIPRGN pRgn, const RECT *pRect)
Subtracts a rectangle from a region.
DestroyBMPFont
MG_EXPORT void GUIAPI DestroyBMPFont(DEVFONT *dev_font)
Destroy the bitmap device font.
LineClipper
MG_EXPORT BOOL GUIAPI LineClipper(const RECT *cliprc, int *_x0, int *_y0, int *_x1, int *_y1)
The line clipper using Cohen-Sutherland algorithm.
LanguageCode
LanguageCode
Definition: gdi.h:7209
UCharCompose
MG_EXPORT BOOL GUIAPI UCharCompose(Uchar32 a, Uchar32 b, Uchar32 *ch)
SetClipRgn
MG_EXPORT BOOL GUIAPI SetClipRgn(PCLIPRGN pRgn, const RECT *pRect)
Set a region to contain only one rect.
UCharGetJoiningType
MG_EXPORT BidiJoiningType GUIAPI UCharGetJoiningType(Uchar32 uc)
Get character joining type.
RotateScaledBitmapVFlip
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.
IDX_COLOR_darkgray
@ IDX_COLOR_darkgray
Definition: gdi.h:161
LANGCODE_tk
@ LANGCODE_tk
Definition: gdi.h:7457
RotateBitmapHFlip
MG_EXPORT void GUIAPI RotateBitmapHFlip(HDC hdc, const BITMAP *bmp, int lx, int ty, int angle)
Flips horizontally and rotates a bitmap object.
LANGCODE_as
@ LANGCODE_as
Definition: gdi.h:7223
_RECT
Definition: common.h:936
Expand256CBitmap
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:11895
LoadMyBitmapSL
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.
GetSysCharset
const MG_EXPORT char *GUIAPI GetSysCharset(BOOL wchar)
Get the current system charset.
ColorBlendMethod
ColorBlendMethod
Definition: gdi.h:5171
BidiLevel
Sint8 BidiLevel
Definition: gdi.h:8763
IDX_COLOR_darkmagenta
@ IDX_COLOR_darkmagenta
Definition: gdi.h:157
InitSlaveScreen
static HDC InitSlaveScreen(const char *name, const char *mode)
Initializes slave screen.
Definition: gdi.h:11703
LANGCODE_eu
@ LANGCODE_eu
Definition: gdi.h:7271
COLOR_BLEND_SP_COLOR_DODGE
@ COLOR_BLEND_SP_COLOR_DODGE
Definition: gdi.h:5242
DeleteSecondaryDC
MG_EXPORT void GUIAPI DeleteSecondaryDC(HWND hwnd)
Deletes the secondary DC of the window.
LANGCODE_lt
@ LANGCODE_lt
Definition: gdi.h:7355
_CLIPRGN::tail
PCLIPRECT tail
Definition: gdi.h:807
IDX_COLOR_lightwhite
@ IDX_COLOR_lightwhite
Definition: gdi.h:177
_DTFIRSTLINE::width
int width
Definition: gdi.h:10884
_STRETCH_EXTRA_INFO::cx
int cx
Definition: gdi.h:5403
LANGCODE_mt
@ LANGCODE_mt
Definition: gdi.h:7375
LANGCODE_it
@ LANGCODE_it
Definition: gdi.h:7319
PaintImageFromMem
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.
BlockDataFree
MG_EXPORT void BlockDataFree(PBLOCKHEAP heap, void *data)
Frees an allocated data block.
LoadBitmapIconFromMem
MG_EXPORT HICON GUIAPI LoadBitmapIconFromMem(HDC hdc, const void *mem, size_t size, const char *ext)
Load an icon from memory.
FillBox
MG_EXPORT void GUIAPI FillBox(HDC hdc, int x, int y, int w, int h)
Fills a rectangle box.
SetMemDCAlpha
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...
COLOR_BLEND_SP_SOFT_LIGHT
@ COLOR_BLEND_SP_SOFT_LIGHT
Definition: gdi.h:5257
InitVectorialFonts
static BOOL GUIAPI InitVectorialFonts(void)
Initializes vectorial font renderer.
Definition: gdi.h:7706
GetPaletteEntries
MG_EXPORT int GUIAPI GetPaletteEntries(HPALETTE hpal, int start, int len, GAL_Color *cmap)
Get palette entries of a logical palette.
SetPaletteEntries
MG_EXPORT int GUIAPI SetPaletteEntries(HPALETTE hpal, int start, int len, GAL_Color *cmap)
Set palette entries of a logical palette.
UCharGetScriptType
MG_EXPORT ScriptType GUIAPI UCharGetScriptType(Uchar32 ch)
ScriptType
ScriptType
Definition: gdi.h:7013
GetBackgroundColorInTextRuns
MG_EXPORT RGBCOLOR GUIAPI GetBackgroundColorInTextRuns(const TEXTRUNS *truns, int index)
_DrmSurfaceInfo::width
uint32_t width
Definition: gdi.h:14472
PaintImageFromFile
MG_EXPORT int GUIAPI PaintImageFromFile(HDC hdc, int x, int y, const char *spFileName)
Paints an image from file on device directly.
LANGCODE_ru
@ LANGCODE_ru
Definition: gdi.h:7409
FALSE
#define FALSE
FALSE value, defined as 0 by MiniGUI.
Definition: common.h:351
SetPixelRGBA
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.
IsWindowDC
MG_EXPORT BOOL GUIAPI IsWindowDC(HDC hdc)
Check whether a given DC is a window DC.
LoadMyBitmapFromMem
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.
GetNearestPaletteIndex
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.
PT_CAP_BUTT
@ PT_CAP_BUTT
Definition: gdi.h:4032
GetSecondaryDC
MG_EXPORT HDC GUIAPI GetSecondaryDC(HWND hwnd)
Retrieve and return the secondary DC of a specific window.
LANGCODE_yi
@ LANGCODE_yi
Definition: gdi.h:7489
_BITMAP::bmType
Uint8 bmType
Definition: gdi.h:11122
LANGCODE_gu
@ LANGCODE_gu
Definition: gdi.h:7293
_FONTMETRICS::descent
int descent
Definition: gdi.h:7615
LANGCODE_te
@ LANGCODE_te
Definition: gdi.h:7449
PaintImageEx
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.
Uint16
unsigned short Uint16
A type definition for a 16-bit unsigned integer.
Definition: common.h:167
GetGValue
#define GetGValue(rgba)
Get the green component from a RGBA quadruple value rgba.
Definition: common.h:879
GetTextMCharInfo
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.
Pixel2RGB
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:3233
IsRectEmpty
MG_EXPORT BOOL GUIAPI IsRectEmpty(const RECT *prc)
Determine whether an rectangle is empty.
COLOR_BLEND_SP_EXCLUSION
@ COLOR_BLEND_SP_EXCLUSION
Definition: gdi.h:5267
UCharCanonicalOrdering
MG_EXPORT void GUIAPI UCharCanonicalOrdering(Uchar32 *string, int len)
SubtractRegion
MG_EXPORT BOOL GUIAPI SubtractRegion(CLIPRGN *rgnD, const CLIPRGN *rgnM, const CLIPRGN *rgnS)
Substrcts a region from another.
BIDIGetTextLogicalAChars
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.
LANGCODE_ka
@ LANGCODE_ka
Definition: gdi.h:7331
ParagraphDir
Uint16 ParagraphDir
Definition: gdi.h:8792
LANGCODE_ie
@ LANGCODE_ie
Definition: gdi.h:7311
LANGCODE_qu
@ LANGCODE_qu
Definition: gdi.h:7401
_DrmSurfaceInfo::pitch
uint32_t pitch
Definition: gdi.h:14476
LANGCODE_mk
@ LANGCODE_mk
Definition: gdi.h:7363
InflateRect
static void InflateRect(RECT *prc, int cx, int cy)
Increases or decreases the width and height of an rectangle.
Definition: gdi.h:5951
_ARC::angle2
int angle2
Definition: gdi.h:4352
_GLYPHEXTINFO::line_adv
int line_adv
Definition: gdi.h:13517
GetFontMetrics
MG_EXPORT void GUIAPI GetFontMetrics(LOGFONT *log_font, FONTMETRICS *font_metrics)
Get metrics information of a logical font.
_BLOCKHEAP::heap
unsigned char * heap
Definition: gdi.h:603
_BITMAP::bmPitch
Uint32 bmPitch
Definition: gdi.h:11139
Sint8
signed char Sint8
A type definition for an 8-bit signed character.
Definition: common.h:162
LANGCODE_am
@ LANGCODE_am
Definition: gdi.h:7219
LANGCODE_iw
@ LANGCODE_iw
Definition: gdi.h:7323
CB_ALLOC_BITMAP_BUFF
BOOL(* CB_ALLOC_BITMAP_BUFF)(void *context, BITMAP *bmp)
The type of callback to allocate pixel buffer for BITMAP object.
Definition: gdi.h:11171
HICON
GHANDLE HICON
Handle to icon.
Definition: common.h:427
CB_ELLIPSE
void(* CB_ELLIPSE)(void *context, int x1, int x2, int y)
The type of ellipse generator callback.
Definition: gdi.h:3502
SaveScreenRectContent
MG_EXPORT BOOL GUIAPI SaveScreenRectContent(const RECT *rcWin, const char *filename)
Saves content of a rectangle in the screen to a file.
LANGCODE_bh
@ LANGCODE_bh
Definition: gdi.h:7235
PT_JOIN_BEVEL
@ PT_JOIN_BEVEL
Definition: gdi.h:4087
CreateMemDCFromBitmap
MG_EXPORT HDC GUIAPI CreateMemDCFromBitmap(HDC hdc, const BITMAP *bmp)
Creates a memory DC from a reference DC and a BITMAP object.
PT_JOIN_ROUND
@ PT_JOIN_ROUND
Definition: gdi.h:4082
GetGlyphValue
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.
IDX_COLOR_darkyellow
@ IDX_COLOR_darkyellow
Definition: gdi.h:159
CreatePrivateSubDC
HDC GUIAPI CreatePrivateSubDC(HDC hdc, int off_x, int off_y, int width, int height)
Creates a private SubDC of a window.
_DrmSurfaceInfo::offset
off_t offset
Definition: gdi.h:14482
UCharToFullSizeKana
MG_EXPORT Uchar32 GUIAPI UCharToFullSizeKana(Uchar32 uc)
GetClipRegion
MG_EXPORT int GUIAPI GetClipRegion(HDC hdc, CLIPRGN *cliprgn)
Get the current clipping region of a DC.
GetBitmapFromDC
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.
GetLastTextOutPos
MG_EXPORT void GUIAPI GetLastTextOutPos(HDC hdc, POINT *pt)
Retrieve the last text output position.
DrmSurfaceInfo
struct _DrmSurfaceInfo DrmSurfaceInfo
LANGCODE_be
@ LANGCODE_be
Definition: gdi.h:7231
LoadBitmapIconFromFile
MG_EXPORT HICON GUIAPI LoadBitmapIconFromFile(HDC hdc, const char *file_name)
Load an icon from a bitmap file.
CreateLogFontForMChar2UChar
MG_EXPORT PLOGFONT GUIAPI CreateLogFontForMChar2UChar(const char *charset)
Create a logical font for conversion from multi-byte character string to Uchar32 string.
_LOGFONT::charset
char * charset
Definition: gdi.h:6484
LANGCODE_mg
@ LANGCODE_mg
Definition: gdi.h:7359
DestroyIcon
MG_EXPORT BOOL GUIAPI DestroyIcon(HICON hicon)
Destroys an icon object.
CPLOGFONT
const typedef LOGFONT * CPLOGFONT
Data type of pointer to a LOGFONT.
Definition: gdi.h:6519
CreateIconEx
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.
LANGCODE_sg
@ LANGCODE_sg
Definition: gdi.h:7417
UStrGetBidiTypes
MG_EXPORT void GUIAPI UStrGetBidiTypes(const Uchar32 *ucs, int nr_ucs, BidiType *bdts)
Get bidi types for an string of Unicode characters.
LANGCODE_ne
@ LANGCODE_ne
Definition: gdi.h:7381
_GLYPHPOS::x
int x
Definition: gdi.h:13547
InitBitmap
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.
WindowFromDC
MG_EXPORT HWND GUIAPI WindowFromDC(HDC hdc)
Get the window handle from DC.
COLOR_BLEND_PD_DST_IN
@ COLOR_BLEND_PD_DST_IN
Definition: gdi.h:5188
LANGCODE_st
@ LANGCODE_st
Definition: gdi.h:7439
_DTFIRSTLINE::startx
int startx
Definition: gdi.h:10880
CB_ARC
void(* CB_ARC)(void *context, int x, int y)
The type of arc generator callback.
Definition: gdi.h:3535
ON_UPDATE_SECONDARYDC
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:2235
CLIPRECT
struct _CLIPRECT CLIPRECT
Uint8
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:157
IsUCharControl
MG_EXPORT BOOL GUIAPI IsUCharControl(Uchar32 uc)
_STRETCH_EXTRA_INFO::cy
int cy
Definition: gdi.h:5406
LANGCODE_mr
@ LANGCODE_mr
Definition: gdi.h:7371
OffsetRegionEx
MG_EXPORT void GUIAPI OffsetRegionEx(PCLIPRGN region, const RECT *rcClient, const RECT *rcScroll, int x, int y)
Offsets the region in the specified window's scroll area.
_BITMAP::bmAlphaMask
Uint8 * bmAlphaMask
Definition: gdi.h:11148
GetGlyphsExtent
MG_EXPORT int GUIAPI GetGlyphsExtent(HDC hdc, Glyph32 *glyphs, int nr_glyphs, SIZE *size)
Get visual extent value of a glyph string.
GetLayoutLineSize
MG_EXPORT BOOL GUIAPI GetLayoutLineSize(const LAYOUTLINE *line, SIZE *line_size)
Get the size of a layout line.
_MYBITMAP::pitch
Uint32 pitch
Definition: gdi.h:11071
LANGCODE_la
@ LANGCODE_la
Definition: gdi.h:7349
FocusRect
MG_EXPORT void GUIAPI FocusRect(HDC hdc, int x0, int y0, int x1, int y1)
Draws a focus rectangle.
LANGCODE_zh
@ LANGCODE_zh
Definition: gdi.h:7495
MG_SMOOTH_DEFAULT
@ MG_SMOOTH_DEFAULT
Definition: gdi.h:8167
_LOGFONT::ascent
int ascent
Definition: gdi.h:6492
_GLYPHPOS::suppressed
Uint8 suppressed
Definition: gdi.h:13567
SCALING_FILTER_BEST
@ SCALING_FILTER_BEST
Definition: gdi.h:5378
InitPolygonRegion
MG_EXPORT BOOL GUIAPI InitPolygonRegion(PCLIPRGN dst, const POINT *pts, int vertices)
Initializes a region to be an enclosed polygon.
ExcludeClipRect
MG_EXPORT void GUIAPI ExcludeClipRect(HDC hdc, const RECT *prc)
Excludes the specified rectangle from the current visible region of a DC.
LANGCODE_gd
@ LANGCODE_gd
Definition: gdi.h:7287
ResizePalette
MG_EXPORT BOOL GUIAPI ResizePalette(HPALETTE hpal, int len)
Resizes a logical palette.
_GLYPHEXTINFO::whitespace
Uint8 whitespace
Definition: gdi.h:13525
CircleGenerator
MG_EXPORT void GUIAPI CircleGenerator(void *context, int sx, int sy, int r, CB_CIRCLE cb)
A circle generator.
COLOR_BLEND_PD_DST_ATOP
@ COLOR_BLEND_PD_DST_ATOP
Definition: gdi.h:5196
LineEx
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.
UBidiGetParagraphDir
MG_EXPORT BidiType GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len)
Get the base paragraph direction.
BOOL
int BOOL
A type definition for boolean value.
Definition: common.h:343
COLOR_BLEND_SP_COLOR_BURN
@ COLOR_BLEND_SP_COLOR_BURN
Definition: gdi.h:5247
LANGCODE_cy
@ LANGCODE_cy
Definition: gdi.h:7251
_DEVFONT::style
DWORD32 style
Definition: gdi.h:7577
RGBCOLOR
DWORD32 RGBCOLOR
A type definition for a RGB color value.
Definition: common.h:860
LoadDevFontFromFile
MG_EXPORT DEVFONT *GUIAPI LoadDevFontFromFile(const char *devfont_name, const char *file_name)
Load device font from font file.
FillBoxWithBitmapPart
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.
GetRasterOperation
MG_EXPORT int GUIAPI GetRasterOperation(HDC hdc)
Get the raster operation of a DC.
LANGCODE_dz
@ LANGCODE_dz
Definition: gdi.h:7259
LANGCODE_sh
@ LANGCODE_sh
Definition: gdi.h:7419
LANGCODE_fj
@ LANGCODE_fj
Definition: gdi.h:7277
_CLIPRECT
Definition: gdi.h:755
FillBitmapPartInBox
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.
LANGCODE_gn
@ LANGCODE_gn
Definition: gdi.h:7291
_RGB::b
BYTE b
Definition: common.h:1025
ReleaseSecondaryDC
static void GUIAPI ReleaseSecondaryDC(HWND hwnd, HDC hdc)
Release the DC returned by GetSecondaryClientDC.
Definition: gdi.h:2348
UBidiJoinArabic
MG_EXPORT void GUIAPI UBidiJoinArabic(const BidiType *bidi_types, const BidiLevel *embedding_levels, int len, BidiArabicProp *ar_props)
Do Arabic joining.
_GLYPHBITMAP::bbox_x
int bbox_x
Definition: gdi.h:7643
LANGCODE_ja
@ LANGCODE_ja
Definition: gdi.h:7325
GetIconSize
MG_EXPORT BOOL GUIAPI GetIconSize(HICON hicon, int *w, int *h)
Get the size of an icon object.
UStrGetBracketTypes
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.
ArcEx
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.
UCharToFullWidth
MG_EXPORT Uchar32 GUIAPI UCharToFullWidth(Uchar32 uc)
CreateMemDCFromMyBitmap
MG_EXPORT HDC GUIAPI CreateMemDCFromMyBitmap(const MYBITMAP *my_bmp, const RGB *pal)
Creates a memory DC from a device independent MYBITMAP object.
_RGB
Definition: common.h:1012
LANGCODE_na
@ LANGCODE_na
Definition: gdi.h:7379
LanguageCodeFromISO639s1Code
static LanguageCode GUIAPI LanguageCodeFromISO639s1Code(const char *iso639_1)
Get MiniGUI language code from an ISO639-1 language code string.
Definition: gdi.h:7531
GetSysFontMaxWidth
MG_EXPORT int GUIAPI GetSysFontMaxWidth(int font_id)
Get the maximal width of a single-byte character of a system font.
_MYBITMAP::w
Uint32 w
Definition: gdi.h:11067
LANGCODE_su
@ LANGCODE_su
Definition: gdi.h:7441
_STRETCH_EXTRA_INFO
Definition: gdi.h:5393
ACHARMAPINFO
struct _ACHARMAPINFO ACHARMAPINFO
Data type of struct _ACHARMAPINFO.
SCALING_FILTER_FAST
@ SCALING_FILTER_FAST
Definition: gdi.h:5374
_DrmSurfaceInfo::height
uint32_t height
Definition: gdi.h:14474
COLOR_BLEND_NS_COLOR
@ COLOR_BLEND_NS_COLOR
Definition: gdi.h:5290
IDX_COLOR_black
@ IDX_COLOR_black
Definition: gdi.h:179
_CLIPRGN::reserved
BYTE reserved[3]
Definition: gdi.h:795
FloodFillGenerator
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.
IsUCharGraph
MG_EXPORT BOOL GUIAPI IsUCharGraph(Uchar32 uc)
_WORDINFO
Definition: gdi.h:8448
_LOGFONT::size_request
int size_request
Definition: gdi.h:6496
UChar2AChar
MG_EXPORT BOOL GUIAPI UChar2AChar(LOGFONT *logfont, Uchar32 uc, Achar32 *ac)
Get the LOGFONT Achar32 value from a Unicode character value.
DPtoLP
MG_EXPORT void GUIAPI DPtoLP(HDC hdc, POINT *pPt)
Converts device coordinates into logical coordinates.
UChars2AChars
MG_EXPORT int GUIAPI UChars2AChars(LOGFONT *logfont, const Uchar32 *ucs, Achar32 *acs, int n)
Convert an Uchar32 array to Unicode character array.
CB_CIRCLE
void(* CB_CIRCLE)(void *context, int x1, int x2, int y)
The type of circle generator callback.
Definition: gdi.h:3466
LANGCODE_or
@ LANGCODE_or
Definition: gdi.h:7391
GetPixelRGB
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.
LANGCODE_unknown
@ LANGCODE_unknown
Definition: gdi.h:7211
LANGCODE_rw
@ LANGCODE_rw
Definition: gdi.h:7411
_GLYPHPOS::y_off
int y_off
Definition: gdi.h:13559
LANGCODE_hi
@ LANGCODE_hi
Definition: gdi.h:7297
SetRect
static void SetRect(RECT *prc, int left, int top, int right, int bottom)
Set a rectangle.
Definition: gdi.h:5873
LANGCODE_az
@ LANGCODE_az
Definition: gdi.h:7227
BT_TILED
@ BT_TILED
Definition: gdi.h:4154
DeleteBitmapAlphaPixel
MG_EXPORT void GUIAPI DeleteBitmapAlphaPixel(PBITMAP bmp)
Deletes the bitmap alpha pixel format information of a BITMAP object.
BIDILogAChars2VisACharsEx
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 ...
LANGCODE_tl
@ LANGCODE_tl
Definition: gdi.h:7459
CreateCompatibleDCEx
MG_EXPORT HDC GUIAPI CreateCompatibleDCEx(HDC hdc, int width, int height)
Creates a memory DC which is compatible with the specified reference DC.
_CLIPRGN::type
BYTE type
Definition: gdi.h:791
IDX_COLOR_green
@ IDX_COLOR_green
Definition: gdi.h:167
LANGCODE_ts
@ LANGCODE_ts
Definition: gdi.h:7467
_GLYPHEXTINFO::orientation
Uint8 orientation
Definition: gdi.h:13537
mlsEnableSlaveScreen
MG_EXPORT BOOL GUIAPI mlsEnableSlaveScreen(HDC dc_mls, BOOL enable)
Enable or Disable a MLShadow slave screen.
SubtractRect
MG_EXPORT int GUIAPI SubtractRect(RECT *rc, const RECT *psrc1, const RECT *psrc2)
Obtains the rectangles when substracting one rectangle from another.
GetSystemFont
static PLOGFONT GUIAPI GetSystemFont(int font_id)
Get the system logical font through an font identifier.
Definition: gdi.h:8320
IncludeClipRect
MG_EXPORT void GUIAPI IncludeClipRect(HDC hdc, const RECT *prc)
Includes the specified rectangle to the current visible region of a DC.
IDX_COLOR_darkred
@ IDX_COLOR_darkred
Definition: gdi.h:155
LANGCODE_ba
@ LANGCODE_ba
Definition: gdi.h:7229
GetClipRgnBoundRect
MG_EXPORT void GUIAPI GetClipRgnBoundRect(PCLIPRGN pRgn, PRECT pRect)
Get the bounding rectangle of a region.
IntersectClipRect
MG_EXPORT BOOL GUIAPI IntersectClipRect(PCLIPRGN pRgn, const RECT *pRect)
Intersects a rectangle with a region.
LANGCODE_ml
@ LANGCODE_ml
Definition: gdi.h:7365
LANGCODE_sa
@ LANGCODE_sa
Definition: gdi.h:7413
InitBitmapPixelFormat
MG_EXPORT BOOL GUIAPI InitBitmapPixelFormat(HDC hdc, PBITMAP bmp)
Initializes the bitmap pixel format information of a BITMAP object.
PTJoinStyle
PTJoinStyle
Definition: gdi.h:4073
_GLYPHEXTINFO::bbox_x
int bbox_x
Definition: gdi.h:13511
LANGCODE_om
@ LANGCODE_om
Definition: gdi.h:7389
CircleArc
MG_EXPORT void GUIAPI CircleArc(HDC hdc, int sx, int sy, int r, int ang1, int ang2)
Draws an arc.
_DTFIRSTLINE
Definition: gdi.h:10875
RGB2Pixels
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.
SetBackgroundColorInTextRuns
MG_EXPORT BOOL GUIAPI SetBackgroundColorInTextRuns(TEXTRUNS *truns, int start_index, int length, RGBCOLOR color)
Set background color in a TEXTRUNS object.
LANGCODE_sr
@ LANGCODE_sr
Definition: gdi.h:7435
CreateMemDCEx
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.
BidiType
Uint16 BidiType
Definition: gdi.h:8767
LANGCODE_so
@ LANGCODE_so
Definition: gdi.h:7431
_GLYPHPOS::orientation
Uint8 orientation
Definition: gdi.h:13587
Ellipse
MG_EXPORT void GUIAPI Ellipse(HDC hdc, int sx, int sy, int rx, int ry)
Draws a ellipse.
LANGCODE_ta
@ LANGCODE_ta
Definition: gdi.h:7447
_CLIPRGN::rcBound
RECT rcBound
Definition: gdi.h:799
_GLYPHBITMAP::bmp_size
size_t bmp_size
Definition: gdi.h:7648
ReplaceBitmapColor
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.
SelectPalette
MG_EXPORT BOOL GUIAPI SelectPalette(HDC hdc, HPALETTE hpal, BOOL reserved)
Selects a palette for a DC.
_GAL_Color
Definition: common.h:1123
GetSampleLanguageForScript
MG_EXPORT LanguageCode GUIAPI GetSampleLanguageForScript(ScriptType st)
GetDCInSecondarySurface
MG_EXPORT HDC GUIAPI GetDCInSecondarySurface(HWND hWnd, BOOL bClient)
Get a window or client DC by using the secondary surface if possible.
PLOGFONT
LOGFONT * PLOGFONT
Data type of pointer to a LOGFONT.
Definition: gdi.h:6513
UBidiShapeMirroring
MG_EXPORT void GUIAPI UBidiShapeMirroring(const BidiLevel *embedding_levels, int len, Uchar32 *ucs)
Do mirroring shaping.
IDX_COLOR_blue
@ IDX_COLOR_blue
Definition: gdi.h:165
SysPixelIndex
MG_EXPORT gal_pixel SysPixelIndex[]
The pre-defined system pixel values.
EmptyClipRgn
MG_EXPORT void GUIAPI EmptyClipRgn(PCLIPRGN pRgn)
Empties a clipping region.
_LOGFONT::rotation
int rotation
Definition: gdi.h:6490
DestroyClipRgn
MG_EXPORT void GUIAPI DestroyClipRgn(PCLIPRGN pRgn)
Empties and destroys a clipping region.
LANGCODE_ug
@ LANGCODE_ug
Definition: gdi.h:7473
CB_EQUAL_PIXEL
BOOL(* CB_EQUAL_PIXEL)(void *context, int x, int y)
Flodd filling generator's equation callback.
Definition: gdi.h:3674
WC2MBEx
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...
ScriptTypeToISO15924
MG_EXPORT Uint32 GUIAPI ScriptTypeToISO15924(ScriptType script)
COLOR_BLEND_NS_SATURATION
@ COLOR_BLEND_NS_SATURATION
Definition: gdi.h:5284
_DTFIRSTLINE::height
int height
Definition: gdi.h:10886
_DrmSurfaceInfo::fb_id
uint32_t fb_id
Definition: gdi.h:14469
PolyLineTo
MG_EXPORT void GUIAPI PolyLineTo(HDC hdc, const POINT *pts, int vertices)
Draws a polyline.
STIPPLE
struct _STIPPLE STIPPLE
UBidiGetParagraphEmbeddingLevelsAlt
MG_EXPORT BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevelsAlt(const Uchar32 *ucs, int nr_ucs, ParagraphDir *paragraph_dir, BidiLevel *embedding_levels)
An alternative of UBidiGetParagraphEmbeddingLevels().
SetBrushInfo
MG_EXPORT void GUIAPI SetBrushInfo(HDC hdc, const BITMAP *tile, const STIPPLE *stipple)
Set the tile or stipple with the DC.
_BLOCKHEAP::sz_heap
size_t sz_heap
Definition: gdi.h:596
DrawGlyph
MG_EXPORT int GUIAPI DrawGlyph(HDC hdc, int x, int y, Glyph32 glyph_value, int *adv_x, int *adv_y)
Draw a glyph.
_FONTMETRICS::ascent
int ascent
Definition: gdi.h:7613
CB_POLYGON
void(* CB_POLYGON)(void *context, int x1, int x2, int y)
The type of polygon generator callback.
Definition: gdi.h:3567
BLOCKHEAP
struct _BLOCKHEAP BLOCKHEAP
DeletePrivateDC
MG_EXPORT void GUIAPI DeletePrivateDC(HDC hdc)
Deletes the DC returned by CreatePrivateDC or CreatePrivateClientDC or CreatePrivateSubDC.
LANGCODE_oc
@ LANGCODE_oc
Definition: gdi.h:7387
Pixel2RGBs
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.
COLOR_BLEND_PD_SRC_OVER
@ COLOR_BLEND_PD_SRC_OVER
Definition: gdi.h:5182
_FONTMETRICS::max_width
int max_width
Definition: gdi.h:7618
DestroyLayout
MG_EXPORT BOOL GUIAPI DestroyLayout(LAYOUT *layout)
Destroy the specified layout information structure.
_CLIPRGN::heap
PBLOCKHEAP heap
Definition: gdi.h:812
IsCovered
MG_EXPORT BOOL GUIAPI IsCovered(const RECT *prc1, const RECT *prc2)
Determine whether one rectangle is covered by another.
TerminateSlaveScreen
MG_EXPORT void GUIAPI TerminateSlaveScreen(HDC hdc)
Terminates slave screen.
DrawLayoutLine
MG_EXPORT int DrawLayoutLine(HDC hdc, const LAYOUTLINE *line, int x, int y)
Draw a laid out line at the specific position.
LANGCODE_ab
@ LANGCODE_ab
Definition: gdi.h:7215
GetPixelInBitmapEx
MG_EXPORT gal_pixel GUIAPI GetPixelInBitmapEx(const BITMAP *bmp, int x, int y, Uint8 *alpha)
Returns the pixel value in a BITMAP object.
LANGCODE_pa
@ LANGCODE_pa
Definition: gdi.h:7393
MB2WCEx
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...
CopyRect
static void CopyRect(RECT *pdrc, const RECT *psrc)
Copies one rectangle to another.
Definition: gdi.h:5909
GetSysFontAveWidth
MG_EXPORT int GUIAPI GetSysFontAveWidth(int font_id)
Get the average width of a single-byte character of a system font.
PivotBitmap
MG_EXPORT void GUIAPI PivotBitmap(HDC hdc, const BITMAP *bmp, int lx, int ty, int cx, int cy, int angle)
Pivot a bitmap object.
GetLogFontInfo
MG_EXPORT void GUIAPI GetLogFontInfo(HDC hdc, LOGFONT *log_font)
Get logical font information of a DC.
SelectClipRect
MG_EXPORT void GUIAPI SelectClipRect(HDC hdc, const RECT *prc)
Set the visible region of a DC to be a rectangle.
COLOR_BLEND_PD_XOR
@ COLOR_BLEND_PD_XOR
Definition: gdi.h:5198
GetPixel
MG_EXPORT gal_pixel GUIAPI GetPixel(HDC hdc, int x, int y)
Get the pixel value at the specified position on a DC.
GetGlyphsExtentFromUChars
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.
COLOR_BLEND_SP_NORMAL
@ COLOR_BLEND_SP_NORMAL
Definition: gdi.h:5212
ScriptTypeFromISO15924
MG_EXPORT ScriptType GUIAPI ScriptTypeFromISO15924(Uint32 iso15924)
Get the ScriptType value from an encoded ISO15924 script code.
_DTFIRSTLINE::nr_chars
int nr_chars
Definition: gdi.h:10878
PolyFillArcEx
MG_EXPORT void GUIAPI PolyFillArcEx(HDC hdc, const ARC *arcs, int nr_arcs)
Fill a polyarc with the current brush in a DC.
COLOR_BLEND_SP_MULTIPLY
@ COLOR_BLEND_SP_MULTIPLY
Definition: gdi.h:5217
_DrmSurfaceInfo::handle
uint32_t handle
Definition: gdi.h:14460
GetTextColorInTextRuns
MG_EXPORT RGBCOLOR GUIAPI GetTextColorInTextRuns(const TEXTRUNS *truns, int index)
EllipseGenerator
MG_EXPORT void GUIAPI EllipseGenerator(void *context, int sx, int sy, int rx, int ry, CB_ELLIPSE cb)
An ellipse generator.
LANGCODE_fi
@ LANGCODE_fi
Definition: gdi.h:7275
UCharGetBreakType
MG_EXPORT UCharBreakType GUIAPI UCharGetBreakType(Uchar32 uc)
Get the break property of a Unicode character.
LANGCODE_ps
@ LANGCODE_ps
Definition: gdi.h:7397
CB_FLOOD_FILL
void(* CB_FLOOD_FILL)(void *context, int x1, int x2, int y)
Flodd filling generator's scan line callback.
Definition: gdi.h:3680
SaveMyBitmapToFile
MG_EXPORT int GUIAPI SaveMyBitmapToFile(PMYBITMAP my_bmp, RGB *pal, const char *spFileName)
Saves a MYBITMAP object to a bitmap file.
MonotoneVerticalPolygonGenerator
MG_EXPORT BOOL GUIAPI MonotoneVerticalPolygonGenerator(void *context, const POINT *pts, int vertices, CB_POLYGON cb)
A monotone vertical polygon generator.
ReleaseDC
MG_EXPORT void GUIAPI ReleaseDC(HDC hdc)
Releases a DC from DC pool.
_GLYPHBITMAP
Definition: gdi.h:7641
SelectFont
MG_EXPORT PLOGFONT GUIAPI SelectFont(HDC hdc, PLOGFONT log_font)
Selects a logical font into a DC.
LANGCODE_ca
@ LANGCODE_ca
Definition: gdi.h:7245
COLOR_BLEND_SP_HARD_LIGHT
@ COLOR_BLEND_SP_HARD_LIGHT
Definition: gdi.h:5252
_DTFIRSTLINE::starty
int starty
Definition: gdi.h:10882
BT_OPAQUE_STIPPLED
@ BT_OPAQUE_STIPPLED
Definition: gdi.h:4168
IDX_COLOR_cyan
@ IDX_COLOR_cyan
Definition: gdi.h:169
GetNextDevFont
const MG_EXPORT DEVFONT *GUIAPI GetNextDevFont(const DEVFONT *dev_font)
Get next devfont information.
ExpandMonoBitmap
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.
LANGCODE_th
@ LANGCODE_th
Definition: gdi.h:7453
_CLIPRECT::rc
RECT rc
Definition: gdi.h:760
LANGCODE_nl
@ LANGCODE_nl
Definition: gdi.h:7383
GetFirstMCharLen
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.
LANGCODE_ku
@ LANGCODE_ku
Definition: gdi.h:7345
drmGetDeviceFD
MG_EXPORT int drmGetDeviceFD(GHANDLE video)
GLYPHINFO
struct _GLYPHINFO GLYPHINFO
Data type of struct _GLYPHINFO.
_RGB::g
BYTE g
Definition: common.h:1021
_MYBITMAP::size
Uint32 size
Definition: gdi.h:11073
SetBitmapScalerType
MG_EXPORT int GUIAPI SetBitmapScalerType(HDC hdc, int scaler_type)
Set bitmap scaler algorithm callback of DC according by scaler_type.
COLOR_BLEND_PD_SRC_IN
@ COLOR_BLEND_PD_SRC_IN
Definition: gdi.h:5186
_STIPPLE
Definition: gdi.h:4197
LANGCODE_ks
@ LANGCODE_ks
Definition: gdi.h:7343
_BITMAP::bmColorRep
Uint32 bmColorRep
Definition: gdi.h:11132
LANGCODE_de
@ LANGCODE_de
Definition: gdi.h:7255
LANGCODE_br
@ LANGCODE_br
Definition: gdi.h:7243
FONTMETRICS
struct _FONTMETRICS FONTMETRICS
LANGCODE_za
@ LANGCODE_za
Definition: gdi.h:7493
SetDCLCS
MG_EXPORT void GUIAPI SetDCLCS(HDC hdc, int which, const POINT *pt)
Set mapping parameters of a device context.
DrawTextEx2
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.
FillEllipse
MG_EXPORT void GUIAPI FillEllipse(HDC hdc, int sx, int sy, int rx, int ry)
Fills an ellipse.
UCharDecompose
MG_EXPORT BOOL GUIAPI UCharDecompose(Uchar32 ch, Uchar32 *a, Uchar32 *b)
Rectangle
MG_EXPORT void GUIAPI Rectangle(HDC hdc, int x0, int y0, int x1, int y1)
Draws a rectangle.
GetPalette
MG_EXPORT int GUIAPI GetPalette(HDC hdc, int start, int len, GAL_Color *cmap)
Get palette entries of a DC.
LANGCODE_fa
@ LANGCODE_fa
Definition: gdi.h:7273
IsUCharPunct
MG_EXPORT BOOL GUIAPI IsUCharPunct(Uchar32 uc)
_STIPPLE::pitch
int pitch
Definition: gdi.h:4205
IDX_COLOR_red
@ IDX_COLOR_red
Definition: gdi.h:171
IDX_COLOR_darkcyan
@ IDX_COLOR_darkcyan
Definition: gdi.h:153
LANGCODE_si
@ LANGCODE_si
Definition: gdi.h:7421
SCALING_FILTER_GOOD
@ SCALING_FILTER_GOOD
Definition: gdi.h:5376
GetGlyphValueAlt
MG_EXPORT Glyph32 GUIAPI GetGlyphValueAlt(LOGFONT *logfont, Achar32 chv)
Get the LOGFONT glyph value of an abstract character.
MG_SMOOTH_LEGACY
@ MG_SMOOTH_LEGACY
Definition: gdi.h:8171
OffsetClipRegion
MG_EXPORT int GUIAPI OffsetClipRegion(HDC hdc, int nXOffset, int nYOffset)
Moves the clipping region of a device context by the specified offsets.
TextOutLen
MG_EXPORT int GUIAPI TextOutLen(HDC hdc, int x, int y, const char *spText, int len)
Outputs a string of text.
GetGlyphsExtentPoint
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.
_MYBITMAP::bits
BYTE * bits
Definition: gdi.h:11076
COLOR_BLEND_NS_LUMINOSITY
@ COLOR_BLEND_NS_LUMINOSITY
Definition: gdi.h:5297
GetACharValue
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.
DrawIcon
MG_EXPORT void GUIAPI DrawIcon(HDC hdc, int x, int y, int w, int h, HICON hicon)
Draws an icon into a box.
_MYBITMAP::alpha
Uint8 alpha
Definition: gdi.h:11061
SysPixelColor
const MG_EXPORT RGB SysPixelColor[]
The pre-defined system RGB colors.
SetBitmapKeyColor
MG_EXPORT int GUIAPI SetBitmapKeyColor(HDC hdc, PBITMAP bmp, Uint8 r, Uint8 g, Uint8 b)
Set the bitmap color key.
UStrGetBreaks
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 ...
UnlockDC
MG_EXPORT void GUIAPI UnlockDC(HDC hdc)
Unlocks a locked DC.
DestroyTextRuns
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...
IDX_COLOR_darkblue
@ IDX_COLOR_darkblue
Definition: gdi.h:149
RotateScaledBitmapHFlip
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.
LANGCODE_lv
@ LANGCODE_lv
Definition: gdi.h:7357
PT_SOLID
@ PT_SOLID
Definition: gdi.h:3961
LANGCODE_en
@ LANGCODE_en
Definition: gdi.h:7263
LANGCODE_et
@ LANGCODE_et
Definition: gdi.h:7269
_GLYPHPOS::advance
int advance
Definition: gdi.h:13563
RectInRegion
MG_EXPORT BOOL GUIAPI RectInRegion(const PCLIPRGN region, const RECT *rect)
Determine whether a rectangle is intersected with a region.
_BLOCKHEAP
Definition: gdi.h:589
GetMirrorAChar
MG_EXPORT BOOL GUIAPI GetMirrorAChar(LOGFONT *logfont, Achar32 chv, Achar32 *mirrored)
Get the mirrored abstract character if possible.
COLOR_BLEND_NS_HUE
@ COLOR_BLEND_NS_HUE
Definition: gdi.h:5278
COLOR_BLEND_PD_DST_OVER
@ COLOR_BLEND_PD_DST_OVER
Definition: gdi.h:5184
ft2SetLcdFilter
MG_EXPORT BOOL GUIAPI ft2SetLcdFilter(LOGFONT *logfont, FT2LCDFilter filter)
Set freetype2 smooth mode.
GetACharsExtentPoint
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.
_ARC::x
int x
Definition: gdi.h:4335
CB_DIRECT_DRAW_RECT
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:2039
SCALING_FILTER_CONVOLUTION
@ SCALING_FILTER_CONVOLUTION
Definition: gdi.h:5384
LANGCODE_ti
@ LANGCODE_ti
Definition: gdi.h:7455
BIDILogAChars2VisAChars
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.
CreateLogFont
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.
LANGCODE_tw
@ LANGCODE_tw
Definition: gdi.h:7471
COLOR_BLEND_PD_SRC_OUT
@ COLOR_BLEND_PD_SRC_OUT
Definition: gdi.h:5190
Pixel2RGBAs
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.
drmCreateDCFromHandleEx
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)
UCharToSingleWidth
MG_EXPORT Uchar32 GUIAPI UCharToSingleWidth(Uchar32 uc)
UStrGetJoiningTypes
MG_EXPORT void GUIAPI UStrGetJoiningTypes(const Uchar32 *ucs, int nr_ucs, BidiJoiningType *joining_types)
Get joining types for a string of Unicode characters.
LANGCODE_rn
@ LANGCODE_rn
Definition: gdi.h:7405
PolyLineEx
MG_EXPORT void GUIAPI PolyLineEx(HDC hdc, const POINT *pts, int nr_pts)
Draws a polyline with the current pen in a DC.
UCharToSmallKana
MG_EXPORT Uchar32 GUIAPI UCharToSmallKana(Uchar32 uc)
LineGenerator
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.
_RGB::r
BYTE r
Definition: common.h:1017
BitBlt
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.
PolygonGeneratorEx
MG_EXPORT BOOL GUIAPI PolygonGeneratorEx(void *context, const POINT *pts, int vertices, CB_POLYGON cb, RECT *rc_output)
A general polygon generator.
_BITMAP::bmColorKey
Uint32 bmColorKey
Definition: gdi.h:11130
IntersectRect
MG_EXPORT BOOL GUIAPI IntersectRect(RECT *pdrc, const RECT *psrc1, const RECT *psrc2)
Calculates the intersection of two rectangles.
LANGCODE_sl
@ LANGCODE_sl
Definition: gdi.h:7425
_DrmSurfaceInfo::drm_format
uint32_t drm_format
Definition: gdi.h:14478
GLYPHBITMAP
struct _GLYPHBITMAP GLYPHBITMAP
GetDefaultPalette
MG_EXPORT HPALETTE GUIAPI GetDefaultPalette(void)
Get the system default logical palette.
TermVectorialFonts
static void GUIAPI TermVectorialFonts(void)
Terminates vectorial font renderer.
Definition: gdi.h:7726
_GLYPHEXTINFO::extra_x
int extra_x
Definition: gdi.h:13515
_BLOCKHEAP::sz_block
size_t sz_block
Definition: gdi.h:594
EqualRect
MG_EXPORT BOOL GUIAPI EqualRect(const RECT *prc1, const RECT *prc2)
Determine whether two rectangles are equal.
GetSysCharWidth
MG_EXPORT int GUIAPI GetSysCharWidth(void)
Get the width of a single-byte character of the default system font.
MoveTo
MG_EXPORT void GUIAPI MoveTo(HDC hdc, int x, int y)
Moves the current zero pen position.
GetSysCCharWidth
MG_EXPORT int GUIAPI GetSysCCharWidth(void)
Get the width of a multi-byte character of the default system font.
IsUCharTitle
MG_EXPORT BOOL GUIAPI IsUCharTitle(Uchar32 uc)
common.h
This file includes macro definitions and typedefs that commonly used by MiniGUI.
drmCreateDCFromPrimeFdEx
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)
LAYOUT
struct _LAYOUT LAYOUT
Definition: gdi.h:13954
LANGCODE_hu
@ LANGCODE_hu
Definition: gdi.h:7303
DestroyPalette
MG_EXPORT void GUIAPI DestroyPalette(HPALETTE hpal)
Destroy a logical palette.
LANGCODE_ar
@ LANGCODE_ar
Definition: gdi.h:7221
InitComplexShapingEngine
MG_EXPORT BOOL GUIAPI InitComplexShapingEngine(TEXTRUNS *truns)
Initialize the complex shaping engine for a TEXTRUNS object.
CreateLogFontByName
MG_EXPORT PLOGFONT GUIAPI CreateLogFontByName(const char *font_name)
Creates a logical font by a font name.
UCharGetBracketType
MG_EXPORT BidiBracketType GUIAPI UCharGetBracketType(Uchar32 ch)
Get bracketed character.
GetBoundsRect
MG_EXPORT void GUIAPI GetBoundsRect(HDC hdc, RECT *pRect)
Retrieve the bounding rectangle of the current visible region of a DC.
COLOR_BLEND_PD_DST
@ COLOR_BLEND_PD_DST
Definition: gdi.h:5180
MBS2WCSEx
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...
RectVisible
MG_EXPORT BOOL GUIAPI RectVisible(HDC hdc, const RECT *pRect)
Check whether the specified rectangle is visible.
SelectClipRegionEx
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.
COLOR_BLEND_PD_DST_OUT
@ COLOR_BLEND_PD_DST_OUT
Definition: gdi.h:5192
GetSubDC
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.
LANGCODE_vi
@ LANGCODE_vi
Definition: gdi.h:7481
PT_ON_OFF_DASH
@ PT_ON_OFF_DASH
Definition: gdi.h:3966
SetFontNameInTextRuns
MG_EXPORT BOOL GUIAPI SetFontNameInTextRuns(TEXTRUNS *truns, int start_index, int length, const char *logfont_name)
Set logfont name of text runs.
SelectClipRegion
MG_EXPORT void GUIAPI SelectClipRegion(HDC hdc, const CLIPRGN *pRgn)
Set the visible region of a DC to be a region.
IsUCharWideCJK
MG_EXPORT BOOL GUIAPI IsUCharWideCJK(Uchar32 uc)
CreateSubMemDC
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.
GetRValue
#define GetRValue(rgba)
Get the red component from a RGBA quadruple value rgba.
Definition: common.h:870
_MG_RWops
Definition: endianrw.h:118
StretchPaintImageFromMem
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.
BlockDataAlloc
MG_EXPORT void * BlockDataAlloc(PBLOCKHEAP heap)
Allocates a data block from private heap.
LANGCODE_pt
@ LANGCODE_pt
Definition: gdi.h:7399
UCharCombiningClass
MG_EXPORT int GUIAPI UCharCombiningClass(Uchar32 uc)
_GLYPHBITMAP::bmp_pitch
int bmp_pitch
Definition: gdi.h:7650
IsUCharLowercase
MG_EXPORT BOOL GUIAPI IsUCharLowercase(Uchar32 uc)
LANGCODE_wo
@ LANGCODE_wo
Definition: gdi.h:7485
_WORDINFO::nr_delimiters
int nr_delimiters
Definition: gdi.h:8455
LANGCODE_fr
@ LANGCODE_fr
Definition: gdi.h:7281
CleanupMyBitmapSL
MG_EXPORT int GUIAPI CleanupMyBitmapSL(MYBITMAP *my_bmp, void *load_info)
Cleanups the scanline loader.
LANGCODE_no
@ LANGCODE_no
Definition: gdi.h:7385
LanguageCodeToISO639s1
const MG_EXPORT char *GUIAPI LanguageCodeToISO639s1(LanguageCode lc)
GetGlyphBitmap
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.
GetACharBidiType
MG_EXPORT BidiType GUIAPI GetACharBidiType(LOGFONT *log_font, Achar32 chv)
Retrieve the BIDI type of an abstract character.
BrushType
BrushType
Definition: gdi.h:4146
GetNextUChar
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.
LANGCODE_bi
@ LANGCODE_bi
Definition: gdi.h:7237
GetAValue
#define GetAValue(rgba)
Get the alpha component from a RGBA quadruple value rgba.
Definition: common.h:897
LoadBitmapEx2
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.
Uint32
unsigned int Uint32
A type definition for a 32-bit unsigned integer.
Definition: common.h:177
UnionRegion
MG_EXPORT BOOL GUIAPI UnionRegion(PCLIPRGN dst, const CLIPRGN *src1, const CLIPRGN *src2)
Unions two regions.
_CLIPRGN::head
PCLIPRECT head
Definition: gdi.h:803
LANGCODE_bo
@ LANGCODE_bo
Definition: gdi.h:7241
LANGCODE_tg
@ LANGCODE_tg
Definition: gdi.h:7451
STRETCH_EXTRA_INFO
struct _STRETCH_EXTRA_INFO STRETCH_EXTRA_INFO
MG_SMOOTH_MAX
@ MG_SMOOTH_MAX
Definition: gdi.h:8173
ClipRectIntersect
MG_EXPORT void GUIAPI ClipRectIntersect(HDC hdc, const RECT *prc)
Intersects the specified rectangle with the visible region of the DC.
LANGCODE_el
@ LANGCODE_el
Definition: gdi.h:7261
_DrmSurfaceInfo::name
uint32_t name
Definition: gdi.h:14466
_DEVFONT::name
char name[LEN_UNIDEVFONT_NAME+1]
Definition: gdi.h:7574
_CLIPRGN
Definition: gdi.h:780
ACHARSHAPETYPE
ACHARSHAPETYPE
Achar32 shape type.
Definition: gdi.h:12456
PolygonIsMonotoneVertical
MG_EXPORT BOOL GUIAPI PolygonIsMonotoneVertical(const POINT *pts, int vertices)
Check a polygon is monotone vertical or not.
IsUCharDigit
MG_EXPORT BOOL GUIAPI IsUCharDigit(Uchar32 uc)
PT_CAP_ROUND
@ PT_CAP_ROUND
Definition: gdi.h:4037
_BITMAP::bmBytesPerPixel
Uint8 bmBytesPerPixel
Definition: gdi.h:11126
CreateLogFontIndirectEx
MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirectEx(LOGFONT *logfont, int rotation)
Creates a new logical font indirectly from a LOGFONT structure with a rotation degrees.
PMYBITMAP
struct _MYBITMAP * PMYBITMAP
Data type of pointer to a struct _MYBITMAP.
Definition: gdi.h:716
UCharIsArabicVowel
MG_EXPORT BOOL GUIAPI UCharIsArabicVowel(Uchar32 uc)
COLOR_BLEND_SP_DIFFERENCE
@ COLOR_BLEND_SP_DIFFERENCE
Definition: gdi.h:5262
GetTextWordInfo
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.
LANGCODE_ms
@ LANGCODE_ms
Definition: gdi.h:7373
_SIZE
Definition: common.h:989
SetDCAttr
MG_EXPORT Uint32 GUIAPI SetDCAttr(HDC hdc, int attr, Uint32 value)
Set a specified attribute value of a DC.
LANGCODE_ss
@ LANGCODE_ss
Definition: gdi.h:7437
LANGCODE_fy
@ LANGCODE_fy
Definition: gdi.h:7283
LANGCODE_he
@ LANGCODE_he
Definition: gdi.h:7299
CreateLogFontIndirect
MG_EXPORT PLOGFONT GUIAPI CreateLogFontIndirect(LOGFONT *logfont)
Creates a logical font indirectly from a LOGFONT structure.
LoadIconFromMem
MG_EXPORT HICON GUIAPI LoadIconFromMem(HDC hdc, const void *area, int which)
Load an icon from a memory area.
UCharToTitle
MG_EXPORT Uchar32 GUIAPI UCharToTitle(Uchar32 uc)
LANGCODE_my
@ LANGCODE_my
Definition: gdi.h:7377
_STIPPLE::bits
const unsigned char * bits
Definition: gdi.h:4211
LANGCODE_iu
@ LANGCODE_iu
Definition: gdi.h:7321
InflateRectToPt
static void InflateRectToPt(RECT *prc, int x, int y)
Inflates a rectangle to contain a point.
Definition: gdi.h:5970
LANGCODE_in
@ LANGCODE_in
Definition: gdi.h:7315
PtInRect
static BOOL PtInRect(const RECT *prc, int x, int y)
Determine whether a point lies within an rectangle.
Definition: gdi.h:5993
_BLOCKHEAP::sz_usage_bmp
size_t sz_usage_bmp
Definition: gdi.h:600
_CLIPRECT::prev
struct _CLIPRECT * prev
Definition: gdi.h:768
LANGCODE_yo
@ LANGCODE_yo
Definition: gdi.h:7491
_BITMAP::bmAlpha
Uint8 bmAlpha
Definition: gdi.h:11128
LANGCODE_kn
@ LANGCODE_kn
Definition: gdi.h:7339
RotateBitmapVFlip
MG_EXPORT void GUIAPI RotateBitmapVFlip(HDC hdc, const BITMAP *bmp, int lx, int ty, int angle)
Flips vertically and rotates a bitmap object.
LANGCODE_jw
@ LANGCODE_jw
Definition: gdi.h:7329
ClipRgnCopy
MG_EXPORT BOOL GUIAPI ClipRgnCopy(PCLIPRGN pDstRgn, const CLIPRGN *pSrcRgn)
Copies one region to another.
Expand16CBitmap
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:11858
GetFontNameInTextRuns
const MG_EXPORT char *GUIAPI GetFontNameInTextRuns(const TEXTRUNS *truns, int index)
_ARC::y
int y
Definition: gdi.h:4337
GetPixelRGBA
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.
_MYBITMAP::transparent
Uint32 transparent
Definition: gdi.h:11064
LANGCODE_kk
@ LANGCODE_kk
Definition: gdi.h:7333
LANGCODE_da
@ LANGCODE_da
Definition: gdi.h:7253
MAKEDWORD32
#define MAKEDWORD32(first, second, third, fourth)
Makes a WORD32 value with four bytes.
Definition: common.h:754
_MYBITMAP
Definition: gdi.h:11024
LANGCODE_mi
@ LANGCODE_mi
Definition: gdi.h:7361
PTCapStyle
PTCapStyle
Definition: gdi.h:4026
IsUCharPrint
MG_EXPORT BOOL GUIAPI IsUCharPrint(Uchar32 uc)
LoadMyBitmapFromFile
MG_EXPORT int GUIAPI LoadMyBitmapFromFile(PMYBITMAP my_bmp, RGB *pal, const char *file_name)
Load a MYBITMAP object from a file.
LANGCODE_zu
@ LANGCODE_zu
Definition: gdi.h:7497
SetPixelRGB
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.
GetNearestColor
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.
LoadBitmapFromMem
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.
_ARC::height
int height
Definition: gdi.h:4342
UBidiShapeArabic
MG_EXPORT void GUIAPI UBidiShapeArabic(Uint32 shaping_flags, const BidiLevel *embedding_levels, int len, BidiArabicProp *ar_props, Uchar32 *ucs)
Do Arabic shaping.
AreRegionsIntersected
static BOOL GUIAPI AreRegionsIntersected(const PCLIPRGN s1, const PCLIPRGN s2)
Determine whether two regions are intersected.
Definition: gdi.h:1118
GetBoundRect
MG_EXPORT void GUIAPI GetBoundRect(PRECT pdrc, const RECT *psrc1, const RECT *psrc2)
Get the bound rectangle of two source rectangles.
SaveBitmapToFile
MG_EXPORT int GUIAPI SaveBitmapToFile(HDC hdc, PBITMAP pBitmap, const char *spFileName)
Saves a BITMAP object to a bitmap file.
COLOR_BLEND_PD_SRC
@ COLOR_BLEND_PD_SRC
Definition: gdi.h:5178
BidiJoiningType
Uint8 BidiJoiningType
Definition: gdi.h:8776
TabbedTextOutLen
MG_EXPORT int GUIAPI TabbedTextOutLen(HDC hdc, int x, int y, const char *spText, int len)
Outputs a formatted text.
UCharGeneralCategory
UCharGeneralCategory
Definition: gdi.h:6708
GetCurFont
MG_EXPORT PLOGFONT GUIAPI GetCurFont(HDC hdc)
Get the pointer to the current logical font of a DC.
FillPolygon
MG_EXPORT BOOL GUIAPI FillPolygon(HDC hdc, const POINT *pts, int vertices)
Fills an polygon.
GLYPHPOS
struct _GLYPHPOS GLYPHPOS
VFlipBitmap
MG_EXPORT void GUIAPI VFlipBitmap(BITMAP *bmp, unsigned char *inter_buff)
Vertical Flip the special Bitmap object.
COLOR_BLEND_PD_SRC_ATOP
@ COLOR_BLEND_PD_SRC_ATOP
Definition: gdi.h:5194
LockDC
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.
PT_JOIN_MITER
@ PT_JOIN_MITER
Definition: gdi.h:4078
GetDC
static HDC GUIAPI GetDC(HWND hWnd)
Get a window DC of a window.
Definition: gdi.h:1490
LANGCODE_aa
@ LANGCODE_aa
Definition: gdi.h:7213
MakeRGBA
#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
LANGCODE_bn
@ LANGCODE_bn
Definition: gdi.h:7239
COLOR_BLEND_PD_MODULATE
@ COLOR_BLEND_PD_MODULATE
Definition: gdi.h:5202
InitBlockDataHeap
MG_EXPORT BOOL InitBlockDataHeap(PBLOCKHEAP heap, size_t bd_size, size_t heap_size)
Initializes a private block data heap.
InitMyBitmapSL
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.
PBLOCKHEAP
BLOCKHEAP * PBLOCKHEAP
Data type of the pointer to a BLOCKHEAP.
Definition: gdi.h:614
drmCreateDCFromNameEx
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)
SetPixelInBitmap
static BOOL GUIAPI SetPixelInBitmap(const BITMAP *bmp, int x, int y, gal_pixel pixel)
Set pixel value in a BITMAP object.
Definition: gdi.h:5619
_RGB::a
BYTE a
Definition: common.h:1029
GetFirstWord
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.
UCharGetVerticalOrientation
MG_EXPORT UVerticalOrient GUIAPI UCharGetVerticalOrientation(Uchar32 uc)
LANGCODE_km
@ LANGCODE_km
Definition: gdi.h:7337
MAKEWORD16
#define MAKEWORD16(low, high)
Makes a 16-bit word from low byte and high byte.
Definition: common.h:745
LANGCODE_ia
@ LANGCODE_ia
Definition: gdi.h:7307
DTFIRSTLINE
struct _DTFIRSTLINE DTFIRSTLINE
LANGCODE_is
@ LANGCODE_is
Definition: gdi.h:7317
NormalizeRect
MG_EXPORT void GUIAPI NormalizeRect(RECT *pRect)
Normalizes a rectangle.
LANGCODE_sw
@ LANGCODE_sw
Definition: gdi.h:7445
LANGCODE_lo
@ LANGCODE_lo
Definition: gdi.h:7353
CLIPRGN
struct _CLIPRGN CLIPRGN
ExpandMyBitmap
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.
IsUCharUppercase
MG_EXPORT BOOL GUIAPI IsUCharUppercase(Uchar32 uc)
LoadDevFontFromIncoreData
MG_EXPORT DEVFONT *GUIAPI LoadDevFontFromIncoreData(const char *devfont_name, const void *data)
Load device font from incore data.
_BLOCKHEAP::usage_bmp
unsigned char * usage_bmp
Definition: gdi.h:605
_WORDINFO::delimiter
unsigned char delimiter
Definition: gdi.h:8453
RotateBitmap
MG_EXPORT void GUIAPI RotateBitmap(HDC hdc, const BITMAP *bmp, int lx, int ty, int angle)
Rotate a bitmap object.
AChar2UChar
MG_EXPORT Uchar32 GUIAPI AChar2UChar(LOGFONT *logfont, Achar32 chv)
Get Uchar32 value (Unicode wide character value) from a LOGFONT abstract character value.
_GLYPHPOS::x_off
int x_off
Definition: gdi.h:13555
TEXTRUNS
struct _TEXTRUNS TEXTRUNS
Definition: gdi.h:13723
GetACharType
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...
LockDCEx
MG_EXPORT BOOL GUIAPI LockDCEx(HDC hdc, const PCLIPRGN region, void *context, CB_DIRECT_DRAW_RECT cb)
directly access the pixels in a DC.
TRUE
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:358
LAYOUTLINE
struct _LAYOUTLINE LAYOUTLINE
Definition: gdi.h:13960
GetShapedAChar
MG_EXPORT Achar32 GUIAPI GetShapedAChar(LOGFONT *logfont, const char *mchar, int mchar_len, ACHARSHAPETYPE shape_type)
Get the glyph shape of a character.
UCharToUpper
MG_EXPORT Uchar32 UCharToUpper(Uchar32 uc)
HPALETTE
GHANDLE HPALETTE
Handle to a logical palette.
Definition: common.h:417
LANGCODE_rm
@ LANGCODE_rm
Definition: gdi.h:7403
Pixel2DWORD
static DWORD Pixel2DWORD(HDC hdc, gal_pixel pixel)
An inline function to convert pixel value to DWORD color.
Definition: gdi.h:3299
CreateTextRuns
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.
COLOR_BLEND_SP_OVERLAY
@ COLOR_BLEND_SP_OVERLAY
Definition: gdi.h:5227
UCharGetMirror
MG_EXPORT BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32 *mirrored)
Get mirrored character.
SplineTo
MG_EXPORT void GUIAPI SplineTo(HDC hdc, const POINT *pts)
Draws a bezier spline.
DestroyDynamicDevFont
MG_EXPORT void GUIAPI DestroyDynamicDevFont(DEVFONT **devfont)
Destroy device font loaded dynamically from font file.
CB_LINE
void(* CB_LINE)(void *context, int stepx, int stepy)
The type of line generator callback.
Definition: gdi.h:3435
RoundRect
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.
LANGCODE_cs
@ LANGCODE_cs
Definition: gdi.h:7249
_STRETCH_EXTRA_INFO::version
int version
Definition: gdi.h:5395
_GLYPHBITMAP::bits
const unsigned char * bits
Definition: gdi.h:7652
_BITMAP
Definition: gdi.h:11088
UCharFullyDecompose
MG_EXPORT int GUIAPI UCharFullyDecompose(Uchar32 ch, BOOL compat, Uchar32 *result, int result_len)
gal_pixel
Uint32 gal_pixel
Data type of pixel value.
Definition: common.h:1106
_RECT::top
int top
Definition: common.h:944
LANGCODE_ky
@ LANGCODE_ky
Definition: gdi.h:7347
LANGCODE_es
@ LANGCODE_es
Definition: gdi.h:7267
IDX_COLOR_darkgreen
@ IDX_COLOR_darkgreen
Definition: gdi.h:151
_BITMAP::bmBits
Uint8 * bmBits
Definition: gdi.h:11141
PBITMAP
BITMAP * PBITMAP
Data type of pointer to a BITMAP.
Definition: gdi.h:701
LANGCODE_tn
@ LANGCODE_tn
Definition: gdi.h:7461
LANGCODE_dv
@ LANGCODE_dv
Definition: gdi.h:7257
ScaleBitmapEx
MG_EXPORT BOOL GUIAPI ScaleBitmapEx(BITMAP *dst, const BITMAP *src, HDC ref_dc)
Scales a BITMAP object into another BITMAP object by specify algorithm.
ARC
struct _ARC ARC
CheckBitmapType
const MG_EXPORT char *GUIAPI CheckBitmapType(MG_RWops *fp)
Check the type of the bitmap in a data source.
CB_ONE_SCANLINE
void(* CB_ONE_SCANLINE)(void *context, MYBITMAP *my_bmp, int y)
The type of scanline loaded callback.
Definition: gdi.h:11177
PtVisible
MG_EXPORT BOOL GUIAPI PtVisible(HDC hdc, int x, int y)
Check whether a point is visible.
_STIPPLE::height
int height
Definition: gdi.h:4202
ScalingFilter
ScalingFilter
Definition: gdi.h:5372
HFlipBitmap
MG_EXPORT void GUIAPI HFlipBitmap(BITMAP *bmp, unsigned char *inter_buff)
Horizontal Flip the special Bitmap object.
ColorLogicalOp
ColorLogicalOp
Definition: gdi.h:5310
UnloadBitmap
MG_EXPORT void GUIAPI UnloadBitmap(PBITMAP pBitmap)
Unloads a bitmap.
LANGCODE_ha
@ LANGCODE_ha
Definition: gdi.h:7295
LANGCODE_fo
@ LANGCODE_fo
Definition: gdi.h:7279
UCharBreakType
UCharBreakType
Definition: gdi.h:6795
CompileRGBABitmapEx
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.
IDX_COLOR_magenta
@ IDX_COLOR_magenta
Definition: gdi.h:173
IsEmptyClipRgn
MG_EXPORT BOOL GUIAPI IsEmptyClipRgn(const CLIPRGN *pRgn)
Determine whether a region is an empty region.
SetRectEmpty
static void SetRectEmpty(RECT *prc)
Empties a rectangle.
Definition: gdi.h:5892
_STIPPLE::width
int width
Definition: gdi.h:4200
FloodFill
MG_EXPORT BOOL GUIAPI FloodFill(HDC hdc, int x, int y)
Fills an enclosed area starting at point (x,y).
OffsetRegion
MG_EXPORT void GUIAPI OffsetRegion(PCLIPRGN region, int x, int y)
Offsets the region.
IsUCharWide
MG_EXPORT BOOL GUIAPI IsUCharWide(Uchar32 uc)
LANGCODE_af
@ LANGCODE_af
Definition: gdi.h:7217
IsUCharXDigit
MG_EXPORT BOOL GUIAPI IsUCharXDigit(Uchar32 uc)
DrawHVDotLine
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.
SetRasterOperation
MG_EXPORT int GUIAPI SetRasterOperation(HDC hdc, int rop)
Set the raster operation of a DC to a new value.
_GLYPHEXTINFO::adv_x
int adv_x
Definition: gdi.h:13513
_FONTMETRICS
Definition: gdi.h:7609
LANGCODE_tt
@ LANGCODE_tt
Definition: gdi.h:7469
BIDIGetTextRangesLog2Vis
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.
LANGCODE_mo
@ LANGCODE_mo
Definition: gdi.h:7369
GetScriptsForLang
const MG_EXPORT ScriptType *GUIAPI GetScriptsForLang(const char *lang_name, LanguageCode *lang_code, int *nr_scripts)
IsUCharMark
MG_EXPORT BOOL GUIAPI IsUCharMark(Uchar32 uc)
GetSecondaryClientDC
static HDC GUIAPI GetSecondaryClientDC(HWND hwnd)
Get a client DC of a window by using the secondary surface if possible.
Definition: gdi.h:2332
LoadBitmapEx
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:11386
drmGetSurfaceInfo
MG_EXPORT BOOL drmGetSurfaceInfo(GHANDLE video, HDC hdc, DrmSurfaceInfo *info)
IsUCharZeroWidth
MG_EXPORT BOOL GUIAPI IsUCharZeroWidth(Uchar32 uc)
InitSlaveScreenEx
MG_EXPORT HDC GUIAPI InitSlaveScreenEx(const char *name, const char *mode, int dpi)
Initializes slave screen.
_DrmSurfaceInfo
Definition: gdi.h:14458
IsUCharDefined
MG_EXPORT BOOL GUIAPI IsUCharDefined(Uchar32 uc)
LANGCODE_sk
@ LANGCODE_sk
Definition: gdi.h:7423
_BITMAP::bmWidth
Uint32 bmWidth
Definition: gdi.h:11135
_DrmSurfaceInfo::prime_fd
int prime_fd
Definition: gdi.h:14463
gal_uint8
Uint8 gal_uint8
Data type of 8-bit unsigned integer.
Definition: common.h:1059
_GLYPHPOS
Definition: gdi.h:13543
PCLIPRGN
CLIPRGN * PCLIPRGN
Data type of the pointer to a CLIPRGN.
Definition: gdi.h:821
IDX_COLOR_transparent
@ IDX_COLOR_transparent
Definition: gdi.h:147
LanguageCodeFromISO639s1
MG_EXPORT LanguageCode GUIAPI LanguageCodeFromISO639s1(Uint16 iso639_1)
Get MiniGUI language code from an encoded ISO639-1 language code.
LPtoSP
MG_EXPORT void GUIAPI LPtoSP(HDC hdc, POINT *pPt)
Converts logical coordinates into screen coordinates.
FillCircle
MG_EXPORT void GUIAPI FillCircle(HDC hdc, int sx, int sy, int r)
Fills a circle.
CreateSecondaryDC
MG_EXPORT HDC GUIAPI CreateSecondaryDC(HWND hwnd)
Creates a secondary DC for a main window.
_LOGFONT::family
char * family
Definition: gdi.h:6482
GetACharsExtent
MG_EXPORT int GUIAPI GetACharsExtent(HDC hdc, Achar32 *achars, int nr_achars, SIZE *size)
Get visual extent value of an achar string.
DeleteMemDC
MG_EXPORT void GUIAPI DeleteMemDC(HDC mem_dc)
Deletes a memory DC.
_GLYPHEXTINFO::suppressed
Uint8 suppressed
Definition: gdi.h:13521
_ARC
Definition: gdi.h:4332
_RECT::left
int left
Definition: common.h:940
RotateScaledBitmap
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.
_BITMAP::bmAlphaPitch
Uint32 bmAlphaPitch
Definition: gdi.h:11151
DWORD32
unsigned int DWORD32
A type definition for a 32-bit unsigned integer.
Definition: common.h:610
FillArcEx
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.
LANGCODE_ga
@ LANGCODE_ga
Definition: gdi.h:7285
InitEllipseRegion
MG_EXPORT BOOL GUIAPI InitEllipseRegion(PCLIPRGN dst, int x, int y, int rx, int ry)
Initializes a region to be an enclosed ellipse.
GetSysFontHeight
MG_EXPORT int GUIAPI GetSysFontHeight(int font_id)
Get the height of a single-byte character of a system font.
LANGCODE_sm
@ LANGCODE_sm
Definition: gdi.h:7427