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

@ -1837,13 +1837,6 @@ if test "$enable_windowscodecs_TIFF_Support" -eq 1; then
enable_windowscodecs_GIF_Encoder=1
fi
if test "$enable_uxtheme_GTK_Theming" -eq 1; then
if test "$enable_ntdll_DllRedirects" -gt 1; then
abort "Patchset ntdll-DllRedirects disabled, but uxtheme-GTK_Theming depends on that."
fi
enable_ntdll_DllRedirects=1
fi
if test "$enable_user32_GetPointerType" -eq 1; then
if test "$enable_user32_Mouse_Message_Hwnd" -gt 1; then
abort "Patchset user32-Mouse_Message_Hwnd disabled, but user32-GetPointerType depends on that."
@ -6651,38 +6644,23 @@ fi
# Patchset uxtheme-GTK_Theming
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * wow64cpu-Wow64Transition, ntdll-DllRedirects
# |
# | Modified files:
# | * aclocal.m4, configure.ac, dlls/uxtheme-gtk/Makefile.in, dlls/uxtheme-gtk/buffer.c, dlls/uxtheme-gtk/button.c, dlls
# | /uxtheme-gtk/combobox.c, dlls/uxtheme-gtk/edit.c, dlls/uxtheme-gtk/header.c, dlls/uxtheme-gtk/listbox.c, dlls/uxtheme-
# | gtk/listview.c, dlls/uxtheme-gtk/menu.c, dlls/uxtheme-gtk/rebar.c, dlls/uxtheme-gtk/status.c, dlls/uxtheme-gtk/tab.c,
# | dlls/uxtheme-gtk/toolbar.c, dlls/uxtheme-gtk/trackbar.c, dlls/uxtheme-gtk/uxtheme-gtk.spec, dlls/uxtheme-gtk/uxtheme.c,
# | dlls/uxtheme-gtk/uxthemegtk.h, dlls/uxtheme-gtk/version.rc, dlls/uxtheme-gtk/window.c
# | * aclocal.m4, configure.ac, dlls/uxtheme/Makefile.in, dlls/uxtheme/draw.c, dlls/uxtheme/gtk-button.c, dlls/uxtheme/gtk-
# | combobox.c, dlls/uxtheme/gtk-edit.c, dlls/uxtheme/gtk-header.c, dlls/uxtheme/gtk-listbox.c, dlls/uxtheme/gtk-listview.c,
# | dlls/uxtheme/gtk-menu.c, dlls/uxtheme/gtk-rebar.c, dlls/uxtheme/gtk-status.c, dlls/uxtheme/gtk-tab.c, dlls/uxtheme/gtk-
# | toolbar.c, dlls/uxtheme/gtk-trackbar.c, dlls/uxtheme/gtk-window.c, dlls/uxtheme/gtk.c, dlls/uxtheme/metric.c,
# | dlls/uxtheme/property.c, dlls/uxtheme/system.c, dlls/uxtheme/uxthemedll.h, dlls/uxtheme/uxthemegtk.h
# |
if test "$enable_uxtheme_GTK_Theming" -eq 1; then
patch_apply uxtheme-GTK_Theming/0001-uxthemegtk-Add-configure-check-and-stub-dll.patch
patch_apply uxtheme-GTK_Theming/0002-uxthemegtk-Initial-implementation.patch
patch_apply uxtheme-GTK_Theming/0003-uxthemegtk-Implement-enumeration-of-themes-color-and.patch
patch_apply uxtheme-GTK_Theming/0004-uxthemegtk-Correctly-render-buttons-with-GTK-3.14.0.patch
patch_apply uxtheme-GTK_Theming/0005-uxthemegtk-Print-class-name-before-calling-vtable-fu.patch
patch_apply uxtheme-GTK_Theming/0006-uxthemegtk-Reset-FPU-flags-before-calling-GTK3-funct.patch
patch_apply uxtheme-GTK_Theming/0007-uxthemegtk-Add-export-for-OpenThemeDataEx.patch
patch_apply uxtheme-GTK_Theming/0008-uxthemegtk-Fix-some-incorrect-error-codes.patch
patch_apply uxtheme-GTK_Theming/0009-uxthemegtk-Validate-theme-handles-before-accessing-p.patch
patch_apply uxtheme-GTK_Theming/0010-Add-buffering-functions.patch
patch_apply uxtheme-GTK_Theming/0001-uxtheme-Initial-implementation-of-GTK-backend.patch
patch_apply uxtheme-GTK_Theming/0003-uxtheme-Correctly-render-buttons-with-GTK-3.14.0.patch
patch_apply uxtheme-GTK_Theming/0004-uxtheme-Reset-FPU-flags-before-calling-GTK3-function.patch
patch_apply uxtheme-GTK_Theming/0005-uxtheme-Fix-some-incorrect-error-codes.patch
(
printf '%s\n' '+ { "Michael Müller", "uxthemegtk: Add configure check and stub dll.", 1 },';
printf '%s\n' '+ { "Ivan Akulinchev", "uxthemegtk: Initial implementation.", 1 },';
printf '%s\n' '+ { "Michael Müller", "uxthemegtk: Implement enumeration of themes, color and sizes.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "uxthemegtk: Correctly render buttons with GTK >= 3.14.0.", 1 },';
printf '%s\n' '+ { "Michael Müller", "uxthemegtk: Print class name before calling vtable functions.", 1 },';
printf '%s\n' '+ { "Michael Müller", "uxthemegtk: Reset FPU flags before calling GTK3 functions.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "uxthemegtk: Add export for OpenThemeDataEx.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "uxthemegtk: Fix some incorrect error codes.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "uxthemegtk: Validate theme handles before accessing private data.", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Add buffering functions.", 1 },';
printf '%s\n' '+ { "Ivan Akulinchev", "uxtheme: Initial implementation of GTK backend.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "uxtheme: Correctly render buttons with GTK >= 3.14.0.", 1 },';
printf '%s\n' '+ { "Michael Müller", "uxtheme: Reset FPU flags before calling GTK3 functions.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "uxtheme: Fix some incorrect error codes.", 1 },';
) >> "$patchlist"
fi

View File

