Moved tweak support to USER dll. Removed tweak.h and cache.h.

This commit is contained in:
Alexandre Julliard 2001-01-15 20:12:55 +00:00
parent 7d5bc5c3f9
commit a41b2cfdd0
28 changed files with 70 additions and 176 deletions

View file

@ -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

View file

@ -19,7 +19,6 @@
#include "heap.h"
#include "controls.h"
#include "debugtools.h"
#include "tweak.h"
DEFAULT_DEBUG_CHANNEL(combo);

View file

@ -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);

View file

@ -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);

View file

@ -32,7 +32,6 @@
#include "user.h"
#include "message.h"
#include "queue.h"
#include "tweak.h"
#include "debugtools.h"

View file

@ -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
{

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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());
{
hPattern55AABitmap = CreateBitmap( 8, 8, 1, 1, wPattern55AA );
hPattern55AABrush = CreatePatternBrush( hPattern55AABitmap );
}
return hPattern55AABrush;
}
/*********************************************************************
* CACHE_GetPattern55AABitmap
*/
HBITMAP CACHE_GetPattern55AABitmap(void)
{
if (!hPattern55AABitmap)
hPattern55AABitmap = CreateBitmap( 8, 8, 1, 1, wPattern55AA );
return hPattern55AABitmap;
}

View file

@ -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);

View file

@ -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*/

View file

@ -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 */

View file

@ -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"

View file

@ -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 */

View file

@ -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 */

View file

@ -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 */

View file

@ -15,7 +15,6 @@ C_SRCS = \
options.c \
registry.c \
system.c \
tweak.c \
version.c
all: $(MODULE).o

View file

@ -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;
}

View file

@ -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 */

View file

@ -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"

View file

@ -82,7 +82,6 @@
#include "controls.h"
#include "user.h"
#include "struct32.h"
#include "tweak.h"
#include "debugtools.h"
#include "dlgs.h"

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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];

View file

@ -17,7 +17,6 @@
#include "controls.h"
#include "keyboard.h"
#include "tweak.h"
#include "user.h"
#include "debugtools.h"