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
October 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
3 participants
783 discussions
Start a n
N
ew thread
Lucas Fialho Zawacki : dinput8/tests: Tests for DIPROP_USERNAME property.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: 46e408d54c26d4e4b4cfcd536f9bc59fe78ef481 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=46e408d54c26d4e4b4cfcd536…
Author: Lucas Fialho Zawacki <lfzawacki(a)gmail.com> Date: Sat Oct 22 18:53:21 2011 -0200 dinput8/tests: Tests for DIPROP_USERNAME property. --- dlls/dinput8/tests/Makefile.in | 2 +- dlls/dinput8/tests/device.c | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/dlls/dinput8/tests/Makefile.in b/dlls/dinput8/tests/Makefile.in index 7584858..fe87118 100644 --- a/dlls/dinput8/tests/Makefile.in +++ b/dlls/dinput8/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = dinput8.dll -IMPORTS = dinput8 ole32 user32 +IMPORTS = dinput8 ole32 user32 advapi32 C_SRCS = \ device.c \ diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c index 8a9b1df..7fbdfaa 100644 --- a/dlls/dinput8/tests/device.c +++ b/dlls/dinput8/tests/device.c @@ -31,6 +31,7 @@ struct enum_data { LPDIACTIONFORMAT lpdiaf; LPDIRECTINPUTDEVICE8 keyboard; LPDIRECTINPUTDEVICE8 mouse; + const char* username; int ndevices; }; @@ -156,6 +157,9 @@ static BOOL CALLBACK enumeration_callback( HRESULT hr; DIPROPDWORD dp; DIPROPRANGE dpr; + DIPROPSTRING dps; + WCHAR usernameW[MAX_PATH]; + DWORD username_size = MAX_PATH; struct enum_data *data = pvRef; DWORD cnt; DIDEVICEOBJECTDATA buffer[5]; @@ -164,6 +168,15 @@ static BOOL CALLBACK enumeration_callback( data->ndevices++; + /* Convert username to WCHAR */ + if (data->username != NULL) + { + username_size = MultiByteToWideChar(CP_ACP, 0, data->username, -1, usernameW, 0); + MultiByteToWideChar(CP_ACP, 0, data->username, -1, usernameW, username_size); + } + else + GetUserNameW(usernameW, &username_size); + /* collect the mouse and keyboard */ if (IsEqualGUID(&lpddi->guidInstance, &GUID_SysKeyboard)) { @@ -190,12 +203,23 @@ static BOOL CALLBACK enumeration_callback( hr = IDirectInputDevice8_Acquire(lpdid); ok (hr == DIERR_INVALIDPARAM, "Device was acquired before SetActionMap hr=%08x\n", hr); - hr = IDirectInputDevice8_SetActionMap(lpdid, data->lpdiaf, NULL, 0); + hr = IDirectInputDevice8_SetActionMap(lpdid, data->lpdiaf, data->username, 0); ok (SUCCEEDED(hr), "SetActionMap failed hr=%08x\n", hr); /* Some joysticks may have no suitable actions and thus should not be tested */ if (hr == DI_NOEFFECT) return DIENUM_CONTINUE; + /* Test username after SetActionMap */ + dps.diph.dwSize = sizeof(dps); + dps.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dps.diph.dwObj = 0; + dps.diph.dwHow = DIPH_DEVICE; + dps.wsz[0] = '\0'; + + hr = IDirectInputDevice_GetProperty(lpdid, DIPROP_USERNAME, &dps.diph); + todo_wine ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); + todo_wine ok (!lstrcmpW(usernameW, dps.wsz), "Username not set correctly expected=%s, got=%s\n", wine_dbgstr_wn(usernameW, -1), wine_dbgstr_wn(dps.wsz, -1)); + /* Test buffer size */ memset(&dp, 0, sizeof(dp)); dp.diph.dwSize = sizeof(dp); @@ -245,7 +269,7 @@ static void test_action_mapping(void) HINSTANCE hinst = GetModuleHandle(NULL); LPDIRECTINPUT8 pDI = NULL; DIACTIONFORMAT af; - struct enum_data data = {pDI, &af, NULL, NULL, 0}; + struct enum_data data = {pDI, &af, NULL, NULL, NULL, 0}; hr = CoCreateInstance(&CLSID_DirectInput8, 0, 1, &IID_IDirectInput8A, (LPVOID*)&pDI); if (hr == DIERR_OLDDIRECTINPUTVERSION || @@ -281,6 +305,11 @@ static void test_action_mapping(void) hr = IDirectInput8_EnumDevicesBySemantics(pDI, 0, &af, enumeration_callback, &data, DIEDBSFL_ATTACHEDONLY); ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed: hr=%08x\n", hr); + /* Repeat tests with a non NULL user */ + data.username = "Ninja Brian"; + hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &af, enumeration_callback, &data, DIEDBSFL_ATTACHEDONLY); + ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed: hr=%08x\n", hr); + if (data.keyboard != NULL) { /* Test keyboard BuildActionMap */
1
0
0
0
Lucas Fialho Zawacki : dinput8/tests: Moved EnumDevicesBySemantics specific tests to dinput. c and added a couple more.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: 32f79acc4951ac52d03772af76f780ab5144f071 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=32f79acc4951ac52d03772af7…
Author: Lucas Fialho Zawacki <lfzawacki(a)gmail.com> Date: Sat Oct 22 18:53:20 2011 -0200 dinput8/tests: Moved EnumDevicesBySemantics specific tests to dinput.c and added a couple more. --- dlls/dinput8/tests/device.c | 61 ----------------- dlls/dinput8/tests/dinput.c | 155 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 61 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=32f79acc4951ac52d0377…
1
0
0
0
Dan Kegel : kernel32/tests: fni-> FileName is not nul terminated in test_readdirectorychanges_cr.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: 6ca1a943eb388fc2e87e1a381136943811bfb806 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ca1a943eb388fc2e87e1a381…
Author: Dan Kegel <dank(a)kegel.com> Date: Sat Oct 15 11:27:34 2011 -0700 kernel32/tests: fni->FileName is not nul terminated in test_readdirectorychanges_cr. --- dlls/kernel32/tests/change.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/kernel32/tests/change.c b/dlls/kernel32/tests/change.c index 4d0bc1c..6142e43 100644 --- a/dlls/kernel32/tests/change.c +++ b/dlls/kernel32/tests/change.c @@ -858,7 +858,7 @@ static void test_readdirectorychanges_cr(void) ok(fni->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), "FileNameLength = %d\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), - "FileName = %s\n", wine_dbgstr_w(fni->FileName)); + "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR))); r = pReadDirectoryChangesW(hdir, fni, sizeof(fni), FALSE, FILE_NOTIFY_CHANGE_FILE_NAME, NULL, &ov, readdirectorychanges_cr); @@ -878,7 +878,7 @@ static void test_readdirectorychanges_cr(void) ok(fni->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), "FileNameLength = %d\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), - "FileName = %s\n", wine_dbgstr_w(fni->FileName)); + "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR))); r = pReadDirectoryChangesW(hdir, fni, sizeof(fni), FALSE, FILE_NOTIFY_CHANGE_FILE_NAME, NULL, &ov, readdirectorychanges_cr); @@ -894,7 +894,7 @@ static void test_readdirectorychanges_cr(void) ok(fni->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), "FileNameLength = %d\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), - "FileName = %s\n", wine_dbgstr_w(fni->FileName)); + "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR))); r = pReadDirectoryChangesW(hdir, fni, sizeof(fni), FALSE, FILE_NOTIFY_CHANGE_FILE_NAME, NULL, &ov, readdirectorychanges_cr); @@ -910,7 +910,7 @@ static void test_readdirectorychanges_cr(void) ok(fni->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), "FileNameLength = %d\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), - "FileName = %s\n", wine_dbgstr_w(fni->FileName)); + "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR))); CloseHandle(hdir); @@ -934,7 +934,7 @@ static void test_readdirectorychanges_cr(void) ok(fni->FileNameLength == lstrlenW(szDir)*sizeof(WCHAR), "FileNameLength = %d\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szDir, lstrlenW(szDir)*sizeof(WCHAR)), - "FileName = %s\n", wine_dbgstr_w(fni->FileName)); + "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR))); ok(fni->NextEntryOffset != 0, "no next entry in movement event\n"); fni_next = (FILE_NOTIFY_INFORMATION*)((char*)fni+fni->NextEntryOffset); ok(fni_next->NextEntryOffset == 0, "there should be no more events in buffer\n"); @@ -942,7 +942,7 @@ static void test_readdirectorychanges_cr(void) ok(fni_next->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), "FileNameLength = %d\n", fni_next->FileNameLength); ok(!memcmp(fni_next->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), - "FileName = %s\n", wine_dbgstr_w(fni_next->FileName)); + "FileName = %s\n", wine_dbgstr_wn(fni_next->FileName, fni_next->FileNameLength/sizeof(WCHAR))); } else { @@ -975,7 +975,7 @@ static void test_readdirectorychanges_cr(void) ok(fni->FileNameLength == lstrlenW(szDir)*sizeof(WCHAR), "FileNameLength = %d\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szDir, lstrlenW(szDir)*sizeof(WCHAR)), - "FileName = %s\n", wine_dbgstr_w(fni->FileName)); + "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR))); if (fni->NextEntryOffset) fni_next = (FILE_NOTIFY_INFORMATION*)((char*)fni+fni->NextEntryOffset); else @@ -993,7 +993,7 @@ static void test_readdirectorychanges_cr(void) ok(fni_next->FileNameLength == lstrlenW(szDir)*sizeof(WCHAR), "FileNameLength = %d\n", fni_next->FileNameLength); ok(!memcmp(fni_next->FileName, szDir, lstrlenW(szDir)*sizeof(WCHAR)), - "FileName = %s\n", wine_dbgstr_w(fni_next->FileName)); + "FileName = %s\n", wine_dbgstr_wn(fni_next->FileName, fni_next->FileNameLength/sizeof(WCHAR))); CloseHandle(hdir); RemoveDirectoryW(file);
1
0
0
0
Vitaliy Margolen : dinput: Restore checks for DirectX 3 buffer size.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: 67e0b356c08e122114ade9786352f097c0fd4521 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=67e0b356c08e122114ade9786…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Thu Oct 20 07:42:49 2011 -0600 dinput: Restore checks for DirectX 3 buffer size. --- dlls/dinput/device.c | 4 +- dlls/dinput/tests/device.c | 69 ++++++++++++++++++++++++++----------------- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index b72b0d5..72670f7 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1288,10 +1288,10 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceData(LPDIRECTINPUTDEVICE8W ifac TRACE("(%p) %p -> %p(%d) x%d, 0x%08x\n", This, dod, entries, entries ? *entries : 0, dodsize, flags); - if (This->dinput->dwVersion == 0x0800) + if (This->dinput->dwVersion == 0x0800 || dodsize == sizeof(DIDEVICEOBJECTDATA_DX3)) { - if (!This->acquired) return DIERR_NOTACQUIRED; if (!This->queue_len) return DIERR_NOTBUFFERED; + if (!This->acquired) return DIERR_NOTACQUIRED; } if (!This->queue_len) diff --git a/dlls/dinput/tests/device.c b/dlls/dinput/tests/device.c index 7171bb8..f03a3b6 100644 --- a/dlls/dinput/tests/device.c +++ b/dlls/dinput/tests/device.c @@ -78,7 +78,9 @@ static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd) DIDEVICEOBJECTINSTANCE obj_info; DWORD obj_types[] = {DIDFT_BUTTON, DIDFT_AXIS, DIDFT_POV}; int type_index; - int cnt = 0, cnt1 = 0; + int cnt1 = 0; + DWORD cnt = 0; + DIDEVICEOBJECTDATA buffer[5]; hr = IDirectInputDevice_EnumObjects(device, enum_callback, &cnt, DIDFT_ALL); ok(SUCCEEDED(hr), "EnumObjects() failed: %08x\n", hr); @@ -98,18 +100,51 @@ static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd) ok(SUCCEEDED(hr), "EnumObjects() failed: %08x\n", hr); } + /* Test buffered mode */ + memset(&dp, 0, sizeof(dp)); + dp.diph.dwSize = sizeof(DIPROPDWORD); + dp.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dp.diph.dwHow = DIPH_DEVICE; + dp.diph.dwObj = 0; + dp.dwData = 0; + + hr = IDirectInputDevice_SetProperty(device, DIPROP_BUFFERSIZE, (LPCDIPROPHEADER)&dp.diph); + ok(hr == DI_OK, "SetProperty() failed: %08x\n", hr); + cnt = 5; + hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0); + ok(hr == DI_OK && cnt == 5, "GetDeviceData() failed: %08x cnt: %d\n", hr, cnt); + hr = IDirectInputDevice_GetDeviceData(device, sizeof(DIDEVICEOBJECTDATA_DX3), buffer, &cnt, 0); + ok(hr == DIERR_NOTBUFFERED, "GetDeviceData() should have failed: %08x\n", hr); + IDirectInputDevice_Acquire(device); + hr = IDirectInputDevice_GetDeviceData(device, sizeof(DIDEVICEOBJECTDATA_DX3), buffer, &cnt, 0); + ok(hr == DIERR_NOTBUFFERED, "GetDeviceData() should have failed: %08x\n", hr); + IDirectInputDevice_Unacquire(device); + + dp.dwData = 20; + hr = IDirectInputDevice_SetProperty(device, DIPROP_BUFFERSIZE, (LPCDIPROPHEADER)&dp.diph); + ok(hr == DI_OK, "SetProperty() failed: %08x\n", hr); + cnt = 5; + hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0); + ok(hr == DI_OK, "GetDeviceData() failed: %08x\n", hr); + hr = IDirectInputDevice_GetDeviceData(device, sizeof(DIDEVICEOBJECTDATA_DX3), buffer, &cnt, 0); + ok(hr == DIERR_NOTACQUIRED, "GetDeviceData() should have failed: %08x\n", hr); + hr = IDirectInputDevice_Acquire(device); + ok(hr == DI_OK, "Acquire() failed: %08x\n", hr); + cnt = 1; + hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0); + ok(hr == DI_OK, "GetDeviceData() failed: %08x\n", hr); + hr = IDirectInputDevice_Unacquire(device); + ok(hr == DI_OK, "Unacquire() failed: %08x\n", hr); + cnt = 1; + hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0); + ok(hr == DI_OK, "GetDeviceData() failed: %08x\n", hr); + /* No need to test devices without axis */ obj_info.dwSize = sizeof(obj_info); hr = IDirectInputDevice_GetObjectInfo(device, &obj_info, 16, DIPH_BYOFFSET); if (SUCCEEDED(hr)) { - DWORD cnt; - DIDEVICEOBJECTDATA buffer[5]; - /* No device supports per axis relative/absolute mode */ - memset(&dp, 0, sizeof(dp)); - dp.diph.dwSize = sizeof(DIPROPDWORD); - dp.diph.dwHeaderSize = sizeof(DIPROPHEADER); dp.diph.dwHow = DIPH_BYOFFSET; dp.diph.dwObj = 16; dp.dwData = DIPROPAXISMODE_ABS; @@ -122,29 +157,9 @@ static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd) hr = IDirectInputDevice_SetProperty(device, DIPROP_AXISMODE, &dp.diph); ok(hr == DI_OK, "SetProperty() failed: %08x\n", hr); - dp.dwData = 0; - hr = IDirectInputDevice_SetProperty(device, DIPROP_BUFFERSIZE, (LPCDIPROPHEADER)&dp.diph); - ok(hr == DI_OK, "SetProperty() failed: %08x\n", hr); - - cnt = 5; - hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0); - ok(hr == DI_OK && cnt == 5, "GetDeviceData() failed: %08x cnt: %d\n", hr, cnt); - - dp.dwData = 20; - hr = IDirectInputDevice_SetProperty(device, DIPROP_BUFFERSIZE, (LPCDIPROPHEADER)&dp.diph); - ok(hr == DI_OK, "SetProperty() failed: %08x\n", hr); - - cnt = 1; - hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0); - ok(hr == DI_OK, "GetDeviceData() failed: %08x\n", hr); - /* Cannot change mode while acquired */ hr = IDirectInputDevice_Acquire(device); ok(hr == DI_OK, "Acquire() failed: %08x\n", hr); - cnt = 1; - hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0); - ok(hr == DI_OK, "GetDeviceData() failed: %08x\n", hr); - hr = IDirectInputDevice_SetProperty(device, DIPROP_AXISMODE, &dp.diph); ok(hr == DIERR_ACQUIRED, "SetProperty() returned: %08x\n", hr);
1
0
0
0
Alexandre Julliard : gdi32: Implement GetGlyphOutline as a standard driver entry point.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: 6376b4cf6f7da4ba7f525ac4bbf967f086d81c99 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6376b4cf6f7da4ba7f525ac4b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Oct 20 16:34:08 2011 +0200 gdi32: Implement GetGlyphOutline as a standard driver entry point. --- dlls/gdi32/font.c | 9 +++------ dlls/gdi32/freetype.c | 27 ++++++++++++--------------- dlls/gdi32/gdi_private.h | 3 --- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 8fa9173..26eba55 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -2503,6 +2503,7 @@ DWORD WINAPI GetGlyphOutlineW( HDC hdc, UINT uChar, UINT fuFormat, { DC *dc; DWORD ret; + PHYSDEV dev; TRACE("(%p, %04x, %04x, %p, %d, %p, %p)\n", hdc, uChar, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2 ); @@ -2512,12 +2513,8 @@ DWORD WINAPI GetGlyphOutlineW( HDC hdc, UINT uChar, UINT fuFormat, dc = get_dc_ptr(hdc); if(!dc) return GDI_ERROR; - if(dc->gdiFont) - ret = WineEngGetGlyphOutline(dc->gdiFont, uChar, fuFormat, lpgm, - cbBuffer, lpBuffer, lpmat2); - else - ret = GDI_ERROR; - + dev = GET_DC_PHYSDEV( dc, pGetGlyphOutline ); + ret = dev->funcs->pGetGlyphOutline( dev, uChar, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2 ); release_dc_ptr( dc ); return ret; } diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index da9de0d..a98cf36 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6196,18 +6196,23 @@ end: } /************************************************************* - * WineEngGetGlyphOutline - * + * freetype_GetGlyphOutline */ -DWORD WineEngGetGlyphOutline(GdiFont *font, UINT glyph, UINT format, - LPGLYPHMETRICS lpgm, DWORD buflen, LPVOID buf, - const MAT2* lpmat) +static DWORD freetype_GetGlyphOutline( PHYSDEV dev, UINT glyph, UINT format, + LPGLYPHMETRICS lpgm, DWORD buflen, LPVOID buf, const MAT2 *lpmat ) { + struct freetype_physdev *physdev = get_freetype_dev( dev ); DWORD ret; + if (!physdev->font) + { + dev = GET_NEXT_PHYSDEV( dev, pGetGlyphOutline ); + return dev->funcs->pGetGlyphOutline( dev, glyph, format, lpgm, buflen, buf, lpmat ); + } + GDI_CheckNotLock(); EnterCriticalSection( &freetype_cs ); - ret = get_glyph_outline( font, glyph, format, lpgm, buflen, buf, lpmat ); + ret = get_glyph_outline( physdev->font, glyph, format, lpgm, buflen, buf, lpmat ); LeaveCriticalSection( &freetype_cs ); return ret; } @@ -7089,7 +7094,7 @@ static const struct gdi_dc_funcs freetype_funcs = NULL, /* pGetFontData */ freetype_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */ freetype_GetGlyphIndices, /* pGetGlyphIndices */ - NULL, /* pGetGlyphOutline */ + freetype_GetGlyphOutline, /* pGetGlyphOutline */ NULL, /* pGetICMProfile */ NULL, /* pGetImage */ NULL, /* pGetKerningPairs */ @@ -7190,14 +7195,6 @@ BOOL WineEngDestroyFontInstance(HFONT hfont) return FALSE; } -DWORD WineEngGetGlyphOutline(GdiFont *font, UINT glyph, UINT format, - LPGLYPHMETRICS lpgm, DWORD buflen, LPVOID buf, - const MAT2* lpmat) -{ - ERR("called but we don't have FreeType\n"); - return GDI_ERROR; -} - UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize, OUTLINETEXTMETRICW *potm) { diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index c09ecf1..d0727a2 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -293,9 +293,6 @@ extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN; extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN; extern DWORD WineEngGetFontData(GdiFont*, DWORD, DWORD, LPVOID, DWORD) DECLSPEC_HIDDEN; -extern DWORD WineEngGetGlyphOutline(GdiFont*, UINT glyph, UINT format, - LPGLYPHMETRICS, DWORD buflen, LPVOID buf, - const MAT2*) DECLSPEC_HIDDEN; extern DWORD WineEngGetKerningPairs(GdiFont*, DWORD, KERNINGPAIR *) DECLSPEC_HIDDEN; extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) DECLSPEC_HIDDEN; extern UINT WineEngGetOutlineTextMetrics(GdiFont*, UINT, LPOUTLINETEXTMETRICW) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : gdi32: Implement GetGlyphIndices as a standard driver entry point.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: ff96c4dd4e23c2a20fc3f63176618be2e6cff06a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ff96c4dd4e23c2a20fc3f6317…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Oct 20 16:30:32 2011 +0200 gdi32: Implement GetGlyphIndices as a standard driver entry point. --- dlls/gdi32/font.c | 8 ++++---- dlls/gdi32/freetype.c | 31 +++++++++++++++---------------- dlls/gdi32/gdi_private.h | 2 -- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 72490c9..8fa9173 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -2837,16 +2837,16 @@ DWORD WINAPI GetGlyphIndicesW(HDC hdc, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags) { DC *dc = get_dc_ptr(hdc); - DWORD ret = GDI_ERROR; + PHYSDEV dev; + DWORD ret; TRACE("(%p, %s, %d, %p, 0x%x)\n", hdc, debugstr_wn(lpstr, count), count, pgi, flags); if(!dc) return GDI_ERROR; - if(dc->gdiFont) - ret = WineEngGetGlyphIndices(dc->gdiFont, lpstr, count, pgi, flags); - + dev = GET_DC_PHYSDEV( dc, pGetGlyphIndices ); + ret = dev->funcs->pGetGlyphIndices( dev, lpstr, count, pgi, flags ); release_dc_ptr( dc ); return ret; } diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 11245d6..da9de0d 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -4947,16 +4947,21 @@ static FT_UInt get_glyph_index(const GdiFont *font, UINT glyph) } /************************************************************* - * WineEngGetGlyphIndices - * + * freetype_GetGlyphIndices */ -DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count, - LPWORD pgi, DWORD flags) +static DWORD freetype_GetGlyphIndices( PHYSDEV dev, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags ) { + struct freetype_physdev *physdev = get_freetype_dev( dev ); int i; WORD default_char; BOOL got_default = FALSE; + if (!physdev->font) + { + dev = GET_NEXT_PHYSDEV( dev, pGetGlyphIndices ); + return dev->funcs->pGetGlyphIndices( dev, lpstr, count, pgi, flags ); + } + if (flags & GGI_MARK_NONEXISTING_GLYPHS) { default_char = 0xffff; /* XP would use 0x1f for bitmap fonts */ @@ -4968,20 +4973,20 @@ DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count, for(i = 0; i < count; i++) { - pgi[i] = get_glyph_index(font, lpstr[i]); + pgi[i] = get_glyph_index(physdev->font, lpstr[i]); if (pgi[i] == 0) { if (!got_default) { - if (FT_IS_SFNT(font->ft_face)) + if (FT_IS_SFNT(physdev->font->ft_face)) { - TT_OS2 *pOS2 = pFT_Get_Sfnt_Table(font->ft_face, ft_sfnt_os2); - default_char = (pOS2->usDefaultChar ? get_glyph_index(font, pOS2->usDefaultChar) : 0); + TT_OS2 *pOS2 = pFT_Get_Sfnt_Table(physdev->font->ft_face, ft_sfnt_os2); + default_char = (pOS2->usDefaultChar ? get_glyph_index(physdev->font, pOS2->usDefaultChar) : 0); } else { TEXTMETRICW textm; - get_text_metrics(font, &textm); + get_text_metrics(physdev->font, &textm); default_char = textm.tmDefaultChar; } got_default = TRUE; @@ -7083,7 +7088,7 @@ static const struct gdi_dc_funcs freetype_funcs = NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ freetype_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */ - NULL, /* pGetGlyphIndices */ + freetype_GetGlyphIndices, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ NULL, /* pGetICMProfile */ NULL, /* pGetImage */ @@ -7185,12 +7190,6 @@ BOOL WineEngDestroyFontInstance(HFONT hfont) return FALSE; } -DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count, - LPWORD pgi, DWORD flags) -{ - return GDI_ERROR; -} - DWORD WineEngGetGlyphOutline(GdiFont *font, UINT glyph, UINT format, LPGLYPHMETRICS lpgm, DWORD buflen, LPVOID buf, const MAT2* lpmat) diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 316e6a9..c09ecf1 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -293,8 +293,6 @@ extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN; extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN; extern DWORD WineEngGetFontData(GdiFont*, DWORD, DWORD, LPVOID, DWORD) DECLSPEC_HIDDEN; -extern DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count, - LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN; extern DWORD WineEngGetGlyphOutline(GdiFont*, UINT glyph, UINT format, LPGLYPHMETRICS, DWORD buflen, LPVOID buf, const MAT2*) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : gdi32: Implement GetFontUnicodeRanges as a standard driver entry point.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: 90ecea9739c1ca8585a97c1a4c1f65f4e141bed6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=90ecea9739c1ca8585a97c1a4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Oct 20 16:26:26 2011 +0200 gdi32: Implement GetFontUnicodeRanges as a standard driver entry point. --- dlls/gdi32/font.c | 6 ++++-- dlls/gdi32/freetype.c | 24 ++++++++++++++---------- dlls/gdi32/gdi_private.h | 1 - 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index f2f4c94..72490c9 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3397,14 +3397,16 @@ BOOL WINAPI GetCharWidthI(HDC hdc, UINT first, UINT count, LPWORD glyphs, LPINT */ DWORD WINAPI GetFontUnicodeRanges(HDC hdc, LPGLYPHSET lpgs) { - DWORD ret = 0; + DWORD ret; + PHYSDEV dev; DC *dc = get_dc_ptr(hdc); TRACE("(%p, %p)\n", hdc, lpgs); if (!dc) return 0; - if (dc->gdiFont) ret = WineEngGetFontUnicodeRanges(dc->gdiFont, lpgs); + dev = GET_DC_PHYSDEV( dc, pGetFontUnicodeRanges ); + ret = dev->funcs->pGetFontUnicodeRanges( dev, lpgs ); release_dc_ptr(dc); return ret; } diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 5b3543b..11245d6 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6675,11 +6675,21 @@ static DWORD get_font_unicode_ranges(FT_Face face, GLYPHSET *gs) return num_ranges; } -DWORD WineEngGetFontUnicodeRanges(GdiFont *font, LPGLYPHSET glyphset) +/************************************************************* + * freetype_GetFontUnicodeRanges + */ +static DWORD freetype_GetFontUnicodeRanges( PHYSDEV dev, LPGLYPHSET glyphset ) { - DWORD size = 0; - DWORD num_ranges = get_font_unicode_ranges(font->ft_face, glyphset); + struct freetype_physdev *physdev = get_freetype_dev( dev ); + DWORD size, num_ranges; + if (!physdev->font) + { + dev = GET_NEXT_PHYSDEV( dev, pGetFontUnicodeRanges ); + return dev->funcs->pGetFontUnicodeRanges( dev, glyphset ); + } + + num_ranges = get_font_unicode_ranges(physdev->font->ft_face, glyphset); size = sizeof(GLYPHSET) + sizeof(WCRANGE) * (num_ranges - 1); if (glyphset) { @@ -7072,7 +7082,7 @@ static const struct gdi_dc_funcs freetype_funcs = NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ - NULL, /* pGetFontUnicodeRanges */ + freetype_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ NULL, /* pGetICMProfile */ @@ -7245,12 +7255,6 @@ BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) return FALSE; } -DWORD WineEngGetFontUnicodeRanges(GdiFont *font, LPGLYPHSET glyphset) -{ - FIXME("(%p, %p): stub\n", font, glyphset); - return 0; -} - BOOL WineEngFontIsLinked(GdiFont *font) { return FALSE; diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 23c1e78..316e6a9 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -293,7 +293,6 @@ extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN; extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN; extern DWORD WineEngGetFontData(GdiFont*, DWORD, DWORD, LPVOID, DWORD) DECLSPEC_HIDDEN; -extern DWORD WineEngGetFontUnicodeRanges(GdiFont *, LPGLYPHSET) DECLSPEC_HIDDEN; extern DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN; extern DWORD WineEngGetGlyphOutline(GdiFont*, UINT glyph, UINT format,
1
0
0
0
Alexandre Julliard : gdi32: Reimplement GetCharABCWidthsFloat using the integer version.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: 23c7c0469c34b072c0e6fdf5bbcab547dcc4d912 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23c7c0469c34b072c0e6fdf5b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 19 22:07:32 2011 +0200 gdi32: Reimplement GetCharABCWidthsFloat using the integer version. --- dlls/gdi32/font.c | 24 +++++++++++------------- dlls/gdi32/freetype.c | 38 -------------------------------------- dlls/gdi32/gdi_private.h | 2 -- 3 files changed, 11 insertions(+), 53 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index e8d10f1..f2f4c94 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3049,6 +3049,8 @@ BOOL WINAPI GetCharABCWidthsFloatA( HDC hdc, UINT first, UINT last, LPABCFLOAT a BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, LPABCFLOAT abcf ) { UINT i; + ABC *abc; + PHYSDEV dev; BOOL ret = FALSE; DC *dc = get_dc_ptr( hdc ); @@ -3056,28 +3058,24 @@ BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, LPABCFLOAT a if (!dc) return FALSE; - if (!abcf) - { - release_dc_ptr( dc ); - return FALSE; - } - - if (dc->gdiFont) - ret = WineEngGetCharABCWidthsFloat( dc->gdiFont, first, last, abcf ); - else - FIXME("stub\n"); + if (!abcf) goto done; + if (!(abc = HeapAlloc( GetProcessHeap(), 0, (last - first + 1) * sizeof(*abc) ))) goto done; + dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths ); + ret = dev->funcs->pGetCharABCWidths( dev, first, last, abc ); if (ret) { /* convert device units to logical */ for (i = first; i <= last; i++, abcf++) { - abcf->abcfA = abcf->abcfA * dc->xformVport2World.eM11; - abcf->abcfB = abcf->abcfB * dc->xformVport2World.eM11; - abcf->abcfC = abcf->abcfC * dc->xformVport2World.eM11; + abcf->abcfA = abc->abcA * dc->xformVport2World.eM11; + abcf->abcfB = abc->abcB * dc->xformVport2World.eM11; + abcf->abcfC = abc->abcC * dc->xformVport2World.eM11; } } + HeapFree( GetProcessHeap(), 0, abc ); +done: release_dc_ptr( dc ); return ret; } diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index fa3f72b..5b3543b 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6387,38 +6387,6 @@ static BOOL freetype_GetCharABCWidths( PHYSDEV dev, UINT firstChar, UINT lastCha } /************************************************************* - * WineEngGetCharABCWidthsFloat - * - */ -BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT first, UINT last, LPABCFLOAT buffer) -{ - static const MAT2 identity = {{0,1}, {0,0}, {0,0}, {0,1}}; - UINT c; - GLYPHMETRICS gm; - FT_UInt glyph_index; - GdiFont *linked_font; - - TRACE("%p, %d, %d, %p\n", font, first, last, buffer); - - GDI_CheckNotLock(); - EnterCriticalSection( &freetype_cs ); - - for (c = first; c <= last; c++) - { - get_glyph_index_linked(font, c, &linked_font, &glyph_index); - get_glyph_outline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, - &gm, 0, NULL, &identity); - buffer[c - first].abcfA = FONT_GM(linked_font, glyph_index)->lsb; - buffer[c - first].abcfB = FONT_GM(linked_font, glyph_index)->bbx; - buffer[c - first].abcfC = FONT_GM(linked_font, glyph_index)->adv - - FONT_GM(linked_font, glyph_index)->lsb - - FONT_GM(linked_font, glyph_index)->bbx; - } - LeaveCriticalSection( &freetype_cs ); - return TRUE; -} - -/************************************************************* * freetype_GetCharABCWidthsI */ static BOOL freetype_GetCharABCWidthsI( PHYSDEV dev, UINT firstChar, UINT count, LPWORD pgi, LPABC buffer ) @@ -7228,12 +7196,6 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize, return 0; } -BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT first, UINT last, LPABCFLOAT buffer) -{ - ERR("called but we don't have FreeType\n"); - return FALSE; -} - BOOL WineEngGetTextExtentExPointI(GdiFont *font, const WORD *indices, INT count, INT max_ext, LPINT nfit, LPINT dx, LPSIZE size) { diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index fff72b1..23c1e78 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -292,8 +292,6 @@ typedef struct extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN; extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN; -extern BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT firstChar, - UINT lastChar, LPABCFLOAT buffer) DECLSPEC_HIDDEN; extern DWORD WineEngGetFontData(GdiFont*, DWORD, DWORD, LPVOID, DWORD) DECLSPEC_HIDDEN; extern DWORD WineEngGetFontUnicodeRanges(GdiFont *, LPGLYPHSET) DECLSPEC_HIDDEN; extern DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
1
0
0
0
Alexandre Julliard : gdi32: Implement GetCharABCWidthsI as a standard driver entry point.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: 27208a0ec5800277831e7764a97e42237fa1fffc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=27208a0ec5800277831e7764a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 19 22:00:55 2011 +0200 gdi32: Implement GetCharABCWidthsI as a standard driver entry point. --- dlls/gdi32/font.c | 11 ++++------- dlls/gdi32/freetype.c | 26 ++++++++++++-------------- dlls/gdi32/gdi_private.h | 2 -- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index d12e73b..e8d10f1 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -2434,8 +2434,9 @@ BOOL WINAPI GetCharABCWidthsI( HDC hdc, UINT firstChar, UINT count, LPWORD pgi, LPABC abc) { DC *dc = get_dc_ptr(hdc); + PHYSDEV dev; unsigned int i; - BOOL ret = FALSE; + BOOL ret; if (!dc) return FALSE; @@ -2445,11 +2446,8 @@ BOOL WINAPI GetCharABCWidthsI( HDC hdc, UINT firstChar, UINT count, return FALSE; } - if(dc->gdiFont) - ret = WineEngGetCharABCWidthsI( dc->gdiFont, firstChar, count, pgi, abc ); - else - FIXME(": stub\n"); - + dev = GET_DC_PHYSDEV( dc, pGetCharABCWidthsI ); + ret = dev->funcs->pGetCharABCWidthsI( dev, firstChar, count, pgi, abc ); if (ret) { /* convert device units to logical */ @@ -2458,7 +2456,6 @@ BOOL WINAPI GetCharABCWidthsI( HDC hdc, UINT firstChar, UINT count, abc->abcB = INTERNAL_XDSTOWS(dc, abc->abcB); abc->abcC = INTERNAL_XDSTOWS(dc, abc->abcC); } - ret = TRUE; } release_dc_ptr( dc ); diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 00ea0ec..fa3f72b 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6419,25 +6419,30 @@ BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT first, UINT last, LPABCFLO } /************************************************************* - * WineEngGetCharABCWidthsI - * + * freetype_GetCharABCWidthsI */ -BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD pgi, - LPABC buffer) +static BOOL freetype_GetCharABCWidthsI( PHYSDEV dev, UINT firstChar, UINT count, LPWORD pgi, LPABC buffer ) { static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; UINT c; GLYPHMETRICS gm; FT_UInt glyph_index; GdiFont *linked_font; + struct freetype_physdev *physdev = get_freetype_dev( dev ); + + if (!physdev->font) + { + dev = GET_NEXT_PHYSDEV( dev, pGetCharABCWidthsI ); + return dev->funcs->pGetCharABCWidthsI( dev, firstChar, count, pgi, buffer ); + } - if(!FT_HAS_HORIZONTAL(font->ft_face)) + if(!FT_HAS_HORIZONTAL(physdev->font->ft_face)) return FALSE; GDI_CheckNotLock(); EnterCriticalSection( &freetype_cs ); - get_glyph_index_linked(font, 'a', &linked_font, &glyph_index); + get_glyph_index_linked(physdev->font, 'a', &linked_font, &glyph_index); if (!pgi) for(c = firstChar; c < firstChar+count; c++) { get_glyph_outline(linked_font, c, GGO_METRICS | GGO_GLYPH_INDEX, @@ -7094,7 +7099,7 @@ static const struct gdi_dc_funcs freetype_funcs = NULL, /* pGdiComment */ NULL, /* pGdiRealizationInfo */ freetype_GetCharABCWidths, /* pGetCharABCWidths */ - NULL, /* pGetCharABCWidthsI */ + freetype_GetCharABCWidthsI, /* pGetCharABCWidthsI */ freetype_GetCharWidth, /* pGetCharWidth */ NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ @@ -7229,13 +7234,6 @@ BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT first, UINT last, LPABCFLO return FALSE; } -BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD pgi, - LPABC buffer) -{ - ERR("called but we don't have FreeType\n"); - return FALSE; -} - BOOL WineEngGetTextExtentExPointI(GdiFont *font, const WORD *indices, INT count, INT max_ext, LPINT nfit, LPINT dx, LPSIZE size) { diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 413d61f..fff72b1 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -294,8 +294,6 @@ extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN; extern BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT firstChar, UINT lastChar, LPABCFLOAT buffer) DECLSPEC_HIDDEN; -extern BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, - UINT count, LPWORD pgi, LPABC buffer) DECLSPEC_HIDDEN; extern DWORD WineEngGetFontData(GdiFont*, DWORD, DWORD, LPVOID, DWORD) DECLSPEC_HIDDEN; extern DWORD WineEngGetFontUnicodeRanges(GdiFont *, LPGLYPHSET) DECLSPEC_HIDDEN; extern DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
1
0
0
0
Alexandre Julliard : gdi32: Implement GetCharABCWidths as a standard driver entry point.
by Alexandre Julliard
25 Oct '11
25 Oct '11
Module: wine Branch: master Commit: e5a0fa7089dfafd2e7a0fc6e5cc6856ecc3e8d9e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e5a0fa7089dfafd2e7a0fc6e5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Oct 21 11:33:04 2011 +0200 gdi32: Implement GetCharABCWidths as a standard driver entry point. --- dlls/gdi32/font.c | 11 ++++------- dlls/gdi32/freetype.c | 28 +++++++++++++--------------- dlls/gdi32/gdi_private.h | 2 -- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index e1fc856..d12e73b 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -2382,8 +2382,9 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, LPABC abc ) { DC *dc = get_dc_ptr(hdc); + PHYSDEV dev; unsigned int i; - BOOL ret = FALSE; + BOOL ret; if (!dc) return FALSE; @@ -2393,11 +2394,8 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, return FALSE; } - if(dc->gdiFont) - ret = WineEngGetCharABCWidths( dc->gdiFont, firstChar, lastChar, abc ); - else - FIXME(": stub\n"); - + dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths ); + ret = dev->funcs->pGetCharABCWidths( dev, firstChar, lastChar, abc ); if (ret) { /* convert device units to logical */ @@ -2406,7 +2404,6 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, abc->abcB = INTERNAL_XDSTOWS(dc, abc->abcB); abc->abcC = INTERNAL_XDSTOWS(dc, abc->abcC); } - ret = TRUE; } release_dc_ptr( dc ); diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 6fbfd0d..00ea0ec 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6348,28 +6348,33 @@ static BOOL freetype_GetCharWidth( PHYSDEV dev, UINT firstChar, UINT lastChar, L } /************************************************************* - * WineEngGetCharABCWidths - * + * freetype_GetCharABCWidths */ -BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar, UINT lastChar, - LPABC buffer) +static BOOL freetype_GetCharABCWidths( PHYSDEV dev, UINT firstChar, UINT lastChar, LPABC buffer ) { static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; UINT c; GLYPHMETRICS gm; FT_UInt glyph_index; GdiFont *linked_font; + struct freetype_physdev *physdev = get_freetype_dev( dev ); - TRACE("%p, %d, %d, %p\n", font, firstChar, lastChar, buffer); + if (!physdev->font) + { + dev = GET_NEXT_PHYSDEV( dev, pGetCharABCWidths ); + return dev->funcs->pGetCharABCWidths( dev, firstChar, lastChar, buffer ); + } + + TRACE("%p, %d, %d, %p\n", physdev->font, firstChar, lastChar, buffer); - if(!FT_IS_SCALABLE(font->ft_face)) + if(!FT_IS_SCALABLE(physdev->font->ft_face)) return FALSE; GDI_CheckNotLock(); EnterCriticalSection( &freetype_cs ); for(c = firstChar; c <= lastChar; c++) { - get_glyph_index_linked(font, c, &linked_font, &glyph_index); + get_glyph_index_linked(physdev->font, c, &linked_font, &glyph_index); get_glyph_outline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, &identity); buffer[c - firstChar].abcA = FONT_GM(linked_font,glyph_index)->lsb; @@ -7088,7 +7093,7 @@ static const struct gdi_dc_funcs freetype_funcs = NULL, /* pFrameRgn */ NULL, /* pGdiComment */ NULL, /* pGdiRealizationInfo */ - NULL, /* pGetCharABCWidths */ + freetype_GetCharABCWidths, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ freetype_GetCharWidth, /* pGetCharWidth */ NULL, /* pGetDeviceCaps */ @@ -7218,13 +7223,6 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize, return 0; } -BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar, UINT lastChar, - LPABC buffer) -{ - ERR("called but we don't have FreeType\n"); - return FALSE; -} - BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT first, UINT last, LPABCFLOAT buffer) { ERR("called but we don't have FreeType\n"); diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index efd3e56..413d61f 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -292,8 +292,6 @@ typedef struct extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN; extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN; -extern BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar, - UINT lastChar, LPABC buffer) DECLSPEC_HIDDEN; extern BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT firstChar, UINT lastChar, LPABCFLOAT buffer) DECLSPEC_HIDDEN; extern BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar,
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
79
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
Results per page:
10
25
50
100
200