diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /widget/WidgetMessageUtils.h | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/WidgetMessageUtils.h')
-rw-r--r-- | widget/WidgetMessageUtils.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/widget/WidgetMessageUtils.h b/widget/WidgetMessageUtils.h new file mode 100644 index 0000000000..8ec0860f75 --- /dev/null +++ b/widget/WidgetMessageUtils.h @@ -0,0 +1,74 @@ +/* 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 + +#include "ipc/EnumSerializer.h" +#include "ipc/IPCMessageUtils.h" +#include "mozilla/DimensionRequest.h" +#include "mozilla/GfxMessageUtils.h" +#include "mozilla/LookAndFeel.h" +#include "mozilla/widget/ThemeChangeKind.h" +#include "nsIWidget.h" +#include "nsStyleConsts.h" + +namespace IPC { + +template <> +struct ParamTraits<mozilla::widget::ThemeChangeKind> + : public BitFlagsEnumSerializer<mozilla::widget::ThemeChangeKind, + mozilla::widget::ThemeChangeKind::AllBits> { +}; + +template <> +struct ParamTraits<mozilla::LookAndFeel::IntID> + : ContiguousEnumSerializer<mozilla::LookAndFeel::IntID, + mozilla::LookAndFeel::IntID(0), + mozilla::LookAndFeel::IntID::End> { + using IdType = std::underlying_type_t<mozilla::LookAndFeel::IntID>; +}; + +template <> +struct ParamTraits<mozilla::LookAndFeel::ColorID> + : ContiguousEnumSerializer<mozilla::LookAndFeel::ColorID, + mozilla::LookAndFeel::ColorID(0), + mozilla::LookAndFeel::ColorID::End> { + using IdType = std::underlying_type_t<mozilla::LookAndFeel::ColorID>; +}; + +template <> +struct ParamTraits<nsTransparencyMode> + : ContiguousEnumSerializerInclusive<nsTransparencyMode, eTransparencyOpaque, + eTransparencyBorderlessGlass> {}; + +template <> +struct ParamTraits<nsCursor> + : ContiguousEnumSerializer<nsCursor, eCursor_standard, eCursorCount> {}; + +template <> +struct ParamTraits<nsIWidget::TouchpadGesturePhase> + : ContiguousEnumSerializerInclusive< + nsIWidget::TouchpadGesturePhase, + nsIWidget::TouchpadGesturePhase::PHASE_BEGIN, + nsIWidget::TouchpadGesturePhase::PHASE_END> {}; + +template <> +struct ParamTraits<nsIWidget::TouchPointerState> + : public BitFlagsEnumSerializer<nsIWidget::TouchPointerState, + nsIWidget::TouchPointerState::ALL_BITS> {}; + +template <> +struct ParamTraits<mozilla::DimensionKind> + : public ContiguousEnumSerializerInclusive<mozilla::DimensionKind, + mozilla::DimensionKind::Inner, + mozilla::DimensionKind::Outer> { +}; + +DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::DimensionRequest, mDimensionKind, mX, + mY, mWidth, mHeight); + +} // namespace IPC + +#endif // WidgetMessageUtils_h |