Bug 1688354 [wpt PR 27298] - Treat 'rem' as an absolute unit for font size, a=testonly
[gecko.git] / widget / WidgetMessageUtils.h
blob8aa2e01591b75dd862b21167400c7c8c9399ebef
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_WidgetMessageUtils_h
6 #define mozilla_WidgetMessageUtils_h
8 #include "ipc/EnumSerializer.h"
9 #include "ipc/IPCMessageUtils.h"
10 #include "mozilla/LookAndFeel.h"
11 #include "mozilla/widget/ThemeChangeKind.h"
12 #include "nsIWidget.h"
13 #include "nsStyleConsts.h"
15 namespace IPC {
17 template <>
18 struct ParamTraits<mozilla::widget::ThemeChangeKind>
19 : public BitFlagsEnumSerializer<mozilla::widget::ThemeChangeKind,
20 mozilla::widget::ThemeChangeKind::AllBits> {
23 template <>
24 struct ParamTraits<mozilla::LookAndFeel::IntID>
25 : ContiguousEnumSerializer<mozilla::LookAndFeel::IntID,
26 mozilla::LookAndFeel::IntID::CaretBlinkTime,
27 mozilla::LookAndFeel::IntID::End> {
28 using IdType = std::underlying_type_t<mozilla::LookAndFeel::IntID>;
29 static_assert(static_cast<IdType>(
30 mozilla::LookAndFeel::IntID::CaretBlinkTime) == IdType(0));
33 template <>
34 struct ParamTraits<mozilla::LookAndFeel::ColorID>
35 : ContiguousEnumSerializer<mozilla::LookAndFeel::ColorID,
36 mozilla::LookAndFeel::ColorID::WindowBackground,
37 mozilla::LookAndFeel::ColorID::End> {
38 using IdType = std::underlying_type_t<mozilla::LookAndFeel::ColorID>;
39 static_assert(
40 static_cast<IdType>(mozilla::LookAndFeel::ColorID::WindowBackground) ==
41 IdType(0));
44 template <>
45 struct ParamTraits<nsTransparencyMode>
46 : ContiguousEnumSerializerInclusive<nsTransparencyMode, eTransparencyOpaque,
47 eTransparencyBorderlessGlass> {};
49 template <>
50 struct ParamTraits<nsCursor>
51 : ContiguousEnumSerializer<nsCursor, eCursor_standard, eCursorCount> {};
53 template <>
54 struct ParamTraits<nsIWidget::TouchPointerState>
55 : public BitFlagsEnumSerializer<nsIWidget::TouchPointerState,
56 nsIWidget::TouchPointerState::ALL_BITS> {};
58 } // namespace IPC
60 #endif // WidgetMessageUtils_h