1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10 * nsWindowDefs - nsWindow related definitions, consts, and macros.
13 #include "mozilla/widget/WinMessages.h"
14 #include "nsBaseWidget.h"
18 /**************************************************************
22 **************************************************************/
24 // ConstrainPosition window positioning slop value
25 #define kWindowPositionSlop 20
27 // Don't put more than this many rects in the dirty region, just fluff
28 // out to the bounding-box if there are more
29 #define MAX_RECTS_IN_REGION 100
31 // Tablet PC Mouse Input Source
32 #define TABLET_INK_SIGNATURE 0xFFFFFF00
33 #define TABLET_INK_CHECK 0xFF515700
34 #define TABLET_INK_TOUCH 0x00000080
35 #define TABLET_INK_ID_MASK 0x0000007F
36 #define MOUSE_INPUT_SOURCE() WinUtils::GetMouseInputSource()
37 #define MOUSE_POINTERID() WinUtils::GetMousePointerID()
39 /**************************************************************
43 **************************************************************/
46 * Native windows class names
50 * External apps and drivers depend on window class names.
51 * For example, changing the window classes could break
52 * touchpad scrolling or screen readers.
56 const wchar_t kClassNameHidden
[] = L
"MozillaHiddenWindowClass";
57 const wchar_t kClassNameGeneral
[] = L
"MozillaWindowClass";
58 const wchar_t kClassNameDialog
[] = L
"MozillaDialogClass";
59 const wchar_t kClassNameDropShadow
[] = L
"MozillaDropShadowWindowClass";
60 const wchar_t kClassNameTransition
[] = L
"MozillaTransitionWindowClass";
62 /**************************************************************
66 **************************************************************/
68 // Used for synthesizing events
73 KeyPair(uint32_t aGeneral
, uint32_t aSpecific
)
74 : mGeneral(aGeneral
& 0xFF),
75 mSpecific(aSpecific
& 0xFF),
76 mScanCode((aGeneral
& 0xFFFF0000) >> 16) {}
77 KeyPair(uint8_t aGeneral
, uint8_t aSpecific
, uint16_t aScanCode
)
78 : mGeneral(aGeneral
), mSpecific(aSpecific
), mScanCode(aScanCode
) {}
85 // Result for the message.
87 // If mConsumed is true, the caller shouldn't call next wndproc.
90 explicit MSGResult(LRESULT
* aResult
= nullptr)
91 : mResult(aResult
? *aResult
: mDefaultResult
), mConsumed(false) {}
94 LRESULT mDefaultResult
;
98 } // namespace mozilla
100 /**************************************************************
104 **************************************************************/
106 #define NSRGB_2_COLOREF(color) \
107 RGB(NS_GET_R(color), NS_GET_G(color), NS_GET_B(color))
108 #define COLOREF_2_NSRGB(color) \
109 NS_RGB(GetRValue(color), GetGValue(color), GetBValue(color))
111 #define VERIFY_WINDOW_STYLE(s) \
112 NS_ASSERTION(((s) & (WS_CHILD | WS_POPUP)) != (WS_CHILD | WS_POPUP), \
113 "WS_POPUP and WS_CHILD are mutually exclusive")
115 #endif /* WindowDefs_h__ */