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 // Origin of the system context menu when displayed in full screen mode
28 #define MOZ_SYSCONTEXT_X_POS 20
29 #define MOZ_SYSCONTEXT_Y_POS 20
31 // Don't put more than this many rects in the dirty region, just fluff
32 // out to the bounding-box if there are more
33 #define MAX_RECTS_IN_REGION 100
35 // Tablet PC Mouse Input Source
36 #define TABLET_INK_SIGNATURE 0xFFFFFF00
37 #define TABLET_INK_CHECK 0xFF515700
38 #define TABLET_INK_TOUCH 0x00000080
39 #define TABLET_INK_ID_MASK 0x0000007F
40 #define MOUSE_INPUT_SOURCE() WinUtils::GetMouseInputSource()
41 #define MOUSE_POINTERID() WinUtils::GetMousePointerID()
43 /**************************************************************
47 **************************************************************/
50 * Native windows class names
54 * External apps and drivers depend on window class names.
55 * For example, changing the window classes could break
56 * touchpad scrolling or screen readers.
60 const wchar_t kClassNameHidden
[] = L
"MozillaHiddenWindowClass";
61 const wchar_t kClassNameGeneral
[] = L
"MozillaWindowClass";
62 const wchar_t kClassNameDialog
[] = L
"MozillaDialogClass";
63 const wchar_t kClassNameDropShadow
[] = L
"MozillaDropShadowWindowClass";
64 const wchar_t kClassNameTemp
[] = L
"MozillaTempWindowClass";
65 const wchar_t kClassNameTransition
[] = L
"MozillaTransitionWindowClass";
67 /**************************************************************
71 **************************************************************/
73 // Used for synthesizing events
78 KeyPair(uint32_t aGeneral
, uint32_t aSpecific
)
79 : mGeneral(aGeneral
& 0xFF),
80 mSpecific(aSpecific
& 0xFF),
81 mScanCode((aGeneral
& 0xFFFF0000) >> 16) {}
82 KeyPair(uint8_t aGeneral
, uint8_t aSpecific
, uint16_t aScanCode
)
83 : mGeneral(aGeneral
), mSpecific(aSpecific
), mScanCode(aScanCode
) {}
87 struct TITLEBARINFOEX
{
90 DWORD rgstate
[CCHILDREN_TITLEBAR
+ 1];
91 RECT rgrect
[CCHILDREN_TITLEBAR
+ 1];
99 // Result for the message.
101 // If mConsumed is true, the caller shouldn't call next wndproc.
104 explicit MSGResult(LRESULT
* aResult
= nullptr)
105 : mResult(aResult
? *aResult
: mDefaultResult
), mConsumed(false) {}
108 LRESULT mDefaultResult
;
111 } // namespace widget
112 } // namespace mozilla
114 /**************************************************************
118 **************************************************************/
120 #define NSRGB_2_COLOREF(color) \
121 RGB(NS_GET_R(color), NS_GET_G(color), NS_GET_B(color))
122 #define COLOREF_2_NSRGB(color) \
123 NS_RGB(GetRValue(color), GetGValue(color), GetBValue(color))
125 #define VERIFY_WINDOW_STYLE(s) \
126 NS_ASSERTION(((s) & (WS_CHILD | WS_POPUP)) != (WS_CHILD | WS_POPUP), \
127 "WS_POPUP and WS_CHILD are mutually exclusive")
129 #endif /* WindowDefs_h__ */