winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
849 discussions
Start a n
N
ew thread
Dylan Smith : d3dx9/tests: Added outline comparison tests for D3DXCreateText.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: b06a6c84ac4fda7032606731c4293a69a0e30402 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b06a6c84ac4fda7032606731c…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Wed Mar 9 08:26:42 2011 -0500 d3dx9/tests: Added outline comparison tests for D3DXCreateText. --- dlls/d3dx9_36/tests/mesh.c | 759 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 759 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b06a6c84ac4fda7032606…
1
0
0
0
Dylan Smith : d3dx9/tests: Add basic tests for D3DXCreateText.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: eec288a4c52d9c926b1c87e52ebf04800c3dae18 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eec288a4c52d9c926b1c87e52…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Wed Mar 9 08:26:28 2011 -0500 d3dx9/tests: Add basic tests for D3DXCreateText. --- dlls/d3dx9_36/tests/mesh.c | 183 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 183 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c index f460c2d..476fb30 100644 --- a/dlls/d3dx9_36/tests/mesh.c +++ b/dlls/d3dx9_36/tests/mesh.c @@ -19,6 +19,7 @@ */ #include <stdio.h> +#include <float.h> #include "wine/test.h" #include "d3dx9.h" @@ -28,6 +29,13 @@ got=D3DXGetFVFVertexSize(type); \ ok(got==exp, "Expected: %d, Got: %d\n", exp, got); +#define compare_float(got, exp) \ + do { \ + float _got = (got); \ + float _exp = (exp); \ + ok(_got == _exp, "Expected: %g, Got: %g\n", _exp, _got); \ + } while (0) + static BOOL compare(FLOAT u, FLOAT v) { return (fabs(u-v) < admitted_error); @@ -2004,6 +2012,180 @@ static void D3DXCreateCylinderTest(void) DestroyWindow(wnd); } +static void test_createtext(IDirect3DDevice9 *device, HDC hdc, LPCSTR text, FLOAT deviation, FLOAT extrusion) +{ + HRESULT hr; + ID3DXMesh *d3dxmesh; + char name[256]; + OUTLINETEXTMETRIC otm; + GLYPHMETRICS gm; + GLYPHMETRICSFLOAT *glyphmetrics_float = malloc(sizeof(GLYPHMETRICSFLOAT) * strlen(text)); + int i; + LOGFONT lf; + HFONT font = NULL, oldfont = NULL; + + sprintf(name, "text ('%s', %f, %f)", text, deviation, extrusion); + + hr = D3DXCreateText(device, hdc, text, deviation, extrusion, &d3dxmesh, NULL, glyphmetrics_float); + ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr); + if (hr != D3D_OK) + { + skip("Couldn't create text with D3DXCreateText\n"); + return; + } + + /* must select a modified font having lfHeight = otm.otmEMSquare before + * calling GetGlyphOutline to get the expected values */ + if (!GetObject(GetCurrentObject(hdc, OBJ_FONT), sizeof(lf), &lf) || + !GetOutlineTextMetrics(hdc, sizeof(otm), &otm)) + { + d3dxmesh->lpVtbl->Release(d3dxmesh); + skip("Couldn't get text outline\n"); + return; + } + lf.lfHeight = otm.otmEMSquare; + lf.lfWidth = 0; + font = CreateFontIndirect(&lf); + if (!font) { + d3dxmesh->lpVtbl->Release(d3dxmesh); + skip("Couldn't create the modified font\n"); + return; + } + oldfont = SelectObject(hdc, font); + + for (i = 0; i < strlen(text); i++) + { + const MAT2 identity = {{0, 1}, {0, 0}, {0, 0}, {0, 1}}; + GetGlyphOutlineA(hdc, text[i], GGO_NATIVE, &gm, 0, NULL, &identity); + compare_float(glyphmetrics_float[i].gmfBlackBoxX, gm.gmBlackBoxX / (float)otm.otmEMSquare); + compare_float(glyphmetrics_float[i].gmfBlackBoxY, gm.gmBlackBoxY / (float)otm.otmEMSquare); + compare_float(glyphmetrics_float[i].gmfptGlyphOrigin.x, gm.gmptGlyphOrigin.x / (float)otm.otmEMSquare); + compare_float(glyphmetrics_float[i].gmfptGlyphOrigin.y, gm.gmptGlyphOrigin.y / (float)otm.otmEMSquare); + compare_float(glyphmetrics_float[i].gmfCellIncX, gm.gmCellIncX / (float)otm.otmEMSquare); + compare_float(glyphmetrics_float[i].gmfCellIncY, gm.gmCellIncY / (float)otm.otmEMSquare); + } + + d3dxmesh->lpVtbl->Release(d3dxmesh); + SelectObject(hdc, oldfont); +} + +static void D3DXCreateTextTest(void) +{ + HRESULT hr; + HWND wnd; + HDC hdc; + IDirect3D9* d3d; + IDirect3DDevice9* device; + D3DPRESENT_PARAMETERS d3dpp; + ID3DXMesh* d3dxmesh = NULL; + HFONT hFont; + OUTLINETEXTMETRIC otm; + int number_of_vertices; + int number_of_faces; + + wnd = CreateWindow("static", "d3dx9_test", WS_POPUP, 0, 0, 1000, 1000, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + if (!wnd) + { + skip("Couldn't create application window\n"); + return; + } + if (!d3d) + { + skip("Couldn't create IDirect3D9 object\n"); + DestroyWindow(wnd); + return; + } + + ZeroMemory(&d3dpp, sizeof(d3dpp)); + d3dpp.Windowed = TRUE; + d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + if (FAILED(hr)) + { + skip("Failed to create IDirect3DDevice9 object %#x\n", hr); + IDirect3D9_Release(d3d); + DestroyWindow(wnd); + return; + } + + hdc = CreateCompatibleDC(NULL); + + hFont = CreateFont(12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, + OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, + "Arial"); + SelectObject(hdc, hFont); + GetOutlineTextMetrics(hdc, sizeof(otm), &otm); + + hr = D3DXCreateText(device, hdc, "wine", 0.001f, 0.4f, NULL, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + /* D3DXCreateTextA page faults from passing NULL text */ + + hr = D3DXCreateTextW(device, hdc, NULL, 0.001f, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateText(device, hdc, "", 0.001f, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateText(device, hdc, " ", 0.001f, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateText(NULL, hdc, "wine", 0.001f, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateText(device, NULL, "wine", 0.001f, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateText(device, hdc, "wine", -FLT_MIN, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateText(device, hdc, "wine", 0.001f, -FLT_MIN, &d3dxmesh, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + /* deviation = 0.0f treated as if deviation = 1.0f / otm.otmEMSquare */ + hr = D3DXCreateText(device, hdc, "wine", 1.0f / otm.otmEMSquare, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK); + number_of_vertices = d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh); + number_of_faces = d3dxmesh->lpVtbl->GetNumFaces(d3dxmesh); + if (SUCCEEDED(hr) && d3dxmesh) d3dxmesh->lpVtbl->Release(d3dxmesh); + + hr = D3DXCreateText(device, hdc, "wine", 0.0f, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK); + ok(number_of_vertices == d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh), + "Got %d vertices, expected %d\n", + d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh), number_of_vertices); + ok(number_of_faces == d3dxmesh->lpVtbl->GetNumFaces(d3dxmesh), + "Got %d faces, expected %d\n", + d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh), number_of_faces); + if (SUCCEEDED(hr) && d3dxmesh) d3dxmesh->lpVtbl->Release(d3dxmesh); + +#if 0 + /* too much detail requested, so will appear to hang */ + trace("Waiting for D3DXCreateText to finish with deviation = FLT_MIN ...\n"); + hr = D3DXCreateText(device, hdc, "wine", FLT_MIN, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK); + if (SUCCEEDED(hr) && d3dxmesh) d3dxmesh->lpVtbl->Release(d3dxmesh); + trace("D3DXCreateText finish with deviation = FLT_MIN\n"); +#endif + + hr = D3DXCreateText(device, hdc, "wine", 0.001f, 0.4f, &d3dxmesh, NULL, NULL); + ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK); + if (SUCCEEDED(hr) && d3dxmesh) d3dxmesh->lpVtbl->Release(d3dxmesh); + + test_createtext(device, hdc, "wine", FLT_MAX, 0.4f); + test_createtext(device, hdc, "wine", 0.001f, FLT_MIN); + test_createtext(device, hdc, "wine", 0.001f, 0.0f); + test_createtext(device, hdc, "wine", 0.001f, FLT_MAX); + test_createtext(device, hdc, "wine", 0.0f, 1.0f); + + DeleteDC(hdc); + + IDirect3DDevice9_Release(device); + IDirect3D9_Release(d3d); + DestroyWindow(wnd); +} + static void test_get_decl_length(void) { static const D3DVERTEXELEMENT9 declaration1[] = @@ -2138,6 +2320,7 @@ START_TEST(mesh) D3DXCreateBoxTest(); D3DXCreateSphereTest(); D3DXCreateCylinderTest(); + D3DXCreateTextTest(); test_get_decl_length(); test_get_decl_vertex_size(); test_fvf_decl_conversion();
1
0
0
0
Dylan Smith : d3dx9: Support triangulation of complex glyphs in D3DXCreateText.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 8245b46e60889669737de1b31e10ba9f63da55ee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8245b46e60889669737de1b31…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Wed Mar 9 08:26:11 2011 -0500 d3dx9: Support triangulation of complex glyphs in D3DXCreateText. --- dlls/d3dx9_36/mesh.c | 354 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 350 insertions(+), 4 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8245b46e60889669737de…
1
0
0
0
Dylan Smith : d3dx9: D3DXCreateText implementation for simple glyphs.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 3eee5b7476a27c3d7738f7b33538f20a66fd5cf6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3eee5b7476a27c3d7738f7b33…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Wed Mar 9 08:25:56 2011 -0500 d3dx9: D3DXCreateText implementation for simple glyphs. --- dlls/d3dx9_36/mesh.c | 795 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 790 insertions(+), 5 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=3eee5b7476a27c3d7738f…
1
0
0
0
André Hentschel : mountmgr.sys: Handle IOCTL_DISK_GET_DRIVE_GEOMETRY_EX.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 7a90e7a4442a011db17b7f297e7c93af87269bc4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a90e7a4442a011db17b7f297…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Mar 9 20:45:18 2011 +0100 mountmgr.sys: Handle IOCTL_DISK_GET_DRIVE_GEOMETRY_EX. --- dlls/mountmgr.sys/device.c | 20 ++++++++++++++++++++ include/winioctl.h | 7 +++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index c4b4b72..8b91be6 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -895,6 +895,26 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp ) irp->IoStatus.u.Status = STATUS_SUCCESS; break; } + case IOCTL_DISK_GET_DRIVE_GEOMETRY_EX: + { + DISK_GEOMETRY_EX info; + DWORD len = min( sizeof(info), irpsp->Parameters.DeviceIoControl.OutputBufferLength ); + + FIXME("The DISK_PARTITION_INFO and DISK_DETECTION_INFO structures will not be filled\n"); + + info.Geometry.Cylinders.QuadPart = 10000; + info.Geometry.MediaType = (dev->devnum.DeviceType == FILE_DEVICE_DISK) ? FixedMedia : RemovableMedia; + info.Geometry.TracksPerCylinder = 255; + info.Geometry.SectorsPerTrack = 63; + info.Geometry.BytesPerSector = 512; + info.DiskSize.QuadPart = info.Geometry.Cylinders.QuadPart * info.Geometry.TracksPerCylinder * + info.Geometry.SectorsPerTrack * info.Geometry.BytesPerSector; + info.Data[0] = 0; + memcpy( irp->MdlAddress->StartVa, &info, len ); + irp->IoStatus.Information = len; + irp->IoStatus.u.Status = STATUS_SUCCESS; + break; + } case IOCTL_STORAGE_GET_DEVICE_NUMBER: { DWORD len = min( sizeof(dev->devnum), irpsp->Parameters.DeviceIoControl.OutputBufferLength ); diff --git a/include/winioctl.h b/include/winioctl.h index d1c3376..7f04d59 100644 --- a/include/winioctl.h +++ b/include/winioctl.h @@ -264,6 +264,7 @@ #define SMART_GET_VERSION CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS) #define SMART_SEND_DRIVE_COMMAND CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define SMART_RCV_DRIVE_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_VOLUME_BASE ((DWORD)'V') #define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -325,6 +326,12 @@ typedef struct _DISK_GEOMETRY { DWORD BytesPerSector; } DISK_GEOMETRY, *PDISK_GEOMETRY; +typedef struct _DISK_GEOMETRY_EX { + DISK_GEOMETRY Geometry; + LARGE_INTEGER DiskSize; + BYTE Data[1]; +} DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX; + typedef struct _PARTITION_INFORMATION { LARGE_INTEGER StartingOffset; LARGE_INTEGER PartitionLength;
1
0
0
0
Aric Stewart : usp10: Corrections to ScriptCPtoX.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 73f743f6d2cc10cc999c0f21c65b584e43b94a83 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=73f743f6d2cc10cc999c0f21c…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue Mar 8 14:33:29 2011 -0600 usp10: Corrections to ScriptCPtoX. --- dlls/usp10/tests/usp10.c | 130 +++++++++++++++++++++++++++++++++++----------- dlls/usp10/usp10.c | 59 ++++++++++++++++++--- 2 files changed, 149 insertions(+), 40 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=73f743f6d2cc10cc999c0…
1
0
0
0
Peter Schellenbach : oleaut32: Fixed initial cyLogical value in IFont constructor. Fixed get_Size to return same value as Windows.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 2ecbfbe5df0d7b5eb333f7723113c22ad171eacf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2ecbfbe5df0d7b5eb333f7723…
Author: Peter Schellenbach <pjs(a)asent.com> Date: Mon Mar 7 16:44:38 2011 -0800 oleaut32: Fixed initial cyLogical value in IFont constructor. Fixed get_Size to return same value as Windows. --- dlls/oleaut32/olefont.c | 21 +++++++++- dlls/oleaut32/tests/olefont.c | 90 ++++++++++++++++++++++++---------------- 2 files changed, 73 insertions(+), 38 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index e65504c..f128270 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -278,6 +278,11 @@ struct OLEFontImpl LONG cyLogical; LONG cyHimetric; + /* + * Stash realized height (pixels) from TEXTMETRIC - used in get_Size() + */ + LONG nRealHeight; + IConnectionPoint *pPropertyNotifyCP; IConnectionPoint *pFontEventsCP; }; @@ -671,6 +676,8 @@ static void realize_font(OLEFontImpl *This) } GetTextMetricsW(hdc, &tm); This->description.sCharset = tm.tmCharSet; + /* While we have it handy, stash the realized font height for use by get_Size() */ + This->nRealHeight = tm.tmHeight - tm.tmInternalLeading; /* corresponds to LOGFONT lfHeight */ SelectObject(hdc, old_font); } } @@ -760,8 +767,14 @@ static HRESULT WINAPI OLEFontImpl_get_Size( if(this->dirty) realize_font(this); + /* + * Convert realized font height in pixels to points descaled by current + * scaling ratio then scaled up by 10000. + */ + psize->s.Lo = MulDiv(this->nRealHeight, + this->cyHimetric * 72 * 10000, + this->cyLogical * 2540); psize->s.Hi = 0; - psize->s.Lo = this->description.cySize.s.Lo; return S_OK; } @@ -1179,8 +1192,12 @@ static HRESULT WINAPI OLEFontImpl_SetRatio( OLEFontImpl *this = impl_from_IFont(iface); TRACE("(%p)->(%d, %d)\n", this, cyLogical, cyHimetric); + if(cyLogical == 0 || cyHimetric == 0) + return E_INVALIDARG; + this->cyLogical = cyLogical; this->cyHimetric = cyHimetric; + this->dirty = TRUE; return S_OK; } @@ -2401,7 +2418,7 @@ static OLEFontImpl* OLEFontImpl_Construct(const FONTDESC *fontDesc) */ newObject->gdiFont = 0; newObject->dirty = TRUE; - newObject->cyLogical = 72L; + newObject->cyLogical = GetDeviceCaps(get_dc(), LOGPIXELSY); newObject->cyHimetric = 2540L; newObject->pPropertyNotifyCP = NULL; newObject->pFontEventsCP = NULL; diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c index 57f1367..e9720bb 100644 --- a/dlls/oleaut32/tests/olefont.c +++ b/dlls/oleaut32/tests/olefont.c @@ -57,8 +57,7 @@ static HRESULT (WINAPI *pOleCreateFontIndirect)(LPFONTDESC,REFIID,LPVOID*); /* SetRatio to ratio_logical, ratio_himetric, */ /* check that resulting hfont has height hfont_height. */ /* Various checks along the way. */ - -static void test_ifont_sizes(LONG lo_size, LONG hi_size, +static void test_ifont_size(LONG lo_size, LONG hi_size, LONG ratio_logical, LONG ratio_himetric, LONG hfont_height, const char * test_name) { @@ -69,9 +68,10 @@ static void test_ifont_sizes(LONG lo_size, LONG hi_size, LOGFONT lf; CY psize; HRESULT hres; + DWORD rtnval; fd.cbSizeofstruct = sizeof(FONTDESC); - fd.lpstrName = system_font; + fd.lpstrName = arial_font; /* using scaleable instead of bitmap font reduces errors due to font realization */ S(fd.cySize).Lo = lo_size; S(fd.cySize).Hi = hi_size; fd.sWeight = 0; @@ -87,33 +87,33 @@ static void test_ifont_sizes(LONG lo_size, LONG hi_size, test_name, hres); ok(pvObj != NULL,"%s: OCFI returns NULL.\n", test_name); - /* Read back size. Hi part was ignored. */ + /* If scaling ration specified, change ratio. */ + if(ratio_logical && ratio_himetric) + { + hres = IFont_SetRatio(ifnt, ratio_logical, ratio_himetric); + ok(hres == S_OK,"%s: IFont_SetRatio returns 0x%08x instead of S_OK.\n", + test_name, hres); + } + + /* Read back size. */ hres = IFont_get_Size(ifnt, &psize); ok(hres == S_OK,"%s: IFont_get_size returns 0x%08x instead of S_OK.\n", test_name, hres); - ok(S(psize).Lo == lo_size && S(psize).Hi == 0, - "%s: get_Size: Lo=%d, Hi=%d; expected Lo=%d, Hi=0.\n", - test_name, S(psize).Lo, S(psize).Hi, lo_size); - /* Change ratio, check size unchanged. Standard is 72, 2540. */ - hres = IFont_SetRatio(ifnt, ratio_logical, ratio_himetric); - ok(hres == S_OK,"%s: IFont_SR returns 0x%08x instead of S_OK.\n", - test_name, hres); - hres = IFont_get_Size(ifnt, &psize); - ok(hres == S_OK,"%s: IFont_get_size returns 0x%08x instead of S_OK.\n", - test_name, hres); - ok(S(psize).Lo == lo_size && S(psize).Hi == 0, - "%s: gS after SR: Lo=%d, Hi=%d; expected Lo=%d, Hi=0.\n", - test_name, S(psize).Lo, S(psize).Hi, lo_size); + /* Check returned size - allow for errors due to rouding & font realization. */ + ok((abs(S(psize).Lo - lo_size) < 10000) && S(psize).Hi == hi_size, + "%s: IFont_get_Size: Lo=%d, Hi=%d; expected Lo=%d, Hi=%d.\n", + test_name, S(psize).Lo, S(psize).Hi, lo_size, hi_size); - /* Check hFont size with this ratio. This tests an important */ - /* conversion for which MSDN is very wrong. */ + /* Check hFont size. */ hres = IFont_get_hFont (ifnt, &hfont); ok(hres == S_OK, "%s: IFont_get_hFont returns 0x%08x instead of S_OK.\n", test_name, hres); - hres = GetObject (hfont, sizeof(LOGFONT), &lf); - ok(hres == OBJ_FONT, "got obj type %d\n", hres); - ok(lf.lfHeight == hfont_height, + rtnval = GetObject (hfont, sizeof(LOGFONT), &lf); + ok(rtnval > 0, "GetObject(hfont) failed\n"); + + /* Since font scaling may encounter rouding errors, allow 1 pixel deviation. */ + ok(abs(lf.lfHeight - hfont_height) <= 1, "%s: hFont has lf.lfHeight=%d, expected %d.\n", test_name, lf.lfHeight, hfont_height); @@ -121,6 +121,37 @@ static void test_ifont_sizes(LONG lo_size, LONG hi_size, IFont_Release(ifnt); } +static void test_ifont_sizes(void) +{ + /* Test various size operations and conversions. */ + /* Add more as needed. */ + + /* Results of first 2 tests depend on display resolution. */ + HDC hdc = GetDC(0); + LONG dpi = GetDeviceCaps(hdc, LOGPIXELSY); /* expected results depend on display DPI */ + ReleaseDC(0, hdc); + if(dpi == 96) /* normal resolution display */ + { + test_ifont_size(180000, 0, 0, 0, -24, "default"); /* normal font */ + test_ifont_size(186000, 0, 0, 0, -25, "rounding"); /* test rounding */ + } else if(dpi == 72) /* low resolution display */ + { + test_ifont_size(180000, 0, 0, 0, -18, "default"); /* normal font */ + test_ifont_size(186000, 0, 0, 0, -19, "rounding"); /* test rounding */ + } else if(dpi == 120) /* high resolution display */ + { + test_ifont_size(180000, 0, 0, 0, -30, "default"); /* normal font */ + test_ifont_size(186000, 0, 0, 0, -31, "rounding"); /* test rounding */ + } else + skip("Skipping resolution dependent font size tests - display resolution is %d\n", dpi); + + /* Next 4 tests specify a scaling ratio, so display resolution is not a factor. */ + test_ifont_size(180000, 0, 72, 2540, -18, "ratio1"); /* change ratio */ + test_ifont_size(180000, 0, 144, 2540, -36, "ratio2"); /* another ratio */ + test_ifont_size(180000, 0, 72, 1270, -36, "ratio3"); /* yet another ratio */ + test_ifont_size(186000, 0, 72, 2540, -19, "rounding+ratio"); /* test rounding with ratio */ +} + static void test_QueryInterface(void) { LPVOID pvObj = NULL; @@ -1094,20 +1125,7 @@ START_TEST(olefont) test_QueryInterface(); test_type_info(); - - /* Test various size operations and conversions. */ - /* Add more as needed. */ - if (0) /* FIXME: failing tests */ - { - test_ifont_sizes(180000, 0, 72, 2540, -18, "default"); - test_ifont_sizes(180000, 0, 144, 2540, -36, "ratio1"); /* change ratio */ - test_ifont_sizes(180000, 0, 72, 1270, -36, "ratio2"); /* 2nd part of ratio */ - - /* These depend on details of how IFont rounds sizes internally. */ - test_ifont_sizes(0, 0, 72, 2540, 0, "zero size"); /* zero size */ - test_ifont_sizes(186000, 0, 72, 2540, -19, "rounding"); /* test rounding */ - } - + test_ifont_sizes(); test_font_events_disp(); test_GetIDsOfNames(); test_Invoke();
1
0
0
0
Erich Hoover : winex11: Add support for retrieving multi-rate animated cursor data.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: eddffff7809dfc4cff2280ac774e8fda939b7a94 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eddffff7809dfc4cff2280ac7…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Wed Mar 9 22:56:50 2011 -0700 winex11: Add support for retrieving multi-rate animated cursor data. --- dlls/winex11.drv/mouse.c | 37 ++++++++++++++++--------------------- 1 files changed, 16 insertions(+), 21 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 6378641..ab500ef 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -294,7 +294,7 @@ static XcursorImage *create_xcursor_frame( HDC hdc, const ICONINFOEXW *iinfo, HA int width, int height, int istep ) { XcursorImage *image, *ret = NULL; - DWORD delay_jiffies, is_static; + DWORD delay_jiffies, num_steps; int x, y, i, has_alpha; XcursorPixel *ptr; @@ -310,12 +310,11 @@ static XcursorImage *create_xcursor_frame( HDC hdc, const ICONINFOEXW *iinfo, HA image->xhot = iinfo->xHotspot; image->yhot = iinfo->yHotspot; - /* TODO: Handle animated cursors that use multiple rates */ image->delay = 100; /* fallback delay, 100 ms */ - if (GetCursorFrameInfo(icon, 0x0 /* unknown parameter */, 0 /* obtain first rate */, &delay_jiffies, &is_static) != 0) + if (GetCursorFrameInfo(icon, 0x0 /* unknown parameter */, istep, &delay_jiffies, &num_steps) != 0) image->delay = (100 * delay_jiffies) / 6; /* convert jiffies (1/60s) to milliseconds */ else - WARN("Failed to retrieve animated cursor framerate.\n"); + WARN("Failed to retrieve animated cursor frame-rate for frame %d.\n", istep); /* draw the cursor frame to a temporary buffer then copy it into the XcursorImage */ memset( color_bits, 0x00, color_size ); @@ -366,14 +365,16 @@ static Cursor create_xcursor_cursor( HDC hdc, const ICONINFOEXW *iinfo, HANDLE i { unsigned char *color_bits, *mask_bits; HBITMAP hbmColor = 0, hbmMask = 0; - XcursorImage **imgs, *image; + DWORD nFrames, delay_jiffies, i; int color_size, mask_size; BITMAPINFO *info = NULL; XcursorImages *images; + XcursorImage **imgs; Cursor cursor = 0; - int nFrames = 0; - if (!(imgs = HeapAlloc( GetProcessHeap(), 0, sizeof(XcursorImage*) ))) return 0; + /* Retrieve the number of frames to render */ + if (!GetCursorFrameInfo(icon, 0x0 /* unknown parameter */, 0, &delay_jiffies, &nFrames)) return 0; + if (!(imgs = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(XcursorImage*)*nFrames ))) return 0; /* Allocate all of the resources necessary to obtain a cursor frame */ if (!(info = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( BITMAPINFO, bmiColors[256] )))) goto cleanup; @@ -406,19 +407,13 @@ static Cursor create_xcursor_cursor( HDC hdc, const ICONINFOEXW *iinfo, HANDLE i } /* Create an XcursorImage for each frame of the cursor */ - while (1) + for (i=0; i<nFrames; i++) { - XcursorImage **imgstmp; - - image = create_xcursor_frame( hdc, iinfo, icon, - hbmColor, color_bits, color_size, - hbmMask, mask_bits, mask_size, - width, height, nFrames ); - if (!image) break; /* no more drawable frames */ - - imgs[nFrames++] = image; - if (!(imgstmp = HeapReAlloc( GetProcessHeap(), 0, imgs, (nFrames+1)*sizeof(XcursorImage*) ))) goto cleanup; - imgs = imgstmp; + imgs[i] = create_xcursor_frame( hdc, iinfo, icon, + hbmColor, color_bits, color_size, + hbmMask, mask_bits, mask_size, + width, height, i ); + if (!imgs[i]) goto cleanup; } /* Build an X cursor out of all of the frames */ @@ -436,8 +431,8 @@ cleanup: if (imgs) { /* Failed to produce a cursor, free previously allocated frames */ - for (nFrames--; nFrames >= 0; nFrames--) - pXcursorImageDestroy( imgs[nFrames] ); + for (i=0; i<nFrames && imgs[i]; i++) + pXcursorImageDestroy( imgs[i] ); HeapFree( GetProcessHeap(), 0, imgs ); } /* Cleanup all of the resources used to obtain the frame data */
1
0
0
0
Erich Hoover : user32: Add preliminary support for reading and storing multi-rate animated cursor data .
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 3e35caa7b2815d2d1bfdca1a893d4a1430d1edbd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3e35caa7b2815d2d1bfdca1a8…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Wed Mar 9 22:56:40 2011 -0700 user32: Add preliminary support for reading and storing multi-rate animated cursor data. --- dlls/user32/cursoricon.c | 23 +++- dlls/user32/tests/cursoricon.c | 280 +++++++++++++++++++--------------------- 2 files changed, 152 insertions(+), 151 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=3e35caa7b2815d2d1bfdc…
1
0
0
0
Erich Hoover : user32: Add FIXMEs for unsupported animated cursor data.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 389ffed29324e57f98e470f7d573293aae2864e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=389ffed29324e57f98e470f7d…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Wed Mar 9 22:56:34 2011 -0700 user32: Add FIXMEs for unsupported animated cursor data. --- dlls/user32/cursoricon.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 141bec8..0d73ecb 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -891,6 +891,7 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi, HMODULE module, LPCW #define ANI_anih_ID RIFF_FOURCC('a', 'n', 'i', 'h') #define ANI_seq__ID RIFF_FOURCC('s', 'e', 'q', ' ') #define ANI_fram_ID RIFF_FOURCC('f', 'r', 'a', 'm') +#define ANI_rate_ID RIFF_FOURCC('r', 'a', 't', 'e') #define ANI_FLAG_ICON 0x1 #define ANI_FLAG_SEQUENCE 0x2 @@ -996,6 +997,7 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size, riff_chunk_t ACON_chunk = {0}; riff_chunk_t anih_chunk = {0}; riff_chunk_t fram_chunk = {0}; + riff_chunk_t rate_chunk = {0}; const unsigned char *icon_chunk; const unsigned char *icon_data; @@ -1017,6 +1019,19 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size, memcpy( &header, anih_chunk.data, sizeof(header) ); dump_ani_header( &header ); + if (!(header.flags & ANI_FLAG_ICON)) + { + FIXME("Raw animated icon/cursor data is not currently supported.\n"); + return 0; + } + + if (header.flags & ANI_FLAG_SEQUENCE) + FIXME("Animated icon/cursor sequence data is not currently supported, frames may appear out of sequence.\n"); + + riff_find_chunk( ANI_rate_ID, 0, &ACON_chunk, &rate_chunk ); + if (rate_chunk.data) + FIXME("Animated icon/cursor multiple frame-frate data not currently supported.\n"); + riff_find_chunk( ANI_fram_ID, ANI_LIST_ID, &ACON_chunk, &fram_chunk ); if (!fram_chunk.data) {
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
...
85
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Results per page:
10
25
50
100
200