|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 // must include config.h first for webkit to fiddle with new/delete |
|
7 #include <android/log.h> |
|
8 #include "AndroidBridge.h" |
|
9 #include "ANPBase.h" |
|
10 #include "nsIPluginInstanceOwner.h" |
|
11 #include "nsPluginInstanceOwner.h" |
|
12 #include "nsNPAPIPluginInstance.h" |
|
13 #include "gfxRect.h" |
|
14 |
|
15 using namespace mozilla; |
|
16 using namespace mozilla; |
|
17 |
|
18 #define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args) |
|
19 #define ASSIGN(obj, name) (obj)->name = anp_native_window_##name |
|
20 |
|
21 static ANPNativeWindow anp_native_window_acquireNativeWindow(NPP instance) { |
|
22 nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata); |
|
23 return pinst->AcquireContentWindow(); |
|
24 } |
|
25 |
|
26 static void anp_native_window_invertPluginContent(NPP instance, bool isContentInverted) { |
|
27 nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata); |
|
28 pinst->SetInverted(isContentInverted); |
|
29 pinst->RedrawPlugin(); |
|
30 } |
|
31 |
|
32 |
|
33 void InitNativeWindowInterface(ANPNativeWindowInterfaceV0* i) { |
|
34 ASSIGN(i, acquireNativeWindow); |
|
35 ASSIGN(i, invertPluginContent); |
|
36 } |