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"
20 struct ParamTraits
<mozilla::widget::ThemeChangeKind
>
21 : public BitFlagsEnumSerializer
<mozilla::widget::ThemeChangeKind
,
22 mozilla::widget::ThemeChangeKind::AllBits
> {
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
>;
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
>;
42 struct ParamTraits
<mozilla::widget::TransparencyMode
>
43 : ContiguousEnumSerializerInclusive
<
44 mozilla::widget::TransparencyMode
,
45 mozilla::widget::TransparencyMode::Opaque
,
46 mozilla::widget::TransparencyMode::Transparent
> {};
49 struct ParamTraits
<nsCursor
>
50 : ContiguousEnumSerializer
<nsCursor
, eCursor_standard
, eCursorCount
> {};
53 struct ParamTraits
<nsIWidget::TouchpadGesturePhase
>
54 : ContiguousEnumSerializerInclusive
<
55 nsIWidget::TouchpadGesturePhase
,
56 nsIWidget::TouchpadGesturePhase::PHASE_BEGIN
,
57 nsIWidget::TouchpadGesturePhase::PHASE_END
> {};
60 struct ParamTraits
<nsIWidget::TouchPointerState
>
61 : public BitFlagsEnumSerializer
<nsIWidget::TouchPointerState
,
62 nsIWidget::TouchPointerState::ALL_BITS
> {};
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
,
76 #endif // WidgetMessageUtils_h