mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-24 17:44:19 +08:00
fixbug: new DC attribute: bidi_flags
This commit is contained in:
+15
-27
@@ -2009,28 +2009,18 @@ MG_EXPORT void GUIAPI DeleteSecondaryDC (HWND hwnd);
|
||||
|
||||
#define DC_ATTR_TEXT_ALIGN 10
|
||||
|
||||
#define DC_ATTR_BIDI_ENABLED 11
|
||||
#define DC_ATTR_BIDI_FIRSTCH_TYPE 12
|
||||
#define BIDI_CHAR_TYPE_INIT 0
|
||||
#define BIDI_CHAR_TYPE_LTR 1
|
||||
#define BIDI_CHAR_TYPE_RTL 2
|
||||
#define DC_ATTR_BIDI_FLAGS 11
|
||||
|
||||
#ifdef _MGHAVE_ADV_2DAPI
|
||||
|
||||
#define DC_ATTR_PEN_TYPE 13
|
||||
#define DC_ATTR_PEN_CAP_STYLE 14
|
||||
#define DC_ATTR_PEN_JOIN_STYLE 15
|
||||
#define DC_ATTR_PEN_WIDTH 16
|
||||
|
||||
#define DC_ATTR_BRUSH_TYPE 17
|
||||
|
||||
#define NR_DC_ATTRS 18
|
||||
|
||||
#else
|
||||
|
||||
#define NR_DC_ATTRS 13
|
||||
|
||||
#endif
|
||||
# define DC_ATTR_PEN_TYPE 12
|
||||
# define DC_ATTR_PEN_CAP_STYLE 13
|
||||
# define DC_ATTR_PEN_JOIN_STYLE 14
|
||||
# define DC_ATTR_PEN_WIDTH 15
|
||||
# define DC_ATTR_BRUSH_TYPE 16
|
||||
# define NR_DC_ATTRS 17
|
||||
#else /* _MGHAVE_ADV_2DAPI */
|
||||
# define NR_DC_ATTRS 12
|
||||
#endif /* !_MGHAVE_ADV_2DAPI */
|
||||
|
||||
|
||||
/**
|
||||
@@ -7016,16 +7006,14 @@ MG_EXPORT int GUIAPI GetTabbedTextExtent (HDC hdc,
|
||||
*
|
||||
* \sa GetTextAlign
|
||||
*/
|
||||
#define SetTextAlign(hdc, ta_flags) \
|
||||
#define SetTextAlign(hdc, ta_flags) \
|
||||
SetDCAttr (hdc, DC_ATTR_TEXT_ALIGN, (DWORD)ta_flags)
|
||||
|
||||
#define GetBIDIFlag(hdc) GetDCAttr (hdc, DC_ATTR_BIDI_ENABLED)
|
||||
#define SetBIDIFlag(hdc, bidi) \
|
||||
SetDCAttr (hdc, DC_ATTR_BIDI_ENABLED, (DWORD)bidi)
|
||||
#define GetBIDIFlags(hdc) \
|
||||
GetDCAttr (hdc, DC_ATTR_BIDI_FLAGS)
|
||||
|
||||
#define GetBIDIFirstChType(hdc) GetDCAttr (hdc, DC_ATTR_BIDI_FIRSTCH_TYPE)
|
||||
#define SetBIDIFirstChType(hdc, type) \
|
||||
SetDCAttr (hdc, DC_ATTR_BIDI_FIRSTCH_TYPE, (DWORD)type)
|
||||
#define SetBIDIFlags(hdc, bidi_flags) \
|
||||
SetDCAttr (hdc, DC_ATTR_BIDI_FLAGS, (DWORD)bidi)
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI TextOutLen (HDC hdc, int x, int y, \
|
||||
|
||||
+1
-2
@@ -166,8 +166,7 @@ struct tagDC
|
||||
|
||||
int ta_flags; /* Text alignment flags */
|
||||
|
||||
int bidi_flag; /* BIDI enable flag */
|
||||
int bidi_firstch_type; /* BIDI first char type */
|
||||
int bidi_flags; /* BIDI flags */
|
||||
|
||||
#ifdef _MGHAVE_ADV_2DAPI
|
||||
/* pen attributes */
|
||||
|
||||
+5
-3
@@ -1733,6 +1733,7 @@ static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient)
|
||||
|
||||
pdc->mapmode = MM_TEXT;
|
||||
pdc->ta_flags = TA_LEFT | TA_TOP | TA_NOUPDATECP;
|
||||
pdc->bidi_flags = 0;
|
||||
|
||||
pdc->ViewOrig.x = pdc->ViewOrig.y = 0;
|
||||
pdc->ViewExtent.x = pdc->ViewExtent.y = 1;
|
||||
@@ -1828,7 +1829,7 @@ static void dc_InitMemDCFrom (PDC pdc, const PDC pdc_ref)
|
||||
|
||||
/* copy attributes from reference DC */
|
||||
memcpy (&pdc->bkcolor, &pdc_ref->bkcolor,
|
||||
sizeof (gal_pixel)*4 + sizeof (int)*7);
|
||||
sizeof (gal_pixel)*4 + sizeof (int)*8);
|
||||
#ifdef _MGHAVE_ADV_2DAPI
|
||||
memcpy (&pdc->pen_type, &pdc_ref->pen_type,
|
||||
(sizeof(int)*7) + sizeof(POINT) + (sizeof (void*)*3));
|
||||
@@ -1894,6 +1895,7 @@ static void dc_InitScreenDC (PDC pdc, GAL_Surface *surface)
|
||||
|
||||
pdc->mapmode = MM_TEXT;
|
||||
pdc->ta_flags = TA_LEFT | TA_TOP | TA_NOUPDATECP;
|
||||
pdc->bidi_flags = 0;
|
||||
|
||||
pdc->ViewOrig.x = pdc->ViewOrig.y = 0;
|
||||
pdc->ViewExtent.x = pdc->ViewExtent.y = 1;
|
||||
@@ -3425,8 +3427,8 @@ HWND GUIAPI WindowFromDC (HDC hdc)
|
||||
typedef struct _DCSTATE
|
||||
{
|
||||
GAL_Color bkcolor, pencolor, brushcolor, textcolor;
|
||||
/* bkmode, tabstop, cExtra, alExtra, blExtra, mapmode, ta_flags */
|
||||
char attrs_g1 [sizeof(int)*7];
|
||||
/* bkmode, tabstop, cExtra, alExtra, blExtra, mapmode, ta_flags, bidi_flags */
|
||||
char attrs_g1 [sizeof(int)*8];
|
||||
|
||||
#ifdef _MGHAVE_ADV_2DAPI
|
||||
/*
|
||||
|
||||
@@ -530,7 +530,7 @@ int GUIAPI GetTabbedTextExtentPoint (HDC hdc, const char* text,
|
||||
size->cx = size->cy = 0;
|
||||
|
||||
/* This function does not support BIDI */
|
||||
if (mbc_devfont && pdc->bidi_flag && mbc_devfont->charset_ops->bidi_glyph_type)
|
||||
if (mbc_devfont && pdc->bidi_flags && mbc_devfont->charset_ops->bidi_glyph_type)
|
||||
return -1;
|
||||
|
||||
_gdi_start_new_line (pdc);
|
||||
|
||||
@@ -463,7 +463,7 @@ int GUIAPI GetTextExtentPoint (HDC hdc, const char* text, int len,
|
||||
size->cx = size->cy = 0;
|
||||
|
||||
/* This function does not support BIDI */
|
||||
if (mbc_devfont && pdc->bidi_flag && mbc_devfont->charset_ops->bidi_glyph_type)
|
||||
if (mbc_devfont && pdc->bidi_flags && mbc_devfont->charset_ops->bidi_glyph_type)
|
||||
return -1;
|
||||
|
||||
_gdi_start_new_line(pdc);
|
||||
|
||||
Reference in New Issue
Block a user