Add features to Wine configuration window (winecfg)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

326 lines
14 KiB

  1. diff -Burp a/programs/winecfg/about.c b/programs/winecfg/about.c
  2. --- a/programs/winecfg/about.c 2018-04-27 21:52:34.925054200 +0300
  3. +++ b/programs/winecfg/about.c 2018-04-27 22:24:01.726867598 +0300
  4. @@ -5,6 +5,7 @@
  5. * Copyright 2003 Dimitrie O. Paun
  6. * Copyright 2003 Mike Hearn
  7. * Copyright 2010 Joel Holdsworth
  8. + * Copyright 2018 Pekka Helenius
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. @@ -30,6 +31,11 @@
  13. #include <commctrl.h>
  14. #include <shellapi.h>
  15. +#include <unistd.h>
  16. +#include <stdlib.h>
  17. +#include <string.h>
  18. +#include <stdio.h>
  19. +
  20. #include "resource.h"
  21. #include "winecfg.h"
  22. @@ -44,6 +50,26 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPAR
  23. HDC hDC;
  24. RECT rcClient, rcRect;
  25. char *owner, *org;
  26. + char *prefixpath, *token, *length, *prefixdir;
  27. + char *home, *defaultdir;
  28. + char *arch_title, *prefix_title, *arch;
  29. +
  30. + prefixpath = wine_get_config_dir();
  31. +
  32. + token = strrchr(prefixpath, '/');
  33. + length = strlen(token);
  34. + prefixdir = malloc(length);
  35. + memcpy(prefixdir, token+1, length);
  36. +
  37. + home = getenv("HOME");
  38. + defaultdir = malloc(strlen(home) + strlen("/.wine") + 1);
  39. +
  40. + memcpy(defaultdir, home, strlen(home));
  41. + memcpy(defaultdir + strlen(home), "/.wine", strlen("/.wine") + 1);
  42. +
  43. + if(strcmp(prefixpath,defaultdir) == 0) {
  44. + prefixdir = "Default";
  45. + }
  46. switch (uMsg)
  47. {
  48. @@ -71,8 +97,16 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPAR
  49. case NM_CLICK:
  50. case NM_RETURN:
  51. - if(wParam == IDC_ABT_WEB_LINK)
  52. + if(wParam == IDC_ABT_WEB_LINK) {
  53. ShellExecuteA(NULL, "open", PACKAGE_URL, NULL, NULL, SW_SHOW);
  54. + }
  55. + else if(wParam == IDC_ABT_PREFIX) {
  56. +
  57. + /* prepare unix command for opening prefixdir */
  58. + char *openfilemgr = malloc(strlen("xdg-open") + strlen(prefixpath) + 1);
  59. + sprintf(openfilemgr, "%s %s", "xdg-open", prefixpath);
  60. + system(openfilemgr);
  61. + }
  62. break;
  63. }
  64. break;
  65. @@ -90,11 +124,38 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPAR
  66. SetDlgItemTextA(hDlg, IDC_ABT_OWNER, owner);
  67. SetDlgItemTextA(hDlg, IDC_ABT_ORG, org);
  68. + /* read architecture info from registry */
  69. + arch = get_reg_key(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Session Manager\\Environment",
  70. + "PROCESSOR_ARCHITECTURE", "");
  71. +
  72. + if(strcmp(arch,"AMD64") == 0) {
  73. + arch = "64-bit";
  74. + }
  75. + else if(strcmp(arch,"x86") == 0) {
  76. + arch = "32-bit";
  77. + } else {
  78. + arch = "Undefined";
  79. + }
  80. +
  81. + SetDlgItemTextA(hDlg, IDC_ABT_ARCH, arch);
  82. +
  83. + arch_title = "Architecture:";
  84. + prefix_title = "Prefix:";
  85. +
  86. + SetDlgItemTextA(hDlg, IDC_ABT_ARCH_TITLE, arch_title);
  87. + SetDlgItemTextA(hDlg, IDC_ABT_PREFIX_TITLE, prefix_title);
  88. +
  89. SendMessageW(GetParent(hDlg), PSM_UNCHANGED, 0, 0);
  90. HeapFree(GetProcessHeap(), 0, owner);
  91. HeapFree(GetProcessHeap(), 0, org);
  92. + /* prepare prefix link text */
  93. + char *openprefix;
  94. + openprefix = malloc(strlen(prefixdir) + 1);
  95. + sprintf(openprefix, "<a> %s </a>", prefixdir);
  96. + SetDlgItemTextA(hDlg, IDC_ABT_PREFIX, openprefix);
  97. +
  98. /* prepare the panel */
  99. hWnd = GetDlgItem(hDlg, IDC_ABT_PANEL);
  100. if(hWnd)
  101. @@ -171,6 +232,10 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPAR
  102. case IDC_ABT_PANEL_TEXT:
  103. case IDC_ABT_LICENSE_TEXT:
  104. case IDC_ABT_WEB_LINK:
  105. + case IDC_ABT_ARCH:
  106. + case IDC_ABT_PREFIX:
  107. + case IDC_ABT_ARCH_TITLE:
  108. + case IDC_ABT_PREFIX_TITLE:
  109. SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
  110. return (INT_PTR)CreateSolidBrush(GetSysColor(COLOR_WINDOW));
  111. }
  112. Binary files a/programs/winecfg/about.o and b/programs/winecfg/about.o differ
  113. Binary files a/programs/winecfg/appdefaults.o and b/programs/winecfg/appdefaults.o differ
  114. Binary files a/programs/winecfg/audio.o and b/programs/winecfg/audio.o differ
  115. Binary files a/programs/winecfg/drive.o and b/programs/winecfg/drive.o differ
  116. Binary files a/programs/winecfg/drivedetect.o and b/programs/winecfg/drivedetect.o differ
  117. Binary files a/programs/winecfg/driveui.o and b/programs/winecfg/driveui.o differ
  118. Binary files a/programs/winecfg/libraries.o and b/programs/winecfg/libraries.o differ
  119. Binary files a/programs/winecfg/main.o and b/programs/winecfg/main.o differ
  120. diff -Burp a/programs/winecfg/resource.h b/programs/winecfg/resource.h
  121. --- a/programs/winecfg/resource.h 2018-04-27 21:52:34.937058231 +0300
  122. +++ b/programs/winecfg/resource.h 2018-04-27 22:25:07.042889774 +0300
  123. @@ -6,6 +6,7 @@
  124. * Copyright 2003 Mark Westcott
  125. * Copyright 2004 Mike Hearn
  126. * Copyright 2005 Raphael Junqueira
  127. + * Copyright 2018 Pekka Helenius
  128. *
  129. * This library is free software; you can redistribute it and/or
  130. * modify it under the terms of the GNU Lesser General Public
  131. @@ -218,6 +219,9 @@
  132. #define IDC_ENABLE_EAX 9003
  133. #define IDC_ENABLE_HIDEWINE 9004
  134. #define IDC_ENABLE_GTK3 9005
  135. +#define IDC_DISABLE_GLSL 9006
  136. +#define IDC_MULTISAMPLING 9007
  137. +#define IDC_FLOATCONSTS 9008
  138. /* About tab */
  139. #define IDC_ABT_OWNER 8432
  140. @@ -227,3 +231,7 @@
  141. #define IDC_ABT_TITLE_TEXT 8436
  142. #define IDC_ABT_WEB_LINK 8437
  143. #define IDC_ABT_LICENSE_TEXT 8438
  144. +#define IDC_ABT_ARCH 8439
  145. +#define IDC_ABT_PREFIX 8440
  146. +#define IDC_ABT_ARCH_TITLE 8441
  147. +#define IDC_ABT_PREFIX_TITLE 8442
  148. diff -Burp a/programs/winecfg/staging.c b/programs/winecfg/staging.c
  149. --- a/programs/winecfg/staging.c 2018-04-27 21:52:34.937058231 +0300
  150. +++ b/programs/winecfg/staging.c 2018-04-27 22:43:34.523541838 +0300
  151. @@ -121,6 +121,47 @@ static void gtk3_set(BOOL status)
  152. #endif
  153. }
  154. +static BOOL glsl_get(void)
  155. +{
  156. + BOOL ret;
  157. + char *value = get_reg_key(config_key, keypath("Direct3D"), "UseGLSL", "enabled");
  158. + ret = (value && !strcmp(value, "disabled"));
  159. + HeapFree(GetProcessHeap(), 0, value);
  160. + return ret;
  161. +}
  162. +static void glsl_set(BOOL status)
  163. +{
  164. + set_reg_key(config_key, keypath("Direct3D"), "UseGLSL", status ? "disabled" : "enabled");
  165. +}
  166. +
  167. +static BOOL msampl_get(void)
  168. +{
  169. + BOOL ret;
  170. + char *value = get_reg_key(config_key, keypath("Direct3D"), "Multisampling", "enabled");
  171. + ret = (value && !strcmp(value, "disabled"));
  172. + HeapFree(GetProcessHeap(), 0, value);
  173. + return ret;
  174. +}
  175. +static void msampl_set(BOOL status)
  176. +{
  177. + set_reg_key(config_key, keypath("Direct3D"), "Multisampling", status ? "disabled" : "enabled");
  178. +
  179. +}
  180. +
  181. +static BOOL fconsts_get(void)
  182. +{
  183. + BOOL ret;
  184. + char *value = get_reg_key(config_key, keypath("Direct3D"), "CheckFloatConstants", "disabled");
  185. + ret = (value && !strcmp(value, "enabled"));
  186. + HeapFree(GetProcessHeap(), 0, value);
  187. + return ret;
  188. +}
  189. +static void fconsts_set(BOOL status)
  190. +{
  191. + set_reg_key(config_key, keypath("Direct3D"), "CheckFloatConstants", status ? "enabled" : "disabled");
  192. +
  193. +}
  194. +
  195. static void load_staging_settings(HWND dialog)
  196. {
  197. CheckDlgButton(dialog, IDC_ENABLE_CSMT, csmt_get() ? BST_CHECKED : BST_UNCHECKED);
  198. @@ -128,6 +169,52 @@ static void load_staging_settings(HWND d
  199. CheckDlgButton(dialog, IDC_ENABLE_EAX, eax_get() ? BST_CHECKED : BST_UNCHECKED);
  200. CheckDlgButton(dialog, IDC_ENABLE_HIDEWINE, hidewine_get() ? BST_CHECKED : BST_UNCHECKED);
  201. CheckDlgButton(dialog, IDC_ENABLE_GTK3, gtk3_get() ? BST_CHECKED : BST_UNCHECKED);
  202. + CheckDlgButton(dialog, IDC_DISABLE_GLSL, glsl_get() ? BST_CHECKED : BST_UNCHECKED);
  203. + CheckDlgButton(dialog, IDC_MULTISAMPLING, msampl_get() ? BST_CHECKED : BST_UNCHECKED);
  204. + CheckDlgButton(dialog, IDC_FLOATCONSTS, fconsts_get() ? BST_CHECKED : BST_UNCHECKED);
  205. +
  206. + /* TODO
  207. +
  208. + DirectDrawRenderer (Direct3D) COMBOBOX
  209. + Values [gdi, opengl]
  210. + Default: opengl
  211. + Human-readable equivalents are GDI, OpenGL
  212. + Label: DirectDraw Renderer
  213. +
  214. + MaxVersionGL (Direct3D) COMBOBOX
  215. + Values: [4.5, 3.2, 1.0]
  216. + Equal DWORD values are 40005 30002 10000
  217. + Default: 1.0
  218. + Label: OpenGL Version
  219. +
  220. + OffscreenRenderingMode (Direct3D) COMBOBOX
  221. + Values: [fbo, backbuffer]
  222. + Default: fbo
  223. + Human-readable equivalents are FBO, Backbuffer
  224. + Label: Offscreen Rendering
  225. +
  226. + VideoMemorySize (Direct3D) COMBOBOX
  227. + Values: [8192, 4096, 3072, 2048, 1024, 768, 512, 384, 256, 128, 64, 32]
  228. + Default: Not specified (this registry value doesn't exist)
  229. + Label: Video Memory (MiB)
  230. +
  231. + MouseWarpOverride (DirectInput) COMBOBOX
  232. + Values: [enable, disable, force]
  233. + Default: enable
  234. + Human-readable equivalents are Enable, Disable, Force
  235. + Label: Mouse Warp
  236. +
  237. + ShowCrashDialog (WineDbg)
  238. + yes/no checkbtn
  239. + Default: show dialogs
  240. + Label: Hide Wine crash dialog
  241. +
  242. + ForceRefreshRate (DirectDraw) input value
  243. + Value: User input (only integers allowed, max value is 120, min value is 1)
  244. + Default: Not specified (this registry value doesn't exist)
  245. + Label: DirectDraw Refresh Rate
  246. +
  247. + */
  248. #ifndef HAVE_VAAPI
  249. disable(IDC_ENABLE_VAAPI);
  250. @@ -180,6 +267,18 @@ INT_PTR CALLBACK StagingDlgProc(HWND hDl
  251. gtk3_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_GTK3) == BST_CHECKED);
  252. SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
  253. return TRUE;
  254. + case IDC_DISABLE_GLSL:
  255. + glsl_set(IsDlgButtonChecked(hDlg, IDC_DISABLE_GLSL) == BST_CHECKED);
  256. + SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
  257. + return TRUE;
  258. + case IDC_MULTISAMPLING:
  259. + msampl_set(IsDlgButtonChecked(hDlg, IDC_MULTISAMPLING) == BST_CHECKED);
  260. + SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
  261. + return TRUE;
  262. + case IDC_FLOATCONSTS:
  263. + fconsts_set(IsDlgButtonChecked(hDlg, IDC_FLOATCONSTS) == BST_CHECKED);
  264. + SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
  265. + return TRUE;
  266. }
  267. break;
  268. }
  269. Binary files a/programs/winecfg/staging.o and b/programs/winecfg/staging.o differ
  270. Binary files a/programs/winecfg/theme.o and b/programs/winecfg/theme.o differ
  271. Binary files a/programs/winecfg/winecfg.exe.fake and b/programs/winecfg/winecfg.exe.fake differ
  272. Binary files a/programs/winecfg/winecfg.exe.so and b/programs/winecfg/winecfg.exe.so differ
  273. Binary files a/programs/winecfg/winecfg.o and b/programs/winecfg/winecfg.o differ
  274. diff -Burp a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc
  275. --- a/programs/winecfg/winecfg.rc 2018-04-27 21:52:34.937058231 +0300
  276. +++ b/programs/winecfg/winecfg.rc 2018-04-27 22:30:51.184369822 +0300
  277. @@ -3,6 +3,7 @@
  278. *
  279. * Copyright 2002 Jaco Greeff
  280. * Copyright 2003 Dimitrie O. Paun
  281. + * Copyright 2018 Pekka Helenius
  282. *
  283. * This library is free software; you can redistribute it and/or
  284. * modify it under the terms of the GNU Lesser General Public
  285. @@ -135,11 +136,15 @@ STYLE WS_CHILD
  286. FONT 8, "MS Shell Dlg"
  287. BEGIN
  288. CONTROL "", IDC_ABT_PANEL, "STATIC", SS_OWNERDRAW, 0, 0, 260, 140
  289. - LTEXT "",IDC_ABT_TITLE_TEXT,105,30,55,30
  290. - LTEXT "",IDC_ABT_PANEL_TEXT,160,43,140,8
  291. - CONTROL "",IDC_ABT_WEB_LINK,"SysLink", LWS_TRANSPARENT, 105,53,106,8
  292. + LTEXT "",IDC_ABT_TITLE_TEXT,105,25,55,30
  293. + LTEXT "",IDC_ABT_PANEL_TEXT,160,38,140,8
  294. + LTEXT "", IDC_ABT_ARCH_TITLE, 105, 50, 133, 8
  295. + LTEXT "", IDC_ABT_ARCH, 158, 50, 160, 8
  296. + LTEXT "", IDC_ABT_PREFIX_TITLE, 105, 59, 133, 8
  297. + CONTROL "", IDC_ABT_PREFIX,"SysLink", LWS_TRANSPARENT, 158, 59, 160, 8
  298. + CONTROL "", IDC_ABT_WEB_LINK,"SysLink", LWS_TRANSPARENT, 105,75,106,8
  299. LTEXT "This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.",
  300. - IDC_ABT_LICENSE_TEXT,105,64,145,66
  301. + IDC_ABT_LICENSE_TEXT,105,86,145,50
  302. GROUPBOX "Windows registration information", IDC_STATIC, 15, 155, 230, 55
  303. LTEXT "&Owner:", IDC_STATIC, 22, 171, 40, 20
  304. EDITTEXT IDC_ABT_OWNER, 75, 171, 160, 13, ES_AUTOHSCROLL | WS_TABSTOP
  305. @@ -320,6 +325,9 @@ BEGIN
  306. CONTROL "Enable Environmental Audio E&xtensions (EAX)",IDC_ENABLE_EAX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,70,230,8
  307. CONTROL "&Hide Wine version from applications",IDC_ENABLE_HIDEWINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,85,230,8
  308. CONTROL "Enable &GTK3 Theming",IDC_ENABLE_GTK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,100,230,8
  309. + CONTROL "Disable G&LSL Support",IDC_DISABLE_GLSL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,115,230,8
  310. + CONTROL "Disable &Multisampling Support",IDC_MULTISAMPLING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,130,230,8
  311. + CONTROL "Check &Float Constants in D3D shaders",IDC_FLOATCONSTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,145,230,8
  312. END
  313. LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
  314. Binary files a/programs/winecfg/winecfg.res and b/programs/winecfg/winecfg.res differ
  315. Binary files a/programs/winecfg/x11drvdlg.o and b/programs/winecfg/x11drvdlg.o differ