зеркало из https://github.com/mozilla/pjs.git
Bug 361154: Drop support for pre-Win2k platforms from Win32 widgets, patch by Ryan Jones <bugs@ryan-jones.com>, r=ere, sr=roc
This commit is contained in:
Родитель
ed82ec7f2e
Коммит
5d2d1a1d5b
|
@ -51,8 +51,6 @@
|
|||
#include "nsIInputStream.h"
|
||||
#include "nsIChannel.h"
|
||||
|
||||
#define MAX_FORMATS 32
|
||||
|
||||
// XXX for older version of PSDK where IAsyncOperation and related stuff is not available
|
||||
// but thisdefine should be removed when parocles config is updated
|
||||
#ifndef __IAsyncOperation_INTERFACE_DEFINED__
|
||||
|
|
|
@ -44,16 +44,7 @@
|
|||
|
||||
#define VK_OEM_1 0xBA // ';:' for US
|
||||
#define VK_OEM_PLUS 0xBB // '+' any country
|
||||
#define VK_OEM_COMMA 0xBC // ',' any country
|
||||
#define VK_OEM_MINUS 0xBD // '-' any country
|
||||
#define VK_OEM_PERIOD 0xBE // '.' any country
|
||||
#define VK_OEM_2 0xBF // '/?' for US
|
||||
#define VK_OEM_3 0xC0 // '`~' for US
|
||||
#define VK_OEM_4 0xDB // '[{' for US
|
||||
#define VK_OEM_5 0xDC // '\|' for US
|
||||
#define VK_OEM_6 0xDD // ']}' for US
|
||||
#define VK_OEM_7 0xDE // ''"' for US
|
||||
#define VK_OEM_8 0xDF
|
||||
|
||||
|
||||
|
||||
|
@ -145,7 +136,6 @@ class KeyboardLayout
|
|||
|
||||
#define NUM_OF_KEYS 50
|
||||
|
||||
UINT mCodePage; // Used for Win9x only
|
||||
HKL mKeyboardLayout;
|
||||
|
||||
VirtualKey mVirtualKeys [NUM_OF_KEYS];
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <shellapi.h>
|
||||
#include "nsWindow.h"
|
||||
|
||||
// Constants only found in new (98+, 2K+, XP+, etc.) Windows.
|
||||
// Constants only found in new (2K+, XP+, etc.) Windows.
|
||||
#ifndef COLOR_MENUHILIGHT
|
||||
#define COLOR_MENUHILIGHT 29
|
||||
#endif
|
||||
|
@ -64,12 +64,13 @@ SHAppBarMessagePtr gSHAppBarMessage = NULL;
|
|||
static HINSTANCE gShell32DLLInst = NULL;
|
||||
#endif
|
||||
|
||||
static PRInt32 GetSystemParam(long flag, PRInt32 def) {
|
||||
static PRInt32 GetSystemParam(long flag, PRInt32 def)
|
||||
{
|
||||
#ifdef WINCE
|
||||
return def;
|
||||
#else
|
||||
DWORD value;
|
||||
return SystemParametersInfo(flag, 0, &value, 0) ? value : def;
|
||||
return ::SystemParametersInfo(flag, 0, &value, 0) ? value : def;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -270,16 +271,11 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
|
|||
idx = COLOR_3DDKSHADOW;
|
||||
break;
|
||||
case eColor__moz_menubarhovertext: {
|
||||
BOOL isFlatMenus;
|
||||
HRESULT rv;
|
||||
|
||||
// This will simply fail on Windows versions prior to XP, so we get
|
||||
// non-flat as desired.
|
||||
rv = ::SystemParametersInfo(SPI_GETFLATMENU, 0, &isFlatMenus, 0);
|
||||
if (rv && isFlatMenus)
|
||||
idx = COLOR_HIGHLIGHTTEXT; /* flat menus (XP themes and later only) */
|
||||
else
|
||||
idx = COLOR_MENUTEXT; /* 3d menus (pre-XP, some themes) */
|
||||
// GetSystemParam will return 0 on failure and we get non-flat as
|
||||
// desired for Windows 2000 and sometimes on XP.
|
||||
idx = (GetSystemParam(SPI_GETFLATMENU, 0)) ?
|
||||
COLOR_HIGHLIGHTTEXT :
|
||||
COLOR_MENUTEXT;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -372,7 +368,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_SubmenuDelay:
|
||||
// This will default to the Window's default
|
||||
// This will default to the Windows' default
|
||||
// (400ms) on error.
|
||||
aMetric = GetSystemParam(SPI_GETMENUSHOWDELAY, 400);
|
||||
break;
|
||||
|
@ -381,7 +377,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_DragFullWindow:
|
||||
// This will default to the Window's default
|
||||
// This will default to the Windows' default
|
||||
// (on by default) on error.
|
||||
aMetric = GetSystemParam(SPI_GETDRAGFULLWINDOWS, 1);
|
||||
break;
|
||||
|
@ -402,19 +398,14 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
// The high contrast flag really means -- use this theme and don't override it.
|
||||
HIGHCONTRAST contrastThemeInfo;
|
||||
contrastThemeInfo.cbSize = sizeof(contrastThemeInfo);
|
||||
// Need to check return from SystemParametersInfo since
|
||||
// SPI_GETHIGHCONTRAST is not supported on Windows NT
|
||||
if (SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, &contrastThemeInfo, 0)) {
|
||||
aMetric = (contrastThemeInfo.dwFlags & HCF_HIGHCONTRASTON) != 0;
|
||||
}
|
||||
else {
|
||||
aMetric = 0;
|
||||
}
|
||||
::SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, &contrastThemeInfo, 0);
|
||||
|
||||
aMetric = ((contrastThemeInfo.dwFlags & HCF_HIGHCONTRASTON) != 0);
|
||||
break;
|
||||
case eMetric_IsScreenReaderActive:
|
||||
BOOL isScreenReaderActive;
|
||||
aMetric = SystemParametersInfo(SPI_GETSCREENREADER, 0, &isScreenReaderActive, 0) &&
|
||||
isScreenReaderActive;
|
||||
// This will default to the Windows' default
|
||||
// (off by default) on error.
|
||||
aMetric = GetSystemParam(SPI_GETSCREENREADER, 0);
|
||||
break;
|
||||
#endif
|
||||
case eMetric_ScrollArrowStyle:
|
||||
|
@ -537,7 +528,8 @@ PRUnichar nsLookAndFeel::GetPasswordCharacter()
|
|||
if (!passwordCharacter) {
|
||||
passwordCharacter = '*';
|
||||
#ifndef WINCE
|
||||
OSVERSIONINFO osversion = { sizeof(OSVERSIONINFO) };
|
||||
OSVERSIONINFO osversion;
|
||||
osversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
::GetVersionEx(&osversion);
|
||||
if (osversion.dwMajorVersion > 5 ||
|
||||
osversion.dwMajorVersion == 5 && osversion.dwMinorVersion > 0)
|
||||
|
|
|
@ -249,14 +249,12 @@ nsNativeThemeWin::UpdateConfig()
|
|||
{
|
||||
// Check for Windows XP (or later), and check if 'flat menus' are enabled.
|
||||
BOOL isFlatMenus;
|
||||
HRESULT rv;
|
||||
mFlatMenus = PR_FALSE;
|
||||
|
||||
// This will simply fail on Windows versions prior to XP, so we get
|
||||
// non-flat as desired.
|
||||
rv = ::SystemParametersInfo(SPI_GETFLATMENU, 0, &isFlatMenus, 0);
|
||||
if (rv)
|
||||
mFlatMenus = isFlatMenus;
|
||||
::SystemParametersInfo(SPI_GETFLATMENU, 0, &isFlatMenus, 0);
|
||||
mFlatMenus = isFlatMenus;
|
||||
}
|
||||
|
||||
HANDLE
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsWidgetAtoms.h"
|
||||
#include "nsWindowAPI.h"
|
||||
#include <objbase.h>
|
||||
#include <initguid.h>
|
||||
|
||||
|
@ -159,12 +160,6 @@ LRESULT CALLBACK DetectWindowMove(int code, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
#endif //#ifndef WINCE
|
||||
|
||||
#include "nsWindowAPI.h"
|
||||
|
||||
#define MAX_CLASS_NAME 128
|
||||
#define MAX_MENU_NAME 128
|
||||
#define MAX_FILTER_NAME 256
|
||||
|
||||
MouseTrailer* nsToolkit::gMouseTrailer;
|
||||
|
||||
void RunPump(void* arg)
|
||||
|
@ -371,7 +366,7 @@ NS_METHOD nsToolkit::Init(PRThread *aThread)
|
|||
// the user is moving a top-level window.
|
||||
if (nsMsgFilterHook == NULL) {
|
||||
nsMsgFilterHook = SetWindowsHookEx(WH_CALLWNDPROC, DetectWindowMove,
|
||||
NULL, GetCurrentThreadId());
|
||||
NULL, GetCurrentThreadId());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -389,7 +384,7 @@ PRBool nsToolkit::UserIsMovingWindow(void)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
LRESULT CALLBACK nsToolkit::WindowProc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
LPARAM lParam)
|
||||
{
|
||||
switch (msg) {
|
||||
case WM_CALLMETHOD:
|
||||
|
@ -478,16 +473,10 @@ PRBool nsToolkit::InitVersionInfo()
|
|||
isInitialized = PR_TRUE;
|
||||
|
||||
#ifndef WINCE
|
||||
OSVERSIONINFOEX osversion;
|
||||
BOOL osVersionInfoEx;
|
||||
|
||||
::ZeroMemory(&osversion, sizeof(OSVERSIONINFOEX));
|
||||
osversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
OSVERSIONINFO osversion;
|
||||
osversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
|
||||
if (!(osVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osversion))) {
|
||||
// Win2k or later should support OSVERSIONINFOEX.
|
||||
return PR_FALSE;
|
||||
}
|
||||
::GetVersionEx(&osversion);
|
||||
|
||||
if (osversion.dwMajorVersion == 5) {
|
||||
nsToolkit::mIsWinXP = (osversion.dwMinorVersion == 1);
|
||||
|
|
|
@ -80,18 +80,6 @@
|
|||
#include <process.h>
|
||||
|
||||
#ifdef WINCE
|
||||
#define NS_VK_APP1 0x0201
|
||||
#define NS_VK_APP2 0x0202
|
||||
#define NS_VK_APP3 0x0203
|
||||
#define NS_VK_APP4 0x0204
|
||||
#define NS_VK_APP5 0x0205
|
||||
#define NS_VK_APP6 0x0206
|
||||
#define NS_VK_APP7 0x0207
|
||||
#define NS_VK_APP8 0x0208
|
||||
#define NS_VK_APP9 0x0209
|
||||
#define NS_VK_APP10 0x020A
|
||||
#define NS_VK_APP11 0x020B
|
||||
|
||||
#include "aygshell.h"
|
||||
#include "imm.h"
|
||||
#include "tpcshell.h"
|
||||
|
@ -182,7 +170,7 @@ static const char kMozHeapDumpMessageString[] = "MOZ_HeapDump";
|
|||
#define MAPVK_VSC_TO_VK 1
|
||||
#define MAPVK_VK_TO_CHAR 2
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
|
||||
#ifndef AC_SRC_ALPHA
|
||||
|
|
Загрузка…
Ссылка в новой задаче