uxtheme-GTK_Theming: Rework to avoid "DLL redirects".

Instead we have an alternate code path for the appropriate API entry
points in uxtheme.dll.

This is not the best organizational structure. We should probably have
HTHEME handles resolve to an object with its own function table, so
then we have an MSSTYLES backend and a GTK backend and what have
you. It would also be better to avoid having GTK controlled with its
own registry key like this but rather to have it be selectable using
EnumThemes()/ApplyTheme() [presumably through a fake theme file, as
was used in the original implementation], so that we don't have to
have special handling for those functions and everything can just be
part of the HTHEME backend. However, time is currently of the essence,
and this will have to do for the moment.
This commit is contained in:
Zebediah Figura
2019-02-09 16:00:35 -06:00
parent ecc4fe6d6a
commit 3d74da6622
14 changed files with 1990 additions and 2896 deletions

View File

@@ -1,4 +1,4 @@
From 179cacadcf7f5e0fbaff2e61dbf009593e4257e8 Mon Sep 17 00:00:00 2001
From ad78908234abc43ef56b5d005e22abde445f8760 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 9 Aug 2015 18:01:11 +0200
Subject: winecfg: Add option to enable/disable GTK3 theming.
@@ -10,10 +10,10 @@ Subject: winecfg: Add option to enable/disable GTK3 theming.
3 files changed, 31 insertions(+)
diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h
index a1fbc69..b94e773 100644
index f8c2fdf8..96f24290 100644
--- a/programs/winecfg/resource.h
+++ b/programs/winecfg/resource.h
@@ -217,6 +217,7 @@
@@ -218,6 +218,7 @@
#define IDC_ENABLE_VAAPI 9002
#define IDC_ENABLE_EAX 9003
#define IDC_ENABLE_HIDEWINE 9004
@@ -22,7 +22,7 @@ index a1fbc69..b94e773 100644
/* About tab */
#define IDC_ABT_OWNER 8432
diff --git a/programs/winecfg/staging.c b/programs/winecfg/staging.c
index c908d24..5a978d6 100644
index 2e305a2c..b573db71 100644
--- a/programs/winecfg/staging.c
+++ b/programs/winecfg/staging.c
@@ -99,6 +99,27 @@ static void hidewine_set(BOOL status)
@@ -36,8 +36,8 @@ index c908d24..5a978d6 100644
+{
+#ifdef HAVE_GTK3
+ BOOL ret;
+ char *value = get_reg_key(config_key, keypath("DllRedirects"), "uxtheme", NULL);
+ ret = (value && !strcmp(value, "uxtheme-gtk.dll"));
+ char *value = get_reg_key(config_key, keypath(""), "ThemeEngine", NULL);
+ ret = (value && !strcasecmp(value, "GTK"));
+ HeapFree(GetProcessHeap(), 0, value);
+ return ret;
+#else
@@ -47,7 +47,7 @@ index c908d24..5a978d6 100644
+static void gtk3_set(BOOL status)
+{
+#ifdef HAVE_GTK3
+ set_reg_key(config_key, keypath("DllRedirects"), "uxtheme", status ? "uxtheme-gtk.dll" : NULL);
+ set_reg_key(config_key, keypath(""), "ThemeEngine", status ? "GTK" : NULL);
+#endif
+}
@@ -80,10 +80,10 @@ index c908d24..5a978d6 100644
break;
}
diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc
index ce7261b..f838a04 100644
index 469ae101..33f2642e 100644
--- a/programs/winecfg/winecfg.rc
+++ b/programs/winecfg/winecfg.rc
@@ -319,6 +319,7 @@ BEGIN
@@ -323,6 +323,7 @@ BEGIN
CONTROL "Enable &VAAPI as backend for DXVA2 GPU decoding",IDC_ENABLE_VAAPI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,55,230,8
CONTROL "Enable Environmental Audio E&xtensions (EAX)",IDC_ENABLE_EAX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,70,230,8
CONTROL "&Hide Wine version from applications",IDC_ENABLE_HIDEWINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,85,230,8
@@ -92,5 +92,5 @@ index ce7261b..f838a04 100644
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
--
2.7.4
2.20.1