wineps.drv: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
783d71366a
commit
865ee87bc3
|
@ -227,8 +227,6 @@ typedef struct
|
||||||
static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
|
static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
|
||||||
WPARAM wParam, LPARAM lParam)
|
WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static const WCHAR resW[] = {'%','d',0};
|
|
||||||
static const WCHAR resxyW[] = {'%','d','x','%','d',0};
|
|
||||||
PSDRV_DLGINFO *di;
|
PSDRV_DLGINFO *di;
|
||||||
int i, Cursel;
|
int i, Cursel;
|
||||||
PAGESIZE *ps;
|
PAGESIZE *ps;
|
||||||
|
@ -280,7 +278,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
|
||||||
WCHAR buf[256];
|
WCHAR buf[256];
|
||||||
|
|
||||||
res = di->pi->ppd->DefaultResolution;
|
res = di->pi->ppd->DefaultResolution;
|
||||||
len = swprintf(buf, ARRAY_SIZE(buf), resW, res);
|
len = swprintf(buf, ARRAY_SIZE(buf), L"%d", res);
|
||||||
buf[len++] = ' ';
|
buf[len++] = ' ';
|
||||||
LoadStringW(PSDRV_hInstance, IDS_DPI, buf + len, ARRAY_SIZE(buf) - len);
|
LoadStringW(PSDRV_hInstance, IDS_DPI, buf + len, ARRAY_SIZE(buf) - len);
|
||||||
SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_ADDSTRING, 0, (LPARAM)buf);
|
SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_ADDSTRING, 0, (LPARAM)buf);
|
||||||
|
@ -310,9 +308,9 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
|
||||||
DWORD idx;
|
DWORD idx;
|
||||||
|
|
||||||
if (res->resx == res->resy)
|
if (res->resx == res->resy)
|
||||||
len = swprintf(buf, ARRAY_SIZE(buf), resW, res->resx);
|
len = swprintf(buf, ARRAY_SIZE(buf), L"%d", res->resx);
|
||||||
else
|
else
|
||||||
len = swprintf(buf, ARRAY_SIZE(buf), resxyW, res->resx, res->resy);
|
len = swprintf(buf, ARRAY_SIZE(buf), L"%dx%d", res->resx, res->resy);
|
||||||
buf[len++] = ' ';
|
buf[len++] = ' ';
|
||||||
LoadStringW(PSDRV_hInstance, IDS_DPI, buf + len, ARRAY_SIZE(buf) - len);
|
LoadStringW(PSDRV_hInstance, IDS_DPI, buf + len, ARRAY_SIZE(buf) - len);
|
||||||
idx = SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_ADDSTRING, 0, (LPARAM)buf);
|
idx = SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_ADDSTRING, 0, (LPARAM)buf);
|
||||||
|
@ -552,7 +550,6 @@ INT CDECL PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput
|
||||||
PSDRV_DLGINFO di;
|
PSDRV_DLGINFO di;
|
||||||
PSDRV_DEVMODE dlgdm;
|
PSDRV_DEVMODE dlgdm;
|
||||||
WCHAR SetupW[64];
|
WCHAR SetupW[64];
|
||||||
static const WCHAR PAPERW[] = {'P','A','P','E','R','\0'};
|
|
||||||
|
|
||||||
LoadStringW(PSDRV_hInstance, IDS_SETUP, SetupW, ARRAY_SIZE(SetupW));
|
LoadStringW(PSDRV_hInstance, IDS_SETUP, SetupW, ARRAY_SIZE(SetupW));
|
||||||
hinstComctl32 = LoadLibraryA("comctl32.dll");
|
hinstComctl32 = LoadLibraryA("comctl32.dll");
|
||||||
|
@ -565,7 +562,7 @@ INT CDECL PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput
|
||||||
di.dlgdm = &dlgdm;
|
di.dlgdm = &dlgdm;
|
||||||
psp.dwSize = sizeof(psp);
|
psp.dwSize = sizeof(psp);
|
||||||
psp.hInstance = PSDRV_hInstance;
|
psp.hInstance = PSDRV_hInstance;
|
||||||
psp.u.pszTemplate = PAPERW;
|
psp.u.pszTemplate = L"PAPER";
|
||||||
psp.u2.pszIcon = NULL;
|
psp.u2.pszIcon = NULL;
|
||||||
psp.pfnDlgProc = PSDRV_PaperDlgProc;
|
psp.pfnDlgProc = PSDRV_PaperDlgProc;
|
||||||
psp.lParam = (LPARAM)&di;
|
psp.lParam = (LPARAM)&di;
|
||||||
|
|
|
@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
||||||
static const PSDRV_DEVMODE DefaultDevmode =
|
static const PSDRV_DEVMODE DefaultDevmode =
|
||||||
{
|
{
|
||||||
{ /* dmPublic */
|
{ /* dmPublic */
|
||||||
/* dmDeviceName */ {'W','i','n','e',' ','P','o','s','t','S','c','r','i','p','t',' ','D','r','i','v','e','r',0},
|
/* dmDeviceName */ L"Wine PostScript Driver",
|
||||||
/* dmSpecVersion */ 0x30a,
|
/* dmSpecVersion */ 0x30a,
|
||||||
/* dmDriverVersion */ 0x001,
|
/* dmDriverVersion */ 0x001,
|
||||||
/* dmSize */ sizeof(DEVMODEW),
|
/* dmSize */ sizeof(DEVMODEW),
|
||||||
|
@ -66,7 +66,7 @@ static const PSDRV_DEVMODE DefaultDevmode =
|
||||||
/* dmYResolution */ 300,
|
/* dmYResolution */ 300,
|
||||||
/* dmTTOption */ DMTT_SUBDEV,
|
/* dmTTOption */ DMTT_SUBDEV,
|
||||||
/* dmCollate */ DMCOLLATE_FALSE,
|
/* dmCollate */ DMCOLLATE_FALSE,
|
||||||
/* dmFormName */ {'L','e','t','t','e','r',0},
|
/* dmFormName */ L"Letter",
|
||||||
/* dmLogPixels */ 0,
|
/* dmLogPixels */ 0,
|
||||||
/* dmBitsPerPel */ 0,
|
/* dmBitsPerPel */ 0,
|
||||||
/* dmPelsWidth */ 0,
|
/* dmPelsWidth */ 0,
|
||||||
|
|
|
@ -1093,13 +1093,12 @@ static BOOL BuildAFM(FILE *file)
|
||||||
*/
|
*/
|
||||||
static BOOL ReadAFMFile(LPCWSTR filename)
|
static BOOL ReadAFMFile(LPCWSTR filename)
|
||||||
{
|
{
|
||||||
static const WCHAR rW[] = {'r',0};
|
|
||||||
FILE *f;
|
FILE *f;
|
||||||
BOOL retval;
|
BOOL retval;
|
||||||
|
|
||||||
TRACE("%s\n", debugstr_w(filename));
|
TRACE("%s\n", debugstr_w(filename));
|
||||||
|
|
||||||
f = _wfopen(filename, rW);
|
f = _wfopen(filename, L"r");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
{
|
{
|
||||||
WARN("%s: %s\n", debugstr_w(filename), strerror(errno));
|
WARN("%s: %s\n", debugstr_w(filename), strerror(errno));
|
||||||
|
@ -1120,8 +1119,6 @@ static BOOL ReadAFMFile(LPCWSTR filename)
|
||||||
*/
|
*/
|
||||||
static BOOL ReadAFMDir(LPCSTR dirname)
|
static BOOL ReadAFMDir(LPCSTR dirname)
|
||||||
{
|
{
|
||||||
static const WCHAR starW[] = {'*',0};
|
|
||||||
static const WCHAR afmW[] = {'.','a','f','m',0};
|
|
||||||
WCHAR *path = wine_get_dos_file_name( dirname );
|
WCHAR *path = wine_get_dos_file_name( dirname );
|
||||||
struct _wfinddata_t data;
|
struct _wfinddata_t data;
|
||||||
intptr_t handle;
|
intptr_t handle;
|
||||||
|
@ -1138,7 +1135,7 @@ static BOOL ReadAFMDir(LPCSTR dirname)
|
||||||
HeapFree( GetProcessHeap(), 0, path );
|
HeapFree( GetProcessHeap(), 0, path );
|
||||||
p = filename + lstrlenW(filename);
|
p = filename + lstrlenW(filename);
|
||||||
*p++ = '\\';
|
*p++ = '\\';
|
||||||
lstrcpyW( p, starW );
|
lstrcpyW( p, L"*" );
|
||||||
|
|
||||||
handle = _wfindfirst( filename, &data );
|
handle = _wfindfirst( filename, &data );
|
||||||
if (handle != -1)
|
if (handle != -1)
|
||||||
|
@ -1146,7 +1143,7 @@ static BOOL ReadAFMDir(LPCSTR dirname)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
WCHAR *ext = wcschr( data.name, '.' );
|
WCHAR *ext = wcschr( data.name, '.' );
|
||||||
if (!ext || wcsicmp(ext, afmW)) continue;
|
if (!ext || wcsicmp(ext, L".afm")) continue;
|
||||||
lstrcpyW( p, data.name );
|
lstrcpyW( p, data.name );
|
||||||
if (!(ret = ReadAFMFile( filename ))) break;
|
if (!(ret = ReadAFMFile( filename ))) break;
|
||||||
} while (!_wfindnext( handle, &data ));
|
} while (!_wfindnext( handle, &data ));
|
||||||
|
@ -1170,7 +1167,6 @@ static BOOL ReadAFMDir(LPCSTR dirname)
|
||||||
*/
|
*/
|
||||||
BOOL PSDRV_GetType1Metrics(void)
|
BOOL PSDRV_GetType1Metrics(void)
|
||||||
{
|
{
|
||||||
static const WCHAR pathW[] = {'A','F','M','P','a','t','h',0};
|
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
LPWSTR valueW;
|
LPWSTR valueW;
|
||||||
|
@ -1180,11 +1176,11 @@ BOOL PSDRV_GetType1Metrics(void)
|
||||||
if (RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Fonts", &hkey) != ERROR_SUCCESS)
|
if (RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Fonts", &hkey) != ERROR_SUCCESS)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (RegQueryValueExW( hkey, pathW, NULL, NULL, NULL, &len ) == ERROR_SUCCESS)
|
if (RegQueryValueExW( hkey, L"AFMPath", NULL, NULL, NULL, &len ) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
len += sizeof(WCHAR);
|
len += sizeof(WCHAR);
|
||||||
valueW = HeapAlloc( PSDRV_Heap, 0, len );
|
valueW = HeapAlloc( PSDRV_Heap, 0, len );
|
||||||
if (RegQueryValueExW( hkey, pathW, NULL, NULL, (LPBYTE)valueW, &len ) == ERROR_SUCCESS)
|
if (RegQueryValueExW( hkey, L"AFMPath", NULL, NULL, (BYTE *)valueW, &len ) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
len = WideCharToMultiByte( CP_UNIXCP, 0, valueW, -1, NULL, 0, NULL, NULL );
|
len = WideCharToMultiByte( CP_UNIXCP, 0, valueW, -1, NULL, 0, NULL, NULL );
|
||||||
valueA = HeapAlloc( PSDRV_Heap, 0, len );
|
valueA = HeapAlloc( PSDRV_Heap, 0, len );
|
||||||
|
|
Loading…
Reference in New Issue