@ -1,467 +0,0 @@
From 198cd3cdddaa7ad98d897444877becfe7a591910 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 9 Aug 2015 02:38:18 +0200
Subject: [PATCH] uxthemegtk: Add configure check and stub dll.
List of functions updated by Ivan Akulinchev <ivan.akulinchev@gmail.com>.
---
aclocal.m4 | 20 ++++
configure.ac | 22 ++++
dlls/uxtheme-gtk/Makefile.in | 7 ++
dlls/uxtheme-gtk/uxtheme-gtk.spec | 1 +
dlls/uxtheme-gtk/uxtheme.c | 218 ++++++++++++++++++++++++++++++++++++++
dlls/uxtheme-gtk/uxthemegtk.h | 88 +++++++++++++++
dlls/uxtheme-gtk/version.rc | 21 ++++
7 files changed, 377 insertions(+)
create mode 100644 dlls/uxtheme-gtk/Makefile.in
create mode 100644 dlls/uxtheme-gtk/uxtheme-gtk.spec
create mode 100644 dlls/uxtheme-gtk/uxtheme.c
create mode 100644 dlls/uxtheme-gtk/uxthemegtk.h
create mode 100644 dlls/uxtheme-gtk/version.rc
diff --git a/aclocal.m4 b/aclocal.m4
index 6ad8363..54e2ccd 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -125,6 +125,26 @@ test -z "$ac_libs" || ac_libs=`echo " $ac_libs" | sed 's/ -L\([[^/]]\)/ -L\$(top
AS_VAR_POPDEF([ac_libs])dnl
AS_VAR_POPDEF([ac_cflags])])dnl
+dnl **** Get include path from pkg-config ****
+dnl
+dnl Usage: WINE_PACKAGE_INCLUDE_FLAGS(var,pkg-name,[cflags-alternate,[checks]]])
+dnl
+AC_DEFUN([WINE_PACKAGE_INCLUDE_FLAGS],
+[AC_REQUIRE([WINE_PATH_PKG_CONFIG])dnl
+AS_VAR_PUSHDEF([ac_cflags],[[$1]_CFLAGS])dnl
+AC_ARG_VAR(ac_cflags, [C compiler flags for $2, overriding pkg-config])dnl
+AS_VAR_IF([ac_cflags],[],
+ [AS_VAR_SET_IF([PKG_CONFIG],
+ [ac_cflags=`$PKG_CONFIG --cflags-only-I [$2] 2>/dev/null`])])
+m4_ifval([$3],[test "$cross_compiling" = yes || ac_cflags=[$]{ac_cflags:-[$3]}])
+AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 cflags: $ac_cflags"]) >&AS_MESSAGE_LOG_FD
+ac_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $ac_cflags"
+$4
+CPPFLAGS=$ac_save_CPPFLAGS
+test -z "$ac_cflags" || ac_cflags=`echo " $ac_cflags" | sed 's/ -I\([[^/]]\)/ -I\$(top_builddir)\/\1/g'`
+AS_VAR_POPDEF([ac_cflags])])dnl
+
dnl **** Link C code with an assembly file ****
dnl
dnl Usage: WINE_TRY_ASM_LINK(asm-code,includes,function,[action-if-found,[action-if-not-found]])
diff --git a/configure.ac b/configure.ac
index 40f96df..a45d5b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,6 +56,7 @@ AC_ARG_WITH(gsm, AS_HELP_STRING([--without-gsm],[do not use libgsm (GSM 06
[if test "x$withval" = "xno"; then ac_cv_header_gsm_h=no; ac_cv_header_gsm_gsm_h=no; fi])
AC_ARG_WITH(gssapi, AS_HELP_STRING([--without-gssapi],[do not use GSSAPI (Kerberos SSP support)]))
AC_ARG_WITH(gstreamer, AS_HELP_STRING([--without-gstreamer],[do not use GStreamer (codecs support)]))
+AC_ARG_WITH(gtk3, AS_HELP_STRING([--without-gtk3],[do not use gtk3 (gtk3 theming support)]))
AC_ARG_WITH(hal, AS_HELP_STRING([--without-hal],[do not use HAL (dynamic device support)]))
AC_ARG_WITH(jpeg, AS_HELP_STRING([--without-jpeg],[do not use JPEG]))
AC_ARG_WITH(krb5, AS_HELP_STRING([--without-krb5],[do not use krb5 (Kerberos)]))
@@ -1491,6 +1492,26 @@ fi
WINE_NOTICE_WITH(cms,[test "$ac_cv_lib_lcms2_cmsOpenProfileFromFile" != "yes"],
[liblcms2 ${notice_platform}development files not found, Color Management won't be supported.])
+dnl **** Check for GTK3 ****
+if test "x$with_gtk3" != "xno";
+then
+ WINE_PACKAGE_INCLUDE_FLAGS(GTK3, [gtk+-3.0],,
+ [AC_CHECK_HEADERS([gtk/gtk.h])
+ if test "$ac_cv_header_gtk_gtk_h" = "yes"
+ then
+ WINE_CHECK_SONAME(gobject-2.0,g_object_unref,
+ [WINE_CHECK_SONAME(cairo,cairo_destroy,
+ [WINE_CHECK_SONAME(gtk-3,gtk_style_context_save,
+ [AC_DEFINE(HAVE_GTK3, 1, [Define if GTK 3 is installed])])])])
+ test "x$ac_cv_lib_soname_gtk_3" != "x" || GTK3_CFLAGS=""
+ else
+ GTK3_CFLAGS=""
+ fi])
+fi
+WINE_NOTICE_WITH(gtk3,[test "x$ac_cv_lib_soname_gtk_3" = x],
+ [GTK3 ${notice_platform}development files not found, GTK themes won't be supported.])
+test "x$ac_cv_lib_soname_gtk_3" != "x" || enable_uxtheme_gtk=${enable_uxtheme_gtk:-no}
+
dnl **** Check for FreeType 2 ****
if test "x$with_freetype" != "xno"
then
@@ -3731,6 +3752,7 @@ WINE_CONFIG_MAKEFILE(dlls/usp10/tests)
WINE_CONFIG_MAKEFILE(dlls/uuid)
WINE_CONFIG_MAKEFILE(dlls/uxtheme)
WINE_CONFIG_MAKEFILE(dlls/uxtheme/tests)
+WINE_CONFIG_MAKEFILE(dlls/uxtheme-gtk)
WINE_CONFIG_MAKEFILE(dlls/vbscript)
WINE_CONFIG_MAKEFILE(dlls/vbscript/tests)
WINE_CONFIG_MAKEFILE(dlls/vcomp)
diff --git a/dlls/uxtheme-gtk/Makefile.in b/dlls/uxtheme-gtk/Makefile.in
new file mode 100644
index 0000000..07cf3a0f
--- /dev/null
+++ b/dlls/uxtheme-gtk/Makefile.in
@@ -0,0 +1,7 @@
+MODULE = uxtheme-gtk.dll
+EXTRAINCL = $(GTK3_CFLAGS)
+
+C_SRCS = \
+ uxtheme.c
+
+RC_SRCS = version.rc
diff --git a/dlls/uxtheme-gtk/uxtheme-gtk.spec b/dlls/uxtheme-gtk/uxtheme-gtk.spec
new file mode 100644
index 0000000..b7db254
--- /dev/null
+++ b/dlls/uxtheme-gtk/uxtheme-gtk.spec
@@ -0,0 +1 @@
+# Empty
diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c
new file mode 100644
index 0000000..cd5e3c0
--- /dev/null
+++ b/dlls/uxtheme-gtk/uxtheme.c
@@ -0,0 +1,218 @@
+/*
+ * GTK uxtheme implementation
+ *
+ * Copyright (C) 2015 Michael Müller
+ *
+ * This library 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.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+#include "wine/port.h"
+#include "wine/library.h"
+
+#include "wine/debug.h"
+#include "uxthemegtk.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(uxthemegtk);
+
+static void *libgtk3 = NULL;
+static void *libcairo = NULL;
+static void *libgobject2 = NULL;
+
+#define MAKE_FUNCPTR(f) typeof(f) * p##f = NULL
+MAKE_FUNCPTR(cairo_create);
+MAKE_FUNCPTR(cairo_destroy);
+MAKE_FUNCPTR(cairo_image_surface_create);
+MAKE_FUNCPTR(cairo_image_surface_get_data);
+MAKE_FUNCPTR(cairo_image_surface_get_stride);
+MAKE_FUNCPTR(cairo_surface_destroy);
+MAKE_FUNCPTR(cairo_surface_flush);
+MAKE_FUNCPTR(g_type_check_instance_is_a);
+MAKE_FUNCPTR(gtk_bin_get_child);
+MAKE_FUNCPTR(gtk_button_new);
+MAKE_FUNCPTR(gtk_check_button_new);
+MAKE_FUNCPTR(gtk_combo_box_new_with_entry);
+MAKE_FUNCPTR(gtk_container_add);
+MAKE_FUNCPTR(gtk_container_forall);
+MAKE_FUNCPTR(gtk_entry_new);
+MAKE_FUNCPTR(gtk_fixed_new);
+MAKE_FUNCPTR(gtk_frame_new);
+MAKE_FUNCPTR(gtk_init);
+MAKE_FUNCPTR(gtk_label_new);
+MAKE_FUNCPTR(gtk_menu_bar_new);
+MAKE_FUNCPTR(gtk_menu_item_new);
+MAKE_FUNCPTR(gtk_menu_item_set_submenu);
+MAKE_FUNCPTR(gtk_menu_new);
+MAKE_FUNCPTR(gtk_menu_shell_append);
+MAKE_FUNCPTR(gtk_notebook_new);
+MAKE_FUNCPTR(gtk_radio_button_new);
+MAKE_FUNCPTR(gtk_render_arrow);
+MAKE_FUNCPTR(gtk_render_background);
+MAKE_FUNCPTR(gtk_render_check);
+MAKE_FUNCPTR(gtk_render_frame);
+MAKE_FUNCPTR(gtk_render_handle);
+MAKE_FUNCPTR(gtk_render_line);
+MAKE_FUNCPTR(gtk_render_option);
+MAKE_FUNCPTR(gtk_render_slider);
+MAKE_FUNCPTR(gtk_scale_new);
+MAKE_FUNCPTR(gtk_scrolled_window_new);
+MAKE_FUNCPTR(gtk_separator_tool_item_new);
+MAKE_FUNCPTR(gtk_style_context_add_class);
+MAKE_FUNCPTR(gtk_style_context_add_region);
+MAKE_FUNCPTR(gtk_style_context_get_background_color);
+MAKE_FUNCPTR(gtk_style_context_get_border_color);
+MAKE_FUNCPTR(gtk_style_context_get_color);
+MAKE_FUNCPTR(gtk_style_context_remove_class);
+MAKE_FUNCPTR(gtk_style_context_restore);
+MAKE_FUNCPTR(gtk_style_context_save);
+MAKE_FUNCPTR(gtk_style_context_set_junction_sides);
+MAKE_FUNCPTR(gtk_style_context_set_state);
+MAKE_FUNCPTR(gtk_toggle_button_get_type);
+MAKE_FUNCPTR(gtk_toolbar_new);
+MAKE_FUNCPTR(gtk_tree_view_append_column);
+MAKE_FUNCPTR(gtk_tree_view_column_get_button);
+MAKE_FUNCPTR(gtk_tree_view_column_new);
+MAKE_FUNCPTR(gtk_tree_view_get_column);
+MAKE_FUNCPTR(gtk_tree_view_new);
+MAKE_FUNCPTR(gtk_widget_destroy);
+MAKE_FUNCPTR(gtk_widget_get_style_context);
+MAKE_FUNCPTR(gtk_widget_style_get);
+MAKE_FUNCPTR(gtk_window_new);
+#undef MAKE_FUNCPTR
+
+static void free_gtk3_libs(void)
+{
+ if (libgtk3) wine_dlclose(libgtk3, NULL, 0);
+ if (libcairo) wine_dlclose(libcairo, NULL, 0);
+ if (libgobject2) wine_dlclose(libgobject2, NULL, 0);
+ libgtk3 = libcairo = libgobject2 = NULL;
+}
+
+#define LOAD_FUNCPTR(lib, f) \
+ if(!(p##f = wine_dlsym(lib, #f, NULL, 0))) \
+ { \
+ WARN("Can't find symbol %s.\n", #f); \
+ goto error; \
+ }
+
+static BOOL load_gtk3_libs(void)
+{
+ libgtk3 = wine_dlopen(SONAME_LIBGTK_3, RTLD_NOW, NULL, 0);
+ if (!libgtk3)
+ {
+ FIXME("Wine cannot find the %s library.\n", SONAME_LIBGTK_3);
+ goto error;
+ }
+
+ LOAD_FUNCPTR(libgtk3, gtk_bin_get_child)
+ LOAD_FUNCPTR(libgtk3, gtk_button_new)
+ LOAD_FUNCPTR(libgtk3, gtk_check_button_new)
+ LOAD_FUNCPTR(libgtk3, gtk_combo_box_new_with_entry)
+ LOAD_FUNCPTR(libgtk3, gtk_container_add)
+ LOAD_FUNCPTR(libgtk3, gtk_container_forall)
+ LOAD_FUNCPTR(libgtk3, gtk_entry_new)
+ LOAD_FUNCPTR(libgtk3, gtk_fixed_new)
+ LOAD_FUNCPTR(libgtk3, gtk_frame_new)
+ LOAD_FUNCPTR(libgtk3, gtk_init)
+ LOAD_FUNCPTR(libgtk3, gtk_label_new)
+ LOAD_FUNCPTR(libgtk3, gtk_menu_bar_new)
+ LOAD_FUNCPTR(libgtk3, gtk_menu_item_new)
+ LOAD_FUNCPTR(libgtk3, gtk_menu_item_set_submenu)
+ LOAD_FUNCPTR(libgtk3, gtk_menu_new)
+ LOAD_FUNCPTR(libgtk3, gtk_menu_shell_append)
+ LOAD_FUNCPTR(libgtk3, gtk_notebook_new)
+ LOAD_FUNCPTR(libgtk3, gtk_radio_button_new)
+ LOAD_FUNCPTR(libgtk3, gtk_render_arrow)
+ LOAD_FUNCPTR(libgtk3, gtk_render_background)
+ LOAD_FUNCPTR(libgtk3, gtk_render_check)
+ LOAD_FUNCPTR(libgtk3, gtk_render_frame)
+ LOAD_FUNCPTR(libgtk3, gtk_render_handle)
+ LOAD_FUNCPTR(libgtk3, gtk_render_line)
+ LOAD_FUNCPTR(libgtk3, gtk_render_option)
+ LOAD_FUNCPTR(libgtk3, gtk_render_slider)
+ LOAD_FUNCPTR(libgtk3, gtk_scale_new)
+ LOAD_FUNCPTR(libgtk3, gtk_scrolled_window_new)
+ LOAD_FUNCPTR(libgtk3, gtk_separator_tool_item_new)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_add_class)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_add_region)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_get_background_color)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_get_border_color)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_get_color)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_remove_class)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_restore)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_save)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_set_junction_sides)
+ LOAD_FUNCPTR(libgtk3, gtk_style_context_set_state)
+ LOAD_FUNCPTR(libgtk3, gtk_toggle_button_get_type)
+ LOAD_FUNCPTR(libgtk3, gtk_toolbar_new)
+ LOAD_FUNCPTR(libgtk3, gtk_tree_view_append_column)
+ LOAD_FUNCPTR(libgtk3, gtk_tree_view_column_get_button)
+ LOAD_FUNCPTR(libgtk3, gtk_tree_view_column_new)
+ LOAD_FUNCPTR(libgtk3, gtk_tree_view_get_column)
+ LOAD_FUNCPTR(libgtk3, gtk_tree_view_new)
+ LOAD_FUNCPTR(libgtk3, gtk_widget_destroy)
+ LOAD_FUNCPTR(libgtk3, gtk_widget_get_style_context)
+ LOAD_FUNCPTR(libgtk3, gtk_widget_style_get)
+ LOAD_FUNCPTR(libgtk3, gtk_window_new)
+
+ libcairo = wine_dlopen(SONAME_LIBCAIRO, RTLD_NOW, NULL, 0);
+ if (!libcairo)
+ {
+ FIXME("Wine cannot find the %s library.\n", SONAME_LIBCAIRO);
+ goto error;
+ }
+
+ LOAD_FUNCPTR(libcairo, cairo_create)
+ LOAD_FUNCPTR(libcairo, cairo_destroy)
+ LOAD_FUNCPTR(libcairo, cairo_image_surface_create)
+ LOAD_FUNCPTR(libcairo, cairo_image_surface_get_data)
+ LOAD_FUNCPTR(libcairo, cairo_image_surface_get_stride)
+ LOAD_FUNCPTR(libcairo, cairo_surface_destroy)
+ LOAD_FUNCPTR(libcairo, cairo_surface_flush)
+
+ libgobject2 = wine_dlopen(SONAME_LIBGOBJECT_2_0, RTLD_NOW, NULL, 0);
+ if (!libgobject2)
+ {
+ FIXME("Wine cannot find the %s library.\n", SONAME_LIBGOBJECT_2_0);
+ goto error;
+ }
+
+ LOAD_FUNCPTR(libgobject2, g_type_check_instance_is_a)
+ return TRUE;
+
+error:
+ free_gtk3_libs();
+ return FALSE;
+}
+
+BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
+{
+ TRACE("(%p, %d, %p)\n", instance, reason, reserved);
+
+ switch (reason)
+ {
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(instance);
+ if (!load_gtk3_libs()) return FALSE;
+ break;
+
+ case DLL_PROCESS_DETACH:
+ if (reserved) break;
+ free_gtk3_libs();
+ break;
+ }
+
+ return TRUE;
+}
diff --git a/dlls/uxtheme-gtk/uxthemegtk.h b/dlls/uxtheme-gtk/uxthemegtk.h
new file mode 100644
index 0000000..42e4784
--- /dev/null
+++ b/dlls/uxtheme-gtk/uxthemegtk.h
@@ -0,0 +1,88 @@
+/*
+ * GTK uxtheme implementation
+ *
+ * Copyright (C) 2015 Michael Müller
+ *
+ * This library 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.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef UXTHEMEGTK_H
+#define UXTHEMEGTK_H
+
+#define GDK_DISABLE_DEPRECATION_WARNINGS
+#include <gtk/gtk.h>
+
+#define MAKE_FUNCPTR(f) extern typeof(f) * p##f DECLSPEC_HIDDEN
+MAKE_FUNCPTR(cairo_create);
+MAKE_FUNCPTR(cairo_destroy);
+MAKE_FUNCPTR(cairo_image_surface_create);
+MAKE_FUNCPTR(cairo_image_surface_get_data);
+MAKE_FUNCPTR(cairo_image_surface_get_stride);
+MAKE_FUNCPTR(cairo_surface_destroy);
+MAKE_FUNCPTR(cairo_surface_flush);
+MAKE_FUNCPTR(g_type_check_instance_is_a);
+MAKE_FUNCPTR(gtk_bin_get_child);
+MAKE_FUNCPTR(gtk_button_new);
+MAKE_FUNCPTR(gtk_check_button_new);
+MAKE_FUNCPTR(gtk_combo_box_new_with_entry);
+MAKE_FUNCPTR(gtk_container_add);
+MAKE_FUNCPTR(gtk_container_forall);
+MAKE_FUNCPTR(gtk_entry_new);
+MAKE_FUNCPTR(gtk_fixed_new);
+MAKE_FUNCPTR(gtk_frame_new);
+MAKE_FUNCPTR(gtk_init);
+MAKE_FUNCPTR(gtk_label_new);
+MAKE_FUNCPTR(gtk_menu_bar_new);
+MAKE_FUNCPTR(gtk_menu_item_new);
+MAKE_FUNCPTR(gtk_menu_item_set_submenu);
+MAKE_FUNCPTR(gtk_menu_new);
+MAKE_FUNCPTR(gtk_menu_shell_append);
+MAKE_FUNCPTR(gtk_notebook_new);
+MAKE_FUNCPTR(gtk_radio_button_new);
+MAKE_FUNCPTR(gtk_render_arrow);
+MAKE_FUNCPTR(gtk_render_background);
+MAKE_FUNCPTR(gtk_render_check);
+MAKE_FUNCPTR(gtk_render_frame);
+MAKE_FUNCPTR(gtk_render_handle);
+MAKE_FUNCPTR(gtk_render_line);
+MAKE_FUNCPTR(gtk_render_option);
+MAKE_FUNCPTR(gtk_render_slider);
+MAKE_FUNCPTR(gtk_scale_new);
+MAKE_FUNCPTR(gtk_scrolled_window_new);
+MAKE_FUNCPTR(gtk_separator_tool_item_new);
+MAKE_FUNCPTR(gtk_style_context_add_class);
+MAKE_FUNCPTR(gtk_style_context_add_region);
+MAKE_FUNCPTR(gtk_style_context_get_background_color);
+MAKE_FUNCPTR(gtk_style_context_get_border_color);
+MAKE_FUNCPTR(gtk_style_context_get_color);
+MAKE_FUNCPTR(gtk_style_context_remove_class);
+MAKE_FUNCPTR(gtk_style_context_restore);
+MAKE_FUNCPTR(gtk_style_context_save);
+MAKE_FUNCPTR(gtk_style_context_set_junction_sides);
+MAKE_FUNCPTR(gtk_style_context_set_state);
+MAKE_FUNCPTR(gtk_toggle_button_get_type);
+MAKE_FUNCPTR(gtk_toolbar_new);
+MAKE_FUNCPTR(gtk_tree_view_append_column);
+MAKE_FUNCPTR(gtk_tree_view_column_get_button);
+MAKE_FUNCPTR(gtk_tree_view_column_new);
+MAKE_FUNCPTR(gtk_tree_view_get_column);
+MAKE_FUNCPTR(gtk_tree_view_new);
+MAKE_FUNCPTR(gtk_widget_destroy);
+MAKE_FUNCPTR(gtk_widget_get_style_context);
+MAKE_FUNCPTR(gtk_widget_style_get);
+MAKE_FUNCPTR(gtk_window_new);
+#undef MAKE_FUNCPTR
+
+#endif /* UXTHEMEGTK_H */
diff --git a/dlls/uxtheme-gtk/version.rc b/dlls/uxtheme-gtk/version.rc
new file mode 100644
index 0000000..38db521
--- /dev/null
+++ b/dlls/uxtheme-gtk/version.rc
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2015 Michael Müller
+ *
+ * This library 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.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define WINE_FILENAME_STR "uxtheme.dll"
+
+#include <wine/wine_common_ver.rc>
--
1.9.1

View File

@ -1,16 +1,16 @@
From 372cc1308fcae0aef6ba85e0a1944f2c939dd732 Mon Sep 17 00:00:00 2001
From 51b2d3854db6bb754a349ba6982fb3645ed14dc8 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 9 Aug 2015 21:09:50 +0200
Subject: uxthemegtk: Correctly render buttons with GTK >= 3.14.0.
Subject: [PATCH 3/5] uxtheme: Correctly render buttons with GTK >= 3.14.0.
---
dlls/uxtheme-gtk/button.c | 14 +++++++++-----
dlls/uxtheme/gtk-button.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/uxtheme-gtk/button.c b/dlls/uxtheme-gtk/button.c
index b4b2d02..b867448 100644
--- a/dlls/uxtheme-gtk/button.c
+++ b/dlls/uxtheme-gtk/button.c
diff --git a/dlls/uxtheme/gtk-button.c b/dlls/uxtheme/gtk-button.c
index b4b2d023..b8674480 100644
--- a/dlls/uxtheme/gtk-button.c
+++ b/dlls/uxtheme/gtk-button.c
@@ -29,6 +29,10 @@
#include "wine/debug.h"
@ -53,5 +53,5 @@ index b4b2d02..b867448 100644
case CBS_MIXEDDISABLED:
return GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_INCONSISTENT;
--
2.1.0
2.20.1

View File

@ -1,308 +0,0 @@
From 2cf0168c9587f0b836a252f6cda65975d5d3cac1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 9 Aug 2015 04:31:32 +0200
Subject: uxthemegtk: Implement enumeration of themes, color and sizes.
Various style improvements by Ivan Akulinchev <ivan.akulinchev@gmail.com>.
---
dlls/uxtheme-gtk/Makefile.in | 2 +-
dlls/uxtheme-gtk/uxtheme-gtk.spec | 44 +++++++++
dlls/uxtheme-gtk/uxtheme.c | 181 +++++++++++++++++++++++++++++++++++++-
3 files changed, 224 insertions(+), 3 deletions(-)
diff --git a/dlls/uxtheme-gtk/Makefile.in b/dlls/uxtheme-gtk/Makefile.in
index 8cefd51..d1e79fd 100644
--- a/dlls/uxtheme-gtk/Makefile.in
+++ b/dlls/uxtheme-gtk/Makefile.in
@@ -1,5 +1,5 @@
MODULE = uxtheme-gtk.dll
-IMPORTS = user32 gdi32 advapi32
+IMPORTS = user32 gdi32 advapi32 shell32
DELAYIMPORTS = msimg32
EXTRAINCL = $(GTK3_CFLAGS)
diff --git a/dlls/uxtheme-gtk/uxtheme-gtk.spec b/dlls/uxtheme-gtk/uxtheme-gtk.spec
index 70cd7ff..4acc0fa 100644
--- a/dlls/uxtheme-gtk/uxtheme-gtk.spec
+++ b/dlls/uxtheme-gtk/uxtheme-gtk.spec
@@ -1,3 +1,47 @@
+# Export by Ordinal
+1 stdcall -noname QueryThemeServices()
+2 stdcall -noname OpenThemeFile(wstr wstr wstr ptr long)
+3 stdcall -noname CloseThemeFile(ptr)
+4 stdcall -noname ApplyTheme(ptr ptr ptr)
+7 stdcall -noname GetThemeDefaults(wstr wstr long wstr long)
+8 stdcall -noname EnumThemes(wstr ptr ptr)
+9 stdcall -noname EnumThemeColors(wstr wstr long ptr)
+10 stdcall -noname EnumThemeSizes(wstr wstr long ptr)
+11 stdcall -noname ParseThemeIniFile(wstr wstr ptr ptr)
+13 stub -noname DrawNCPreview
+14 stub -noname RegisterDefaultTheme
+15 stub -noname DumpLoadedThemeToTextFile
+16 stub -noname OpenThemeDataFromFile
+17 stub -noname OpenThemeFileFromData
+18 stub -noname GetThemeSysSize96
+19 stub -noname GetThemeSysFont96
+20 stub -noname SessionAllocate
+21 stub -noname SessionFree
+22 stub -noname ThemeHooksOn
+23 stub -noname ThemeHooksOff
+24 stub -noname AreThemeHooksActive
+25 stub -noname GetCurrentChangeNumber
+26 stub -noname GetNewChangeNumber
+27 stub -noname SetGlobalTheme
+28 stub -noname GetGlobalTheme
+29 stub -noname CheckThemeSignature(wstr)
+30 stub -noname LoadTheme
+31 stub -noname InitUserTheme
+32 stub -noname InitUserRegistry
+33 stub -noname ReestablishServerConnection
+34 stub -noname ThemeHooksInstall
+35 stub -noname ThemeHooksRemove
+36 stub -noname RefreshThemeForTS
+43 stub -noname ClassicGetSystemMetrics
+44 stub -noname ClassicSystemParametersInfoA
+45 stub -noname ClassicSystemParametersInfoW
+46 stub -noname ClassicAdjustWindowRectEx
+48 stub -noname GetThemeParseErrorInfo
+60 stub -noname CreateThemeDataFromObjects
+61 stub OpenThemeDataEx
+62 stub -noname ServerClearStockObjects
+63 stub -noname MarkSelection
+
# System
@ stdcall CloseThemeData(ptr)
@ stdcall EnableThemeDialogTexture(ptr long)
diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c
index 22285df..0050036 100644
--- a/dlls/uxtheme-gtk/uxtheme.c
+++ b/dlls/uxtheme-gtk/uxtheme.c
@@ -33,6 +33,8 @@
#include "uxtheme.h"
#include "vsstyle.h"
#include "vssym32.h"
+#include "vfwmsgs.h"
+#include "shlobj.h"
#include "wine/debug.h"
@@ -131,7 +133,11 @@ MAKE_FUNCPTR(gtk_window_new);
#define MENU_HEIGHT 20
#define CLASSLIST_MAXLEN 128
-static const WCHAR THEME_PROPERTY[] = {'u','x','g','t','k','_','t','h','e','m','e',0};
+static const WCHAR THEME_PROPERTY[] = {'u','x','g','t','k','_','t','h','e','m','e',0};
+static const WCHAR FAKE_THEME_NAME[] = {'G','T','K','-','3',0};
+static const WCHAR FAKE_THEME_COLOR[] = {'D','e','f','a','u','l','t',' ','C','o','l','o','r',0};
+static const WCHAR FAKE_THEME_SIZE[] = {'D','e','f','a','u','l','t',' ','S','i','z','e',0};
+static WCHAR fake_msstyles_file[MAX_PATH];
static void free_gtk3_libs(void)
{
@@ -240,9 +246,12 @@ error:
static void process_attach(void)
{
+ static const WCHAR themes_subdir[] = {'\\','T','h','e','m','e','s','\\', 'g','t','k','3',0};
+ static const WCHAR style_file[] = {'\\','g','t','k','3','.','m','s','s','t','y','l','e','s',0};
int i, colors[NUM_SYS_COLORS];
COLORREF refs[NUM_SYS_COLORS];
NONCLIENTMETRICSW metrics;
+ HANDLE file;
if (!load_gtk3_libs())
return;
@@ -267,6 +276,52 @@ static void process_attach(void)
SystemParametersInfoW(SPI_SETCLEARTYPE, 0, (LPVOID)TRUE, 0);
SystemParametersInfoW(SPI_SETFONTSMOOTHING, 0, (LPVOID)TRUE, 0);
SystemParametersInfoW(SPI_SETFLATMENU, 0, (LPVOID)TRUE, 0);
+
+ /* create fake msstyles file */
+ if (SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_RESOURCES|CSIDL_FLAG_CREATE, NULL,
+ SHGFP_TYPE_CURRENT, fake_msstyles_file)))
+ {
+ lstrcatW(fake_msstyles_file, themes_subdir);
+ SHCreateDirectoryExW(NULL, fake_msstyles_file, NULL);
+
+ lstrcatW(fake_msstyles_file, style_file);
+ file = CreateFileW(fake_msstyles_file, GENERIC_WRITE, 0, NULL, CREATE_NEW,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ if (file != INVALID_HANDLE_VALUE) CloseHandle(file);
+ return;
+ }
+ fake_msstyles_file[0] = 0;
+}
+
+static BOOL is_fake_theme(const WCHAR *path)
+{
+ BY_HANDLE_FILE_INFORMATION fake_info, file_info;
+ HANDLE fake_handle, file_handle;
+ BOOL ret;
+
+ if (!fake_msstyles_file[0]) return FALSE;
+
+ fake_handle = CreateFileW(fake_msstyles_file, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE |
+ FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (fake_handle == INVALID_HANDLE_VALUE) return FALSE;
+
+ file_handle = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE |
+ FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (file_handle == INVALID_HANDLE_VALUE)
+ {
+ CloseHandle(fake_handle);
+ return FALSE;
+ }
+
+ ret = GetFileInformationByHandle(fake_handle, &fake_info) &&
+ GetFileInformationByHandle(file_handle, &file_info) &&
+ fake_info.dwVolumeSerialNumber == file_info.dwVolumeSerialNumber &&
+ fake_info.nFileIndexHigh == file_info.nFileIndexHigh &&
+ fake_info.nFileIndexLow == file_info.nFileIndexLow;
+
+ CloseHandle(file_handle);
+ CloseHandle(fake_handle);
+ return ret;
}
void uxgtk_theme_init(uxgtk_theme_t *theme, const uxgtk_theme_vtable_t *vtable)
@@ -377,7 +432,10 @@ HRESULT WINAPI GetCurrentThemeName(LPWSTR filename, int filename_maxlen,
TRACE("(%p, %d, %p, %d, %p, %d)\n", filename, filename_maxlen,
color, color_maxlen, size, size_maxlen);
- return E_FAIL; /* To prevent calling EnumThemeColors and so on */
+ if (filename) lstrcpynW(filename, fake_msstyles_file, filename_maxlen);
+ if (color) lstrcpynW(color, FAKE_THEME_COLOR, color_maxlen);
+ if (size) lstrcpynW(size, FAKE_THEME_SIZE, size_maxlen);
+ return S_OK;
}
DWORD WINAPI GetThemeAppProperties(void)
@@ -1044,6 +1102,125 @@ BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
return theme->vtable->is_part_defined(part_id, state_id);
}
+DWORD WINAPI QueryThemeServices(void)
+{
+ TRACE("()\n");
+ return 3; /* This is what is returned under XP in most cases */
+}
+
+HRESULT WINAPI OpenThemeFile(LPCWSTR filename, LPCWSTR color, LPCWSTR size,
+ HTHEMEFILE *hthemefile, DWORD unknown)
+{
+ TRACE("(%s, %s, %s, %p, %d)\n", debugstr_w(filename), debugstr_w(color), debugstr_w(size),
+ hthemefile, unknown);
+
+ if (!is_fake_theme(filename))
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ if (color && lstrcmpW(FAKE_THEME_COLOR, color) != 0)
+ return HRESULT_FROM_WIN32(ERROR_BAD_FORMAT);
+
+ if (size && lstrcmpW(FAKE_THEME_SIZE, size) != 0)
+ return HRESULT_FROM_WIN32(ERROR_BAD_FORMAT);
+
+ *hthemefile = (HTHEMEFILE)0xdeadbeef;
+ return S_OK;
+}
+
+HRESULT WINAPI CloseThemeFile(HTHEMEFILE hthemefile)
+{
+ TRACE("(%p)\n", hthemefile);
+ return S_OK;
+}
+
+HRESULT WINAPI ApplyTheme(HTHEMEFILE hthemefile, char *unknown, HWND hwnd)
+{
+ TRACE("(%p, %s, %p)\n", hthemefile, unknown, hwnd);
+ return S_OK;
+}
+
+HRESULT WINAPI GetThemeDefaults(LPCWSTR filename, LPWSTR color, DWORD color_maxlen,
+ LPWSTR size, DWORD size_maxlen)
+{
+ TRACE("(%s, %p, %d, %p, %d)\n", debugstr_w(filename), color, color_maxlen, size, size_maxlen);
+
+ if (!is_fake_theme(filename))
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ lstrcpynW(color, FAKE_THEME_COLOR, color_maxlen);
+ lstrcpynW(size, FAKE_THEME_SIZE, size_maxlen);
+ return S_OK;
+}
+
+HRESULT WINAPI EnumThemes(LPCWSTR themepath, EnumThemeProc callback, LPVOID data)
+{
+ TRACE("(%s, %p, %p)\n", debugstr_w(themepath), callback, data);
+
+ /* FIXME: check path */
+ callback(NULL, fake_msstyles_file, FAKE_THEME_NAME, FAKE_THEME_NAME, NULL, data);
+
+ return S_OK;
+}
+
+HRESULT WINAPI EnumThemeColors(LPWSTR filename, LPWSTR size, DWORD color_id, PTHEMENAMES colors)
+{
+ TRACE("(%s, %s, %d, %p)\n", debugstr_w(filename), debugstr_w(size), color_id, colors);
+
+ if (!is_fake_theme(filename))
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ if (size && lstrcmpW(FAKE_THEME_SIZE, size) != 0)
+ return E_PROP_ID_UNSUPPORTED;
+
+ if (color_id != 0)
+ return E_PROP_ID_UNSUPPORTED;
+
+ lstrcpynW(colors->szName, FAKE_THEME_COLOR,
+ sizeof(colors->szName) / sizeof(WCHAR));
+ lstrcpynW(colors->szDisplayName, FAKE_THEME_COLOR,
+ sizeof(colors->szDisplayName) / sizeof(WCHAR));
+ lstrcpynW(colors->szTooltip, FAKE_THEME_COLOR,
+ sizeof(colors->szTooltip) / sizeof(WCHAR));
+ return S_OK;
+}
+
+HRESULT WINAPI EnumThemeSizes(LPWSTR filename, LPWSTR color, DWORD size_id, PTHEMENAMES sizes)
+{
+ TRACE("(%s, %s, %d, %p)\n", debugstr_w(filename), debugstr_w(color), size_id, sizes);
+
+ if (!is_fake_theme(filename))
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ if (color && lstrcmpW(FAKE_THEME_COLOR, color) != 0)
+ return E_PROP_ID_UNSUPPORTED;
+
+ if (size_id != 0)
+ return E_PROP_ID_UNSUPPORTED;
+
+ lstrcpynW(sizes->szName, FAKE_THEME_SIZE,
+ sizeof(sizes->szName) / sizeof(WCHAR));
+ lstrcpynW(sizes->szDisplayName, FAKE_THEME_SIZE,
+ sizeof(sizes->szDisplayName) / sizeof(WCHAR));
+ lstrcpynW(sizes->szTooltip, FAKE_THEME_SIZE,
+ sizeof(sizes->szTooltip) / sizeof(WCHAR));
+ return S_OK;
+}
+
+HRESULT WINAPI ParseThemeIniFile(LPCWSTR filename, LPWSTR unknown,
+ ParseThemeIniFileProc callback, LPVOID data)
+{
+ TRACE("(%s, %s, %p, %p)\n", debugstr_w(filename), debugstr_w(unknown), callback, data);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI CheckThemeSignature(LPCWSTR filename)
+{
+ if (!is_fake_theme(filename))
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ return S_OK;
+}
+
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
TRACE("(%p, %d, %p)\n", instance, reason, reserved);
--
2.5.0

View File

@ -1,19 +1,19 @@
From fa7e6a770944d1e8663e6062ee83df778d6cf7af Mon Sep 17 00:00:00 2001
From 94806d7ea8a23f94823f2a29e75a85dba55d2076 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 22 Aug 2015 15:41:15 +0200
Subject: uxthemegtk: Reset FPU flags before calling GTK3 functions.
Subject: [PATCH] uxtheme: Reset FPU flags before calling GTK3 functions.
---
dlls/uxtheme-gtk/uxtheme.c | 57 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 55 insertions(+), 2 deletions(-)
dlls/uxtheme/gtk.c | 58 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 55 insertions(+), 3 deletions(-)
diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c
index 37af3bc..22d3ffb 100644
--- a/dlls/uxtheme-gtk/uxtheme.c
+++ b/dlls/uxtheme-gtk/uxtheme.c
@@ -139,6 +139,27 @@ static const WCHAR FAKE_THEME_COLOR[] = {'D','e','f','a','u','l','t',' ','C','
static const WCHAR FAKE_THEME_SIZE[] = {'D','e','f','a','u','l','t',' ','S','i','z','e',0};
static WCHAR fake_msstyles_file[MAX_PATH];
diff --git a/dlls/uxtheme/gtk.c b/dlls/uxtheme/gtk.c
index bbee8e87..86ea4d1b 100644
--- a/dlls/uxtheme/gtk.c
+++ b/dlls/uxtheme/gtk.c
@@ -117,6 +117,27 @@ MAKE_FUNCPTR(gtk_window_new);
#define MENU_HEIGHT 20
#define CLASSLIST_MAXLEN 128
+static inline WORD reset_fpu_flags(void)
+{
@ -39,17 +39,14 @@ index 37af3bc..22d3ffb 100644
static void free_gtk3_libs(void)
{
if (libgtk3) wine_dlclose(libgtk3, NULL, 0);
@@ -384,6 +405,7 @@ static void paint_cairo_surface(cairo_surface_t *surface, HDC target_hdc,
HRESULT WINAPI CloseThemeData(HTHEME htheme)
@@ -319,11 +340,15 @@ BOOL uxtheme_gtk_enabled(void)
HRESULT uxtheme_gtk_CloseThemeData(HTHEME htheme)
{
uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
+ WORD fpu_flags;
TRACE("(%p)\n", htheme);
@@ -394,7 +416,10 @@ HRESULT WINAPI CloseThemeData(HTHEME htheme)
return E_HANDLE;
/* Destroy the toplevel widget */
+ fpu_flags = reset_fpu_flags();
pgtk_widget_destroy(theme->window);
@ -58,26 +55,29 @@ index 37af3bc..22d3ffb 100644
HeapFree(GetProcessHeap(), 0, theme);
return S_OK;
}
@@ -480,6 +505,7 @@ HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
@@ -381,6 +406,8 @@ BOOL uxtheme_gtk_IsThemeDialogTextureEnabled(HWND hwnd)
HTHEME uxtheme_gtk_OpenThemeDataEx(HWND hwnd, LPCWSTR classlist, DWORD flags)
{
WCHAR *start, *tok, buf[CLASSLIST_MAXLEN];
uxgtk_theme_t *theme;
+ uxgtk_theme_t *theme;
+ WORD fpu_flags;
int i;
TRACE("(%p, %s)\n", hwnd, debugstr_w(classlist));
@@ -526,7 +552,10 @@ found:
TRACE("(%p, %s, %#x)\n", hwnd, debugstr_w(classlist), flags);
@@ -414,7 +441,11 @@ found:
TRACE("Using %s for %s.\n", debugstr_w(classes[i].classname),
debugstr_w(classlist));
- return classes[i].create();
+ fpu_flags = reset_fpu_flags();
theme = classes[i].create();
+ theme = classes[i].create();
+ set_fpu_flags(fpu_flags);
+
if (theme && IsWindow(hwnd))
SetPropW(hwnd, THEME_PROPERTY, theme);
+ return theme;
}
@@ -561,6 +590,7 @@ HRESULT WINAPI GetThemeColor(HTHEME htheme, int part_id, int state_id,
void uxtheme_gtk_SetThemeAppProperties(DWORD flags)
@@ -444,6 +475,7 @@ HRESULT uxtheme_gtk_GetThemeColor(HTHEME htheme, int part_id, int state_id,
HRESULT hr;
GdkRGBA rgba = {0, 0, 0, 0};
uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
@ -85,18 +85,17 @@ index 37af3bc..22d3ffb 100644
TRACE("(%p, %d, %d, %d, %p)\n", htheme, part_id, state_id, prop_id, color);
@@ -577,7 +607,10 @@ HRESULT WINAPI GetThemeColor(HTHEME htheme, int part_id, int state_id,
@@ -456,7 +488,9 @@ HRESULT uxtheme_gtk_GetThemeColor(HTHEME htheme, int part_id, int state_id,
if (color == NULL)
return E_INVALIDARG;
TRACE("%s->get_color()\n", theme->vtable->classname);
+
+ fpu_flags = reset_fpu_flags();
hr = theme->vtable->get_color(theme, part_id, state_id, prop_id, &rgba);
+ set_fpu_flags(fpu_flags);
if (SUCCEEDED(hr) && rgba.alpha > 0)
{
@@ -860,6 +893,7 @@ HRESULT WINAPI DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, int st
@@ -758,6 +792,7 @@ HRESULT uxtheme_gtk_DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, i
uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
cairo_surface_t *surface;
int width, height;
@ -104,7 +103,7 @@ index 37af3bc..22d3ffb 100644
cairo_t *cr;
HRESULT hr;
@@ -877,6 +911,8 @@ HRESULT WINAPI DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, int st
@@ -772,6 +807,8 @@ HRESULT uxtheme_gtk_DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, i
width = rect->right - rect->left;
height = rect->bottom - rect->top;
@ -113,7 +112,7 @@ index 37af3bc..22d3ffb 100644
surface = pcairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
cr = pcairo_create(surface);
@@ -887,6 +923,9 @@ HRESULT WINAPI DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, int st
@@ -781,6 +818,9 @@ HRESULT uxtheme_gtk_DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, i
pcairo_destroy(cr);
pcairo_surface_destroy(surface);
@ -123,8 +122,8 @@ index 37af3bc..22d3ffb 100644
return hr;
}
@@ -1021,6 +1060,8 @@ HRESULT WINAPI GetThemePartSize(HTHEME htheme, HDC hdc, int part_id, int state_i
RECT *rect, THEMESIZE type, SIZE *size)
@@ -826,6 +866,8 @@ HRESULT uxtheme_gtk_GetThemePartSize(HTHEME htheme, HDC hdc, int part_id, int st
RECT *rect, THEMESIZE type, SIZE *size)
{
uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
+ HRESULT result;
@ -132,12 +131,11 @@ index 37af3bc..22d3ffb 100644
TRACE("(%p, %p, %d, %d, %p, %d, %p)\n", htheme, hdc, part_id, state_id, rect, type, size);
@@ -1037,7 +1078,12 @@ HRESULT WINAPI GetThemePartSize(HTHEME htheme, HDC hdc, int part_id, int state_i
@@ -838,7 +880,11 @@ HRESULT uxtheme_gtk_GetThemePartSize(HTHEME htheme, HDC hdc, int part_id, int st
if (rect == NULL || size == NULL)
return E_INVALIDARG;
TRACE("%s->get_part_size()\n", theme->vtable->classname);
- return theme->vtable->get_part_size(theme, part_id, state_id, rect, size);
+
+ fpu_flags = reset_fpu_flags();
+ result = theme->vtable->get_part_size(theme, part_id, state_id, rect, size);
+ set_fpu_flags(fpu_flags);
@ -145,9 +143,9 @@ index 37af3bc..22d3ffb 100644
+ return result;
}
HRESULT WINAPI GetThemeTextExtent(HTHEME htheme, HDC hdc, int part_id, int state_id,
@@ -1081,6 +1127,8 @@ BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME htheme, int part_id, in
BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
HRESULT uxtheme_gtk_GetThemeTextExtent(HTHEME htheme, HDC hdc, int part_id, int state_id,
@@ -872,6 +918,8 @@ BOOL uxtheme_gtk_IsThemeBackgroundPartiallyTransparent(HTHEME htheme, int part_i
BOOL uxtheme_gtk_IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
{
uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
+ WORD fpu_flags;
@ -155,12 +153,11 @@ index 37af3bc..22d3ffb 100644
TRACE("(%p, %d, %d)\n", htheme, part_id, state_id);
@@ -1103,7 +1151,12 @@ BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
@@ -887,7 +935,11 @@ BOOL uxtheme_gtk_IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
return FALSE;
}
TRACE("%s->is_part_defined()\n", theme->vtable->classname);
- return theme->vtable->is_part_defined(part_id, state_id);
+
+ fpu_flags = reset_fpu_flags();
+ result = theme->vtable->is_part_defined(part_id, state_id);
+ set_fpu_flags(fpu_flags);
@ -168,7 +165,7 @@ index 37af3bc..22d3ffb 100644
+ return result;
}
DWORD WINAPI QueryThemeServices(void)
#else
--
2.5.0
2.20.1

View File

@ -0,0 +1,34 @@
From 538e7170f2c8927428c7a4fb7a383ab85af7e318 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 27 Jan 2016 08:16:10 +0100
Subject: [PATCH 5/5] uxtheme: Fix some incorrect error codes.
---
dlls/uxtheme/gtk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/uxtheme/gtk.c b/dlls/uxtheme/gtk.c
index a5465356..74d55ada 100644
--- a/dlls/uxtheme/gtk.c
+++ b/dlls/uxtheme/gtk.c
@@ -457,7 +457,7 @@ HRESULT uxtheme_gtk_SetWindowTheme(HWND hwnd, LPCWSTR sub_app_name, LPCWSTR sub_
FIXME("(%p, %s, %s)\n", hwnd, debugstr_w(sub_app_name),
debugstr_w(sub_id_list));
- return E_NOTIMPL;
+ return S_OK;
}
HRESULT uxtheme_gtk_GetThemeBool(HTHEME htheme, int part_id, int state_id,
@@ -924,7 +924,7 @@ BOOL uxtheme_gtk_IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
if (theme->vtable == NULL)
{
- SetLastError(ERROR_INVALID_HANDLE);
+ SetLastError(E_HANDLE);
return FALSE;
}
--
2.20.1

View File

@ -1,220 +0,0 @@
From 6670a2999420323cb4c63d7aaa47638a5abd98fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 22 Aug 2015 05:08:42 +0200
Subject: uxthemegtk: Print class name before calling vtable functions.
---
dlls/uxtheme-gtk/button.c | 1 +
dlls/uxtheme-gtk/combobox.c | 1 +
dlls/uxtheme-gtk/edit.c | 1 +
dlls/uxtheme-gtk/header.c | 4 +++-
dlls/uxtheme-gtk/listbox.c | 1 +
dlls/uxtheme-gtk/menu.c | 1 +
dlls/uxtheme-gtk/rebar.c | 1 +
dlls/uxtheme-gtk/status.c | 1 +
dlls/uxtheme-gtk/tab.c | 1 +
dlls/uxtheme-gtk/toolbar.c | 1 +
dlls/uxtheme-gtk/trackbar.c | 1 +
dlls/uxtheme-gtk/uxtheme.c | 4 ++++
dlls/uxtheme-gtk/uxthemegtk.h | 1 +
dlls/uxtheme-gtk/window.c | 1 +
14 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/dlls/uxtheme-gtk/button.c b/dlls/uxtheme-gtk/button.c
index b867448..3d8e6eb 100644
--- a/dlls/uxtheme-gtk/button.c
+++ b/dlls/uxtheme-gtk/button.c
@@ -483,6 +483,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t button_vtable =
{
+ "button",
get_color,
draw_background,
get_part_size,
diff --git a/dlls/uxtheme-gtk/combobox.c b/dlls/uxtheme-gtk/combobox.c
index 38abb82..66299a9 100644
--- a/dlls/uxtheme-gtk/combobox.c
+++ b/dlls/uxtheme-gtk/combobox.c
@@ -191,6 +191,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t combobox_vtable =
{
+ "combobox",
NULL, /* get_color */
draw_background,
NULL, /* get_part_size */
diff --git a/dlls/uxtheme-gtk/edit.c b/dlls/uxtheme-gtk/edit.c
index eb5f108..60b7b3f 100644
--- a/dlls/uxtheme-gtk/edit.c
+++ b/dlls/uxtheme-gtk/edit.c
@@ -180,6 +180,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t edit_vtable =
{
+ "edit",
get_color,
draw_background,
NULL, /* get_part_size */
diff --git a/dlls/uxtheme-gtk/header.c b/dlls/uxtheme-gtk/header.c
index 11c0245..353c7ac 100644
--- a/dlls/uxtheme-gtk/header.c
+++ b/dlls/uxtheme-gtk/header.c
@@ -92,7 +92,9 @@ static BOOL is_part_defined(int part_id, int state_id)
return (part_id == HP_HEADERITEM);
}
-static const uxgtk_theme_vtable_t header_vtable = {
+static const uxgtk_theme_vtable_t header_vtable =
+{
+ "header",
NULL, /* get_color */
draw_background,
NULL, /* get_part_size */
diff --git a/dlls/uxtheme-gtk/listbox.c b/dlls/uxtheme-gtk/listbox.c
index 53e1391..7450378 100644
--- a/dlls/uxtheme-gtk/listbox.c
+++ b/dlls/uxtheme-gtk/listbox.c
@@ -88,6 +88,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t listbox_vtable =
{
+ "listbox",
NULL, /* get_color */
draw_background,
NULL, /* get_part_size */
diff --git a/dlls/uxtheme-gtk/menu.c b/dlls/uxtheme-gtk/menu.c
index b24a085..d6cdeca 100644
--- a/dlls/uxtheme-gtk/menu.c
+++ b/dlls/uxtheme-gtk/menu.c
@@ -154,6 +154,7 @@ static HRESULT get_color(uxgtk_theme_t *theme, int part_id, int state_id,
static const uxgtk_theme_vtable_t menu_vtable =
{
+ "menu",
get_color,
NULL, /* draw_background */
NULL, /* get_part_size */
diff --git a/dlls/uxtheme-gtk/rebar.c b/dlls/uxtheme-gtk/rebar.c
index 03650ae..714a9e7 100644
--- a/dlls/uxtheme-gtk/rebar.c
+++ b/dlls/uxtheme-gtk/rebar.c
@@ -71,6 +71,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t rebar_vtable =
{
+ "rebar",
NULL, /* get_color */
draw_background,
NULL, /* get_part_size */
diff --git a/dlls/uxtheme-gtk/status.c b/dlls/uxtheme-gtk/status.c
index e2a937a..8398360 100644
--- a/dlls/uxtheme-gtk/status.c
+++ b/dlls/uxtheme-gtk/status.c
@@ -122,6 +122,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t status_vtable =
{
+ "status",
NULL, /* get_color */
draw_background,
get_part_size,
diff --git a/dlls/uxtheme-gtk/tab.c b/dlls/uxtheme-gtk/tab.c
index 31bdc0e..6ad40bb 100644
--- a/dlls/uxtheme-gtk/tab.c
+++ b/dlls/uxtheme-gtk/tab.c
@@ -166,6 +166,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t tab_vtable =
{
+ "tab",
NULL, /* get_color */
draw_background,
NULL, /* get_part_size */
diff --git a/dlls/uxtheme-gtk/toolbar.c b/dlls/uxtheme-gtk/toolbar.c
index be8fbae..6158353 100644
--- a/dlls/uxtheme-gtk/toolbar.c
+++ b/dlls/uxtheme-gtk/toolbar.c
@@ -138,6 +138,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t toolbar_vtable =
{
+ "toolbar",
NULL, /* get_color */
draw_background,
NULL, /* get_part_size */
diff --git a/dlls/uxtheme-gtk/trackbar.c b/dlls/uxtheme-gtk/trackbar.c
index 58df246..f576fbe 100644
--- a/dlls/uxtheme-gtk/trackbar.c
+++ b/dlls/uxtheme-gtk/trackbar.c
@@ -149,6 +149,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t trackbar_vtable =
{
+ "trackbar",
NULL, /* get_color */
draw_background,
NULL, /* get_part_size */
diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c
index 0050036..37af3bc 100644
--- a/dlls/uxtheme-gtk/uxtheme.c
+++ b/dlls/uxtheme-gtk/uxtheme.c
@@ -576,6 +576,7 @@ HRESULT WINAPI GetThemeColor(HTHEME htheme, int part_id, int state_id,
if (color == NULL)
return E_INVALIDARG;
+ TRACE("%s->get_color()\n", theme->vtable->classname);
hr = theme->vtable->get_color(theme, part_id, state_id, prop_id, &rgba);
if (SUCCEEDED(hr) && rgba.alpha > 0)
@@ -879,6 +880,7 @@ HRESULT WINAPI DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, int st
surface = pcairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
cr = pcairo_create(surface);
+ TRACE("%s->draw_background()\n", theme->vtable->classname);
hr = theme->vtable->draw_background(theme, cr, part_id, state_id, width, height);
if (SUCCEEDED(hr))
paint_cairo_surface(surface, hdc, rect->left, rect->top, width, height);
@@ -1034,6 +1036,7 @@ HRESULT WINAPI GetThemePartSize(HTHEME htheme, HDC hdc, int part_id, int state_i
if (rect == NULL || size == NULL)
return E_INVALIDARG;
+ TRACE("%s->get_part_size()\n", theme->vtable->classname);
return theme->vtable->get_part_size(theme, part_id, state_id, rect, size);
}
@@ -1099,6 +1102,7 @@ BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
return FALSE;
}
+ TRACE("%s->is_part_defined()\n", theme->vtable->classname);
return theme->vtable->is_part_defined(part_id, state_id);
}
diff --git a/dlls/uxtheme-gtk/uxthemegtk.h b/dlls/uxtheme-gtk/uxthemegtk.h
index 17307f1..79037fb 100644
--- a/dlls/uxtheme-gtk/uxthemegtk.h
+++ b/dlls/uxtheme-gtk/uxthemegtk.h
@@ -32,6 +32,7 @@ typedef struct _uxgtk_theme_vtable uxgtk_theme_vtable_t;
struct _uxgtk_theme_vtable
{
+ const char *classname;
HRESULT (*get_color)(uxgtk_theme_t *theme, int part_id, int state_id,
int prop_id, GdkRGBA *rgba);
HRESULT (*draw_background)(uxgtk_theme_t *theme, cairo_t *cr, int part_id, int state_id,
diff --git a/dlls/uxtheme-gtk/window.c b/dlls/uxtheme-gtk/window.c
index cf617ef..8b1478c 100644
--- a/dlls/uxtheme-gtk/window.c
+++ b/dlls/uxtheme-gtk/window.c
@@ -141,6 +141,7 @@ static BOOL is_part_defined(int part_id, int state_id)
static const uxgtk_theme_vtable_t window_vtable =
{
+ "window",
get_color,
draw_background,
NULL, /* get_part_size */
--
2.5.0

View File

@ -1,59 +0,0 @@
From e82e7adedc71f3a2cb3f8a4c7af5ffbfaad48885 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 27 Jan 2016 08:20:28 +0100
Subject: uxthemegtk: Add export for OpenThemeDataEx.
---
dlls/uxtheme-gtk/uxtheme-gtk.spec | 2 +-
dlls/uxtheme-gtk/uxtheme.c | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/uxtheme-gtk/uxtheme-gtk.spec b/dlls/uxtheme-gtk/uxtheme-gtk.spec
index 4acc0fa..c4a619a 100644
--- a/dlls/uxtheme-gtk/uxtheme-gtk.spec
+++ b/dlls/uxtheme-gtk/uxtheme-gtk.spec
@@ -38,7 +38,7 @@
46 stub -noname ClassicAdjustWindowRectEx
48 stub -noname GetThemeParseErrorInfo
60 stub -noname CreateThemeDataFromObjects
-61 stub OpenThemeDataEx
+61 stdcall OpenThemeDataEx(ptr wstr long)
62 stub -noname ServerClearStockObjects
63 stub -noname MarkSelection
diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c
index b520f6f..15fc231 100644
--- a/dlls/uxtheme-gtk/uxtheme.c
+++ b/dlls/uxtheme-gtk/uxtheme.c
@@ -501,14 +501,14 @@ BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd)
return TRUE; /* Always enabled */
}
-HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
+HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR classlist, DWORD flags)
{
WCHAR *start, *tok, buf[CLASSLIST_MAXLEN];
uxgtk_theme_t *theme;
WORD fpu_flags;
int i;
- TRACE("(%p, %s)\n", hwnd, debugstr_w(classlist));
+ TRACE("(%p, %s, %x)\n", hwnd, debugstr_w(classlist), flags);
if (libgtk3 == NULL)
{
@@ -562,6 +562,11 @@ found:
return theme;
}
+HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
+{
+ return OpenThemeDataEx(hwnd, classlist, 0);
+}
+
void WINAPI SetThemeAppProperties(DWORD flags)
{
TRACE("(%u)\n", flags);
--
2.6.4

View File

@ -1,43 +0,0 @@
From 60dd76b04fa8aad2200f91660d0277a1c403dbab Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 27 Jan 2016 08:16:10 +0100
Subject: uxthemegtk: Fix some incorrect error codes.
---
dlls/uxtheme-gtk/uxtheme.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c
index ab369f5..631c4da 100644
--- a/dlls/uxtheme-gtk/uxtheme.c
+++ b/dlls/uxtheme-gtk/uxtheme.c
@@ -519,7 +519,7 @@ HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR classlist, DWORD flags)
/* comctl32.dll likes to send NULL */
if (classlist == NULL)
{
- SetLastError(ERROR_INVALID_PARAMETER);
+ SetLastError(E_POINTER);
return NULL;
}
@@ -578,7 +578,7 @@ HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR sub_app_name,
FIXME("(%p, %s, %s)\n", hwnd, debugstr_w(sub_app_name),
debugstr_w(sub_id_list));
- return E_NOTIMPL;
+ return S_OK;
}
HRESULT WINAPI GetThemeBool(HTHEME htheme, int part_id, int state_id,
@@ -1145,7 +1145,7 @@ BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
if (theme == NULL || theme->vtable == NULL)
{
- SetLastError(ERROR_INVALID_HANDLE);
+ SetLastError(E_HANDLE);
return FALSE;
}
--
2.6.4

View File

@ -1,192 +0,0 @@
From f5278dc9cd67771aace50ba14bce51626719ac7c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 27 Jan 2016 08:53:14 +0100
Subject: uxthemegtk: Validate theme handles before accessing private data.
---
dlls/uxtheme-gtk/uxtheme.c | 47 +++++++++++++++++++++++++++++++++----------
dlls/uxtheme-gtk/uxthemegtk.h | 2 +-
2 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/dlls/uxtheme-gtk/uxtheme.c b/dlls/uxtheme-gtk/uxtheme.c
index 631c4da..aeaeb06 100644
--- a/dlls/uxtheme-gtk/uxtheme.c
+++ b/dlls/uxtheme-gtk/uxtheme.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2015 Ivan Akulinchev
* Copyright (C) 2015 Michael Müller
+ * Copyright (C) 2016 Sebastian Lackner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -36,6 +37,7 @@
#include "vfwmsgs.h"
#include "shlobj.h"
+#include "wine/exception.h"
#include "wine/debug.h"
#include "uxthemegtk.h"
@@ -129,6 +131,7 @@ MAKE_FUNCPTR(gtk_widget_style_get);
MAKE_FUNCPTR(gtk_window_new);
#undef MAKE_FUNCPTR
+#define HTHEME_MAGIC 0x4b544758
#define NUM_SYS_COLORS (COLOR_MENUBAR + 1)
#define MENU_HEIGHT 20
#define CLASSLIST_MAXLEN 128
@@ -265,6 +268,26 @@ error:
return FALSE;
}
+static uxgtk_theme_t *impl_from_HTHEME(HTHEME htheme)
+{
+ uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
+ if (!htheme || htheme == INVALID_HANDLE_VALUE) return NULL;
+ __TRY
+ {
+ if (theme->magic != HTHEME_MAGIC) theme = NULL;
+ }
+ __EXCEPT_PAGE_FAULT
+ {
+ theme = NULL;
+ }
+ __ENDTRY
+
+ if (!theme)
+ FIXME("Theme handle %p is invalid\n", htheme);
+
+ return theme;
+}
+
static void process_attach(void)
{
static const WCHAR themes_subdir[] = {'\\','T','h','e','m','e','s','\\', 'g','t','k','3',0};
@@ -347,6 +370,7 @@ static BOOL is_fake_theme(const WCHAR *path)
void uxgtk_theme_init(uxgtk_theme_t *theme, const uxgtk_theme_vtable_t *vtable)
{
+ theme->magic = HTHEME_MAGIC;
theme->vtable = vtable;
theme->window = pgtk_window_new(GTK_WINDOW_TOPLEVEL);
theme->layout = pgtk_fixed_new();
@@ -404,7 +428,7 @@ static void paint_cairo_surface(cairo_surface_t *surface, HDC target_hdc,
HRESULT WINAPI CloseThemeData(HTHEME htheme)
{
- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
+ uxgtk_theme_t *theme;
WORD fpu_flags;
TRACE("(%p)\n", htheme);
@@ -412,7 +436,7 @@ HRESULT WINAPI CloseThemeData(HTHEME htheme)
if (libgtk3 == NULL)
return E_NOTIMPL;
- if (theme == NULL)
+ if (!(theme = impl_from_HTHEME(htheme)))
return E_HANDLE;
/* Destroy the toplevel widget */
@@ -420,6 +444,7 @@ HRESULT WINAPI CloseThemeData(HTHEME htheme)
pgtk_widget_destroy(theme->window);
set_fpu_flags(fpu_flags);
+ theme->magic = 0;
HeapFree(GetProcessHeap(), 0, theme);
return S_OK;
}
@@ -592,17 +617,17 @@ HRESULT WINAPI GetThemeBool(HTHEME htheme, int part_id, int state_id,
HRESULT WINAPI GetThemeColor(HTHEME htheme, int part_id, int state_id,
int prop_id, COLORREF *color)
{
- HRESULT hr;
GdkRGBA rgba = {0, 0, 0, 0};
- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
+ uxgtk_theme_t *theme;
WORD fpu_flags;
+ HRESULT hr;
TRACE("(%p, %d, %d, %d, %p)\n", htheme, part_id, state_id, prop_id, color);
if (libgtk3 == NULL)
return E_NOTIMPL;
- if (theme == NULL || theme->vtable == NULL)
+ if (!(theme = impl_from_HTHEME(htheme)))
return E_HANDLE;
if (theme->vtable->get_color == NULL)
@@ -895,8 +920,8 @@ HRESULT WINAPI DrawThemeBackground(HTHEME htheme, HDC hdc, int part_id, int stat
HRESULT WINAPI DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, int state_id,
LPCRECT rect, const DTBGOPTS *options)
{
- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
cairo_surface_t *surface;
+ uxgtk_theme_t *theme;
int width, height;
WORD fpu_flags;
cairo_t *cr;
@@ -907,7 +932,7 @@ HRESULT WINAPI DrawThemeBackgroundEx(HTHEME htheme, HDC hdc, int part_id, int st
if (libgtk3 == NULL)
return E_NOTIMPL;
- if (theme == NULL || theme->vtable == NULL)
+ if (!(theme = impl_from_HTHEME(htheme)))
return E_HANDLE;
if (theme->vtable->draw_background == NULL)
@@ -1064,7 +1089,7 @@ HRESULT WINAPI GetThemeBackgroundRegion(HTHEME htheme, HDC hdc, int part_id, int
HRESULT WINAPI GetThemePartSize(HTHEME htheme, HDC hdc, int part_id, int state_id,
RECT *rect, THEMESIZE type, SIZE *size)
{
- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
+ uxgtk_theme_t *theme;
HRESULT result;
WORD fpu_flags;
@@ -1073,7 +1098,7 @@ HRESULT WINAPI GetThemePartSize(HTHEME htheme, HDC hdc, int part_id, int state_i
if (libgtk3 == NULL)
return E_NOTIMPL;
- if (theme == NULL || theme->vtable == NULL)
+ if (!(theme = impl_from_HTHEME(htheme)))
return E_HANDLE;
if (theme->vtable->get_part_size == NULL)
@@ -1131,7 +1156,7 @@ BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME htheme, int part_id, in
BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
{
- uxgtk_theme_t *theme = (uxgtk_theme_t *)htheme;
+ uxgtk_theme_t *theme;
WORD fpu_flags;
BOOL result;
@@ -1143,7 +1168,7 @@ BOOL WINAPI IsThemePartDefined(HTHEME htheme, int part_id, int state_id)
return FALSE;
}
- if (theme == NULL || theme->vtable == NULL)
+ if (!(theme = impl_from_HTHEME(htheme)))
{
SetLastError(E_HANDLE);
return FALSE;
diff --git a/dlls/uxtheme-gtk/uxthemegtk.h b/dlls/uxtheme-gtk/uxthemegtk.h
index 79037fb..185366b 100644
--- a/dlls/uxtheme-gtk/uxthemegtk.h
+++ b/dlls/uxtheme-gtk/uxthemegtk.h
@@ -44,8 +44,8 @@ struct _uxgtk_theme_vtable
struct _uxgtk_theme
{
+ DWORD magic;
const uxgtk_theme_vtable_t *vtable;
-
GtkWidget *window;
GtkWidget *layout;
};
--
2.6.4

View File

@ -1,355 +0,0 @@
From 42a2a5837c231b6593e562a0c17f8a1513ea4d25 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 7 Feb 2019 14:39:12 +1100
Subject: [PATCH] Add buffering functions
This is just a copy of buffer.c from uxtheme.
Fixes
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46587
---
dlls/uxtheme-gtk/Makefile.in | 1 +
dlls/uxtheme-gtk/buffer.c | 300 ++++++++++++++++++++++++++++++++++++++
dlls/uxtheme-gtk/uxtheme-gtk.spec | 8 +
3 files changed, 309 insertions(+)
create mode 100644 dlls/uxtheme-gtk/buffer.c
diff --git a/dlls/uxtheme-gtk/Makefile.in b/dlls/uxtheme-gtk/Makefile.in
index d1e79fd4..2cbff61 100644
--- a/dlls/uxtheme-gtk/Makefile.in
+++ b/dlls/uxtheme-gtk/Makefile.in
@@ -4,6 +4,7 @@ DELAYIMPORTS = msimg32
EXTRAINCL = $(GTK3_CFLAGS)
C_SRCS = \
+ buffer.c \
button.c \
combobox.c \
edit.c \
diff --git a/dlls/uxtheme-gtk/buffer.c b/dlls/uxtheme-gtk/buffer.c
new file mode 100644
index 0000000..32d341c
--- /dev/null
+++ b/dlls/uxtheme-gtk/buffer.c
@@ -0,0 +1,300 @@
+/*
+ * uxtheme Double-buffered Drawing API
+ *
+ * Copyright (C) 2008 Reece H. Dunn
+ * Copyright 2017 Nikolay Sivov for CodeWeavers
+ *
+ * This library 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.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "wingdi.h"
+#include "vfwmsgs.h"
+#include "uxtheme.h"
+
+#include "wine/debug.h"
+#include "wine/heap.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
+
+struct paintbuffer
+{
+ HDC targetdc;
+ HDC memorydc;
+ HBITMAP bitmap;
+ RECT rect;
+ void *bits;
+};
+
+static void free_paintbuffer(struct paintbuffer *buffer)
+{
+ DeleteObject(buffer->bitmap);
+ DeleteDC(buffer->memorydc);
+ heap_free(buffer);
+}
+
+static struct paintbuffer *get_buffer_obj(HPAINTBUFFER handle)
+{
+ if (!handle)
+ return NULL;
+ return handle;
+}
+
+/***********************************************************************
+ * BufferedPaintInit (UXTHEME.@)
+ */
+HRESULT WINAPI BufferedPaintInit(VOID)
+{
+ FIXME("Stub ()\n");
+ return S_OK;
+}
+
+/***********************************************************************
+ * BufferedPaintUnInit (UXTHEME.@)
+ */
+HRESULT WINAPI BufferedPaintUnInit(VOID)
+{
+ FIXME("Stub ()\n");
+ return S_OK;
+}
+
+/***********************************************************************
+ * BeginBufferedPaint (UXTHEME.@)
+ */
+HPAINTBUFFER WINAPI BeginBufferedPaint(HDC targetdc, const RECT *rect,
+ BP_BUFFERFORMAT format, BP_PAINTPARAMS *params, HDC *retdc)
+{
+ char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
+ BITMAPINFO *bmi = (BITMAPINFO *)bmibuf;
+ struct paintbuffer *buffer;
+
+ TRACE("(%p %s %d %p %p)\n", targetdc, wine_dbgstr_rect(rect), format,
+ params, retdc);
+
+ if (retdc)
+ *retdc = NULL;
+
+ if (!targetdc || IsRectEmpty(rect))
+ return NULL;
+
+ if (params)
+ FIXME("painting parameters are ignored\n");
+
+ buffer = heap_alloc(sizeof(*buffer));
+ buffer->targetdc = targetdc;
+ buffer->rect = *rect;
+ buffer->memorydc = CreateCompatibleDC(targetdc);
+
+ switch (format)
+ {
+ case BPBF_COMPATIBLEBITMAP:
+ buffer->bitmap = CreateCompatibleBitmap(targetdc, rect->right - rect->left, rect->bottom - rect->top);
+ buffer->bits = NULL;
+ break;
+ case BPBF_DIB:
+ case BPBF_TOPDOWNDIB:
+ case BPBF_TOPDOWNMONODIB:
+ /* create DIB section */
+ memset(bmi, 0, sizeof(bmibuf));
+ bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader);
+ bmi->bmiHeader.biHeight = format == BPBF_DIB ? rect->bottom - rect->top :
+ -(rect->bottom - rect->top);
+ bmi->bmiHeader.biWidth = rect->right - rect->left;
+ bmi->bmiHeader.biBitCount = format == BPBF_TOPDOWNMONODIB ? 1 : 32;
+ bmi->bmiHeader.biPlanes = 1;
+ bmi->bmiHeader.biCompression = BI_RGB;
+ buffer->bitmap = CreateDIBSection(buffer->memorydc, bmi, DIB_RGB_COLORS, &buffer->bits, NULL, 0);
+ break;
+ default:
+ WARN("Unknown buffer format %d\n", format);
+ buffer->bitmap = NULL;
+ free_paintbuffer(buffer);
+ return NULL;
+ }
+
+ if (!buffer->bitmap)
+ {
+ WARN("Failed to create buffer bitmap\n");
+ free_paintbuffer(buffer);
+ return NULL;
+ }
+
+ SetWindowOrgEx(buffer->memorydc, rect->left, rect->top, NULL);
+ IntersectClipRect(buffer->memorydc, rect->left, rect->top, rect->right, rect->bottom);
+ DeleteObject(SelectObject(buffer->memorydc, buffer->bitmap));
+
+ *retdc = buffer->memorydc;
+
+ return (HPAINTBUFFER)buffer;
+}
+
+/***********************************************************************
+ * EndBufferedPaint (UXTHEME.@)
+ */
+HRESULT WINAPI EndBufferedPaint(HPAINTBUFFER bufferhandle, BOOL update)
+{
+ struct paintbuffer *buffer = get_buffer_obj(bufferhandle);
+
+ TRACE("(%p %d)\n", bufferhandle, update);
+
+ if (!buffer)
+ return E_INVALIDARG;
+
+ if (update)
+ {
+ if (!BitBlt(buffer->targetdc, buffer->rect.left, buffer->rect.top,
+ buffer->rect.right - buffer->rect.left, buffer->rect.bottom - buffer->rect.top,
+ buffer->memorydc, buffer->rect.left, buffer->rect.top, SRCCOPY))
+ {
+ WARN("BitBlt() failed\n");
+ }
+ }
+
+ free_paintbuffer(buffer);
+ return S_OK;
+}
+
+/***********************************************************************
+ * BufferedPaintClear (UXTHEME.@)
+ */
+HRESULT WINAPI BufferedPaintClear(HPAINTBUFFER hBufferedPaint, const RECT *prc)
+{
+ FIXME("Stub (%p %p)\n", hBufferedPaint, prc);
+ return E_NOTIMPL;
+}
+
+/***********************************************************************
+ * BufferedPaintSetAlpha (UXTHEME.@)
+ */
+HRESULT WINAPI BufferedPaintSetAlpha(HPAINTBUFFER hBufferedPaint, const RECT *prc, BYTE alpha)
+{
+ FIXME("Stub (%p %p %u)\n", hBufferedPaint, prc, alpha);
+ return E_NOTIMPL;
+}
+
+/***********************************************************************
+ * GetBufferedPaintBits (UXTHEME.@)
+ */
+HRESULT WINAPI GetBufferedPaintBits(HPAINTBUFFER bufferhandle, RGBQUAD **bits, int *width)
+{
+ struct paintbuffer *buffer = get_buffer_obj(bufferhandle);
+
+ TRACE("(%p %p %p)\n", buffer, bits, width);
+
+ if (!bits || !width)
+ return E_POINTER;
+
+ if (!buffer || !buffer->bits)
+ return E_FAIL;
+
+ *bits = buffer->bits;
+ *width = buffer->rect.right - buffer->rect.left;
+
+ return S_OK;
+}
+
+/***********************************************************************
+ * GetBufferedPaintDC (UXTHEME.@)
+ */
+HDC WINAPI GetBufferedPaintDC(HPAINTBUFFER bufferhandle)
+{
+ struct paintbuffer *buffer = get_buffer_obj(bufferhandle);
+
+ TRACE("(%p)\n", buffer);
+
+ return buffer ? buffer->memorydc : NULL;
+}
+
+/***********************************************************************
+ * GetBufferedPaintTargetDC (UXTHEME.@)
+ */
+HDC WINAPI GetBufferedPaintTargetDC(HPAINTBUFFER bufferhandle)
+{
+ struct paintbuffer *buffer = get_buffer_obj(bufferhandle);
+
+ TRACE("(%p)\n", buffer);
+
+ return buffer ? buffer->targetdc : NULL;
+}
+
+/***********************************************************************
+ * GetBufferedPaintTargetRect (UXTHEME.@)
+ */
+HRESULT WINAPI GetBufferedPaintTargetRect(HPAINTBUFFER bufferhandle, RECT *rect)
+{
+ struct paintbuffer *buffer = get_buffer_obj(bufferhandle);
+
+ TRACE("(%p %p)\n", buffer, rect);
+
+ if (!rect)
+ return E_POINTER;
+
+ if (!buffer)
+ return E_FAIL;
+
+ *rect = buffer->rect;
+ return S_OK;
+}
+
+/***********************************************************************
+ * BeginBufferedAnimation (UXTHEME.@)
+ */
+HANIMATIONBUFFER WINAPI BeginBufferedAnimation(HWND hwnd, HDC hdcTarget, const RECT *rcTarget,
+ BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS *pPaintParams,
+ BP_ANIMATIONPARAMS *pAnimationParams, HDC *phdcFrom,
+ HDC *phdcTo)
+{
+ FIXME("Stub (%p %p %p %u %p %p %p %p)\n", hwnd, hdcTarget, rcTarget, dwFormat,
+ pPaintParams, pAnimationParams, phdcFrom, phdcTo);
+
+ return NULL;
+}
+
+/***********************************************************************
+ * BufferedPaintRenderAnimation (UXTHEME.@)
+ */
+BOOL WINAPI BufferedPaintRenderAnimation(HWND hwnd, HDC hdcTarget)
+{
+ FIXME("Stub (%p %p)\n", hwnd, hdcTarget);
+
+ return FALSE;
+}
+
+/***********************************************************************
+ * BufferedPaintStopAllAnimations (UXTHEME.@)
+ */
+HRESULT WINAPI BufferedPaintStopAllAnimations(HWND hwnd)
+{
+ FIXME("Stub (%p)\n", hwnd);
+
+ return E_NOTIMPL;
+}
+
+/***********************************************************************
+ * EndBufferedAnimation (UXTHEME.@)
+ */
+HRESULT WINAPI EndBufferedAnimation(HANIMATIONBUFFER hbpAnimation, BOOL fUpdateTarget)
+{
+ FIXME("Stub (%p %u)\n", hbpAnimation, fUpdateTarget);
+
+ return E_NOTIMPL;
+}
diff --git a/dlls/uxtheme-gtk/uxtheme-gtk.spec b/dlls/uxtheme-gtk/uxtheme-gtk.spec
index c4a619a..f4cf37f 100644
--- a/dlls/uxtheme-gtk/uxtheme-gtk.spec
+++ b/dlls/uxtheme-gtk/uxtheme-gtk.spec
@@ -43,6 +43,14 @@
63 stub -noname MarkSelection
# System
+@ stdcall BeginBufferedAnimation(ptr ptr ptr long ptr ptr ptr ptr)
+@ stdcall BeginBufferedPaint(ptr ptr long ptr ptr)
+@ stdcall BufferedPaintClear(ptr ptr)
+@ stdcall BufferedPaintInit()
+@ stdcall BufferedPaintRenderAnimation(ptr ptr)
+@ stdcall BufferedPaintSetAlpha(ptr ptr long)
+@ stdcall BufferedPaintStopAllAnimations(ptr)
+@ stdcall BufferedPaintUnInit()
@ stdcall CloseThemeData(ptr)
@ stdcall EnableThemeDialogTexture(ptr long)
@ stdcall EnableTheming(long)
--
1.9.1

View File

@ -2,4 +2,3 @@
# sha1: ecbca8e848834180092d9078be0762a60617fcd7
Fixes: Add support for GTK3 theming
Depends: ntdll-DllRedirects

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