[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and i
From: |
Rob Savoye |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and indenting changes to conform to the rest of the code style used in Gnash. |
Date: |
Wed, 02 Jun 2010 10:32:55 -0600 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 12208
committer: Rob Savoye <address@hidden>
branch nick: trunk
timestamp: Wed 2010-06-02 10:32:55 -0600
message:
100% only reformatting and indenting changes to conform to the rest of the
code style used in Gnash.
modified:
plugin/npapi/mozilla-sdk/include/npapi.h
plugin/npapi/mozilla-sdk/include/npfunctions.h
plugin/npapi/mozilla-sdk/include/npruntime.h
plugin/npapi/mozilla-sdk/include/nptypes.h
plugin/npapi/mozilla-sdk/np_entry.cpp
plugin/npapi/mozilla-sdk/npn_gate.cpp
plugin/npapi/mozilla-sdk/npp_gate.cpp
plugin/npapi/mozilla-sdk/npplat.h
plugin/npapi/mozilla-sdk/pluginbase.h
=== modified file 'plugin/npapi/mozilla-sdk/include/npapi.h'
--- a/plugin/npapi/mozilla-sdk/include/npapi.h 2010-03-24 23:33:22 +0000
+++ b/plugin/npapi/mozilla-sdk/include/npapi.h 2010-06-02 16:32:55 +0000
@@ -1,39 +1,22 @@
/* -*- Mode: C; tab-width: 4; 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
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+// Foundation, Inc
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
#ifndef npapi_h_
#define npapi_h_
@@ -149,21 +132,21 @@
*/
typedef struct _NPP
{
- void* pdata; /* plug-in private data */
- void* ndata; /* netscape private data */
+ void* pdata; /* plug-in private data */
+ void* ndata; /* netscape private data */
} NPP_t;
typedef NPP_t* NPP;
typedef struct _NPStream
{
- void* pdata; /* plug-in private data */
- void* ndata; /* netscape private data */
- const char* url;
- uint32_t end;
- uint32_t lastmodified;
- void* notifyData;
- const char* headers; /* Response headers from host.
+ void* pdata; /* plug-in private data */
+ void* ndata; /* netscape private data */
+ const char* url;
+ uint32_t end;
+ uint32_t lastmodified;
+ void* notifyData;
+ const char* headers; /* Response headers from host.
* Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
* Used for HTTP only; NULL for non-HTTP.
* Available from NPP_NewStream onwards.
@@ -177,29 +160,29 @@
typedef struct _NPByteRange
{
- int32_t offset; /* negative offset means from the end */
- uint32_t length;
- struct _NPByteRange* next;
+ int32_t offset; /* negative offset means from the end */
+ uint32_t length;
+ struct _NPByteRange* next;
} NPByteRange;
typedef struct _NPSavedData
{
- int32_t len;
- void* buf;
+ int32_t len;
+ void* buf;
} NPSavedData;
typedef struct _NPRect
{
- uint16_t top;
- uint16_t left;
- uint16_t bottom;
- uint16_t right;
+ uint16_t top;
+ uint16_t left;
+ uint16_t bottom;
+ uint16_t right;
} NPRect;
typedef struct _NPSize
{
- int32_t width;
- int32_t height;
+ int32_t width;
+ int32_t height;
} NPSize;
#ifdef XP_UNIX
@@ -213,30 +196,30 @@
* These are used to pass additional platform specific information.
*/
enum {
- NP_SETWINDOW = 1,
- NP_PRINT
+ NP_SETWINDOW = 1,
+ NP_PRINT
};
typedef struct
{
- int32_t type;
+ int32_t type;
} NPAnyCallbackStruct;
typedef struct
{
- int32_t type;
+ int32_t type;
#ifdef MOZ_X11
- Display* display;
- Visual* visual;
- Colormap colormap;
- unsigned int depth;
+ Display* display;
+ Visual* visual;
+ Colormap colormap;
+ unsigned int depth;
#endif
} NPSetWindowCallbackStruct;
typedef struct
{
- int32_t type;
- FILE* fp;
+ int32_t type;
+ FILE* fp;
} NPPrintCallbackStruct;
#endif /* XP_UNIX */
@@ -244,17 +227,17 @@
#ifdef XP_MACOSX
typedef enum {
#ifndef NP_NO_QUICKDRAW
- NPDrawingModelQuickDraw = 0,
+ NPDrawingModelQuickDraw = 0,
#endif
- NPDrawingModelCoreGraphics = 1,
- NPDrawingModelCoreAnimation = 3
+ NPDrawingModelCoreGraphics = 1,
+ NPDrawingModelCoreAnimation = 3
} NPDrawingModel;
typedef enum {
#ifndef NP_NO_CARBON
- NPEventModelCarbon = 0,
+ NPEventModelCarbon = 0,
#endif
- NPEventModelCocoa = 1
+ NPEventModelCocoa = 1
} NPEventModel;
#endif
@@ -295,54 +278,54 @@
* List of variable names for which NPP_GetValue shall be implemented
*/
typedef enum {
- NPPVpluginNameString = 1,
- NPPVpluginDescriptionString,
- NPPVpluginWindowBool,
- NPPVpluginTransparentBool,
- NPPVjavaClass, /* Not implemented in Mozilla 1.0 */
- NPPVpluginWindowSize,
- NPPVpluginTimerInterval,
-
- NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
- NPPVpluginScriptableIID = 11,
-
- /* Introduced in Mozilla 0.9.9 */
- NPPVjavascriptPushCallerBool = 12,
-
- /* Introduced in Mozilla 1.0 */
- NPPVpluginKeepLibraryInMemory = 13,
- NPPVpluginNeedsXEmbed = 14,
-
- /* Get the NPObject for scripting the plugin. Introduced in Firefox
- * 1.0 (NPAPI minor version 14).
- */
- NPPVpluginScriptableNPObject = 15,
-
- /* Get the plugin value (as \0-terminated UTF-8 string data) for
- * form submission if the plugin is part of a form. Use
- * NPN_MemAlloc() to allocate memory for the string data. Introduced
- * in Mozilla 1.8b2 (NPAPI minor version 15).
- */
- NPPVformValue = 16,
-
- NPPVpluginUrlRequestsDisplayedBool = 17,
-
- /* Checks if the plugin is interested in receiving the http body of
- * all http requests (including failed ones, http status != 200).
- */
- NPPVpluginWantsAllNetworkStreams = 18
-
+ NPPVpluginNameString = 1,
+ NPPVpluginDescriptionString,
+ NPPVpluginWindowBool,
+ NPPVpluginTransparentBool,
+ NPPVjavaClass, /* Not implemented in Mozilla 1.0 */
+ NPPVpluginWindowSize,
+ NPPVpluginTimerInterval,
+
+ NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
+ NPPVpluginScriptableIID = 11,
+
+ /* Introduced in Mozilla 0.9.9 */
+ NPPVjavascriptPushCallerBool = 12,
+
+ /* Introduced in Mozilla 1.0 */
+ NPPVpluginKeepLibraryInMemory = 13,
+ NPPVpluginNeedsXEmbed = 14,
+
+ /* Get the NPObject for scripting the plugin. Introduced in Firefox
+ * 1.0 (NPAPI minor version 14).
+ */
+ NPPVpluginScriptableNPObject = 15,
+
+ /* Get the plugin value (as \0-terminated UTF-8 string data) for
+ * form submission if the plugin is part of a form. Use
+ * NPN_MemAlloc() to allocate memory for the string data. Introduced
+ * in Mozilla 1.8b2 (NPAPI minor version 15).
+ */
+ NPPVformValue = 16,
+
+ NPPVpluginUrlRequestsDisplayedBool = 17,
+
+ /* Checks if the plugin is interested in receiving the http body of
+ * all http requests (including failed ones, http status != 200).
+ */
+ NPPVpluginWantsAllNetworkStreams = 18
+
#ifdef XP_MACOSX
- /* Used for negotiating drawing models */
- , NPPVpluginDrawingModel = 1000
- /* Used for negotiating event models */
- , NPPVpluginEventModel = 1001
- /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the
plug-in for a Core Animation layer. */
- , NPPVpluginCoreAnimationLayer = 1003
+ /* Used for negotiating drawing models */
+ , NPPVpluginDrawingModel = 1000
+ /* Used for negotiating event models */
+ , NPPVpluginEventModel = 1001
+ /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the
plug-in for a Core Animation layer. */
+ , NPPVpluginCoreAnimationLayer = 1003
#endif
-
+
#if (MOZ_PLATFORM_MAEMO == 5)
- , NPPVpluginWindowlessLocalBool = 2002
+ , NPPVpluginWindowlessLocalBool = 2002
#endif
} NPPVariable;
@@ -350,59 +333,59 @@
* List of variable names for which NPN_GetValue is implemented by Mozilla
*/
typedef enum {
- NPNVxDisplay = 1,
- NPNVxtAppContext,
- NPNVnetscapeWindow,
- NPNVjavascriptEnabledBool,
- NPNVasdEnabledBool,
- NPNVisOfflineBool,
-
- /* 10 and over are available on Mozilla builds starting with 0.9.4 */
- NPNVserviceManager = (10 | NP_ABI_MASK),
- NPNVDOMElement = (11 | NP_ABI_MASK), /* available in Mozilla 1.2 */
- NPNVDOMWindow = (12 | NP_ABI_MASK),
- NPNVToolkit = (13 | NP_ABI_MASK),
- NPNVSupportsXEmbedBool = 14,
-
- /* Get the NPObject wrapper for the browser window. */
- NPNVWindowNPObject = 15,
-
- /* Get the NPObject wrapper for the plugins DOM element. */
- NPNVPluginElementNPObject = 16,
-
- NPNVSupportsWindowless = 17,
-
- NPNVprivateModeBool = 18
-
+ NPNVxDisplay = 1,
+ NPNVxtAppContext,
+ NPNVnetscapeWindow,
+ NPNVjavascriptEnabledBool,
+ NPNVasdEnabledBool,
+ NPNVisOfflineBool,
+
+ /* 10 and over are available on Mozilla builds starting with 0.9.4 */
+ NPNVserviceManager = (10 | NP_ABI_MASK),
+ NPNVDOMElement = (11 | NP_ABI_MASK), /* available in Mozilla 1.2 */
+ NPNVDOMWindow = (12 | NP_ABI_MASK),
+ NPNVToolkit = (13 | NP_ABI_MASK),
+ NPNVSupportsXEmbedBool = 14,
+
+ /* Get the NPObject wrapper for the browser window. */
+ NPNVWindowNPObject = 15,
+
+ /* Get the NPObject wrapper for the plugins DOM element. */
+ NPNVPluginElementNPObject = 16,
+
+ NPNVSupportsWindowless = 17,
+
+ NPNVprivateModeBool = 18
+
#ifdef XP_MACOSX
- /* Used for negotiating drawing models */
- , NPNVpluginDrawingModel = 1000
+ /* Used for negotiating drawing models */
+ , NPNVpluginDrawingModel = 1000
#ifndef NP_NO_QUICKDRAW
- , NPNVsupportsQuickDrawBool = 2000
+ , NPNVsupportsQuickDrawBool = 2000
#endif
- , NPNVsupportsCoreGraphicsBool = 2001
- , NPNVsupportsCoreAnimationBool = 2003
+ , NPNVsupportsCoreGraphicsBool = 2001
+ , NPNVsupportsCoreAnimationBool = 2003
#ifndef NP_NO_CARBON
- , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon
event model */
+ , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon
event model */
#endif
- , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa
event model */
+ , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa
event model */
#endif
#if (MOZ_PLATFORM_MAEMO == 5)
- , NPNVSupportsWindowlessLocal = 2002
+ , NPNVSupportsWindowlessLocal = 2002
#endif
} NPNVariable;
typedef enum {
- NPNURLVCookie = 501,
- NPNURLVProxy
+ NPNURLVCookie = 501,
+ NPNURLVProxy
} NPNURLVariable;
/*
* The type of Toolkit the widgets use
*/
typedef enum {
- NPNVGtk12 = 1,
- NPNVGtk2
+ NPNVGtk12 = 1,
+ NPNVGtk2
} NPNToolkitType;
/*
@@ -410,64 +393,63 @@
* returned in the window field.
*/
typedef enum {
- NPWindowTypeWindow = 1,
- NPWindowTypeDrawable
+ NPWindowTypeWindow = 1,
+ NPWindowTypeDrawable
} NPWindowType;
typedef struct _NPWindow
{
- void* window; /* Platform specific window handle */
- /* OS/2: x - Position of bottom left corner */
- /* OS/2: y - relative to visible netscape window */
- 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 */
+ void* window; /* Platform specific window handle */
+ /* OS/2: x - Position of bottom left corner */
+ /* OS/2: y - relative to visible netscape window */
+ 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 */
#if defined(XP_UNIX) && !defined(XP_MACOSX)
- void * ws_info; /* Platform-dependent additional data */
+ void * ws_info; /* Platform-dependent additional data */
#endif /* XP_UNIX */
- NPWindowType type; /* Is this a window or a drawable? */
+ NPWindowType type; /* Is this a window or a drawable? */
} NPWindow;
typedef struct _NPImageExpose
{
- char* data; /* image pointer */
- int32_t stride; /* Stride of data image pointer */
- int32_t depth; /* Depth of image pointer */
- int32_t x; /* Expose x */
- int32_t y; /* Expose y */
- uint32_t width; /* Expose width */
- uint32_t height; /* Expose height */
- NPSize dataSize; /* Data buffer size */
- float translateX; /* translate X matrix value */
- float translateY; /* translate Y matrix value */
- float scaleX; /* scale X matrix value */
- float scaleY; /* scale Y matrix value */
+ char* data; /* image pointer */
+ int32_t stride; /* Stride of data image pointer */
+ int32_t depth; /* Depth of image pointer */
+ int32_t x; /* Expose x */
+ int32_t y; /* Expose y */
+ uint32_t width; /* Expose width */
+ uint32_t height; /* Expose height */
+ NPSize dataSize; /* Data buffer size */
+ float translateX; /* translate X matrix value */
+ float translateY; /* translate Y matrix value */
+ float scaleX; /* scale X matrix value */
+ float scaleY; /* scale Y matrix value */
} NPImageExpose;
typedef struct _NPFullPrint
{
- NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
- NPBool printOne; /* TRUE if plugin should print one copy to default
- printer */
- void* platformPrint; /* Platform-specific printing info */
+ NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
+ NPBool printOne; /* TRUE if plugin should print one copy to default
+ printer */
+ void* platformPrint; /* Platform-specific printing info */
} NPFullPrint;
typedef struct _NPEmbedPrint
{
- NPWindow window;
- void* platformPrint; /* Platform-specific printing info */
+ NPWindow window;
+ void* platformPrint; /* Platform-specific printing info */
} NPEmbedPrint;
typedef struct _NPPrint
{
- uint16_t mode; /* NP_FULL or NP_EMBED */
- union
- {
- NPFullPrint fullPrint; /* if mode is NP_FULL */
- NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
- } print;
+ uint16_t mode; /* NP_FULL or NP_EMBED */
+ union {
+ NPFullPrint fullPrint; /* if mode is NP_FULL */
+ NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
+ } print;
} NPPrint;
#ifdef XP_MACOSX
@@ -475,18 +457,16 @@
typedef EventRecord NPEvent;
#endif
#elif defined(XP_WIN)
-typedef struct _NPEvent
-{
- uint16_t event;
- uint32_t wParam;
- uint32_t lParam;
+typedef struct _NPEvent {
+ uint16_t event;
+ uint32_t wParam;
+ uint32_t lParam;
} NPEvent;
#elif defined(XP_OS2)
-typedef struct _NPEvent
-{
- uint32_t event;
- uint32_t wParam;
- uint32_t lParam;
+typedef struct _NPEvent {
+ uint32_t event;
+ uint32_t wParam;
+ uint32_t lParam;
} NPEvent;
#elif defined (XP_UNIX) && defined(MOZ_X11)
typedef XEvent NPEvent;
@@ -519,96 +499,96 @@
#endif
typedef enum {
- NPCoordinateSpacePlugin = 1,
- NPCoordinateSpaceWindow,
- NPCoordinateSpaceFlippedWindow,
- NPCoordinateSpaceScreen,
- NPCoordinateSpaceFlippedScreen
+ NPCoordinateSpacePlugin = 1,
+ NPCoordinateSpaceWindow,
+ NPCoordinateSpaceFlippedWindow,
+ NPCoordinateSpaceScreen,
+ NPCoordinateSpaceFlippedScreen
} NPCoordinateSpace;
#ifdef XP_MACOSX
typedef struct NP_Port
{
- CGrafPtr port;
- int32_t portx; /* position inside the topmost window */
- int32_t porty;
+ CGrafPtr port;
+ int32_t portx; /* position inside the topmost window */
+ int32_t porty;
} NP_Port;
typedef struct NP_CGContext
{
- CGContextRef context;
+ CGContextRef context;
#ifdef NP_NO_CARBON
- NPNSWindow *window;
+ NPNSWindow *window;
#else
- void *window; /* A WindowRef or NULL for the Cocoa event model. */
+ void *window; /* A WindowRef or NULL for the Cocoa event model. */
#endif
} NP_CGContext;
typedef enum {
- NPCocoaEventDrawRect = 1,
- NPCocoaEventMouseDown,
- NPCocoaEventMouseUp,
- NPCocoaEventMouseMoved,
- NPCocoaEventMouseEntered,
- NPCocoaEventMouseExited,
- NPCocoaEventMouseDragged,
- NPCocoaEventKeyDown,
- NPCocoaEventKeyUp,
- NPCocoaEventFlagsChanged,
- NPCocoaEventFocusChanged,
- NPCocoaEventWindowFocusChanged,
- NPCocoaEventScrollWheel,
- NPCocoaEventTextInput
+ NPCocoaEventDrawRect = 1,
+ NPCocoaEventMouseDown,
+ NPCocoaEventMouseUp,
+ NPCocoaEventMouseMoved,
+ NPCocoaEventMouseEntered,
+ NPCocoaEventMouseExited,
+ NPCocoaEventMouseDragged,
+ NPCocoaEventKeyDown,
+ NPCocoaEventKeyUp,
+ NPCocoaEventFlagsChanged,
+ NPCocoaEventFocusChanged,
+ NPCocoaEventWindowFocusChanged,
+ NPCocoaEventScrollWheel,
+ NPCocoaEventTextInput
} NPCocoaEventType;
typedef struct _NPCocoaEvent {
- NPCocoaEventType type;
- uint32_t version;
- union {
- struct {
- uint32_t modifierFlags;
- double pluginX;
- double pluginY;
- int32_t buttonNumber;
- int32_t clickCount;
- double deltaX;
- double deltaY;
- double deltaZ;
- } mouse;
- struct {
- uint32_t modifierFlags;
- NPNSString *characters;
- NPNSString *charactersIgnoringModifiers;
- NPBool isARepeat;
- uint16_t keyCode;
- } key;
- struct {
- CGContextRef context;
- double x;
- double y;
- double width;
- double height;
- } draw;
- struct {
- NPBool hasFocus;
- } focus;
- struct {
- NPNSString *text;
- } text;
- } data;
+ NPCocoaEventType type;
+ uint32_t version;
+ union {
+ struct {
+ uint32_t modifierFlags;
+ double pluginX;
+ double pluginY;
+ int32_t buttonNumber;
+ int32_t clickCount;
+ double deltaX;
+ double deltaY;
+ double deltaZ;
+ } mouse;
+ struct {
+ uint32_t modifierFlags;
+ NPNSString *characters;
+ NPNSString *charactersIgnoringModifiers;
+ NPBool isARepeat;
+ uint16_t keyCode;
+ } key;
+ struct {
+ CGContextRef context;
+ double x;
+ double y;
+ double width;
+ double height;
+ } draw;
+ struct {
+ NPBool hasFocus;
+ } focus;
+ struct {
+ NPNSString *text;
+ } text;
+ } data;
} NPCocoaEvent;
#ifndef NP_NO_CARBON
/* Non-standard event types that can be passed to HandleEvent */
enum NPEventType {
- NPEventType_GetFocusEvent = (osEvt + 16),
- NPEventType_LoseFocusEvent,
- NPEventType_AdjustCursorEvent,
- NPEventType_MenuCommandEvent,
- NPEventType_ClippingChangedEvent,
- NPEventType_ScrollingBeginsEvent = 1000,
- NPEventType_ScrollingEndsEvent
+ NPEventType_GetFocusEvent = (osEvt + 16),
+ NPEventType_LoseFocusEvent,
+ NPEventType_AdjustCursorEvent,
+ NPEventType_MenuCommandEvent,
+ NPEventType_ClippingChangedEvent,
+ NPEventType_ScrollingBeginsEvent = 1000,
+ NPEventType_ScrollingEndsEvent
};
#ifdef OBSOLETE
#define getFocusEvent (osEvt + 16)
@@ -795,10 +775,16 @@
char **username, uint32_t
*ulen,
char **password,
uint32_t *plen);
-uint32_t NP_LOADDS NPN_ScheduleTimer(NPP instance, uint32_t interval,
NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
+uint32_t NP_LOADDS NPN_ScheduleTimer(NPP instance, uint32_t interval,
+ NPBool repeat,
+ void (*timerFunc)(NPP npp, uint32_t
timerID));
void NP_LOADDS NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
NPError NP_LOADDS NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
-NPBool NP_LOADDS NPN_ConvertPoint(NPP instance, double sourceX, double
sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY,
NPCoordinateSpace destSpace);
+NPBool NP_LOADDS NPN_ConvertPoint(NPP instance, double sourceX,
+ double sourceY,
+ NPCoordinateSpace sourceSpace,
+ double *destX, double *destY,
+ NPCoordinateSpace destSpace);
#ifdef __cplusplus
} /* end extern "C" */
@@ -810,3 +796,8 @@
#endif
#endif /* npapi_h_ */
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
=== modified file 'plugin/npapi/mozilla-sdk/include/npfunctions.h'
--- a/plugin/npapi/mozilla-sdk/include/npfunctions.h 2010-05-27 19:11:10
+0000
+++ b/plugin/npapi/mozilla-sdk/include/npfunctions.h 2010-06-02 16:32:55
+0000
@@ -1,39 +1,22 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** 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
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+// Foundation, Inc
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
#ifndef npfunctions_h_
#define npfunctions_h_
@@ -50,32 +33,60 @@
typedef void (* NP_LOADDS NPP_InitializeProcPtr)();
typedef void (* NP_LOADDS NPP_ShutdownProcPtr)();
-typedef NPError (* NP_LOADDS NPP_NewProcPtr)(NPMIMEType pluginType, NPP
instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData*
saved);
-typedef NPError (* NP_LOADDS NPP_DestroyProcPtr)(NPP instance,
NPSavedData** save);
-typedef NPError (* NP_LOADDS NPP_SetWindowProcPtr)(NPP instance,
NPWindow* window);
-typedef NPError (* NP_LOADDS NPP_NewStreamProcPtr)(NPP instance,
NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
-typedef NPError (* NP_LOADDS NPP_DestroyStreamProcPtr)(NPP instance,
NPStream* stream, NPReason reason);
-typedef int32_t (* NP_LOADDS NPP_WriteReadyProcPtr)(NPP instance,
NPStream* stream);
-typedef int32_t (* NP_LOADDS NPP_WriteProcPtr)(NPP instance, NPStream*
stream, int32_t offset, int32_t len, void* buffer);
-typedef void (* NP_LOADDS NPP_StreamAsFileProcPtr)(NPP instance,
NPStream* stream, const char* fname);
-typedef void (* NP_LOADDS NPP_PrintProcPtr)(NPP instance, NPPrint*
platformPrint);
-typedef int16_t (* NP_LOADDS NPP_HandleEventProcPtr)(NPP instance, void*
event);
-typedef void (* NP_LOADDS NPP_URLNotifyProcPtr)(NPP instance, const
char* url, NPReason reason, void* notifyData);
+typedef NPError (* NP_LOADDS NPP_NewProcPtr)(NPMIMEType pluginType,
+ NPP instance, uint16_t mode, int16_t argc,
+ char* argn[], char* argv[], NPSavedData* saved);
+typedef NPError (* NP_LOADDS NPP_DestroyProcPtr)(NPP instance,
+ NPSavedData** save);
+typedef NPError (* NP_LOADDS NPP_SetWindowProcPtr)(NPP instance,
+ NPWindow* window);
+typedef NPError (* NP_LOADDS NPP_NewStreamProcPtr)(NPP instance,
+ NPMIMEType type, NPStream* stream, NPBool seekable,
+ uint16_t* stype);
+typedef NPError (* NP_LOADDS NPP_DestroyStreamProcPtr)(NPP instance,
+ NPStream* stream, NPReason reason);
+typedef int32_t (* NP_LOADDS NPP_WriteReadyProcPtr)(NPP instance,
+ NPStream* stream);
+typedef int32_t (* NP_LOADDS NPP_WriteProcPtr)(NPP instance,
+ NPStream* stream, int32_t offset, int32_t len,
+ void* buffer);
+typedef void (* NP_LOADDS NPP_StreamAsFileProcPtr)(NPP instance,
+ NPStream* stream, const char* fname);
+typedef void (* NP_LOADDS NPP_PrintProcPtr)(NPP instance,
+ NPPrint* platformPrint);
+typedef int16_t (* NP_LOADDS NPP_HandleEventProcPtr)(NPP instance,
+ void* event);
+typedef void (* NP_LOADDS NPP_URLNotifyProcPtr)(NPP instance,
+ const char* url, NPReason reason, void* notifyData);
/* Any NPObjects returned to the browser via NPP_GetValue should be retained
by the plugin on the way out. The browser is responsible for releasing. */
-typedef NPError (* NP_LOADDS NPP_GetValueProcPtr)(NPP instance,
NPPVariable variable, void *ret_value);
-typedef NPError (* NP_LOADDS NPP_SetValueProcPtr)(NPP instance,
NPNVariable variable, void *value);
+typedef NPError (* NP_LOADDS NPP_GetValueProcPtr)(NPP instance,
+ NPPVariable variable, void *ret_value);
+typedef NPError (* NP_LOADDS NPP_SetValueProcPtr)(NPP instance,
+ NPNVariable variable, void *value);
-typedef NPError (*NPN_GetValueProcPtr)(NPP instance, NPNVariable
variable, void *ret_value);
-typedef NPError (*NPN_SetValueProcPtr)(NPP instance, NPPVariable
variable, void *value);
-typedef NPError (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* url,
const char* window, void* notifyData);
-typedef NPError (*NPN_PostURLNotifyProcPtr)(NPP instance, const char*
url, const char* window, uint32_t len, const char* buf, NPBool file, void*
notifyData);
-typedef NPError (*NPN_GetURLProcPtr)(NPP instance, const char* url, const
char* window);
-typedef NPError (*NPN_PostURLProcPtr)(NPP instance, const char* url,
const char* window, uint32_t len, const char* buf, NPBool file);
-typedef NPError (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange*
rangeList);
-typedef NPError (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type,
const char* window, NPStream** stream);
-typedef int32_t (*NPN_WriteProcPtr)(NPP instance, NPStream* stream,
int32_t len, void* buffer);
-typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream*
stream, NPReason reason);
+typedef NPError (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable,
+ void *ret_value);
+typedef NPError (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable,
+ void *value);
+typedef NPError (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* url,
+ const char* window, void* notifyData);
+typedef NPError (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* url,
+ const char* window, uint32_t len, const char* buf,
+ NPBool file, void*
notifyData);
+typedef NPError (*NPN_GetURLProcPtr)(NPP instance, const char* url,
+ const char* window);
+typedef NPError (*NPN_PostURLProcPtr)(NPP instance, const char* url,
+ const char* window, uint32_t len,
+ const char* buf, NPBool file);
+typedef NPError (*NPN_RequestReadProcPtr)(NPStream* stream,
+ NPByteRange* rangeList);
+typedef NPError (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type,
+ const char* window, NPStream** stream);
+typedef int32_t (*NPN_WriteProcPtr)(NPP instance, NPStream* stream,
+ int32_t len, void* buffer);
+typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream*
stream,
+ NPReason reason);
typedef void (*NPN_StatusProcPtr)(NPP instance, const char* message);
/* Browser manages the lifetime of the buffer returned by NPN_UserAgent, don't
depend on it sticking around and don't free it. */
@@ -87,10 +98,13 @@
typedef void* (*NPN_GetJavaEnvProcPtr)();
typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance);
typedef void (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect);
-typedef void (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion
region);
+typedef void (*NPN_InvalidateRegionProcPtr)(NPP instance,
+ NPRegion region);
typedef void (*NPN_ForceRedrawProcPtr)(NPP instance);
typedef NPIdentifier (*NPN_GetStringIdentifierProcPtr)(const NPUTF8* name);
-typedef void (*NPN_GetStringIdentifiersProcPtr)(const NPUTF8** names,
int32_t nameCount, NPIdentifier* identifiers);
+typedef void (*NPN_GetStringIdentifiersProcPtr)(const NPUTF8** names,
+ int32_t nameCount,
+ NPIdentifier* identifiers);
typedef NPIdentifier (*NPN_GetIntIdentifierProcPtr)(int32_t intid);
typedef bool (*NPN_IdentifierIsStringProcPtr)(NPIdentifier identifier);
typedef NPUTF8* (*NPN_UTF8FromIdentifierProcPtr)(NPIdentifier identifier);
@@ -98,103 +112,145 @@
typedef NPObject* (*NPN_CreateObjectProcPtr)(NPP npp, NPClass *aClass);
typedef NPObject* (*NPN_RetainObjectProcPtr)(NPObject *obj);
typedef void (*NPN_ReleaseObjectProcPtr)(NPObject *obj);
-typedef bool (*NPN_InvokeProcPtr)(NPP npp, NPObject* obj, NPIdentifier
methodName, const NPVariant *args, uint32_t argCount, NPVariant *result);
-typedef bool (*NPN_InvokeDefaultProcPtr)(NPP npp, NPObject* obj, const
NPVariant *args, uint32_t argCount, NPVariant *result);
-typedef bool (*NPN_EvaluateProcPtr)(NPP npp, NPObject *obj, NPString
*script, NPVariant *result);
-typedef bool (*NPN_GetPropertyProcPtr)(NPP npp, NPObject *obj,
NPIdentifier propertyName, NPVariant *result);
-typedef bool (*NPN_SetPropertyProcPtr)(NPP npp, NPObject *obj,
NPIdentifier propertyName, const NPVariant *value);
-typedef bool (*NPN_RemovePropertyProcPtr)(NPP npp, NPObject *obj,
NPIdentifier propertyName);
-typedef bool (*NPN_HasPropertyProcPtr)(NPP npp, NPObject *obj,
NPIdentifier propertyName);
-typedef bool (*NPN_HasMethodProcPtr)(NPP npp, NPObject *obj,
NPIdentifier propertyName);
+typedef bool (*NPN_InvokeProcPtr)(NPP npp, NPObject* obj,
+ NPIdentifier methodName,
+ const NPVariant *args,
+ uint32_t argCount, NPVariant
*result);
+typedef bool (*NPN_InvokeDefaultProcPtr)(NPP npp, NPObject* obj,
+ const NPVariant *args,
+ uint32_t argCount,
+ NPVariant *result);
+typedef bool (*NPN_EvaluateProcPtr)(NPP npp, NPObject *obj,
+ NPString *script, NPVariant *result);
+typedef bool (*NPN_GetPropertyProcPtr)(NPP npp, NPObject *obj,
+ NPIdentifier propertyName,
+ NPVariant *result);
+typedef bool (*NPN_SetPropertyProcPtr)(NPP npp, NPObject *obj,
+ NPIdentifier propertyName,
+ const NPVariant *value);
+typedef bool (*NPN_RemovePropertyProcPtr)(NPP npp, NPObject *obj,
+ NPIdentifier propertyName);
+typedef bool (*NPN_HasPropertyProcPtr)(NPP npp, NPObject *obj,
+ NPIdentifier propertyName);
+typedef bool (*NPN_HasMethodProcPtr)(NPP npp, NPObject *obj,
+ NPIdentifier propertyName);
typedef void (*NPN_ReleaseVariantValueProcPtr)(NPVariant *variant);
-typedef void (*NPN_SetExceptionProcPtr)(NPObject *obj, const NPUTF8
*message);
-typedef bool (*NPN_PushPopupsEnabledStateProcPtr)(NPP npp, NPBool
enabled);
+typedef void (*NPN_SetExceptionProcPtr)(NPObject *obj,
+ const NPUTF8 *message);
+typedef bool (*NPN_PushPopupsEnabledStateProcPtr)(NPP npp,
+ NPBool enabled);
typedef bool (*NPN_PopPopupsEnabledStateProcPtr)(NPP npp);
-typedef bool (*NPN_EnumerateProcPtr)(NPP npp, NPObject *obj,
NPIdentifier **identifier, uint32_t *count);
-typedef void (*NPN_PluginThreadAsyncCallProcPtr)(NPP instance, void
(*func)(void *), void *userData);
-typedef bool (*NPN_ConstructProcPtr)(NPP npp, NPObject* obj, const
NPVariant *args, uint32_t argCount, NPVariant *result);
-typedef NPError (*NPN_GetValueForURLPtr)(NPP npp, NPNURLVariable
variable, const char *url, char **value, uint32_t *len);
-typedef NPError (*NPN_SetValueForURLPtr)(NPP npp, NPNURLVariable
variable, const char *url, const char *value, uint32_t len);
-typedef NPError (*NPN_GetAuthenticationInfoPtr)(NPP npp, 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);
-typedef uint32_t (*NPN_ScheduleTimerPtr)(NPP instance, uint32_t interval,
NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
+typedef bool (*NPN_EnumerateProcPtr)(NPP npp, NPObject *obj,
+ NPIdentifier **identifier,
+ uint32_t *count);
+typedef void (*NPN_PluginThreadAsyncCallProcPtr)(NPP instance,
+ void (*func)(void *),
+ void *userData);
+typedef bool (*NPN_ConstructProcPtr)(NPP npp, NPObject* obj,
+ const NPVariant *args,
+ uint32_t argCount,
+ NPVariant *result);
+typedef NPError (*NPN_GetValueForURLPtr)(NPP npp, NPNURLVariable variable,
+ const char *url, char **value,
+ uint32_t *len);
+typedef NPError (*NPN_SetValueForURLPtr)(NPP npp, NPNURLVariable variable,
+ const char *url,
+ const char *value, uint32_t len);
+typedef NPError (*NPN_GetAuthenticationInfoPtr)(NPP npp,
+ 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);
+typedef uint32_t (*NPN_ScheduleTimerPtr)(NPP instance, uint32_t interval,
+ NPBool repeat,
+ void (*timerFunc)(NPP npp, uint32_t timerID));
typedef void (*NPN_UnscheduleTimerPtr)(NPP instance, uint32_t timerID);
typedef NPError (*NPN_PopUpContextMenuPtr)(NPP instance, NPMenu* menu);
-typedef NPBool (*NPN_ConvertPointPtr)(NPP instance, double sourceX,
double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY,
NPCoordinateSpace destSpace);
+typedef NPBool (*NPN_ConvertPointPtr)(NPP instance, double sourceX,\
+ double sourceY,
+ NPCoordinateSpace sourceSpace,
+ double *destX, double *destY,
+ NPCoordinateSpace destSpace);
typedef struct _NPPluginFuncs {
- uint16_t size;
- uint16_t version;
- NPP_NewProcPtr newp;
- NPP_DestroyProcPtr destroy;
- NPP_SetWindowProcPtr setwindow;
- NPP_NewStreamProcPtr newstream;
- NPP_DestroyStreamProcPtr destroystream;
- NPP_StreamAsFileProcPtr asfile;
- NPP_WriteReadyProcPtr writeready;
- NPP_WriteProcPtr write;
- NPP_PrintProcPtr print;
- NPP_HandleEventProcPtr event;
- NPP_URLNotifyProcPtr urlnotify;
- void* javaClass;
- NPP_GetValueProcPtr getvalue;
- NPP_SetValueProcPtr setvalue;
+ uint16_t size;
+ uint16_t version;
+ NPP_NewProcPtr newp;
+ NPP_DestroyProcPtr destroy;
+ NPP_SetWindowProcPtr setwindow;
+ NPP_NewStreamProcPtr newstream;
+ NPP_DestroyStreamProcPtr destroystream;
+ NPP_StreamAsFileProcPtr asfile;
+ NPP_WriteReadyProcPtr writeready;
+ NPP_WriteProcPtr write;
+ NPP_PrintProcPtr print;
+ NPP_HandleEventProcPtr event;
+ NPP_URLNotifyProcPtr urlnotify;
+ void* javaClass;
+ NPP_GetValueProcPtr getvalue;
+ NPP_SetValueProcPtr setvalue;
} NPPluginFuncs;
typedef struct _NPNetscapeFuncs {
- uint16_t size;
- uint16_t version;
- NPN_GetURLProcPtr geturl;
- NPN_PostURLProcPtr posturl;
- NPN_RequestReadProcPtr requestread;
- NPN_NewStreamProcPtr newstream;
- NPN_WriteProcPtr write;
- NPN_DestroyStreamProcPtr destroystream;
- NPN_StatusProcPtr status;
- NPN_UserAgentProcPtr uagent;
- NPN_MemAllocProcPtr memalloc;
- NPN_MemFreeProcPtr memfree;
- NPN_MemFlushProcPtr memflush;
- NPN_ReloadPluginsProcPtr reloadplugins;
- NPN_GetJavaEnvProcPtr getJavaEnv;
- NPN_GetJavaPeerProcPtr getJavaPeer;
- NPN_GetURLNotifyProcPtr geturlnotify;
- NPN_PostURLNotifyProcPtr posturlnotify;
- NPN_GetValueProcPtr getvalue;
- NPN_SetValueProcPtr setvalue;
- NPN_InvalidateRectProcPtr invalidaterect;
- NPN_InvalidateRegionProcPtr invalidateregion;
- NPN_ForceRedrawProcPtr forceredraw;
- NPN_GetStringIdentifierProcPtr getstringidentifier;
- NPN_GetStringIdentifiersProcPtr getstringidentifiers;
- NPN_GetIntIdentifierProcPtr getintidentifier;
- NPN_IdentifierIsStringProcPtr identifierisstring;
- NPN_UTF8FromIdentifierProcPtr utf8fromidentifier;
- NPN_IntFromIdentifierProcPtr intfromidentifier;
- NPN_CreateObjectProcPtr createobject;
- NPN_RetainObjectProcPtr retainobject;
- NPN_ReleaseObjectProcPtr releaseobject;
- NPN_InvokeProcPtr invoke;
- NPN_InvokeDefaultProcPtr invokeDefault;
- NPN_EvaluateProcPtr evaluate;
- NPN_GetPropertyProcPtr getproperty;
- NPN_SetPropertyProcPtr setproperty;
- NPN_RemovePropertyProcPtr removeproperty;
- NPN_HasPropertyProcPtr hasproperty;
- NPN_HasMethodProcPtr hasmethod;
- NPN_ReleaseVariantValueProcPtr releasevariantvalue;
- NPN_SetExceptionProcPtr setexception;
- NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate;
- NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate;
- NPN_EnumerateProcPtr enumerate;
- NPN_PluginThreadAsyncCallProcPtr pluginthreadasynccall;
- NPN_ConstructProcPtr construct;
- NPN_GetValueForURLPtr getvalueforurl;
- NPN_SetValueForURLPtr setvalueforurl;
- NPN_GetAuthenticationInfoPtr getauthenticationinfo;
- NPN_ScheduleTimerPtr scheduletimer;
- NPN_UnscheduleTimerPtr unscheduletimer;
- NPN_PopUpContextMenuPtr popupcontextmenu;
- NPN_ConvertPointPtr convertpoint;
+ uint16_t size;
+ uint16_t version;
+ NPN_GetURLProcPtr geturl;
+ NPN_PostURLProcPtr posturl;
+ NPN_RequestReadProcPtr requestread;
+ NPN_NewStreamProcPtr newstream;
+ NPN_WriteProcPtr write;
+ NPN_DestroyStreamProcPtr destroystream;
+ NPN_StatusProcPtr status;
+ NPN_UserAgentProcPtr uagent;
+ NPN_MemAllocProcPtr memalloc;
+ NPN_MemFreeProcPtr memfree;
+ NPN_MemFlushProcPtr memflush;
+ NPN_ReloadPluginsProcPtr reloadplugins;
+ NPN_GetJavaEnvProcPtr getJavaEnv;
+ NPN_GetJavaPeerProcPtr getJavaPeer;
+ NPN_GetURLNotifyProcPtr geturlnotify;
+ NPN_PostURLNotifyProcPtr posturlnotify;
+ NPN_GetValueProcPtr getvalue;
+ NPN_SetValueProcPtr setvalue;
+ NPN_InvalidateRectProcPtr invalidaterect;
+ NPN_InvalidateRegionProcPtr invalidateregion;
+ NPN_ForceRedrawProcPtr forceredraw;
+ NPN_GetStringIdentifierProcPtr getstringidentifier;
+ NPN_GetStringIdentifiersProcPtr getstringidentifiers;
+ NPN_GetIntIdentifierProcPtr getintidentifier;
+ NPN_IdentifierIsStringProcPtr identifierisstring;
+ NPN_UTF8FromIdentifierProcPtr utf8fromidentifier;
+ NPN_IntFromIdentifierProcPtr intfromidentifier;
+ NPN_CreateObjectProcPtr createobject;
+ NPN_RetainObjectProcPtr retainobject;
+ NPN_ReleaseObjectProcPtr releaseobject;
+ NPN_InvokeProcPtr invoke;
+ NPN_InvokeDefaultProcPtr invokeDefault;
+ NPN_EvaluateProcPtr evaluate;
+ NPN_GetPropertyProcPtr getproperty;
+ NPN_SetPropertyProcPtr setproperty;
+ NPN_RemovePropertyProcPtr removeproperty;
+ NPN_HasPropertyProcPtr hasproperty;
+ NPN_HasMethodProcPtr hasmethod;
+ NPN_ReleaseVariantValueProcPtr releasevariantvalue;
+ NPN_SetExceptionProcPtr setexception;
+ NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate;
+ NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate;
+ NPN_EnumerateProcPtr enumerate;
+ NPN_PluginThreadAsyncCallProcPtr pluginthreadasynccall;
+ NPN_ConstructProcPtr construct;
+ NPN_GetValueForURLPtr getvalueforurl;
+ NPN_SetValueForURLPtr setvalueforurl;
+ NPN_GetAuthenticationInfoPtr getauthenticationinfo;
+ NPN_ScheduleTimerPtr scheduletimer;
+ NPN_UnscheduleTimerPtr unscheduletimer;
+ NPN_PopUpContextMenuPtr popupcontextmenu;
+ NPN_ConvertPointPtr convertpoint;
} NPNetscapeFuncs;
#ifdef XP_MACOSX
@@ -208,13 +264,13 @@
*/
enum
{
- kBPSupportedMIMETypesStructVers_1 = 1
+ kBPSupportedMIMETypesStructVers_1 = 1
};
typedef struct _BPSupportedMIMETypes
{
- SInt32 structVersion; /* struct version */
- Handle typeStrings; /* STR# formated handle, allocated by plug-in */
- Handle infoStrings; /* STR# formated handle, allocated by plug-in */
+ SInt32 structVersion; /* struct version */
+ Handle typeStrings; /* STR# formated handle, allocated by
plug-in */
+ Handle infoStrings; /* STR# formated handle, allocated by
plug-in */
} BPSupportedMIMETypes;
OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
#define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
@@ -223,25 +279,25 @@
#endif
#if defined(_WINDOWS)
-#define OSCALL WINAPI
+# define OSCALL WINAPI
#else
#if defined(__OS2__)
-#define OSCALL _System
+# define OSCALL _System
#else
-#define OSCALL
+# define OSCALL
#endif
#endif
#if defined(XP_UNIX)
/* GCC 3.3 and later support the visibility attribute. */
#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__
>= 3))
-#define NP_VISIBILITY_DEFAULT __attribute__((visibility("default")))
+# define NP_VISIBILITY_DEFAULT __attribute__((visibility("default")))
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#define NP_VISIBILITY_DEFAULT __global
+# define NP_VISIBILITY_DEFAULT __global
#else
-#define NP_VISIBILITY_DEFAULT
+# define NP_VISIBILITY_DEFAULT
#endif
-#define NP_EXPORT(__type) NP_VISIBILITY_DEFAULT __type
+# define NP_EXPORT(__type) NP_VISIBILITY_DEFAULT __type
#endif
#if defined(_WINDOWS) || defined (__OS2__)
@@ -251,14 +307,15 @@
/* plugin meta member functions */
#if defined(__OS2__)
typedef struct _NPPluginData { /* Alternate OS2 Plugin interface */
- char *pMimeTypes;
- char *pFileExtents;
- char *pFileOpenTemplate;
- char *pProductName;
- char *pProductDescription;
- unsigned long dwProductVersionMS;
- unsigned long dwProductVersionLS;
+ char *pMimeTypes;
+ char *pFileExtents;
+ char *pFileOpenTemplate;
+ char *pProductName;
+ char *pProductDescription;
+ unsigned long dwProductVersionMS;
+ unsigned long dwProductVersionLS;
} NPPluginData;
+
NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData);
#endif
NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs);
@@ -271,11 +328,11 @@
#endif
#if defined(__OS2__)
-#pragma pack()
+# pragma pack()
#endif
#ifdef XP_UNIX
-#ifdef __cplusplus
+# ifdef __cplusplus
extern "C" {
#endif
NP_EXPORT(char*) NP_GetPluginVersion();
@@ -294,3 +351,8 @@
#endif
#endif /* npfunctions_h_ */
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
=== modified file 'plugin/npapi/mozilla-sdk/include/npruntime.h'
--- a/plugin/npapi/mozilla-sdk/include/npruntime.h 2010-03-24 23:33:22
+0000
+++ b/plugin/npapi/mozilla-sdk/include/npruntime.h 2010-06-02 16:32:55
+0000
@@ -424,3 +424,8 @@
#endif
#endif
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
=== modified file 'plugin/npapi/mozilla-sdk/include/nptypes.h'
--- a/plugin/npapi/mozilla-sdk/include/nptypes.h 2010-03-24 23:33:22
+0000
+++ b/plugin/npapi/mozilla-sdk/include/nptypes.h 2010-06-02 16:32:55
+0000
@@ -1,40 +1,23 @@
/* -*- 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 <address@hidden> (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 ***** */
+
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+// Foundation, Inc
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
#ifndef nptypes_h_
#define nptypes_h_
@@ -45,74 +28,79 @@
*/
#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;
+/*
+ * 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>
+/*
+ * 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
+#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
+/*
+ * 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>
+# 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>
+/*
+ * 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
+#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_ */
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
=== modified file 'plugin/npapi/mozilla-sdk/np_entry.cpp'
--- a/plugin/npapi/mozilla-sdk/np_entry.cpp 2010-05-27 19:11:10 +0000
+++ b/plugin/npapi/mozilla-sdk/np_entry.cpp 2010-06-02 16:32:55 +0000
@@ -29,133 +29,140 @@
extern NPError NS_PluginGetValue(NPPVariable aVariable, void *aValue);
-NPError OSCALL NP_Shutdown()
+NPError OSCALL
+NP_Shutdown()
{
- NS_PluginShutdown();
- return NPERR_NO_ERROR;
+ NS_PluginShutdown();
+ return NPERR_NO_ERROR;
}
-NPError fillPluginFunctionTable(NPPluginFuncs* aNPPFuncs)
+NPError
+fillPluginFunctionTable(NPPluginFuncs* aNPPFuncs)
{
- if(aNPPFuncs == NULL)
- return NPERR_INVALID_FUNCTABLE_ERROR;
-
- // Set up the plugin function table that Netscape will use to
- // call us. Netscape needs to know about our version and size
- // and have a UniversalProcPointer for every function we implement.
-
- aNPPFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
+ if(aNPPFuncs == NULL) {
+ return NPERR_INVALID_FUNCTABLE_ERROR;
+ }
+
+ // Set up the plugin function table that Netscape will use to
+ // call us. Netscape needs to know about our version and size
+ // and have a UniversalProcPointer for every function we implement.
+
+ aNPPFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
#ifdef XP_MAC
- aNPPFuncs->newp = NewNPP_NewProc(Private_New);
- aNPPFuncs->destroy = NewNPP_DestroyProc(Private_Destroy);
- aNPPFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow);
- aNPPFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream);
- aNPPFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream);
- aNPPFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile);
- aNPPFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady);
- aNPPFuncs->write = NewNPP_WriteProc(Private_Write);
- aNPPFuncs->print = NewNPP_PrintProc(Private_Print);
- aNPPFuncs->event = NewNPP_HandleEventProc(Private_HandleEvent);
- aNPPFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);
- aNPPFuncs->getvalue = NewNPP_GetValueProc(Private_GetValue);
- aNPPFuncs->setvalue = NewNPP_SetValueProc(Private_SetValue);
+ aNPPFuncs->newp = NewNPP_NewProc(Private_New);
+ aNPPFuncs->destroy = NewNPP_DestroyProc(Private_Destroy);
+ aNPPFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow);
+ aNPPFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream);
+ aNPPFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream);
+ aNPPFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile);
+ aNPPFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady);
+ aNPPFuncs->write = NewNPP_WriteProc(Private_Write);
+ aNPPFuncs->print = NewNPP_PrintProc(Private_Print);
+ aNPPFuncs->event = NewNPP_HandleEventProc(Private_HandleEvent);
+ aNPPFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);
+ aNPPFuncs->getvalue = NewNPP_GetValueProc(Private_GetValue);
+ aNPPFuncs->setvalue = NewNPP_SetValueProc(Private_SetValue);
#else
- aNPPFuncs->newp = NPP_New;
- aNPPFuncs->destroy = NPP_Destroy;
- aNPPFuncs->setwindow = NPP_SetWindow;
- aNPPFuncs->newstream = NPP_NewStream;
- aNPPFuncs->destroystream = NPP_DestroyStream;
- aNPPFuncs->asfile = NPP_StreamAsFile;
- aNPPFuncs->writeready = NPP_WriteReady;
- aNPPFuncs->write = NPP_Write;
- aNPPFuncs->print = NPP_Print;
- aNPPFuncs->event = NPP_HandleEvent;
- aNPPFuncs->urlnotify = NPP_URLNotify;
- aNPPFuncs->getvalue = NPP_GetValue;
- aNPPFuncs->setvalue = NPP_SetValue;
+ aNPPFuncs->newp = NPP_New;
+ aNPPFuncs->destroy = NPP_Destroy;
+ aNPPFuncs->setwindow = NPP_SetWindow;
+ aNPPFuncs->newstream = NPP_NewStream;
+ aNPPFuncs->destroystream = NPP_DestroyStream;
+ aNPPFuncs->asfile = NPP_StreamAsFile;
+ aNPPFuncs->writeready = NPP_WriteReady;
+ aNPPFuncs->write = NPP_Write;
+ aNPPFuncs->print = NPP_Print;
+ aNPPFuncs->event = NPP_HandleEvent;
+ aNPPFuncs->urlnotify = NPP_URLNotify;
+ aNPPFuncs->getvalue = NPP_GetValue;
+ aNPPFuncs->setvalue = NPP_SetValue;
#endif
#ifdef OJI
- aNPPFuncs->javaClass = NULL;
+ aNPPFuncs->javaClass = NULL;
#endif
-
- return NPERR_NO_ERROR;
+
+ return NPERR_NO_ERROR;
}
-NPError fillNetscapeFunctionTable(NPNetscapeFuncs* aNPNFuncs)
+NPError
+fillNetscapeFunctionTable(NPNetscapeFuncs* aNPNFuncs)
{
- int i = 0, n;
-
- if(aNPNFuncs == NULL)
- return NPERR_INVALID_FUNCTABLE_ERROR;
-
- if(HIBYTE(aNPNFuncs->version) > NP_VERSION_MAJOR)
- return NPERR_INCOMPATIBLE_VERSION_ERROR;
-
+ int i = 0, n;
+
+ if(aNPNFuncs == NULL) {
+ return NPERR_INVALID_FUNCTABLE_ERROR;
+ }
+
+ if(HIBYTE(aNPNFuncs->version) > NP_VERSION_MAJOR) {
+ return NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+
#if 0
- if(aNPNFuncs->size < sizeof(NPNetscapeFuncs))
- return NPERR_INVALID_FUNCTABLE_ERROR;
+ if(aNPNFuncs->size < sizeof(NPNetscapeFuncs)) {
+ return NPERR_INVALID_FUNCTABLE_ERROR;
+ }
#endif
-
- // Number of function pointers in aNPNFuncs.
- n = (aNPNFuncs->size - (2 * sizeof(uint16_t))) / sizeof(void *);
-
- NPNFuncs.size = aNPNFuncs->size;
- NPNFuncs.version = aNPNFuncs->version;
-
- /*
- * BEWARE! The following is order-sensitive and needs to be in the
- * same order as the structure definition from npupp.h.
- */
-
- if (++i <= n) NPNFuncs.geturl = aNPNFuncs->geturl;
- if (++i <= n) NPNFuncs.posturl = aNPNFuncs->posturl;
- if (++i <= n) NPNFuncs.requestread = aNPNFuncs->requestread;
- if (++i <= n) NPNFuncs.newstream = aNPNFuncs->newstream;
- if (++i <= n) NPNFuncs.write = aNPNFuncs->write;
- if (++i <= n) NPNFuncs.destroystream = aNPNFuncs->destroystream;
- if (++i <= n) NPNFuncs.status = aNPNFuncs->status;
- if (++i <= n) NPNFuncs.uagent = aNPNFuncs->uagent;
- if (++i <= n) NPNFuncs.memalloc = aNPNFuncs->memalloc;
- if (++i <= n) NPNFuncs.memfree = aNPNFuncs->memfree;
- if (++i <= n) NPNFuncs.memflush = aNPNFuncs->memflush;
- if (++i <= n) NPNFuncs.reloadplugins = aNPNFuncs->reloadplugins;
- if (++i <= n) NPNFuncs.getJavaEnv = aNPNFuncs->getJavaEnv;
- if (++i <= n) NPNFuncs.getJavaPeer = aNPNFuncs->getJavaPeer;
- if (++i <= n) NPNFuncs.geturlnotify = aNPNFuncs->geturlnotify;
- if (++i <= n) NPNFuncs.posturlnotify = aNPNFuncs->posturlnotify;
- if (++i <= n) NPNFuncs.getvalue = aNPNFuncs->getvalue;
- if (++i <= n) NPNFuncs.setvalue = aNPNFuncs->setvalue;
- if (++i <= n) NPNFuncs.invalidaterect = aNPNFuncs->invalidaterect;
- if (++i <= n) NPNFuncs.invalidateregion = aNPNFuncs->invalidateregion;
- if (++i <= n) NPNFuncs.forceredraw = aNPNFuncs->forceredraw;
- if (++i <= n) NPNFuncs.getstringidentifier = aNPNFuncs->getstringidentifier;
- if (++i <= n) NPNFuncs.getstringidentifiers =
aNPNFuncs->getstringidentifiers;
- if (++i <= n) NPNFuncs.getintidentifier = aNPNFuncs->getintidentifier;
- if (++i <= n) NPNFuncs.identifierisstring = aNPNFuncs->identifierisstring;
- if (++i <= n) NPNFuncs.utf8fromidentifier = aNPNFuncs->utf8fromidentifier;
- if (++i <= n) NPNFuncs.intfromidentifier = aNPNFuncs->intfromidentifier;
- if (++i <= n) NPNFuncs.createobject = aNPNFuncs->createobject;
- if (++i <= n) NPNFuncs.retainobject = aNPNFuncs->retainobject;
- if (++i <= n) NPNFuncs.releaseobject = aNPNFuncs->releaseobject;
- if (++i <= n) NPNFuncs.invoke = aNPNFuncs->invoke;
- if (++i <= n) NPNFuncs.invokeDefault = aNPNFuncs->invokeDefault;
- if (++i <= n) NPNFuncs.evaluate = aNPNFuncs->evaluate;
- if (++i <= n) NPNFuncs.getproperty = aNPNFuncs->getproperty;
- if (++i <= n) NPNFuncs.setproperty = aNPNFuncs->setproperty;
- if (++i <= n) NPNFuncs.removeproperty = aNPNFuncs->removeproperty;
- if (++i <= n) NPNFuncs.hasproperty = aNPNFuncs->hasproperty;
- if (++i <= n) NPNFuncs.hasmethod = aNPNFuncs->hasmethod;
- if (++i <= n) NPNFuncs.releasevariantvalue = aNPNFuncs->releasevariantvalue;
- if (++i <= n) NPNFuncs.setexception = aNPNFuncs->setexception;
- if (++i <= n) NPNFuncs.pushpopupsenabledstate =
aNPNFuncs->pushpopupsenabledstate;
- if (++i <= n) NPNFuncs.poppopupsenabledstate =
aNPNFuncs->poppopupsenabledstate;
- if (++i <= n) NPNFuncs.enumerate = aNPNFuncs->enumerate;
- if (++i <= n) NPNFuncs.pluginthreadasynccall =
aNPNFuncs->pluginthreadasynccall;
- if (++i <= n) NPNFuncs.construct = aNPNFuncs->construct;
- if (++i <= n) NPNFuncs.getvalueforurl = aNPNFuncs->getvalueforurl;
- if (++i <= n) NPNFuncs.setvalueforurl = aNPNFuncs->setvalueforurl;
-
- return NPERR_NO_ERROR;
+
+ // Number of function pointers in aNPNFuncs.
+ n = (aNPNFuncs->size - (2 * sizeof(uint16_t))) / sizeof(void *);
+
+ NPNFuncs.size = aNPNFuncs->size;
+ NPNFuncs.version = aNPNFuncs->version;
+
+ /*
+ * BEWARE! The following is order-sensitive and needs to be in the
+ * same order as the structure definition from npupp.h.
+ */
+
+ if (++i <= n) NPNFuncs.geturl = aNPNFuncs->geturl;
+ if (++i <= n) NPNFuncs.posturl = aNPNFuncs->posturl;
+ if (++i <= n) NPNFuncs.requestread = aNPNFuncs->requestread;
+ if (++i <= n) NPNFuncs.newstream = aNPNFuncs->newstream;
+ if (++i <= n) NPNFuncs.write = aNPNFuncs->write;
+ if (++i <= n) NPNFuncs.destroystream = aNPNFuncs->destroystream;
+ if (++i <= n) NPNFuncs.status = aNPNFuncs->status;
+ if (++i <= n) NPNFuncs.uagent = aNPNFuncs->uagent;
+ if (++i <= n) NPNFuncs.memalloc = aNPNFuncs->memalloc;
+ if (++i <= n) NPNFuncs.memfree = aNPNFuncs->memfree;
+ if (++i <= n) NPNFuncs.memflush = aNPNFuncs->memflush;
+ if (++i <= n) NPNFuncs.reloadplugins = aNPNFuncs->reloadplugins;
+ if (++i <= n) NPNFuncs.getJavaEnv = aNPNFuncs->getJavaEnv;
+ if (++i <= n) NPNFuncs.getJavaPeer = aNPNFuncs->getJavaPeer;
+ if (++i <= n) NPNFuncs.geturlnotify = aNPNFuncs->geturlnotify;
+ if (++i <= n) NPNFuncs.posturlnotify = aNPNFuncs->posturlnotify;
+ if (++i <= n) NPNFuncs.getvalue = aNPNFuncs->getvalue;
+ if (++i <= n) NPNFuncs.setvalue = aNPNFuncs->setvalue;
+ if (++i <= n) NPNFuncs.invalidaterect = aNPNFuncs->invalidaterect;
+ if (++i <= n) NPNFuncs.invalidateregion = aNPNFuncs->invalidateregion;
+ if (++i <= n) NPNFuncs.forceredraw = aNPNFuncs->forceredraw;
+ if (++i <= n) NPNFuncs.getstringidentifier =
aNPNFuncs->getstringidentifier;
+ if (++i <= n) NPNFuncs.getstringidentifiers =
aNPNFuncs->getstringidentifiers;
+ if (++i <= n) NPNFuncs.getintidentifier = aNPNFuncs->getintidentifier;
+ if (++i <= n) NPNFuncs.identifierisstring = aNPNFuncs->identifierisstring;
+ if (++i <= n) NPNFuncs.utf8fromidentifier = aNPNFuncs->utf8fromidentifier;
+ if (++i <= n) NPNFuncs.intfromidentifier = aNPNFuncs->intfromidentifier;
+ if (++i <= n) NPNFuncs.createobject = aNPNFuncs->createobject;
+ if (++i <= n) NPNFuncs.retainobject = aNPNFuncs->retainobject;
+ if (++i <= n) NPNFuncs.releaseobject = aNPNFuncs->releaseobject;
+ if (++i <= n) NPNFuncs.invoke = aNPNFuncs->invoke;
+ if (++i <= n) NPNFuncs.invokeDefault = aNPNFuncs->invokeDefault;
+ if (++i <= n) NPNFuncs.evaluate = aNPNFuncs->evaluate;
+ if (++i <= n) NPNFuncs.getproperty = aNPNFuncs->getproperty;
+ if (++i <= n) NPNFuncs.setproperty = aNPNFuncs->setproperty;
+ if (++i <= n) NPNFuncs.removeproperty = aNPNFuncs->removeproperty;
+ if (++i <= n) NPNFuncs.hasproperty = aNPNFuncs->hasproperty;
+ if (++i <= n) NPNFuncs.hasmethod = aNPNFuncs->hasmethod;
+ if (++i <= n) NPNFuncs.releasevariantvalue =
aNPNFuncs->releasevariantvalue;
+ if (++i <= n) NPNFuncs.setexception = aNPNFuncs->setexception;
+ if (++i <= n) NPNFuncs.pushpopupsenabledstate =
aNPNFuncs->pushpopupsenabledstate;
+ if (++i <= n) NPNFuncs.poppopupsenabledstate =
aNPNFuncs->poppopupsenabledstate;
+ if (++i <= n) NPNFuncs.enumerate = aNPNFuncs->enumerate;
+ if (++i <= n) NPNFuncs.pluginthreadasynccall =
aNPNFuncs->pluginthreadasynccall;
+ if (++i <= n) NPNFuncs.construct = aNPNFuncs->construct;
+ if (++i <= n) NPNFuncs.getvalueforurl = aNPNFuncs->getvalueforurl;
+ if (++i <= n) NPNFuncs.setvalueforurl = aNPNFuncs->setvalueforurl;
+
+ return NPERR_NO_ERROR;
}
//
@@ -169,7 +176,8 @@
/**************************************************/
#ifdef XP_WIN
-NPError OSCALL NP_Initialize(NPNetscapeFuncs* aNPNFuncs)
+NPError OSCALL
+NP_Initialize(NPNetscapeFuncs* aNPNFuncs)
{
/*
* N.B. On Firefox 2.0.0.12/WinXP, aNPNFuncs->size is 172 while
@@ -181,19 +189,21 @@
* NS_PluginInitialize anyway, too.
*/
- NPError rv = fillNetscapeFunctionTable(aNPNFuncs);
+ NPError rv = fillNetscapeFunctionTable(aNPNFuncs);
#if 0
- if(rv != NPERR_NO_ERROR)
- return rv;
+ if(rv != NPERR_NO_ERROR) {
+ return rv;
+ }
#endif
- NPError rv2 = NS_PluginInitialize();
-
- return rv2 != NPERR_NO_ERROR ? rv2 : rv;
+ NPError rv2 = NS_PluginInitialize();
+
+ return rv2 != NPERR_NO_ERROR ? rv2 : rv;
}
-NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* aNPPFuncs)
+NPError OSCALL
+NP_GetEntryPoints(NPPluginFuncs* aNPPFuncs)
{
- return fillPluginFunctionTable(aNPPFuncs);
+ return fillPluginFunctionTable(aNPPFuncs);
}
#endif //XP_WIN
@@ -205,27 +215,32 @@
/**************************************************/
#ifdef XP_UNIX
-NPError NP_Initialize(NPNetscapeFuncs* aNPNFuncs, NPPluginFuncs* aNPPFuncs)
-{
- NPError rv = fillNetscapeFunctionTable(aNPNFuncs);
- if(rv != NPERR_NO_ERROR)
- return rv;
-
- rv = fillPluginFunctionTable(aNPPFuncs);
- if(rv != NPERR_NO_ERROR)
- return rv;
-
- return NS_PluginInitialize();
-}
-
-char * NP_GetMIMEDescription(void)
-{
- return NPP_GetMIMEDescription();
-}
-
-NPError NP_GetValue(void* /*future*/, NPPVariable aVariable, void *aValue)
-{
- return NS_PluginGetValue(aVariable, aValue);
+NPError
+NP_Initialize(NPNetscapeFuncs* aNPNFuncs, NPPluginFuncs* aNPPFuncs)
+{
+ NPError rv = fillNetscapeFunctionTable(aNPNFuncs);
+ if(rv != NPERR_NO_ERROR) {
+ return rv;
+ }
+
+ rv = fillPluginFunctionTable(aNPPFuncs);
+ if(rv != NPERR_NO_ERROR) {
+ return rv;
+ }
+
+ return NS_PluginInitialize();
+}
+
+char *
+NP_GetMIMEDescription(void)
+{
+ return NPP_GetMIMEDescription();
+}
+
+NPError
+NP_GetValue(void* /*future*/, NPPVariable aVariable, void *aValue)
+{
+ return NS_PluginGetValue(aVariable, aValue);
}
#endif //XP_UNIX
@@ -243,82 +258,86 @@
short gResFile; // Refnum of the plugin's resource file
-NPError Private_Initialize(void)
+NPError
+Private_Initialize(void)
{
- NPError rv = NS_PluginInitialize();
- return rv;
+ NPError rv = NS_PluginInitialize();
+ return rv;
}
-void Private_Shutdown(void)
+void
+Private_Shutdown(void)
{
- NS_PluginShutdown();
- __destroy_global_chain();
+ NS_PluginShutdown();
+ __destroy_global_chain();
}
void SetUpQD(void);
void SetUpQD(void)
{
- ProcessSerialNumber PSN;
- FSSpec myFSSpec;
- Str63 name;
- ProcessInfoRec infoRec;
- OSErr result = noErr;
- CFragConnectionID connID;
- Str255 errName;
-
- // Memorize the plugin?s resource file refnum for later use.
- gResFile = CurResFile();
-
+ ProcessSerialNumber PSN;
+ FSSpec myFSSpec;
+ Str63 name;
+ ProcessInfoRec infoRec;
+ OSErr result = noErr;
+ CFragConnectionID connID;
+ Str255 errName;
+
+ // Memorize the plugin?s resource file refnum for later use.
+ gResFile = CurResFile();
+
#if !TARGET_API_MAC_CARBON
- // Ask the system if CFM is available.
- long response;
- OSErr err = Gestalt(gestaltCFMAttr, &response);
- Boolean hasCFM = BitTst(&response, 31-gestaltCFMPresent);
-
- if (hasCFM) {
- // GetProcessInformation takes a process serial number and
- // will give us back the name and FSSpec of the application.
- // See the Process Manager in IM.
- infoRec.processInfoLength = sizeof(ProcessInfoRec);
- infoRec.processName = name;
- infoRec.processAppSpec = &myFSSpec;
-
- PSN.highLongOfPSN = 0;
- PSN.lowLongOfPSN = kCurrentProcess;
-
- result = GetProcessInformation(&PSN, &infoRec);
- }
- else
- // If no CFM installed, assume it must be a 68K app.
- result = -1;
-
- if (result == noErr) {
- // Now that we know the app name and FSSpec, we can call GetDiskFragment
- // to get a connID to use in a subsequent call to FindSymbol (it will also
- // return the address of ?main? in app, which we ignore). If
GetDiskFragment
- // returns an error, we assume the app must be 68K.
- Ptr mainAddr;
- result = GetDiskFragment(infoRec.processAppSpec, 0L, 0L,
infoRec.processName,
- kReferenceCFrag, &connID, (Ptr*)&mainAddr,
errName);
- }
-
- if (result == noErr) {
- // The app is a PPC code fragment, so call FindSymbol
- // to get the exported ?qd? symbol so we can access its
- // QuickDraw globals.
- CFragSymbolClass symClass;
- result = FindSymbol(connID, "\pqd", (Ptr*)&gQDPtr, &symClass);
- }
- else {
- // The app is 68K, so use its A5 to compute the address
- // of its QuickDraw globals.
- gQDPtr = (QDGlobals*)(*((long*)SetCurrentA5()) - (sizeof(QDGlobals) -
sizeof(GrafPtr)));
- }
+ // Ask the system if CFM is available.
+ long response;
+ OSErr err = Gestalt(gestaltCFMAttr, &response);
+ Boolean hasCFM = BitTst(&response, 31-gestaltCFMPresent);
+
+ if (hasCFM) {
+ // GetProcessInformation takes a process serial number and
+ // will give us back the name and FSSpec of the application.
+ // See the Process Manager in IM.
+ infoRec.processInfoLength = sizeof(ProcessInfoRec);
+ infoRec.processName = name;
+ infoRec.processAppSpec = &myFSSpec;
+
+ PSN.highLongOfPSN = 0;
+ PSN.lowLongOfPSN = kCurrentProcess;
+
+ result = GetProcessInformation(&PSN, &infoRec);
+ } else {
+ // If no CFM installed, assume it must be a 68K app.
+ result = -1;
+ }
+
+ if (result == noErr) {
+ // Now that we know the app name and FSSpec, we can call
+ // GetDiskFragmentto get a connID to use in a subsequent call
+ // to FindSymbol (it will also return the address of ?main? in
+ // app, which we ignore). If GetDiskFragment returns an
+ // error, we assume the app must be 68K.
+ Ptr mainAddr;
+ result = GetDiskFragment(infoRec.processAppSpec, 0L, 0L,
+ infoRec.processName, kReferenceCFrag,
+ &connID, (Ptr*)&mainAddr, errName);
+ }
+
+ if (result == noErr) {
+ // The app is a PPC code fragment, so call FindSymbol
+ // to get the exported ?qd? symbol so we can access its
+ // QuickDraw globals.
+ CFragSymbolClass symClass;
+ result = FindSymbol(connID, "\pqd", (Ptr*)&gQDPtr, &symClass);
+ } else {
+ // The app is 68K, so use its A5 to compute the address
+ // of its QuickDraw globals.
+ gQDPtr = (QDGlobals*)(*((long*)SetCurrentA5()) - (sizeof(QDGlobals) -
sizeof(GrafPtr)));
+ }
#endif /* !TARGET_API_MAC_CARBON */
}
-NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs,
NPP_ShutdownUPP* unloadUpp);
+NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs,
+ NPP_ShutdownUPP* unloadUpp);
#if !TARGET_API_MAC_CARBON
#pragma export on
@@ -329,26 +348,34 @@
#endif /* !TARGET_API_MAC_CARBON */
-NPError main(NPNetscapeFuncs* aNPNFuncs, NPPluginFuncs* aNPPFuncs,
NPP_ShutdownUPP* aUnloadUpp)
+NPError main(NPNetscapeFuncs* aNPNFuncs, NPPluginFuncs* aNPPFuncs,
+ NPP_ShutdownUPP* aUnloadUpp)
{
- NPError rv = NPERR_NO_ERROR;
-
- if (aUnloadUpp == NULL)
- rv = NPERR_INVALID_FUNCTABLE_ERROR;
-
- if (rv == NPERR_NO_ERROR)
- rv = fillNetscapeFunctionTable(aNPNFuncs);
-
- if (rv == NPERR_NO_ERROR) {
- // defer static constructors until the global functions are initialized.
- __InitCode__();
- rv = fillPluginFunctionTable(aNPPFuncs);
- }
-
- *aUnloadUpp = NewNPP_ShutdownProc(Private_Shutdown);
- SetUpQD();
- rv = Private_Initialize();
-
- return rv;
+ NPError rv = NPERR_NO_ERROR;
+
+ if (aUnloadUpp == NULL) {
+ rv = NPERR_INVALID_FUNCTABLE_ERROR;
+ }
+
+ if (rv == NPERR_NO_ERROR) {
+ rv = fillNetscapeFunctionTable(aNPNFuncs);
+ }
+
+ if (rv == NPERR_NO_ERROR) {
+ // defer static constructors until the global functions are
initialized.
+ __InitCode__();
+ rv = fillPluginFunctionTable(aNPPFuncs);
+ }
+
+ *aUnloadUpp = NewNPP_ShutdownProc(Private_Shutdown);
+ SetUpQD();
+ rv = Private_Initialize();
+
+ return rv;
}
#endif //XP_MAC
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
=== modified file 'plugin/npapi/mozilla-sdk/npn_gate.cpp'
--- a/plugin/npapi/mozilla-sdk/npn_gate.cpp 2010-06-02 14:18:20 +0000
+++ b/plugin/npapi/mozilla-sdk/npn_gate.cpp 2010-06-02 16:32:55 +0000
@@ -1,39 +1,23 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: NPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Netscape 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/NPL/
- *
- * 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
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 NPL, 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 NPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009,
+// 2010 Free Software Foundation, Inc
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
////////////////////////////////////////////////////////////
//
@@ -54,286 +38,340 @@
extern NPNetscapeFuncs NPNFuncs;
-void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major,
int* netscape_minor)
-{
- *plugin_major = NP_VERSION_MAJOR;
- *plugin_minor = NP_VERSION_MINOR;
- *netscape_major = HIBYTE(NPNFuncs.version);
- *netscape_minor = LOBYTE(NPNFuncs.version);
-}
-
-NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target,
void* notifyData)
-{
- int navMinorVers = NPNFuncs.version & 0xFF;
- NPError rv = NPERR_NO_ERROR;
-
- if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
- rv = NPNFuncs.geturlnotify(instance, url, target, notifyData);
- else
- rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
-
- return rv;
-}
-
-NPError NPN_GetURL(NPP instance, const char *url, const char *target)
-{
- NPError rv = NPNFuncs.geturl(instance, url, target);
- return rv;
-}
-
-NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window,
uint32_t len, const char* buf, NPBool file, void* notifyData)
-{
- int navMinorVers = NPNFuncs.version & 0xFF;
- NPError rv = NPERR_NO_ERROR;
-
- if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
- rv = NPNFuncs.posturlnotify(instance, url, window, len, buf,
file, notifyData);
- else
- rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
-
- return rv;
-}
-
-NPError NPN_PostURL(NPP instance, const char* url, const char* window,
uint32_t len, const char* buf, NPBool file)
-{
- NPError rv = NPNFuncs.posturl(instance, url, window, len, buf, file);
- return rv;
+void
+NPN_Version(int* plugin_major, int* plugin_minor,
+ int* netscape_major, int* netscape_minor)
+{
+ *plugin_major = NP_VERSION_MAJOR;
+ *plugin_minor = NP_VERSION_MINOR;
+ *netscape_major = HIBYTE(NPNFuncs.version);
+ *netscape_minor = LOBYTE(NPNFuncs.version);
+}
+
+NPError
+NPN_GetURLNotify(NPP instance, const char *url, const char *target,
+ void* notifyData)
+{
+ int navMinorVers = NPNFuncs.version & 0xFF;
+ NPError rv = NPERR_NO_ERROR;
+
+ if(navMinorVers >= NPVERS_HAS_NOTIFICATION) {
+ rv = NPNFuncs.geturlnotify(instance, url, target, notifyData);
+ } else {
+ rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+
+ return rv;
+}
+
+NPError
+NPN_GetURL(NPP instance, const char *url, const char *target)
+{
+ NPError rv = NPNFuncs.geturl(instance, url, target);
+ return rv;
+}
+
+NPError
+NPN_PostURLNotify(NPP instance, const char* url, const char* window,
+ uint32_t len, const char* buf, NPBool file,
+ void* notifyData)
+{
+ int navMinorVers = NPNFuncs.version & 0xFF;
+ NPError rv = NPERR_NO_ERROR;
+
+ if(navMinorVers >= NPVERS_HAS_NOTIFICATION) {
+ rv = NPNFuncs.posturlnotify(instance, url, window, len, buf, file,
notifyData);
+ } else {
+ rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+
+ return rv;
+}
+
+NPError
+NPN_PostURL(NPP instance, const char* url, const char* window,
+ uint32_t len, const char* buf, NPBool file)
+{
+ NPError rv = NPNFuncs.posturl(instance, url, window, len, buf, file);
+ return rv;
}
-NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
-{
- NPError rv = NPNFuncs.requestread(stream, rangeList);
- return rv;
-}
-
-NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target,
NPStream** stream)
-{
- int navMinorVersion = NPNFuncs.version & 0xFF;
-
- NPError rv = NPERR_NO_ERROR;
-
- if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
- rv = NPNFuncs.newstream(instance, type, target, stream);
- else
- rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
-
- return rv;
-}
-
-int32_t NPN_Write(NPP instance, NPStream *stream, int32_t len, void *buffer)
-{
- int navMinorVersion = NPNFuncs.version & 0xFF;
- int32_t rv = 0;
-
- if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
- rv = NPNFuncs.write(instance, stream, len, buffer);
- else
- rv = -1;
-
- return rv;
-}
-
-NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
-{
- int navMinorVersion = NPNFuncs.version & 0xFF;
- NPError rv = NPERR_NO_ERROR;
-
- if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
- rv = NPNFuncs.destroystream(instance, stream, reason);
- else
- rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
-
- return rv;
-}
-
-void NPN_Status(NPP instance, const char *message)
-{
- NPNFuncs.status(instance, message);
-}
-
-const char* NPN_UserAgent(NPP instance)
-{
- const char * rv = NULL;
- rv = NPNFuncs.uagent(instance);
- return rv;
-}
-
-void* NPN_MemAlloc(uint32_t size)
-{
- void * rv = NULL;
- rv = NPNFuncs.memalloc(size);
- return rv;
-}
-
-void NPN_MemFree(void* ptr)
-{
- NPNFuncs.memfree(ptr);
-}
-
-uint32_t NPN_MemFlush(uint32_t size)
-{
- uint32_t rv = NPNFuncs.memflush(size);
- return rv;
-}
-
-void NPN_ReloadPlugins(NPBool reloadPages)
-{
- NPNFuncs.reloadplugins(reloadPages);
-}
-
-NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
-{
- NPError rv = NPERR_GENERIC_ERROR;
- if (NPNFuncs.getvalue) {
- rv = NPNFuncs.getvalue(instance, variable, value);
- }
- return rv;
-}
-
-NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
-{
- NPError rv = NPERR_GENERIC_ERROR;
- if (NPNFuncs.setvalue) {
+NPError
+NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
+{
+ NPError rv = NPNFuncs.requestread(stream, rangeList);
+ return rv;
+}
+
+NPError
+NPN_NewStream(NPP instance, NPMIMEType type, const char* target,
+ NPStream** stream)
+{
+ int navMinorVersion = NPNFuncs.version & 0xFF;
+
+ NPError rv = NPERR_NO_ERROR;
+
+ if(navMinorVersion >= NPVERS_HAS_STREAMOUTPUT) {
+ rv = NPNFuncs.newstream(instance, type, target, stream);
+ } else {
+ rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+
+ return rv;
+}
+
+int32_t
+NPN_Write(NPP instance, NPStream *stream, int32_t len, void *buffer)
+{
+ int navMinorVersion = NPNFuncs.version & 0xFF;
+ int32_t rv = 0;
+
+ if(navMinorVersion >= NPVERS_HAS_STREAMOUTPUT) {
+ rv = NPNFuncs.write(instance, stream, len, buffer);
+ } else {
+ rv = -1;
+ }
+
+ return rv;
+}
+
+NPError
+NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
+{
+ int navMinorVersion = NPNFuncs.version & 0xFF;
+ NPError rv = NPERR_NO_ERROR;
+
+ if(navMinorVersion >= NPVERS_HAS_STREAMOUTPUT) {
+ rv = NPNFuncs.destroystream(instance, stream, reason);
+ } else {
+ rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+
+ return rv;
+}
+
+void
+NPN_Status(NPP instance, const char *message)
+{
+ NPNFuncs.status(instance, message);
+}
+
+const char *
+NPN_UserAgent(NPP instance)
+{
+ const char * rv = NULL;
+ rv = NPNFuncs.uagent(instance);
+ return rv;
+}
+
+void *
+NPN_MemAlloc(uint32_t size)
+{
+ void * rv = NULL;
+ rv = NPNFuncs.memalloc(size);
+ return rv;
+}
+
+void
+NPN_MemFree(void* ptr)
+{
+ NPNFuncs.memfree(ptr);
+}
+
+uint32_t
+NPN_MemFlush(uint32_t size)
+{
+ uint32_t rv = NPNFuncs.memflush(size);
+ return rv;
+}
+
+void
+NPN_ReloadPlugins(NPBool reloadPages)
+{
+ NPNFuncs.reloadplugins(reloadPages);
+}
+
+NPError
+NPN_GetValue(NPP instance, NPNVariable variable, void *value)
+{
+ NPError rv = NPERR_GENERIC_ERROR;
+ if (NPNFuncs.getvalue) {
+ rv = NPNFuncs.getvalue(instance, variable, value);
+ }
+ return rv;
+}
+
+NPError
+NPN_SetValue(NPP instance, NPPVariable variable, void *value)
+{
+ NPError rv = NPERR_GENERIC_ERROR;
+ if (NPNFuncs.setvalue) {
rv = NPNFuncs.setvalue(instance, variable, value);
- }
- return rv;
-}
-
-void NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
-{
- NPNFuncs.invalidaterect(instance, invalidRect);
-}
-
-void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
-{
- NPNFuncs.invalidateregion(instance, invalidRegion);
-}
-
-void NPN_ForceRedraw(NPP instance)
-{
- NPNFuncs.forceredraw(instance);
-}
-
-NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
-{
- return NPNFuncs.getstringidentifier(name);
-}
-
-void NPN_GetStringIdentifiers(const NPUTF8 **names, uint32_t nameCount,
+ }
+ return rv;
+}
+
+void
+NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
+{
+ NPNFuncs.invalidaterect(instance, invalidRect);
+}
+
+void
+NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
+{
+ NPNFuncs.invalidateregion(instance, invalidRegion);
+}
+
+void
+NPN_ForceRedraw(NPP instance)
+{
+ NPNFuncs.forceredraw(instance);
+}
+
+NPIdentifier
+NPN_GetStringIdentifier(const NPUTF8 *name)
+{
+ return NPNFuncs.getstringidentifier(name);
+}
+
+void
+NPN_GetStringIdentifiers(const NPUTF8 **names, uint32_t nameCount,
NPIdentifier *identifiers)
{
- return NPNFuncs.getstringidentifiers(names, nameCount, identifiers);
-}
-
-NPIdentifier NPN_GetStringIdentifier(int32_t intid)
-{
- return NPNFuncs.getintidentifier(intid);
-}
-
-bool NPN_IdentifierIsString(NPIdentifier identifier)
-{
- return NPNFuncs.identifierisstring(identifier);
-}
-
-NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
-{
- return NPNFuncs.utf8fromidentifier(identifier);
-}
-
-int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
-{
- return NPNFuncs.intfromidentifier(identifier);
-}
-
-NPObject *NPN_CreateObject(NPP npp, NPClass *aClass)
-{
- return NPNFuncs.createobject(npp, aClass);
-}
-
-NPObject *NPN_RetainObject(NPObject *obj)
-{
- return NPNFuncs.retainobject(obj);
-}
-
-void NPN_ReleaseObject(NPObject *obj)
-{
- return NPNFuncs.releaseobject(obj);
-}
-
-bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
+ return NPNFuncs.getstringidentifiers(names, nameCount, identifiers);
+}
+
+NPIdentifier
+NPN_GetStringIdentifier(int32_t intid)
+{
+ return NPNFuncs.getintidentifier(intid);
+}
+
+bool
+NPN_IdentifierIsString(NPIdentifier identifier)
+{
+ return NPNFuncs.identifierisstring(identifier);
+}
+
+NPUTF8 *
+NPN_UTF8FromIdentifier(NPIdentifier identifier)
+{
+ return NPNFuncs.utf8fromidentifier(identifier);
+}
+
+int32_t
+NPN_IntFromIdentifier(NPIdentifier identifier)
+{
+ return NPNFuncs.intfromidentifier(identifier);
+}
+
+NPObject *
+NPN_CreateObject(NPP npp, NPClass *aClass)
+{
+ return NPNFuncs.createobject(npp, aClass);
+}
+
+NPObject *
+NPN_RetainObject(NPObject *obj)
+{
+ return NPNFuncs.retainobject(obj);
+}
+
+void
+NPN_ReleaseObject(NPObject *obj)
+{
+ return NPNFuncs.releaseobject(obj);
+}
+
+bool
+NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
const NPVariant *args, uint32_t argCount, NPVariant *result)
{
- return NPNFuncs.invoke(npp, obj, methodName, args, argCount, result);
+ return NPNFuncs.invoke(npp, obj, methodName, args, argCount, result);
}
-bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args,
+bool
+NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args,
uint32_t argCount, NPVariant *result)
{
- return NPNFuncs.invokeDefault(npp, obj, args, argCount, result);
+ return NPNFuncs.invokeDefault(npp, obj, args, argCount, result);
}
-bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
+bool
+NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
NPVariant *result)
{
- return NPNFuncs.evaluate(npp, obj, script, result);
+ return NPNFuncs.evaluate(npp, obj, script, result);
}
-bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
+bool
+NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
NPVariant *result)
{
- return NPNFuncs.getproperty(npp, obj, propertyName, result);
+ return NPNFuncs.getproperty(npp, obj, propertyName, result);
}
-bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
+bool
+NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
const NPVariant *value)
{
- return NPNFuncs.setproperty(npp, obj, propertyName, value);
+ return NPNFuncs.setproperty(npp, obj, propertyName, value);
}
-bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
+bool
+NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
{
- return NPNFuncs.removeproperty(npp, obj, propertyName);
+ return NPNFuncs.removeproperty(npp, obj, propertyName);
}
-bool NPN_Enumerate(NPP npp, NPObject *obj, NPIdentifier **identifier,
+bool
+NPN_Enumerate(NPP npp, NPObject *obj, NPIdentifier **identifier,
uint32_t *count)
{
- return NPNFuncs.enumerate(npp, obj, identifier, count);
+ return NPNFuncs.enumerate(npp, obj, identifier, count);
}
-bool NPN_Construct(NPP npp, NPObject *obj, const NPVariant *args,
+bool
+NPN_Construct(NPP npp, NPObject *obj, const NPVariant *args,
uint32_t argCount, NPVariant *result)
{
- return NPNFuncs.construct(npp, obj, args, argCount, result);
-}
-
-bool NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
-{
- return NPNFuncs.hasproperty(npp, obj, propertyName);
-}
-
-bool NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName)
-{
- return NPNFuncs.hasmethod(npp, obj, methodName);
-}
-
-void NPN_ReleaseVariantValue(NPVariant *variant)
-{
- NPNFuncs.releasevariantvalue(variant);
-}
-
-void NPN_SetException(NPObject* obj, const NPUTF8 *message)
-{
- NPNFuncs.setexception(obj, message);
-}
-
-NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable,
+ return NPNFuncs.construct(npp, obj, args, argCount, result);
+}
+
+bool
+NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
+{
+ return NPNFuncs.hasproperty(npp, obj, propertyName);
+}
+
+bool
+NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName)
+{
+ return NPNFuncs.hasmethod(npp, obj, methodName);
+}
+
+void
+NPN_ReleaseVariantValue(NPVariant *variant)
+{
+ NPNFuncs.releasevariantvalue(variant);
+}
+
+void
+NPN_SetException(NPObject* obj, const NPUTF8 *message)
+{
+ NPNFuncs.setexception(obj, message);
+}
+
+NPError
+NPN_GetValueForURL(NPP instance, NPNURLVariable variable,
const char *url, char **value, uint32_t *len)
{
return NPNFuncs.getvalueforurl(instance, variable, url, value, len);
}
-NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable,
+NPError
+NPN_SetValueForURL(NPP instance, NPNURLVariable variable,
const char *url, const char *value, uint32_t len)
{
return NPNFuncs.setvalueforurl(instance, variable, url, value, len);
@@ -350,9 +388,13 @@
password, plen);
}
-void NPN_PluginThreadAsyncCall(NPP plugin, void (*func)(void *), void
*userData)
+void
+NPN_PluginThreadAsyncCall(NPP plugin, void (*func)(void *), void *userData)
{
NPNFuncs.pluginthreadasynccall(plugin, func, userData);
}
-
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
=== modified file 'plugin/npapi/mozilla-sdk/npp_gate.cpp'
--- a/plugin/npapi/mozilla-sdk/npp_gate.cpp 2010-03-24 23:33:22 +0000
+++ b/plugin/npapi/mozilla-sdk/npp_gate.cpp 2010-06-02 16:32:55 +0000
@@ -1,39 +1,23 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** 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
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
+
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009,
+// 2010 Free Software Foundation, Inc
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
// Implementation of plugin entry points (NPP_*)
@@ -44,42 +28,47 @@
// will do all the necessary job
NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t
argc, char* argn[], char* argv[], NPSavedData* saved)
{
- if (!instance)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- // create a new plugin instance object
- // initialization will be done when the associated window is ready
- nsPluginCreateData ds;
-
- ds.instance = instance;
- ds.type = pluginType;
- ds.mode = mode;
- ds.argc = argc;
- ds.argn = argn;
- ds.argv = argv;
- ds.saved = saved;
-
- nsPluginInstanceBase * plugin = NS_NewPluginInstance(&ds);
- if (!plugin)
- return NPERR_OUT_OF_MEMORY_ERROR;
-
- // associate the plugin instance object with NPP instance
- instance->pdata = (void *)plugin;
- return NPERR_NO_ERROR;
+ if (!instance) {
+ return NPERR_INVALID_INSTANCE_ERROR;
+ }
+
+ // create a new plugin instance object
+ // initialization will be done when the associated window is ready
+ nsPluginCreateData ds;
+
+ ds.instance = instance;
+ ds.type = pluginType;
+ ds.mode = mode;
+ ds.argc = argc;
+ ds.argn = argn;
+ ds.argv = argv;
+ ds.saved = saved;
+
+ nsPluginInstanceBase * plugin = NS_NewPluginInstance(&ds);
+ if (!plugin) {
+ return NPERR_OUT_OF_MEMORY_ERROR;
+ }
+
+ // associate the plugin instance object with NPP instance
+ instance->pdata = (void *)plugin;
+
+ return NPERR_NO_ERROR;
}
// here is the place to clean up and destroy the nsPluginInstance object
NPError NPP_Destroy (NPP instance, NPSavedData** save)
{
- if (!instance)
+ if (!instance) {
return NPERR_INVALID_INSTANCE_ERROR;
+ }
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (plugin) {
- plugin->shut();
- NS_DestroyPluginInstance(plugin);
- }
- return NPERR_NO_ERROR;
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (plugin) {
+ plugin->shut();
+ NS_DestroyPluginInstance(plugin);
+ }
+
+ return NPERR_NO_ERROR;
}
// during this call we know when the plugin window is ready or
@@ -87,156 +76,187 @@
// initialization and shutdown
NPError NPP_SetWindow (NPP instance, NPWindow* pNPWindow)
{
- if (!instance)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- if (!pNPWindow)
- return NPERR_GENERIC_ERROR;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
-
- if (!plugin)
- return NPERR_GENERIC_ERROR;
-
- // window just created
- if (!plugin->isInitialized() && pNPWindow->window) {
- if (!plugin->init(pNPWindow)) {
- NS_DestroyPluginInstance(plugin);
- return NPERR_MODULE_LOAD_FAILED_ERROR;
- }
- }
-
- // window goes away
- if (!pNPWindow->window && plugin->isInitialized())
- return plugin->SetWindow(pNPWindow);
-
- // window resized?
- if (plugin->isInitialized() && pNPWindow->window)
- return plugin->SetWindow(pNPWindow);
-
- // this should not happen, nothing to do
- if (!pNPWindow->window && !plugin->isInitialized())
- return plugin->SetWindow(pNPWindow);
-
- return NPERR_NO_ERROR;
+ if (!instance) {
+ return NPERR_INVALID_INSTANCE_ERROR;
+ }
+
+ if (!pNPWindow) {
+ return NPERR_GENERIC_ERROR;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+
+ if (!plugin) {
+ return NPERR_GENERIC_ERROR;
+ }
+
+ // window just created
+ if (!plugin->isInitialized() && pNPWindow->window) {
+ if (!plugin->init(pNPWindow)) {
+ NS_DestroyPluginInstance(plugin);
+ return NPERR_MODULE_LOAD_FAILED_ERROR;
+ }
+ }
+
+ // window goes away
+ if (!pNPWindow->window && plugin->isInitialized()) {
+ return plugin->SetWindow(pNPWindow);
+ }
+
+ // window resized?
+ if (plugin->isInitialized() && pNPWindow->window) {
+ return plugin->SetWindow(pNPWindow);
+ }
+
+ // this should not happen, nothing to do
+ if (!pNPWindow->window && !plugin->isInitialized()) {
+ return plugin->SetWindow(pNPWindow);
+ }
+
+ return NPERR_NO_ERROR;
}
NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool
seekable, uint16_t* stype)
{
- if (!instance)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return NPERR_GENERIC_ERROR;
-
- return plugin->NewStream(type, stream, seekable, stype);
+ if (!instance) {
+ return NPERR_INVALID_INSTANCE_ERROR;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return NPERR_GENERIC_ERROR;
+ }
+
+ return plugin->NewStream(type, stream, seekable, stype);
}
int32_t NPP_WriteReady (NPP instance, NPStream *stream)
{
- if (!instance)
- return 0x0fffffff;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return 0x0fffffff;
-
- return plugin->WriteReady(stream);
+ if (!instance) {
+ return 0x0fffffff;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return 0x0fffffff;
+ }
+
+ return plugin->WriteReady(stream);
}
int32_t NPP_Write (NPP instance, NPStream *stream, int32_t offset, int32_t
len, void *buffer)
{
- if (!instance)
- return len;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return len;
-
- return plugin->Write(stream, offset, len, buffer);
+ if (!instance) {
+ return len;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return len;
+ }
+
+ return plugin->Write(stream, offset, len, buffer);
}
NPError NPP_DestroyStream (NPP instance, NPStream *stream, NPError reason)
{
- if (!instance)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return NPERR_GENERIC_ERROR;
-
- return plugin->DestroyStream(stream, reason);
+ if (!instance) {
+ return NPERR_INVALID_INSTANCE_ERROR;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return NPERR_GENERIC_ERROR;
+ }
+
+ return plugin->DestroyStream(stream, reason);
}
void NPP_StreamAsFile (NPP instance, NPStream* stream, const char* fname)
{
- if (!instance)
- return;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return;
-
- plugin->StreamAsFile(stream, fname);
+ if (!instance) {
+ return;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return;
+ }
+
+ plugin->StreamAsFile(stream, fname);
}
void NPP_Print (NPP instance, NPPrint* printInfo)
{
- if (!instance)
- return;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return;
-
- plugin->Print(printInfo);
+ if (!instance) {
+ return;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return;
+ }
+
+ plugin->Print(printInfo);
}
void NPP_URLNotify(NPP instance, const char* url, NPReason reason, void*
notifyData)
{
- if (!instance)
- return;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return;
-
- plugin->URLNotify(url, reason, notifyData);
+ if (!instance) {
+ return;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return;
+ }
+
+ plugin->URLNotify(url, reason, notifyData);
}
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
{
- if (!instance)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return NPERR_GENERIC_ERROR;
-
- return plugin->GetValue(variable, value);
+ if (!instance) {
+ return NPERR_INVALID_INSTANCE_ERROR;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return NPERR_GENERIC_ERROR;
+ }
+
+ return plugin->GetValue(variable, value);
}
NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
{
- if (!instance)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return NPERR_GENERIC_ERROR;
-
- return plugin->SetValue(variable, value);
+ if (!instance) {
+ return NPERR_INVALID_INSTANCE_ERROR;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return NPERR_GENERIC_ERROR;
+ }
+
+ return plugin->SetValue(variable, value);
}
int16_t NPP_HandleEvent(NPP instance, void* event)
{
- if (!instance)
- return 0;
-
- nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
- if (!plugin)
- return 0;
-
- return plugin->HandleEvent(event);
+ if (!instance) {
+ return 0;
+ }
+
+ nsPluginInstanceBase * plugin = (nsPluginInstanceBase *)instance->pdata;
+ if (!plugin) {
+ return 0;
+ }
+
+ return plugin->HandleEvent(event);
}
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
=== modified file 'plugin/npapi/mozilla-sdk/npplat.h'
--- a/plugin/npapi/mozilla-sdk/npplat.h 2010-03-24 23:33:22 +0000
+++ b/plugin/npapi/mozilla-sdk/npplat.h 2010-06-02 16:32:55 +0000
@@ -44,3 +44,8 @@
#endif
#endif // npplat_h_
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
=== modified file 'plugin/npapi/mozilla-sdk/pluginbase.h'
--- a/plugin/npapi/mozilla-sdk/pluginbase.h 2010-03-24 23:33:22 +0000
+++ b/plugin/npapi/mozilla-sdk/pluginbase.h 2010-06-02 16:32:55 +0000
@@ -25,43 +25,48 @@
struct nsPluginCreateData
{
- NPP instance;
- NPMIMEType type;
- uint16_t mode;
- int16_t argc;
- char** argn;
- char** argv;
- NPSavedData* saved;
+ NPP instance;
+ NPMIMEType type;
+ uint16_t mode;
+ int16_t argc;
+ char** argn;
+ char** argv;
+ NPSavedData* saved;
};
class DSOLOCAL nsPluginInstanceBase
{
- public:
- virtual ~nsPluginInstanceBase() { return; }
-
- // these three methods must be implemented in the derived
- // class platform specific way
- virtual NPBool init(NPWindow* aWindow) = 0;
- virtual void shut() = 0;
- virtual NPBool isInitialized() = 0;
-
- // implement all or part of those methods in the derived
- // class as needed
- virtual NPError SetWindow(NPWindow* /*pNPWindow*/) {
return NPERR_NO_ERROR; }
- virtual NPError WriteStatus(char* /*msg*/) const {
return NPERR_NO_ERROR; }
- virtual NPError NewStream(NPMIMEType /*type*/, NPStream* /*stream*/,
- NPBool /*seekable*/, uint16_t* /*stype*/)
{ return NPERR_NO_ERROR; }
- virtual NPError DestroyStream(NPStream* /*stream*/, NPError /*reason*/) {
return NPERR_NO_ERROR; }
- virtual void StreamAsFile(NPStream* /*stream*/, const char* /*fname*/) {
return; }
- virtual int32_t WriteReady(NPStream* /*stream*/) {
return 0x0fffffff; }
- virtual int32_t Write(NPStream* /*stream*/, int32_t /*offset*/,
- int32_t len, void* /*buffer*/) {
return len; }
- virtual void Print(NPPrint* /*printInfo*/) {
return; }
- virtual uint16_t HandleEvent(void* /*event*/) {
return 0; }
- virtual void URLNotify(const char* /*url*/, NPReason /*reason*/,
- void* /*notifyData*/) {
return; }
- virtual NPError GetValue(NPPVariable /*variable*/, void* /*value*/) {
return NPERR_NO_ERROR; }
- virtual NPError SetValue(NPNVariable /*variable*/, void* /*value*/) {
return NPERR_NO_ERROR; }
+ public:
+ virtual ~nsPluginInstanceBase() { return; }
+
+ // these three methods must be implemented in the derived
+ // class platform specific way
+ virtual NPBool init(NPWindow* aWindow) = 0;
+ virtual void shut() = 0;
+ virtual NPBool isInitialized() = 0;
+
+ // implement all or part of those methods in the derived
+ // class as needed
+ virtual NPError SetWindow(NPWindow* /*pNPWindow*/) { return
NPERR_NO_ERROR; }
+ virtual NPError WriteStatus(char* /*msg*/) const { return NPERR_NO_ERROR; }
+ virtual NPError NewStream(NPMIMEType /*type*/, NPStream* /*stream*/,
+ NPBool /*seekable*/, uint16_t* /*stype*/)
+ { return NPERR_NO_ERROR; }
+ virtual NPError DestroyStream(NPStream* /*stream*/, NPError /*reason*/)
+ { return NPERR_NO_ERROR; }
+ virtual void StreamAsFile(NPStream* /*stream*/, const char* /*fname*/)
+ { return; }
+ virtual int32_t WriteReady(NPStream* /*stream*/) { return 0x0fffffff; }
+ virtual int32_t Write(NPStream* /*stream*/, int32_t /*offset*/,
+ int32_t len, void* /*buffer*/) { return len; }
+ virtual void Print(NPPrint* /*printInfo*/) { return; }
+ virtual uint16_t HandleEvent(void* /*event*/) { return 0; }
+ virtual void URLNotify(const char* /*url*/, NPReason /*reason*/,
+ void* /*notifyData*/) { return; }
+ virtual NPError GetValue(NPPVariable /*variable*/, void* /*value*/)
+ { return NPERR_NO_ERROR; }
+ virtual NPError SetValue(NPNVariable /*variable*/, void* /*value*/)
+ { return NPERR_NO_ERROR; }
};
// functions that should be implemented for each specific plugin
@@ -75,3 +80,8 @@
void NS_PluginShutdown();
#endif // __PLUGININSTANCEBASE_H__
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
- [Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and indenting changes to conform to the rest of the code style used in Gnash.,
Rob Savoye <=
- Re: [Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and indenting changes to conform to the rest of the code style used in Gnash., Benjamin Wolsey, 2010/06/02
- Re: [Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and indenting changes to conform to the rest of the code style used in Gnash., Rob Savoye, 2010/06/02
- Re: [Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and indenting changes to conform to the rest of the code style used in Gnash., Benjamin Wolsey, 2010/06/02
- Re: [Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and indenting changes to conform to the rest of the code style used in Gnash., Rob Savoye, 2010/06/02
- Re: [Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and indenting changes to conform to the rest of the code style used in Gnash., Bastiaan Jacques, 2010/06/03
- Re: [Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and indenting changes to conform to the rest of the code style used in Gnash., Rob Savoye, 2010/06/04
- Re: [Gnash-commit] /srv/bzr/gnash/trunk r12208: 100% only reformatting and indenting changes to conform to the rest of the code style used in Gnash., Bastiaan Jacques, 2010/06/04