| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | |
| 3 * | |
| 4 * Redistribution and use in source and binary forms, with or without | |
| 5 * modification, are permitted provided that the following conditions are | |
| 6 * met: | |
| 7 * | |
| 8 * * Redistributions of source code must retain the above copyright | |
| 9 * notice, this list of conditions and the following disclaimer. | |
| 10 * * Redistributions in binary form must reproduce the above | |
| 11 * copyright notice, this list of conditions and the following disclaimer | |
| 12 * in the documentation and/or other materials provided with the | |
| 13 * distribution. | |
| 14 * * Neither the name of Google Inc. nor the names of its | |
| 15 * contributors may be used to endorse or promote products derived from | |
| 16 * this software without specific prior written permission. | |
| 17 * | |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 29 */ | |
| 30 | |
| 31 #ifndef WebBindings_h | |
| 32 #define WebBindings_h | |
| 33 | |
| 34 #include "../platform/WebCommon.h" | |
| 35 #include <bindings/npruntime.h> | |
| 36 | |
| 37 namespace blink { | |
| 38 | |
| 39 // A haphazard collection of functions for dealing with plugins. | |
| 40 class WebBindings { | |
| 41 public: | |
| 42 // NPN Functions ------------------------------------------------------ | |
| 43 // These are all defined in npruntime.h and are well documented. | |
| 44 | |
| 45 // NPN_Construct | |
| 46 BLINK_EXPORT static bool construct(NPP, NPObject*, const NPVariant* args, ui
nt32_t argCount, NPVariant* result); | |
| 47 | |
| 48 // NPN_CreateObject | |
| 49 BLINK_EXPORT static NPObject* createObject(NPP, NPClass*); | |
| 50 | |
| 51 // NPN_Enumerate | |
| 52 BLINK_EXPORT static bool enumerate(NPP, NPObject*, NPIdentifier**, uint32_t*
identifierCount); | |
| 53 | |
| 54 // NPN_Evaluate | |
| 55 BLINK_EXPORT static bool evaluate(NPP, NPObject*, NPString* script, NPVarian
t* result); | |
| 56 | |
| 57 // NPN_GetIntIdentifier | |
| 58 BLINK_EXPORT static NPIdentifier getIntIdentifier(int32_t number); | |
| 59 | |
| 60 // NPN_GetProperty | |
| 61 BLINK_EXPORT static bool getProperty(NPP, NPObject*, NPIdentifier property,
NPVariant *result); | |
| 62 | |
| 63 // NPN_GetStringIdentifier | |
| 64 BLINK_EXPORT static NPIdentifier getStringIdentifier(const NPUTF8* string); | |
| 65 | |
| 66 // NPN_GetStringIdentifiers | |
| 67 BLINK_EXPORT static void getStringIdentifiers(const NPUTF8** names, int32_t
nameCount, NPIdentifier*); | |
| 68 | |
| 69 // NPN_HasMethod | |
| 70 BLINK_EXPORT static bool hasMethod(NPP, NPObject*, NPIdentifier method); | |
| 71 | |
| 72 // NPN_HasProperty | |
| 73 BLINK_EXPORT static bool hasProperty(NPP, NPObject*, NPIdentifier property); | |
| 74 | |
| 75 // NPN_IdentifierIsString | |
| 76 BLINK_EXPORT static bool identifierIsString(NPIdentifier); | |
| 77 | |
| 78 // NPN_IntFromIdentifier | |
| 79 BLINK_EXPORT static int32_t intFromIdentifier(NPIdentifier); | |
| 80 | |
| 81 // NPN_Invoke | |
| 82 BLINK_EXPORT static bool invoke(NPP, NPObject*, NPIdentifier method, const N
PVariant* args, uint32_t argCount, NPVariant* result); | |
| 83 | |
| 84 // NPN_InvokeDefault | |
| 85 BLINK_EXPORT static bool invokeDefault(NPP, NPObject*, const NPVariant* args
, uint32_t argCount, NPVariant* result); | |
| 86 | |
| 87 // NPN_ReleaseObject | |
| 88 BLINK_EXPORT static void releaseObject(NPObject*); | |
| 89 | |
| 90 // NPN_ReleaseVariantValue | |
| 91 BLINK_EXPORT static void releaseVariantValue(NPVariant*); | |
| 92 | |
| 93 // NPN_RemoveProperty | |
| 94 BLINK_EXPORT static bool removeProperty(NPP, NPObject*, NPIdentifier); | |
| 95 | |
| 96 // NPN_RetainObject | |
| 97 BLINK_EXPORT static NPObject* retainObject(NPObject*); | |
| 98 | |
| 99 // NPN_SetException | |
| 100 BLINK_EXPORT static void setException(NPObject*, const NPUTF8* message); | |
| 101 | |
| 102 // NPN_SetProperty | |
| 103 BLINK_EXPORT static bool setProperty(NPP, NPObject*, NPIdentifier, const NPV
ariant*); | |
| 104 | |
| 105 // NPN_UTF8FromIdentifier | |
| 106 BLINK_EXPORT static NPUTF8* utf8FromIdentifier(NPIdentifier); | |
| 107 }; | |
| 108 | |
| 109 } // namespace blink | |
| 110 | |
| 111 #endif | |
| OLD | NEW |