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
Alexandre Julliard : winemenubuilder: Process messages while waiting for the semaphore or the parent process.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: de139bf028c5cf445649ff4fbfba3f34806e0380 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=de139bf028c5cf445649ff4fb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 21 20:34:30 2008 +0200 winemenubuilder: Process messages while waiting for the semaphore or the parent process. --- programs/winemenubuilder/winemenubuilder.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 9ea739d..7d9632d 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -1180,7 +1180,7 @@ static BOOL InvokeShellLinker( IShellLinkW *sl, LPCWSTR link, BOOL bWait ) /* running multiple instances of wineshelllink at the same time may be dangerous */ hsem = CreateSemaphoreA( NULL, 1, 1, "winemenubuilder_semaphore"); - if( WAIT_OBJECT_0 != WaitForSingleObject( hsem, INFINITE ) ) + if( WAIT_OBJECT_0 != MsgWaitForMultipleObjects( 1, &hsem, FALSE, INFINITE, QS_ALLINPUT ) ) { WINE_ERR("failed wait for semaphore\n"); goto cleanup; @@ -1243,7 +1243,7 @@ static BOOL WaitForParentProcess( void ) goto done; } - if (WaitForSingleObject( hprocess, INFINITE ) == WAIT_OBJECT_0) + if (MsgWaitForMultipleObjects( 1, &hprocess, FALSE, INFINITE, QS_ALLINPUT ) == WAIT_OBJECT_0) ret = TRUE; else WINE_ERR("Unable to wait for parent process, error %d\n", GetLastError());
1
0
0
0
Alexandre Julliard : winex11: Get rid of the unnecessary opengl debug channel.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 6b30e61a1e22d8a1472e8f8c2b278c8441d5ecce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b30e61a1e22d8a1472e8f8c2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 21 20:33:49 2008 +0200 winex11: Get rid of the unnecessary opengl debug channel. --- dlls/winex11.drv/opengl.c | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 1a0a52f..0338d06 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -35,7 +35,6 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wgl); -WINE_DECLARE_DEBUG_CHANNEL(opengl); #ifdef SONAME_LIBGL @@ -3370,7 +3369,7 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) return 0; } - TRACE_(opengl)("(%p)\n", physDev); + TRACE("(%p)\n", physDev); drawable = get_glxdrawable(physDev); @@ -3491,7 +3490,7 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, * SwapBuffers (X11DRV.@) */ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return FALSE; } @@ -3502,7 +3501,7 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) { * For OpenGL32 wglCopyContext. */ BOOL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return FALSE; } @@ -3512,7 +3511,7 @@ BOOL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { * For OpenGL32 wglCreateContext. */ HGLRC X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return NULL; } @@ -3522,7 +3521,7 @@ HGLRC X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev) { * For OpenGL32 wglDeleteContext. */ BOOL X11DRV_wglDeleteContext(HGLRC hglrc) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return FALSE; } @@ -3532,18 +3531,18 @@ BOOL X11DRV_wglDeleteContext(HGLRC hglrc) { * For OpenGL32 wglGetProcAddress. */ PROC X11DRV_wglGetProcAddress(LPCSTR lpszProc) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return NULL; } HDC X11DRV_wglGetPbufferDCARB(X11DRV_PDEVICE *hDevice, void *hPbuffer) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return NULL; } BOOL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* hDrawDev, X11DRV_PDEVICE* hReadDev, HGLRC hglrc) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return FALSE; } @@ -3553,7 +3552,7 @@ BOOL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* hDrawDev, X11DRV_PDEVICE* h * For OpenGL32 wglMakeCurrent. */ BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return FALSE; } @@ -3563,7 +3562,7 @@ BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { * For OpenGL32 wglShaderLists. */ BOOL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return FALSE; } @@ -3574,7 +3573,7 @@ BOOL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { */ BOOL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return FALSE; } @@ -3585,7 +3584,7 @@ BOOL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count */ BOOL X11DRV_wglUseFontBitmapsW(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) { - ERR_(opengl)("No OpenGL support compiled in.\n"); + ERR("No OpenGL support compiled in.\n"); return FALSE; }
1
0
0
0
Alexandre Julliard : winex11: Set type to dialog for owned popup windows.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 0bbadeb69ba8b478dea0b0f70345ef7d8cd97b3e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0bbadeb69ba8b478dea0b0f70…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 21 20:33:18 2008 +0200 winex11: Set type to dialog for owned popup windows. --- dlls/winex11.drv/window.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e362e9c..996bb8e 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -883,6 +883,7 @@ void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data ) else if (ex_style & WS_EX_APPWINDOW) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL); else if (style & WS_DLGFRAME) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG); else if (ex_style & WS_EX_DLGMODALFRAME) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG); + else if ((style & WS_POPUP) && owner) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG); #if 0 /* many window managers don't handle utility windows very well */ else if (ex_style & WS_EX_TOOLWINDOW) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_UTILITY); #endif
1
0
0
0
Alexandre Julliard : winex11: Use SetWindowPos to invalidate DCEs when changing the pixel format.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 9727aa812389e73ef63e6fbe1c51d8adfb90518a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9727aa812389e73ef63e6fbe1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 21 20:32:22 2008 +0200 winex11: Use SetWindowPos to invalidate DCEs when changing the pixel format. --- dlls/user32/user32.spec | 1 - dlls/winex11.drv/window.c | 6 +++++- dlls/winex11.drv/x11drv.h | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 7057399..73af8aa 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -788,4 +788,3 @@ # Wine dll separation hacks, these will go away, don't use them # @ cdecl HOOK_CallHooks(long long long long long) -@ cdecl WIN_invalidate_dce(long ptr) invalidate_dce diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 0802b4d..e362e9c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -496,7 +496,10 @@ done: wine_tsx11_lock(); XFlush( display ); wine_tsx11_unlock(); - WIN_invalidate_dce( hwnd, NULL ); + /* force DCE invalidation */ + SetWindowPos( hwnd, 0, 0, 0, 0, 0, + SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE | + SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_STATECHANGED); return TRUE; } @@ -559,6 +562,7 @@ static void sync_gl_drawable(Display *display, struct x11drv_win_data *data) XFreePixmap(display, data->pixmap); destroy_glxpixmap(display, data->gl_drawable); + TRACE( "Recreated GL drawable %lx to replace %lx\n", glxp, data->gl_drawable ); data->pixmap = pix; data->gl_drawable = glxp; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 90a2abd..450153b 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -774,7 +774,6 @@ extern void X11DRV_ForceXIMReset(HWND hwnd); /* FIXME: private functions imported from user32 */ extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ); -extern void WIN_invalidate_dce( HWND hwnd, const RECT *rect ); #define XEMBED_MAPPED (1 << 0)
1
0
0
0
Alexandre Julliard : user32: Invalide DCEs also when resizing a hidden window, or when minimizing.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: b9443c9a14fe52166d202944f479d01c84eadf46 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b9443c9a14fe52166d202944f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 21 20:31:14 2008 +0200 user32: Invalide DCEs also when resizing a hidden window, or when minimizing. --- dlls/user32/winpos.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 4a79352..78749a9 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1909,8 +1909,8 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, USER_Driver->pSetWindowPos( hwnd, insert_after, swp_flags, window_rect, client_rect, &visible_rect, valid_rects ); - if ((((swp_flags & SWP_AGG_NOPOSCHANGE) != SWP_AGG_NOPOSCHANGE) && (new_style & WS_VISIBLE)) || - (swp_flags & (SWP_HIDEWINDOW | SWP_SHOWWINDOW))) + if (((swp_flags & SWP_AGG_NOPOSCHANGE) != SWP_AGG_NOPOSCHANGE) || + (swp_flags & (SWP_HIDEWINDOW | SWP_SHOWWINDOW | SWP_STATECHANGED))) invalidate_dce( hwnd, &old_window_rect ); } return ret;
1
0
0
0
Alexandre Julliard : user32: Dump more SetWindowPos flags.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 6a8b38ff206c1d89304bfd28d44ee8e07c7005e1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6a8b38ff206c1d89304bfd28d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 21 20:30:43 2008 +0200 user32: Dump more SetWindowPos flags. --- dlls/user32/winpos.c | 26 +++++++++----------------- 1 files changed, 9 insertions(+), 17 deletions(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 6914ec0..4a79352 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1465,6 +1465,11 @@ LONG WINPOS_HandleWindowPosChanging( HWND hwnd, WINDOWPOS *winpos ) */ static void dump_winpos_flags(UINT flags) { + static const DWORD dumped_flags = (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | + SWP_NOACTIVATE | SWP_FRAMECHANGED | SWP_SHOWWINDOW | + SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOOWNERZORDER | + SWP_NOSENDCHANGING | SWP_DEFERERASE | SWP_ASYNCWINDOWPOS | + SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_STATECHANGED); TRACE("flags:"); if(flags & SWP_NOSIZE) TRACE(" SWP_NOSIZE"); if(flags & SWP_NOMOVE) TRACE(" SWP_NOMOVE"); @@ -1479,25 +1484,12 @@ static void dump_winpos_flags(UINT flags) if(flags & SWP_NOSENDCHANGING) TRACE(" SWP_NOSENDCHANGING"); if(flags & SWP_DEFERERASE) TRACE(" SWP_DEFERERASE"); if(flags & SWP_ASYNCWINDOWPOS) TRACE(" SWP_ASYNCWINDOWPOS"); + if(flags & SWP_NOCLIENTSIZE) TRACE(" SWP_NOCLIENTSIZE"); + if(flags & SWP_NOCLIENTMOVE) TRACE(" SWP_NOCLIENTMOVE"); + if(flags & SWP_STATECHANGED) TRACE(" SWP_STATECHANGED"); -#define DUMPED_FLAGS \ - (SWP_NOSIZE | \ - SWP_NOMOVE | \ - SWP_NOZORDER | \ - SWP_NOREDRAW | \ - SWP_NOACTIVATE | \ - SWP_FRAMECHANGED | \ - SWP_SHOWWINDOW | \ - SWP_HIDEWINDOW | \ - SWP_NOCOPYBITS | \ - SWP_NOOWNERZORDER | \ - SWP_NOSENDCHANGING | \ - SWP_DEFERERASE | \ - SWP_ASYNCWINDOWPOS) - - if(flags & ~DUMPED_FLAGS) TRACE(" %08x", flags & ~DUMPED_FLAGS); + if(flags & ~dumped_flags) TRACE(" %08x", flags & ~dumped_flags); TRACE("\n"); -#undef DUMPED_FLAGS } /***********************************************************************
1
0
0
0
Alexandre Julliard : winecfg: Don' t allow editing the configuration of the C drive.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 6b42c054c111f5afe567a84840ae81e895f306e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b42c054c111f5afe567a8484…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 21 20:29:34 2008 +0200 winecfg: Don't allow editing the configuration of the C drive. --- programs/winecfg/driveui.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/programs/winecfg/driveui.c b/programs/winecfg/driveui.c index 47aed18..9d9e420 100644 --- a/programs/winecfg/driveui.c +++ b/programs/winecfg/driveui.c @@ -427,6 +427,11 @@ static void update_controls(HWND dialog) if (selection == -1) selection = DRIVE_TYPE_DEFAULT; SendDlgItemMessage(dialog, IDC_COMBO_TYPE, CB_SETCURSEL, selection, 0); + EnableWindow( GetDlgItem( dialog, IDC_BUTTON_REMOVE ), (current_drive->letter != 'C') ); + EnableWindow( GetDlgItem( dialog, IDC_EDIT_PATH ), (current_drive->letter != 'C') ); + EnableWindow( GetDlgItem( dialog, IDC_BUTTON_BROWSE_PATH ), (current_drive->letter != 'C') ); + EnableWindow( GetDlgItem( dialog, IDC_COMBO_TYPE ), (current_drive->letter != 'C') ); + /* removeable media properties */ label = current_drive->label; set_text(dialog, IDC_EDIT_LABEL, label);
1
0
0
0
Alex Villacís Lasso : riched32: Implement a portion of suggested interpretation of CRLF handling for richedit 1 .0 emulation.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 820de0bd595656d2f27863232d96104224d6e158 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=820de0bd595656d2f27863232…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Mon Apr 21 10:10:05 2008 -0500 riched32: Implement a portion of suggested interpretation of CRLF handling for richedit 1.0 emulation. Fixes a few todos introduced by previous patch. --- dlls/riched20/caret.c | 23 +++++++++++++++++++---- dlls/riched32/tests/editor.c | 6 +++--- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index a6a6217..7d50460 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -537,10 +537,25 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, ME_ReleaseStyle(end_run->member.run.style); end_run->member.run.style = tmp_style; p->nOffset = 0; - if(pos-str < len && *pos =='\r') - pos++; - if(pos-str < len && *pos =='\n') - pos++; + if (editor->bEmulateVersion10) { + const WCHAR * tpos; + + tpos = pos; + while (tpos-str < len && *tpos == '\r') { + tpos++; + } + if (tpos-str >= len) { + if (tpos != pos) pos++; + } else if (*tpos == '\n') + pos = tpos + 1; + else + pos++; + } else { + if(pos-str < len && *pos =='\r') + pos++; + if(pos-str < len && *pos =='\n') + pos++; + } if(pos-str <= len) { len -= pos - str; str = pos; diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index f6f04af..906623f 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -113,9 +113,9 @@ static void test_WM_SETTEXT() 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, 1) - TEST_SETTEXT(TestItem6, TestItem6, 3, 1, 1) - TEST_SETTEXT(TestItem7, TestItem7, 4, 1, 1) + TEST_SETTEXT(TestItem5, TestItem5, 2, 1, 0) + TEST_SETTEXT(TestItem6, TestItem6, 3, 1, 0) + TEST_SETTEXT(TestItem7, TestItem7, 4, 1, 0) TEST_SETTEXT(TestItem8, TestItem8, 2, 0, 0) TEST_SETTEXT(TestItem9, TestItem9, 3, 0, 0) TEST_SETTEXT(TestItem10, TestItem10, 3, 0, 0)
1
0
0
0
Alex Villacís Lasso : riched32: Add more todo tests for CR and LF behavior for richedit 1.0.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 17c437d48c3b1be0bf59cfca1273ee10814af581 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=17c437d48c3b1be0bf59cfca1…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Mon Apr 21 10:08:01 2008 -0500 riched32: Add more todo tests for CR and LF behavior for richedit 1.0. --- dlls/riched32/tests/editor.c | 50 ++++++++++++++++++++++++++++++----------- 1 files changed, 36 insertions(+), 14 deletions(-) diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 66a3090..f6f04af 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -64,6 +64,9 @@ static void test_WM_SETTEXT() const char * TestItem11 = "TestSomeText TestSomeText"; const char * TestItem12 = "TestSomeText \r\nTestSomeText"; const char * TestItem13 = "TestSomeText\r\n \r\nTestSomeText"; + const char * TestItem14 = "TestSomeText\n"; + const char * TestItem15 = "TestSomeText\r\r\r"; + const char * TestItem16 = "TestSomeText\r\r\rSomeMoreText"; char buf[1024] = {0}; LRESULT result; @@ -72,9 +75,19 @@ static void test_WM_SETTEXT() return it as is. In particular, \r\r\n is NOT converted, unlike riched20. Currently, builtin riched32 mangles solitary \r or \n when not part of a \r\n pair. + + For riched32, the rules for breaking lines seem to be the following: + - \r\n is one line break. This is the normal case. + - \r{0,N}\n is one line break. In particular, \n by itself is a line break. + - \n{1,N} are that many line breaks. + - \r with text or other characters (except \n) past it, is a line break. That + is, a run of \r{N} without a terminating \n is considered N line breaks + - \r at the end of the text is NOT a line break. This differs from riched20, + where \r at the end of the text is a proper line break. This causes + TestItem2 to fail its test. */ -#define TEST_SETTEXT(a, b, is_todo) \ +#define TEST_SETTEXT(a, b, nlines, is_todo, is_todo2) \ result = SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) a); \ ok (result == 1, "WM_SETTEXT returned %ld instead of 1\n", result); \ result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buf); \ @@ -88,21 +101,30 @@ static void test_WM_SETTEXT() } else { \ ok(result == 0, \ "WM_SETTEXT round trip: strcmp = %ld\n", result); \ + } \ + result = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); \ + if (is_todo2) todo_wine { \ + ok(result == nlines, "EM_GETLINECOUNT returned %ld, expected %d\n", result, nlines); \ + } else { \ + ok(result == nlines, "EM_GETLINECOUNT returned %ld, expected %d\n", result, nlines); \ } - TEST_SETTEXT(TestItem1, TestItem1, 0) - TEST_SETTEXT(TestItem2, TestItem2, 1) - TEST_SETTEXT(TestItem3, TestItem3, 1) - TEST_SETTEXT(TestItem4, TestItem4, 1) - TEST_SETTEXT(TestItem5, TestItem5, 1) - TEST_SETTEXT(TestItem6, TestItem6, 1) - TEST_SETTEXT(TestItem7, TestItem7, 1) - TEST_SETTEXT(TestItem8, TestItem8, 0) - TEST_SETTEXT(TestItem9, TestItem9, 0) - TEST_SETTEXT(TestItem10, TestItem10, 0) - TEST_SETTEXT(TestItem11, TestItem11, 0) - TEST_SETTEXT(TestItem12, TestItem12, 0) - TEST_SETTEXT(TestItem13, TestItem13, 0) + 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, 1) + TEST_SETTEXT(TestItem6, TestItem6, 3, 1, 1) + TEST_SETTEXT(TestItem7, TestItem7, 4, 1, 1) + 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) #undef TEST_SETTEXT DestroyWindow(hwndRichEdit);
1
0
0
0
Alex Villacís Lasso : riched20: EM_SETTEXTEX supports RTF strings, with tests.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 46ff4a6f165c55570324ff87d7a4bdd939d6e4b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=46ff4a6f165c55570324ff87d…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Mon Apr 21 10:05:31 2008 -0500 riched20: EM_SETTEXTEX supports RTF strings, with tests. --- dlls/riched20/editor.c | 11 +++++--- dlls/riched20/tests/editor.c | 56 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 7eaf769..42f7216 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -115,7 +115,7 @@ + EM_SETSCROLLPOS 3.0 - EM_SETTABSTOPS 3.0 - EM_SETTARGETDEVICE (partial) - + EM_SETTEXTEX 3.0 (no rich text insertion handling, proper style?) + + EM_SETTEXTEX 3.0 (proper style?) - EM_SETTEXTMODE 2.0 - EM_SETTYPOGRAPHYOPTIONS 3.0 + EM_SETUNDOLIMIT 2.0 @@ -2117,17 +2117,20 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, wszText = lParam ? ME_ToUnicode(pStruct->codepage == 1200, (void *)lParam) : NULL; len = wszText ? lstrlenW(wszText) : 0; - /* FIXME: this should support RTF strings too, according to MSDN */ if (pStruct->flags & ST_SELECTION) { ME_GetSelection(editor, &from, &to); style = ME_GetSelectionInsertStyle(editor); ME_InternalDeleteText(editor, from, to - from); - ME_InsertTextFromCursor(editor, 0, wszText, len, style); + if (pStruct->codepage != 1200 && lParam && !strncmp((char *)lParam, "{\\rtf", 5)) + ME_StreamInRTFString(editor, 0, (char *)lParam); + else ME_InsertTextFromCursor(editor, 0, wszText, len, style); ME_ReleaseStyle(style); } else { ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor)); - ME_InsertTextFromCursor(editor, 0, wszText, len, editor->pBuffer->pDefaultStyle); + if (pStruct->codepage != 1200 && lParam && !strncmp((char *)lParam, "{\\rtf", 5)) + ME_StreamInRTFString(editor, 0, (char *)lParam); + else ME_InsertTextFromCursor(editor, 0, wszText, len, editor->pBuffer->pDefaultStyle); len = 1; } ME_CommitUndo(editor); diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index b97e458..dd7640c 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -1041,6 +1041,20 @@ static void test_ES_PASSWORD(void) DestroyWindow(hwndRichEdit); } +static DWORD CALLBACK test_WM_SETTEXT_esCallback(DWORD_PTR dwCookie, + LPBYTE pbBuff, + LONG cb, + LONG *pcb) +{ + char** str = (char**)dwCookie; + *pcb = cb; + if (*pcb > 0) { + memcpy(*str, pbBuff, *pcb); + *str += *pcb; + } + return 0; +} + static void test_WM_SETTEXT() { HWND hwndRichEdit = new_richedit(NULL); @@ -1057,8 +1071,11 @@ static void test_WM_SETTEXT() const char * TestItem6_after = "TestSomeText \r\nTestSomeText"; const char * TestItem7 = "TestSomeText\r\n\r\r\n\rTestSomeText"; const char * TestItem7_after = "TestSomeText\r\n \r\nTestSomeText"; + char buf[1024] = {0}; LRESULT result; + EDITSTREAM es; + char * p; /* This test attempts to show that WM_SETTEXT on a riched20 control causes any solitary \r to be converted to \r\n on return. Properly paired @@ -1086,6 +1103,18 @@ static void test_WM_SETTEXT() TEST_SETTEXT(TestItem6, TestItem6_after) TEST_SETTEXT(TestItem7, TestItem7_after) + /* The following test demonstrates that WM_SETTEXT supports RTF strings */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) TestItem1); + p = buf; + es.dwCookie = (DWORD_PTR)&p; + es.dwError = 0; + es.pfnCallback = test_WM_SETTEXT_esCallback; + memset(buf, 0, sizeof(buf)); + SendMessage(hwndRichEdit, EM_STREAMOUT, + (WPARAM)(SF_RTF), (LPARAM)&es); + trace("EM_STREAMOUT produced: \n%s\n", buf); + TEST_SETTEXT(buf, TestItem1) + #undef TEST_SETTEXT DestroyWindow(hwndRichEdit); } @@ -1126,8 +1155,10 @@ static void test_EM_SETTEXTEX(void) ' ','\r', 0}; #define MAX_BUF_LEN 1024 WCHAR buf[MAX_BUF_LEN]; + char * p; int result; CHARRANGE cr; + EDITSTREAM es; setText.codepage = 1200; /* no constant for unicode */ getText.codepage = 1200; /* no constant for unicode */ @@ -1274,6 +1305,31 @@ static void test_EM_SETTEXTEX(void) "EM_SETTEXTEX to replace selection with more text failed: %i.\n", lstrlenW(buf) ); + /* The following test demonstrates that EM_SETTEXTEX supports RTF strings */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "TestSomeText"); /* TestItem1 */ + p = (char *)buf; + es.dwCookie = (DWORD_PTR)&p; + es.dwError = 0; + es.pfnCallback = test_WM_SETTEXT_esCallback; + memset(buf, 0, sizeof(buf)); + SendMessage(hwndRichEdit, EM_STREAMOUT, + (WPARAM)(SF_RTF), (LPARAM)&es); + trace("EM_STREAMOUT produced: \n%s\n", (char *)buf); + + setText.codepage = CP_ACP;/* EM_STREAMOUT saved as ANSI string */ + getText.codepage = 1200; /* no constant for unicode */ + getText.cb = MAX_BUF_LEN; + getText.flags = GT_DEFAULT; + getText.lpDefaultChar = NULL; + getText.lpUsedDefChar = NULL; + + setText.flags = 0; + SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM) buf); + SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buf); + ok(lstrcmpW(buf, TestItem1) == 0, + "EM_GETTEXTEX results not what was set by EM_SETTEXTEX\n"); + + DestroyWindow(hwndRichEdit); }
1
0
0
0
Alex Villacís Lasso : riched20: Fix behavior of EM_REPLACESEL with painting disabled.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: dfcebfb22e17542c6e26fc45b4d285ee88c2730c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dfcebfb22e17542c6e26fc45b…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Mon Apr 21 10:02:52 2008 -0500 riched20: Fix behavior of EM_REPLACESEL with painting disabled. --- dlls/riched20/paint.c | 4 ++- dlls/riched20/tests/editor.c | 52 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 625f7dd..e6ec8ce 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -109,9 +109,11 @@ void ME_UpdateRepaint(ME_TextEditor *editor) { /* Should be called whenever the contents of the control have changed */ ME_Cursor *pCursor; + BOOL wrappedParagraphs; + wrappedParagraphs = ME_WrapMarkedParagraphs(editor); if (!editor->bRedraw) return; - if (ME_WrapMarkedParagraphs(editor)) + if (wrappedParagraphs) ME_UpdateScrollBar(editor); /* Ensure that the cursor is visible */ diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index f8a3d6a..b97e458 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -1793,7 +1793,7 @@ static void test_EM_EXSETSEL(void) DestroyWindow(hwndRichEdit); } -static void test_EM_REPLACESEL(void) +static void test_EM_REPLACESEL(int redraw) { HWND hwndRichEdit = new_richedit(NULL); char buffer[1024] = {0}; @@ -1818,6 +1818,9 @@ static void test_EM_REPLACESEL(void) hwndRichEdit = new_richedit(NULL); + trace("Testing EM_REPLACESEL behavior with redraw=%d\n", redraw); + SendMessage(hwndRichEdit, WM_SETREDRAW, redraw, 0); + /* Test behavior with carriage returns and newlines */ SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "RichEdit1"); @@ -1834,6 +1837,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, "RichEdit1") == 0, "EM_GETTEXTEX results not what was set by EM_REPLACESEL\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 1, "EM_GETLINECOUNT returned %d, expected 1\n", r); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "RichEdit1\r"); ok(10 == r, "EM_REPLACESEL returned %d, expected 10\n", r); @@ -1849,6 +1856,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, "RichEdit1\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 2, "EM_GETLINECOUNT returned %d, expected 2\n", r); + /* Win98's riched20 and WinXP's riched20 disagree on what to return from EM_REPLACESEL. The general rule seems to be that Win98's riched20 returns the number of characters *inserted* into the control (after @@ -1861,6 +1872,10 @@ static void test_EM_REPLACESEL(void) ok(11 == r /* WinXP */ || 10 == r /* Win98 */, "EM_REPLACESEL returned %d, expected 11 or 10\n", r); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 2, "EM_GETLINECOUNT returned %d, expected 2\n", r); + r = SendMessage(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr); ok(0 == r, "EM_EXGETSEL returned %d, expected 0\n", r); ok(cr.cpMin == 10, "EM_EXGETSEL returned cpMin=%d, expected 10\n", cr.cpMin); @@ -1907,6 +1922,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, "\r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 3, "EM_GETLINECOUNT returned %d, expected 3\n", r); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\r\r\n"); ok(3 == r /* WinXP */ || 1 == r /* Win98 */, @@ -1926,6 +1945,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, " ") == 0, "EM_GETTEXTEX returned incorrect string\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 1, "EM_GETLINECOUNT returned %d, expected 1\n", r); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\r\r\r\r\r\n\r\r\r"); ok(9 == r /* WinXP */ || 7 == r /* Win98 */, @@ -1945,6 +1968,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, "\r\r\r \r\r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 7, "EM_GETLINECOUNT returned %d, expected 7\n", r); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\r\r\n\r\n"); ok(5 == r /* WinXP */ || 2 == r /* Win98 */, @@ -1964,6 +1991,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, " \r") == 0, "EM_GETTEXTEX returned incorrect string\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 2, "EM_GETLINECOUNT returned %d, expected 2\n", r); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\r\r\n\r\r"); ok(5 == r /* WinXP */ || 3 == r /* Win98 */, @@ -1983,6 +2014,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, " \r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 3, "EM_GETLINECOUNT returned %d, expected 3\n", r); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\rX\r\n\r\r"); ok(6 == r /* WinXP */ || 5 == r /* Win98 */, @@ -2002,6 +2037,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, "\rX\r\r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 5, "EM_GETLINECOUNT returned %d, expected 5\n", r); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\n\n"); ok(2 == r, "EM_REPLACESEL returned %d, expected 2\n", r); @@ -2020,6 +2059,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, "\r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 3, "EM_GETLINECOUNT returned %d, expected 3\n", r); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)NULL); r = SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM) "\n\n\n\n\r\r\r\r\n"); ok(9 == r /* WinXP */ || 7 == r /* Win98 */, @@ -2039,6 +2082,10 @@ static void test_EM_REPLACESEL(void) ok(strcmp(buffer, "\r\r\r\r\r\r ") == 0, "EM_GETTEXTEX returned incorrect string\n"); + /* Test number of lines reported after EM_REPLACESEL */ + r = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok(r == 7, "EM_GETLINECOUNT returned %d, expected 7\n", r); + DestroyWindow(hwndRichEdit); } @@ -2721,7 +2768,8 @@ START_TEST( editor ) test_EM_FORMATRANGE(); test_unicode_conversions(); test_EM_GETTEXTLENGTHEX(); - test_EM_REPLACESEL(); + test_EM_REPLACESEL(1); + test_EM_REPLACESEL(0); test_eventMask(); /* Set the environment variable WINETEST_RICHED20 to keep windows
1
0
0
0
Jacek Caban : mshtml: Forward IHTMLDocument2' s IDispatch methods to IDispatchEx implementation.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 0a32cd868db912ad861bc2269c38e595f0e7c8c3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0a32cd868db912ad861bc2269…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 21 18:22:12 2008 +0200 mshtml: Forward IHTMLDocument2's IDispatch methods to IDispatchEx implementation. --- dlls/mshtml/htmldoc.c | 32 ++++++++------------------------ 1 files changed, 8 insertions(+), 24 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 16db749..0bb2ebf 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -213,16 +213,16 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface) static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo) { HTMLDocument *This = HTMLDOC_THIS(iface); - FIXME("(%p)->(%p)\n", This, pctinfo); - return E_NOTIMPL; + + return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo); } static HRESULT WINAPI HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocument *This = HTMLDOC_THIS(iface); - FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); - return E_NOTIMPL; + + return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo); } static HRESULT WINAPI HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID riid, @@ -230,9 +230,8 @@ static HRESULT WINAPI HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID r LCID lcid, DISPID *rgDispId) { HTMLDocument *This = HTMLDOC_THIS(iface); - FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, - lcid, rgDispId); - return E_NOTIMPL; + + return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId); } static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMember, @@ -241,23 +240,8 @@ static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMe { HTMLDocument *This = HTMLDOC_THIS(iface); - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), - lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); - - switch(dispIdMember) { - case DISPID_READYSTATE: - if(!(wFlags & DISPATCH_PROPERTYGET)) - return E_INVALIDARG; - - V_VT(pVarResult) = VT_I4; - V_I4(pVarResult) = This->readystate; - return S_OK; - - default: - FIXME("Unsupported dispid %d\n", dispIdMember); - } - - return E_NOTIMPL; + return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams, + pVarResult, pExcepInfo, puArgErr); } static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch **p)
1
0
0
0
Jacek Caban : mshtml: Added HTMLDocument's IDispatchEx implementation.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 98ab1a92c03c9aa28963e5cb221a7fbd137bd318 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=98ab1a92c03c9aa28963e5cb2…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 21 18:21:54 2008 +0200 mshtml: Added HTMLDocument's IDispatchEx implementation. --- dlls/mshtml/dispex.c | 5 + dlls/mshtml/htmldoc.c | 169 +++++++++++++++++++++++++++++++++++++++++- dlls/mshtml/mshtml_private.h | 7 ++ 3 files changed, 180 insertions(+), 1 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 06b495b..26be1e8 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -51,7 +51,12 @@ static struct list dispex_data_list = LIST_INIT(dispex_data_list); static REFIID tid_ids[] = { &IID_NULL, + &DIID_DispHTMLDocument, &DIID_DispHTMLWindow2, + &IID_IHTMLDocument2, + &IID_IHTMLDocument3, + &IID_IHTMLDocument4, + &IID_IHTMLDocument5, &IID_IHTMLWindow2, &IID_IHTMLWindow3, &IID_IOmNavigator diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 1907ab7..16db749 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -46,7 +46,10 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID *ppvObject = HTMLDOC(This); }else if(IsEqualGUID(&IID_IDispatch, riid)) { TRACE("(%p)->(IID_IDispatch, %p)\n", This, ppvObject); - *ppvObject = HTMLDOC(This); + *ppvObject = DISPATCHEX(This); + }else if(IsEqualGUID(&IID_IDispatchEx, riid)) { + TRACE("(%p)->(IID_IDispatchEx, %p)\n", This, ppvObject); + *ppvObject = DISPATCHEX(This); }else if(IsEqualGUID(&IID_IHTMLDocument, riid)) { TRACE("(%p)->(IID_IHTMLDocument, %p)\n", This, ppvObject); *ppvObject = HTMLDOC(This); @@ -1354,6 +1357,167 @@ static const IHTMLDocument2Vtbl HTMLDocumentVtbl = { HTMLDocument_createStyleSheet }; +#define DISPEX_THIS(iface) DEFINE_THIS(HTMLDocument, IDispatchEx, iface) + +static HRESULT WINAPI DocDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IHTMLWindow2_QueryInterface(HTMLDOC(This), riid, ppv); +} + +static ULONG WINAPI DocDispatchEx_AddRef(IDispatchEx *iface) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IHTMLWindow2_AddRef(HTMLDOC(This)); +} + +static ULONG WINAPI DocDispatchEx_Release(IDispatchEx *iface) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IHTMLWindow2_AddRef(HTMLDOC(This)); +} + +static HRESULT WINAPI DocDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo); +} + +static HRESULT WINAPI DocDispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI DocDispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId); +} + +static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + + switch(dispIdMember) { + case DISPID_READYSTATE: + TRACE("DISPID_READYSTATE\n"); + + if(!(wFlags & DISPATCH_PROPERTYGET)) + return E_INVALIDARG; + + V_VT(pVarResult) = VT_I4; + V_I4(pVarResult) = This->readystate; + return S_OK; + } + + return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid, wFlags, pDispParams, + pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_GetDispID(DISPATCHEX(&This->dispex), bstrName, grfdex, pid); +} + +static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_InvokeEx(DISPATCHEX(&This->dispex), id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); +} + +static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_DeleteMemberByName(DISPATCHEX(&This->dispex), bstrName, grfdex); +} + +static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_DeleteMemberByDispID(DISPATCHEX(&This->dispex), id); +} + +static HRESULT WINAPI DocDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_GetMemberProperties(DISPATCHEX(&This->dispex), id, grfdexFetch, pgrfdex); +} + +static HRESULT WINAPI DocDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_GetMemberName(DISPATCHEX(&This->dispex), id, pbstrName); +} + +static HRESULT WINAPI DocDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_GetNextDispID(DISPATCHEX(&This->dispex), grfdex, id, pid); +} + +static HRESULT WINAPI DocDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) +{ + HTMLDocument *This = DISPEX_THIS(iface); + + return IDispatchEx_GetNameSpaceParent(DISPATCHEX(&This->dispex), ppunk); +} + +#undef DISPEX_THIS + +static const IDispatchExVtbl DocDispatchExVtbl = { + DocDispatchEx_QueryInterface, + DocDispatchEx_AddRef, + DocDispatchEx_Release, + DocDispatchEx_GetTypeInfoCount, + DocDispatchEx_GetTypeInfo, + DocDispatchEx_GetIDsOfNames, + DocDispatchEx_Invoke, + DocDispatchEx_GetDispID, + DocDispatchEx_InvokeEx, + DocDispatchEx_DeleteMemberByName, + DocDispatchEx_DeleteMemberByDispID, + DocDispatchEx_GetMemberProperties, + DocDispatchEx_GetMemberName, + DocDispatchEx_GetNextDispID, + DocDispatchEx_GetNameSpaceParent +}; + +static dispex_static_data_t HTMLDocument_dispex = { + DispHTMLDocument_tid, + NULL, + { + IHTMLDocument2_tid, + IHTMLDocument3_tid, + IHTMLDocument4_tid, + IHTMLDocument5_tid, + 0 + } +}; + HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) { HTMLDocument *ret; @@ -1363,6 +1527,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) ret = heap_alloc_zero(sizeof(HTMLDocument)); ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl; + ret->lpIDispatchExVtbl = &DocDispatchExVtbl; ret->ref = 0; ret->readystate = READYSTATE_UNINITIALIZED; @@ -1394,6 +1559,8 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) ConnectionPoint_Init(&ret->cp_htmldocevents, &ret->cp_container, &DIID_HTMLDocumentEvents); ConnectionPoint_Init(&ret->cp_htmldocevents2, &ret->cp_container, &DIID_HTMLDocumentEvents2); + init_dispex(&ret->dispex, (IUnknown*)HTMLDOC(ret), &HTMLDocument_dispex); + ret->nscontainer = NSContainer_Create(ret, NULL); ret->window = HTMLWindow_Create(ret); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 15320be..73169f7 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -61,7 +61,12 @@ typedef struct event_target_t event_target_t; /* NOTE: make sure to keep in sync with dispex.c */ typedef enum { NULL_tid, + DispHTMLDocument_tid, DispHTMLWindow2_tid, + IHTMLDocument2_tid, + IHTMLDocument3_tid, + IHTMLDocument4_tid, + IHTMLDocument5_tid, IHTMLWindow2_tid, IHTMLWindow3_tid, IOmNavigator_tid, @@ -149,6 +154,7 @@ typedef struct { } HTMLOptionElementFactory; struct HTMLDocument { + DispatchEx dispex; const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl; const IHTMLDocument3Vtbl *lpHTMLDocument3Vtbl; const IHTMLDocument4Vtbl *lpHTMLDocument4Vtbl; @@ -168,6 +174,7 @@ struct HTMLDocument { const IHlinkTargetVtbl *lpHlinkTargetVtbl; const IPersistStreamInitVtbl *lpPersistStreamInitVtbl; const ICustomDocVtbl *lpCustomDocVtbl; + const IDispatchExVtbl *lpIDispatchExVtbl; LONG ref;
1
0
0
0
Jacek Caban : mshtml: Make IHTMLDocument2 iterface offset independent.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 7d0034a5ba3ab64cba7440c28d642f4e8d1e0978 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d0034a5ba3ab64cba7440c28…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 21 18:21:33 2008 +0200 mshtml: Make IHTMLDocument2 iterface offset independent. --- dlls/mshtml/htmldoc.c | 308 ++++++++++++++++++++++++++++++++---------------- 1 files changed, 205 insertions(+), 103 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7d0034a5ba3ab64cba744…
1
0
0
0
Jacek Caban : mshtml: Added setTimeout implementation.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 788432af49d0ce9a63ab15397c5277c68ec574b2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=788432af49d0ce9a63ab15397…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 21 18:21:19 2008 +0200 mshtml: Added setTimeout implementation. --- dlls/mshtml/htmlwindow.c | 15 ++++++- dlls/mshtml/mshtml_private.h | 2 + dlls/mshtml/task.c | 95 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index ce98f38..82b03e6 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -845,8 +845,19 @@ static HRESULT WINAPI HTMLWindow3_setTimeout(IHTMLWindow3 *iface, VARIANT *expre VARIANT *language, long *timerID) { HTMLWindow *This = HTMLWINDOW3_THIS(iface); - FIXME("(%p)->(%p(%d) %ld %p %p)\n", This, expression, V_VT(expression), msec, language, timerID); - return E_NOTIMPL; + + TRACE("(%p)->(%p(%d) %ld %p %p)\n", This, expression, V_VT(expression), msec, language, timerID); + + switch(V_VT(expression)) { + case VT_DISPATCH: + *timerID = set_task_timer(This->doc, msec, V_DISPATCH(expression)); + break; + + default: + FIXME("unimplemented vt=%d\n", V_VT(expression)); + } + + return S_OK; } static HRESULT WINAPI HTMLWindow3_setInterval(IHTMLWindow3 *iface, VARIANT *expression, long msec, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 8bca848..15320be 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -555,12 +555,14 @@ typedef struct { HWND thread_hwnd; task_t *task_queue_head; task_t *task_queue_tail; + struct list timer_list; } thread_data_t; thread_data_t *get_thread_data(BOOL); HWND get_thread_hwnd(void); void push_task(task_t*); void remove_doc_tasks(const HTMLDocument*); +DWORD set_task_timer(HTMLDocument*,DWORD,IDispatch*); HRESULT get_typeinfo(tid_t,ITypeInfo**); void release_typelib(void); diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index 3bb99cc..99e2573 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -36,6 +36,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); #define WM_PROCESSTASK 0x8008 +#define TIMER_ID 0x3000 + +typedef struct { + HTMLDocument *doc; + DWORD id; + DWORD time; + IDispatch *disp; + + struct list entry; +} task_timer_t; void push_task(task_t *task) { @@ -66,11 +76,34 @@ static task_t *pop_task(void) return task; } +static void release_task_timer(HWND thread_hwnd, task_timer_t *timer) +{ + list_remove(&timer->entry); + + KillTimer(thread_hwnd, timer->id); + IDispatch_Release(timer->disp); + + heap_free(timer); +} + void remove_doc_tasks(const HTMLDocument *doc) { thread_data_t *thread_data = get_thread_data(FALSE); + struct list *liter, *ltmp; + task_timer_t *timer; task_t *iter, *tmp; + LIST_FOR_EACH_SAFE(liter, ltmp, &thread_data->timer_list) { + timer = LIST_ENTRY(liter, task_timer_t, entry); + if(timer->doc == doc) + release_task_timer(thread_data->thread_hwnd, timer); + } + + if(!list_empty(&thread_data->timer_list)) { + timer = LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry); + SetTimer(thread_data->thread_hwnd, TIMER_ID, timer->time - GetTickCount(), NULL); + } + if(!thread_data) return; @@ -90,6 +123,43 @@ void remove_doc_tasks(const HTMLDocument *doc) } } +DWORD set_task_timer(HTMLDocument *doc, DWORD msec, IDispatch *disp) +{ + thread_data_t *thread_data = get_thread_data(TRUE); + task_timer_t *timer; + DWORD tc = GetTickCount(); + + static DWORD id_cnt = 0x20000000; + + timer = heap_alloc(sizeof(task_timer_t)); + timer->id = id_cnt++; + timer->doc = doc; + timer->time = tc + msec; + + IDispatch_AddRef(disp); + timer->disp = disp; + + if(list_empty(&thread_data->timer_list) + || LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry)->time > timer->time) { + + list_add_head(&thread_data->timer_list, &timer->entry); + SetTimer(thread_data->thread_hwnd, TIMER_ID, msec, NULL); + }else { + task_timer_t *iter; + + LIST_FOR_EACH_ENTRY(iter, &thread_data->timer_list, task_timer_t, entry) { + if(iter->time > timer->time) { + list_add_tail(&iter->entry, &timer->entry); + return timer->id; + } + } + + list_add_tail(&thread_data->timer_list, &timer->entry); + } + + return timer->id; +} + static void set_downloading(HTMLDocument *doc) { IOleCommandTarget *olecmd; @@ -238,6 +308,28 @@ static void process_task(task_t *task) } } +static LRESULT process_timer(void) +{ + thread_data_t *thread_data = get_thread_data(TRUE); + DWORD tc = GetTickCount(); + task_timer_t *timer; + + while(!list_empty(&thread_data->timer_list)) { + timer = LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry); + if(timer->time > tc) { + SetTimer(thread_data->thread_hwnd, TIMER_ID, timer->time-tc, NULL); + return 0; + } + + list_remove(&timer->entry); + call_disp_func(timer->doc, timer->disp); + release_task_timer(thread_data->thread_hwnd, timer); + } + + KillTimer(thread_data->thread_hwnd, TIMER_ID); + return 0; +} + static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { @@ -252,6 +344,8 @@ static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa } return 0; + case WM_TIMER: + return process_timer(); } if(msg > WM_USER) @@ -307,6 +401,7 @@ thread_data_t *get_thread_data(BOOL create) if(!thread_data && create) { thread_data = heap_alloc_zero(sizeof(thread_data_t)); TlsSetValue(mshtml_tls, thread_data); + list_init(&thread_data->timer_list); } return thread_data;
1
0
0
0
Jacek Caban : mshtml: Forward IHTMLWindow2::setTimeout to IHTMLWindow3:: setTimeout.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 86409551889d99775aa04c64c48188c8cc32ad68 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=86409551889d99775aa04c64c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 21 18:12:49 2008 +0200 mshtml: Forward IHTMLWindow2::setTimeout to IHTMLWindow3::setTimeout. --- dlls/mshtml/htmlwindow.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 43c893f..ce98f38 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -184,8 +184,14 @@ static HRESULT WINAPI HTMLWindow2_setTimeout(IHTMLWindow2 *iface, BSTR expressio long msec, VARIANT *language, long *timerID) { HTMLWindow *This = HTMLWINDOW2_THIS(iface); - FIXME("(%p)->(%s %ld %p %p)\n", This, debugstr_w(expression), msec, language, timerID); - return E_NOTIMPL; + VARIANT expr_var; + + TRACE("(%p)->(%s %ld %p %p)\n", This, debugstr_w(expression), msec, language, timerID); + + V_VT(&expr_var) = VT_BSTR; + V_BSTR(&expr_var) = expression; + + return IHTMLWindow3_setTimeout(HTMLWINDOW3(This), &expr_var, msec, language, timerID); } static HRESULT WINAPI HTMLWindow2_clearTimeout(IHTMLWindow2 *iface, long timerID)
1
0
0
0
Jacek Caban : mshtml: Added IHTMLWindow2::get_document implementation.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: aeb1095b47482fdbdb46814d51a54601712837ef URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aeb1095b47482fdbdb46814d5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 21 18:12:32 2008 +0200 mshtml: Added IHTMLWindow2::get_document implementation. --- dlls/mshtml/htmlwindow.c | 14 ++++++++++++-- dlls/mshtml/tests/dom.c | 21 ++++++++++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 5ed5701..43c893f 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -467,8 +467,18 @@ static HRESULT WINAPI HTMLWindow2_get_onscroll(IHTMLWindow2 *iface, VARIANT *p) static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocument2 **p) { HTMLWindow *This = HTMLWINDOW2_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + if(This->doc) { + /* FIXME: We should return a wrapper object here */ + *p = HTMLDOC(This->doc); + IHTMLDocument2_AddRef(*p); + }else { + *p = NULL; + } + + return S_OK; } static HRESULT WINAPI HTMLWindow2_get_event(IHTMLWindow2 *iface, IHTMLEventObj **p) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 90ccd4d..59c2a17 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -1081,7 +1081,6 @@ static void test_navigator(IHTMLDocument2 *doc) hres = IHTMLDocument2_get_parentWindow(doc, &window); ok(hres == S_OK, "parentWidnow failed: %08x\n", hres); - test_ifaces((IUnknown*)window, window_iids); hres = IHTMLWindow2_get_navigator(window, &navigator); ok(hres == S_OK, "get_navigator failed: %08x\n", hres); @@ -1187,6 +1186,25 @@ static void test_default_body(IHTMLBodyElement *body) ok(bstr == NULL, "bstr != NULL\n"); } +static void test_window(IHTMLDocument2 *doc) +{ + IHTMLWindow2 *window; + IHTMLDocument2 *doc2 = NULL; + HRESULT hres; + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentElement failed: %08x\n", hres); + test_ifaces((IUnknown*)window, window_iids); + test_disp((IUnknown*)window, &DIID_DispHTMLWindow2); + + hres = IHTMLWindow2_get_document(window, &doc2); + ok(hres == S_OK, "get_document failed: %08x\n", hres); + ok(doc2 != NULL, "doc2 == NULL\n"); + + IHTMLDocument_Release(doc2); + IHTMLWindow2_Release(window); +} + static void test_defaults(IHTMLDocument2 *doc) { IHTMLStyleSheetsCollection *stylesheetcol; @@ -1209,6 +1227,7 @@ static void test_defaults(IHTMLDocument2 *doc) ok(hres == S_OK, "get_style failed: %08x\n", hres); test_default_style(style); + test_window(doc); test_compatmode(doc); test_location(doc); test_navigator(doc);
1
0
0
0
Jacek Caban : mshtml: Added navigator's IDispatchEx test.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 7c63087a5c99c144567095ef65326350fcbd9b92 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c63087a5c99c144567095ef6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 21 18:12:10 2008 +0200 mshtml: Added navigator's IDispatchEx test. --- dlls/mshtml/tests/dom.c | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 5e2acde..90ccd4d 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -30,6 +30,7 @@ #include "mshtmcid.h" #include "mshtmhst.h" #include "docobj.h" +#include "dispex.h" static const char doc_blank[] = "<html></html>"; static const char doc_str1[] = "<html><body>test</body></html>"; @@ -268,6 +269,41 @@ static void _test_ifaces(unsigned line, IUnknown *iface, REFIID *iids) } } +#define test_disp(u,id) _test_disp(__LINE__,u,id) +static void _test_disp(unsigned line, IUnknown *unk, const IID *diid) +{ + IDispatchEx *dispex; + ITypeInfo *typeinfo; + UINT ticnt; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IDispatchEx, (void**)&dispex); + ok_(__FILE__,line) (hres == S_OK, "Could not get IDispatch: %08x\n", hres); + if(FAILED(hres)) + return; + + ticnt = 0xdeadbeef; + hres = IDispatchEx_GetTypeInfoCount(dispex, &ticnt); + ok_(__FILE__,line) (hres == S_OK, "GetTypeInfoCount failed: %08x\n", hres); + ok_(__FILE__,line) (ticnt == 1, "ticnt=%u\n", ticnt); + + hres = IDispatchEx_GetTypeInfo(dispex, 0, 0, &typeinfo); + ok_(__FILE__,line) (hres == S_OK, "GetTypeInfo failed: %08x\n", hres); + + if(SUCCEEDED(hres)) { + TYPEATTR *type_attr; + + hres = ITypeInfo_GetTypeAttr(typeinfo, &type_attr); + ok_(__FILE__,line) (hres == S_OK, "GetTypeAttr failed: %08x\n", hres); + ok_(__FILE__,line) (IsEqualGUID(&type_attr->guid, diid), "unexpected guid %s\n", dbgstr_guid(&type_attr->guid)); + + ITypeInfo_ReleaseTypeAttr(typeinfo, type_attr); + ITypeInfo_Release(typeinfo); + } + + IDispatchEx_Release(dispex); +} + #define test_node_name(u,n) _test_node_name(__LINE__,u,n) static void _test_node_name(unsigned line, IUnknown *unk, const char *exname) { @@ -1050,6 +1086,7 @@ static void test_navigator(IHTMLDocument2 *doc) hres = IHTMLWindow2_get_navigator(window, &navigator); ok(hres == S_OK, "get_navigator failed: %08x\n", hres); ok(navigator != NULL, "navigator == NULL\n"); + test_disp((IUnknown*)navigator, &IID_IOmNavigator); hres = IHTMLWindow2_get_navigator(window, &navigator2); ok(hres == S_OK, "get_navigator failed: %08x\n", hres);
1
0
0
0
Steven Edwards : rpcrt4: Correct the number of aguments for fill_method on unsupported architectures .
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: d0ddece843064b8acbc90bb8a5c293879abca248 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d0ddece843064b8acbc90bb8a…
Author: Steven Edwards <winehacker(a)gmail.com> Date: Mon Apr 21 09:49:59 2008 -0400 rpcrt4: Correct the number of aguments for fill_method on unsupported architectures. --- dlls/rpcrt4/cstub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/cstub.c b/dlls/rpcrt4/cstub.c index b416a10..83a5fb2 100644 --- a/dlls/rpcrt4/cstub.c +++ b/dlls/rpcrt4/cstub.c @@ -194,7 +194,7 @@ static void fill_table(IUnknownVtbl *vtbl, void **methods, DWORD num) #else /* __i386__ */ typedef struct {int dummy;} vtbl_method_t; -static void fill_table(IUnknownVtbl *vtbl, DWORD num) +static void fill_table(IUnknownVtbl *vtbl, void **methods, DWORD num) { ERR("delegated stubs are not supported on this architecture\n"); }
1
0
0
0
Dmitry Timoshkov : gdi32: Add a test for EMR_EXTSELECTCLIPRGN, make it pass under Wine.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 5201c78b2e07e19158dff8d30f12ac20a2afd6cc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5201c78b2e07e19158dff8d30…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Mon Apr 21 19:38:03 2008 +0900 gdi32: Add a test for EMR_EXTSELECTCLIPRGN, make it pass under Wine. --- dlls/gdi32/enhmetafile.c | 12 +-- dlls/gdi32/tests/metafile.c | 196 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 199 insertions(+), 9 deletions(-) diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c index 39b6057..a3e7aa5 100644 --- a/dlls/gdi32/enhmetafile.c +++ b/dlls/gdi32/enhmetafile.c @@ -1172,17 +1172,15 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_EXTSELECTCLIPRGN: { - static int extselectcliprgn_cases; -#if 0 - const EMREXTSELECTCLIPRGN lpRgn = (const EMREXTSELECTCLIPRGN *)mr; - HRGN hRgn = ExtCreateRegion(NULL, lpRgn->cbRgnData, (RGNDATA *)lpRgn->RgnData); + const EMREXTSELECTCLIPRGN *lpRgn = (const EMREXTSELECTCLIPRGN *)mr; + HRGN hRgn = 0; + + if (mr->nSize >= sizeof(*lpRgn) + sizeof(RGNDATAHEADER)) + hRgn = ExtCreateRegion( &info->init_transform, 0, (RGNDATA *)lpRgn->RgnData ); ExtSelectClipRgn(hdc, hRgn, (INT)(lpRgn->iMode)); /* ExtSelectClipRgn created a copy of the region */ DeleteObject(hRgn); -#endif - if(!(extselectcliprgn_cases++)) - FIXME("ExtSelectClipRgn\n"); break; } diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 72100c8..473f7e3 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -302,8 +302,6 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, ok(save_state == 0, "EOF save_state %d\n", save_state); break; } - - return 1; } @@ -1158,6 +1156,199 @@ static void test_emf_ExtTextOut_on_path(void) DestroyWindow(hwnd); } +static const unsigned char EMF_CLIPPING[] = +{ + 0x01, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, + 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00, + 0xd0, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x7c, 0x01, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x60, 0xcc, 0x05, 0x00, + 0xe0, 0x93, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 +}; + +static void translate( POINT *pt, UINT count, const XFORM *xform ) +{ + while (count--) + { + FLOAT x = (FLOAT)pt->x; + FLOAT y = (FLOAT)pt->y; + pt->x = (LONG)floor( x * xform->eM11 + y * xform->eM21 + xform->eDx + 0.5 ); + pt->y = (LONG)floor( x * xform->eM12 + y * xform->eM22 + xform->eDy + 0.5 ); + pt++; + } +} + +static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, + const ENHMETARECORD *emr, int n_objs, LPARAM param) +{ + if (emr->iType == EMR_EXTSELECTCLIPRGN) + { + const EMREXTSELECTCLIPRGN *clip = (const EMREXTSELECTCLIPRGN *)emr; + union _rgn + { + RGNDATA data; + char buf[sizeof(RGNDATAHEADER) + sizeof(RECT)]; + }; + const union _rgn *rgn1; + union _rgn rgn2; + RECT rect, rc_transformed; + const RECT *rc = (const RECT *)param; + HRGN hrgn; + XFORM xform; + INT ret; + BOOL is_win9x; + + trace("EMR_EXTSELECTCLIPRGN: cbRgnData %#x, iMode %u\n", + clip->cbRgnData, clip->iMode); + + ok(clip->iMode == RGN_COPY, "expected RGN_COPY, got %u\n", clip->iMode); + ok(clip->cbRgnData >= sizeof(RGNDATAHEADER) + sizeof(RECT), + "too small data block: %u bytes\n", clip->cbRgnData); + if (clip->cbRgnData < sizeof(RGNDATAHEADER) + sizeof(RECT)) + return 0; + + rgn1 = (const union _rgn *)clip->RgnData; + + trace("size %u, type %u, count %u, rgn size %u, bound (%d,%d-%d,%d)\n", + rgn1->data.rdh.dwSize, rgn1->data.rdh.iType, + rgn1->data.rdh.nCount, rgn1->data.rdh.nRgnSize, + rgn1->data.rdh.rcBound.left, rgn1->data.rdh.rcBound.top, + rgn1->data.rdh.rcBound.right, rgn1->data.rdh.rcBound.bottom); + + ok(EqualRect(&rgn1->data.rdh.rcBound, rc), "rects don't match\n"); + + rect = *(const RECT *)rgn1->data.Buffer; + trace("rect (%d,%d-%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom); + ok(EqualRect(&rect, rc), "rects don't match\n"); + + ok(rgn1->data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %u", rgn1->data.rdh.dwSize); + ok(rgn1->data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %u\n", rgn1->data.rdh.iType); + ok(rgn1->data.rdh.nCount == 1, "expected 1, got %u\n", rgn1->data.rdh.nCount); + ok(rgn1->data.rdh.nRgnSize == sizeof(RECT), "expected sizeof(RECT), got %u\n", rgn1->data.rdh.nRgnSize); + + hrgn = CreateRectRgn(0, 0, 0, 0); + + memset(&xform, 0, sizeof(xform)); + SetLastError(0xdeadbeef); + ret = GetWorldTransform(hdc, &xform); + is_win9x = !ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED; + if (!is_win9x) + ok(ret, "GetWorldTransform error %u\n", GetLastError()); + + trace("xform.eM11 %f, xform.eM22 %f\n", xform.eM11, xform.eM22); + + ret = GetClipRgn(hdc, hrgn); + ok(ret == 0, "GetClipRgn returned %d, expected 0\n", ret); + + PlayEnhMetaFileRecord(hdc, handle_table, emr, n_objs); + + ret = GetClipRgn(hdc, hrgn); + ok(ret == 1, "GetClipRgn returned %d, expected 0\n", ret); + + /* Win9x returns empty clipping region */ + if (is_win9x) return 1; + + ret = GetRegionData(hrgn, 0, NULL); + ok(ret == sizeof(rgn2.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret); + + ret = GetRegionData(hrgn, sizeof(rgn2), &rgn2.data); + + trace("size %u, type %u, count %u, rgn size %u, bound (%d,%d-%d,%d)\n", + rgn2.data.rdh.dwSize, rgn2.data.rdh.iType, + rgn2.data.rdh.nCount, rgn2.data.rdh.nRgnSize, + rgn2.data.rdh.rcBound.left, rgn2.data.rdh.rcBound.top, + rgn2.data.rdh.rcBound.right, rgn2.data.rdh.rcBound.bottom); + + rect = rgn2.data.rdh.rcBound; + rc_transformed = *rc; + translate((POINT *)&rc_transformed, 2, &xform); + ok(EqualRect(&rect, &rc_transformed), "rects don't match\n"); + + rect = *(const RECT *)rgn2.data.Buffer; + trace("rect (%d,%d-%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom); + rc_transformed = *rc; + translate((POINT *)&rc_transformed, 2, &xform); + ok(EqualRect(&rect, &rc_transformed), "rects don't match\n"); + + ok(rgn2.data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %u", rgn2.data.rdh.dwSize); + ok(rgn2.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %u\n", rgn2.data.rdh.iType); + ok(rgn2.data.rdh.nCount == 1, "expected 1, got %u\n", rgn2.data.rdh.nCount); + ok(rgn2.data.rdh.nRgnSize == sizeof(RECT), "expected sizeof(RECT), got %u\n", rgn2.data.rdh.nRgnSize); + + DeleteObject(hrgn); + } + return 1; +} + +static void test_emf_clipping(void) +{ + static const RECT rc = { 0, 0, 100, 100 }; + RECT rc_clip = { 100, 100, 1024, 1024 }; + HWND hwnd; + HDC hdc; + HENHMETAFILE hemf; + HRGN hrgn; + INT ret; + + SetLastError(0xdeadbeef); + hdc = CreateEnhMetaFileA(0, NULL, NULL, NULL); + ok(hdc != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + + /* Need to write something to the emf, otherwise Windows won't play it back */ + LineTo(hdc, 1, 1); + + hrgn = CreateRectRgn(rc_clip.left, rc_clip.top, rc_clip.right, rc_clip.bottom); + ret = SelectClipRgn(hdc, hrgn); + ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); + + SetLastError(0xdeadbeef); + hemf = CloseEnhMetaFile(hdc); + ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + + if (compare_emf_bits(hemf, EMF_CLIPPING, sizeof(EMF_CLIPPING), + "emf_clipping", TRUE) != 0) + { + dump_emf_bits(hemf, "emf_clipping"); + dump_emf_records(hemf, "emf_clipping"); + } + + DeleteObject(hrgn); + + /* Win9x doesn't play EMFs on invisible windows */ + hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE, + 0, 0, 200, 200, 0, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowExA error %d\n", GetLastError()); + + hdc = GetDC(hwnd); + + ret = EnumEnhMetaFile(hdc, hemf, clip_emf_enum_proc, &rc_clip, &rc); + ok(ret, "EnumEnhMetaFile error %d\n", GetLastError()); + + DeleteEnhMetaFile(hemf); + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); +} + static INT CALLBACK EmfEnumProc(HDC hdc, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, INT nObj, LPARAM lpData) { LPMETAFILEPICT lpMFP = (LPMETAFILEPICT)lpData; @@ -1617,6 +1808,7 @@ START_TEST(metafile) test_SetMetaFileBits(); test_mf_ExtTextOut_on_path(); test_emf_ExtTextOut_on_path(); + test_emf_clipping(); /* For metafile conversions */ test_mf_conversions();
1
0
0
0
Nikolay Sivov : gdiplus: GdipCreateLineBrushI implemented using float args version.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 0679e9770a773c166ea1ca25564d6a31748ad65b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0679e9770a773c166ea1ca255…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Apr 21 00:45:52 2008 +0400 gdiplus: GdipCreateLineBrushI implemented using float args version. --- dlls/gdiplus/brush.c | 18 ++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- 2 files changed, 19 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 7f324f3..1c69518 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -131,6 +131,24 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint, return Ok; } +GpStatus WINGDIPAPI GdipCreateLineBrushI(GDIPCONST GpPoint* startpoint, + GDIPCONST GpPoint* endpoint, ARGB startcolor, ARGB endcolor, + GpWrapMode wrap, GpLineGradient **line) +{ + GpPointF stF; + GpPointF endF; + + if(!startpoint || !endpoint) + return InvalidParameter; + + stF.X = (REAL)startpoint->X; + stF.Y = (REAL)startpoint->Y; + endF.X = (REAL)endpoint->X; + endF.X = (REAL)endpoint->Y; + + return GdipCreateLineBrush(&stF, &endF, startcolor, endcolor, wrap, line); +} + GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect, ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, GpLineGradient **line) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index fff85c1..cbea1b9 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -103,7 +103,7 @@ @ stdcall GdipCreateLineBrushFromRectI(ptr long long long long ptr) @ stub GdipCreateLineBrushFromRectWithAngle @ stub GdipCreateLineBrushFromRectWithAngleI -@ stub GdipCreateLineBrushI +@ stdcall GdipCreateLineBrushI(ptr ptr long long long ptr) @ stdcall GdipCreateMatrix2(long long long long long long ptr) @ stdcall GdipCreateMatrix3(ptr ptr ptr) @ stdcall GdipCreateMatrix3I(ptr ptr ptr)
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipDrawRectangle.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 172389e1316dcdee488dd4e85568fcf4c65fbbab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=172389e1316dcdee488dd4e85…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Sun Apr 20 21:27:10 2008 +0400 gdiplus: Implemented GdipDrawRectangle. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 4f6b300..fff85c1 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -194,7 +194,7 @@ @ stub GdipDrawPieI @ stub GdipDrawPolygon @ stub GdipDrawPolygonI -@ stub GdipDrawRectangle +@ stdcall GdipDrawRectangle(ptr ptr long long long long) @ stdcall GdipDrawRectangleI(ptr ptr long long long long) @ stdcall GdipDrawRectangles(ptr ptr ptr long) @ stub GdipDrawRectanglesI diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 7356234..4912759 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1308,8 +1308,8 @@ GpStatus WINGDIPAPI GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x, return Ok; } -GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x, - INT y, INT width, INT height) +GpStatus WINGDIPAPI GdipDrawRectangle(GpGraphics *graphics, GpPen *pen, REAL x, + REAL y, REAL width, REAL height) { INT save_state; GpPointF ptf[4]; @@ -1338,6 +1338,12 @@ GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x, return Ok; } +GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x, + INT y, INT width, INT height) +{ + return GdipDrawRectangle(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height); +} + GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF* rects, INT count) {
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipAddPathLine.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 1f8f5578922765e2c24dec7ac39458ef72f3640a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f8f5578922765e2c24dec7ac…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Sun Apr 20 20:00:00 2008 +0400 gdiplus: Implemented GdipAddPathLine. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphicspath.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index d6971f9..4f6b300 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -18,7 +18,7 @@ @ stub GdipAddPathEllipseI @ stdcall GdipAddPathLine2(ptr ptr long) @ stdcall GdipAddPathLine2I(ptr ptr long) -@ stub GdipAddPathLine +@ stdcall GdipAddPathLine(ptr long long long long) @ stdcall GdipAddPathLineI(ptr long long long long) @ stdcall GdipAddPathPath(ptr ptr long) @ stub GdipAddPathPie diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 0375f8e..d7be43e 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -247,7 +247,7 @@ GpStatus WINGDIPAPI GdipAddPathLine2I(GpPath *path, GDIPCONST GpPoint *points, I return stat; } -GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y2) +GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2) { INT old_count; @@ -259,10 +259,10 @@ GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y old_count = path->pathdata.Count; - path->pathdata.Points[old_count].X = (REAL) x1; - path->pathdata.Points[old_count].Y = (REAL) y1; - path->pathdata.Points[old_count + 1].X = (REAL) x2; - path->pathdata.Points[old_count + 1].Y = (REAL) y2; + path->pathdata.Points[old_count].X = x1; + path->pathdata.Points[old_count].Y = y1; + path->pathdata.Points[old_count + 1].X = x2; + path->pathdata.Points[old_count + 1].Y = y2; path->pathdata.Types[old_count] = (path->newfigure ? PathPointTypeStart : PathPointTypeLine); @@ -274,6 +274,11 @@ GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y return Ok; } +GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y2) +{ + return GdipAddPathLine(path, (REAL)x1, (REAL)y1, (REAL)x2, (REAL)y2); +} + GpStatus WINGDIPAPI GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath, BOOL connect) {
1
0
0
0
David Adam : wined3d: Fix a possible null dereference.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 7df193676e8de9c9b760ceb10206c81f6b7fe592 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7df193676e8de9c9b760ceb10…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Sat Apr 19 20:12:48 2008 +0200 wined3d: Fix a possible null dereference. --- dlls/d3d8/tests/device.c | 37 +++++++++++++++++++++++++++++++++++++ dlls/d3d9/tests/device.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/wined3d/device.c | 2 ++ 3 files changed, 75 insertions(+), 0 deletions(-) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 8de4ec7..8617c0c 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -1281,6 +1281,42 @@ static void test_render_zero_triangles(void) if(d3d8) IDirect3D8_Release(d3d8); } +static void test_set_material(void) +{ + D3DPRESENT_PARAMETERS present_parameters; + IDirect3DDevice8 *device = NULL; + IDirect3D8 *d3d8; + HWND hwnd; + HRESULT hr; + + d3d8 = pDirect3DCreate8( D3D_SDK_VERSION ); + ok(d3d8 != NULL, "Failed to create IDirect3D8 object\n"); + hwnd = CreateWindow( "static", "d3d8_test", WS_OVERLAPPEDWINDOW, 100, 100, 160, 160, NULL, NULL, NULL, NULL ); + ok(hwnd != NULL, "Failed to create window\n"); + if (!d3d8 || !hwnd) goto cleanup; + + ZeroMemory(&present_parameters, sizeof(present_parameters)); + present_parameters.Windowed = TRUE; + present_parameters.hDeviceWindow = hwnd; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + + hr = IDirect3D8_CreateDevice( d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, + D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &present_parameters, &device ); + ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "IDirect3D8_CreateDevice failed with %s\n", DXGetErrorString8(hr)); + if(!device) + { + skip("Failed to create a d3d device\n"); + goto cleanup; + } + + hr = IDirect3DDevice8_SetMaterial(device, NULL); + ok(hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %s\n", DXGetErrorString8(hr)); + + cleanup: + if(device) IDirect3DDevice8_Release(device); + if(d3d8) IDirect3D8_Release(d3d8); +} + START_TEST(device) { HMODULE d3d8_handle = LoadLibraryA( "d3d8.dll" ); @@ -1306,5 +1342,6 @@ START_TEST(device) test_limits(); test_lights(); test_render_zero_triangles(); + test_set_material(); } } diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 020b17a..8f4542a 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -1994,6 +1994,41 @@ static void test_display_formats() if(d3d9) IDirect3D9_Release(d3d9); } +static void test_set_material(void) +{ + D3DPRESENT_PARAMETERS present_parameters; + IDirect3DDevice9 *device = NULL; + IDirect3D9 *d3d9; + HWND hwnd; + HRESULT hr; + + d3d9 = pDirect3DCreate9( D3D_SDK_VERSION ); + ok(d3d9 != NULL, "Failed to create IDirect3D9 object\n"); + hwnd = CreateWindow( "static", "d3d9_test", WS_OVERLAPPEDWINDOW, 100, 100, 160, 160, NULL, NULL, NULL, NULL ); + ok(hwnd != NULL, "Failed to create window\n"); + if (!d3d9 || !hwnd) goto cleanup; + + ZeroMemory(&present_parameters, sizeof(present_parameters)); + present_parameters.Windowed = TRUE; + present_parameters.hDeviceWindow = hwnd; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + + IDirect3D9_CreateDevice( d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, + D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &present_parameters, &device ); + if(!device) + { + skip("Failed to create a d3d device\n"); + goto cleanup; + } + + hr = IDirect3DDevice9_SetMaterial(device, NULL); + ok(hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %s\n", DXGetErrorString9(hr)); + + cleanup: + if(device) IDirect3DDevice9_Release(device); + if(d3d9) IDirect3D9_Release(d3d9); +} + START_TEST(device) { HMODULE d3d9_handle = LoadLibraryA( "d3d9.dll" ); @@ -2023,5 +2058,6 @@ START_TEST(device) test_vertex_buffer_alignment(); test_lights(); test_set_stream_source(); + test_set_material(); } } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 53d669e..c8eafc8 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3086,6 +3086,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetClipStatus(IWineD3DDevice *iface, static HRESULT WINAPI IWineD3DDeviceImpl_SetMaterial(IWineD3DDevice *iface, CONST WINED3DMATERIAL* pMaterial) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + if (!pMaterial) return WINED3DERR_INVALIDCALL; + This->updateStateBlock->changed.material = TRUE; This->updateStateBlock->material = *pMaterial;
1
0
0
0
Alexandre Julliard : libwine: Allow to specify a non-existing directory as WINEPREFIX.
by Alexandre Julliard
22 Apr '08
22 Apr '08
Module: wine Branch: master Commit: 662718160e03586424da4b49b21b99d2263273be URL:
http://source.winehq.org/git/wine.git/?a=commit;h=662718160e03586424da4b49b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 21 15:48:12 2008 +0200 libwine: Allow to specify a non-existing directory as WINEPREFIX. --- libs/wine/config.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/wine/config.c b/libs/wine/config.c index 9e33f4e..ba89811 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c @@ -209,10 +209,8 @@ static void init_paths(void) fatal_error( "invalid directory %s in WINEPREFIX: not an absolute path\n", prefix ); if (stat( config_dir, &st ) == -1) { - if (errno != ENOENT) - fatal_perror( "cannot open %s as specified in WINEPREFIX", config_dir ); - fatal_error( "the '%s' directory specified in WINEPREFIX doesn't exist.\n" - "You may want to create it by running 'wineprefixcreate'.\n", config_dir ); + if (errno == ENOENT) return; /* will be created later on */ + fatal_perror( "cannot open %s as specified in WINEPREFIX", config_dir ); } } else
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
52
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Results per page:
10
25
50
100
200