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
March 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
2 participants
1163 discussions
Start a n
N
ew thread
Alexandre Julliard : msvcrt: Avoid depending on the mount manager in fstat().
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: 23ed647773546ab3e0817580f6ac28ed8c948c9d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=23ed647773546ab3e0817580…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Mar 17 10:29:28 2021 +0100 msvcrt: Avoid depending on the mount manager in fstat(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/file.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 89d6e7d721f..bf7496cc233 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1754,7 +1754,6 @@ int CDECL _fstat64(int fd, struct _stat64* buf) ioinfo *info = get_ioinfo(fd); DWORD dw; DWORD type; - BY_HANDLE_FILE_INFORMATION hfi; TRACE(":fd (%d) stat (%p)\n", fd, buf); if (info->handle == INVALID_HANDLE_VALUE) @@ -1771,7 +1770,6 @@ int CDECL _fstat64(int fd, struct _stat64* buf) return -1; } - memset(&hfi, 0, sizeof(hfi)); memset(buf, 0, sizeof(struct _stat64)); type = GetFileType(info->handle); if (type == FILE_TYPE_PIPE) @@ -1788,25 +1786,30 @@ int CDECL _fstat64(int fd, struct _stat64* buf) } else /* FILE_TYPE_DISK etc. */ { - if (!GetFileInformationByHandle(info->handle, &hfi)) + FILE_BASIC_INFORMATION basic_info; + FILE_STANDARD_INFORMATION std_info; + IO_STATUS_BLOCK io; + NTSTATUS status; + + if ((status = NtQueryInformationFile( info->handle, &io, &basic_info, sizeof(basic_info), FileBasicInformation )) || + (status = NtQueryInformationFile( info->handle, &io, &std_info, sizeof(std_info), FileStandardInformation ))) { - WARN(":failed-last error (%d)\n",GetLastError()); + WARN(":failed-error %x\n",status); msvcrt_set_errno(ERROR_INVALID_PARAMETER); release_ioinfo(info); return -1; } buf->st_mode = _S_IFREG | 0444; - if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + if (!(basic_info.FileAttributes & FILE_ATTRIBUTE_READONLY)) buf->st_mode |= 0222; - buf->st_size = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); + buf->st_size = std_info.EndOfFile.QuadPart; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&basic_info.LastAccessTime, &dw); buf->st_atime = dw; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&basic_info.LastWriteTime, &dw); buf->st_mtime = buf->st_ctime = dw; - buf->st_nlink = hfi.nNumberOfLinks; + buf->st_nlink = std_info.NumberOfLinks; + TRACE(":dwFileAttributes = 0x%x, mode set to 0x%x\n",basic_info.FileAttributes, buf->st_mode); } - TRACE(":dwFileAttributes = 0x%x, mode set to 0x%x\n",hfi.dwFileAttributes, - buf->st_mode); release_ioinfo(info); return 0; }
1
0
0
0
Alexandre Julliard : kernelbase: Avoid depending on the mount manager in CopyFileExW().
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: 4d7b49eae6613246f623957d2f7686a94a13010b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4d7b49eae6613246f623957d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Mar 17 10:21:42 2021 +0100 kernelbase: Avoid depending on the mount manager in CopyFileExW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/file.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index 765bb41ab98..23a36b0a765 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -499,7 +499,8 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT { static const int buffer_size = 65536; HANDLE h1, h2; - BY_HANDLE_FILE_INFORMATION info; + FILE_BASIC_INFORMATION info; + IO_STATUS_BLOCK io; DWORD count; BOOL ret = FALSE; char *buffer; @@ -525,7 +526,7 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT return FALSE; } - if (!GetFileInformationByHandle( h1, &info )) + if (!set_ntstatus( NtQueryInformationFile( h1, &io, &info, sizeof(info), FileBasicInformation ))) { WARN("GetFileInformationByHandle returned error for %s\n", debugstr_w(source)); HeapFree( GetProcessHeap(), 0, buffer ); @@ -553,7 +554,7 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT if ((h2 = CreateFileW( dest, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, (flags & COPY_FILE_FAIL_IF_EXISTS) ? CREATE_NEW : CREATE_ALWAYS, - info.dwFileAttributes, h1 )) == INVALID_HANDLE_VALUE) + info.FileAttributes, h1 )) == INVALID_HANDLE_VALUE) { WARN("Unable to open dest %s\n", debugstr_w(dest)); HeapFree( GetProcessHeap(), 0, buffer ); @@ -575,7 +576,8 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT ret = TRUE; done: /* Maintain the timestamp of source file to destination file */ - SetFileTime( h2, NULL, NULL, &info.ftLastWriteTime ); + info.FileAttributes = 0; + NtSetInformationFile( h2, &io, &info, sizeof(info), FileBasicInformation ); HeapFree( GetProcessHeap(), 0, buffer ); CloseHandle( h1 ); CloseHandle( h2 );
1
0
0
0
Huw Davies : riched20: Set the window title in the host.
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: 8724c37c7b9626a728ae95c91911002a28bb3a77 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8724c37c7b9626a728ae95c9…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Mar 17 08:45:28 2021 +0000 riched20: Set the window title in the host. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/editor.c | 55 +++++++++++++++---------------------------------- dlls/riched20/editor.h | 4 ++-- dlls/riched20/txthost.c | 23 ++++++++++++++++++--- dlls/riched20/txtsrv.c | 16 +++++++------- 4 files changed, 47 insertions(+), 51 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 779472f1f04..13a04a003f4 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3207,16 +3207,10 @@ static void ME_SetText(ME_TextEditor *editor, void *text, BOOL unicode) ME_EndToUnicode(codepage, wszText); } -static LRESULT ME_WmCreate(ME_TextEditor *editor, LPARAM lParam, BOOL unicode) +static LRESULT ME_WmCreate( ME_TextEditor *editor ) { - CREATESTRUCTW *createW = (CREATESTRUCTW*)lParam; - CREATESTRUCTA *createA = (CREATESTRUCTA*)lParam; - void *text = NULL; INT max; - if (lParam) - text = unicode ? (void*)createW->lpszName : (void*)createA->lpszName; - max = (editor->scrollbars & ES_DISABLENOSCROLL) ? 1 : 0; if (~editor->scrollbars & ES_DISABLENOSCROLL || editor->scrollbars & WS_VSCROLL) ITextHost_TxSetScrollRange(editor->texthost, SB_VERT, 0, max, TRUE); @@ -3237,17 +3231,6 @@ static LRESULT ME_WmCreate(ME_TextEditor *editor, LPARAM lParam, BOOL unicode) ITextHost_TxShowScrollBar(editor->texthost, SB_HORZ, TRUE); } } - - if (text) - { - ME_SetText(editor, text, unicode); - ME_SetCursorToStart(editor, &editor->pCursors[0]); - ME_SetCursorToStart(editor, &editor->pCursors[1]); - } - - ME_CommitUndo(editor); - ME_WrapMarkedParagraphs(editor); - update_caret(editor); return 0; } @@ -3312,8 +3295,8 @@ static LRESULT handle_EM_SETCHARFORMAT( ME_TextEditor *editor, WPARAM flags, con * The LRESULT that is returned is a return value for window procs, * and the phresult parameter is the COM return code needed by the * text services interface. */ -LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, - LPARAM lParam, BOOL unicode, HRESULT* phresult) +LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam, + LPARAM lParam, HRESULT* phresult ) { *phresult = S_OK; @@ -3978,7 +3961,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, return (wParam >= 0x40000) ? 0 : MAKELONG( pt.x, pt.y ); } case WM_CREATE: - return ME_WmCreate(editor, lParam, unicode); + return ME_WmCreate( editor ); case WM_SETCURSOR: { POINT cursor_pos; @@ -4060,23 +4043,19 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, case WM_CHAR: return handle_wm_char( editor, wParam, lParam ); case WM_UNICHAR: - if (unicode) - { - if(wParam == UNICODE_NOCHAR) return TRUE; - if(wParam <= 0x000fffff) - { - if(wParam > 0xffff) /* convert to surrogates */ - { - wParam -= 0x10000; - handle_wm_char( editor, (wParam >> 10) + 0xd800, 0 ); - handle_wm_char( editor, (wParam & 0x03ff) + 0xdc00, 0 ); - } - else - handle_wm_char( editor, wParam, 0 ); - } - return 0; - } - break; + if (wParam == UNICODE_NOCHAR) return TRUE; + if (wParam <= 0x000fffff) + { + if (wParam > 0xffff) /* convert to surrogates */ + { + wParam -= 0x10000; + handle_wm_char( editor, (wParam >> 10) + 0xd800, 0 ); + handle_wm_char( editor, (wParam & 0x03ff) + 0xdc00, 0 ); + } + else + handle_wm_char( editor, wParam, 0 ); + } + return 0; case EM_STOPGROUPTYPING: ME_CommitUndo(editor); /* End coalesced undos for typed characters */ return 0; diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index ee2cde833c4..d0645356678 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -271,8 +271,8 @@ void ME_DeleteReObject(struct re_object *re_object) DECLSPEC_HIDDEN; /* editor.c */ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) DECLSPEC_HIDDEN; void ME_DestroyEditor(ME_TextEditor *editor) DECLSPEC_HIDDEN; -LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, - LPARAM lParam, BOOL unicode, HRESULT* phresult) DECLSPEC_HIDDEN; +LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam, + LPARAM lParam, HRESULT* phresult ) DECLSPEC_HIDDEN; void ME_SendOldNotify(ME_TextEditor *editor, int nCode) DECLSPEC_HIDDEN; int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen, const ME_Cursor *start, int srcChars, BOOL bCRLF, BOOL bEOP) DECLSPEC_HIDDEN; diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c index 0325d5d41d8..c80263bbd69 100644 --- a/dlls/riched20/txthost.c +++ b/dlls/riched20/txthost.c @@ -963,10 +963,27 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam, } case WM_CREATE: + { + CREATESTRUCTW *createW = (CREATESTRUCTW *)lparam; + CREATESTRUCTA *createA = (CREATESTRUCTA *)lparam; + void *text; + WCHAR *textW = NULL; + LONG codepage = unicode ? CP_UNICODE : CP_ACP; + int len; + ITextServices_OnTxPropertyBitsChange( host->text_srv, TXTBIT_CLIENTRECTCHANGE, 0 ); - res = ME_HandleMessage( editor, msg, wparam, lparam, unicode, &hr ); - break; + if (lparam) + { + text = unicode ? (void *)createW->lpszName : (void *)createA->lpszName; + textW = ME_ToUnicode( codepage, text, &len ); + } + ITextServices_TxSetText( host->text_srv, textW ); + if (lparam) ME_EndToUnicode( codepage, textW ); + + hr = ITextServices_TxSendMessage( host->text_srv, msg, wparam, lparam, &res ); + break; + } case WM_DESTROY: ITextHost_Release( &host->ITextHost_iface ); return 0; @@ -1254,7 +1271,7 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam, break; } default: - res = ME_HandleMessage( editor, msg, wparam, lparam, unicode, &hr ); + hr = ITextServices_TxSendMessage( host->text_srv, msg, wparam, lparam, &res ); } if (hr == S_FALSE) diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c index 3f7688e6b25..9cf1908b4de 100644 --- a/dlls/riched20/txtsrv.c +++ b/dlls/riched20/txtsrv.c @@ -130,16 +130,16 @@ static ULONG WINAPI fnTextSrv_Release(ITextServices *iface) } DEFINE_THISCALL_WRAPPER(fnTextSrv_TxSendMessage,20) -DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxSendMessage(ITextServices *iface, UINT msg, WPARAM wparam, - LPARAM lparam, LRESULT *plresult) +DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxSendMessage( ITextServices *iface, UINT msg, WPARAM wparam, + LPARAM lparam, LRESULT *result ) { - struct text_services *services = impl_from_ITextServices( iface ); - HRESULT hresult; - LRESULT lresult; + struct text_services *services = impl_from_ITextServices( iface ); + HRESULT hr; + LRESULT res; - lresult = ME_HandleMessage( services->editor, msg, wparam, lparam, TRUE, &hresult ); - if (plresult) *plresult = lresult; - return hresult; + res = editor_handle_message( services->editor, msg, wparam, lparam, &hr ); + if (result) *result = res; + return hr; } DEFINE_THISCALL_WRAPPER(fnTextSrv_TxDraw,52)
1
0
0
0
Huw Davies : riched20: Handle the client rect changes in the host.
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: a1f88602b49774a006d7e782da6801826ed19d68 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a1f88602b49774a006d7e782…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Mar 17 08:45:27 2021 +0000 riched20: Handle the client rect changes in the host. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/editor.c | 81 -------------------------------------------- dlls/riched20/editstr.h | 3 -- dlls/riched20/tests/editor.c | 15 +++++++- dlls/riched20/txthost.c | 76 +++++++++++++++++++++++++++++++++++++++-- dlls/riched20/txtsrv.c | 25 ++++++++++++++ 5 files changed, 112 insertions(+), 88 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a1f88602b49774a006d7…
1
0
0
0
Huw Davies : riched20: Handle ES_SELECTIONBAR in the host.
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: 518c548b7a57757bd73b87684ceeb6bdc1b83f6c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=518c548b7a57757bd73b8768…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Mar 17 08:45:26 2021 +0000 riched20: Handle ES_SELECTIONBAR in the host. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/editor.c | 70 ++++--------------------------------------------- dlls/riched20/editstr.h | 1 - dlls/riched20/txthost.c | 22 ++++++++-------- dlls/riched20/txtsrv.c | 18 +++++++++++++ 4 files changed, 34 insertions(+), 77 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index df4cbcb4129..17b7d427d83 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2979,6 +2979,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) ME_TextEditor *ed = heap_alloc(sizeof(*ed)); int i; LONG selbarwidth; + HRESULT hr; ed->hWnd = NULL; ed->hwndParent = NULL; @@ -2986,7 +2987,6 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) ed->texthost = texthost; ed->reOle = NULL; ed->bEmulateVersion10 = bEmulateVersion10; - ed->styleFlags = 0; ed->exStyleFlags = 0; ed->total_rows = 0; ITextHost_TxGetPropertyBits( texthost, TXTBIT_RICHTEXT | TXTBIT_MULTILINE | TXTBIT_READONLY | @@ -3047,14 +3047,10 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) ME_CheckCharOffsets(ed); SetRectEmpty(&ed->rcFormat); ed->bDefaultFormatRect = TRUE; - ITextHost_TxGetSelectionBarWidth(ed->texthost, &selbarwidth); - if (selbarwidth) { - /* FIXME: Convert selbarwidth from HIMETRIC to pixels */ - ed->selofs = SELECTIONBAR_WIDTH; - ed->styleFlags |= ES_SELECTIONBAR; - } else { - ed->selofs = 0; - } + hr = ITextHost_TxGetSelectionBarWidth( ed->texthost, &selbarwidth ); + /* FIXME: Convert selbarwidth from HIMETRIC to pixels */ + if (hr == S_OK && selbarwidth) ed->selofs = SELECTIONBAR_WIDTH; + else ed->selofs = 0; ed->nSelectionType = stPosition; ed->cPasswordMask = 0; @@ -3405,14 +3401,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, return ME_Undo(editor); case EM_REDO: return ME_Redo(editor); - case EM_GETOPTIONS: - { - /* these flags are equivalent to the ES_* counterparts */ - DWORD mask = ECO_SELECTIONBAR; - DWORD settings = editor->styleFlags & mask; - - return settings; - } case EM_SETFONTSIZE: { CHARFORMAT2W cf; @@ -3454,54 +3442,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, return TRUE; } - case EM_SETOPTIONS: - { - /* these flags are equivalent to ES_* counterparts, except for - * ECO_AUTOWORDSELECTION that doesn't have an ES_* counterpart, - * but is still stored in editor->styleFlags. */ - const DWORD mask = ECO_SELECTIONBAR; - DWORD settings = mask & editor->styleFlags; - DWORD oldSettings = settings; - DWORD changedSettings; - - switch(wParam) - { - case ECOOP_SET: - settings = lParam; - break; - case ECOOP_OR: - settings |= lParam; - break; - case ECOOP_AND: - settings &= lParam; - break; - case ECOOP_XOR: - settings ^= lParam; - } - changedSettings = oldSettings ^ settings; - - if (changedSettings) { - editor->styleFlags = (editor->styleFlags & ~mask) | (settings & mask); - - if (changedSettings & ECO_SELECTIONBAR) - { - ITextHost_TxInvalidateRect(editor->texthost, &editor->rcFormat, TRUE); - if (settings & ECO_SELECTIONBAR) { - assert(!editor->selofs); - editor->selofs = SELECTIONBAR_WIDTH; - editor->rcFormat.left += editor->selofs; - } else { - editor->rcFormat.left -= editor->selofs; - editor->selofs = 0; - } - ME_RewrapRepaint(editor); - } - - - } - - return settings; - } case EM_SETSEL: { return set_selection( editor, wParam, lParam ); diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index 1fbf70ee6b2..a3e5970bff8 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -383,7 +383,6 @@ typedef struct tagME_TextEditor BOOL bEmulateVersion10; ME_TextBuffer *pBuffer; ME_Cursor *pCursors; - DWORD styleFlags; DWORD exStyleFlags; DWORD props; DWORD scrollbars; diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c index 9ae54a2a5f2..3ba522331b0 100644 --- a/dlls/riched20/txthost.c +++ b/dlls/riched20/txthost.c @@ -42,6 +42,7 @@ struct host unsigned int emulate_10 : 1; unsigned int dialog_mode : 1; unsigned int want_return : 1; + unsigned int sel_bar : 1; PARAFORMAT2 para_fmt; DWORD props, scrollbars, event_mask; }; @@ -73,6 +74,7 @@ static void host_init_props( struct host *host ) if (!(host->scrollbars & ES_AUTOHSCROLL)) host->props |= TXTBIT_WORDWRAP; + host->sel_bar = !!(style & ES_SELECTIONBAR); host->want_return = !!(style & ES_WANTRETURN); } @@ -471,8 +473,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth( ITextHo { struct host *host = impl_from_ITextHost( iface ); - DWORD style = host->editor ? host->editor->styleFlags : GetWindowLongW( host->window, GWL_STYLE ); - *width = (style & ES_SELECTIONBAR) ? 225 : 0; /* in HIMETRIC */ + *width = host->sel_bar ? 225 : 0; /* in HIMETRIC */ return S_OK; } @@ -773,10 +774,6 @@ static HRESULT set_options( struct host *host, DWORD op, DWORD value, LRESULT *r DWORD style, old_options, new_options, change, props_mask = 0; DWORD mask = ECO_AUTOWORDSELECTION | ECO_AUTOVSCROLL | ECO_AUTOHSCROLL | ECO_NOHIDESEL | ECO_READONLY | ECO_WANTRETURN | ECO_SAVESEL | ECO_SELECTIONBAR | ECO_VERTICAL; - const DWORD host_mask = ECO_AUTOWORDSELECTION | ECO_AUTOVSCROLL | ECO_AUTOHSCROLL | ECO_NOHIDESEL | ECO_READONLY | - ECO_WANTRETURN | ECO_SAVESEL | ECO_VERTICAL; - - HRESULT hr = S_OK; new_options = old_options = SendMessageW( host->window, EM_GETOPTIONS, 0, 0 ); @@ -828,6 +825,11 @@ static HRESULT set_options( struct host *host, DWORD op, DWORD value, LRESULT *r host->props ^= TXTBIT_SAVESELECTION; props_mask |= TXTBIT_SAVESELECTION; } + if (change & ECO_SELECTIONBAR) + { + host->sel_bar ^= 1; + props_mask |= TXTBIT_SELBARCHANGE; + } if (change & ECO_VERTICAL) { host->props ^= TXTBIT_VERTICAL; @@ -838,15 +840,13 @@ static HRESULT set_options( struct host *host, DWORD op, DWORD value, LRESULT *r if (props_mask) ITextServices_OnTxPropertyBitsChange( host->text_srv, props_mask, host->props & props_mask ); - /* Handle the rest in the editor for now */ - hr = ITextServices_TxSendMessage( host->text_srv, EM_SETOPTIONS, op, value, res ); - *res = (*res & ~host_mask) | (new_options & host_mask); + *res = new_options; mask &= ~ECO_AUTOWORDSELECTION; /* doesn't correspond to a window style */ style = GetWindowLongW( host->window, GWL_STYLE ); style = (style & ~mask) | (*res & mask); SetWindowLongW( host->window, GWL_STYLE, style ); - return hr; + return S_OK; } /* handle dialog mode VK_RETURN. Returns TRUE if message has been processed */ @@ -1017,7 +1017,6 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam, break; } case EM_GETOPTIONS: - hr = ITextServices_TxSendMessage( host->text_srv, EM_GETOPTIONS, 0, 0, &res ); if (host->props & TXTBIT_READONLY) res |= ECO_READONLY; if (!(host->props & TXTBIT_HIDESELECTION)) res |= ECO_NOHIDESEL; if (host->props & TXTBIT_SAVESELECTION) res |= ECO_SAVESEL; @@ -1026,6 +1025,7 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam, if (host->scrollbars & ES_AUTOHSCROLL) res |= ECO_AUTOHSCROLL; if (host->scrollbars & ES_AUTOVSCROLL) res |= ECO_AUTOVSCROLL; if (host->want_return) res |= ECO_WANTRETURN; + if (host->sel_bar) res |= ECO_SELECTIONBAR; break; case WM_GETTEXT: diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c index 8fb6416d38b..df62a2dd7c5 100644 --- a/dlls/riched20/txtsrv.c +++ b/dlls/riched20/txtsrv.c @@ -327,6 +327,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxPropertyBitsChange( ITextServic struct text_services *services = impl_from_ITextServices( iface ); DWORD scrollbars; HRESULT hr; + BOOL repaint = FALSE; TRACE( "%p, mask %08x, bits %08x\n", services, mask, bits ); @@ -349,6 +350,23 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxPropertyBitsChange( ITextServic if ((mask & TXTBIT_HIDESELECTION) && !services->editor->bHaveFocus) ME_InvalidateSelection( services->editor ); + if (mask & TXTBIT_SELBARCHANGE) + { + LONG width; + + hr = ITextHost_TxGetSelectionBarWidth( services->host, &width ); + if (hr == S_OK) + { + ITextHost_TxInvalidateRect( services->host, &services->editor->rcFormat, TRUE ); + services->editor->rcFormat.left -= services->editor->selofs; + services->editor->selofs = width ? SELECTIONBAR_WIDTH : 0; /* FIXME: convert from HIMETRIC */ + services->editor->rcFormat.left += services->editor->selofs; + repaint = TRUE; + } + } + + if (repaint) ME_RewrapRepaint( services->editor ); + return S_OK; }
1
0
0
0
Huw Davies : riched20: Handle ES_WANTRETURN in the host.
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: 6162703fbb37b9e37231d464cb77f4969a09ff44 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6162703fbb37b9e37231d464…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Mar 17 08:45:25 2021 +0000 riched20: Handle ES_WANTRETURN in the host. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/editor.c | 4 ++-- dlls/riched20/txthost.c | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 77787906344..df4cbcb4129 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3408,7 +3408,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, case EM_GETOPTIONS: { /* these flags are equivalent to the ES_* counterparts */ - DWORD mask = ECO_WANTRETURN | ECO_SELECTIONBAR; + DWORD mask = ECO_SELECTIONBAR; DWORD settings = editor->styleFlags & mask; return settings; @@ -3459,7 +3459,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, /* these flags are equivalent to ES_* counterparts, except for * ECO_AUTOWORDSELECTION that doesn't have an ES_* counterpart, * but is still stored in editor->styleFlags. */ - const DWORD mask = ECO_WANTRETURN | ECO_SELECTIONBAR; + const DWORD mask = ECO_SELECTIONBAR; DWORD settings = mask & editor->styleFlags; DWORD oldSettings = settings; DWORD changedSettings; diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c index ddbb879a75f..9ae54a2a5f2 100644 --- a/dlls/riched20/txthost.c +++ b/dlls/riched20/txthost.c @@ -41,6 +41,7 @@ struct host HWND window, parent; unsigned int emulate_10 : 1; unsigned int dialog_mode : 1; + unsigned int want_return : 1; PARAFORMAT2 para_fmt; DWORD props, scrollbars, event_mask; }; @@ -71,6 +72,8 @@ static void host_init_props( struct host *host ) if (style & ES_NOOLEDRAGDROP) host->props |= TXTBIT_DISABLEDRAG; if (!(host->scrollbars & ES_AUTOHSCROLL)) host->props |= TXTBIT_WORDWRAP; + + host->want_return = !!(style & ES_WANTRETURN); } struct host *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 ) @@ -698,7 +701,6 @@ static BOOL create_windowed_editor( HWND hwnd, CREATESTRUCTW *create, BOOL emula IUnknown_Release( unk ); host->editor->exStyleFlags = GetWindowLongW( hwnd, GWL_EXSTYLE ); - host->editor->styleFlags |= GetWindowLongW( hwnd, GWL_STYLE ) & ES_WANTRETURN; host->editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */ host->editor->hwndParent = create->hwndParent; @@ -772,7 +774,7 @@ static HRESULT set_options( struct host *host, DWORD op, DWORD value, LRESULT *r DWORD mask = ECO_AUTOWORDSELECTION | ECO_AUTOVSCROLL | ECO_AUTOHSCROLL | ECO_NOHIDESEL | ECO_READONLY | ECO_WANTRETURN | ECO_SAVESEL | ECO_SELECTIONBAR | ECO_VERTICAL; const DWORD host_mask = ECO_AUTOWORDSELECTION | ECO_AUTOVSCROLL | ECO_AUTOHSCROLL | ECO_NOHIDESEL | ECO_READONLY | - ECO_SAVESEL | ECO_VERTICAL; + ECO_WANTRETURN | ECO_SAVESEL | ECO_VERTICAL; HRESULT hr = S_OK; @@ -831,6 +833,7 @@ static HRESULT set_options( struct host *host, DWORD op, DWORD value, LRESULT *r host->props ^= TXTBIT_VERTICAL; props_mask |= TXTBIT_VERTICAL; } + if (change & ECO_WANTRETURN) host->want_return ^= 1; if (props_mask) ITextServices_OnTxPropertyBitsChange( host->text_srv, props_mask, host->props & props_mask ); @@ -853,7 +856,7 @@ static BOOL handle_dialog_enter( struct host *host ) if (ctrl_is_down) return TRUE; - if (host->editor->styleFlags & ES_WANTRETURN) return FALSE; + if (host->want_return) return FALSE; if (host->parent) { @@ -1022,6 +1025,7 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam, if (host->props & TXTBIT_VERTICAL) res |= ECO_VERTICAL; if (host->scrollbars & ES_AUTOHSCROLL) res |= ECO_AUTOHSCROLL; if (host->scrollbars & ES_AUTOVSCROLL) res |= ECO_AUTOVSCROLL; + if (host->want_return) res |= ECO_WANTRETURN; break; case WM_GETTEXT:
1
0
0
0
Huw Davies : riched20: Handle dialog mode in the host.
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: 7a038cae5790a633a5d1f93f8ef47db4461f6ea6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7a038cae5790a633a5d1f93f…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Mar 17 08:45:24 2021 +0000 riched20: Handle dialog mode in the host. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/editor.c | 47 ---------------------------------------- dlls/riched20/editstr.h | 1 - dlls/riched20/txthost.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 56 insertions(+), 49 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 6f38231de9b..77787906344 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2411,34 +2411,8 @@ static void ME_UpdateSelectionLinkAttribute(ME_TextEditor *editor) static BOOL handle_enter(ME_TextEditor *editor) { - BOOL ctrl_is_down = GetKeyState(VK_CONTROL) & 0x8000; BOOL shift_is_down = GetKeyState(VK_SHIFT) & 0x8000; - if (editor->bDialogMode) - { - if (ctrl_is_down) - return TRUE; - - if (!(editor->styleFlags & ES_WANTRETURN)) - { - if (editor->hwndParent) - { - DWORD dw; - dw = SendMessageW(editor->hwndParent, DM_GETDEFID, 0, 0); - if (HIWORD(dw) == DC_HASDEFID) - { - HWND hwDefCtrl = GetDlgItem(editor->hwndParent, LOWORD(dw)); - if (hwDefCtrl) - { - SendMessageW(editor->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwDefCtrl, TRUE); - PostMessageW(hwDefCtrl, WM_KEYDOWN, VK_RETURN, 0); - } - } - } - return TRUE; - } - } - if (editor->props & TXTBIT_MULTILINE) { ME_Cursor cursor = editor->pCursors[0]; @@ -2647,14 +2621,6 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) if (!editor->bEmulateVersion10) return handle_enter(editor); break; - case VK_ESCAPE: - if (editor->bDialogMode && editor->hwndParent) - PostMessageW(editor->hwndParent, WM_CLOSE, 0, 0); - return TRUE; - case VK_TAB: - if (editor->bDialogMode && editor->hwndParent) - SendMessageW(editor->hwndParent, WM_NEXTDLGCTL, shift_is_down, 0); - return TRUE; case 'A': if (ctrl_is_down) { @@ -3068,7 +3034,6 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) ed->mode |= (ed->props & TXTBIT_RICHTEXT) ? TM_RICHTEXT : TM_PLAINTEXT; ed->AutoURLDetect_bEnable = FALSE; ed->bHaveFocus = FALSE; - ed->bDialogMode = FALSE; ed->bMouseCaptured = FALSE; ed->caret_hidden = FALSE; ed->caret_height = 0; @@ -3399,18 +3364,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, return ME_StreamIn(editor, wParam, (EDITSTREAM*)lParam, TRUE); case EM_STREAMOUT: return ME_StreamOut(editor, wParam, (EDITSTREAM *)lParam); - case WM_GETDLGCODE: - { - UINT code = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS; - - if (lParam) - editor->bDialogMode = TRUE; - if (editor->props & TXTBIT_MULTILINE) - code |= DLGC_WANTMESSAGE; - if (!(editor->props & TXTBIT_SAVESELECTION)) - code |= DLGC_HASSETSEL; - return code; - } case EM_EMPTYUNDOBUFFER: ME_EmptyUndoStack(editor); return 0; diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index f689194901c..1fbf70ee6b2 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -424,7 +424,6 @@ typedef struct tagME_TextEditor BOOL AutoURLDetect_bEnable; WCHAR cPasswordMask; BOOL bHaveFocus; - BOOL bDialogMode; /* Indicates that we are inside a dialog window */ /*for IME */ int imeStartIndex; DWORD selofs; /* The size of the selection bar on the left side of control */ diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c index a8286905659..ddbb879a75f 100644 --- a/dlls/riched20/txthost.c +++ b/dlls/riched20/txthost.c @@ -39,7 +39,8 @@ struct host ITextServices *text_srv; ME_TextEditor *editor; /* to be removed */ HWND window, parent; - BOOL emulate_10; + unsigned int emulate_10 : 1; + unsigned int dialog_mode : 1; PARAFORMAT2 para_fmt; DWORD props, scrollbars, event_mask; }; @@ -84,6 +85,7 @@ struct host *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 ) texthost->window = hwnd; texthost->parent = cs->hwndParent; texthost->emulate_10 = emulate_10; + texthost->dialog_mode = 0; memset( &texthost->para_fmt, 0, sizeof(texthost->para_fmt) ); texthost->para_fmt.cbSize = sizeof(texthost->para_fmt); texthost->para_fmt.dwMask = PFM_ALIGNMENT; @@ -844,6 +846,31 @@ static HRESULT set_options( struct host *host, DWORD op, DWORD value, LRESULT *r return hr; } +/* handle dialog mode VK_RETURN. Returns TRUE if message has been processed */ +static BOOL handle_dialog_enter( struct host *host ) +{ + BOOL ctrl_is_down = GetKeyState( VK_CONTROL ) & 0x8000; + + if (ctrl_is_down) return TRUE; + + if (host->editor->styleFlags & ES_WANTRETURN) return FALSE; + + if (host->parent) + { + DWORD id = SendMessageW( host->parent, DM_GETDEFID, 0, 0 ); + if (HIWORD( id ) == DC_HASDEFID) + { + HWND ctrl = GetDlgItem( host->parent, LOWORD( id )); + if (ctrl) + { + SendMessageW( host->parent, WM_NEXTDLGCTL, (WPARAM)ctrl, TRUE ); + PostMessageW( ctrl, WM_KEYDOWN, VK_RETURN, 0 ); + } + } + } + return TRUE; +} + static LRESULT send_msg_filter( struct host *host, UINT msg, WPARAM *wparam, LPARAM *lparam ) { MSGFILTER msgf; @@ -905,6 +932,7 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam, WCHAR wc = wparam; if (!unicode) MultiByteToWideChar( CP_ACP, 0, (char *)&wparam, 1, &wc, 1 ); + if (wparam == '\r' && host->dialog_mode && host->emulate_10 && handle_dialog_enter( host )) break; hr = ITextServices_TxSendMessage( host->text_srv, msg, wc, lparam, &res ); break; } @@ -958,6 +986,14 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam, } break; } + case WM_GETDLGCODE: + if (lparam) host->dialog_mode = TRUE; + + res = DLGC_WANTCHARS | DLGC_WANTTAB | DLGC_WANTARROWS; + if (host->props & TXTBIT_MULTILINE) res |= DLGC_WANTMESSAGE; + if (!(host->props & TXTBIT_SAVESELECTION)) res |= DLGC_HASSETSEL; + break; + case EM_GETLINE: if (unicode) hr = ITextServices_TxSendMessage( host->text_srv, msg, wparam, lparam, &res ); else hr = get_lineA( host->text_srv, wparam, lparam, &res ); @@ -1014,6 +1050,25 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam, else hr = get_text_rangeA( host, (TEXTRANGEA *)lparam, &res ); break; + case WM_KEYDOWN: + switch (LOWORD( wparam )) + { + case VK_ESCAPE: + if (host->dialog_mode && host->parent) + PostMessageW( host->parent, WM_CLOSE, 0, 0 ); + break; + case VK_TAB: + if (host->dialog_mode && host->parent) + SendMessageW( host->parent, WM_NEXTDLGCTL, GetKeyState( VK_SHIFT ) & 0x8000, 0 ); + break; + case VK_RETURN: + if (host->dialog_mode && !host->emulate_10 && handle_dialog_enter( host )) break; + /* fall through */ + default: + hr = ITextServices_TxSendMessage( host->text_srv, msg, wparam, lparam, &res ); + } + break; + case WM_PAINT: { HDC hdc;
1
0
0
0
Michael Stefaniuc : gameux: Use wide-char string literals.
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: 84aa9b911df0295fe0a4d275945099710f82bcba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=84aa9b911df0295fe0a4d275…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Mar 16 23:09:04 2021 +0100 gameux: Use wide-char string literals. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gameux/gameexplorer.c | 67 +++++++++++--------------------------------- dlls/gameux/gamestatistics.c | 57 +++++++++++-------------------------- 2 files changed, 32 insertions(+), 92 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=84aa9b911df0295fe0a4…
1
0
0
0
Michael Stefaniuc : evr: Remove superfluous cast to self.
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: 23d899c00c0d714ab32d03bd7cc2e4e83c222ac3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=23d899c00c0d714ab32d03bd…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Mar 16 23:09:05 2021 +0100 evr: Remove superfluous cast to self. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/evr/mixer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index 52fc7d0cfcc..c59ec002340 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -899,7 +899,7 @@ static HRESULT WINAPI video_mixer_transform_GetInputCurrentType(IMFTransform *if hr = MF_E_TRANSFORM_TYPE_NOT_SET; else { - *type = (IMFMediaType *)stream->media_type; + *type = stream->media_type; IMFMediaType_AddRef(*type); } } @@ -925,7 +925,7 @@ static HRESULT WINAPI video_mixer_transform_GetOutputCurrentType(IMFTransform *i hr = MF_E_TRANSFORM_TYPE_NOT_SET; else { - *type = (IMFMediaType *)mixer->output.media_type; + *type = mixer->output.media_type; IMFMediaType_AddRef(*type); }
1
0
0
0
Zebediah Figura : winegstreamer: Convert timestamps to running time in wg_parser_stream_notify_qos().
by Alexandre Julliard
17 Mar '21
17 Mar '21
Module: wine Branch: master Commit: 5e222064ab27266c0f44ec3986872f611772ff10 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5e222064ab27266c0f44ec39…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 16 16:06:32 2021 -0500 winegstreamer: Convert timestamps to running time in wg_parser_stream_notify_qos(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50733
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/wg_parser.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 51d7e3d9748..aefb097f7f0 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -79,6 +79,7 @@ struct wg_parser_stream GstPad *their_src, *post_sink, *post_src, *my_sink; GstElement *flip; + GstSegment segment; struct wg_format preferred_format, current_format; pthread_cond_t event_cond, event_empty_cond; @@ -691,10 +692,24 @@ static bool CDECL wg_parser_stream_seek(struct wg_parser_stream *stream, double static void CDECL wg_parser_stream_notify_qos(struct wg_parser_stream *stream, bool underflow, double proportion, int64_t diff, uint64_t timestamp) { + GstClockTime stream_time; GstEvent *event; + /* We return timestamps in stream time, i.e. relative to the start of the + * file (or other medium), but gst_event_new_qos() expects the timestamp in + * running time. */ + stream_time = gst_segment_to_running_time(&stream->segment, GST_FORMAT_TIME, timestamp * 100); + if (stream_time == -1) + { + /* This can happen legitimately if the sample falls outside of the + * segment bounds. GStreamer elements shouldn't present the sample in + * that case, but DirectShow doesn't care. */ + TRACE("Ignoring QoS event.\n"); + return; + } + if (!(event = gst_event_new_qos(underflow ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW, - proportion, diff * 100, timestamp * 100))) + proportion, diff * 100, stream_time))) ERR("Failed to create QOS event.\n"); gst_pad_push_event(stream->my_sink, event); } @@ -792,6 +807,8 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) break; } + gst_segment_copy_into(segment, &stream->segment); + stream_event.type = WG_PARSER_EVENT_SEGMENT; stream_event.u.segment.position = segment->position / 100; stream_event.u.segment.stop = segment->stop / 100; @@ -838,6 +855,14 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) break; case GST_EVENT_FLUSH_STOP: + { + gboolean reset_time; + + gst_event_parse_flush_stop(event, &reset_time); + + if (reset_time) + gst_segment_init(&stream->segment, GST_FORMAT_UNDEFINED); + if (stream->enabled) { pthread_mutex_lock(&parser->mutex); @@ -845,6 +870,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) pthread_mutex_unlock(&parser->mutex); } break; + } case GST_EVENT_CAPS: { @@ -882,6 +908,10 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu stream_event.type = WG_PARSER_EVENT_BUFFER; + /* FIXME: Should we use gst_segment_to_stream_time_full()? Under what + * circumstances is the stream time not equal to the buffer PTS? Note that + * this will need modification to wg_parser_stream_notify_qos() as well. */ + if ((stream_event.u.buffer.has_pts = GST_BUFFER_PTS_IS_VALID(buffer))) stream_event.u.buffer.pts = GST_BUFFER_PTS(buffer) / 100; if ((stream_event.u.buffer.has_duration = GST_BUFFER_DURATION_IS_VALID(buffer))) @@ -972,6 +1002,8 @@ static struct wg_parser_stream *create_stream(struct wg_parser *parser) if (!(stream = calloc(1, sizeof(*stream)))) return NULL; + gst_segment_init(&stream->segment, GST_FORMAT_UNDEFINED); + stream->parser = parser; pthread_cond_init(&stream->event_cond, NULL); pthread_cond_init(&stream->event_empty_cond, NULL);
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
117
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
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200