sel_ldr: Remove support for rodata segment at start of executable
[nativeclient.git] / documentation / npapi.html
blobbcda5345265e7a6044808f01cf239df2ca36905d
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>Native Client: NPAPI Support</title>
6 <link href="stylesheet.css" type="text/css" rel="stylesheet"></link>
7 </head>
9 <body>
11 <div id="toplink">
12 <a href="../README.html">Back to README</a>
13 </div>
15 <h1>NPAPI Support</h1>
17 <p>
18 Native Client modules can communicate with the browser
19 using either NPAPI or
20 <a href="srpc.html">simple RPC (SRPC)</a>.
21 This document lists the NPAPI functions
22 that Native Client modules can and cannot use.
23 </p>
25 <p>
26 <b>See also:</b>
27 Mozilla
28 <a href="https://developer.mozilla.org/en/Plugins">Plugins documentation</a>
29 and
30 <a href="https://developer.mozilla.org/en/Gecko_Plugin_API_Reference">Gecko
31 Plugin API Reference</a>
32 </p>
34 <h3>Contents</h3>
36 <ul>
37 <li> <a href="#nacl">Native Client only: nacl_npapi.h</a> </li>
38 <li> <a href="#npapi-h">npapi.h</a>
39 <ul>
40 <li> <a href="#npapi-h-implemented">Implemented</a> </li>
41 <li> <a href="#npapi-h-not">Not implemented</a> </li>
42 </ul></li>
43 <li> <a href="#npruntime-h">npruntime.h</a>
44 <ul>
45 <li> <a href="#npruntime-h-implemented">Implemented</a> </li>
46 <li> <a href="#npruntime-h-not">Not implemented</a> </li>
47 </ul></li>
48 </ul>
50 <h2><a name="nacl"> </a> Native Client only: nacl_npapi.h </h2>
52 <p>
53 For information on these functions and
54 on other API defined in <code>nacl/nacl_npapi.h</code>,
55 see the
56 <a href="../scons-out/doc/html/nacl__npapi_8h.html"><code>nacl_npapi.h</code>
57 reference doc</a>.
58 </p>
60 <pre class="listing">
61 int NaClNP_Init(int* argc, char* argv[]);
62 int NaClNP_MainLoop(unsigned flags);
63 NPObject* NaClNPN_CreateArray(NPP npp);
64 NPError NaClNPN_OpenURL(NPP npp, const char* url, void* notify_data,
65 void (*notify)(const char* url, void* notify_data,
66 int handle));
67 NPVARIANT_IS_HANDLE(_v)
68 NPVARIANT_TO_HANDLE(_v)
69 HANDLE_TO_NPVARIANT(_val, _v)
70 </pre>
72 <h2><a name="npapi-h"> </a> npapi.h </h2>
74 <p>
75 API defined in the file <code>nacl/nacl_npapi.h</code>.
76 </p>
78 <h3><a name="npapi-h-implemented"> </a> Implemented </h3>
80 <pre class="listing">
81 NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value);
82 void* NPN_MemAlloc(uint32_t size);
83 void NPN_MemFree(void* ptr);
84 void NPN_Status(NPP instance, const char* message);
85 void NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
86 void NPN_ForceRedraw(NPP instance);
87 </pre>
89 <h3><a name="npapi-h-not"> </a> Not implemented </h3>
91 <pre class="listing">
92 void NPN_Version(int* plugin_major, int* plugin_minor,
93 NPError NPN_GetURLNotify(NPP instance, const char* url,
94 NPError NPN_GetURL(NPP instance, const char* url,
95 NPError NPN_PostURLNotify(NPP instance, const char* url,
96 NPError NPN_PostURL(NPP instance, const char* url,
97 NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
98 NPError NPN_NewStream(NPP instance, NPMIMEType type,
99 int32_t NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer);
100 NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
101 const char* NPN_UserAgent(NPP instance);
102 uint32_t NPN_MemFlush(uint32_t size);
103 void NPN_ReloadPlugins(NPBool reloadPages);
104 JRIEnv* NPN_GetJavaEnv(void);
105 jref NPN_GetJavaPeer(NPP instance);
106 NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value);
107 void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
108 void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
109 void NPN_PopPopupsEnabledState(NPP instance);
110 void NPN_PluginThreadAsyncCall(NPP instance,
111 </pre>
113 <h2><a name="npruntime-h"> </a> npruntime.h </h2>
116 API defined in the file <code>nacl/nacl_npruntime.h</code>.
117 </p>
119 <h3><a name="npruntime-h-implemented"> </a> Implemented </h3>
121 <pre class="listing">
122 NPObject *NPN_CreateObject(NPP npp, NPClass *aClass);
123 NPIdentifier NPN_GetIntIdentifier(int32_t intid);
124 NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name);
125 void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
126 NPObject *NPN_RetainObject(NPObject *npobj);
127 NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier);
128 bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName,
129 bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName);
130 bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
131 bool NPN_IdentifierIsString(NPIdentifier identifier);
132 bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName,
133 int32_t NPN_IntFromIdentifier(NPIdentifier identifier);
134 bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args,
135 void NPN_ReleaseObject(NPObject *npobj);
136 void NPN_ReleaseVariantValue(NPVariant *variant);
137 bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
138 bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName,
139 void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
140 </pre>
142 <h3><a name="npruntime-h-not"> </a> Not implemented </h3>
144 <pre class="listing">
145 bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args,
146 bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier,
147 bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script, [PENDING:...]
148 </pre>
150 <p id="license">
151 Except as otherwise
152 <a href="http://code.google.com/policies.html#restrictions">noted</a>,
153 the content of this page is licensed under a
154 <a href="http://creativecommons.org/licenses/by/2.5/">Creative Commons
155 Attribution 2.5 license</a>.
156 </p>
158 </body>
159 </html>