1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/base/android/ANPEvent.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,32 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "assert.h" 1.10 +#include "ANPBase.h" 1.11 +#include <android/log.h> 1.12 +#include "nsThreadUtils.h" 1.13 +#include "nsNPAPIPluginInstance.h" 1.14 +#include "AndroidBridge.h" 1.15 +#include "nsNPAPIPlugin.h" 1.16 + 1.17 +#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args) 1.18 +#define ASSIGN(obj, name) (obj)->name = anp_event_##name 1.19 + 1.20 +void 1.21 +anp_event_postEvent(NPP instance, const ANPEvent* event) 1.22 +{ 1.23 + LOG("%s", __PRETTY_FUNCTION__); 1.24 + 1.25 + nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata); 1.26 + pinst->PostEvent((void*) event); 1.27 + 1.28 + LOG("returning from %s", __PRETTY_FUNCTION__); 1.29 +} 1.30 + 1.31 + 1.32 +void InitEventInterface(ANPEventInterfaceV0 *i) { 1.33 + _assert(i->inSize == sizeof(*i)); 1.34 + ASSIGN(i, postEvent); 1.35 +}