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
June
May
April
March
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
April 2008
----- 2025 -----
June 2025
May 2025
April 2025
March 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
4 participants
1278 discussions
Start a n
N
ew thread
Lei Zhang : winmm: Do not unload drivers when the process is terminating.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: d20f982433b6c1fe735699f3172e67d2e0a6884b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d20f982433b6c1fe735699f31…
Author: Lei Zhang <thestig(a)google.com> Date: Mon Apr 28 12:28:19 2008 -0700 winmm: Do not unload drivers when the process is terminating. --- dlls/winmm/winmm.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c index a6fec99..8342c44 100644 --- a/dlls/winmm/winmm.c +++ b/dlls/winmm/winmm.c @@ -193,8 +193,14 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad) /* close all opened MCI drivers */ MCI_SendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_WAIT, 0L, TRUE); MMDRV_Exit(); - /* now unload all remaining drivers... */ - DRIVER_UnloadAll(); + /* There's no guarantee the drivers haven't already been unloaded on + * process shutdown. + */ + if (!fImpLoad) + { + /* now unload all remaining drivers... */ + DRIVER_UnloadAll(); + } WINMM_DeleteIData(); break;
1
0
0
0
Alex Villacís Lasso : richedit: Paragraph may have multiple rows, which should possibly update nHeight.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: d2a8461585f2b2ba53be7a38dcee3964c0abb966 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d2a8461585f2b2ba53be7a38d…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sun Apr 27 22:25:47 2008 -0500 richedit: Paragraph may have multiple rows, which should possibly update nHeight. Otherwise, a paragraph with multiple rows might fail to make the scrollbar appear when displaying text. --- dlls/riched20/wrap.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c index 43d3d79..4767074 100644 --- a/dlls/riched20/wrap.c +++ b/dlls/riched20/wrap.c @@ -508,6 +508,14 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) { ME_DestroyContext(&c, editor->hWnd); + /* Each paragraph may contain multiple rows, which should be scrollable, even + if the containing paragraph has nYPos == 0 */ + item = editor->pBuffer->pFirst; + while ((item = ME_FindItemFwd(item, diStartRow)) != NULL) { + assert(item->type == diStartRow); + editor->nHeight = max(editor->nHeight, item->member.row.nYPos); + } + if (bModified || editor->nTotalLength < editor->nLastTotalLength) ME_InvalidateMarkedParagraphs(editor); return bModified;
1
0
0
0
Alex Villacís Lasso : richedit: Fix modify step setting in EM_SETCHARFORMAT.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 3cad256d54eb7071a3693102ee683bdbbd087227 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3cad256d54eb7071a3693102e…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sun Apr 27 13:17:28 2008 -0500 richedit: Fix modify step setting in EM_SETCHARFORMAT. EM_SETCHARFORMAT with wParam==0 sets default char format and does NOT set modify step flag. EM_SETCHARFORMAT with wParam==SCF_SELECTION only sets modify step flag when selection is nonempty. EM_GETMODIFY returns -1, not 1, when modify flag is set. Tests for the above behavior. --- dlls/riched20/editor.c | 8 +++-- dlls/riched20/tests/editor.c | 58 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 660942f..84c8d36 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2206,7 +2206,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, return lColor; } case EM_GETMODIFY: - return editor->nModifyStep == 0 ? 0 : 1; + return editor->nModifyStep == 0 ? 0 : -1; case EM_SETMODIFY: { if (wParam) @@ -2249,8 +2249,10 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, } else if (wParam == SCF_ALL) { if (editor->mode & TM_PLAINTEXT) ME_SetDefaultCharFormat(editor, p); - else + else { ME_SetCharFormat(editor, 0, ME_GetTextLength(editor), p); + editor->nModifyStep = 1; + } } else if (editor->mode & TM_PLAINTEXT) { return 0; } else { @@ -2258,8 +2260,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_GetSelection(editor, &from, &to); bRepaint = (from != to); ME_SetSelectionCharFormat(editor, p); + if (from != to) editor->nModifyStep = 1; } - editor->nModifyStep = 1; ME_CommitUndo(editor); if (bRepaint) ME_RewrapRepaint(editor); diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index b365965..05db7f8 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -438,6 +438,57 @@ static void test_EM_SETCHARFORMAT(void) (LPARAM) &cf2); ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); + cf2.cbSize = sizeof(CHARFORMAT2); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_DEFAULT, + (LPARAM) &cf2); + + /* Test state of modify flag before and after valid EM_SETCHARFORMAT */ + cf2.cbSize = sizeof(CHARFORMAT2); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_DEFAULT, + (LPARAM) &cf2); + cf2.dwMask = CFM_ITALIC | cf2.dwMask; + cf2.dwEffects = CFE_ITALIC ^ cf2.dwEffects; + + /* wParam==0 is default char format, does not set modify */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == 0, "Text marked as modified, expected not modified!\n"); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, 0, (LPARAM) &cf2); + ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == 0, "Text marked as modified, expected not modified!\n"); + + /* wParam==SCF_SELECTION sets modify if nonempty selection */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == 0, "Text marked as modified, expected not modified!\n"); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf2); + ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == 0, "Text marked as modified, expected not modified!\n"); + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"wine"); + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == 0, "Text marked as modified, expected not modified!\n"); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf2); + ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == 0, "Text marked as modified, expected not modified!\n"); + SendMessage(hwndRichEdit, EM_SETSEL, 0, 2); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf2); + ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == -1, "Text not marked as modified, expected modified! (%d)\n", rc); + + /* wParam==SCF_ALL sets modify regardless of whether text is present */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == 0, "Text marked as modified, expected not modified!\n"); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == -1, "Text not marked as modified, expected modified! (%d)\n", rc); + DestroyWindow(hwndRichEdit); } @@ -472,10 +523,17 @@ static void test_EM_SETTEXTMODE(void) cf2.dwMask = CFM_ITALIC | cf2.dwMask; cf2.dwEffects = CFE_ITALIC ^ cf2.dwEffects; + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == 0, "Text marked as modified, expected not modified!\n"); + /*EM_SETCHARFORMAT is not yet fully implemented for all WPARAMs in wine; however, SCF_ALL has been implemented*/ rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); + + rc = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); + ok(rc == -1, "Text not marked as modified, expected modified! (%d)\n", rc); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "wine"); /*Select the string "wine"*/
1
0
0
0
Alex Villacís Lasso : richedit: Flip the big switch and encode actual CR and LF into end-of-paragraph runs .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 4047df0f564786437cdf9a0712fbee603f5f3d2f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4047df0f564786437cdf9a071…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 22:49:35 2008 -0500 richedit: Flip the big switch and encode actual CR and LF into end-of-paragraph runs. Document remaining uses of bEmulateVersion10 and other checks for CRLF in editor.c. Make RTF reader emit a \r or a \r\n according to emulation, not a \n, which breaks streaming tests. Remove todo_wine from a bunch of riched32 tests that now succeed. --- dlls/riched20/caret.c | 43 ++++++++++++++++++++++++++--------------- dlls/riched20/editor.c | 26 +++++++++++++++++++++++- dlls/riched20/reader.c | 3 +- dlls/riched32/tests/editor.c | 34 ++++++++++++++++---------------- 4 files changed, 70 insertions(+), 36 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index a8e51db..bf53aff 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -524,6 +524,8 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, if (pos-str < len) { /* handle EOLs */ ME_DisplayItem *tp, *end_run; ME_Style *tmp_style; + int numCR, numLF; + if (pos!=str) ME_InternalInsertTextFromCursor(editor, nCursor, str, pos-str, style, 0); p = &editor->pCursors[nCursor]; @@ -534,38 +536,47 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, tmp_style = ME_GetInsertStyle(editor, nCursor); /* ME_SplitParagraph increases style refcount */ - /* TODO: move here and fix logic for pos updating according to emulation, - so that number of CR and LF encoded are a result of such logic, instead - of hardcoded as below. - */ - if (editor->bEmulateVersion10) - tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, 1, 1); - else - tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, 1, 0); - p->pRun = ME_FindItemFwd(tp, diRun); - end_run = ME_FindItemBack(tp, diRun); - ME_ReleaseStyle(end_run->member.run.style); - end_run->member.run.style = tmp_style; - p->nOffset = 0; + /* Encode and fill number of CR and LF according to emulation mode */ if (editor->bEmulateVersion10) { const WCHAR * tpos; + /* We have to find out how many consecutive \r are there, and if there + is a \n terminating the run of \r's. */ + numCR = 0; numLF = 0; tpos = pos; while (tpos-str < len && *tpos == '\r') { tpos++; + numCR++; } if (tpos-str >= len) { - if (tpos != pos) pos++; - } else if (*tpos == '\n') + /* Reached end of text without finding anything but '\r' */ + if (tpos != pos) { + pos++; + } + numCR = 1; numLF = 0; + } else if (*tpos == '\n') { + /* The entire run of \r's plus the one \n is one single line break */ pos = tpos + 1; - else + numLF = 1; + } else { + /* Found some other content past the run of \r's */ pos++; + numCR = 1; numLF = 0; + } } else { if(pos-str < len && *pos =='\r') pos++; if(pos-str < len && *pos =='\n') pos++; + numCR = 1; numLF = 0; } + tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, numCR, numLF); + p->pRun = ME_FindItemFwd(tp, diRun); + end_run = ME_FindItemBack(tp, diRun); + ME_ReleaseStyle(end_run->member.run.style); + end_run->member.run.style = tmp_style; + p->nOffset = 0; + if(pos-str <= len) { len -= pos - str; str = pos; diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index d0d6195..4b4db9f 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1101,7 +1101,10 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre if (parser.lpRichEditOle) IRichEditOle_Release(parser.lpRichEditOle); - /* Remove last line break, as mandated by tests */ + /* Remove last line break, as mandated by tests. This is not affected by + CR/LF counters, since RTF streaming presents only \para tokens, which + are converted according to the standard rules: \r for 2.0, \r\n for 1.0 + */ if (stripLastCR) { int newfrom, newto; ME_GetSelection(editor, &newfrom, &newto); @@ -1213,6 +1216,21 @@ ME_FindItemAtOffset(ME_TextEditor *editor, ME_DIType nItemType, int nOffset, int } while (item && (item->member.run.nCharOfs + runLength <= nOffset)); if (item) { nOffset -= item->member.run.nCharOfs; + + /* Special case: nOffset may not point exactly at the division between the + \r and the \n in 1.0 emulation. If such a case happens, it is sent + into the next run, if one exists + */ + if ( item->member.run.nFlags & MERF_ENDPARA + && nOffset == item->member.run.nCR + && item->member.run.nLF > 0) { + ME_DisplayItem *nextItem; + nextItem = ME_FindItemFwd(item, diRun); + if (nextItem) { + nOffset = 0; + item = nextItem; + } + } if (nItemOffset) *nItemOffset = nOffset; } @@ -2487,6 +2505,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, { GETTEXTLENGTHEX how; + /* CR/LF conversion required in 2.0 mode, verbatim in 1.0 mode */ how.flags = GTL_CLOSE | (editor->bEmulateVersion10 ? 0 : GTL_USECRLF) | GTL_NUMCHARS; how.codepage = unicode ? 1200 : CP_ACP; return ME_GetTextLengthEx(editor, &how); @@ -2552,7 +2571,10 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, else { /* potentially each char may be a CR, why calculate the exact value with O(N) when - we can just take a bigger buffer? :) */ + we can just take a bigger buffer? :) + The above assumption still holds with CR/LF counters, since CR->CRLF expansion + occurs only in richedit 2.0 mode, in which line breaks have only one CR + */ int crlfmul = (ex->flags & GT_USECRLF) ? 2 : 1; LPWSTR buffer; DWORD buflen = ex->cb; diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c index 1ecca08..5ee9fa2 100644 --- a/dlls/riched20/reader.c +++ b/dlls/riched20/reader.c @@ -2605,7 +2605,8 @@ static void SpecialChar (RTF_Info *info) case rtfSect: case rtfRow: case rtfPar: - RTFPutUnicodeChar (info, '\n'); + RTFPutUnicodeChar (info, '\r'); + if (info->editor->bEmulateVersion10) RTFPutUnicodeChar (info, '\n'); break; case rtfNoBrkSpace: RTFPutUnicodeChar (info, 0x00A0); diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 21972ab..70d1558 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -110,21 +110,21 @@ static void test_WM_SETTEXT() } TEST_SETTEXT(TestItem1, TestItem1, 1, 0, 0) - TEST_SETTEXT(TestItem2, TestItem2, 1, 1, 1) - TEST_SETTEXT(TestItem3, TestItem3, 2, 1, 1) - TEST_SETTEXT(TestItem4, TestItem4, 3, 1, 0) - TEST_SETTEXT(TestItem5, TestItem5, 2, 1, 0) - TEST_SETTEXT(TestItem6, TestItem6, 3, 1, 0) - TEST_SETTEXT(TestItem7, TestItem7, 4, 1, 0) + TEST_SETTEXT(TestItem2, TestItem2, 1, 0, 1) + TEST_SETTEXT(TestItem3, TestItem3, 2, 0, 1) + TEST_SETTEXT(TestItem4, TestItem4, 3, 0, 0) + TEST_SETTEXT(TestItem5, TestItem5, 2, 0, 0) + TEST_SETTEXT(TestItem6, TestItem6, 3, 0, 0) + TEST_SETTEXT(TestItem7, TestItem7, 4, 0, 0) TEST_SETTEXT(TestItem8, TestItem8, 2, 0, 0) TEST_SETTEXT(TestItem9, TestItem9, 3, 0, 0) TEST_SETTEXT(TestItem10, TestItem10, 3, 0, 0) TEST_SETTEXT(TestItem11, TestItem11, 1, 0, 0) TEST_SETTEXT(TestItem12, TestItem12, 2, 0, 0) TEST_SETTEXT(TestItem13, TestItem13, 3, 0, 0) - TEST_SETTEXT(TestItem14, TestItem14, 2, 1, 0) - TEST_SETTEXT(TestItem15, TestItem15, 3, 1, 1) - TEST_SETTEXT(TestItem16, TestItem16, 4, 1, 0) + TEST_SETTEXT(TestItem14, TestItem14, 2, 0, 0) + TEST_SETTEXT(TestItem15, TestItem15, 3, 0, 1) + TEST_SETTEXT(TestItem16, TestItem16, 4, 0, 0) #undef TEST_SETTEXT DestroyWindow(hwndRichEdit); @@ -332,11 +332,11 @@ static void test_EM_STREAMOUT(void) SendMessage(hwndRichEdit, EM_STREAMOUT, (WPARAM)(SF_TEXT), (LPARAM)&es); r = strlen(buf); - todo_wine { /* Currently fails because of solitary \r mangling */ + ok(r == 13, "streamed text length is %d, expecting 13\n", r); ok(strcmp(buf, TestItem2) == 0, "streamed text different, got %s\n", buf); - } + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) TestItem3); p = buf; es.dwCookie = (DWORD_PTR)&p; @@ -360,8 +360,8 @@ static const struct getline_s { int wine_todo; } gl[] = { {0, 10, "foo bar\r\n", 0}, - {1, 10, "\n", 1}, - {2, 10, "bar\n", 1}, + {1, 10, "\n", 0}, + {2, 10, "bar\n", 0}, {3, 10, "\r\n", 0}, /* Buffer smaller than line length */ @@ -493,9 +493,9 @@ static void test_EM_GETTEXTRANGE(void) result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange); ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n", result, strlen(expect2)); - todo_wine { + ok(!strcmp(expect2, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); - } + DestroyWindow(hwndRichEdit); } @@ -524,9 +524,9 @@ static void test_EM_GETSELTEXT(void) result = SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer); ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n", result, strlen(expect2)); - todo_wine { + ok(!strcmp(expect2, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); - } + DestroyWindow(hwndRichEdit); }
1
0
0
0
Alex Villacís Lasso : richedit: Implement rule that in 1.0 emulation, a single CR that terminates the text is NOT a line break.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: cac55008c9640014bcbd9ccdbbe1872e3f390719 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cac55008c9640014bcbd9ccdb…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sun Apr 27 09:24:15 2008 -0500 richedit: Implement rule that in 1.0 emulation, a single CR that terminates the text is NOT a line break. Fix riched32 test that now succeed. --- dlls/riched20/editor.c | 18 ++++++++++++++++++ dlls/riched32/tests/editor.c | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 4b4db9f..3121293 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2702,12 +2702,30 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_DisplayItem *item = editor->pBuffer->pFirst->next; int nRows = 0; + ME_DisplayItem *prev_para = NULL, *last_para = NULL; + while (item != editor->pBuffer->pLast) { assert(item->type == diParagraph); + prev_para = ME_FindItemBack(item, diRun); + if (prev_para) { + assert(prev_para->member.run.nFlags & MERF_ENDPARA); + } nRows += item->member.para.nRows; item = item->member.para.next_para; } + last_para = ME_FindItemBack(item, diRun); + assert(last_para); + assert(last_para->member.run.nFlags & MERF_ENDPARA); + if (editor->bEmulateVersion10 && prev_para && last_para->member.run.nCharOfs == 0 + && prev_para->member.run.nCR == 1 && prev_para->member.run.nLF == 0) + { + /* In 1.0 emulation, the last solitary \r at the very end of the text + (if one exists) is NOT a line break. + FIXME: this is an ugly hack. This should have a more regular model. */ + nRows--; + } + TRACE("EM_GETLINECOUNT: nRows==%d\n", nRows); return max(1, nRows); } diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 70d1558..abecaee 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -110,8 +110,8 @@ static void test_WM_SETTEXT() } TEST_SETTEXT(TestItem1, TestItem1, 1, 0, 0) - TEST_SETTEXT(TestItem2, TestItem2, 1, 0, 1) - TEST_SETTEXT(TestItem3, TestItem3, 2, 0, 1) + TEST_SETTEXT(TestItem2, TestItem2, 1, 0, 0) + TEST_SETTEXT(TestItem3, TestItem3, 2, 0, 0) TEST_SETTEXT(TestItem4, TestItem4, 3, 0, 0) TEST_SETTEXT(TestItem5, TestItem5, 2, 0, 0) TEST_SETTEXT(TestItem6, TestItem6, 3, 0, 0) @@ -123,7 +123,7 @@ static void test_WM_SETTEXT() TEST_SETTEXT(TestItem12, TestItem12, 2, 0, 0) TEST_SETTEXT(TestItem13, TestItem13, 3, 0, 0) TEST_SETTEXT(TestItem14, TestItem14, 2, 0, 0) - TEST_SETTEXT(TestItem15, TestItem15, 3, 0, 1) + TEST_SETTEXT(TestItem15, TestItem15, 3, 0, 0) TEST_SETTEXT(TestItem16, TestItem16, 4, 0, 0) #undef TEST_SETTEXT
1
0
0
0
Alex Villacís Lasso : richedit: Only notify selection change when selection has actually changed from previous notification .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 1fa39b50c0bafeb72e85c257391e6cd5fb70182d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1fa39b50c0bafeb72e85c2573…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sun Apr 27 13:08:55 2008 -0500 richedit: Only notify selection change when selection has actually changed from previous notification. Otherwise, redundant and early notifications are sent to apps that do not expect them. Fixes crash #1 with Perfect! TextEdit. --- dlls/riched20/caret.c | 10 +++++++++- dlls/riched20/editor.c | 2 ++ dlls/riched20/editstr.h | 3 +++ 3 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index bf53aff..b2172ac 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -1330,7 +1330,15 @@ void ME_SendSelChange(ME_TextEditor *editor) sc.seltyp |= SEL_TEXT; if (sc.chrg.cpMin < sc.chrg.cpMax+1) /* wth were RICHEDIT authors thinking ? */ sc.seltyp |= SEL_MULTICHAR; - SendMessageW(GetParent(editor->hWnd), WM_NOTIFY, sc.nmhdr.idFrom, (LPARAM)&sc); + TRACE("cpMin=%d cpMax=%d seltyp=%d (%s %s)\n", + sc.chrg.cpMin, sc.chrg.cpMax, sc.seltyp, + (sc.seltyp & SEL_TEXT) ? "SEL_TEXT" : "", + (sc.seltyp & SEL_MULTICHAR) ? "SEL_MULTICHAR" : ""); + if (sc.chrg.cpMin != editor->notified_cr.cpMin || sc.chrg.cpMax != editor->notified_cr.cpMax) + { + editor->notified_cr = sc.chrg; + SendMessageW(GetParent(editor->hWnd), WM_NOTIFY, sc.nmhdr.idFrom, (LPARAM)&sc); + } } BOOL diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 3121293..660942f 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1665,6 +1665,8 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { else ed->cPasswordMask = 0; + ed->notified_cr.cpMin = ed->notified_cr.cpMax = 0; + return ed; } diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index aedaefa..1e2c770 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -331,6 +331,9 @@ typedef struct tagME_TextEditor /*for IME */ int imeStartIndex; DWORD selofs, linesel, sely; + + /* Track previous notified selection */ + CHARRANGE notified_cr; } ME_TextEditor; typedef struct tagME_Context
1
0
0
0
Alex Villacís Lasso : richedit: WM_SETTEXT - Clear modify step flag before any notifications can be sent.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: c52bc5881600e6830e2849ca59632755cdaa0bf2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c52bc5881600e6830e2849ca5…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sun Apr 27 14:21:02 2008 -0500 richedit: WM_SETTEXT - Clear modify step flag before any notifications can be sent. Otherwise the app-defined WM_NOTIFY callback might see the modify flag set, even though WM_SETTEXT is supposed to clear it. --- dlls/riched20/editor.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 84c8d36..b153fc1 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2436,10 +2436,10 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, } else TRACE("WM_SETTEXT - NULL\n"); + editor->nModifyStep = 0; ME_CommitUndo(editor); ME_EmptyUndoStack(editor); ME_SetSelection(editor, 0, 0); - editor->nModifyStep = 0; ME_UpdateRepaint(editor); return 1; }
1
0
0
0
Alex Villacís Lasso : richedit: Private movement of cursors in text insertion should not cause WM_NOTIFY to be sent .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 829940458f11bc74f4fefca5cb200ad9abd17951 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=829940458f11bc74f4fefca5c…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sun Apr 27 15:47:26 2008 -0500 richedit: Private movement of cursors in text insertion should not cause WM_NOTIFY to be sent. As text is inserted, the cursor is moved to the end, and then back to offset 0. A reordering of operations prevents a WM_NOTIFY from being sent on cursor being moved to the end, and another by being moved back to the beginning. If the cursor was not at offset 0, then exactly one WM_NOTIFY must be sent, for the movement from previous position to the beginning. With tests to prove this change and the previous one (modify flag should be off on WM_SETTEXT-caused WM_NOTIFY). --- dlls/riched20/editor.c | 2 +- dlls/riched20/tests/editor.c | 79 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index b153fc1..392a60a 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2436,10 +2436,10 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, } else TRACE("WM_SETTEXT - NULL\n"); + ME_SetSelection(editor, 0, 0); editor->nModifyStep = 0; ME_CommitUndo(editor); ME_EmptyUndoStack(editor); - ME_SetSelection(editor, 0, 0); ME_UpdateRepaint(editor); return 1; } diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 05db7f8..891c713 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -3125,6 +3125,83 @@ static void test_eventMask(void) } +static int received_WM_NOTIFY = 0; +static int modify_at_WM_NOTIFY = 0; +static HWND hwndRichedit_WM_NOTIFY; + +static LRESULT WINAPI WM_NOTIFY_ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + if(message == WM_NOTIFY) + { + received_WM_NOTIFY = 1; + modify_at_WM_NOTIFY = SendMessage(hwndRichedit_WM_NOTIFY, EM_GETMODIFY, 0, 0); + } + return DefWindowProcA(hwnd, message, wParam, lParam); +} + +static void test_WM_NOTIFY(void) +{ + HWND parent; + WNDCLASSA cls; + CHARFORMAT2 cf2; + + /* register class to capture WM_NOTIFY */ + cls.style = 0; + cls.lpfnWndProc = WM_NOTIFY_ParentMsgCheckProcA; + cls.cbClsExtra = 0; + cls.cbWndExtra = 0; + cls.hInstance = GetModuleHandleA(0); + cls.hIcon = 0; + cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW); + cls.hbrBackground = GetStockObject(WHITE_BRUSH); + cls.lpszMenuName = NULL; + cls.lpszClassName = "WM_NOTIFY_ParentClass"; + if(!RegisterClassA(&cls)) assert(0); + + parent = CreateWindow(cls.lpszClassName, NULL, WS_POPUP|WS_VISIBLE, + 0, 0, 200, 60, NULL, NULL, NULL, NULL); + ok (parent != 0, "Failed to create parent window\n"); + + hwndRichedit_WM_NOTIFY = new_richedit(parent); + ok(hwndRichedit_WM_NOTIFY != 0, "Failed to create edit window\n"); + + SendMessage(hwndRichedit_WM_NOTIFY, EM_SETEVENTMASK, 0, ENM_SELCHANGE); + + /* Notifications for selection change should only be sent when selection + actually changes. EM_SETCHARFORMAT is one message that calls + ME_CommitUndo, which should check whether message should be sent */ + received_WM_NOTIFY = 0; + cf2.cbSize = sizeof(CHARFORMAT2); + SendMessage(hwndRichedit_WM_NOTIFY, EM_GETCHARFORMAT, (WPARAM) SCF_DEFAULT, + (LPARAM) &cf2); + cf2.dwMask = CFM_ITALIC | cf2.dwMask; + cf2.dwEffects = CFE_ITALIC ^ cf2.dwEffects; + SendMessage(hwndRichedit_WM_NOTIFY, EM_SETCHARFORMAT, 0, (LPARAM) &cf2); + ok(received_WM_NOTIFY == 0, "Unexpected WM_NOTIFY was sent!\n"); + + /* WM_SETTEXT should NOT cause a WM_NOTIFY to be sent when selection is + already at 0. */ + received_WM_NOTIFY = 0; + modify_at_WM_NOTIFY = 0; + SendMessage(hwndRichedit_WM_NOTIFY, WM_SETTEXT, 0, (LPARAM)"sometext"); + ok(received_WM_NOTIFY == 0, "Unexpected WM_NOTIFY was sent!\n"); + ok(modify_at_WM_NOTIFY == 0, "WM_NOTIFY callback saw text flagged as modified!\n"); + + received_WM_NOTIFY = 0; + modify_at_WM_NOTIFY = 0; + SendMessage(hwndRichedit_WM_NOTIFY, EM_SETSEL, 4, 4); + ok(received_WM_NOTIFY == 1, "Expected WM_NOTIFY was NOT sent!\n"); + + received_WM_NOTIFY = 0; + modify_at_WM_NOTIFY = 0; + SendMessage(hwndRichedit_WM_NOTIFY, WM_SETTEXT, 0, (LPARAM)"sometext"); + ok(received_WM_NOTIFY == 1, "Expected WM_NOTIFY was NOT sent!\n"); + ok(modify_at_WM_NOTIFY == 0, "WM_NOTIFY callback saw text flagged as modified!\n"); + + DestroyWindow(hwndRichedit_WM_NOTIFY); + DestroyWindow(parent); +} + START_TEST( editor ) { MSG msg; @@ -3134,7 +3211,6 @@ START_TEST( editor ) * RICHED20.DLL, so the linker doesn't actually link to it. */ hmoduleRichEdit = LoadLibrary("RICHED20.DLL"); ok(hmoduleRichEdit != NULL, "error: %d\n", (int) GetLastError()); - test_WM_CHAR(); test_EM_FINDTEXT(); test_EM_GETLINE(); @@ -3168,6 +3244,7 @@ START_TEST( editor ) test_EM_GETTEXTLENGTHEX(); test_EM_REPLACESEL(1); test_EM_REPLACESEL(0); + test_WM_NOTIFY(); test_eventMask(); /* Set the environment variable WINETEST_RICHED20 to keep windows
1
0
0
0
Alex Villacís Lasso : richedit: Modify ME_GetTextW() to honor CR and LF encodings.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: e8aa9dee561979ac8fd0b3770f535120f201b136 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8aa9dee561979ac8fd0b3770…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 20:37:50 2008 -0500 richedit: Modify ME_GetTextW() to honor CR and LF encodings. ME_GetTextLengthEx should ignore GTL_USECRLF in 1.0 emulation mode. --- dlls/riched20/caret.c | 4 +++- dlls/riched20/editor.c | 31 +++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 56cd2b1..a8e51db 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -57,7 +57,9 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how) length = ME_GetTextLength(editor); - if ((GetWindowLongW(editor->hWnd, GWL_STYLE) & ES_MULTILINE) && (how->flags & GTL_USECRLF)) + if ((GetWindowLongW(editor->hWnd, GWL_STYLE) & ES_MULTILINE) + && (how->flags & GTL_USECRLF) + && !editor->bEmulateVersion10) /* Ignore GTL_USECRLF flag in 1.0 emulation */ length += editor->nParagraphs - 1; if (how->flags & GTL_NUMBYTES) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 01502bf..4ba23a5 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3376,6 +3376,9 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in return 0; } + /* bCRLF flag is only honored in 2.0 and up. 1.0 must always return text verbatim */ + if (editor->bEmulateVersion10) bCRLF = 0; + if (nStart) { int nLen = ME_StrLen(item->member.run.strText) - nStart; @@ -3394,6 +3397,8 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in while(nChars && item) { int nLen = ME_StrLen(item->member.run.strText); + if (item->member.run.nFlags & MERF_ENDPARA) + nLen = item->member.run.nCR + item->member.run.nLF; if (nLen > nChars) nLen = nChars; @@ -3406,16 +3411,30 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in nLen = 0; nChars = 0; } else { - *buffer = '\r'; if (bCRLF) { - *(++buffer) = '\n'; + /* richedit 2.0 case - actual line-break is \r but should report \r\n */ + assert(nLen == 1); + *buffer++ = '\r'; + *buffer = '\n'; /* Later updated by nLen==1 at the end of the loop */ nWritten++; } - assert(nLen == 1); - /* our end paragraph consists of 2 characters now */ - if (editor->bEmulateVersion10) - nChars--; + else + { + int i, j; + + /* richedit 2.0 verbatim has only \r. richedit 1.0 should honor encodings */ + i = 0; + while (nChars - i > 0 && i < item->member.run.nCR) + { + buffer[i] = '\r'; i++; + } + j = 0; + while (nChars - i - j > 0 && j < item->member.run.nLF) + { + buffer[i+j] = '\n'; j++; + } + } } } else
1
0
0
0
Alex Villacís Lasso : richedit: Remove indication for bCRLF, now that ME_GetTextW() knows how to honor CR and LF counters.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 3a271386ec96a9c8468c01ac8251bdbc0d3c6a40 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a271386ec96a9c8468c01ac8…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 21:16:41 2008 -0500 richedit: Remove indication for bCRLF, now that ME_GetTextW() knows how to honor CR and LF counters. EM_GETTEXTRANGE and EM_GETSELTEXT are affected by this, so include tests to ensure no behavior was broken. --- dlls/riched20/editor.c | 4 +- dlls/riched20/tests/editor.c | 63 ++++++++++++++++++++++++++++++++++++++ dlls/riched32/tests/editor.c | 69 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 4ba23a5..d0d6195 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2594,12 +2594,12 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, rng->chrg.cpMin, rng->chrg.cpMax, unicode, editor->bEmulateVersion10, ME_GetTextLength(editor)); if (unicode) - return ME_GetTextW(editor, rng->lpstrText, rng->chrg.cpMin, rng->chrg.cpMax-rng->chrg.cpMin, editor->bEmulateVersion10); + return ME_GetTextW(editor, rng->lpstrText, rng->chrg.cpMin, rng->chrg.cpMax-rng->chrg.cpMin, 0); else { int nLen = rng->chrg.cpMax-rng->chrg.cpMin; WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1); - int nChars = ME_GetTextW(editor, p, rng->chrg.cpMin, nLen, editor->bEmulateVersion10); + int nChars = ME_GetTextW(editor, p, rng->chrg.cpMin, nLen, 0); /* FIXME this is a potential security hole (buffer overrun) if you know more about wchar->mbyte conversion please explain */ diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 28b4ce5..b365965 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -753,6 +753,67 @@ static void test_WM_GETTEXT(void) DestroyWindow(hwndRichEdit); } +static void test_EM_GETTEXTRANGE(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + const char * text1 = "foo bar\r\nfoo bar"; + const char * text2 = "foo bar\rfoo bar"; + const char * expect = "bar\rfoo"; + char buffer[1024] = {0}; + LRESULT result; + TEXTRANGEA textRange; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text1); + + textRange.lpstrText = buffer; + textRange.chrg.cpMin = 4; + textRange.chrg.cpMax = 11; + result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange); + ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n", + result, strlen(expect)); + ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2); + + textRange.lpstrText = buffer; + textRange.chrg.cpMin = 4; + textRange.chrg.cpMax = 11; + result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange); + ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n", + result, strlen(expect)); + ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); + + DestroyWindow(hwndRichEdit); +} + +static void test_EM_GETSELTEXT(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + const char * text1 = "foo bar\r\nfoo bar"; + const char * text2 = "foo bar\rfoo bar"; + const char * expect = "bar\rfoo"; + char buffer[1024] = {0}; + LRESULT result; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text1); + + SendMessage(hwndRichEdit, EM_SETSEL, 4, 11); + result = SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer); + ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n", + result, strlen(expect)); + ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2); + + SendMessage(hwndRichEdit, EM_SETSEL, 4, 11); + result = SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer); + ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n", + result, strlen(expect)); + ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); + + DestroyWindow(hwndRichEdit); +} + /* FIXME: need to test unimplemented options and robustly test wparam */ static void test_EM_SETOPTIONS(void) { @@ -3028,6 +3089,8 @@ START_TEST( editor ) test_TM_PLAINTEXT(); test_EM_SETOPTIONS(); test_WM_GETTEXT(); + test_EM_GETTEXTRANGE(); + test_EM_GETSELTEXT(); test_EM_AUTOURLDETECT(); test_EM_SETUNDOLIMIT(); test_ES_PASSWORD(); diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 6fe027b..21972ab 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -464,6 +464,73 @@ static void test_EM_LINELENGTH(void) DestroyWindow(hwndRichEdit); } +static void test_EM_GETTEXTRANGE(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + const char * text1 = "foo bar\r\nfoo bar"; + const char * text2 = "foo bar\rfoo bar"; + const char * expect1 = "bar\r\nfoo"; + const char * expect2 = "bar\rfoo"; + char buffer[1024] = {0}; + LRESULT result; + TEXTRANGEA textRange; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text1); + + textRange.lpstrText = buffer; + textRange.chrg.cpMin = 4; + textRange.chrg.cpMax = 12; + result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange); + ok(result == 8, "EM_GETTEXTRANGE returned %ld, expected %d\n", + result, strlen(expect1)); + ok(!strcmp(expect1, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2); + + textRange.lpstrText = buffer; + textRange.chrg.cpMin = 4; + textRange.chrg.cpMax = 11; + result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange); + ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n", + result, strlen(expect2)); + todo_wine { + ok(!strcmp(expect2, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); + } + + DestroyWindow(hwndRichEdit); +} + +static void test_EM_GETSELTEXT(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + const char * text1 = "foo bar\r\nfoo bar"; + const char * text2 = "foo bar\rfoo bar"; + const char * expect1 = "bar\r\nfoo"; + const char * expect2 = "bar\rfoo"; + char buffer[1024] = {0}; + LRESULT result; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text1); + + SendMessage(hwndRichEdit, EM_SETSEL, 4, 12); + result = SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer); + ok(result == 8, "EM_GETTEXTRANGE returned %ld, expected %d\n", + result, strlen(expect1)); + ok(!strcmp(expect1, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2); + + SendMessage(hwndRichEdit, EM_SETSEL, 4, 11); + result = SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer); + ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n", + result, strlen(expect2)); + todo_wine { + ok(!strcmp(expect2, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); + } + + DestroyWindow(hwndRichEdit); +} + START_TEST( editor ) { MSG msg; @@ -475,6 +542,8 @@ START_TEST( editor ) ok(hmoduleRichEdit != NULL, "error: %d\n", (int) GetLastError()); test_WM_SETTEXT(); + test_EM_GETTEXTRANGE(); + test_EM_GETSELTEXT(); test_WM_GETTEXTLENGTH(); test_EM_STREAMIN(); test_EM_STREAMOUT();
1
0
0
0
Alex Villacís Lasso : richedit: EM_LINELENGTH: honor CR and LF counters.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: d95cbeef671186421da94a585d6201e524e428d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d95cbeef671186421da94a585…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 18:14:13 2008 -0500 richedit: EM_LINELENGTH: honor CR and LF counters. Add fixup to ME_FindItemAtOffset(), fixes crash by null-pointer access. Add tests for EM_LINELENGTH. --- dlls/riched20/editor.c | 19 ++++++++++++++++--- dlls/riched20/tests/editor.c | 36 +++++++++++++++++++++++++++++++++++- dlls/riched32/tests/editor.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 4 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index da61cd2..01502bf 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1190,6 +1190,7 @@ ME_DisplayItem * ME_FindItemAtOffset(ME_TextEditor *editor, ME_DIType nItemType, int nOffset, int *nItemOffset) { ME_DisplayItem *item = ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph); + int runLength; while (item && item->member.para.next_para->member.para.nCharOfs <= nOffset) item = ME_FindItemFwd(item, diParagraph); @@ -1206,7 +1207,10 @@ ME_FindItemAtOffset(ME_TextEditor *editor, ME_DIType nItemType, int nOffset, int do { item = ME_FindItemFwd(item, diRun); - } while (item && (item->member.run.nCharOfs + ME_StrLen(item->member.run.strText) <= nOffset)); + runLength = ME_StrLen(item->member.run.strText); + if (item->member.run.nFlags & MERF_ENDPARA) + runLength = item->member.run.nCR + item->member.run.nLF; + } while (item && (item->member.run.nCharOfs + runLength <= nOffset)); if (item) { nOffset -= item->member.run.nCharOfs; if (nItemOffset) @@ -2735,8 +2739,17 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (item_end->type == diStartRow) nNextLineOfs = ME_CharOfsFromRunOfs(editor, ME_FindItemFwd(item_end, diRun), 0); else - nNextLineOfs = ME_FindItemFwd(item, diParagraphOrEnd)->member.para.nCharOfs - - (editor->bEmulateVersion10?2:1); + { + ME_DisplayItem *endPara; + + nNextLineOfs = ME_FindItemFwd(item, diParagraphOrEnd)->member.para.nCharOfs; + endPara = ME_FindItemFwd(item, diParagraphOrEnd); + endPara = ME_FindItemBack(endPara, diRun); + assert(endPara); + assert(endPara->type == diRun); + assert(endPara->member.run.nFlags & MERF_ENDPARA); + nNextLineOfs -= endPara->member.run.nCR + endPara->member.run.nLF; + } nChars = nNextLineOfs - nThisLineOfs; TRACE("EM_LINELENGTH(%ld)==%d\n",wParam, nChars); return nChars; diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index d78c7f6..28b4ce5 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -261,6 +261,40 @@ static void test_EM_GETLINE(void) DestroyWindow(hwndRichEdit); } +static void test_EM_LINELENGTH(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + const char * text = + "richedit1\r" + "richedit1\n" + "richedit1\r\n" + "richedit1"; + int offset_test[10][2] = { + {0, 9}, + {5, 9}, + {10, 9}, + {15, 9}, + {20, 9}, + {25, 9}, + {30, 9}, + {35, 9}, + {40, 0}, + {45, 0}, + }; + int i; + LRESULT result; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); + + for (i = 0; i < 10; i++) { + result = SendMessage(hwndRichEdit, EM_LINELENGTH, offset_test[i][0], 0); + ok(result == offset_test[i][1], "Length of line at offset %d is %ld, expected %d\n", + offset_test[i][0], result, offset_test[i][1]); + } + + DestroyWindow(hwndRichEdit); +} + static int get_scroll_pos_y(HWND hwnd) { POINT p = {-1, -1}; @@ -2972,7 +3006,6 @@ static void test_eventMask(void) } - START_TEST( editor ) { MSG msg; @@ -2989,6 +3022,7 @@ START_TEST( editor ) test_EM_SCROLLCARET(); test_EM_SCROLL(); test_WM_SETTEXT(); + test_EM_LINELENGTH(); test_EM_SETCHARFORMAT(); test_EM_SETTEXTMODE(); test_TM_PLAINTEXT(); diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 106cd65..6fe027b 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -430,6 +430,39 @@ static void test_EM_GETLINE(void) DestroyWindow(hwndRichEdit); } +static void test_EM_LINELENGTH(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + const char * text = + "richedit1\r" + "richedit1\n" + "richedit1\r\n" + "richedit1\r\r\r\r\r\n"; + int offset_test[10][2] = { + {0, 9}, + {5, 9}, + {10, 9}, + {15, 9}, + {20, 9}, + {25, 9}, + {30, 9}, + {35, 9}, + {40, 9}, /* <----- in the middle of the \r run, but run not counted */ + {45, 0}, + }; + int i; + LRESULT result; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); + + for (i = 0; i < 10; i++) { + result = SendMessage(hwndRichEdit, EM_LINELENGTH, offset_test[i][0], 0); + ok(result == offset_test[i][1], "Length of line at offset %d is %ld, expected %d\n", + offset_test[i][0], result, offset_test[i][1]); + } + + DestroyWindow(hwndRichEdit); +} START_TEST( editor ) { @@ -446,6 +479,7 @@ START_TEST( editor ) test_EM_STREAMIN(); test_EM_STREAMOUT(); test_EM_GETLINE(); + test_EM_LINELENGTH(); /* Set the environment variable WINETEST_RICHED32 to keep windows * responsive and open for 30 seconds. This is useful for debugging.
1
0
0
0
Alex Villacís Lasso : richedit: EM_GETLINE: honor CR and LF counters.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 3968a67eb9faa428365c5a2ca42d15e0f14d4d9c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3968a67eb9faa428365c5a2ca…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 16:43:14 2008 -0500 richedit: EM_GETLINE: honor CR and LF counters. Add richedit 1.0 tests for EM_GETLINE. --- dlls/riched20/editor.c | 50 ++++++++++++++++---------- dlls/riched32/tests/editor.c | 79 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 19 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 7a0dce7..da61cd2 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2608,11 +2608,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, { ME_DisplayItem *run; const unsigned int nMaxChars = *(WORD *) lParam; - unsigned int nEndChars, nCharsLeft = nMaxChars; + unsigned int nCharsLeft = nMaxChars; char *dest = (char *) lParam; - /* rich text editor 1.0 uses \r\n for line end, 2.0 uses just \r; - we need to know how if we have the extra \n or not */ - int nLF = editor->bEmulateVersion10; + BOOL wroteNull = FALSE; TRACE("EM_GETLINE: row=%d, nMaxChars=%d (%s)\n", (int) wParam, nMaxChars, unicode ? "Unicode" : "Ansi"); @@ -2640,24 +2638,38 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, nCharsLeft -= nCopy; } - /* append \r\0 (or \r\n\0 in 1.0), space allowing */ - nEndChars = min(nCharsLeft, 2 + nLF); - nCharsLeft -= nEndChars; - if (unicode) + /* append line termination, space allowing */ + if (nCharsLeft > 0) { - const WCHAR src[] = {'\r', '\0'}; - const WCHAR src10[] = {'\r', '\n', '\0'}; - lstrcpynW((LPWSTR) dest, nLF ? src10 : src, nEndChars); + if (run && (run->member.run.nFlags & MERF_ENDPARA)) + { + unsigned int i; + /* Write as many \r as encoded in end-of-paragraph, space allowing */ + for (i = 0; i < run->member.run.nCR && nCharsLeft > 0; i++, nCharsLeft--) + { + *((WCHAR *)dest) = '\r'; + dest += unicode ? sizeof(WCHAR) : 1; + } + /* Write as many \n as encoded in end-of-paragraph, space allowing */ + for (i = 0; i < run->member.run.nLF && nCharsLeft > 0; i++, nCharsLeft--) + { + *((WCHAR *)dest) = '\n'; + dest += unicode ? sizeof(WCHAR) : 1; + } + } + if (nCharsLeft > 0) + { + if (unicode) + *((WCHAR *)dest) = '\0'; + else + *dest = '\0'; + nCharsLeft--; + wroteNull = TRUE; + } } - else - lstrcpynA(dest, nLF ? "\r\n" : "\r", nEndChars); - - TRACE("EM_GETLINE: got %u bytes\n", nMaxChars - nCharsLeft); - if (nEndChars == 2 + nLF) - return nMaxChars - nCharsLeft - 1; /* don't count \0 */ - else - return nMaxChars - nCharsLeft; + TRACE("EM_GETLINE: got %u characters\n", nMaxChars - nCharsLeft); + return nMaxChars - nCharsLeft - (wroteNull ? 1 : 0); } case EM_GETLINECOUNT: { diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 4bf35ab..106cd65 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -353,6 +353,84 @@ static void test_EM_STREAMOUT(void) DestroyWindow(hwndRichEdit); } +static const struct getline_s { + int line; + size_t buffer_len; + const char *text; + int wine_todo; +} gl[] = { + {0, 10, "foo bar\r\n", 0}, + {1, 10, "\n", 1}, + {2, 10, "bar\n", 1}, + {3, 10, "\r\n", 0}, + + /* Buffer smaller than line length */ + {0, 2, "foo bar\r", 0}, + {0, 1, "foo bar\r", 0}, + {0, 0, "foo bar\r", 0} +}; + +static void test_EM_GETLINE(void) +{ + int i; + HWND hwndRichEdit = new_richedit(NULL); + static const int nBuf = 1024; + char dest[1024], origdest[1024]; + const char text[] = "foo bar\r\n" + "\n" + "bar\n"; + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); + + memset(origdest, 0xBB, nBuf); + for (i = 0; i < sizeof(gl)/sizeof(struct getline_s); i++) + { + int nCopied; + int expected_nCopied = min(gl[i].buffer_len, strlen(gl[i].text)); + int expected_bytes_written = min(gl[i].buffer_len, strlen(gl[i].text) + 1); + memset(dest, 0xBB, nBuf); + *(WORD *) dest = gl[i].buffer_len; + + /* EM_GETLINE appends a "\r\0" to the end of the line + * nCopied counts up to and including the '\r' */ + nCopied = SendMessage(hwndRichEdit, EM_GETLINE, gl[i].line, (LPARAM) dest); + if (gl[i].wine_todo) todo_wine { + ok(nCopied == expected_nCopied, "%d: %d!=%d\n", i, nCopied, + expected_nCopied); + } else + ok(nCopied == expected_nCopied, "%d: %d!=%d\n", i, nCopied, + expected_nCopied); + /* two special cases since a parameter is passed via dest */ + if (gl[i].buffer_len == 0) + ok(!dest[0] && !dest[1] && !strncmp(dest+2, origdest+2, nBuf-2), + "buffer_len=0\n"); + else if (gl[i].buffer_len == 1) + ok(dest[0] == gl[i].text[0] && !dest[1] && + !strncmp(dest+2, origdest+2, nBuf-2), "buffer_len=1\n"); + else + { + if (gl[i].wine_todo) todo_wine { + ok(!strncmp(dest, gl[i].text, expected_bytes_written), + "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + ok(!strncmp(dest + expected_bytes_written, origdest + + expected_bytes_written, nBuf - expected_bytes_written), + "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + } + else + { + ok(!strncmp(dest, gl[i].text, expected_bytes_written), + "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + ok(!strncmp(dest + expected_bytes_written, origdest + + expected_bytes_written, nBuf - expected_bytes_written), + "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + } + } + } + + DestroyWindow(hwndRichEdit); +} + + START_TEST( editor ) { MSG msg; @@ -367,6 +445,7 @@ START_TEST( editor ) test_WM_GETTEXTLENGTH(); test_EM_STREAMIN(); test_EM_STREAMOUT(); + test_EM_GETLINE(); /* Set the environment variable WINETEST_RICHED32 to keep windows * responsive and open for 30 seconds. This is useful for debugging.
1
0
0
0
Alex Villacís Lasso : richedit: Add support for encoding number of CR and LF contained within a line break .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: d47f66191e1497fd2776528aac29b9ddedf82108 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d47f66191e1497fd2776528aa…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 13:29:53 2008 -0500 richedit: Add support for encoding number of CR and LF contained within a line break. --- dlls/riched20/caret.c | 10 +++++++++- dlls/riched20/editor.h | 2 +- dlls/riched20/editstr.h | 2 ++ dlls/riched20/list.c | 2 ++ dlls/riched20/para.c | 25 +++++++++++++++++-------- dlls/riched20/undo.c | 6 +++++- 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 7d50460..2153092 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -531,7 +531,15 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, } tmp_style = ME_GetInsertStyle(editor, nCursor); /* ME_SplitParagraph increases style refcount */ - tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style); + + /* TODO: move here and fix logic for pos updating according to emulation, + so that number of CR and LF encoded are a result of such logic, instead + of hardcoded as below. + */ + if (editor->bEmulateVersion10) + tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, 1, 1); + else + tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, 1, 0); p->pRun = ME_FindItemFwd(tp, diRun); end_run = ME_FindItemBack(tp, diRun); ME_ReleaseStyle(end_run->member.run.style); diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 0c0d324..992ce7f 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -220,7 +220,7 @@ int ME_twips2pointsY(ME_Context *c, int y); ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run); void ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end); void ME_MakeFirstParagraph(ME_TextEditor *editor); -ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style); +ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style, int numCR, int numLF); ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp); void ME_DumpParaStyle(ME_Paragraph *s); void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]); diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index 964f356..aedaefa 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -148,6 +148,7 @@ typedef struct tagME_Run POINT pt; /* relative to para's position */ struct tagME_TableCell *pCell; /* for MERF_CELL: points to respective cell in ME_Paragraph */ REOBJECT *ole_obj; /* FIXME: should be a union with strText (at least) */ + int nCR; int nLF; /* for MERF_ENDPARA: number of \r and \n characters encoded by run */ } ME_Run; typedef struct tagME_Document { @@ -217,6 +218,7 @@ typedef struct tagME_UndoItem { ME_DisplayItem di; int nStart, nLen; + int nCR, nLF; /* used by diUndoSplitParagraph */ } ME_UndoItem; typedef struct tagME_TextBuffer diff --git a/dlls/riched20/list.c b/dlls/riched20/list.c index 14f9b17..951e7f3 100644 --- a/dlls/riched20/list.c +++ b/dlls/riched20/list.c @@ -200,6 +200,8 @@ void ME_DumpDocument(ME_TextBuffer *buffer) case diRun: TRACE(" - Run(\"%s\", %d)\n", debugstr_w(pItem->member.run.strText->szData), pItem->member.run.nCharOfs); + if (pItem->member.run.nFlags & MERF_ENDPARA) + TRACE(" - Paragraph end: %d CR, %d LF\n", pItem->member.run.nCR, pItem->member.run.nLF); break; case diTextEnd: TRACE("End(ofs=%d)\n", pItem->member.para.nCharOfs); diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index b2f8e6c..6f52910 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -110,7 +110,7 @@ void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_D } /* split paragraph at the beginning of the run */ -ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME_Style *style) +ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME_Style *style, int numCR, int numLF) { ME_DisplayItem *next_para = NULL; ME_DisplayItem *run_para = NULL; @@ -119,10 +119,12 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME ME_UndoItem *undo = NULL; int ofs; ME_DisplayItem *pp; - int end_len = (editor->bEmulateVersion10 ? 2 : 1); + int end_len = numCR + numLF; assert(run->type == diRun); + end_run->member.run.nCR = numCR; + end_run->member.run.nLF = numLF; run_para = ME_GetParagraph(run); assert(run_para->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); @@ -204,7 +206,7 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) ME_DisplayItem *pNext, *pFirstRunInNext, *pRun, *pTmp; int i, shift; ME_UndoItem *undo = NULL; - int end_len = (editor->bEmulateVersion10 ? 2 : 1); + int end_len; assert(tp->type == diParagraph); assert(tp->member.para.next_para); @@ -212,6 +214,15 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) pNext = tp->member.para.next_para; + /* Need to locate end-of-paragraph run here, in order to know end_len */ + pRun = ME_FindItemBack(pNext, diRunOrParagraph); + + assert(pRun); + assert(pRun->type == diRun); + assert(pRun->member.run.nFlags & MERF_ENDPARA); + + end_len = pRun->member.run.nCR + pRun->member.run.nLF; + { /* null char format operation to store the original char format for the ENDPARA run */ CHARFORMAT2W fmt; @@ -222,18 +233,16 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) if (undo) { undo->nStart = pNext->member.para.nCharOfs - end_len; + undo->nCR = pRun->member.run.nCR; + undo->nLF = pRun->member.run.nLF; assert(pNext->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); *undo->di.member.para.pFmt = *pNext->member.para.pFmt; } shift = pNext->member.para.nCharOfs - tp->member.para.nCharOfs - end_len; - pRun = ME_FindItemBack(pNext, diRunOrParagraph); pFirstRunInNext = ME_FindItemFwd(pNext, diRunOrParagraph); - - assert(pRun); - assert(pRun->type == diRun); - assert(pRun->member.run.nFlags & MERF_ENDPARA); + assert(pFirstRunInNext->type == diRun); /* if some cursor points at end of paragraph, make it point to the first diff --git a/dlls/riched20/undo.c b/dlls/riched20/undo.c index 43f8810..a26f0e0 100644 --- a/dlls/riched20/undo.c +++ b/dlls/riched20/undo.c @@ -56,6 +56,7 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_Disp else { ME_DisplayItem *pItem = (ME_DisplayItem *)ALLOC_OBJ(ME_UndoItem); + ((ME_UndoItem *)pItem)->nCR = ((ME_UndoItem *)pItem)->nLF = -1; switch(type) { case diUndoEndTransaction: @@ -225,7 +226,10 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) ME_CursorFromCharOfs(editor, pUItem->nStart, &tmp); if (tmp.nOffset) tmp.pRun = ME_SplitRunSimple(editor, tmp.pRun, tmp.nOffset); - new_para = ME_SplitParagraph(editor, tmp.pRun, tmp.pRun->member.run.style); + assert(pUItem->nCR >= 0); + assert(pUItem->nLF >= 0); + new_para = ME_SplitParagraph(editor, tmp.pRun, tmp.pRun->member.run.style, + pUItem->nCR, pUItem->nLF); assert(pItem->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); *new_para->member.para.pFmt = *pItem->member.para.pFmt; break;
1
0
0
0
Alex Villacís Lasso : richedit: Fixups to move over to reliance on CR and LF counters.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 8d37388fe7ff2d45054e0a05374767b515dba237 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8d37388fe7ff2d45054e0a053…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 15:26:58 2008 -0500 richedit: Fixups to move over to reliance on CR and LF counters. Text streamout now honors CR and LF counters. Tests to pin down required EM_STREAMOUT behavior. --- dlls/riched20/editor.c | 3 ++ dlls/riched20/para.c | 2 + dlls/riched20/run.c | 12 +++++-- dlls/riched20/tests/editor.c | 55 +++++++++++++++++++++++++++++++++ dlls/riched20/writer.c | 45 ++++++++++++++++++++++----- dlls/riched32/tests/editor.c | 69 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 173 insertions(+), 13 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8d37388fe7ff2d45054e0…
1
0
0
0
Alex Villacís Lasso : richedit: Remove reliance on bEmulateVersion10 for end-of-line handling in ME_InternalDeleteText .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: fd557736806050d195991b6540aa3970a0d88f14 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fd557736806050d195991b654…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Sat Apr 26 15:48:24 2008 -0500 richedit: Remove reliance on bEmulateVersion10 for end-of-line handling in ME_InternalDeleteText. --- dlls/riched20/caret.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 2153092..56cd2b1 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -270,6 +270,8 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, ME_CursorFromCharOfs(editor, nOfs, &c); run = &c.pRun->member.run; if (run->nFlags & MERF_ENDPARA) { + int eollen = run->nCR + run->nLF; + if (!ME_FindItemFwd(c.pRun, diParagraph)) { return; @@ -277,9 +279,7 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, ME_JoinParagraphs(editor, ME_GetParagraph(c.pRun)); /* ME_SkipAndPropagateCharOffset(p->pRun, shift); */ ME_CheckCharOffsets(editor); - nChars--; - if (editor->bEmulateVersion10 && nChars) - nChars--; + nChars -= (eollen < nChars) ? eollen : nChars; continue; } else
1
0
0
0
Jeremy White : gdi32: Shift default height used in EnumStructs to the standard em size of 2048.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: f4625d1ae1109ee9a30faa8254b10779853f0ac2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4625d1ae1109ee9a30faa825…
Author: Jeremy White <jwhite(a)codeweavers.com> Date: Wed Apr 23 23:25:27 2008 -0500 gdi32: Shift default height used in EnumStructs to the standard em size of 2048. As pointed out by Dmitry Timoshkov. --- dlls/gdi32/freetype.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index bfa986d..82150d3 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3560,7 +3560,7 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf, font = alloc_font(); if(face->scalable) { - height = 100; + height = -2048; /* 2048 is the most common em size */ width = 0; } else { height = face->size.y_ppem >> 6;
1
0
0
0
Aric Stewart : hlink: Implement IExtensionServices.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 09af64cb83ca5122c0ce271d275fa3c35ab943ae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09af64cb83ca5122c0ce271d2…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Apr 28 13:44:16 2008 -0500 hlink: Implement IExtensionServices. --- dlls/hlink/extserv.c | 117 ++++++++++++++++++++++++++++++++++++++++++-------- include/hlguids.h | 2 + include/hlink.idl | 22 +++++++++ 3 files changed, 123 insertions(+), 18 deletions(-) diff --git a/dlls/hlink/extserv.c b/dlls/hlink/extserv.c index daedf9e..c4e95ab 100644 --- a/dlls/hlink/extserv.c +++ b/dlls/hlink/extserv.c @@ -26,9 +26,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(hlink); #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl))) typedef struct { - const IUnknownVtbl *lpIUnknownVtbl; - const IAuthenticateVtbl *lpIAuthenticateVtbl; - const IHttpNegotiateVtbl *lpIHttpNegotiateVtbl; + const IUnknownVtbl *lpIUnknownVtbl; + const IAuthenticateVtbl *lpIAuthenticateVtbl; + const IHttpNegotiateVtbl *lpIHttpNegotiateVtbl; + const IExtensionServicesVtbl *lpIExtensionServicesVtbl; LONG ref; IUnknown *outer; @@ -42,6 +43,7 @@ typedef struct { #define EXTSERVUNK(x) ((IUnknown*) &(x)->lpIUnknownVtbl) #define AUTHENTICATE(x) ((IAuthenticate*) &(x)->lpIAuthenticateVtbl) #define HTTPNEGOTIATE(x) ((IHttpNegotiate*) &(x)->lpIHttpNegotiateVtbl) +#define EXTENSIONSERVICES(x) ((IExtensionServices*) &(x)->lpIExtensionServicesVtbl) #define EXTSERVUNK_THIS(iface) DEFINE_THIS(ExtensionService, IUnknown, iface) @@ -60,6 +62,9 @@ static HRESULT WINAPI ExtServUnk_QueryInterface(IUnknown *iface, REFIID riid, vo }else if(IsEqualGUID(&IID_IHttpNegotiate, riid)) { TRACE("(%p)->(IID_IHttpNegotiate %p)\n", This, ppv); *ppv = HTTPNEGOTIATE(This); + }else if(IsEqualGUID(&IID_IExtensionServices, riid)) { + TRACE("(%p)->(IID_IExtensionServices %p)\n", This, ppv); + *ppv = EXTENSIONSERVICES(This); } if(*ppv) { @@ -209,6 +214,90 @@ static const IHttpNegotiateVtbl HttpNegotiateVtbl = { HttpNegotiate_OnResponse }; +#define EXTENSIONSERVICES_THIS(iface) DEFINE_THIS(ExtensionService, IExtensionServices, iface) + +static HRESULT WINAPI ExtServ_QueryInterface(IExtensionServices *iface, REFIID riid, void **ppv) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + return IUnknown_QueryInterface(This->outer, riid, ppv); +} + +static ULONG WINAPI ExtServ_AddRef(IExtensionServices *iface) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + return IUnknown_AddRef(This->outer); +} + +static ULONG WINAPI ExtServ_Release(IExtensionServices *iface) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + return IUnknown_Release(This->outer); +} + +static HRESULT ExtServ_ImplSetAdditionalHeaders(ExtensionService* This, LPCWSTR pwzAdditionalHeaders) +{ + int len = 0; + + heap_free(This->headers); + This->headers = NULL; + + if (!pwzAdditionalHeaders) + return S_OK; + + len = strlenW(pwzAdditionalHeaders); + + if(len && pwzAdditionalHeaders[len-1] != '\n' && pwzAdditionalHeaders[len-1] != '\r') { + static const WCHAR endlW[] = {'\r','\n',0}; + This->headers = heap_alloc(len*sizeof(WCHAR) + sizeof(endlW)); + memcpy(This->headers, pwzAdditionalHeaders, len*sizeof(WCHAR)); + memcpy(This->headers+len, endlW, sizeof(endlW)); + }else { + This->headers = hlink_strdupW(pwzAdditionalHeaders); + } + + return S_OK; +} + +static HRESULT WINAPI ExtServ_SetAdditionalHeaders(IExtensionServices* iface, LPCWSTR pwzAdditionalHeaders) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + + TRACE("(%p)->(%s)\n", This, debugstr_w(pwzAdditionalHeaders)); + + return ExtServ_ImplSetAdditionalHeaders(This,pwzAdditionalHeaders); +} + +static HRESULT ExtServ_ImplSetAuthenticateData(ExtensionService* This, HWND phwnd, LPCWSTR pwzUsername, LPCWSTR pwzPassword) +{ + heap_free(This->username); + heap_free(This->password); + + This->hwnd = phwnd; + This->username = hlink_strdupW(pwzUsername); + This->password = hlink_strdupW(pwzPassword); + + return S_OK; +} + +static HRESULT WINAPI ExtServ_SetAuthenticateData(IExtensionServices* iface, HWND phwnd, LPCWSTR pwzUsername, LPCWSTR pwzPassword) +{ + ExtensionService *This = EXTENSIONSERVICES_THIS(iface); + + TRACE("(%p)->(%p %s %s)\n", This, phwnd, debugstr_w(pwzUsername), debugstr_w(pwzPassword)); + + return ExtServ_ImplSetAuthenticateData(This, phwnd, pwzUsername, pwzPassword); +} + +#undef EXTENSIONSERVICES_THIS + +static const IExtensionServicesVtbl ExtServVtbl = { + ExtServ_QueryInterface, + ExtServ_AddRef, + ExtServ_Release, + ExtServ_SetAdditionalHeaders, + ExtServ_SetAuthenticateData +}; + /*********************************************************************** * HlinkCreateExtensionServices (HLINK.@) */ @@ -217,7 +306,6 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders, IUnknown *punkOuter, REFIID riid, void** ppv) { ExtensionService *ret; - int len = 0; HRESULT hres = S_OK; TRACE("%s %p %s %s %p %s %p\n",debugstr_w(pwzAdditionalHeaders), @@ -229,22 +317,15 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders, ret->lpIUnknownVtbl = &ExtServUnkVtbl; ret->lpIAuthenticateVtbl = &AuthenticateVtbl; ret->lpIHttpNegotiateVtbl = &HttpNegotiateVtbl; + ret->lpIExtensionServicesVtbl= &ExtServVtbl; ret->ref = 1; - ret->hwnd = phwnd; - ret->username = hlink_strdupW(pszUsername); - ret->password = hlink_strdupW(pszPassword); - - if(pwzAdditionalHeaders) - len = strlenW(pwzAdditionalHeaders); + ret->headers = NULL; + ret->hwnd = NULL; + ret->username = NULL; + ret->password = NULL; - if(len && pwzAdditionalHeaders[len-1] != '\n' && pwzAdditionalHeaders[len-1] != '\r') { - static const WCHAR endlW[] = {'\r','\n',0}; - ret->headers = heap_alloc(len*sizeof(WCHAR) + sizeof(endlW)); - memcpy(ret->headers, pwzAdditionalHeaders, len*sizeof(WCHAR)); - memcpy(ret->headers+len, endlW, sizeof(endlW)); - }else { - ret->headers = hlink_strdupW(pwzAdditionalHeaders); - } + ExtServ_ImplSetAuthenticateData(ret, phwnd, pszUsername, pszPassword); + ExtServ_ImplSetAdditionalHeaders(ret, pwzAdditionalHeaders); if(!punkOuter) { ret->outer = EXTSERVUNK(ret); diff --git a/include/hlguids.h b/include/hlguids.h index 77bac3e..7a45e66 100644 --- a/include/hlguids.h +++ b/include/hlguids.h @@ -25,5 +25,7 @@ DEFINE_GUID(CLSID_StdHlink, 0x79eac9d0, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa,0x00,0x4b,0xa9,0x0b); DEFINE_GUID(CLSID_StdHlinkBrowseContext, 0x79eac9d1, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa,0x00,0x4b,0xa9,0x0b); +DEFINE_GUID(CLSID_IID_IExtensionServices, + 0x79eac9cb, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa,0x00,0x4b,0xa9,0x0b); #endif diff --git a/include/hlink.idl b/include/hlink.idl index c59cd32..886acb3 100644 --- a/include/hlink.idl +++ b/include/hlink.idl @@ -416,3 +416,25 @@ interface IHlinkFrame : IUnknown [in, unique] LPCWSTR pwzLocation, [in, unique] LPCWSTR pwzFriendlyName); } + +/***************************************************************************** + * IExtensionServices interface + */ +[ + object, + uuid(79eac9cb-baf9-11ce-8c82-00aa004ba90b), + pointer_default(unique) +] + +interface IExtensionServices: IUnknown +{ + typedef IExtensionServices *LPEXTENSIONSERVICES; + + HRESULT SetAdditionalHeaders( + [in] LPCWSTR pwzAdditionalHeaders); + + HRESULT SetAuthenticateData( + [in] HWND phwnd, + [in] LPCWSTR pwzUsername, + [in] LPCWSTR pwzPassword); +}
1
0
0
0
Kusanagi Kouichi : winex11: Allow XIM server to be started after Wine.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: bf05ded740b283e64a33d8139170654e0ac443bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf05ded740b283e64a33d8139…
Author: Kusanagi Kouichi <slash(a)ma.neweb.ne.jp> Date: Tue Apr 29 20:03:51 2008 +0900 winex11: Allow XIM server to be started after Wine. --- dlls/winex11.drv/ime.c | 17 ----------------- dlls/winex11.drv/x11drv.h | 1 - dlls/winex11.drv/xim.c | 1 - 3 files changed, 0 insertions(+), 19 deletions(-) diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c index 5d36612..ffd8e80 100644 --- a/dlls/winex11.drv/ime.c +++ b/dlls/winex11.drv/ime.c @@ -75,7 +75,6 @@ static const WCHAR UI_CLASS_NAME[] = {'W','i','n','e','X','1','1','I','M','E',0} static HIMC *hSelectedFrom = NULL; static INT hSelectedCount = 0; -static BOOL hXIMPresent = FALSE; /* MSIME messages */ static UINT WM_MSIME_SERVICE; @@ -521,11 +520,6 @@ BOOL WINAPI ImeInquire(LPIMEINFO lpIMEInfo, LPWSTR lpszUIClass, LPCWSTR lpszOption) { TRACE("\n"); - if (!hXIMPresent) - { - ERR("No XIM in the back end\n"); - return FALSE; - } lpIMEInfo->dwPrivateDataSize = sizeof (IMEPRIVATE); lpIMEInfo->fdwProperty = IME_PROP_UNICODE | IME_PROP_AT_CARET; lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE; @@ -592,12 +586,6 @@ BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect) return FALSE; } - if (!hXIMPresent) - { - ERR("No XIM in the back end\n"); - return FALSE; - } - if (!hIMC) return TRUE; @@ -981,11 +969,6 @@ void IME_SetOpenStatus(BOOL fOpen) ImmSetOpenStatus(RealIMC(FROM_X11), fOpen); } -void IME_XIMPresent(BOOL present) -{ - hXIMPresent = present; -} - LRESULT IME_SendMessageToSelectedHWND(UINT msg, WPARAM wParam, LPARAM lParam) { LPINPUTCONTEXT lpIMC; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 2f2e583..c543ef8 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -277,7 +277,6 @@ extern BOOL destroy_glxpixmap(Display *display, XID glxpixmap); extern void IME_RegisterClasses(HINSTANCE hImeInst); extern void IME_UnregisterClasses(HINSTANCE hImeInst); extern void IME_SetOpenStatus(BOOL fOpen); -extern void IME_XIMPresent(BOOL present); extern LRESULT IME_SendMessageToSelectedHWND(UINT msg, WPARAM wParam, LPARAM lParam); extern INT IME_GetCursorPos(); extern void IME_SetCursorPos(DWORD pos); diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index c44a869..a4fbdb2 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -475,7 +475,6 @@ static void X11DRV_OpenIM(Display *display, XPointer ptr, XPointer data) thread_data->xim = xim; XUnregisterIMInstantiateCallback(display, NULL, NULL, NULL, X11DRV_OpenIM, NULL); wine_tsx11_unlock(); - IME_XIMPresent(TRUE); IME_UpdateAssociation(NULL); }
1
0
0
0
Tijl Coosemans : hhctrl: Fix NULL pointer dereference in some failure cases .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: efa040119ba2a636c654e69b5caed1829b5c0968 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=efa040119ba2a636c654e69b5…
Author: Tijl Coosemans <tijl(a)ulyssis.org> Date: Mon Apr 28 22:41:47 2008 +0200 hhctrl: Fix NULL pointer dereference in some failure cases. --- dlls/hhctrl.ocx/hhctrl.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c index e663c11..a555a42 100644 --- a/dlls/hhctrl.ocx/hhctrl.c +++ b/dlls/hhctrl.ocx/hhctrl.c @@ -123,14 +123,17 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat } info = CreateHelpViewer(filename); + if(!info) + return NULL; + + if(!index) + index = info->WinType.pszFile; - if (info) + res = NavigateToChm(info, info->pCHMInfo->szFile, index); + if(!res) { - if (!index) - index = info->WinType.pszFile; - res = NavigateToChm(info, info->pCHMInfo->szFile, index); - if(!res) - ReleaseHelpViewer(info); + ReleaseHelpViewer(info); + return NULL; } return info->WinType.hwndHelp; }
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipGetPathGradientCenterPointI.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 9cce789881caddb67be8dede18adbe854af16950 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9cce789881caddb67be8dede1…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Apr 29 00:10:25 2008 +0400 gdiplus: Implemented GdipGetPathGradientCenterPointI. --- dlls/gdiplus/brush.c | 19 +++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusflat.h | 1 + 3 files changed, 21 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 5d0a1de..31c7cf1 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -488,6 +488,25 @@ GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad, return Ok; } +GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient *grad, + GpPoint *point) +{ + GpStatus ret; + GpPointF ptf; + + if(!point) + return InvalidParameter; + + ret = GdipGetPathGradientCenterPoint(grad,&ptf); + + if(ret == Ok){ + point->X = roundr(ptf.X); + point->Y = roundr(ptf.Y); + } + + return ret; +} + GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient *grad, REAL *x, REAL *y) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index c06fa2e..8e8e94f 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -329,7 +329,7 @@ @ stub GdipGetPathGradientBlendCount @ stub GdipGetPathGradientCenterColor @ stdcall GdipGetPathGradientCenterPoint(ptr ptr) -@ stub GdipGetPathGradientCenterPointI +@ stdcall GdipGetPathGradientCenterPointI(ptr ptr) @ stdcall GdipGetPathGradientFocusScales(ptr ptr ptr) @ stdcall GdipGetPathGradientGammaCorrection(ptr ptr) @ stub GdipGetPathGradientPath diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index dbf1c85..49464d8 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -169,6 +169,7 @@ GpStatus WINGDIPAPI GdipGetLineRectI(GpLineGradient*,GpRect*); GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient*,ARGB*); GpStatus WINGDIPAPI GdipGetPathGradientCenterColor(GpPathGradient*,ARGB*); GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient*,GpPointF*); +GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient*,GpPoint*); GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient*,REAL*,REAL*); GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection(GpPathGradient*,BOOL*); GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient*,INT*);
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipFillEllipse/GdipFillEllipseI.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: fc2dc8bc2a81275c713f5014d3f9da2e13cb1811 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fc2dc8bc2a81275c713f5014d…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Apr 29 00:10:10 2008 +0400 gdiplus: Implemented GdipFillEllipse/GdipFillEllipseI. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/graphics.c | 35 +++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 ++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 2a3aa8a..c6a57a4 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -217,8 +217,8 @@ @ stub GdipFillClosedCurve2I @ stub GdipFillClosedCurve @ stub GdipFillClosedCurveI -@ stub GdipFillEllipse -@ stub GdipFillEllipseI +@ stdcall GdipFillEllipse(ptr ptr long long long long) +@ stdcall GdipFillEllipseI(ptr ptr long long long long) @ stdcall GdipFillPath(ptr ptr ptr) @ stdcall GdipFillPie(ptr ptr long long long long long long) @ stdcall GdipFillPieI(ptr ptr long long long long long long) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 4982c84..1cba138 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1682,6 +1682,41 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string return Ok; } +GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x, + REAL y, REAL width, REAL height) +{ + INT save_state; + GpPointF ptf[2]; + POINT pti[2]; + + if(!graphics || !brush) + return InvalidParameter; + + ptf[0].X = x; + ptf[0].Y = y; + ptf[1].X = x + width; + ptf[1].Y = y + height; + + save_state = SaveDC(graphics->hdc); + EndPath(graphics->hdc); + SelectObject(graphics->hdc, brush->gdibrush); + SelectObject(graphics->hdc, GetStockObject(NULL_PEN)); + + transform_and_round_points(graphics, pti, ptf, 2); + + Ellipse(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y); + + RestoreDC(graphics->hdc, save_state); + + return Ok; +} + +GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x, + INT y, INT width, INT height) +{ + return GdipFillEllipse(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height); +} + GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path) { INT save_state; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 73bf7c0..244656f 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -106,6 +106,8 @@ GpStatus WINGDIPAPI GdipDrawRectanglesI(GpGraphics*,GpPen*,GDIPCONST GpRect*,INT GpStatus WINGDIPAPI GdipDrawString(GpGraphics*,GDIPCONST WCHAR*,INT, GDIPCONST GpFont*,GDIPCONST RectF*, GDIPCONST GpStringFormat*, GDIPCONST GpBrush*); +GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL); +GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics*,GpBrush*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipFillPath(GpGraphics*,GpBrush*,GpPath*); GpStatus WINGDIPAPI GdipFillPie(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipFillPieI(GpGraphics*,GpBrush*,INT,INT,INT,INT,REAL,REAL);
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipDrawImagePointsRectI.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 79b49a8f19f1966a7a71cda671616d60bcdb3643 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=79b49a8f19f1966a7a71cda67…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Apr 29 00:10:05 2008 +0400 gdiplus: Implemented GdipDrawImagePointsRectI. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 21 +++++++++++++++++++++ include/gdiplusflat.h | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index a49da93..2a3aa8a 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -180,7 +180,7 @@ @ stub GdipDrawImagePoints @ stub GdipDrawImagePointsI @ stdcall GdipDrawImagePointsRect(ptr ptr ptr long long long long long long ptr ptr ptr) -@ stub GdipDrawImagePointsRectI +@ stdcall GdipDrawImagePointsRectI(ptr ptr ptr long long long long long long ptr ptr ptr) @ stdcall GdipDrawImageRect(ptr ptr long long long long) @ stdcall GdipDrawImageRectI(ptr ptr long long long long) @ stdcall GdipDrawImageRectRect(ptr ptr long long long long long long long long long ptr long ptr) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 4559390..4982c84 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1201,6 +1201,27 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image return Ok; } +GpStatus WINGDIPAPI GdipDrawImagePointsRectI(GpGraphics *graphics, GpImage *image, + GDIPCONST GpPoint *points, INT count, INT srcx, INT srcy, INT srcwidth, + INT srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes, + DrawImageAbort callback, VOID * callbackData) +{ + GpPointF pointsF[3]; + INT i; + + if(!points || count!=3) + return InvalidParameter; + + for(i = 0; i < count; i++){ + pointsF[i].X = (REAL)points[i].X; + pointsF[i].Y = (REAL)points[i].Y; + } + + return GdipDrawImagePointsRect(graphics, image, pointsF, count, (REAL)srcx, (REAL)srcy, + (REAL)srcwidth, (REAL)srcheight, srcUnit, imageAttributes, + callback, callbackData); +} + GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image, REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 15ab134..73bf7c0 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -80,7 +80,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics*,GpImage*, GDIPCONST GpPointF*,INT,REAL,REAL,REAL,REAL,GpUnit, GDIPCONST GpImageAttributes*,DrawImageAbort,VOID*); GpStatus WINGDIPAPI GdipDrawImagePointsRectI(GpGraphics*,GpImage*, - GDIPCONST GpPointF*,INT,INT,INT,INT,INT,GpUnit, + GDIPCONST GpPoint*,INT,INT,INT,INT,INT,GpUnit, GDIPCONST GpImageAttributes*,DrawImageAbort,VOID*); GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics*,GpImage*,REAL,REAL,REAL, REAL,REAL,REAL,REAL,REAL,GpUnit,GDIPCONST GpImageAttributes*,DrawImageAbort,
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipFillRectangles/GdipFillRectanglesI .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 7ce48b034609b642a6e9fdba935082d8185d3da1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7ce48b034609b642a6e9fdba9…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Apr 29 00:10:15 2008 +0400 gdiplus: Implemented GdipFillRectangles/GdipFillRectanglesI. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/graphics.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 ++ 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index c6a57a4..0aca002 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -228,8 +228,8 @@ @ stdcall GdipFillPolygonI(ptr ptr ptr long long) @ stdcall GdipFillRectangle(ptr ptr long long long long) @ stdcall GdipFillRectangleI(ptr ptr long long long long) -@ stub GdipFillRectangles -@ stub GdipFillRectanglesI +@ stdcall GdipFillRectangles(ptr ptr long) +@ stdcall GdipFillRectanglesI(ptr ptr long) @ stub GdipFillRegion @ stdcall GdipFindFirstImageItem(ptr ptr) @ stub GdipFindNextImageItem diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 1cba138..d60e7d3 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1922,6 +1922,50 @@ GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush, return Ok; } +GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, + INT count) +{ + GpStatus ret; + INT i; + + if(!rects) + return InvalidParameter; + + for(i = 0; i < count; i++){ + ret = GdipFillRectangle(graphics, brush, rects[i].X, rects[i].Y, rects[i].Width, rects[i].Height); + if(ret != Ok) return ret; + } + + return Ok; +} + +GpStatus WINGDIPAPI GdipFillRectanglesI(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRect *rects, + INT count) +{ + GpRectF *rectsF; + GpStatus ret; + INT i; + + if(!rects || count <= 0) + return InvalidParameter; + + rectsF = GdipAlloc(sizeof(GpRectF)*count); + if(!rectsF) + return OutOfMemory; + + for(i = 0; i < count; i++){ + rectsF[i].X = (REAL)rects[i].X; + rectsF[i].Y = (REAL)rects[i].Y; + rectsF[i].X = (REAL)rects[i].Width; + rectsF[i].Height = (REAL)rects[i].Height; + } + + ret = GdipFillRectangles(graphics,brush,rectsF,count); + GdipFree(rectsF); + + return ret; +} + /* FIXME: Compositing mode is not used anywhere except the getter/setter. */ GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics *graphics, CompositingMode *mode) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 244656f..5c9e0f9 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -119,6 +119,8 @@ GpStatus WINGDIPAPI GdipFillPolygon2(GpGraphics*,GpBrush*,GDIPCONST GpPointF*,IN GpStatus WINGDIPAPI GdipFillPolygon2I(GpGraphics*,GpBrush*,GDIPCONST GpPoint*,INT); GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics*,GpBrush*,INT,INT,INT,INT); +GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics*,GpBrush*,GDIPCONST GpRectF*,INT); +GpStatus WINGDIPAPI GdipFillRectanglesI(GpGraphics*,GpBrush*,GDIPCONST GpRect*,INT); GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics*,CompositingMode*); GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*); GpStatus WINGDIPAPI GdipGetImageDimension(GpImage*,REAL*,REAL*);
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipGetDpiX/GdipGetDpiY.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: d5769957b4d340b3e4add942965f66e1d7657f88 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d5769957b4d340b3e4add9429…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Apr 29 00:10:20 2008 +0400 gdiplus: Implemented GdipGetDpiX/GdipGetDpiY. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/graphics.c | 20 ++++++++++++++++++++ include/gdiplusflat.h | 3 +++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 0aca002..c06fa2e 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -256,8 +256,8 @@ @ stub GdipGetCustomLineCapType @ stub GdipGetCustomLineCapWidthScale @ stub GdipGetDC -@ stub GdipGetDpiX -@ stub GdipGetDpiY +@ stdcall GdipGetDpiX(ptr ptr) +@ stdcall GdipGetDpiY(ptr ptr) @ stub GdipGetEffectParameterSize @ stub GdipGetEffectParameters @ stub GdipGetEmHeight diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index d60e7d3..2646a46 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2398,3 +2398,23 @@ GpStatus WINGDIPAPI GdipDrawPolygonI(GpGraphics *graphics,GpPen *pen,GDIPCONST G return ret; } + +GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL* dpi) +{ + if(!graphics || !dpi) + return InvalidParameter; + + *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX); + + return Ok; +} + +GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL* dpi) +{ + if(!graphics || !dpi) + return InvalidParameter; + + *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY); + + return Ok; +} diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 5c9e0f9..dbf1c85 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -343,6 +343,9 @@ GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat*,StringAlignment GpStatus WINGDIPAPI GdipSetStringFormatTrimming(GpStringFormat*,StringTrimming); GpStatus WINGDIPAPI GdipCloneStringFormat(GDIPCONST GpStringFormat*,GpStringFormat**); +GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics*,REAL*); +GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics*,REAL*); + #ifdef __cplusplus } #endif
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipDrawImage.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 492470493ec2b8f2396ab42caaa61c410d01a7a6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=492470493ec2b8f2396ab42ca…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Apr 29 00:10:01 2008 +0400 gdiplus: Implemented GdipDrawImage. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 6 ++++++ include/gdiplusflat.h | 1 + 3 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index d2baa36..a49da93 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -172,7 +172,7 @@ @ stub GdipDrawDriverString @ stub GdipDrawEllipse @ stub GdipDrawEllipseI -@ stub GdipDrawImage +@ stdcall GdipDrawImage(ptr ptr long long) @ stub GdipDrawImageFX @ stdcall GdipDrawImageI(ptr ptr long long) @ stub GdipDrawImagePointRect diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index b011ef7..4559390 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1115,6 +1115,12 @@ GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen, return ret; } +GpStatus WINGDIPAPI GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, REAL y) +{ + /* IPicture::Render uses LONG coords */ + return GdipDrawImageI(graphics,image,roundr(x),roundr(y)); +} + GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x, INT y) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index de1125e..15ab134 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -74,6 +74,7 @@ GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipDrawCurveI(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT); GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT,REAL); GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT,REAL); +GpStatus WINGDIPAPI GdipDrawImage(GpGraphics*,GpImage*,REAL,REAL); GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics*,GpImage*,INT,INT); GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics*,GpImage*, GDIPCONST GpPointF*,INT,REAL,REAL,REAL,REAL,GpUnit,
1
0
0
0
Roderick Colenbrander : wined3d: Fix a few small bugs in WineD3D_ChoosePixelFormat.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 4428cc32de1f99463ebaa990726c8bd7a3eef6c4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4428cc32de1f99463ebaa9907…
Author: Roderick Colenbrander <thunderbird2k(a)gmx.net> Date: Mon Apr 28 21:13:12 2008 +0000 wined3d: Fix a few small bugs in WineD3D_ChoosePixelFormat. --- dlls/wined3d/context.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index f185c33..d80ef06 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -133,6 +133,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DF /* Find a pixel format which EXACTLY matches our requirements (except for depth) */ for(i=0; i<nCfgs; i++) { BOOL exactDepthMatch = TRUE; + cfgs = &This->adapter->cfgs[i]; /* For now only accept RGBA formats. Perhaps some day we will * allow floating point formats for pbuffers. */ @@ -194,7 +195,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DF if(!iPixelFormat && !findCompatible) { ERR("Can't find a suitable iPixelFormat\n"); return FALSE; - } else { + } else if(!iPixelFormat) { PIXELFORMATDESCRIPTOR pfd; TRACE("Falling back to ChoosePixelFormat as we weren't able to find an exactly matching pixel format\n"); @@ -218,7 +219,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DF } } - TRACE("Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s\n", cfgs->iPixelFormat, debug_d3dformat(ColorFormat), debug_d3dformat(DepthStencilFormat)); + TRACE("Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s\n", iPixelFormat, debug_d3dformat(ColorFormat), debug_d3dformat(DepthStencilFormat)); return iPixelFormat; }
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipDrawCurve2I.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 00cfffbcb3653ecef6a59240b72df5c9b0e25b74 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=00cfffbcb3653ecef6a59240b…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Apr 29 00:09:44 2008 +0400 gdiplus: Implemented GdipDrawCurve2I. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 2c70823..298c5f7 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -164,7 +164,7 @@ @ stub GdipDrawClosedCurve @ stub GdipDrawClosedCurveI @ stdcall GdipDrawCurve2(ptr ptr ptr long long) -@ stub GdipDrawCurve2I +@ stdcall GdipDrawCurve2I(ptr ptr ptr long long) @ stub GdipDrawCurve3 @ stub GdipDrawCurve3I @ stub GdipDrawCurve diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index b8a2efa..d918d99 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1059,6 +1059,31 @@ GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen, return retval; } +GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen, + GDIPCONST GpPoint *points, INT count, REAL tension) +{ + GpPointF *pointsF; + GpStatus ret; + INT i; + + if(!points || count <= 0) + return InvalidParameter; + + pointsF = GdipAlloc(sizeof(GpPointF)*count); + if(!pointsF) + return OutOfMemory; + + for(i = 0; i < count; i++){ + pointsF[i].X = (REAL)points[i].X; + pointsF[i].Y = (REAL)points[i].Y; + } + + ret = GdipDrawCurve2(graphics,pen,pointsF,count,tension); + GdipFree(pointsF); + + return ret; +} + GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x, INT y) {
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipDrawCurve/GdipDrawCurveI.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: fe1782eeae53dfc124acb06f85aafc7ddec435cc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fe1782eeae53dfc124acb06f8…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Apr 29 00:09:55 2008 +0400 gdiplus: Implemented GdipDrawCurve/GdipDrawCurveI. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/graphics.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 298c5f7..d2baa36 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -167,8 +167,8 @@ @ stdcall GdipDrawCurve2I(ptr ptr ptr long long) @ stub GdipDrawCurve3 @ stub GdipDrawCurve3I -@ stub GdipDrawCurve -@ stub GdipDrawCurveI +@ stdcall GdipDrawCurve(ptr ptr ptr long) +@ stdcall GdipDrawCurveI(ptr ptr ptr long) @ stub GdipDrawDriverString @ stub GdipDrawEllipse @ stub GdipDrawEllipseI diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index d918d99..b011ef7 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1006,6 +1006,37 @@ GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1, return retval; } +GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics *graphics, GpPen *pen, + GDIPCONST GpPointF *points, INT count) +{ + return GdipDrawCurve2(graphics,pen,points,count,1.0); +} + +GpStatus WINGDIPAPI GdipDrawCurveI(GpGraphics *graphics, GpPen *pen, + GDIPCONST GpPoint *points, INT count) +{ + GpPointF *pointsF; + GpStatus ret; + INT i; + + if(!points || count <= 0) + return InvalidParameter; + + pointsF = GdipAlloc(sizeof(GpPointF)*count); + if(!pointsF) + return OutOfMemory; + + for(i = 0; i < count; i++){ + pointsF[i].X = (REAL)points[i].X; + pointsF[i].Y = (REAL)points[i].Y; + } + + ret = GdipDrawCurve(graphics,pen,pointsF,count); + GdipFree(pointsF); + + return ret; +} + /* Approximates cardinal spline with Bezier curves. */ GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, REAL tension)
1
0
0
0
Dmitry Timoshkov : gdi32: info->state.next is always NULL, there is no need to save/restore it.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 5c15cf5f12ee57df0bd67aa4858f990753e2de54 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5c15cf5f12ee57df0bd67aa48…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Apr 29 14:48:55 2008 +0900 gdi32: info->state.next is always NULL, there is no need to save/restore it. --- dlls/gdi32/enhmetafile.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c index 7c6068d..378ac4f 100644 --- a/dlls/gdi32/enhmetafile.c +++ b/dlls/gdi32/enhmetafile.c @@ -557,11 +557,7 @@ static void EMF_RestoreDC( enum_emh_data *info, INT level ) info->saved_state = state->next; state->next = NULL; if (--info->save_level < level) - { - EMF_dc_state *next = info->state.next; info->state = *state; - info->state.next = next; - } HeapFree( GetProcessHeap(), 0, state ); } } @@ -2279,7 +2275,7 @@ BOOL WINAPI EnumEnhMetaFile( return FALSE; } - info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + info = HeapAlloc( GetProcessHeap(), 0, sizeof (enum_emh_data) + sizeof(HANDLETABLE) * emh->nHandles ); if(!info) { @@ -2298,6 +2294,7 @@ BOOL WINAPI EnumEnhMetaFile( info->state.world_transform.eM12 = info->state.world_transform.eM21 = 0; info->state.world_transform.eDx = info->state.world_transform.eDy = 0; + info->state.next = NULL; info->save_level = 0; info->saved_state = NULL;
1
0
0
0
Dmitry Timoshkov : gdi32: Make the bitmap test pass under Windows 2000.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 80c1508bf1ed6fdbf450868230a8bb10cb1a537d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=80c1508bf1ed6fdbf45086823…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Apr 29 14:49:45 2008 +0900 gdi32: Make the bitmap test pass under Windows 2000. --- dlls/gdi32/tests/bitmap.c | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 00441c0..27a6c88 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -276,7 +276,7 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER { BITMAP bm; DIBSECTION ds; - INT ret, width_bytes; + INT ret, bm_width_bytes, dib_width_bytes; BYTE *buf; ret = GetObject(hbm, sizeof(bm), &bm); @@ -285,23 +285,25 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER ok(bm.bmType == 0, "wrong bm.bmType %d\n", bm.bmType); ok(bm.bmWidth == bmih->biWidth, "wrong bm.bmWidth %d\n", bm.bmWidth); ok(bm.bmHeight == bmih->biHeight, "wrong bm.bmHeight %d\n", bm.bmHeight); - width_bytes = DIB_GetWidthBytes(bm.bmWidth, bm.bmBitsPixel); - ok(bm.bmWidthBytes == width_bytes, "wrong bm.bmWidthBytes %d != %d\n", bm.bmWidthBytes, width_bytes); + dib_width_bytes = DIB_GetWidthBytes(bm.bmWidth, bm.bmBitsPixel); + bm_width_bytes = BITMAP_GetWidthBytes(bm.bmWidth, bm.bmBitsPixel); + if (bm.bmWidthBytes != dib_width_bytes) /* Win2k bug */ + ok(bm.bmWidthBytes == bm_width_bytes, "wrong bm.bmWidthBytes %d != %d\n", bm.bmWidthBytes, bm_width_bytes); + else + ok(bm.bmWidthBytes == dib_width_bytes, "wrong bm.bmWidthBytes %d != %d\n", bm.bmWidthBytes, dib_width_bytes); ok(bm.bmPlanes == bmih->biPlanes, "wrong bm.bmPlanes %d\n", bm.bmPlanes); ok(bm.bmBitsPixel == bmih->biBitCount, "bm.bmBitsPixel %d != %d\n", bm.bmBitsPixel, bmih->biBitCount); ok(bm.bmBits == bits, "wrong bm.bmBits %p != %p\n", bm.bmBits, bits); buf = HeapAlloc(GetProcessHeap(), 0, bm.bmWidthBytes * bm.bmHeight + 4096); - width_bytes = BITMAP_GetWidthBytes(bm.bmWidth, bm.bmBitsPixel); - /* GetBitmapBits returns not 32-bit aligned data */ ret = GetBitmapBits(hbm, 0, NULL); - ok(ret == width_bytes * bm.bmHeight, "%d != %d\n", ret, width_bytes * bm.bmHeight); + ok(ret == bm_width_bytes * bm.bmHeight, "%d != %d\n", ret, bm_width_bytes * bm.bmHeight); memset(buf, 0xAA, bm.bmWidthBytes * bm.bmHeight + 4096); ret = GetBitmapBits(hbm, bm.bmWidthBytes * bm.bmHeight + 4096, buf); - ok(ret == width_bytes * bm.bmHeight, "%d != %d\n", ret, width_bytes * bm.bmHeight); + ok(ret == bm_width_bytes * bm.bmHeight, "%d != %d\n", ret, bm_width_bytes * bm.bmHeight); HeapFree(GetProcessHeap(), 0, buf); @@ -331,8 +333,9 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER ok(ret == sizeof(ds), "wrong size %d\n", ret); ok(ds.dsBm.bmBits == bits, "wrong bm.bmBits %p != %p\n", ds.dsBm.bmBits, bits); - ok(ds.dsBmih.biSizeImage == ds.dsBm.bmWidthBytes * ds.dsBm.bmHeight, "%u != %u\n", - ds.dsBmih.biSizeImage, ds.dsBm.bmWidthBytes * ds.dsBm.bmHeight); + if (ds.dsBm.bmWidthBytes != bm_width_bytes) /* Win2k bug */ + ok(ds.dsBmih.biSizeImage == ds.dsBm.bmWidthBytes * ds.dsBm.bmHeight, "%u != %u\n", + ds.dsBmih.biSizeImage, ds.dsBm.bmWidthBytes * ds.dsBm.bmHeight); ok(bmih->biSizeImage == 0, "%u != 0\n", bmih->biSizeImage); ds.dsBmih.biSizeImage = 0; @@ -969,11 +972,6 @@ static void test_bitmap(void) SetLastError(0xdeadbeef); hbmp = CreateBitmap(0x7ffffff, 1, 1, 1, NULL); - ok(hbmp != 0, "CreateBitmap should not fail\n"); - DeleteObject(hbmp); - - SetLastError(0xdeadbeef); - hbmp = CreateBitmap(0x7ffffff, 9, 1, 1, NULL); if (!hbmp) { ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY, @@ -983,6 +981,13 @@ static void test_bitmap(void) DeleteObject(hbmp); SetLastError(0xdeadbeef); + hbmp = CreateBitmap(0x7ffffff, 9, 1, 1, NULL); + ok(!hbmp, "CreateBitmap should fail\n"); + ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY /* XP */ || + GetLastError() == ERROR_INVALID_PARAMETER /* Win2k */, + "expected ERROR_NOT_ENOUGH_MEMORY, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); hbmp = CreateBitmap(0x7ffffff + 1, 1, 1, 1, NULL); ok(!hbmp, "CreateBitmap should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER,
1
0
0
0
Maarten Lankhorst : quartz: Handle failures better in acmwrapper.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 1ba8ece76e1b87f43270edb1324c31b818e8162e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ba8ece76e1b87f43270edb13…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Mon Apr 28 16:32:57 2008 -0700 quartz: Handle failures better in acmwrapper. --- dlls/quartz/acmwrapper.c | 96 ++++++++++++++++++++++++++++++++++++++------- 1 files changed, 81 insertions(+), 15 deletions(-) diff --git a/dlls/quartz/acmwrapper.c b/dlls/quartz/acmwrapper.c index c7b1e42..92d0298 100644 --- a/dlls/quartz/acmwrapper.c +++ b/dlls/quartz/acmwrapper.c @@ -48,6 +48,9 @@ typedef struct ACMWrapperImpl LPWAVEFORMATEX pWfIn; LPWAVEFORMATEX pWfOut; + IMediaSample *recv, *xmit; + ULONG done; + LONGLONG lasttime_real; LONGLONG lasttime_sent; } ACMWrapperImpl; @@ -66,32 +69,61 @@ static HRESULT ACMWrapper_ProcessSampleData(TransformFilterImpl* pTransformFilte HRESULT hr; LONGLONG tStart = -1, tStop = -1, tMed; + assert(pSample); + + if (This->xmit) + { + hr = OutputPin_SendSample((OutputPin*)This->tf.ppPins[1], This->xmit); + if (hr != S_OK) + return hr; + IMediaSample_Release(This->xmit); + This->xmit = NULL; + } + hr = IMediaSample_GetPointer(pSample, &pbSrcStream); if (FAILED(hr)) { ERR("Cannot get pointer to sample data (%x)\n", hr); return hr; } - - preroll = (IMediaSample_IsPreroll(pSample) == S_OK); - - IMediaSample_GetTime(pSample, &tStart, &tStop); cbSrcStream = IMediaSample_GetActualDataLength(pSample); + preroll = (IMediaSample_IsPreroll(pSample) == S_OK); - /* Prevent discontinuities when codecs 'absorb' data but not give anything back in return */ - if (IMediaSample_IsDiscontinuity(pSample) == S_OK) + if (pSample != This->recv) { - This->lasttime_real = tStart; - This->lasttime_sent = tStart; + if (This->recv) + { + /* Get rid of buffered sample first */ + hr = ACMWrapper_ProcessSampleData(pTransformFilter, This->recv); + if (hr != S_OK) + return hr; + if (This->recv) + return S_FALSE; + } + + IMediaSample_GetTime(pSample, &tStart, &tStop); + + /* Prevent discontinuities when codecs 'absorb' data but not give anything back in return */ + if (IMediaSample_IsDiscontinuity(pSample) == S_OK) + { + This->lasttime_real = tStart; + This->lasttime_sent = tStart; + } + else if (This->lasttime_real == tStart) + tStart = This->lasttime_sent; + else + WARN("Discontinuity\n"); } - else if (This->lasttime_real == tStart) - tStart = This->lasttime_sent; else - WARN("Discontinuity\n"); - + { + tStart = This->lasttime_sent; + tStop = This->lasttime_real; + cbSrcStream -= This->done; + pbSrcStream += This->done; + } tMed = tStart; - TRACE("Sample data ptr = %p, size = %ld\n", pbSrcStream, (long)cbSrcStream); + TRACE("Sample data ptr = %p, size = %u\n", pbSrcStream, cbSrcStream); hr = IPin_ConnectionMediaType(This->tf.ppPins[0], &amt); if (FAILED(hr)) { @@ -201,17 +233,44 @@ error: ash.pbSrc += ash.cbSrcLengthUsed; ash.cbSrcLength -= ash.cbSrcLengthUsed; + if (hr == S_FALSE) + { + This->xmit = pOutSample; + if (ash.cbSrcLength && !This->recv) + { + This->recv = pSample; + IMediaSample_AddRef(This->recv); + } + else if (This->recv) + { + IMediaSample_Release(This->recv); + This->recv = NULL; + } + + This->done = IMediaSample_GetActualDataLength(pSample) - ash.cbSrcLength; + break; + } + if (pOutSample) IMediaSample_Release(pOutSample); pOutSample = NULL; - } This->lasttime_real = tStop; This->lasttime_sent = tMed; + if (hr != S_OK) FIXME("FATALITY: %08x\n", hr); + else if (This->recv) + { + assert(This->recv == pSample); + IMediaSample_Release(This->recv); + This->recv = NULL; + } + + if (hr == S_FALSE) + return S_OK; return hr; } @@ -277,7 +336,13 @@ static HRESULT ACMWrapper_Cleanup(TransformFilterImpl* pTransformFilter) This->has = 0; This->lasttime_real = This->lasttime_sent = -1; - + if (This->recv) + IMediaSample_Release(This->recv); + + if (This->xmit) + IMediaSample_Release(This->xmit); + + This->recv = This->xmit = NULL; return S_OK; } @@ -313,6 +378,7 @@ HRESULT ACMWrapper_create(IUnknown * pUnkOuter, LPVOID * ppv) *ppv = (LPVOID)This; This->lasttime_real = This->lasttime_sent = -1; + This->recv = This->xmit = NULL; return hr; }
1
0
0
0
Maarten Lankhorst : quartz: Keep track of the time in the video renderer.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 37847b0d9b884752e86eedc96bc3294b78a9b51b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=37847b0d9b884752e86eedc96…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Mon Apr 28 15:00:51 2008 -0700 quartz: Keep track of the time in the video renderer. --- dlls/quartz/videorenderer.c | 54 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 50 insertions(+), 4 deletions(-) diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index f009eda..db80b65 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -85,6 +85,7 @@ typedef struct VideoRendererImpl IUnknown * pUnkOuter; BOOL bUnkOuterValid; BOOL bAggregatable; + REFERENCE_TIME rtLastStop; } VideoRendererImpl; static LRESULT CALLBACK VideoWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -361,9 +362,26 @@ static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample) TRACE("%p %p\n", iface, pSample); + hr = IMediaSample_GetTime(pSample, &tStart, &tStop); + if (FAILED(hr)) + ERR("Cannot get sample time (%x)\n", hr); + + if (This->rtLastStop != tStart) + { + if (IMediaSample_IsDiscontinuity(pSample) == S_FALSE) + ERR("Unexpected discontinuity: Last: %u.%03u, tStart: %u.%03u\n", + (DWORD)(This->rtLastStop / 10000000), + (DWORD)((This->rtLastStop / 10000)%1000), + (DWORD)(tStart / 10000000), (DWORD)((tStart / 10000)%1000)); + This->rtLastStop = tStart; + } + /* Preroll means the sample isn't shown, this is used for key frames and things like that */ if (IMediaSample_IsPreroll(pSample) == S_OK) + { + This->rtLastStop = tStop; return S_OK; + } hr = IMediaSample_GetPointer(pSample, &pbSrcStream); if (FAILED(hr)) @@ -372,10 +390,6 @@ static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample) return hr; } - hr = IMediaSample_GetTime(pSample, &tStart, &tStop); - if (FAILED(hr)) - ERR("Cannot get sample time (%x)\n", hr); - cbSrcStream = IMediaSample_GetActualDataLength(pSample); TRACE("val %p %ld\n", pbSrcStream, cbSrcStream); @@ -393,6 +407,37 @@ static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample) } #endif + if (This->pClock && This->state == State_Running) + { + REFERENCE_TIME time, trefstart, trefstop; + LONG delta; + + /* Perhaps I <SHOULD> use the reference clock AdviseTime function here + * I'm not going to! When I tried, it seemed to generate lag and + * it caused instability. + */ + IReferenceClock_GetTime(This->pClock, &time); + + trefstart = This->rtStreamStart; + trefstop = (REFERENCE_TIME)((double)(tStop - tStart) / This->pInputPin->dRate) + This->rtStreamStart; + delta = (LONG)((trefstart-time)/10000); + This->rtStreamStart = trefstop; + This->rtLastStop = tStop; + + if (delta > 0) + { + TRACE("Sleeping for %u ms\n", delta); + Sleep(delta); + } + else if (time > trefstop) + { + TRACE("Dropping sample: Time: %lld ms trefstop: %lld ms!\n", time/10000, trefstop/10000); + This->rtLastStop = tStop; + return S_OK; + } + } + This->rtLastStop = tStop; + VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream); return S_OK; @@ -464,6 +509,7 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv) pVideoRenderer->pClock = NULL; pVideoRenderer->init = 0; pVideoRenderer->AutoShow = 1; + pVideoRenderer->rtLastStop = -1; ZeroMemory(&pVideoRenderer->filterInfo, sizeof(FILTER_INFO)); /* construct input pin */
1
0
0
0
Maarten Lankhorst : quartz: Fix bug in memallocator with test.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 1fad872961499c48c2b33851636f8408d67321cc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1fad872961499c48c2b338516…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Mon Apr 28 09:26:20 2008 -0700 quartz: Fix bug in memallocator with test. --- dlls/quartz/memallocator.c | 6 +++--- dlls/quartz/tests/memallocator.c | 34 +++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index cd87a34..12effbb 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -237,13 +237,13 @@ static HRESULT WINAPI BaseMemAllocator_Commit(IMemAllocator * iface) { if (!This->pProps) hr = VFW_E_SIZENOTSET; - else if (This->bCommitted) - hr = S_OK; - else if (This->bDecommitQueued) + else if (This->bDecommitQueued && This->bCommitted) { This->bDecommitQueued = FALSE; hr = S_OK; } + else if (This->bCommitted) + hr = S_OK; else { if (!(This->hSemWaiting = CreateSemaphoreW(NULL, This->pProps->cBuffers, This->pProps->cBuffers, NULL))) diff --git a/dlls/quartz/tests/memallocator.c b/dlls/quartz/tests/memallocator.c index 0a01db9..b0638e8 100644 --- a/dlls/quartz/tests/memallocator.c +++ b/dlls/quartz/tests/memallocator.c @@ -37,13 +37,15 @@ static void CommitDecommitTest(void) if (hr == S_OK) { - ALLOCATOR_PROPERTIES RequestedProps; - ALLOCATOR_PROPERTIES ActualProps; + ALLOCATOR_PROPERTIES RequestedProps; + ALLOCATOR_PROPERTIES ActualProps; - RequestedProps.cBuffers = 1; - RequestedProps.cbBuffer = 65536; - RequestedProps.cbAlign = 1; - RequestedProps.cbPrefix = 0; + IMediaSample *sample = NULL, *sample2 = NULL; + + RequestedProps.cBuffers = 2; + RequestedProps.cbBuffer = 65536; + RequestedProps.cbAlign = 1; + RequestedProps.cbPrefix = 0; hr = IMemAllocator_SetProperties(pMemAllocator, &RequestedProps, &ActualProps); ok(hr==S_OK, "SetProperties returned: %x\n", hr); @@ -53,12 +55,30 @@ static void CommitDecommitTest(void) hr = IMemAllocator_Commit(pMemAllocator); ok(hr==S_OK, "Commit returned: %x\n", hr); + hr = IMemAllocator_GetBuffer(pMemAllocator, &sample, NULL, NULL, 0); + ok(hr==S_OK, "Could not get a buffer: %x\n", hr); + hr = IMemAllocator_Decommit(pMemAllocator); ok(hr==S_OK, "Decommit returned: %x\n", hr); hr = IMemAllocator_Decommit(pMemAllocator); ok(hr==S_OK, "Cecommit returned: %x\n", hr); - IMemAllocator_Release(pMemAllocator); + /* Decommit and recommit while holding a sample */ + if (sample) + { + hr = IMemAllocator_Commit(pMemAllocator); + ok(hr==S_OK, "Commit returned: %x\n", hr); + + hr = IMemAllocator_GetBuffer(pMemAllocator, &sample2, NULL, NULL, 0); + ok(hr==S_OK, "Could not get a buffer: %x\n", hr); + IUnknown_Release(sample); + if (sample2) + IUnknown_Release(sample2); + + hr = IMemAllocator_Decommit(pMemAllocator); + ok(hr==S_OK, "Cecommit returned: %x\n", hr); + } + IMemAllocator_Release(pMemAllocator); } }
1
0
0
0
Maarten Lankhorst : quartz: Some state changes fixes.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 4e761d26135ba73bc8916fa3a3579512c1c3978b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4e761d26135ba73bc8916fa3a…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Mon Apr 28 16:35:53 2008 -0700 quartz: Some state changes fixes. --- dlls/quartz/pin.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c index 803a751..8619776 100644 --- a/dlls/quartz/pin.c +++ b/dlls/quartz/pin.c @@ -1145,7 +1145,6 @@ HRESULT OutputPin_CommitAllocator(OutputPin * This) TRACE("(%p)->()\n", This); EnterCriticalSection(This->pin.pCritSec); - if (!This->custom_allocator) { if (!This->pin.pConnectedTo || !This->pMemInputPin) hr = VFW_E_NOT_CONNECTED; @@ -1164,6 +1163,7 @@ HRESULT OutputPin_CommitAllocator(OutputPin * This) } LeaveCriticalSection(This->pin.pCritSec); + TRACE("--> %08x\n", hr); return hr; } @@ -1474,10 +1474,6 @@ static void CALLBACK PullPin_Thread_Process(PullPin *This) IMediaSample * pSample = NULL; ALLOCATOR_PROPERTIES allocProps; - EnterCriticalSection(This->pin.pCritSec); - SetEvent(This->hEventStateChanged); - LeaveCriticalSection(This->pin.pCritSec); - hr = IMemAllocator_GetProperties(This->pAlloc, &allocProps); This->cbAlign = allocProps.cbAlign; @@ -1502,6 +1498,10 @@ static void CALLBACK PullPin_Thread_Process(PullPin *This) if (FAILED(hr)) ERR("Request error: %x\n", hr); + EnterCriticalSection(This->pin.pCritSec); + SetEvent(This->hEventStateChanged); + LeaveCriticalSection(This->pin.pCritSec); + do { DWORD_PTR dwUser; @@ -1568,9 +1568,11 @@ static void CALLBACK PullPin_Thread_Process(PullPin *This) /* Can't reset state to Sleepy here because that might race, instead PauseProcessing will do that for us * Flush remaining samples */ - PullPin_Flush(This); + TRACE("Almost done..\n"); + if (This->fnDone) This->fnDone(This->pin.pUserData); + PullPin_Flush(This); TRACE("End: %08x, %d\n", hr, This->stop_playback); } @@ -1706,6 +1708,9 @@ HRESULT PullPin_PauseProcessing(PullPin * This) PullPin_WaitForStateChange(This, INFINITE); EnterCriticalSection(This->pin.pCritSec); + /* Faster! */ + IAsyncReader_BeginFlush(This->pReader); + assert(!This->stop_playback); assert(This->state == Req_Run|| This->state == Req_Sleepy); @@ -1737,7 +1742,6 @@ HRESULT PullPin_StopProcessing(PullPin * This) assert(WaitForSingleObject(This->thread_sleepy, 0) == WAIT_TIMEOUT); ResetEvent(This->hEventStateChanged); SetEvent(This->thread_sleepy); - return S_OK; }
1
0
0
0
Alexandre Julliard : winex11: Don' t put window manager decorations on shaped windows.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 2bbf00ed084f422c66f67f2c3d9738d6211dc885 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2bbf00ed084f422c66f67f2c3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 29 12:46:16 2008 +0200 winex11: Don't put window manager decorations on shaped windows. --- dlls/winex11.drv/window.c | 3 +++ dlls/winex11.drv/x11drv.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 0f84ae2..ad56a70 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -163,6 +163,7 @@ static unsigned long get_mwm_decorations( struct x11drv_win_data *data, if (!decorated_mode) return 0; if (IsRectEmpty( &data->window_rect )) return 0; + if (data->shaped) return 0; if (ex_style & WS_EX_TOOLWINDOW) return 0; @@ -321,6 +322,7 @@ static void sync_window_region( Display *display, struct x11drv_win_data *data, { #ifdef HAVE_LIBXSHAPE if (!data->whole_window) return; + data->shaped = FALSE; if (!hrgn) { @@ -341,6 +343,7 @@ static void sync_window_region( Display *display, struct x11drv_win_data *data, pRegionData->rdh.nCount, ShapeSet, YXBanded ); wine_tsx11_unlock(); HeapFree(GetProcessHeap(), 0, pRegionData); + data->shaped = TRUE; } } #endif /* HAVE_LIBXSHAPE */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index f46eaaa..2f2e583 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -690,6 +690,7 @@ struct x11drv_win_data BOOL mapped : 1; /* is window mapped? (in either normal or iconic state) */ BOOL iconic : 1; /* is window in iconic state? */ BOOL embedded : 1; /* is window an XEMBED client? */ + BOOL shaped : 1; /* is window using a custom region shape? */ int wm_state; /* current value of the WM_STATE property */ DWORD net_wm_state; /* bit mask of active x11drv_net_wm_state values */ HBITMAP hWMIconBitmap;
1
0
0
0
Alexandre Julliard : documentation: Remove PACKAGING, this is maintained on the wiki now.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 6ff4ba7e680466b5966a4c8ed76017f7d51750c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ff4ba7e680466b5966a4c8ed…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 29 12:46:30 2008 +0200 documentation: Remove PACKAGING, this is maintained on the wiki now. --- documentation/PACKAGING | 500 ----------------------------------------------- 1 files changed, 0 insertions(+), 500 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6ff4ba7e680466b5966a4…
1
0
0
0
Jacek Caban : mshtml: Added IDispatchEx support to HTMLInputElement.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 7582518e18b50bf4ebbd2cda30822d25be3d81a9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7582518e18b50bf4ebbd2cda3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 29 01:39:09 2008 +0200 mshtml: Added IDispatchEx support to HTMLInputElement. --- dlls/mshtml/dispex.c | 2 ++ dlls/mshtml/htmlinput.c | 16 ++++++++++++++++ dlls/mshtml/mshtml_private.h | 2 ++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 834f3b3..37a3b3d 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -54,6 +54,7 @@ static REFIID tid_ids[] = { &DIID_DispHTMLDocument, &DIID_DispHTMLDOMTextNode, &DIID_DispHTMLElementCollection, + &DIID_DispHTMLInputElement, &DIID_DispHTMLUnknownElement, &DIID_DispHTMLWindow2, &IID_IHTMLDocument2, @@ -66,6 +67,7 @@ static REFIID tid_ids[] = { &IID_IHTMLElement, &IID_IHTMLElement2, &IID_IHTMLElementCollection, + &IID_IHTMLInputElement, &IID_IHTMLWindow2, &IID_IHTMLWindow3, &IID_IOmNavigator diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index dd0a8b5..3ba954f 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -1059,6 +1059,20 @@ static const NodeImplVtbl HTMLInputElementImplVtbl = { HTMLInputElement_destructor }; +static dispex_static_data_t HTMLInputElement_dispex = { + NULL, + DispHTMLInputElement_tid, + NULL, + { + IHTMLDOMNode_tid, + IHTMLDOMNode2_tid, + IHTMLElement_tid, + IHTMLElement2_tid, + IHTMLInputElement_tid, + 0 + } +}; + HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem) { HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement)); @@ -1069,6 +1083,8 @@ HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem) ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl; ret->element.node.vtbl = &HTMLInputElementImplVtbl; + init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLINPUT(ret), &HTMLInputElement_dispex); + nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput); if(NS_FAILED(nsres)) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 42381b5..911abe0 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -64,6 +64,7 @@ typedef enum { DispHTMLDocument_tid, DispHTMLDOMTextNode_tid, DispHTMLElementCollection_tid, + DispHTMLInputElement_tid, DispHTMLUnknownElement_tid, DispHTMLWindow2_tid, IHTMLDocument2_tid, @@ -76,6 +77,7 @@ typedef enum { IHTMLElement_tid, IHTMLElement2_tid, IHTMLElementCollection_tid, + IHTMLInputElement_tid, IHTMLWindow2_tid, IHTMLWindow3_tid, IOmNavigator_tid,
1
0
0
0
Jacek Caban : mshtml: Added IDispatchEx support to HTMLOptionElement.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 928914c81ebbbb21ff66e3b044036bf7a4172d08 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=928914c81ebbbb21ff66e3b04…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 29 01:39:38 2008 +0200 mshtml: Added IDispatchEx support to HTMLOptionElement. --- dlls/mshtml/dispex.c | 2 ++ dlls/mshtml/htmloption.c | 16 ++++++++++++++++ dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/tests/dom.c | 4 ++-- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 37a3b3d..6f17a9d 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -55,6 +55,7 @@ static REFIID tid_ids[] = { &DIID_DispHTMLDOMTextNode, &DIID_DispHTMLElementCollection, &DIID_DispHTMLInputElement, + &DIID_DispHTMLOptionElement, &DIID_DispHTMLUnknownElement, &DIID_DispHTMLWindow2, &IID_IHTMLDocument2, @@ -68,6 +69,7 @@ static REFIID tid_ids[] = { &IID_IHTMLElement2, &IID_IHTMLElementCollection, &IID_IHTMLInputElement, + &IID_IHTMLOptionElement, &IID_IHTMLWindow2, &IID_IHTMLWindow3, &IID_IOmNavigator diff --git a/dlls/mshtml/htmloption.c b/dlls/mshtml/htmloption.c index 7252dde..a642295 100644 --- a/dlls/mshtml/htmloption.c +++ b/dlls/mshtml/htmloption.c @@ -331,6 +331,20 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = { HTMLOptionElement_destructor }; +static dispex_static_data_t HTMLOptionElement_dispex = { + NULL, + DispHTMLOptionElement_tid, + NULL, + { + IHTMLDOMNode_tid, + IHTMLDOMNode2_tid, + IHTMLElement_tid, + IHTMLElement2_tid, + IHTMLOptionElement_tid, + 0 + } +}; + HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem) { HTMLOptionElement *ret = heap_alloc_zero(sizeof(HTMLOptionElement)); @@ -345,6 +359,8 @@ HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem) if(NS_FAILED(nsres)) ERR("Could not get nsIDOMHTMLOptionElement interface: %08x\n", nsres); + init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLOPTION(ret), &HTMLOptionElement_dispex); + return &ret->element; } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 911abe0..55c0090 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -65,6 +65,7 @@ typedef enum { DispHTMLDOMTextNode_tid, DispHTMLElementCollection_tid, DispHTMLInputElement_tid, + DispHTMLOptionElement_tid, DispHTMLUnknownElement_tid, DispHTMLWindow2_tid, IHTMLDocument2_tid, @@ -78,6 +79,7 @@ typedef enum { IHTMLElement2_tid, IHTMLElementCollection_tid, IHTMLInputElement_tid, + IHTMLOptionElement_tid, IHTMLWindow2_tid, IHTMLWindow3_tid, IOmNavigator_tid, diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 7d607d7..7a9b05d 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -221,10 +221,10 @@ static const elem_type_info_t elem_type_infos[] = { {"TITLE", elem_iids, NULL}, {"BODY", body_iids, NULL}, {"A", anchor_iids, NULL}, - {"INPUT", input_iids, NULL}, + {"INPUT", input_iids, &DIID_DispHTMLInputElement}, {"SELECT", select_iids, NULL}, {"TEXTAREA", textarea_iids, NULL}, - {"OPTION", option_iids, NULL}, + {"OPTION", option_iids, &DIID_DispHTMLOptionElement}, {"STYLE", elem_iids, NULL}, {"BLOCKQUOTE",elem_iids, NULL}, {"P", elem_iids, NULL},
1
0
0
0
Jacek Caban : mshtml: Added indexed access to HTMLElementCollection object support.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 1597967417caa123153bec5b307f31ed7fd5fa18 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1597967417caa123153bec5b3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 29 01:38:41 2008 +0200 mshtml: Added indexed access to HTMLElementCollection object support. --- dlls/mshtml/htmlelem.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 1 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index faf888c..f9b416a 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -1651,6 +1651,51 @@ static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface, return S_OK; } +#define DISPID_ELEMCOL_0 MSHTML_DISPID_CUSTOM_MIN + +static HRESULT HTMLElementCollection_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid) +{ + HTMLElementCollection *This = ELEMCOL_THIS(iface); + WCHAR *ptr; + DWORD idx=0; + + for(ptr = name; *ptr && isdigitW(*ptr); ptr++) + idx = idx*10 + (*ptr-'0'); + + if(*ptr || idx >= This->len) + return DISP_E_UNKNOWNNAME; + + *dispid = DISPID_ELEMCOL_0 + idx; + TRACE("ret %x\n", *dispid); + return S_OK; +} + +static HRESULT HTMLElementCollection_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + HTMLElementCollection *This = ELEMCOL_THIS(iface); + DWORD idx; + + TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller); + + idx = id - DISPID_ELEMCOL_0; + if(idx >= This->len) + return DISP_E_UNKNOWNNAME; + + switch(flags) { + case INVOKE_PROPERTYGET: + V_VT(res) = VT_DISPATCH; + V_DISPATCH(res) = (IDispatch*)HTMLELEM(This->elems[idx]); + IHTMLElement_AddRef(HTMLELEM(This->elems[idx])); + break; + default: + FIXME("unimplemented flags %x\n", flags); + return E_NOTIMPL; + } + + return S_OK; +} + #undef ELEMCOL_THIS static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl = { @@ -1669,8 +1714,13 @@ static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl = { HTMLElementCollection_tags }; +static const dispex_static_data_vtbl_t HTMLElementColection_dispex_vtbl = { + HTMLElementCollection_get_dispid, + HTMLElementCollection_invoke +}; + static dispex_static_data_t HTMLElementCollection_dispex = { - NULL, + &HTMLElementColection_dispex_vtbl, DispHTMLElementCollection_tid, NULL, {
1
0
0
0
Jacek Caban : mshtml: Added support for custom DISPIDs.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: ef4200fcf78159e1b7f1d5f87f98b054d15dbf75 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ef4200fcf78159e1b7f1d5f87…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 29 01:38:09 2008 +0200 mshtml: Added support for custom DISPIDs. --- dlls/mshtml/dispex.c | 16 ++++++++++++++++ dlls/mshtml/htmldoc.c | 1 + dlls/mshtml/htmlelem.c | 2 ++ dlls/mshtml/htmltextnode.c | 1 + dlls/mshtml/htmlwindow.c | 1 + dlls/mshtml/mshtml_private.h | 11 ++++++++++- dlls/mshtml/omnavigator.c | 1 + 7 files changed, 32 insertions(+), 1 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 153d864..834f3b3 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -277,6 +277,11 @@ void call_disp_func(HTMLDocument *doc, IDispatch *disp) VariantClear(&res); } +static inline BOOL is_custom_dispid(DISPID id) +{ + return MSHTML_DISPID_CUSTOM_MIN <= id && id <= MSHTML_DISPID_CUSTOM_MAX; +} + #define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface) static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) @@ -395,6 +400,14 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW min = n+1; } + if(This->data->vtbl && This->data->vtbl->get_dispid) { + HRESULT hres; + + hres = This->data->vtbl->get_dispid(This->outer, bstrName, grfdex, pid); + if(hres != DISP_E_UNKNOWNNAME) + return hres; + } + TRACE("not found %s\n", debugstr_w(bstrName)); return DISP_E_UNKNOWNNAME; } @@ -412,6 +425,9 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + if(is_custom_dispid(id) && This->data->vtbl && This->data->vtbl->invoke) + return This->data->vtbl->invoke(This->outer, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + if(wFlags == DISPATCH_CONSTRUCT) { FIXME("DISPATCH_CONSTRUCT not implemented\n"); return E_NOTIMPL; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 425fb39..73e31f1 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1491,6 +1491,7 @@ static const IDispatchExVtbl DocDispatchExVtbl = { }; static dispex_static_data_t HTMLDocument_dispex = { + NULL, DispHTMLDocument_tid, NULL, { diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index c44e2e5..faf888c 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -1283,6 +1283,7 @@ static const NodeImplVtbl HTMLElementImplVtbl = { }; static dispex_static_data_t HTMLElement_dispex = { + NULL, DispHTMLUnknownElement_tid, NULL, { @@ -1669,6 +1670,7 @@ static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl = { }; static dispex_static_data_t HTMLElementCollection_dispex = { + NULL, DispHTMLElementCollection_tid, NULL, { diff --git a/dlls/mshtml/htmltextnode.c b/dlls/mshtml/htmltextnode.c index fa6308e..b98821b 100644 --- a/dlls/mshtml/htmltextnode.c +++ b/dlls/mshtml/htmltextnode.c @@ -186,6 +186,7 @@ static const NodeImplVtbl HTMLDOMTextNodeImplVtbl = { }; static dispex_static_data_t HTMLDOMTextNode_dispex = { + NULL, DispHTMLDOMTextNode_tid, 0, { diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 82b03e6..2073132 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1108,6 +1108,7 @@ static const IDispatchExVtbl WindowDispExVtbl = { }; static dispex_static_data_t HTMLWindow_dispex = { + NULL, DispHTMLWindow2_tid, NULL, { diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 126bc2e..42381b5 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Jacek Caban for CodeWeavers + * Copyright 2005-2008 Jacek Caban for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -84,7 +84,16 @@ typedef enum { typedef struct dispex_data_t dispex_data_t; +#define MSHTML_DISPID_CUSTOM_MIN 0x60000000 +#define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff + +typedef struct { + HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*); + HRESULT (*invoke)(IUnknown*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); +} dispex_static_data_vtbl_t; + typedef struct { + const dispex_static_data_vtbl_t *vtbl; const tid_t disp_tid; dispex_data_t *data; const tid_t iface_tids[]; diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 742df19..74b2cfd 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -301,6 +301,7 @@ static const IOmNavigatorVtbl OmNavigatorVtbl = { }; static dispex_static_data_t OmNavigator_dispex = { + NULL, IOmNavigator_tid, NULL, {
1
0
0
0
Jacek Caban : mshtml: Added IHTMLCommentElement declaration.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 96fdb0e7425317eece64e573f9444521194bd931 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=96fdb0e7425317eece64e573f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 29 01:35:18 2008 +0200 mshtml: Added IHTMLCommentElement declaration. --- include/mshtmdid.h | 13 +++++++++ include/mshtml.idl | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 0 deletions(-) diff --git a/include/mshtmdid.h b/include/mshtmdid.h index c6b98a4..579face 100644 --- a/include/mshtmdid.h +++ b/include/mshtmdid.h @@ -2054,6 +2054,19 @@ #define DISPID_IHTMLTABLECAPTION_ALIGN STDPROPID_XOBJ_BLOCKALIGN #define DISPID_IHTMLTABLECAPTION_VALIGN DISPID_A_TABLEVALIGN + /* IHTMLCommentElement */ +#define DISPID_IHTMLCOMMENTELEMENT_TEXT DISPID_COMMENTPDL+1 +#define DISPID_IHTMLCOMMENTELEMENT_ATOMIC DISPID_COMMENTPDL+2 + + /* IHTMLCommentElement2 */ +#define DISPID_IHTMLCOMMENTELEMENT2_DATA DISPID_COMMENTPDL+3 +#define DISPID_IHTMLCOMMENTELEMENT2_LENGTH DISPID_COMMENTPDL+4 +#define DISPID_IHTMLCOMMENTELEMENT2_SUBSTRINGDATA DISPID_COMMENTPDL+5 +#define DISPID_IHTMLCOMMENTELEMENT2_APPENDDATA DISPID_COMMENTPDL+6 +#define DISPID_IHTMLCOMMENTELEMENT2_INSERTDATA DISPID_COMMENTPDL+7 +#define DISPID_IHTMLCOMMENTELEMENT2_DELETEDATA DISPID_COMMENTPDL+8 +#define DISPID_IHTMLCOMMENTELEMENT2_REPLACEDATA DISPID_COMMENTPDL+9 + /* IHTMLTable */ #define DISPID_IHTMLTABLE_COLS DISPID_TABLE+1 #define DISPID_IHTMLTABLE_BORDER DISPID_TABLE+2 diff --git a/include/mshtml.idl b/include/mshtml.idl index 4091e8d..055150b 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -9633,6 +9633,76 @@ coclass HTMLDocument } /***************************************************************************** + * IHTMLCommentElement interface + */ +[ + odl, + oleautomation, + dual, + uuid(3050f20c-98b5-11cf-bb82-00aa00bdce0b) +] +interface IHTMLCommentElement : IDispatch +{ + [propput, id(DISPID_IHTMLCOMMENTELEMENT_TEXT), displaybind, bindable] + HRESULT text([in] BSTR v); + + [propget, id(DISPID_IHTMLCOMMENTELEMENT_TEXT), displaybind, bindable] + HRESULT text([out, retval] BSTR *p); + + [propput, id(DISPID_IHTMLCOMMENTELEMENT_ATOMIC), displaybind, bindable] + HRESULT atomic([in] long v); + + [propget, id(DISPID_IHTMLCOMMENTELEMENT_ATOMIC), displaybind, bindable] + HRESULT atomic([out, retval] long *p); +} + +/***************************************************************************** + * IHTMLCommentElement2 interface + */ +[ + odl, + oleautomation, + dual, + uuid(3050f813-98b5-11cf-bb82-00aa00bdce0b) +] +interface IHTMLCommentElement2 : IDispatch +{ + [propput, id(DISPID_IHTMLCOMMENTELEMENT2_DATA)] + HRESULT data([in] BSTR v); + + [propget, id(DISPID_IHTMLCOMMENTELEMENT2_DATA)] + HRESULT data([out, retval] BSTR *p); + + [propget, id(DISPID_IHTMLCOMMENTELEMENT2_LENGTH)] + HRESULT length([out, retval] long *p); + + [id(DISPID_IHTMLCOMMENTELEMENT2_SUBSTRINGDATA)] + HRESULT substringData( + [in] long offset, + [in] long Count, + [out, retval] BSTR *pbstrsubString); + + [id(DISPID_IHTMLCOMMENTELEMENT2_APPENDDATA)] + HRESULT appendData([in] BSTR bstrstring); + + [id(DISPID_IHTMLCOMMENTELEMENT2_INSERTDATA)] + HRESULT insertData( + [in] long offset, + [in] BSTR bstrstring); + + [id(DISPID_IHTMLCOMMENTELEMENT2_DELETEDATA)] + HRESULT deleteData( + [in] long offset, + [in] long Count); + + [id(DISPID_IHTMLCOMMENTELEMENT2_REPLACEDATA)] + HRESULT replaceData( + [in] long offset, + [in] long Count, + [in] BSTR bstrstring); +} + +/***************************************************************************** * HTMLTableEvents dispinterface */ [
1
0
0
0
Jacek Caban : mshtml.idl: Added DispHTMLOptionElement declaration.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 3186aa7a6508a03d0021c41ba1e4e1685952b892 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3186aa7a6508a03d0021c41ba…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 29 01:42:19 2008 +0200 mshtml.idl: Added DispHTMLOptionElement declaration. --- include/mshtmdid.h | 3 + include/mshtml.idl | 891 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 894 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=3186aa7a6508a03d0021c…
1
0
0
0
Jacek Caban : mshtml.idl: Added IHTMLDOMChildrenCollection and DispDOMChildrenCollection declaration .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: f885b332189f3656acd60834c677e6b76735b88a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f885b332189f3656acd60834c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 29 01:34:00 2008 +0200 mshtml.idl: Added IHTMLDOMChildrenCollection and DispDOMChildrenCollection declaration. --- include/mshtmdid.h | 5 +++++ include/mshtml.idl | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 0 deletions(-) diff --git a/include/mshtmdid.h b/include/mshtmdid.h index 583d124..94303d5 100644 --- a/include/mshtmdid.h +++ b/include/mshtmdid.h @@ -992,6 +992,11 @@ /* IHTMLElementCollection3 */ #define DISPID_IHTMLELEMENTCOLLECTION3_NAMEDITEM DISPID_COLLECTION+6 +/* IHTMLDOMChildrenCollection */ +#define DISPID_IHTMLDOMCHILDRENCOLLECTION_LENGTH DISPID_COLLECTION +#define DISPID_IHTMLDOMCHILDRENCOLLECTION__NEWENUM DISPID_NEWENUM +#define DISPID_IHTMLDOMCHILDRENCOLLECTION_ITEM DISPID_VALUE + /* HTMLElementEvents */ #define DISPID_HTMLELEMENTEVENTS_ONHELP DISPID_EVMETH_ONHELP #define DISPID_HTMLELEMENTEVENTS_ONCLICK DISPID_EVMETH_ONCLICK diff --git a/include/mshtml.idl b/include/mshtml.idl index 1a33bf5..8e071f5 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -1841,6 +1841,49 @@ methods: IDispatch *ownerDocument(); } +/***************************************************************************** + * IHTMLDOMChildrenCollection interface + */ +[ + odl, + oleautomation, + dual, + uuid(3050f5ab-98b5-11cf-bb82-00aa00bdce0b) +] +interface IHTMLDOMChildrenCollection : IDispatch +{ + [propget, id(DISPID_IHTMLDOMCHILDRENCOLLECTION_LENGTH)] + HRESULT length([out, retval] long *p); + + [propget, id(DISPID_IHTMLDOMCHILDRENCOLLECTION__NEWENUM), hidden, restricted] + HRESULT _newEnum([out, retval] IUnknown **p); + + [id(DISPID_IHTMLDOMCHILDRENCOLLECTION_ITEM)] + HRESULT item( + [in] long index, + [out, retval] IDispatch **ppItem); +} + +/***************************************************************************** + * DispDOMChildrenCollection dispinterface + */ +[ + hidden, + uuid(3050f577-98b5-11cf-bb82-00aa00bdce0b) +] +dispinterface DispDOMChildrenCollection +{ +properties: +methods: + [propget, id(DISPID_IHTMLDOMCHILDRENCOLLECTION_LENGTH)] + long length(); + + [propget, id(DISPID_IHTMLDOMCHILDRENCOLLECTION__NEWENUM), hidden, restricted] + IUnknown *_newEnum(); + + [id(DISPID_IHTMLDOMCHILDRENCOLLECTION_ITEM)] + IDispatch *item([in] long index); +} interface IHTMLElementCollection;
1
0
0
0
Andrew Talbot : shlwapi: Remove unused variables.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: af3055e2e1bb7be0bdcaa70c7efbf9353aee1525 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af3055e2e1bb7be0bdcaa70c7…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Mon Apr 28 22:17:14 2008 +0100 shlwapi: Remove unused variables. --- dlls/shlwapi/ordinal.c | 4 ++-- dlls/shlwapi/reg.c | 14 ++++++-------- dlls/shlwapi/url.c | 6 ++---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 5786c94..d1668a6 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -1492,11 +1492,11 @@ HRESULT WINAPI IUnknown_QueryService(IUnknown* lpUnknown, REFGUID sid, REFIID ri */ BOOL WINAPI SHLoadMenuPopup(HINSTANCE hInst, LPCWSTR szName) { - HMENU hMenu, hSubMenu; + HMENU hMenu; if ((hMenu = LoadMenuW(hInst, szName))) { - if ((hSubMenu = GetSubMenu(hMenu, 0))) + if (GetSubMenu(hMenu, 0)) RemoveMenu(hMenu, 0, MF_BYPOSITION); DestroyMenu(hMenu); diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 52908e9..9239824 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -626,7 +626,6 @@ BOOL WINAPI SHRegGetBoolUSValueA( BOOL fIgnoreHKCU, /* [I] TRUE=Don't check HKEY_CURRENT_USER */ BOOL fDefault) /* [I] Default value to use if pszValue is not present */ { - LONG retvalue; DWORD type, datalen, work; BOOL ret = fDefault; CHAR data[10]; @@ -636,9 +635,9 @@ BOOL WINAPI SHRegGetBoolUSValueA( (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM"); datalen = sizeof(data)-1; - if (!(retvalue = SHRegGetUSValueA( pszSubKey, pszValue, &type, - data, &datalen, - fIgnoreHKCU, 0, 0))) { + if (!SHRegGetUSValueA( pszSubKey, pszValue, &type, + data, &datalen, + fIgnoreHKCU, 0, 0)) { /* process returned data via type into bool */ switch (type) { case REG_SZ: @@ -687,7 +686,6 @@ BOOL WINAPI SHRegGetBoolUSValueW( static const WCHAR wTRUE[]= {'T','R','U','E','\0'}; static const WCHAR wNO[]= {'N','O','\0'}; static const WCHAR wFALSE[]={'F','A','L','S','E','\0'}; - LONG retvalue; DWORD type, datalen, work; BOOL ret = fDefault; WCHAR data[10]; @@ -697,9 +695,9 @@ BOOL WINAPI SHRegGetBoolUSValueW( (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM"); datalen = (sizeof(data)-1) * sizeof(WCHAR); - if (!(retvalue = SHRegGetUSValueW( pszSubKey, pszValue, &type, - data, &datalen, - fIgnoreHKCU, 0, 0))) { + if (!SHRegGetUSValueW( pszSubKey, pszValue, &type, + data, &datalen, + fIgnoreHKCU, 0, 0)) { /* process returned data via type into bool */ switch (type) { case REG_SZ: diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 1ff4312..2593f96 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -2153,7 +2153,6 @@ HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) { PARSEDURLA base; - DWORD res1; TRACE("%s\n", debugstr_a(lpstrPath)); @@ -2161,7 +2160,7 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) /* get protocol */ base.cbSize = sizeof(base); - res1 = ParseURLA(lpstrPath, &base); + ParseURLA(lpstrPath, &base); return (base.nScheme != URL_SCHEME_INVALID); } @@ -2173,7 +2172,6 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath) { PARSEDURLW base; - DWORD res1; TRACE("%s\n", debugstr_w(lpstrPath)); @@ -2181,7 +2179,7 @@ BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath) /* get protocol */ base.cbSize = sizeof(base); - res1 = ParseURLW(lpstrPath, &base); + ParseURLW(lpstrPath, &base); return (base.nScheme != URL_SCHEME_INVALID); }
1
0
0
0
Tijl Coosemans : hhctrl.ocx: Plug memory leak.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: af72d10014a4f2e74da3e55f89c635823744284f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af72d10014a4f2e74da3e55f8…
Author: Tijl Coosemans <tijl(a)ulyssis.org> Date: Mon Apr 28 22:42:56 2008 +0200 hhctrl.ocx: Plug memory leak. --- dlls/hhctrl.ocx/hhctrl.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c index c0054de..e663c11 100644 --- a/dlls/hhctrl.ocx/hhctrl.c +++ b/dlls/hhctrl.ocx/hhctrl.c @@ -144,7 +144,10 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat url = FindContextAlias(info->pCHMInfo, data); if(!url) + { + ReleaseHelpViewer(info); return NULL; + } NavigateToUrl(info, url); heap_free(url);
1
0
0
0
Eric Pouech : winhelp: Make richedit the default for rendering.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 9b24f2a0507d173e65641649a70fced300afab26 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b24f2a0507d173e65641649a…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Apr 28 21:16:09 2008 +0200 winhelp: Make richedit the default for rendering. --- programs/winhelp/winhelp.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index fd605a9..62eb98f 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -251,7 +251,11 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) Globals.hInstance = hInstance; - use_richedit = getenv("WINHELP_RICHEDIT") != NULL; + /* don't use richedit for rendering when WINHELP_RICHEDIT environment variable is 0 */ + { + const char* p = getenv("WINHELP_RICHEDIT"); + use_richedit = !p || *p != '0'; + } if (use_richedit && LoadLibrary("riched20.dll") == NULL) return MessageBox(0, MAKEINTRESOURCE(STID_NO_RICHEDIT), MAKEINTRESOURCE(STID_WHERROR), MB_OK);
1
0
0
0
Eric Pouech : msvcrt: Fixed space in type with double indirection.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: f55da6db848e27472cd4d0ade1c61c171e7866cb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f55da6db848e27472cd4d0ade…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Apr 28 21:18:32 2008 +0200 msvcrt: Fixed space in type with double indirection. Spotted by James Hawkins. --- dlls/msvcrt/tests/cpp.c | 2 +- dlls/msvcrt/undname.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index 2b815b7..ef80cac 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -984,7 +984,7 @@ static void test_demangle(void) {"?$AAA@$DBAB@", "AAA<`template-parameter257'>"}, {"?$AAA@?C@", "AAA<`template-parameter-2'>"}, {"?$AAA@PAUBBB@@", "AAA<struct BBB *>"}, -{"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z", "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa **,class ee *)"}, +{"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z", "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa * *,class ee *)"}, {"?f@T@@QAEHQCY1BE@BO@D@Z", "public: int __thiscall T::f(char (volatile * const)[20][30])"}, {"?f@T@@QAEHQAY2BE@BO@CI@D@Z", "public: int __thiscall T::f(char (* const)[20][30][40])"}, {"?f@T@@QAEHQAY1BE@BO@$$CBD@Z", "public: int __thiscall T::f(char const (* const)[20][30])"}, diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c index 9bc0970..1d9fae7 100644 --- a/dlls/msvcrt/undname.c +++ b/dlls/msvcrt/undname.c @@ -410,7 +410,7 @@ static BOOL get_modifier(char ch, const char** ret) } static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym, - struct array *pmt_ref, char modif) + struct array *pmt_ref, char modif, BOOL in_args) { const char* modifier; const char* str_modif; @@ -465,7 +465,7 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym, else { /* don't insert a space between duplicate '*' */ - if (str_modif[0] && str_modif[1] == '*' && sub_ct.left[strlen(sub_ct.left)-1] == '*') + if (!in_args && str_modif[0] && str_modif[1] == '*' && sub_ct.left[strlen(sub_ct.left)-1] == '*') str_modif++; ct->left = str_printf(sym, "%s%s", sub_ct.left, str_modif ); } @@ -793,17 +793,17 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, } else { - if (!get_modified_type(ct, sym, pmt_ref, '?')) goto done; + if (!get_modified_type(ct, sym, pmt_ref, '?', in_args)) goto done; } break; case 'A': /* reference */ case 'B': /* volatile reference */ - if (!get_modified_type(ct, sym, pmt_ref, dt)) goto done; + if (!get_modified_type(ct, sym, pmt_ref, dt, in_args)) goto done; break; case 'Q': /* const pointer */ case 'R': /* volatile pointer */ case 'S': /* const volatile pointer */ - if (!get_modified_type(ct, sym, pmt_ref, in_args ? dt : 'P')) goto done; + if (!get_modified_type(ct, sym, pmt_ref, in_args ? dt : 'P', in_args)) goto done; break; case 'P': /* Pointer */ if (isdigit(*sym->current)) @@ -833,7 +833,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, } else goto done; } - else if (!get_modified_type(ct, sym, pmt_ref, 'P')) goto done; + else if (!get_modified_type(ct, sym, pmt_ref, 'P', in_args)) goto done; break; case 'W': if (*sym->current == '4')
1
0
0
0
Eric Pouech : msvcrt: undname: correctly handle multi-dimensional arrays.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: 2e1775620a0faaf50c5620d69555c0ad7cc9e51e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e1775620a0faaf50c5620d69…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Apr 28 21:18:26 2008 +0200 msvcrt: undname: correctly handle multi-dimensional arrays. Based on a patch from Ulrich Küttler. --- dlls/msvcrt/tests/cpp.c | 4 ++++ dlls/msvcrt/undname.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index 5daa4cc..2b815b7 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -985,6 +985,10 @@ static void test_demangle(void) {"?$AAA@?C@", "AAA<`template-parameter-2'>"}, {"?$AAA@PAUBBB@@", "AAA<struct BBB *>"}, {"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z", "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa **,class ee *)"}, +{"?f@T@@QAEHQCY1BE@BO@D@Z", "public: int __thiscall T::f(char (volatile * const)[20][30])"}, +{"?f@T@@QAEHQAY2BE@BO@CI@D@Z", "public: int __thiscall T::f(char (* const)[20][30][40])"}, +{"?f@T@@QAEHQAY1BE@BO@$$CBD@Z", "public: int __thiscall T::f(char const (* const)[20][30])"}, + }; int i, num_test = (sizeof(test)/sizeof(test[0])); char* name; diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c index f115dca..9bc0970 100644 --- a/dlls/msvcrt/undname.c +++ b/dlls/msvcrt/undname.c @@ -24,6 +24,7 @@ #include <assert.h> #include <stdio.h> +#include <stdlib.h> #include "msvcrt.h" #include "wine/debug.h" @@ -431,6 +432,31 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym, unsigned mark = sym->stack.num; struct datatype_t sub_ct; + /* multidimensional arrays */ + if (*sym->current == 'Y') + { + const char* n1; + int num; + + sym->current++; + if (!(n1 = get_number(sym))) return FALSE; + num = atoi(n1); + + if (str_modif[0] == ' ' && !modifier) + str_modif++; + + if (modifier) + { + str_modif = str_printf(sym, " (%s%s)", modifier, str_modif); + modifier = NULL; + } + else + str_modif = str_printf(sym, " (%s)", str_modif); + + while (num--) + str_modif = str_printf(sym, "%s[%s]", str_modif, get_number(sym)); + } + /* Recurse to get the referred-to type */ if (!demangle_datatype(sym, &sub_ct, pmt_ref, FALSE)) return FALSE; @@ -872,6 +898,17 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, ct->left = str_printf(sym, "`non-type-template-parameter%s'", ptr); } break; + case '$': + if (*sym->current == 'C') + { + const char* ptr; + + sym->current++; + if (!get_modifier(*sym->current++, &ptr)) goto done; + if (!demangle_datatype(sym, ct, pmt_ref, in_args)) goto done; + ct->left = str_printf(sym, "%s %s", ct->left, ptr); + } + break; } break; default :
1
0
0
0
Eric Pouech : msvcrt: Fixed symbol unmangling for template-parameter-?? form, as well as test.
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: a940218c0b5b64f638b0e1678024659cd77e2089 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a940218c0b5b64f638b0e1678…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Apr 28 21:18:20 2008 +0200 msvcrt: Fixed symbol unmangling for template-parameter-?? form, as well as test. Spotted by James Hawkins. --- dlls/msvcrt/tests/cpp.c | 2 +- dlls/msvcrt/undname.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index 2788a56..5daa4cc 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -982,7 +982,7 @@ static void test_demangle(void) { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "private: static int (__cdecl** Bar::Qux)(class Bar *,int &,int &,int *)" }, { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "Bar::Qux", 0x1800}, {"?$AAA@$DBAB@", "AAA<`template-parameter257'>"}, -{"?$AAA@$D?4@", "AAA<`template-parameter-5'>"}, +{"?$AAA@?C@", "AAA<`template-parameter-2'>"}, {"?$AAA@PAUBBB@@", "AAA<struct BBB *>"}, {"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z", "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa **,class ee *)"}, }; diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c index 93030b2..f115dca 100644 --- a/dlls/msvcrt/undname.c +++ b/dlls/msvcrt/undname.c @@ -759,7 +759,16 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, break; case '?': /* not all the time is seems */ - if (!get_modified_type(ct, sym, pmt_ref, '?')) goto done; + if (in_args) + { + const char* ptr; + if (!(ptr = get_number(sym))) goto done; + ct->left = str_printf(sym, "`template-parameter-%s'", ptr); + } + else + { + if (!get_modified_type(ct, sym, pmt_ref, '?')) goto done; + } break; case 'A': /* reference */ case 'B': /* volatile reference */
1
0
0
0
Rob Shearman : rpcss: When registering a moniker that is already registered in the ROT another ROT entry should still be created and a distinct cookie returned .
by Alexandre Julliard
29 Apr '08
29 Apr '08
Module: wine Branch: master Commit: b9f8a81d8c8ebf35d597b3cc0b35813d0473da7d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b9f8a81d8c8ebf35d597b3cc0…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 28 19:42:35 2008 +0100 rpcss: When registering a moniker that is already registered in the ROT another ROT entry should still be created and a distinct cookie returned. --- dlls/ole32/tests/moniker.c | 1 - programs/rpcss/irotp.c | 20 +++++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index aa737c0..b15cce4 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -690,7 +690,6 @@ static void test_ROT_multiple_entries(void) hr = IRunningObjectTable_Register(pROT, 0, (IUnknown *)&Test_ClassFactory, pMoniker, &dwCookie2); ok(hr == MK_S_MONIKERALREADYREGISTERED, "IRunningObjectTable_Register should have returned MK_S_MONIKERALREADYREGISTERED instead of 0x%08x\n", hr); - todo_wine ok(dwCookie1 != dwCookie2, "cookie returned for registering duplicate object shouldn't match cookie of original object (0x%x)\n", dwCookie1); hr = IRunningObjectTable_GetObject(pROT, pMoniker, &pObject); diff --git a/programs/rpcss/irotp.c b/programs/rpcss/irotp.c index 21ede32..6f32205 100644 --- a/programs/rpcss/irotp.c +++ b/programs/rpcss/irotp.c @@ -137,24 +137,14 @@ HRESULT IrotRegister( } } - if (hr == S_OK) - { - list_add_tail(&RunningObjectTable, &rot_entry->entry); - /* gives a registration identifier to the registered object*/ - *cookie = rot_entry->cookie = InterlockedIncrement(&last_cookie); - *ctxt_handle = rot_entry; - } - else - { - rot_entry_release(rot_entry); - *cookie = existing_rot_entry->cookie; - InterlockedIncrement(&existing_rot_entry->refs); - *ctxt_handle = existing_rot_entry; - } - + list_add_tail(&RunningObjectTable, &rot_entry->entry); LeaveCriticalSection(&csRunningObjectTable); + /* gives a registration identifier to the registered object*/ + *cookie = rot_entry->cookie = InterlockedIncrement(&last_cookie); + *ctxt_handle = rot_entry; + return hr; }
1
0
0
0
← Newer
1
2
3
4
5
...
26
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
Results per page:
10
25
50
100
200