dom/plugins/ipc/PluginLibrary.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 * vim: sw=4 ts=4 et :
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef mozilla_PluginLibrary_h
michael@0 8 #define mozilla_PluginLibrary_h 1
michael@0 9
michael@0 10 #include "prlink.h"
michael@0 11 #include "npapi.h"
michael@0 12 #include "npfunctions.h"
michael@0 13 #include "nscore.h"
michael@0 14 #include "nsTArray.h"
michael@0 15 #include "nsError.h"
michael@0 16 #include "mozilla/EventForwards.h"
michael@0 17
michael@0 18 class gfxContext;
michael@0 19 class nsCString;
michael@0 20 struct nsIntRect;
michael@0 21 struct nsIntSize;
michael@0 22 class nsNPAPIPlugin;
michael@0 23
michael@0 24 namespace mozilla {
michael@0 25 namespace layers {
michael@0 26 class Image;
michael@0 27 class ImageContainer;
michael@0 28 }
michael@0 29 }
michael@0 30
michael@0 31
michael@0 32 namespace mozilla {
michael@0 33
michael@0 34 class PluginLibrary
michael@0 35 {
michael@0 36 public:
michael@0 37 virtual ~PluginLibrary() { }
michael@0 38
michael@0 39 /**
michael@0 40 * Inform this library about the nsNPAPIPlugin which owns it. This
michael@0 41 * object will hold a weak pointer to the plugin.
michael@0 42 */
michael@0 43 virtual void SetPlugin(nsNPAPIPlugin* plugin) = 0;
michael@0 44
michael@0 45 virtual bool HasRequiredFunctions() = 0;
michael@0 46
michael@0 47 #if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
michael@0 48 virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) = 0;
michael@0 49 #else
michael@0 50 virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) = 0;
michael@0 51 #endif
michael@0 52 virtual nsresult NP_Shutdown(NPError* error) = 0;
michael@0 53 virtual nsresult NP_GetMIMEDescription(const char** mimeDesc) = 0;
michael@0 54 virtual nsresult NP_GetValue(void *future, NPPVariable aVariable,
michael@0 55 void *aValue, NPError* error) = 0;
michael@0 56 #if defined(XP_WIN) || defined(XP_MACOSX)
michael@0 57 virtual nsresult NP_GetEntryPoints(NPPluginFuncs* pFuncs, NPError* error) = 0;
michael@0 58 #endif
michael@0 59 virtual nsresult NPP_New(NPMIMEType pluginType, NPP instance,
michael@0 60 uint16_t mode, int16_t argc, char* argn[],
michael@0 61 char* argv[], NPSavedData* saved,
michael@0 62 NPError* error) = 0;
michael@0 63
michael@0 64 virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags,
michael@0 65 uint64_t maxAge) = 0;
michael@0 66 virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& aResult) = 0;
michael@0 67
michael@0 68 virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window) = 0;
michael@0 69 virtual nsresult GetImageContainer(NPP instance, mozilla::layers::ImageContainer** aContainer) = 0;
michael@0 70 virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize) = 0;
michael@0 71 virtual bool IsOOP() = 0;
michael@0 72 #if defined(XP_MACOSX)
michael@0 73 virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, bool *aDrawing) = 0;
michael@0 74 virtual nsresult ContentsScaleFactorChanged(NPP instance, double aContentsScaleFactor) = 0;
michael@0 75 #endif
michael@0 76
michael@0 77 /**
michael@0 78 * The next three methods are the third leg in the trip to
michael@0 79 * PluginInstanceParent. They approximately follow the ReadbackSink
michael@0 80 * API.
michael@0 81 */
michael@0 82 virtual nsresult SetBackgroundUnknown(NPP instance) = 0;
michael@0 83 virtual nsresult BeginUpdateBackground(NPP instance,
michael@0 84 const nsIntRect&, gfxContext**) = 0;
michael@0 85 virtual nsresult EndUpdateBackground(NPP instance,
michael@0 86 gfxContext*, const nsIntRect&) = 0;
michael@0 87 };
michael@0 88
michael@0 89
michael@0 90 } // namespace mozilla
michael@0 91
michael@0 92 #endif // ifndef mozilla_PluginLibrary_h

mercurial