1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/ipc/NPEventAndroid.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 1.4 +/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */ 1.5 +/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +// This is a NPEventX11.h derived stub for Android 1.11 +// Plugins aren't actually supported yet 1.12 + 1.13 +#ifndef mozilla_dom_plugins_NPEventAndroid_h 1.14 +#define mozilla_dom_plugins_NPEventAndroid_h 1.15 + 1.16 +#include "npapi.h" 1.17 + 1.18 +namespace mozilla { 1.19 + 1.20 +namespace plugins { 1.21 + 1.22 +struct NPRemoteEvent { 1.23 + NPEvent event; 1.24 +}; 1.25 + 1.26 +} 1.27 + 1.28 +} 1.29 + 1.30 + 1.31 +namespace IPC { 1.32 + 1.33 +template <> 1.34 +struct ParamTraits<mozilla::plugins::NPRemoteEvent> 1.35 +{ 1.36 + typedef mozilla::plugins::NPRemoteEvent paramType; 1.37 + 1.38 + static void Write(Message* aMsg, const paramType& aParam) 1.39 + { 1.40 + aMsg->WriteBytes(&aParam, sizeof(paramType)); 1.41 + } 1.42 + 1.43 + static bool Read(const Message* aMsg, void** aIter, paramType* aResult) 1.44 + { 1.45 + const char* bytes = 0; 1.46 + 1.47 + if (!aMsg->ReadBytes(aIter, &bytes, sizeof(paramType))) { 1.48 + return false; 1.49 + } 1.50 + 1.51 + memcpy(aResult, bytes, sizeof(paramType)); 1.52 + return true; 1.53 + } 1.54 + 1.55 + static void Log(const paramType& aParam, std::wstring* aLog) 1.56 + { 1.57 + // TODO 1.58 + aLog->append(L"(AndroidEvent)"); 1.59 + } 1.60 +}; 1.61 + 1.62 +} // namespace IPC 1.63 + 1.64 + 1.65 +#endif // mozilla_dom_plugins_NPEventAndroid_h