Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * tweak.c |
| 4 | * |
| 5 | * Windows 95 style interface tweaks. |
| 6 | * Copyright (c) 1997 Dave Cuthbert. |
| 7 | * |
| 8 | * FIXME: This file is, unfortunately, aptly named: the method of |
| 9 | * displaying Win95 style windows is a tweak. Lots of stuff does not yet |
| 10 | * work -- and probably never will unless some of this code is |
| 11 | * incorporated into the mainstream Wine code. |
| 12 | * |
| 13 | * DEVELOPERS, PLEASE NOTE: Before delving into the mainstream code and |
| 14 | * altering it, consider how your changes will affect the Win3.1 interface |
| 15 | * (which has taken a major effort to create!). After you make any sort of |
| 16 | * non-trivial change, *test* the Wine code running in Win3.1 mode! The |
| 17 | * object here is to make it so that the person who tests the latest version |
| 18 | * of Wine without adding the tweaks into wine.conf notices nothing out of |
| 19 | * the ordinary. |
| 20 | * |
| 21 | * Revision history |
| 22 | * 03-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) |
| 23 | * Original implementation. |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 24 | * 05-Aug-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) |
| 25 | * Removed some unused code. |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 26 | * 22-Sep-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) |
| 27 | * Removed more unused code. |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 28 | * |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 29 | *****************************************************************************/ |
| 30 | |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 31 | #include <string.h> |
Jeremy White | d3e22d9 | 2000-02-10 19:03:02 +0000 | [diff] [blame] | 32 | #include "windef.h" |
| 33 | #include "wingdi.h" |
Marcus Meissner | 04c3e1d | 1999-02-19 10:37:02 +0000 | [diff] [blame] | 34 | #include "winuser.h" |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 35 | #include "tweak.h" |
| 36 | #include "options.h" |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 37 | #include "debugtools.h" |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 38 | |
Patrik Stridvall | b4b9fae | 1999-04-19 14:56:29 +0000 | [diff] [blame] | 39 | DEFAULT_DEBUG_CHANNEL(tweak) |
| 40 | |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 41 | /* General options */ |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 42 | |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 43 | WINE_LOOK TWEAK_WineLook = WIN31_LOOK; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 44 | |
| 45 | |
| 46 | /****************************************************************************** |
| 47 | * |
| 48 | * int TWEAK_Init() |
| 49 | * |
| 50 | * Does the full initialization of the Win95 tweak subsystem. Return value |
| 51 | * indicates success. Called by loader/main.c's MAIN_Init(). |
| 52 | * |
| 53 | * Revision history |
| 54 | * 05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) |
| 55 | * Original implementation. |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 56 | * 22-Sep-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) |
| 57 | * Removed unused code and added Win98 option. |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 58 | * |
| 59 | *****************************************************************************/ |
| 60 | |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 61 | int TWEAK_Init (void) |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 62 | { |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 63 | char szIniString[80]; |
| 64 | |
| 65 | PROFILE_GetWineIniString ("Tweak.Layout", "Win95Look", "TestString", |
| 66 | szIniString, 80); |
| 67 | if (strncmp (szIniString, "TestString", 10)) { |
| 68 | if (PROFILE_GetWineIniBool ("Tweak.Layout", "Win95Look", 0)) { |
| 69 | TWEAK_WineLook = WIN95_LOOK; |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 70 | TRACE("Using Win95 look and feel.\n"); |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 71 | } |
| 72 | else { |
| 73 | TWEAK_WineLook = WIN31_LOOK; |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 74 | TRACE("Using Win3.1 look and feel.\n"); |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 75 | } |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 76 | ERR( |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 77 | "Replace \"Win95Look\" by \"WineLook\" in your \"wine.ini\"!\n"); |
| 78 | } |
| 79 | |
| 80 | PROFILE_GetWineIniString ("Tweak.Layout", "WineLook", "Win31", |
| 81 | szIniString, 80); |
| 82 | |
| 83 | if (!strncasecmp (szIniString, "Win31", 5)) { |
| 84 | TWEAK_WineLook = WIN31_LOOK; |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 85 | TRACE("Using Win3.1 look and feel.\n"); |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 86 | } |
| 87 | else if (!strncasecmp (szIniString, "Win95", 5)) { |
| 88 | TWEAK_WineLook = WIN95_LOOK; |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 89 | TRACE("Using Win95 look and feel.\n"); |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 90 | } |
| 91 | else if (!strncasecmp (szIniString, "Win98", 5)) { |
| 92 | TWEAK_WineLook = WIN98_LOOK; |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 93 | TRACE("Using Win98 look and feel.\n"); |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 94 | } |
| 95 | else { |
| 96 | TWEAK_WineLook = WIN31_LOOK; |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 97 | TRACE("Using Win3.1 look and feel.\n"); |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 98 | } |
| 99 | |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 100 | return 1; |
| 101 | } |