diff --git a/controls/button.c b/controls/button.c index d75004defeb1af2f881fffe420fdbfbf5b952373..1983dd17cebf791b00805e364b02e636c377393d 100644 --- a/controls/button.c +++ b/controls/button.c @@ -13,7 +13,7 @@ #include "wingdi.h" #include "wine/winuser16.h" #include "controls.h" -#include "tweak.h" +#include "user.h" /* Note: under MS-Windows, state is a BYTE and this structure is * only 3 bytes long. I don't think there are programs out there diff --git a/controls/combo.c b/controls/combo.c index f50e88a7b3994b6fd24ad945669bb5a512d52945..a26824c045306a177e5cb9425b569f021c9b0fdb 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -19,7 +19,6 @@ #include "heap.h" #include "controls.h" #include "debugtools.h" -#include "tweak.h" DEFAULT_DEBUG_CHANNEL(combo); diff --git a/controls/edit.c b/controls/edit.c index e0c4d2744406f979ddfe1457f1f189b1665c162e..cd2b5dcd489a813887b2ae77c667aebd31e709d7 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -24,8 +24,8 @@ #include "wine/unicode.h" #include "controls.h" #include "local.h" +#include "user.h" #include "debugtools.h" -#include "tweak.h" DEFAULT_DEBUG_CHANNEL(edit); DECLARE_DEBUG_CHANNEL(combo); diff --git a/controls/listbox.c b/controls/listbox.c index 24920d791dba3f2219a1a4320ce5daad65844bc8..a7da000acc70e6c655562bfc9123b6c1eaf4297f 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -16,9 +16,9 @@ #include "winerror.h" #include "spy.h" #include "win.h" +#include "user.h" #include "controls.h" #include "debugtools.h" -#include "tweak.h" DEFAULT_DEBUG_CHANNEL(listbox); DECLARE_DEBUG_CHANNEL(combo); diff --git a/controls/menu.c b/controls/menu.c index 56886769ae25bd43f3303fb62f107bb70998a82d..43936be1c2fb49d9214745255e4ece6bc60342cd 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -32,7 +32,6 @@ #include "user.h" #include "message.h" #include "queue.h" -#include "tweak.h" #include "debugtools.h" diff --git a/controls/scroll.c b/controls/scroll.c index ec7049fed2a3b6c2c678ab95dace37853b512fe9..bc0706b97d0b37a4e5b89cfcdffd611c855fc21f 100644 --- a/controls/scroll.c +++ b/controls/scroll.c @@ -12,8 +12,7 @@ #include "heap.h" #include "win.h" #include "debugtools.h" -#include "cache.h" -#include "tweak.h" +#include "user.h" DEFAULT_DEBUG_CHANNEL(scroll); @@ -673,16 +672,7 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar, if (TWEAK_WineLook == WIN31_LOOK && (flags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) { /* This ought to be the color of the parent window */ - if (TWEAK_WineLook == WIN31_LOOK) { - hBrush = GetSysColorBrush(COLOR_WINDOW); - } else { - /* Under Win9x look & feel, scrollbars don't have a solid border. - * To make scrollbar's background different from the window - * background, we need to apply a gray 0x55aa pattern brush. - * Otherwise it won't look good. - */ - hBrush = CACHE_GetPattern55AABrush(); - } + hBrush = GetSysColorBrush(COLOR_WINDOW); } else { diff --git a/controls/static.c b/controls/static.c index a5b1ca127b2a84045c38506b25e51c0b1c5b71b8..fa127b6163db0ad415254858520fb9a6f44d5347 100644 --- a/controls/static.c +++ b/controls/static.c @@ -12,8 +12,8 @@ #include "cursoricon.h" #include "controls.h" #include "heap.h" +#include "user.h" #include "debugtools.h" -#include "tweak.h" DEFAULT_DEBUG_CHANNEL(static); diff --git a/controls/uitools.c b/controls/uitools.c index 820bb36450a53425770a0338e9913a9a2b93ee7d..e2aadd2ed37dd313b7d5727251b581cea61b3e4e 100644 --- a/controls/uitools.c +++ b/controls/uitools.c @@ -9,8 +9,8 @@ #include "wingdi.h" #include "wine/winuser16.h" #include "winuser.h" +#include "user.h" #include "debugtools.h" -#include "tweak.h" DEFAULT_DEBUG_CHANNEL(graphics); diff --git a/dlls/gdi/gdi_main.c b/dlls/gdi/gdi_main.c index f468a72fc34542039a822f532919f0d260592df9..ae89c0ee35d03cbbb9d45ba163ec02b33ddc198d 100644 --- a/dlls/gdi/gdi_main.c +++ b/dlls/gdi/gdi_main.c @@ -7,7 +7,6 @@ #include "wine/winbase16.h" #include "gdi.h" -#include "tweak.h" #include "win16drv.h" #include "winbase.h" @@ -18,8 +17,6 @@ BOOL WINAPI MAIN_GdiInit(HINSTANCE hinstDLL, DWORD reason, LPVOID lpvReserved) { if (reason != DLL_PROCESS_ATTACH) return TRUE; - if (!TWEAK_Init()) return FALSE; - /* GDI initialisation */ if(!GDI_Init()) return FALSE; diff --git a/dlls/user/cache.c b/dlls/user/cache.c index 54090b8941108db4542d60f7a18c82e9a7c00f57..2724e5cbe37a73d9b156a5bd099d1bc1d1d3fca4 100644 --- a/dlls/user/cache.c +++ b/dlls/user/cache.c @@ -8,7 +8,7 @@ #include "windef.h" #include "wingdi.h" -#include "cache.h" +#include "user.h" static const WORD wPattern55AA[] = { @@ -26,17 +26,9 @@ static HBITMAP hPattern55AABitmap = 0; HBRUSH CACHE_GetPattern55AABrush(void) { if (!hPattern55AABrush) - hPattern55AABrush = CreatePatternBrush(CACHE_GetPattern55AABitmap()); - return hPattern55AABrush; -} - - -/********************************************************************* - * CACHE_GetPattern55AABitmap - */ -HBITMAP CACHE_GetPattern55AABitmap(void) -{ - if (!hPattern55AABitmap) + { hPattern55AABitmap = CreateBitmap( 8, 8, 1, 1, wPattern55AA ); - return hPattern55AABitmap; + hPattern55AABrush = CreatePatternBrush( hPattern55AABitmap ); + } + return hPattern55AABrush; } diff --git a/dlls/user/text.c b/dlls/user/text.c index 1463c6d5c2322a489bf2db1424a7452d98041450..7e3c379813cdfd8a8717e5b2c5303d9a2a4bef8e 100644 --- a/dlls/user/text.c +++ b/dlls/user/text.c @@ -14,7 +14,7 @@ #include "winbase.h" #include "winerror.h" #include "winnls.h" -#include "cache.h" +#include "user.h" #include "debugtools.h" DEFAULT_DEBUG_CHANNEL(text); diff --git a/dlls/user/user_main.c b/dlls/user/user_main.c index 5e8052bb88de41d845d79728572092e3b8e0c9f7..36a909d341477322c6c5626bc994584812740685 100644 --- a/dlls/user/user_main.c +++ b/dlls/user/user_main.c @@ -27,6 +27,8 @@ DEFAULT_DEBUG_CHANNEL(graphics); USER_DRIVER USER_Driver; +WINE_LOOK TWEAK_WineLook = WIN31_LOOK; + static HMODULE graphics_driver; #define GET_USER_FUNC(name) \ @@ -150,6 +152,38 @@ static void palette_init(void) } +/*********************************************************************** + * tweak_init + */ +static void tweak_init(void) +{ + static const char *OS = "Win3.1"; + char buffer[80]; + HKEY hkey; + DWORD type, count = sizeof(buffer); + + if (RegCreateKeyExA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\Tweak.Layout", 0, NULL, + REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL )) + return; + if (RegQueryValueExA( hkey, "WineLook", 0, &type, buffer, &count )) + strcpy( buffer, "Win31" ); /* default value */ + RegCloseKey( hkey ); + + /* WIN31_LOOK is default */ + if (!strncasecmp( buffer, "Win95", 5 )) + { + TWEAK_WineLook = WIN95_LOOK; + OS = "Win95"; + } + else if (!strncasecmp( buffer, "Win98", 5 )) + { + TWEAK_WineLook = WIN98_LOOK; + OS = "Win98"; + } + TRACE("Using %s look and feel.\n", OS); +} + + /*********************************************************************** * USER initialisation routine */ @@ -168,6 +202,7 @@ BOOL WINAPI USER_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) if (!ATOM_Init( USER_HeapSel )) return FALSE; /* Load the graphics driver */ + tweak_init(); if (!load_driver()) return FALSE; /* Initialize system colors and metrics*/ diff --git a/graphics/x11drv/oembitmap.c b/graphics/x11drv/oembitmap.c index 8970e17cc1c3b410ce26f14d78d6afe9ff1bfe4f..696d6997ca826d7f294dee4e05e7f4fa6224bc49 100644 --- a/graphics/x11drv/oembitmap.c +++ b/graphics/x11drv/oembitmap.c @@ -26,7 +26,7 @@ typedef unsigned long Pixel; #include "debugtools.h" #include "gdi.h" #include "heap.h" -#include "tweak.h" +#include "user.h" /* for TWEAK_WineLook (FIXME) */ #include "x11drv.h" /* Include OEM pixmaps */ diff --git a/graphics/x11drv/xfont.c b/graphics/x11drv/xfont.c index 6b690404063d1155877d247c1d8a9f4593e265b6..88acae127c3caa4316c16fe166d02e3ffbdfeb55 100644 --- a/graphics/x11drv/xfont.c +++ b/graphics/x11drv/xfont.c @@ -31,7 +31,7 @@ #include "options.h" #include "font.h" #include "debugtools.h" -#include "tweak.h" +#include "user.h" /* for TWEAK_WineLook (FIXME) */ #include "x11font.h" #include "server.h" diff --git a/include/cache.h b/include/cache.h deleted file mode 100644 index d8537e5c644373181f38a5240dd2bd591917b3eb..0000000000000000000000000000000000000000 --- a/include/cache.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Wine internally cached objects to speedup some things and prevent - * infinite duplication of trivial code and data. - * - * Copyright 1997 Bertho A. Stultiens - * - */ - -#ifndef __WINE_CACHE_H -#define __WINE_CACHE_H - -#include "windef.h" - -HBRUSH CACHE_GetPattern55AABrush(void); -HBITMAP CACHE_GetPattern55AABitmap(void); - -#endif /* __WINE_CACHE_H */ diff --git a/include/tweak.h b/include/tweak.h deleted file mode 100644 index 7eab50e02388902fabccdb0241fa2f22d6d391a6..0000000000000000000000000000000000000000 --- a/include/tweak.h +++ /dev/null @@ -1,26 +0,0 @@ -/****************************************************************************** - * - * Wine Windows 95 interface tweaks - * - * Copyright (c) 1997 Dave Cuthbert (dacut@ece.cmu.edu) - * - *****************************************************************************/ - -#ifndef __WINE_TWEAK_H -#define __WINE_TWEAK_H - -#include "windef.h" - -typedef enum -{ - WIN31_LOOK, - WIN95_LOOK, - WIN98_LOOK -} WINE_LOOK; - - -int TWEAK_Init(void); - -extern WINE_LOOK TWEAK_WineLook; - -#endif /* __WINE_TWEAK_H */ diff --git a/include/user.h b/include/user.h index eb8d2af570071a1fd96ad8871aa46b8a43453dd7..a4d16adf36292c84631cc654931e5805396a6dba 100644 --- a/include/user.h +++ b/include/user.h @@ -88,4 +88,18 @@ WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID, VOID WINAPI MOUSE_Enable(LPMOUSE_EVENT_PROC lpMouseEventProc); VOID WINAPI MOUSE_Disable(VOID); +/* Wine look */ + +typedef enum +{ + WIN31_LOOK, + WIN95_LOOK, + WIN98_LOOK +} WINE_LOOK; + +extern WINE_LOOK TWEAK_WineLook; + +/* gray brush cache */ +extern HBRUSH CACHE_GetPattern55AABrush(void); + #endif /* __WINE_USER_H */ diff --git a/misc/Makefile.in b/misc/Makefile.in index 8d951162c354704009d0a4183badc1bb93e720d3..f82a079800fe281b168ea0b4eff0280d20d10b66 100644 --- a/misc/Makefile.in +++ b/misc/Makefile.in @@ -15,7 +15,6 @@ C_SRCS = \ options.c \ registry.c \ system.c \ - tweak.c \ version.c all: $(MODULE).o diff --git a/misc/tweak.c b/misc/tweak.c deleted file mode 100644 index 146233a92afd6c3f733326eeffc7025ba7c477bb..0000000000000000000000000000000000000000 --- a/misc/tweak.c +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** - * - * tweak.c - * - * Windows 95 style interface tweaks. - * Copyright (c) 1997 Dave Cuthbert. - * - * FIXME: This file is, unfortunately, aptly named: the method of - * displaying Win95 style windows is a tweak. Lots of stuff does not yet - * work -- and probably never will unless some of this code is - * incorporated into the mainstream Wine code. - * - * DEVELOPERS, PLEASE NOTE: Before delving into the mainstream code and - * altering it, consider how your changes will affect the Win3.1 interface - * (which has taken a major effort to create!). After you make any sort of - * non-trivial change, *test* the Wine code running in Win3.1 mode! The - * object here is to make it so that the person who tests the latest version - * of Wine without adding the tweaks into wine.conf notices nothing out of - * the ordinary. - * - * Revision history - * 03-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) - * Original implementation. - * 05-Aug-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Removed some unused code. - * 22-Sep-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Removed more unused code. - * - *****************************************************************************/ - -#include <string.h> - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "tweak.h" -#include "options.h" -#include "debugtools.h" - -DEFAULT_DEBUG_CHANNEL(tweak); - -/****************************************************************************** - * - * int TWEAK_Init() - * - * Does the full initialization of the Win95 tweak subsystem. Return value - * indicates success. Called by loader/main.c's MAIN_Init(). - * - * Revision history - * 05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) - * Original implementation. - * 22-Sep-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Removed unused code and added Win98 option. - * 23-Aug-2000 Andreas Mohr (a.mohr@mailto.de) - * Speedup and code cleanup. - * - *****************************************************************************/ - -WINE_LOOK TWEAK_WineLook = WIN31_LOOK; - -int TWEAK_Init (void) -{ - static const char *OS = "Win3.1"; - char szIniString[80]; - - PROFILE_GetWineIniString ("Tweak.Layout", "WineLook", "Win31", szIniString, 80); - - /* WIN31_LOOK is default */ - if (!strncasecmp (szIniString, "Win95", 5)) { - TWEAK_WineLook = WIN95_LOOK; - OS = "Win95"; - } - else if (!strncasecmp (szIniString, "Win98", 5)) { - TWEAK_WineLook = WIN98_LOOK; - OS = "Win98"; - } - TRACE("Using %s look and feel.\n", OS); - return 1; -} diff --git a/objects/gdiobj.c b/objects/gdiobj.c index 057eda0920b7e3ee9e0970a71f187df2d4d6dc81..e938de84a552b41c7547706506d91447fc977c3e 100644 --- a/objects/gdiobj.c +++ b/objects/gdiobj.c @@ -26,7 +26,6 @@ #include "region.h" #include "debugtools.h" #include "gdi.h" -#include "tweak.h" DEFAULT_DEBUG_CHANNEL(gdi); @@ -323,7 +322,6 @@ static inline void FixStockFontSizeA( */ BOOL GDI_Init(void) { - BOOL systemIsBold = (TWEAK_WineLook == WIN31_LOOK); HPALETTE16 hpalette; HINSTANCE16 instance; @@ -344,9 +342,9 @@ BOOL GDI_Init(void) ReadFontInformation("OEMFixed", &OEMFixedFont, 0, 0, 0, 0, 0); ReadFontInformation("AnsiFixed", &AnsiFixedFont, 0, 0, 0, 0, 0); ReadFontInformation("AnsiVar", &AnsiVarFont, 0, 0, 0, 0, 0); - ReadFontInformation("System", &SystemFont, 0, systemIsBold, 0, 0, 0); + ReadFontInformation("System", &SystemFont, 0, 0, 0, 0, 0); ReadFontInformation("DeviceDefault", &DeviceDefaultFont, 0, 0, 0, 0, 0); - ReadFontInformation("SystemFixed", &SystemFixedFont, 0, systemIsBold, 0, 0, 0); + ReadFontInformation("SystemFixed", &SystemFixedFont, 0, 0, 0, 0, 0); ReadFontInformation("DefaultGui", &DefaultGuiFont, 0, 0, 0, 0, 0); /* Create default palette */ diff --git a/windows/defwnd.c b/windows/defwnd.c index 0c230d41788e1cde4324814ea3ef903578476cbf..91f74e4d4e1c9b5be12042c980561828c0a55725 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -15,8 +15,6 @@ #include "dce.h" #include "debugtools.h" #include "spy.h" -#include "tweak.h" -#include "cache.h" #include "windef.h" #include "wingdi.h" #include "winnls.h" diff --git a/windows/mdi.c b/windows/mdi.c index 209e9cb84715a2caaa5e4ff2b9f2c72c2124dfc3..7f66fe77edee5edaba379ebb4117624497e97ed3 100644 --- a/windows/mdi.c +++ b/windows/mdi.c @@ -82,7 +82,6 @@ #include "controls.h" #include "user.h" #include "struct32.h" -#include "tweak.h" #include "debugtools.h" #include "dlgs.h" diff --git a/windows/msgbox.c b/windows/msgbox.c index 99edf71d99dd8768d88b6c900381d227797b978b..a80e3c661b706db71a82a98335b836f62126be27 100644 --- a/windows/msgbox.c +++ b/windows/msgbox.c @@ -12,8 +12,8 @@ #include "wine/winuser16.h" #include "dlgs.h" #include "heap.h" +#include "user.h" #include "debugtools.h" -#include "tweak.h" DEFAULT_DEBUG_CHANNEL(dialog); diff --git a/windows/nonclient.c b/windows/nonclient.c index 86db5b323907865c93c3d2be2475586a868ae7de..979daff515ff903a2a95022c06d42024fc2d6dad 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -20,11 +20,9 @@ #include "hook.h" #include "nonclient.h" #include "queue.h" -#include "tweak.h" #include "debugtools.h" #include "options.h" #include "shellapi.h" -#include "cache.h" #include "bitmap.h" DEFAULT_DEBUG_CHANNEL(nonclient); diff --git a/windows/painting.c b/windows/painting.c index 208aacbed4d3b765f6941c83e0d9502eee08cae5..b6778117e01b9b0e07c40f7dc35e6e5d91c2ac63 100644 --- a/windows/painting.c +++ b/windows/painting.c @@ -10,12 +10,12 @@ #include "wine/winuser16.h" #include "wine/unicode.h" #include "region.h" +#include "user.h" #include "win.h" #include "queue.h" #include "dce.h" #include "heap.h" #include "debugtools.h" -#include "cache.h" DEFAULT_DEBUG_CHANNEL(win); DECLARE_DEBUG_CHANNEL(nonclient); diff --git a/windows/syscolor.c b/windows/syscolor.c index 9dd3915ad29361550a0cb15d9ce1e8870ca7298b..a871b54e8093370ab57390955960f6bb8be37b6f 100644 --- a/windows/syscolor.c +++ b/windows/syscolor.c @@ -18,9 +18,9 @@ #include "winbase.h" #include "winuser.h" #include "debugtools.h" -#include "tweak.h" #include "winreg.h" #include "local.h" +#include "user.h" #include "gdi.h" /* sic */ DEFAULT_DEBUG_CHANNEL(syscolor); diff --git a/windows/sysmetrics.c b/windows/sysmetrics.c index c2b31406b34abe3d62770fc902a32c51eb435693..9fc7fd2eb4f47695f909eaa639ef69517fcecc7a 100644 --- a/windows/sysmetrics.c +++ b/windows/sysmetrics.c @@ -14,8 +14,8 @@ #include "winbase.h" #include "winuser.h" #include "options.h" +#include "user.h" #include "sysmetrics.h" -#include "tweak.h" static int sysMetrics[SM_WINE_CMETRICS+1]; diff --git a/windows/sysparams.c b/windows/sysparams.c index c7c17c87d43f1ba18ea202a03d312c1dff28d54f..d435a196d0e967622e66783ddb7a9723230d01bd 100644 --- a/windows/sysparams.c +++ b/windows/sysparams.c @@ -17,7 +17,6 @@ #include "controls.h" #include "keyboard.h" -#include "tweak.h" #include "user.h" #include "debugtools.h"