Module: wine Branch: master Commit: 0110512904d9c646abef416819a057c06d3f2c97 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0110512904d9c646abef416819...
Author: L. Rahyen research@science.su Date: Mon Mar 10 15:54:16 2008 +0000
winecfg: Make DPI interval to be the same as in Windows.
---
programs/winecfg/winecfg.c | 5 +++++ programs/winecfg/x11drvdlg.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c index c492a11..b21599d 100644 --- a/programs/winecfg/winecfg.c +++ b/programs/winecfg/winecfg.c @@ -461,6 +461,11 @@ void set_reg_key_dword(HKEY root, const char *path, const char *name, DWORD valu HeapFree(GetProcessHeap(), 0, wname); }
+void set_reg_key_dwordW(HKEY root, const WCHAR *path, const WCHAR *name, DWORD value) +{ + set_reg_key_ex(root, path, name, &value, REG_DWORD); +} + /** * enumerates the value names at the given path, taking into account * the changes in the settings list. diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c index d6e9912..972ca6d 100644 --- a/programs/winecfg/x11drvdlg.c +++ b/programs/winecfg/x11drvdlg.c @@ -37,10 +37,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
#define RES_MAXLEN 5 /* the maximum number of characters in a screen dimension. 5 digits should be plenty, what kind of crazy person runs their screen >10,000 pixels across? */ #define MINDPI 96 -#define MAXDPI 160 +#define MAXDPI 480 #define DEFDPI 96
-static const char logpixels_reg[] = "System\CurrentControlSet\Hardware Profiles\Current\Software\Fonts"; +static const WCHAR logpixels_reg[] = {'S','y','s','t','e','m','\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\','H','a','r','d','w','a','r','e',' ','P','r','o','f','i','l','e','s','\','C','u','r','r','e','n','t','\','S','o','f','t','w','a','r','e','\','F','o','n','t','s',0}; +static const WCHAR logpixels[] = {'L','o','g','P','i','x','e','l','s',0};
static struct SHADERMODE { @@ -244,8 +245,7 @@ static void on_d3d_pshader_mode_clicked(HWND dialog) { static INT read_logpixels_reg(void) { DWORD dwLogPixels; - char *buf = get_reg_key(HKEY_LOCAL_MACHINE, logpixels_reg, - "LogPixels", NULL); + WCHAR *buf = get_reg_keyW(HKEY_LOCAL_MACHINE, logpixels_reg, logpixels, NULL); dwLogPixels = buf ? *buf : DEFDPI; HeapFree(GetProcessHeap(), 0, buf); return dwLogPixels; @@ -357,7 +357,7 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) buf[0] = 0; sprintf(buf, "%d", i); SendMessage(GetDlgItem(hDlg, IDC_RES_DPIEDIT), WM_SETTEXT, 0, (LPARAM) buf); - set_reg_key_dword(HKEY_LOCAL_MACHINE, logpixels_reg, "LogPixels", i); + set_reg_key_dwordW(HKEY_LOCAL_MACHINE, logpixels_reg, logpixels, i); break; } }