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
|
|
|
|
|
|
|
|
#include "ipc/IPCMessageUtils.h"
|
|
|
|
#include "mozilla/LookAndFeel.h"
|
2018-04-06 06:24:28 +03:00
|
|
|
#include "nsIWidget.h"
|
2015-04-22 17:58:15 +03:00
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<LookAndFeelInt> {
|
|
|
|
typedef LookAndFeelInt paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2020-06-11 14:27:43 +03:00
|
|
|
WriteParam(aMsg, static_cast<int32_t>(aParam.id));
|
2015-04-22 17:58:15 +03:00
|
|
|
WriteParam(aMsg, aParam.value);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2015-04-22 17:58:15 +03:00
|
|
|
int32_t id, value;
|
|
|
|
if (ReadParam(aMsg, aIter, &id) && ReadParam(aMsg, aIter, &value)) {
|
2020-06-11 14:27:43 +03:00
|
|
|
aResult->id = static_cast<mozilla::LookAndFeel::IntID>(id);
|
2015-04-22 17:58:15 +03:00
|
|
|
aResult->value = value;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-04-06 06:24:28 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<nsTransparencyMode>
|
|
|
|
: public ContiguousEnumSerializerInclusive<nsTransparencyMode,
|
|
|
|
eTransparencyOpaque,
|
|
|
|
eTransparencyBorderlessGlass> {};
|
|
|
|
|
2018-04-09 17:48:09 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<nsCursor>
|
|
|
|
: public ContiguousEnumSerializer<nsCursor, eCursor_standard,
|
|
|
|
eCursorCount> {};
|
|
|
|
|
2015-04-22 17:58:15 +03:00
|
|
|
} // namespace IPC
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
#endif // WidgetMessageUtils_h
|