summaryrefslogtreecommitdiffstats
path: root/third_party/npapi/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/npapi/bindings')
-rw-r--r--third_party/npapi/bindings/npapi.h127
-rw-r--r--third_party/npapi/bindings/npapi_x11.h2
-rw-r--r--third_party/npapi/bindings/nphostapi.h38
-rw-r--r--third_party/npapi/bindings/npruntime.h12
-rw-r--r--third_party/npapi/bindings/nptypes.h118
5 files changed, 184 insertions, 113 deletions
diff --git a/third_party/npapi/bindings/npapi.h b/third_party/npapi/bindings/npapi.h
index 1e6e7e2..bf4306d 100644
--- a/third_party/npapi/bindings/npapi.h
+++ b/third_party/npapi/bindings/npapi.h
@@ -43,6 +43,7 @@
#ifndef _NPAPI_H_
#define _NPAPI_H_
+#include "nptypes.h"
/* BEGIN GOOGLE MODIFICATIONS */
@@ -151,42 +152,6 @@
/* Definition of Basic Types */
/*----------------------------------------------------------------------*/
-/* QNX sets the _INT16 and friends defines, but does not typedef the types */
-#ifdef __QNXNTO__
-#undef _UINT16
-#undef _INT16
-#undef _UINT32
-#undef _INT32
-#endif
-
-#ifndef _UINT16
-#define _UINT16
-typedef unsigned short uint16;
-#endif
-
-#ifndef _UINT32
-#define _UINT32
-#ifdef __LP64__
-typedef unsigned int uint32;
-#else /* __LP64__ */
-typedef unsigned long uint32;
-#endif /* __LP64__ */
-#endif
-
-#ifndef _INT16
-#define _INT16
-typedef short int16;
-#endif
-
-#ifndef _INT32
-#define _INT32
-#ifdef __LP64__
-typedef int int32;
-#else /* __LP64__ */
-typedef long int32;
-#endif /* __LP64__ */
-#endif
-
#ifndef FALSE
#define FALSE (0)
#endif
@@ -198,8 +163,8 @@ typedef long int32;
#endif
typedef unsigned char NPBool;
-typedef int16 NPError;
-typedef int16 NPReason;
+typedef int16_t NPError;
+typedef int16_t NPReason;
typedef char* NPMIMEType;
@@ -231,8 +196,8 @@ typedef struct _NPStream
void* pdata; /* plug-in private data */
void* ndata; /* netscape private data */
const char* url;
- uint32 end;
- uint32 lastmodified;
+ uint32_t end;
+ uint32_t lastmodified;
void* notifyData;
const char* headers; /* Response headers from host.
* Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
@@ -249,25 +214,25 @@ typedef struct _NPStream
typedef struct _NPByteRange
{
- int32 offset; /* negative offset means from the end */
- uint32 length;
+ int32_t offset; /* negative offset means from the end */
+ uint32_t length;
struct _NPByteRange* next;
} NPByteRange;
typedef struct _NPSavedData
{
- int32 len;
+ int32_t len;
void* buf;
} NPSavedData;
typedef struct _NPRect
{
- uint16 top;
- uint16 left;
- uint16 bottom;
- uint16 right;
+ uint16_t top;
+ uint16_t left;
+ uint16_t bottom;
+ uint16_t right;
} NPRect;
@@ -288,7 +253,7 @@ enum {
typedef struct
{
- int32 type;
+ int32_t type;
} NPAnyCallbackStruct;
/* BEGIN GOOGLE MODIFICATIONS */
@@ -297,7 +262,7 @@ typedef struct _NPSetWindowCallbackStruct NPSetWindowCallbackStruct;
typedef struct
{
- int32 type;
+ int32_t type;
FILE* fp;
} NPPrintCallbackStruct;
@@ -516,25 +481,25 @@ typedef struct _NPNSMenu NPNSMenu;
typedef struct _NPCocoaEvent {
NPCocoaEventType type;
- uint32 version;
+ uint32_t version;
union {
struct {
- uint32 modifierFlags;
+ uint32_t modifierFlags;
double pluginX;
double pluginY;
- int32 buttonNumber;
- int32 clickCount;
+ int32_t buttonNumber;
+ int32_t clickCount;
double deltaX;
double deltaY;
double deltaZ;
} mouse;
struct {
- uint32 modifierFlags;
+ uint32_t modifierFlags;
NPNSString *characters;
NPNSString *charactersIgnoringModifiers;
NPBool isARepeat;
- uint16 keyCode;
+ uint16_t keyCode;
} key;
struct {
CGContextRef context;
@@ -558,10 +523,10 @@ typedef struct _NPCocoaEvent {
typedef struct _NPWindow
{
void* window; /* Platform specific window handle */
- int32 x; /* Position of top left corner relative */
- int32 y; /* to a netscape page. */
- uint32 width; /* Maximum window size */
- uint32 height;
+ int32_t x; /* Position of top left corner relative */
+ int32_t y; /* to a netscape page. */
+ uint32_t width; /* Maximum window size */
+ uint32_t height;
NPRect clipRect; /* Clipping rectangle in port coordinates */
/* Used by MAC only. */
#if defined(XP_UNIX) && !defined(XP_MACOSX)
@@ -586,7 +551,7 @@ typedef struct _NPEmbedPrint
typedef struct _NPPrint
{
- uint16 mode; /* NP_FULL or NP_EMBED */
+ uint16_t mode; /* NP_FULL or NP_EMBED */
union
{
NPFullPrint fullPrint; /* if mode is NP_FULL */
@@ -620,9 +585,9 @@ typedef EventRecord NPEvent;
#elif defined(XP_WIN)
typedef struct _NPEvent
{
- uint16 event;
- uint32 wParam;
- uint32 lParam;
+ uint16_t event;
+ uintptr_t wParam;
+ uintptr_t lParam;
} NPEvent;
#elif defined (XP_UNIX) && defined(MOZ_X11)
/* BEGIN GOOGLE MODIFICATIONS */
@@ -712,8 +677,8 @@ typedef struct NP_GLContext
typedef struct NP_Port
{
CGrafPtr port; /* Grafport */
- int32 portx; /* position inside the topmost window */
- int32 porty;
+ int32_t portx; /* position inside the topmost window */
+ int32_t porty;
} NP_Port;
#endif /* NP_NO_QUICKDRAW */
@@ -851,22 +816,22 @@ char* NPP_GetMIMEDescription(void);
NPError NPP_Initialize(void);
void NPP_Shutdown(void);
NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
- uint16 mode, int16 argc, char* argn[],
+ uint16_t mode, int16_t argc, char* argn[],
char* argv[], NPSavedData* saved);
NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
NPStream* stream, NPBool seekable,
- uint16* stype);
+ uint16_t* stype);
NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
NPReason reason);
-int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
-int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
- int32 len, void* buffer);
+int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
+int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset,
+ int32_t len, void* buffer);
void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
const char* fname);
void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
-int16 NPP_HandleEvent(NPP instance, void* event);
+int16_t NPP_HandleEvent(NPP instance, void* event);
void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
NPReason reason, void* notifyData);
jref NP_LOADDS NPP_GetJavaClass(void);
@@ -886,24 +851,24 @@ NPError NPN_GetURLNotify(NPP instance, const char* url,
NPError NPN_GetURL(NPP instance, const char* url,
const char* target);
NPError NPN_PostURLNotify(NPP instance, const char* url,
- const char* target, uint32 len,
+ const char* target, uint32_t len,
const char* buf, NPBool file,
void* notifyData);
NPError NPN_PostURL(NPP instance, const char* url,
- const char* target, uint32 len,
+ const char* target, uint32_t len,
const char* buf, NPBool file);
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
NPError NPN_NewStream(NPP instance, NPMIMEType type,
const char* target, NPStream** stream);
-int32 NPN_Write(NPP instance, NPStream* stream, int32 len,
+int32_t NPN_Write(NPP instance, NPStream* stream, int32_t len,
void* buffer);
NPError NPN_DestroyStream(NPP instance, NPStream* stream,
NPReason reason);
void NPN_Status(NPP instance, const char* message);
const char* NPN_UserAgent(NPP instance);
-void* NPN_MemAlloc(uint32 size);
+void* NPN_MemAlloc(uint32_t size);
void NPN_MemFree(void* ptr);
-uint32 NPN_MemFlush(uint32 size);
+uint32_t NPN_MemFlush(uint32_t size);
void NPN_ReloadPlugins(NPBool reloadPages);
JRIEnv* NPN_GetJavaEnv(void);
jref NPN_GetJavaPeer(NPP instance);
@@ -917,11 +882,11 @@ void NPN_ForceRedraw(NPP instance);
void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
void NPN_PopPopupsEnabledState(NPP instance);
void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData);
-NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32* len);
-NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32 len);
-NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32 port, const char* scheme, const char *realm, char** username, uint32* ulen, char** password, uint32* plen);
-uint32 NPN_ScheduleTimer(NPP instance, uint32 interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32 timerID));
-void NPN_UnscheduleTimer(NPP instance, uint32 timerID);
+NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32_t* len);
+NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32_t len);
+NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32_t port, const char* scheme, const char *realm, char** username, uint32_t* ulen, char** password, uint32_t* plen);
+uint32_t NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
+void NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
NPError NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
diff --git a/third_party/npapi/bindings/npapi_x11.h b/third_party/npapi/bindings/npapi_x11.h
index c586419..84ca078 100644
--- a/third_party/npapi/bindings/npapi_x11.h
+++ b/third_party/npapi/bindings/npapi_x11.h
@@ -49,7 +49,7 @@
typedef struct _NPSetWindowCallbackStruct
{
- int32 type;
+ int32_t type;
#ifdef MOZ_X11
Display* display;
Visual* visual;
diff --git a/third_party/npapi/bindings/nphostapi.h b/third_party/npapi/bindings/nphostapi.h
index 69bad70..baa2a44 100644
--- a/third_party/npapi/bindings/nphostapi.h
+++ b/third_party/npapi/bindings/nphostapi.h
@@ -21,8 +21,8 @@ extern "C" {
//
typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType,
NPP instance,
- uint16 mode,
- int16 argc,
+ uint16_t mode,
+ int16_t argc,
char* argn[],
char* argv[],
NPSavedData* saved);
@@ -34,23 +34,23 @@ typedef NPError (*NPP_NewStreamProcPtr)(NPP instance,
NPMIMEType type,
NPStream* stream,
NPBool seekable,
- uint16* stype);
+ uint16_t* stype);
typedef NPError (*NPP_DestroyStreamProcPtr)(NPP instance,
NPStream* stream,
NPReason reason);
-typedef int32 (*NPP_WriteReadyProcPtr)(NPP instance,
+typedef int32_t (*NPP_WriteReadyProcPtr)(NPP instance,
NPStream* stream);
-typedef int32 (*NPP_WriteProcPtr)(NPP instance,
+typedef int32_t (*NPP_WriteProcPtr)(NPP instance,
NPStream* stream,
- int32 offset,
- int32 len,
+ int32_t offset,
+ int32_t len,
void* buffer);
typedef void (*NPP_StreamAsFileProcPtr)(NPP instance,
NPStream* stream,
const char* fname);
typedef void (*NPP_PrintProcPtr)(NPP instance,
NPPrint* platformPrint);
-typedef int16 (*NPP_HandleEventProcPtr)(NPP instance,
+typedef int16_t (*NPP_HandleEventProcPtr)(NPP instance,
void* event);
typedef void (*NPP_URLNotifyProcPtr)(NPP instance,
const char* url,
@@ -73,7 +73,7 @@ typedef NPError (*NPN_GetURLProcPtr)(NPP instance,
typedef NPError (*NPN_PostURLProcPtr)(NPP instance,
const char* URL,
const char* window,
- uint32 len,
+ uint32_t len,
const char* buf,
NPBool file);
typedef NPError (*NPN_RequestReadProcPtr)(NPStream* stream,
@@ -82,9 +82,9 @@ typedef NPError (*NPN_NewStreamProcPtr)(NPP instance,
NPMIMEType type,
const char* window,
NPStream** stream);
-typedef int32 (*NPN_WriteProcPtr)(NPP instance,
+typedef int32_t (*NPN_WriteProcPtr)(NPP instance,
NPStream* stream,
- int32 len,
+ int32_t len,
void* buffer);
typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance,
NPStream* stream,
@@ -92,9 +92,9 @@ typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance,
typedef void (*NPN_StatusProcPtr)(NPP instance,
const char* message);
typedef const char* (*NPN_UserAgentProcPtr)(NPP instance);
-typedef void* (*NPN_MemAllocProcPtr)(uint32 size);
+typedef void* (*NPN_MemAllocProcPtr)(uint32_t size);
typedef void (*NPN_MemFreeProcPtr)(void* ptr);
-typedef uint32 (*NPN_MemFlushProcPtr)(uint32 size);
+typedef uint32_t (*NPN_MemFlushProcPtr)(uint32_t size);
typedef void (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages);
typedef void* (*NPN_GetJavaEnvProcPtr)(void);
@@ -107,7 +107,7 @@ typedef NPError (*NPN_GetURLNotifyProcPtr)(NPP instance,
typedef NPError (*NPN_PostURLNotifyProcPtr)(NPP instance,
const char* URL,
const char* window,
- uint32 len,
+ uint32_t len,
const char* buf,
NPBool file,
void* notifyData);
@@ -208,11 +208,11 @@ typedef NPError (*NPN_GetAuthenticationInfoPtr)(NPP npp,
char **password,
uint32_t *plen);
typedef uint32 (*NPN_ScheduleTimerPtr)(NPP npp,
- uint32 interval,
+ uint32_t interval,
NPBool repeat,
- void (*timerFunc)(NPP npp, uint32 timerID));
+ void (*timerFunc)(NPP npp, uint32_t timerID));
typedef void (*NPN_UnscheduleTimerPtr)(NPP npp,
- uint32 timerID);
+ uint32_t timerID);
typedef NPError (*NPN_PopUpContextMenuPtr)(NPP npp,
NPMenu* menu);
typedef NPBool (*NPN_ConvertPointPtr)(NPP npp,
@@ -249,8 +249,8 @@ typedef struct _NPPluginFuncs {
// NPAPI Function table NPN functions (functions provided by host to plugin)
//
typedef struct _NPNetscapeFuncs {
- uint16 size;
- uint16 version;
+ uint16_t size;
+ uint16_t version;
NPN_GetURLProcPtr geturl;
NPN_PostURLProcPtr posturl;
NPN_RequestReadProcPtr requestread;
diff --git a/third_party/npapi/bindings/npruntime.h b/third_party/npapi/bindings/npruntime.h
index e050b21..496bbd69 100644
--- a/third_party/npapi/bindings/npruntime.h
+++ b/third_party/npapi/bindings/npruntime.h
@@ -68,22 +68,10 @@
#ifndef _NP_RUNTIME_H_
#define _NP_RUNTIME_H_
-
// BEGIN GOOGLE MODIFICATIONS
#include "npapi.h"
-#ifndef __native_client__
-typedef uint8 uint8_t;
-typedef int8 int8_t;
-typedef uint16 uint16_t;
-typedef int16 int16_t;
-typedef uint32 uint32_t;
-typedef int32 int32_t;
-typedef int64 int64_t;
-typedef uint64 uint64_t;
-#endif /* __native_client__ */
// END GOOGLE MODIFICATIONS
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/third_party/npapi/bindings/nptypes.h b/third_party/npapi/bindings/nptypes.h
new file mode 100644
index 0000000..e8a1391
--- /dev/null
+++ b/third_party/npapi/bindings/nptypes.h
@@ -0,0 +1,118 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * mozilla.org.
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Johnny Stenback <jst@mozilla.org> (Original author)
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef nptypes_h_
+#define nptypes_h_
+
+/*
+ * Header file for ensuring that C99 types ([u]int32_t and bool) and
+ * true/false macros are available.
+ */
+
+#if defined(WIN32) || defined(OS2)
+ /*
+ * Win32 and OS/2 don't know C99, so define [u]int_16/32 here. The bool
+ * is predefined tho, both in C and C++.
+ */
+ typedef short int16_t;
+ typedef unsigned short uint16_t;
+ typedef int int32_t;
+ typedef unsigned int uint32_t;
+#elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || defined(HPUX)
+ /*
+ * AIX and SunOS ship a inttypes.h header that defines [u]int32_t,
+ * but not bool for C.
+ */
+ #include <inttypes.h>
+
+ #ifndef __cplusplus
+ typedef int bool;
+ #define true 1
+ #define false 0
+ #endif
+#elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
+ /*
+ * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and
+ * u_int32_t.
+ */
+ #include <sys/types.h>
+
+ /*
+ * BSD/OS ships no header that defines uint32_t, nor bool (for C)
+ */
+ #if defined(bsdi)
+ typedef u_int32_t uint32_t;
+
+ #if !defined(__cplusplus)
+ typedef int bool;
+ #define true 1
+ #define false 0
+ #endif
+ #else
+ /*
+ * FreeBSD and OpenBSD define uint32_t and bool.
+ */
+ #include <inttypes.h>
+ #include <stdbool.h>
+ #endif
+#elif defined(BEOS)
+ #include <inttypes.h>
+#else
+ /*
+ * For those that ship a standard C99 stdint.h header file, include
+ * it. Can't do the same for stdbool.h tho, since some systems ship
+ * with a stdbool.h file that doesn't compile!
+ */
+ #include <stdint.h>
+
+ #ifndef __cplusplus
+ #if !defined(__GNUC__) || (__GNUC__ > 2 || __GNUC_MINOR__ > 95)
+ #include <stdbool.h>
+ #else
+ /*
+ * GCC 2.91 can't deal with a typedef for bool, but a #define
+ * works.
+ */
+ #define bool int
+ #define true 1
+ #define false 0
+ #endif
+ #endif
+#endif
+
+#endif /* nptypes_h_ */