Bug 1822519 - When qcms_profile_from_memory fails, default to sRGB for display space...
[gecko.git] / widget / WidgetMessageUtils.h
blobd7ae0a17b48dce71144eb9b19afe5f7aea01bd0b
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/DimensionRequest.h"
11 #include "mozilla/GfxMessageUtils.h"
12 #include "mozilla/LookAndFeel.h"
13 #include "mozilla/widget/ThemeChangeKind.h"
14 #include "nsIWidget.h"
15 #include "nsStyleConsts.h"
17 namespace IPC {
19 template <>
20 struct ParamTraits<mozilla::widget::ThemeChangeKind>
21 : public BitFlagsEnumSerializer<mozilla::widget::ThemeChangeKind,
22 mozilla::widget::ThemeChangeKind::AllBits> {
25 template <>
26 struct ParamTraits<mozilla::LookAndFeel::IntID>
27 : ContiguousEnumSerializer<mozilla::LookAndFeel::IntID,
28 mozilla::LookAndFeel::IntID(0),
29 mozilla::LookAndFeel::IntID::End> {
30 using IdType = std::underlying_type_t<mozilla::LookAndFeel::IntID>;
33 template <>
34 struct ParamTraits<mozilla::LookAndFeel::ColorID>
35 : ContiguousEnumSerializer<mozilla::LookAndFeel::ColorID,
36 mozilla::LookAndFeel::ColorID(0),
37 mozilla::LookAndFeel::ColorID::End> {
38 using IdType = std::underlying_type_t<mozilla::LookAndFeel::ColorID>;
41 template <>
42 struct ParamTraits<mozilla::widget::TransparencyMode>
43 : ContiguousEnumSerializerInclusive<
44 mozilla::widget::TransparencyMode,
45 mozilla::widget::TransparencyMode::Opaque,
46 mozilla::widget::TransparencyMode::BorderlessGlass> {};
48 template <>
49 struct ParamTraits<nsCursor>
50 : ContiguousEnumSerializer<nsCursor, eCursor_standard, eCursorCount> {};
52 template <>
53 struct ParamTraits<nsIWidget::TouchpadGesturePhase>
54 : ContiguousEnumSerializerInclusive<
55 nsIWidget::TouchpadGesturePhase,
56 nsIWidget::TouchpadGesturePhase::PHASE_BEGIN,
57 nsIWidget::TouchpadGesturePhase::PHASE_END> {};
59 template <>
60 struct ParamTraits<nsIWidget::TouchPointerState>
61 : public BitFlagsEnumSerializer<nsIWidget::TouchPointerState,
62 nsIWidget::TouchPointerState::ALL_BITS> {};
64 template <>
65 struct ParamTraits<mozilla::DimensionKind>
66 : public ContiguousEnumSerializerInclusive<mozilla::DimensionKind,
67 mozilla::DimensionKind::Inner,
68 mozilla::DimensionKind::Outer> {
71 DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::DimensionRequest, mDimensionKind, mX,
72 mY, mWidth, mHeight);
74 } // namespace IPC
76 #endif // WidgetMessageUtils_h