winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
1051 discussions
Start a n
N
ew thread
Jacek Caban : gdi32: Use NtGdiHfontCreate for CreateFont* functions.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: 75786478c67a49c7ab960452fc5b1fd23b76051c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=75786478c67a49c7ab960452…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 20 10:42:44 2021 +0200 gdi32: Use NtGdiHfontCreate for CreateFont* functions. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/font.c | 129 ++------------------------------------------------ dlls/gdi32/text.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 126 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=75786478c67a49c7ab96…
1
0
0
0
Jacek Caban : gdi32: Store font code page in DC_ATTR.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: 7ad7ec5b8b903733bc521cfdc1200bf4d76fb182 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7ad7ec5b8b903733bc521cfd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 20 10:42:24 2021 +0200 gdi32: Store font code page in DC_ATTR. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/dc.c | 2 +- dlls/gdi32/font.c | 28 ++++++---------------------- dlls/gdi32/ntgdi_private.h | 1 - dlls/gdi32/text.c | 9 +++++++++ include/ntgdi.h | 1 + 5 files changed, 17 insertions(+), 24 deletions(-) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 51b754d1ccd..e4f643389d5 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -80,8 +80,8 @@ static void set_initial_dc_state( DC *dc ) dc->attr->vport_ext.cy = 1; dc->attr->miter_limit = 10.0f; /* 10.0 is the default, from MSDN */ dc->attr->layout = 0; - dc->font_code_page = CP_ACP; dc->attr->rop_mode = R2_COPYPEN; + dc->attr->font_code_page = CP_ACP; dc->attr->poly_fill_mode = ALTERNATE; dc->attr->stretch_blt_mode = BLACKONWHITE; dc->attr->rel_abs_mode = ABSOLUTE; diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index bfb27ccd1af..e267190fb64 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -4163,22 +4163,6 @@ static BOOL get_char_positions_indices( DC *dc, const WORD *indices, INT count, return TRUE; } -/*********************************************************************** - * GdiGetCodePage (GDI32.@) - */ -DWORD WINAPI GdiGetCodePage( HDC hdc ) -{ - UINT cp = CP_ACP; - DC *dc = get_dc_ptr( hdc ); - - if (dc) - { - cp = dc->font_code_page; - release_dc_ptr( dc ); - } - return cp; -} - /*********************************************************************** * get_text_charset_info * @@ -4457,14 +4441,14 @@ static void update_font_code_page( DC *dc, HANDLE font ) /* Hmm, nicely designed api this one! */ if (TranslateCharsetInfo( ULongToPtr(charset), &csi, TCI_SRCCHARSET) ) - dc->font_code_page = csi.ciACP; + dc->attr->font_code_page = csi.ciACP; else { switch(charset) { case OEM_CHARSET: - dc->font_code_page = GetOEMCP(); + dc->attr->font_code_page = GetOEMCP(); break; case DEFAULT_CHARSET: - dc->font_code_page = GetACP(); + dc->attr->font_code_page = GetACP(); break; case VISCII_CHARSET: @@ -4481,17 +4465,17 @@ static void update_font_code_page( DC *dc, HANDLE font ) each of these, but since it's broken anyway we'll just use CP_ACP and hope it'll go away... */ - dc->font_code_page = CP_ACP; + dc->attr->font_code_page = CP_ACP; break; default: FIXME("Can't find codepage for charset %d\n", charset); - dc->font_code_page = CP_ACP; + dc->attr->font_code_page = CP_ACP; break; } } - TRACE("charset %d => cp %d\n", charset, dc->font_code_page); + TRACE( "charset %d => cp %d\n", charset, dc->attr->font_code_page ); } /*********************************************************************** diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h index 522bd51b6cc..91230666fad 100644 --- a/dlls/gdi32/ntgdi_private.h +++ b/dlls/gdi32/ntgdi_private.h @@ -99,7 +99,6 @@ typedef struct tagDC const struct font_gamma_ramp *font_gamma_ramp; - UINT font_code_page; INT breakExtra; /* breakTotalExtra / breakCount */ INT breakRem; /* breakTotalExtra % breakCount */ ABORTPROC pAbortProc; /* AbortProc for Printing */ diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 2d3902d2433..ffbc9806e78 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -737,6 +737,15 @@ static void text_metric_WtoA( const TEXTMETRICW *tmW, TEXTMETRICA *tmA ) tmA->tmCharSet = tmW->tmCharSet; } +/*********************************************************************** + * GdiGetCodePage (GDI32.@) + */ +DWORD WINAPI GdiGetCodePage( HDC hdc ) +{ + DC_ATTR *dc_attr = get_dc_attr( hdc ); + return dc_attr ? dc_attr->font_code_page : CP_ACP; +} + /*********************************************************************** * ExtTextOutW (GDI32.@) */ diff --git a/include/ntgdi.h b/include/ntgdi.h index 52eb0767617..14808593501 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -156,6 +156,7 @@ typedef struct DC_ATTR SIZE vport_ext; /* viewport extent */ SIZE virtual_res; SIZE virtual_size; + UINT font_code_page; void *emf; } DC_ATTR;
1
0
0
0
Jacek Caban : gdi32: Use NtGdiGetTextMetricsW for GetTextMetrics.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: 6caf861a63403dd2a0b58237271d89cbc58af171 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6caf861a63403dd2a0b58237…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 20 10:42:10 2021 +0200 gdi32: Use NtGdiGetTextMetricsW for GetTextMetrics. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/font.c | 16 ++------------- dlls/gdi32/text.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 14 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 029990bf847..bfb27ccd1af 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -4820,21 +4820,9 @@ BOOL WINAPI NtGdiGetTextExtentExW( HDC hdc, const WCHAR *str, INT count, INT max } /*********************************************************************** - * GetTextMetricsA (GDI32.@) + * NtGdiGetTextMetricsW (win32u.@) */ -BOOL WINAPI GetTextMetricsA( HDC hdc, TEXTMETRICA *metrics ) -{ - TEXTMETRICW tm32; - - if (!GetTextMetricsW( hdc, &tm32 )) return FALSE; - FONT_TextMetricWToA( &tm32, metrics ); - return TRUE; -} - -/*********************************************************************** - * GetTextMetricsW (GDI32.@) - */ -BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics ) +BOOL WINAPI NtGdiGetTextMetricsW( HDC hdc, TEXTMETRICW *metrics, ULONG flags ) { PHYSDEV physdev; BOOL ret = FALSE; diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 86b58555ad5..2d3902d2433 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -699,6 +699,44 @@ static WCHAR *text_mbtowc( HDC hdc, const char *str, INT count, INT *plenW, UINT return strW; } +static void text_metric_WtoA( const TEXTMETRICW *tmW, TEXTMETRICA *tmA ) +{ + tmA->tmHeight = tmW->tmHeight; + tmA->tmAscent = tmW->tmAscent; + tmA->tmDescent = tmW->tmDescent; + tmA->tmInternalLeading = tmW->tmInternalLeading; + tmA->tmExternalLeading = tmW->tmExternalLeading; + tmA->tmAveCharWidth = tmW->tmAveCharWidth; + tmA->tmMaxCharWidth = tmW->tmMaxCharWidth; + tmA->tmWeight = tmW->tmWeight; + tmA->tmOverhang = tmW->tmOverhang; + tmA->tmDigitizedAspectX = tmW->tmDigitizedAspectX; + tmA->tmDigitizedAspectY = tmW->tmDigitizedAspectY; + tmA->tmFirstChar = min( tmW->tmFirstChar, 255 ); + if (tmW->tmCharSet == SYMBOL_CHARSET) + { + tmA->tmFirstChar = 0x1e; + tmA->tmLastChar = 0xff; /* win9x behaviour - we need the OS2 table data to calculate correctly */ + } + else if (tmW->tmPitchAndFamily & TMPF_TRUETYPE) + { + tmA->tmFirstChar = tmW->tmDefaultChar - 1; + tmA->tmLastChar = min( tmW->tmLastChar, 0xff ); + } + else + { + tmA->tmFirstChar = min( tmW->tmFirstChar, 0xff ); + tmA->tmLastChar = min( tmW->tmLastChar, 0xff ); + } + tmA->tmDefaultChar = tmW->tmDefaultChar; + tmA->tmBreakChar = tmW->tmBreakChar; + tmA->tmItalic = tmW->tmItalic; + tmA->tmUnderlined = tmW->tmUnderlined; + tmA->tmStruckOut = tmW->tmStruckOut; + tmA->tmPitchAndFamily = tmW->tmPitchAndFamily; + tmA->tmCharSet = tmW->tmCharSet; +} + /*********************************************************************** * ExtTextOutW (GDI32.@) */ @@ -1183,3 +1221,23 @@ BOOL WINAPI GetTextExtentPointW( HDC hdc, const WCHAR *str, INT count, SIZE *siz { return GetTextExtentPoint32W( hdc, str, count, size ); } + +/*********************************************************************** + * GetTextMetricsW (GDI32.@) + */ +BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics ) +{ + return NtGdiGetTextMetricsW( hdc, metrics, 0 ); +} + +/*********************************************************************** + * GetTextMetricsA (GDI32.@) + */ +BOOL WINAPI GetTextMetricsA( HDC hdc, TEXTMETRICA *metrics ) +{ + TEXTMETRICW tm32; + + if (!GetTextMetricsW( hdc, &tm32 )) return FALSE; + text_metric_WtoA( &tm32, metrics ); + return TRUE; +}
1
0
0
0
Jacek Caban : gdi32: Use NtGdiGetTextExtentExPointW for GetTextExtentExPoint.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: c0486678ebb55cbb8beeed6cbbe59021daf205a8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c0486678ebb55cbb8beeed6c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 20 10:41:56 2021 +0200 gdi32: Use NtGdiGetTextExtentExPointW for GetTextExtentExPoint. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/font.c | 215 +++--------------------------------------------------- dlls/gdi32/text.c | 95 ++++++++++++++++++++++++ include/ntgdi.h | 4 +- 3 files changed, 107 insertions(+), 207 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c0486678ebb55cbb8bee…
1
0
0
0
Jacek Caban : gdi32: Use NtGdiGetTextFaceW for GetTextFace.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: ff36618c969d46e6203ce66d053224b11dc6ee4a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ff36618c969d46e6203ce66d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 20 10:41:32 2021 +0200 gdi32: Use NtGdiGetTextFaceW for GetTextFace. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/font.c | 33 ++------------------------------- dlls/gdi32/text.c | 36 ++++++++++++++++++++++++++++++++++++ include/ntgdi.h | 2 +- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 4d6f11d5080..ba1da3b11a9 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -4743,38 +4743,9 @@ BOOL WINAPI NtGdiSetTextJustification( HDC hdc, INT extra, INT breaks ) /*********************************************************************** - * GetTextFaceA (GDI32.@) + * NtGdiGetTextFaceW (win32u.@) */ -INT WINAPI GetTextFaceA( HDC hdc, INT count, LPSTR name ) -{ - INT res = GetTextFaceW(hdc, 0, NULL); - LPWSTR nameW = HeapAlloc( GetProcessHeap(), 0, res * 2 ); - GetTextFaceW( hdc, res, nameW ); - - if (name) - { - if (count) - { - res = WideCharToMultiByte(CP_ACP, 0, nameW, -1, name, count, NULL, NULL); - if (res == 0) - res = count; - name[count-1] = 0; - /* GetTextFaceA does NOT include the nul byte in the return count. */ - res--; - } - else - res = 0; - } - else - res = WideCharToMultiByte( CP_ACP, 0, nameW, -1, NULL, 0, NULL, NULL); - HeapFree( GetProcessHeap(), 0, nameW ); - return res; -} - -/*********************************************************************** - * GetTextFaceW (GDI32.@) - */ -INT WINAPI GetTextFaceW( HDC hdc, INT count, LPWSTR name ) +INT WINAPI NtGdiGetTextFaceW( HDC hdc, INT count, WCHAR *name, BOOL alias_name ) { PHYSDEV dev; INT ret; diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 82bf709fe19..d8cd4fb0dda 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1052,3 +1052,39 @@ DWORD WINAPI GetCharacterPlacementA( HDC hdc, const char *str, INT count, INT ma HeapFree( GetProcessHeap(), 0, resultsW.lpOutString ); return ret; } + +/*********************************************************************** + * GetTextFaceA (GDI32.@) + */ +INT WINAPI GetTextFaceA( HDC hdc, INT count, char *name ) +{ + INT res = GetTextFaceW( hdc, 0, NULL ); + WCHAR *nameW = HeapAlloc( GetProcessHeap(), 0, res * sizeof(WCHAR) ); + + GetTextFaceW( hdc, res, nameW ); + if (name) + { + if (count) + { + res = WideCharToMultiByte( CP_ACP, 0, nameW, -1, name, count, NULL, NULL ); + if (res == 0) res = count; + name[count - 1] = 0; + /* GetTextFaceA does NOT include the nul byte in the return count. */ + res--; + } + else + res = 0; + } + else + res = WideCharToMultiByte( CP_ACP, 0, nameW, -1, NULL, 0, NULL, NULL ); + HeapFree( GetProcessHeap(), 0, nameW ); + return res; +} + +/*********************************************************************** + * GetTextFaceW (GDI32.@) + */ +INT WINAPI GetTextFaceW( HDC hdc, INT count, WCHAR *name ) +{ + return NtGdiGetTextFaceW( hdc, count, name, FALSE ); +} diff --git a/include/ntgdi.h b/include/ntgdi.h index cfcbce43fed..fd552cfa26d 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -238,7 +238,7 @@ DWORD WINAPI NtGdiGetRegionData( HRGN hrgn, DWORD count, RGNDATA *data ); INT WINAPI NtGdiGetRgnBox( HRGN hrgn, RECT *rect ); UINT WINAPI NtGdiGetSystemPaletteUse( HDC hdc ); UINT WINAPI NtGdiGetTextCharsetInfo( HDC hdc, FONTSIGNATURE *fs, DWORD flags ); -INT WINAPI NtGdiGetTextFaceW( HDC hdc, INT count, WCHAR *name ); +INT WINAPI NtGdiGetTextFaceW( HDC hdc, INT count, WCHAR *name, BOOL alias_name ); BOOL WINAPI NtGdiGetTextMetricsW( HDC hdc, TEXTMETRICW *metrics ); BOOL WINAPI NtGdiGetTransform( HDC hdc, DWORD which, XFORM *xform ); BOOL WINAPI NtGdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
1
0
0
0
Jacek Caban : gdi32: Move GetCharacterPlacementA to text.c.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: e27c61be21a5abca5520b3e539a1f9bf112c69be URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e27c61be21a5abca5520b3e5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 20 10:41:13 2021 +0200 gdi32: Move GetCharacterPlacementA to text.c. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/font.c | 53 ----------------------------------------------------- dlls/gdi32/text.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 53 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 6905d21751b..4d6f11d5080 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -6937,59 +6937,6 @@ DWORD WINAPI GetGlyphIndicesW(HDC hdc, LPCWSTR lpstr, INT count, return ret; } -/************************************************************************* - * GetCharacterPlacementA [GDI32.@] - * - * See GetCharacterPlacementW. - * - * NOTES: - * the web browser control of ie4 calls this with dwFlags=0 - */ -DWORD WINAPI -GetCharacterPlacementA(HDC hdc, LPCSTR lpString, INT uCount, - INT nMaxExtent, GCP_RESULTSA *lpResults, - DWORD dwFlags) -{ - WCHAR *lpStringW; - INT uCountW; - GCP_RESULTSW resultsW; - DWORD ret; - UINT font_cp; - - TRACE("%s, %d, %d, 0x%08x\n", - debugstr_an(lpString, uCount), uCount, nMaxExtent, dwFlags); - - lpStringW = FONT_mbtowc(hdc, lpString, uCount, &uCountW, &font_cp); - - if (!lpResults) - { - ret = GetCharacterPlacementW(hdc, lpStringW, uCountW, nMaxExtent, NULL, dwFlags); - HeapFree(GetProcessHeap(), 0, lpStringW); - return ret; - } - - /* both structs are equal in size */ - memcpy(&resultsW, lpResults, sizeof(resultsW)); - - if(lpResults->lpOutString) - resultsW.lpOutString = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*uCountW); - - ret = GetCharacterPlacementW(hdc, lpStringW, uCountW, nMaxExtent, &resultsW, dwFlags); - - lpResults->nGlyphs = resultsW.nGlyphs; - lpResults->nMaxFit = resultsW.nMaxFit; - - if(lpResults->lpOutString) { - WideCharToMultiByte(font_cp, 0, resultsW.lpOutString, uCountW, - lpResults->lpOutString, uCount, NULL, NULL ); - } - - HeapFree(GetProcessHeap(), 0, lpStringW); - HeapFree(GetProcessHeap(), 0, resultsW.lpOutString); - - return ret; -} - /************************************************************************* * GetCharABCWidthsFloatA [GDI32.@] * diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 66a51e89817..82bf709fe19 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1009,3 +1009,46 @@ DWORD WINAPI GetCharacterPlacementW( HDC hdc, const WCHAR *str, INT count, INT m HeapFree( GetProcessHeap(), 0, kern ); return ret; } + +/************************************************************************* + * GetCharacterPlacementA (GDI32.@) + */ +DWORD WINAPI GetCharacterPlacementA( HDC hdc, const char *str, INT count, INT max_extent, + GCP_RESULTSA *result, DWORD flags ) +{ + GCP_RESULTSW resultsW; + WCHAR *strW; + INT countW; + DWORD ret; + UINT font_cp; + + TRACE( "%s, %d, %d, 0x%08x\n", debugstr_an(str, count), count, max_extent, flags ); + + strW = text_mbtowc( hdc, str, count, &countW, &font_cp ); + + if (!result) + { + ret = GetCharacterPlacementW( hdc, strW, countW, max_extent, NULL, flags ); + HeapFree( GetProcessHeap(), 0, strW ); + return ret; + } + + /* both structs are equal in size */ + memcpy( &resultsW, result, sizeof(resultsW) ); + + if (result->lpOutString) + resultsW.lpOutString = HeapAlloc( GetProcessHeap(), 0, sizeof(WCHAR) * countW ); + + ret = GetCharacterPlacementW( hdc, strW, countW, max_extent, &resultsW, flags ); + + result->nGlyphs = resultsW.nGlyphs; + result->nMaxFit = resultsW.nMaxFit; + + if (result->lpOutString) + WideCharToMultiByte( font_cp, 0, resultsW.lpOutString, countW, + result->lpOutString, count, NULL, NULL ); + + HeapFree( GetProcessHeap(), 0, strW ); + HeapFree( GetProcessHeap(), 0, resultsW.lpOutString ); + return ret; +}
1
0
0
0
Jacek Caban : gdi32: Move ExtTextOutW wrappers to text.c.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: cd60db086a4c96df797fb81b7e5461f286b99531 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cd60db086a4c96df797fb81b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 20 10:41:01 2021 +0200 gdi32: Move ExtTextOutW wrappers to text.c. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/font.c | 111 ---------------------------------------------- dlls/gdi32/text.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 111 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 359ebfbc0bd..6905d21751b 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5748,66 +5748,6 @@ BOOL CDECL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT return TRUE; } - -/*********************************************************************** - * ExtTextOutA (GDI32.@) - * - * See ExtTextOutW. - */ -BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags, - const RECT *lprect, LPCSTR str, UINT count, const INT *lpDx ) -{ - INT wlen; - UINT codepage; - LPWSTR p; - BOOL ret; - LPINT lpDxW = NULL; - - if (count > INT_MAX) return FALSE; - - if (flags & ETO_GLYPH_INDEX) - return ExtTextOutW( hdc, x, y, flags, lprect, (LPCWSTR)str, count, lpDx ); - - p = FONT_mbtowc(hdc, str, count, &wlen, &codepage); - - if (lpDx) { - unsigned int i = 0, j = 0; - - /* allocate enough for a ETO_PDY */ - lpDxW = HeapAlloc( GetProcessHeap(), 0, 2*wlen*sizeof(INT)); - while(i < count) { - if(IsDBCSLeadByteEx(codepage, str[i])) - { - if(flags & ETO_PDY) - { - lpDxW[j++] = lpDx[i * 2] + lpDx[(i + 1) * 2]; - lpDxW[j++] = lpDx[i * 2 + 1] + lpDx[(i + 1) * 2 + 1]; - } - else - lpDxW[j++] = lpDx[i] + lpDx[i + 1]; - i = i + 2; - } - else - { - if(flags & ETO_PDY) - { - lpDxW[j++] = lpDx[i * 2]; - lpDxW[j++] = lpDx[i * 2 + 1]; - } - else - lpDxW[j++] = lpDx[i]; - i = i + 1; - } - } - } - - ret = ExtTextOutW( hdc, x, y, flags, lprect, p, wlen, lpDxW ); - - HeapFree( GetProcessHeap(), 0, p ); - HeapFree( GetProcessHeap(), 0, lpDxW ); - return ret; -} - /*********************************************************************** * get_line_width * @@ -6213,57 +6153,6 @@ done: } -/*********************************************************************** - * TextOutA (GDI32.@) - */ -BOOL WINAPI TextOutA( HDC hdc, INT x, INT y, LPCSTR str, INT count ) -{ - return ExtTextOutA( hdc, x, y, 0, NULL, str, count, NULL ); -} - - -/*********************************************************************** - * TextOutW (GDI32.@) - */ -BOOL WINAPI TextOutW(HDC hdc, INT x, INT y, LPCWSTR str, INT count) -{ - return ExtTextOutW( hdc, x, y, 0, NULL, str, count, NULL ); -} - - -/*********************************************************************** - * PolyTextOutA (GDI32.@) - * - * See PolyTextOutW. - */ -BOOL WINAPI PolyTextOutA( HDC hdc, const POLYTEXTA *pptxt, INT cStrings ) -{ - for (; cStrings>0; cStrings--, pptxt++) - if (!ExtTextOutA( hdc, pptxt->x, pptxt->y, pptxt->uiFlags, &pptxt->rcl, pptxt->lpstr, pptxt->n, pptxt->pdx )) - return FALSE; - return TRUE; -} - - - -/*********************************************************************** - * PolyTextOutW (GDI32.@) - * - * Draw several Strings - * - * RETURNS - * TRUE: Success. - * FALSE: Failure. - */ -BOOL WINAPI PolyTextOutW( HDC hdc, const POLYTEXTW *pptxt, INT cStrings ) -{ - for (; cStrings>0; cStrings--, pptxt++) - if (!ExtTextOutW( hdc, pptxt->x, pptxt->y, pptxt->uiFlags, &pptxt->rcl, pptxt->lpstr, pptxt->n, pptxt->pdx )) - return FALSE; - return TRUE; -} - - /*********************************************************************** * GetAspectRatioFilterEx (GDI32.@) */ diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 156cb3986aa..66a51e89817 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -669,6 +669,36 @@ cleanup: return ret; } +/*********************************************************************** + * text_mbtowc + * + * Returns a Unicode translation of str using the charset of the + * currently selected font in hdc. If count is -1 then str is assumed + * to be '\0' terminated, otherwise it contains the number of bytes to + * convert. If plenW is non-NULL, on return it will point to the + * number of WCHARs that have been written. If ret_cp is non-NULL, on + * return it will point to the codepage used in the conversion. The + * caller should free the returned string from the process heap + * itself. + */ +static WCHAR *text_mbtowc( HDC hdc, const char *str, INT count, INT *plenW, UINT *ret_cp ) +{ + UINT cp; + INT lenW; + LPWSTR strW; + + cp = GdiGetCodePage( hdc ); + + if (count == -1) count = strlen( str ); + lenW = MultiByteToWideChar( cp, 0, str, count, NULL, 0 ); + strW = HeapAlloc( GetProcessHeap(), 0, lenW * sizeof(WCHAR) ); + MultiByteToWideChar( cp, 0, str, count, strW, lenW ); + TRACE( "mapped %s -> %s\n", debugstr_an(str, count), debugstr_wn(strW, lenW) ); + if (plenW) *plenW = lenW; + if (ret_cp) *ret_cp = cp; + return strW; +} + /*********************************************************************** * ExtTextOutW (GDI32.@) */ @@ -711,6 +741,104 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect, return ret; } +/*********************************************************************** + * ExtTextOutA (GDI32.@) + */ +BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags, const RECT *rect, + const char *str, UINT count, const INT *dx ) +{ + INT wlen; + UINT codepage; + WCHAR *p; + BOOL ret; + INT *dxW = NULL; + + if (count > INT_MAX) return FALSE; + + if (flags & ETO_GLYPH_INDEX) + return ExtTextOutW( hdc, x, y, flags, rect, (const WCHAR *)str, count, dx ); + + p = text_mbtowc( hdc, str, count, &wlen, &codepage ); + + if (dx) + { + unsigned int i = 0, j = 0; + + /* allocate enough for a ETO_PDY */ + dxW = HeapAlloc( GetProcessHeap(), 0, 2 * wlen * sizeof(INT) ); + while (i < count) + { + if (IsDBCSLeadByteEx( codepage, str[i] )) + { + if (flags & ETO_PDY) + { + dxW[j++] = dx[i * 2] + dx[(i + 1) * 2]; + dxW[j++] = dx[i * 2 + 1] + dx[(i + 1) * 2 + 1]; + } + else + dxW[j++] = dx[i] + dx[i + 1]; + i = i + 2; + } + else + { + if (flags & ETO_PDY) + { + dxW[j++] = dx[i * 2]; + dxW[j++] = dx[i * 2 + 1]; + } + else + dxW[j++] = dx[i]; + i = i + 1; + } + } + } + + ret = ExtTextOutW( hdc, x, y, flags, rect, p, wlen, dxW ); + + HeapFree( GetProcessHeap(), 0, p ); + HeapFree( GetProcessHeap(), 0, dxW ); + return ret; +} + +/*********************************************************************** + * TextOutA (GDI32.@) + */ +BOOL WINAPI TextOutA( HDC hdc, INT x, INT y, const char *str, INT count ) +{ + return ExtTextOutA( hdc, x, y, 0, NULL, str, count, NULL ); +} + +/*********************************************************************** + * TextOutW (GDI32.@) + */ +BOOL WINAPI TextOutW( HDC hdc, INT x, INT y, const WCHAR *str, INT count ) +{ + return ExtTextOutW( hdc, x, y, 0, NULL, str, count, NULL ); +} + + +/*********************************************************************** + * PolyTextOutA (GDI32.@) + */ +BOOL WINAPI PolyTextOutA( HDC hdc, const POLYTEXTA *pt, INT count ) +{ + for (; count>0; count--, pt++) + if (!ExtTextOutA( hdc, pt->x, pt->y, pt->uiFlags, &pt->rcl, pt->lpstr, pt->n, pt->pdx )) + return FALSE; + return TRUE; +} + +/*********************************************************************** + * PolyTextOutW (GDI32.@) + */ +BOOL WINAPI PolyTextOutW( HDC hdc, const POLYTEXTW *pt, INT count ) +{ + for (; count>0; count--, pt++) + if (!ExtTextOutW( hdc, pt->x, pt->y, pt->uiFlags, &pt->rcl, pt->lpstr, pt->n, pt->pdx )) + return FALSE; + return TRUE; +} + static int kern_pair( const KERNINGPAIR *kern, int count, WCHAR c1, WCHAR c2 ) { int i;
1
0
0
0
Gerald Pfeifer : nsiproxy: Add $(PROCSTAT_LIBS) to EXTRALIBS.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: c5d9f2f7c665700f183b81201151ab2096594841 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c5d9f2f7c665700f183b8120…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Thu Aug 19 11:09:00 2021 +0200 nsiproxy: Add $(PROCSTAT_LIBS) to EXTRALIBS. We try to use libprocstat on non-Linux platforms and detect its presence in the configure phase. Make sure we actually link this library in that case by adding $(PROCSTAT_LIBS) to EXTRALIBS. Signed-off-by: Gerald Pfeifer <gerald(a)pfeifer.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/nsiproxy.sys/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/nsiproxy.sys/Makefile.in b/dlls/nsiproxy.sys/Makefile.in index cee4b72c33f..183a6374144 100644 --- a/dlls/nsiproxy.sys/Makefile.in +++ b/dlls/nsiproxy.sys/Makefile.in @@ -1,5 +1,6 @@ MODULE = nsiproxy.sys IMPORTS = ntoskrnl uuid +EXTRALIBS = $(PROCSTAT_LIBS) EXTRADLLFLAGS = -Wl,--subsystem,native C_SRCS = \
1
0
0
0
Gerald Pfeifer : nsiproxy: Include sys/types.h from udp.c.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: 070185c3412d3e1802248e9aa1a600863a85ae7c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=070185c3412d3e1802248e9a…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Thu Aug 19 08:39:27 2021 +0200 nsiproxy: Include sys/types.h from udp.c. This addresses failures like In file included from dlls/nsiproxy.sys/udp.c:34: In file included from /usr/include/sys/socketvar.h:38: In file included from /usr/include/sys/selinfo.h:36: /usr/include/sys/event.h:77:2: error: unknown type name 'u_short' on non-Linux platforms. Signed-off-by: Gerald Pfeifer <gerald(a)pfeifer.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/nsiproxy.sys/udp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c index b6109ef9592..9f9966815c2 100644 --- a/dlls/nsiproxy.sys/udp.c +++ b/dlls/nsiproxy.sys/udp.c @@ -22,6 +22,10 @@ #include <stdarg.h> #include <stddef.h> +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + #ifdef HAVE_SYS_SYSCTL_H #include <sys/sysctl.h> #endif
1
0
0
0
Alexandre Julliard : wow64: Fix function comments.
by Alexandre Julliard
20 Aug '21
20 Aug '21
Module: wine Branch: master Commit: 4f4ddb57c2b964faf35b223217a22aecc313ff14 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4f4ddb57c2b964faf35b2232…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Aug 20 17:34:36 2021 +0200 wow64: Fix function comments. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/syscall.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 91f2a029e4b..0df1dfc143b 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -535,7 +535,7 @@ static LONG CALLBACK syscall_filter( EXCEPTION_POINTERS *ptrs ) /********************************************************************** - * Wow64SystemServiceEx (NTDLL.@) + * Wow64SystemServiceEx (wow64.@) */ NTSTATUS WINAPI Wow64SystemServiceEx( UINT num, UINT *args ) { @@ -562,7 +562,7 @@ NTSTATUS WINAPI Wow64SystemServiceEx( UINT num, UINT *args ) /********************************************************************** - * Wow64AllocateTemp + * Wow64AllocateTemp (wow64.@) * * FIXME: probably not 100% compatible. */ @@ -579,7 +579,7 @@ void * WINAPI Wow64AllocateTemp( SIZE_T size ) /********************************************************************** - * Wow64ApcRoutine (NTDLL.@) + * Wow64ApcRoutine (wow64.@) */ void WINAPI Wow64ApcRoutine( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3, CONTEXT *context ) { @@ -652,7 +652,7 @@ void WINAPI Wow64ApcRoutine( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3, CON /********************************************************************** - * Wow64LdrpInitialize (NTDLL.@) + * Wow64LdrpInitialize (wow64.@) */ void WINAPI Wow64LdrpInitialize( CONTEXT *context ) {
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
106
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Results per page:
10
25
50
100
200