2015-04-22 17:58:15 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_WidgetMessageUtils_h
|
|
|
|
#define mozilla_WidgetMessageUtils_h
|
|
|
|
|
2020-12-10 14:09:21 +03:00
|
|
|
#include "ipc/EnumSerializer.h"
|
2015-04-22 17:58:15 +03:00
|
|
|
#include "ipc/IPCMessageUtils.h"
|
|
|
|
#include "mozilla/LookAndFeel.h"
|
2020-10-27 13:24:40 +03:00
|
|
|
#include "mozilla/widget/ThemeChangeKind.h"
|
2018-04-06 06:24:28 +03:00
|
|
|
#include "nsIWidget.h"
|
2020-11-12 02:26:51 +03:00
|
|
|
#include "nsStyleConsts.h"
|
2015-04-22 17:58:15 +03:00
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
2020-10-27 13:24:40 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::ThemeChangeKind>
|
|
|
|
: public BitFlagsEnumSerializer<mozilla::widget::ThemeChangeKind,
|
|
|
|
mozilla::widget::ThemeChangeKind::AllBits> {
|
|
|
|
};
|
|
|
|
|
2020-07-31 19:21:44 +03:00
|
|
|
template <>
|
2020-11-12 02:26:51 +03:00
|
|
|
struct ParamTraits<mozilla::LookAndFeel::IntID>
|
|
|
|
: ContiguousEnumSerializer<mozilla::LookAndFeel::IntID,
|
|
|
|
mozilla::LookAndFeel::IntID::CaretBlinkTime,
|
|
|
|
mozilla::LookAndFeel::IntID::End> {
|
|
|
|
using IdType = std::underlying_type_t<mozilla::LookAndFeel::IntID>;
|
|
|
|
static_assert(static_cast<IdType>(
|
|
|
|
mozilla::LookAndFeel::IntID::CaretBlinkTime) == IdType(0));
|
2020-10-15 07:54:41 +03:00
|
|
|
};
|
|
|
|
|
2020-07-31 19:21:44 +03:00
|
|
|
template <>
|
2020-11-12 02:26:51 +03:00
|
|
|
struct ParamTraits<mozilla::LookAndFeel::ColorID>
|
|
|
|
: ContiguousEnumSerializer<mozilla::LookAndFeel::ColorID,
|
|
|
|
mozilla::LookAndFeel::ColorID::WindowBackground,
|
|
|
|
mozilla::LookAndFeel::ColorID::End> {
|
|
|
|
using IdType = std::underlying_type_t<mozilla::LookAndFeel::ColorID>;
|
|
|
|
static_assert(
|
|
|
|
static_cast<IdType>(mozilla::LookAndFeel::ColorID::WindowBackground) ==
|
|
|
|
IdType(0));
|
2020-07-31 19:21:44 +03:00
|
|
|
};
|
|
|
|
|
2018-04-06 06:24:28 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<nsTransparencyMode>
|
2020-11-12 02:26:51 +03:00
|
|
|
: ContiguousEnumSerializerInclusive<nsTransparencyMode, eTransparencyOpaque,
|
|
|
|
eTransparencyBorderlessGlass> {};
|
2018-04-06 06:24:28 +03:00
|
|
|
|
2018-04-09 17:48:09 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<nsCursor>
|
2020-11-12 02:26:51 +03:00
|
|
|
: ContiguousEnumSerializer<nsCursor, eCursor_standard, eCursorCount> {};
|
2018-04-09 17:48:09 +03:00
|
|
|
|
2021-02-19 08:35:40 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<nsIWidget::TouchpadPinchPhase>
|
|
|
|
: ContiguousEnumSerializerInclusive<
|
|
|
|
nsIWidget::TouchpadPinchPhase,
|
|
|
|
nsIWidget::TouchpadPinchPhase::PHASE_BEGIN,
|
|
|
|
nsIWidget::TouchpadPinchPhase::PHASE_END> {};
|
|
|
|
|
2020-12-10 14:09:21 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<nsIWidget::TouchPointerState>
|
|
|
|
: public BitFlagsEnumSerializer<nsIWidget::TouchPointerState,
|
|
|
|
nsIWidget::TouchPointerState::ALL_BITS> {};
|
|
|
|
|
2015-04-22 17:58:15 +03:00
|
|
|
} // namespace IPC
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
#endif // WidgetMessageUtils_h
|