Bug 1257759 part.2 Separate Windows' message and related definitions from nsWindowDefs.h to mozilla/widget/WinMessages.h r=jimm

This patch separates Windows' message definition and related definitions from nsWindowDefs.h to mozilla/widget/WinMessages.h because the definitions are useful in plugin module but nsWindowDefs.h cannot be included from plugin module since it depends on some headers in under widget.

MozReview-Commit-ID: KNUAffLMKT1

--HG--
rename : widget/windows/nsWindowDefs.h => widget/windows/WinMessages.h
extra : rebase_source : ae9390e700ca97a0a4eea3b2977d4d5568ce9408
This commit is contained in:
Masayuki Nakano 2016-04-09 15:15:31 +09:00
Родитель 3a41e70ea1
Коммит f19611cb89
5 изменённых файлов: 184 добавлений и 170 удалений

Просмотреть файл

@ -73,13 +73,8 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
#ifdef XP_WIN
#include <wtypes.h>
#include <winuser.h>
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL (0x020E)
#endif
#ifndef SPI_GETWHEELSCROLLCHARS
#define SPI_GETWHEELSCROLLCHARS (0x006C)
#endif
#endif
#include "mozilla/widget/WinMessages.h"
#endif // #ifdef XP_WIN
#ifdef XP_MACOSX
#include "ComplexTextInputPanel.h"

Просмотреть файл

@ -56,10 +56,11 @@ using namespace std;
#undef KeyPress
#undef KeyRelease
#elif defined(OS_WIN)
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E
#endif
#include <windows.h>
#include <windowsx.h>
#include "mozilla/widget/WinMessages.h"
#include "nsWindowsDllInterceptor.h"
typedef BOOL (WINAPI *User32TrackPopupMenu)(HMENU hMenu,
@ -94,9 +95,6 @@ static const HIMC sHookIMC = (const HIMC)0xefefefef;
using mozilla::gfx::SharedDIB;
#include <windows.h>
#include <windowsx.h>
// Flash WM_USER message delay time for PostDelayedTask. Borrowed
// from Chromium's web plugin delegate src. See 'flash msg throttling
// helpers' section for details.

Просмотреть файл

@ -0,0 +1,176 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_widget_WinMessages_h_
#define mozilla_widget_WinMessages_h_
/*****************************************************************************
* MOZ_WM_* messages
****************************************************************************/
// A magic APP message that can be sent to quit, sort of like a
// QUERYENDSESSION/ENDSESSION, but without the query.
#define MOZ_WM_APP_QUIT (WM_APP+0x0300)
// Used as a "tracer" event to probe event loop latency.
#define MOZ_WM_TRACE (WM_APP+0x0301)
// Our internal message for WM_MOUSEWHEEL, WM_MOUSEHWHEEL, WM_VSCROLL and
// WM_HSCROLL
#define MOZ_WM_MOUSEVWHEEL (WM_APP+0x0310)
#define MOZ_WM_MOUSEHWHEEL (WM_APP+0x0311)
#define MOZ_WM_VSCROLL (WM_APP+0x0312)
#define MOZ_WM_HSCROLL (WM_APP+0x0313)
#define MOZ_WM_MOUSEWHEEL_FIRST MOZ_WM_MOUSEVWHEEL
#define MOZ_WM_MOUSEWHEEL_LAST MOZ_WM_HSCROLL
// If a popup window is being activated, we try to reactivate the previous
// window with this message.
#define MOZ_WM_REACTIVATE (WM_APP+0x0314)
// If TSFTextStore needs to notify TSF/TIP of layout change later, this
// message is posted.
#define MOZ_WM_NOTIY_TSF_OF_LAYOUT_CHANGE (WM_APP+0x0315)
// Internal message used in correcting backwards clock skew
#define MOZ_WM_SKEWFIX (WM_APP+0x0316)
// Internal message used for hiding the on-screen keyboard
#define MOZ_WM_DISMISS_ONSCREEN_KEYBOARD (WM_APP+0x0317)
// Internal message for ensuring the file picker is visible on multi monitor
// systems, and when the screen resolution changes.
#define MOZ_WM_ENSUREVISIBLE (WM_APP+0x374F)
// XXX Should rename them to MOZ_WM_* and use safer values!
// Messages for fullscreen transition window
#define WM_FULLSCREEN_TRANSITION_BEFORE (WM_USER + 0)
#define WM_FULLSCREEN_TRANSITION_AFTER (WM_USER + 1)
/*****************************************************************************
* WM_* messages and related constants which may not be defined by
* old Windows SDK
****************************************************************************/
#ifndef SM_CXPADDEDBORDER
#define SM_CXPADDEDBORDER 92
#endif
// require WINVER >= 0x601
#ifndef SM_MAXIMUMTOUCHES
#define SM_MAXIMUMTOUCHES 95
#endif
#ifndef WM_THEMECHANGED
#define WM_THEMECHANGED 0x031A
#endif
#ifndef WM_GETOBJECT
#define WM_GETOBJECT 0x03d
#endif
#ifndef PBT_APMRESUMEAUTOMATIC
#define PBT_APMRESUMEAUTOMATIC 0x0012
#endif
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E
#endif
#ifndef MOUSEEVENTF_HWHEEL
#define MOUSEEVENTF_HWHEEL 0x01000
#endif
#ifndef WM_MOUSELEAVE
#define WM_MOUSELEAVE 0x02A3
#endif
#ifndef SPI_GETWHEELSCROLLCHARS
#define SPI_GETWHEELSCROLLCHARS 0x006C
#endif
#ifndef SPI_SETWHEELSCROLLCHARS
#define SPI_SETWHEELSCROLLCHARS 0x006D
#endif
#ifndef MAPVK_VSC_TO_VK
#define MAPVK_VK_TO_VSC 0
#define MAPVK_VSC_TO_VK 1
#define MAPVK_VK_TO_CHAR 2
#define MAPVK_VSC_TO_VK_EX 3
#define MAPVK_VK_TO_VSC_EX 4
#endif
#ifndef WM_DWMCOMPOSITIONCHANGED
#define WM_DWMCOMPOSITIONCHANGED 0x031E
#endif
#ifndef WM_DWMNCRENDERINGCHANGED
#define WM_DWMNCRENDERINGCHANGED 0x031F
#endif
#ifndef WM_DWMCOLORIZATIONCOLORCHANGED
#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320
#endif
#ifndef WM_DWMWINDOWMAXIMIZEDCHANGE
#define WM_DWMWINDOWMAXIMIZEDCHANGE 0x0321
#endif
// Drop shadow window style
#define CS_XP_DROPSHADOW 0x00020000
// App Command messages for IntelliMouse and Natural Keyboard Pro
// These messages are not included in Visual C++ 6.0, but are in 7.0+
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif
#define FAPPCOMMAND_MASK 0xF000
#ifndef WM_GETTITLEBARINFOEX
#define WM_GETTITLEBARINFOEX 0x033F
#endif
#ifndef CCHILDREN_TITLEBAR
#define CCHILDREN_TITLEBAR 5
#endif
#ifndef APPCOMMAND_BROWSER_BACKWARD
#define APPCOMMAND_BROWSER_BACKWARD 1
#define APPCOMMAND_BROWSER_FORWARD 2
#define APPCOMMAND_BROWSER_REFRESH 3
#define APPCOMMAND_BROWSER_STOP 4
#define APPCOMMAND_BROWSER_SEARCH 5
#define APPCOMMAND_BROWSER_FAVORITES 6
#define APPCOMMAND_BROWSER_HOME 7
#define APPCOMMAND_MEDIA_NEXTTRACK 11
#define APPCOMMAND_MEDIA_PREVIOUSTRACK 12
#define APPCOMMAND_MEDIA_STOP 13
#define APPCOMMAND_MEDIA_PLAY_PAUSE 14
/*
* Additional commands currently not in use.
*
*#define APPCOMMAND_VOLUME_MUTE 8
*#define APPCOMMAND_VOLUME_DOWN 9
*#define APPCOMMAND_VOLUME_UP 10
*#define APPCOMMAND_LAUNCH_MAIL 15
*#define APPCOMMAND_LAUNCH_MEDIA_SELECT 16
*#define APPCOMMAND_LAUNCH_APP1 17
*#define APPCOMMAND_LAUNCH_APP2 18
*#define APPCOMMAND_BASS_DOWN 19
*#define APPCOMMAND_BASS_BOOST 20
*#define APPCOMMAND_BASS_UP 21
*#define APPCOMMAND_TREBLE_DOWN 22
*#define APPCOMMAND_TREBLE_UP 23
*#define FAPPCOMMAND_MOUSE 0x8000
*#define FAPPCOMMAND_KEY 0
*#define FAPPCOMMAND_OEM 0x1000
*/
#define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
/*
*#define GET_DEVICE_LPARAM(lParam) ((WORD)(HIWORD(lParam) & FAPPCOMMAND_MASK))
*#define GET_MOUSEORKEY_LPARAM GET_DEVICE_LPARAM
*#define GET_FLAGS_LPARAM(lParam) (LOWORD(lParam))
*#define GET_KEYSTATE_LPARAM(lParam) GET_FLAGS_LPARAM(lParam)
*/
#endif // #ifndef APPCOMMAND_BROWSER_BACKWARD
#endif // #ifndef mozilla_widget_WinMessages_h_

Просмотреть файл

@ -14,6 +14,7 @@ EXPORTS += [
EXPORTS.mozilla.widget += [
'AudioSession.h',
'WinMessages.h',
]
UNIFIED_SOURCES += [

Просмотреть файл

@ -10,6 +10,7 @@
* nsWindowDefs - nsWindow related definitions, consts, and macros.
*/
#include "mozilla/widget/WinMessages.h"
#include "nsBaseWidget.h"
#include "nsdefs.h"
#include "resource.h"
@ -20,96 +21,6 @@
*
**************************************************************/
// A magic APP message that can be sent to quit, sort of like a QUERYENDSESSION/ENDSESSION,
// but without the query.
#define MOZ_WM_APP_QUIT (WM_APP+0x0300)
// Used as a "tracer" event to probe event loop latency.
#define MOZ_WM_TRACE (WM_APP+0x0301)
// Our internal message for WM_MOUSEWHEEL, WM_MOUSEHWHEEL, WM_VSCROLL and
// WM_HSCROLL
#define MOZ_WM_MOUSEVWHEEL (WM_APP+0x0310)
#define MOZ_WM_MOUSEHWHEEL (WM_APP+0x0311)
#define MOZ_WM_VSCROLL (WM_APP+0x0312)
#define MOZ_WM_HSCROLL (WM_APP+0x0313)
#define MOZ_WM_MOUSEWHEEL_FIRST MOZ_WM_MOUSEVWHEEL
#define MOZ_WM_MOUSEWHEEL_LAST MOZ_WM_HSCROLL
// If a popup window is being activated, we try to reactivate the previous
// window with this message.
#define MOZ_WM_REACTIVATE (WM_APP+0x0314)
// If TSFTextStore needs to notify TSF/TIP of layout change later, this
// message is posted.
#define MOZ_WM_NOTIY_TSF_OF_LAYOUT_CHANGE (WM_APP+0x0315)
// Internal message used in correcting backwards clock skew
#define MOZ_WM_SKEWFIX (WM_APP+0x0316)
// Internal message used for hiding the on-screen keyboard
#define MOZ_WM_DISMISS_ONSCREEN_KEYBOARD (WM_APP+0x0317)
// Internal message for ensuring the file picker is visible on multi monitor
// systems, and when the screen resolution changes.
#define MOZ_WM_ENSUREVISIBLE (WM_APP+0x374F)
#ifndef SM_CXPADDEDBORDER
#define SM_CXPADDEDBORDER 92
#endif
// require WINVER >= 0x601
#ifndef SM_MAXIMUMTOUCHES
#define SM_MAXIMUMTOUCHES 95
#endif
#ifndef WM_THEMECHANGED
#define WM_THEMECHANGED 0x031A
#endif
#ifndef WM_GETOBJECT
#define WM_GETOBJECT 0x03d
#endif
#ifndef PBT_APMRESUMEAUTOMATIC
#define PBT_APMRESUMEAUTOMATIC 0x0012
#endif
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E
#endif
#ifndef MOUSEEVENTF_HWHEEL
#define MOUSEEVENTF_HWHEEL 0x01000
#endif
#ifndef WM_MOUSELEAVE
#define WM_MOUSELEAVE 0x02A3
#endif
#ifndef SPI_GETWHEELSCROLLCHARS
#define SPI_GETWHEELSCROLLCHARS 0x006C
#endif
#ifndef SPI_SETWHEELSCROLLCHARS
#define SPI_SETWHEELSCROLLCHARS 0x006D
#endif
#ifndef MAPVK_VSC_TO_VK
#define MAPVK_VK_TO_VSC 0
#define MAPVK_VSC_TO_VK 1
#define MAPVK_VK_TO_CHAR 2
#define MAPVK_VSC_TO_VK_EX 3
#define MAPVK_VK_TO_VSC_EX 4
#endif
#ifndef WM_DWMCOMPOSITIONCHANGED
#define WM_DWMCOMPOSITIONCHANGED 0x031E
#endif
#ifndef WM_DWMNCRENDERINGCHANGED
#define WM_DWMNCRENDERINGCHANGED 0x031F
#endif
#ifndef WM_DWMCOLORIZATIONCOLORCHANGED
#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320
#endif
#ifndef WM_DWMWINDOWMAXIMIZEDCHANGE
#define WM_DWMWINDOWMAXIMIZEDCHANGE 0x0321
#endif
// ConstrainPosition window positioning slop value
#define kWindowPositionSlop 20
@ -117,83 +28,16 @@
#define MOZ_SYSCONTEXT_X_POS 20
#define MOZ_SYSCONTEXT_Y_POS 20
// Drop shadow window style
#define CS_XP_DROPSHADOW 0x00020000
// Don't put more than this many rects in the dirty region, just fluff
// out to the bounding-box if there are more
#define MAX_RECTS_IN_REGION 100
// App Command messages for IntelliMouse and Natural Keyboard Pro
// These messages are not included in Visual C++ 6.0, but are in 7.0+
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif
#define FAPPCOMMAND_MASK 0xF000
#ifndef WM_GETTITLEBARINFOEX
#define WM_GETTITLEBARINFOEX 0x033F
#endif
#ifndef CCHILDREN_TITLEBAR
#define CCHILDREN_TITLEBAR 5
#endif
#ifndef APPCOMMAND_BROWSER_BACKWARD
#define APPCOMMAND_BROWSER_BACKWARD 1
#define APPCOMMAND_BROWSER_FORWARD 2
#define APPCOMMAND_BROWSER_REFRESH 3
#define APPCOMMAND_BROWSER_STOP 4
#define APPCOMMAND_BROWSER_SEARCH 5
#define APPCOMMAND_BROWSER_FAVORITES 6
#define APPCOMMAND_BROWSER_HOME 7
#define APPCOMMAND_MEDIA_NEXTTRACK 11
#define APPCOMMAND_MEDIA_PREVIOUSTRACK 12
#define APPCOMMAND_MEDIA_STOP 13
#define APPCOMMAND_MEDIA_PLAY_PAUSE 14
/*
* Additional commands currently not in use.
*
*#define APPCOMMAND_VOLUME_MUTE 8
*#define APPCOMMAND_VOLUME_DOWN 9
*#define APPCOMMAND_VOLUME_UP 10
*#define APPCOMMAND_LAUNCH_MAIL 15
*#define APPCOMMAND_LAUNCH_MEDIA_SELECT 16
*#define APPCOMMAND_LAUNCH_APP1 17
*#define APPCOMMAND_LAUNCH_APP2 18
*#define APPCOMMAND_BASS_DOWN 19
*#define APPCOMMAND_BASS_BOOST 20
*#define APPCOMMAND_BASS_UP 21
*#define APPCOMMAND_TREBLE_DOWN 22
*#define APPCOMMAND_TREBLE_UP 23
*#define FAPPCOMMAND_MOUSE 0x8000
*#define FAPPCOMMAND_KEY 0
*#define FAPPCOMMAND_OEM 0x1000
*/
#define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
/*
*#define GET_DEVICE_LPARAM(lParam) ((WORD)(HIWORD(lParam) & FAPPCOMMAND_MASK))
*#define GET_MOUSEORKEY_LPARAM GET_DEVICE_LPARAM
*#define GET_FLAGS_LPARAM(lParam) (LOWORD(lParam))
*#define GET_KEYSTATE_LPARAM(lParam) GET_FLAGS_LPARAM(lParam)
*/
#endif // #ifndef APPCOMMAND_BROWSER_BACKWARD
//Tablet PC Mouse Input Source
#define TABLET_INK_SIGNATURE 0xFFFFFF00
#define TABLET_INK_CHECK 0xFF515700
#define TABLET_INK_TOUCH 0x00000080
#define MOUSE_INPUT_SOURCE() WinUtils::GetMouseInputSource()
// Messages for fullscreen transition window
#define WM_FULLSCREEN_TRANSITION_BEFORE (WM_USER + 0)
#define WM_FULLSCREEN_TRANSITION_AFTER (WM_USER + 1)
/**************************************************************
*
* SECTION: enums