npapi.h File Reference

#include "prtypes.h"

Go to the source code of this file.

Data Structures

struct  _NPP
struct  _NPStream
struct  _NPByteRange
struct  _NPSavedData
struct  _NPRect
struct  _NPSize
struct  _NPWindow
struct  _NPFullPrint
struct  _NPEmbedPrint
struct  _NPPrint

Defines

#define MOZ_X11   1
#define NP_VERSION_MAJOR   0
#define NP_VERSION_MINOR   19
#define NP_INFO_ProductVersion   1
#define NP_INFO_MIMEType   2
#define NP_INFO_FileOpenName   3
#define NP_INFO_FileExtents   4
#define NP_INFO_FileDescription   5
#define NP_INFO_ProductName   6
#define NP_INFO_CompanyName   7
#define NP_INFO_FileVersion   8
#define NP_INFO_InternalName   9
#define NP_INFO_LegalCopyright   10
#define NP_INFO_OriginalFilename   11
#define FALSE   (0)
#define TRUE   (1)
#define NULL   (0L)
#define NP_ABI_GCC3_MASK   0x10000000
#define _NP_ABI_MIXIN_FOR_GCC3   0
#define NP_ABI_MACHO_MASK   0x01000000
#define _NP_ABI_MIXIN_FOR_MACHO   0
#define NP_ABI_MASK   (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
#define NP_EMBED   1
#define NP_FULL   2
#define NP_NORMAL   1
#define NP_SEEK   2
#define NP_ASFILE   3
#define NP_ASFILEONLY   4
#define NP_MAXREADY   (((unsigned)(~0)<<1)>>1)
#define NPERR_BASE   0
#define NPERR_NO_ERROR   (NPERR_BASE + 0)
#define NPERR_GENERIC_ERROR   (NPERR_BASE + 1)
#define NPERR_INVALID_INSTANCE_ERROR   (NPERR_BASE + 2)
#define NPERR_INVALID_FUNCTABLE_ERROR   (NPERR_BASE + 3)
#define NPERR_MODULE_LOAD_FAILED_ERROR   (NPERR_BASE + 4)
#define NPERR_OUT_OF_MEMORY_ERROR   (NPERR_BASE + 5)
#define NPERR_INVALID_PLUGIN_ERROR   (NPERR_BASE + 6)
#define NPERR_INVALID_PLUGIN_DIR_ERROR   (NPERR_BASE + 7)
#define NPERR_INCOMPATIBLE_VERSION_ERROR   (NPERR_BASE + 8)
#define NPERR_INVALID_PARAM   (NPERR_BASE + 9)
#define NPERR_INVALID_URL   (NPERR_BASE + 10)
#define NPERR_FILE_NOT_FOUND   (NPERR_BASE + 11)
#define NPERR_NO_DATA   (NPERR_BASE + 12)
#define NPERR_STREAM_NOT_SEEKABLE   (NPERR_BASE + 13)
#define NPRES_BASE   0
#define NPRES_DONE   (NPRES_BASE + 0)
#define NPRES_NETWORK_ERR   (NPRES_BASE + 1)
#define NPRES_USER_BREAK   (NPRES_BASE + 2)
#define NP_NOERR   NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
#define NP_EINVAL   NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
#define NP_EABORT   NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
#define NPVERS_HAS_STREAMOUTPUT   8
#define NPVERS_HAS_NOTIFICATION   9
#define NPVERS_HAS_LIVECONNECT   9
#define NPVERS_WIN16_HAS_LIVECONNECT   9
#define NPVERS_68K_HAS_LIVECONNECT   11
#define NPVERS_HAS_WINDOWLESS   11
#define NPVERS_HAS_XPCONNECT_SCRIPTING   13
#define NPVERS_HAS_NPRUNTIME_SCRIPTING   14
#define NPVERS_HAS_FORM_VALUES   15
#define NPVERS_HAS_POPUPS_ENABLED_STATE   16
#define NPVERS_HAS_RESPONSE_HEADERS   17
#define NPVERS_HAS_NPOBJECT_ENUM   18
#define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL   19
#define NP_LOADDS

Typedefs

typedef unsigned short uint16
typedef unsigned long uint32
typedef short int16
typedef long int32
typedef unsigned char NPBool
typedef int16 NPError
typedef int16 NPReason
typedef char * NPMIMEType
typedef struct _NPP NPP_t
typedef NPP_tNPP
typedef struct _NPStream NPStream
typedef struct _NPByteRange NPByteRange
typedef struct _NPSavedData NPSavedData
typedef struct _NPRect NPRect
typedef struct _NPSize NPSize
typedef struct _NPWindow NPWindow
typedef struct _NPFullPrint NPFullPrint
typedef struct _NPEmbedPrint NPEmbedPrint
typedef struct _NPPrint NPPrint
typedef void * NPEvent
typedef void * NPRegion

Enumerations

enum  NPPVariable {
  NPPVpluginNameString = 1, NPPVpluginDescriptionString, NPPVpluginWindowBool, NPPVpluginTransparentBool,
  NPPVjavaClass, NPPVpluginWindowSize, NPPVpluginTimerInterval, NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
  NPPVpluginScriptableIID = 11, NPPVjavascriptPushCallerBool = 12, NPPVpluginKeepLibraryInMemory = 13, NPPVpluginNeedsXEmbed = 14,
  NPPVpluginScriptableNPObject = 15, NPPVformValue = 16
}
enum  NPNVariable {
  NPNVxDisplay = 1, NPNVxtAppContext, NPNVnetscapeWindow, NPNVjavascriptEnabledBool,
  NPNVasdEnabledBool, NPNVisOfflineBool, NPNVserviceManager = (10 | NP_ABI_MASK), NPNVDOMElement = (11 | NP_ABI_MASK),
  NPNVDOMWindow = (12 | NP_ABI_MASK), NPNVToolkit = (13 | NP_ABI_MASK), NPNVSupportsXEmbedBool = 14, NPNVWindowNPObject = 15,
  NPNVPluginElementNPObject = 16, NPNVSupportsWindowless = 17
}
enum  NPNToolkitType { NPNVGtk12 = 1, NPNVGtk2 }
enum  NPWindowType { NPWindowTypeWindow = 1, NPWindowTypeDrawable }

Functions

NPError NP_LOADDS NPP_Initialize (void)
void NP_LOADDS NPP_Shutdown (void)
NPError NP_LOADDS NPP_New (NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved)
NPError NP_LOADDS NPP_Destroy (NPP instance, NPSavedData **save)
NPError NP_LOADDS NPP_SetWindow (NPP instance, NPWindow *window)
NPError NP_LOADDS NPP_NewStream (NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype)
NPError NP_LOADDS NPP_DestroyStream (NPP instance, NPStream *stream, NPReason reason)
int32 NP_LOADDS NPP_WriteReady (NPP instance, NPStream *stream)
int32 NP_LOADDS NPP_Write (NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer)
void NP_LOADDS NPP_StreamAsFile (NPP instance, NPStream *stream, const char *fname)
void NP_LOADDS NPP_Print (NPP instance, NPPrint *platformPrint)
int16 NP_LOADDS NPP_HandleEvent (NPP instance, void *event)
void NP_LOADDS NPP_URLNotify (NPP instance, const char *url, NPReason reason, void *notifyData)
NPError NP_LOADDS NPP_GetValue (NPP instance, NPPVariable variable, void *value)
NPError NP_LOADDS NPP_SetValue (NPP instance, NPNVariable variable, void *value)
void NP_LOADDS NPN_Version (int *plugin_major, int *plugin_minor, int *netscape_major, int *netscape_minor)
NPError NP_LOADDS NPN_GetURLNotify (NPP instance, const char *url, const char *target, void *notifyData)
NPError NP_LOADDS NPN_GetURL (NPP instance, const char *url, const char *target)
NPError NP_LOADDS NPN_PostURLNotify (NPP instance, const char *url, const char *target, uint32 len, const char *buf, NPBool file, void *notifyData)
NPError NP_LOADDS NPN_PostURL (NPP instance, const char *url, const char *target, uint32 len, const char *buf, NPBool file)
NPError NP_LOADDS NPN_RequestRead (NPStream *stream, NPByteRange *rangeList)
NPError NP_LOADDS NPN_NewStream (NPP instance, NPMIMEType type, const char *target, NPStream **stream)
int32 NP_LOADDS NPN_Write (NPP instance, NPStream *stream, int32 len, void *buffer)
NPError NP_LOADDS NPN_DestroyStream (NPP instance, NPStream *stream, NPReason reason)
void NP_LOADDS NPN_Status (NPP instance, const char *message)
const char *NP_LOADDS NPN_UserAgent (NPP instance)
void *NP_LOADDS NPN_MemAlloc (uint32 size)
void NP_LOADDS NPN_MemFree (void *ptr)
uint32 NP_LOADDS NPN_MemFlush (uint32 size)
void NP_LOADDS NPN_ReloadPlugins (NPBool reloadPages)
NPError NP_LOADDS NPN_GetValue (NPP instance, NPNVariable variable, void *value)
NPError NP_LOADDS NPN_SetValue (NPP instance, NPPVariable variable, void *value)
void NP_LOADDS NPN_InvalidateRect (NPP instance, NPRect *invalidRect)
void NP_LOADDS NPN_InvalidateRegion (NPP instance, NPRegion invalidRegion)
void NP_LOADDS NPN_ForceRedraw (NPP instance)
void NP_LOADDS NPN_PushPopupsEnabledState (NPP instance, NPBool enabled)
void NP_LOADDS NPN_PopPopupsEnabledState (NPP instance)
void NP_LOADDS NPN_PluginThreadAsyncCall (NPP instance, void(*func)(void *), void *userData)

Define Documentation

#define _NP_ABI_MIXIN_FOR_GCC3   0

Definition at line 362 of file npapi.h.

#define _NP_ABI_MIXIN_FOR_MACHO   0

Definition at line 377 of file npapi.h.

#define FALSE   (0)

Definition at line 210 of file npapi.h.

#define MOZ_X11   1

Definition at line 38 of file npapi.h.

#define NP_ABI_GCC3_MASK   0x10000000

Definition at line 354 of file npapi.h.

#define NP_ABI_MACHO_MASK   0x01000000

Definition at line 366 of file npapi.h.

#define NP_ABI_MASK   (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)

Definition at line 381 of file npapi.h.

#define NP_ASFILE   3

Definition at line 602 of file npapi.h.

#define NP_ASFILEONLY   4

Definition at line 603 of file npapi.h.

#define NP_EABORT   NP_EABORT_is_obsolete_use_NPRES_USER_BREAK

Definition at line 644 of file npapi.h.

#define NP_EINVAL   NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR

Definition at line 643 of file npapi.h.

#define NP_EMBED   1

Definition at line 594 of file npapi.h.

#define NP_FULL   2

Definition at line 595 of file npapi.h.

#define NP_INFO_CompanyName   7

Definition at line 166 of file npapi.h.

#define NP_INFO_FileDescription   5

Definition at line 162 of file npapi.h.

#define NP_INFO_FileExtents   4

Definition at line 159 of file npapi.h.

#define NP_INFO_FileOpenName   3

Definition at line 158 of file npapi.h.

#define NP_INFO_FileVersion   8

Definition at line 167 of file npapi.h.

#define NP_INFO_InternalName   9

Definition at line 168 of file npapi.h.

#define NP_INFO_LegalCopyright   10

Definition at line 169 of file npapi.h.

#define NP_INFO_MIMEType   2

Definition at line 157 of file npapi.h.

#define NP_INFO_OriginalFilename   11

Definition at line 170 of file npapi.h.

#define NP_INFO_ProductName   6

Definition at line 163 of file npapi.h.

#define NP_INFO_ProductVersion   1

Definition at line 156 of file npapi.h.

#define NP_LOADDS

Definition at line 673 of file npapi.h.

#define NP_MAXREADY   (((unsigned)(~0)<<1)>>1)

Definition at line 605 of file npapi.h.

#define NP_NOERR   NP_NOERR_is_obsolete_use_NPERR_NO_ERROR

Definition at line 642 of file npapi.h.

#define NP_NORMAL   1

Definition at line 600 of file npapi.h.

#define NP_SEEK   2

Definition at line 601 of file npapi.h.

#define NP_VERSION_MAJOR   0

Definition at line 123 of file npapi.h.

#define NP_VERSION_MINOR   19

Definition at line 124 of file npapi.h.

#define NPERR_BASE   0

Definition at line 615 of file npapi.h.

#define NPERR_FILE_NOT_FOUND   (NPERR_BASE + 11)

Definition at line 627 of file npapi.h.

#define NPERR_GENERIC_ERROR   (NPERR_BASE + 1)

Definition at line 617 of file npapi.h.

#define NPERR_INCOMPATIBLE_VERSION_ERROR   (NPERR_BASE + 8)

Definition at line 624 of file npapi.h.

#define NPERR_INVALID_FUNCTABLE_ERROR   (NPERR_BASE + 3)

Definition at line 619 of file npapi.h.

#define NPERR_INVALID_INSTANCE_ERROR   (NPERR_BASE + 2)

Definition at line 618 of file npapi.h.

#define NPERR_INVALID_PARAM   (NPERR_BASE + 9)

Definition at line 625 of file npapi.h.

#define NPERR_INVALID_PLUGIN_DIR_ERROR   (NPERR_BASE + 7)

Definition at line 623 of file npapi.h.

#define NPERR_INVALID_PLUGIN_ERROR   (NPERR_BASE + 6)

Definition at line 622 of file npapi.h.

#define NPERR_INVALID_URL   (NPERR_BASE + 10)

Definition at line 626 of file npapi.h.

#define NPERR_MODULE_LOAD_FAILED_ERROR   (NPERR_BASE + 4)

Definition at line 620 of file npapi.h.

#define NPERR_NO_DATA   (NPERR_BASE + 12)

Definition at line 628 of file npapi.h.

#define NPERR_NO_ERROR   (NPERR_BASE + 0)

Definition at line 616 of file npapi.h.

#define NPERR_OUT_OF_MEMORY_ERROR   (NPERR_BASE + 5)

Definition at line 621 of file npapi.h.

#define NPERR_STREAM_NOT_SEEKABLE   (NPERR_BASE + 13)

Definition at line 629 of file npapi.h.

#define NPRES_BASE   0

Definition at line 634 of file npapi.h.

#define NPRES_DONE   (NPRES_BASE + 0)

Definition at line 635 of file npapi.h.

#define NPRES_NETWORK_ERR   (NPRES_BASE + 1)

Definition at line 636 of file npapi.h.

#define NPRES_USER_BREAK   (NPRES_BASE + 2)

Definition at line 637 of file npapi.h.

#define NPVERS_68K_HAS_LIVECONNECT   11

Definition at line 653 of file npapi.h.

#define NPVERS_HAS_FORM_VALUES   15

Definition at line 657 of file npapi.h.

#define NPVERS_HAS_LIVECONNECT   9

Definition at line 651 of file npapi.h.

#define NPVERS_HAS_NOTIFICATION   9

Definition at line 650 of file npapi.h.

#define NPVERS_HAS_NPOBJECT_ENUM   18

Definition at line 660 of file npapi.h.

#define NPVERS_HAS_NPRUNTIME_SCRIPTING   14

Definition at line 656 of file npapi.h.

#define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL   19

Definition at line 661 of file npapi.h.

#define NPVERS_HAS_POPUPS_ENABLED_STATE   16

Definition at line 658 of file npapi.h.

#define NPVERS_HAS_RESPONSE_HEADERS   17

Definition at line 659 of file npapi.h.

#define NPVERS_HAS_STREAMOUTPUT   8

Definition at line 649 of file npapi.h.

#define NPVERS_HAS_WINDOWLESS   11

Definition at line 654 of file npapi.h.

#define NPVERS_HAS_XPCONNECT_SCRIPTING   13

Definition at line 655 of file npapi.h.

#define NPVERS_WIN16_HAS_LIVECONNECT   9

Definition at line 652 of file npapi.h.

#define NULL   (0L)

Definition at line 216 of file npapi.h.

#define TRUE   (1)

Definition at line 213 of file npapi.h.


Typedef Documentation

typedef short int16

Definition at line 197 of file npapi.h.

typedef long int32

Definition at line 204 of file npapi.h.

typedef unsigned char NPBool

Definition at line 228 of file npapi.h.

typedef struct _NPByteRange NPByteRange
typedef struct _NPEmbedPrint NPEmbedPrint
typedef int16 NPError

Definition at line 229 of file npapi.h.

typedef void* NPEvent

Definition at line 535 of file npapi.h.

typedef struct _NPFullPrint NPFullPrint
typedef char* NPMIMEType

Definition at line 231 of file npapi.h.

typedef NPP_t* NPP

Definition at line 248 of file npapi.h.

typedef struct _NPP NPP_t
typedef struct _NPPrint NPPrint
typedef int16 NPReason

Definition at line 230 of file npapi.h.

typedef struct _NPRect NPRect
typedef void* NPRegion

Definition at line 549 of file npapi.h.

typedef struct _NPSavedData NPSavedData
typedef struct _NPSize NPSize
typedef struct _NPStream NPStream
typedef struct _NPWindow NPWindow
typedef unsigned short uint16

Definition at line 181 of file npapi.h.

typedef unsigned long uint32

Definition at line 188 of file npapi.h.


Enumeration Type Documentation

Enumerator:
NPNVGtk12 
NPNVGtk2 

Definition at line 461 of file npapi.h.

00461              {
00462   NPNVGtk12 = 1,
00463   NPNVGtk2
00464 } NPNToolkitType;

Enumerator:
NPNVxDisplay 
NPNVxtAppContext 
NPNVnetscapeWindow 
NPNVjavascriptEnabledBool 
NPNVasdEnabledBool 
NPNVisOfflineBool 
NPNVserviceManager 
NPNVDOMElement 
NPNVDOMWindow 
NPNVToolkit 
NPNVSupportsXEmbedBool 
NPNVWindowNPObject 
NPNVPluginElementNPObject 
NPNVSupportsWindowless 

Definition at line 425 of file npapi.h.

00425              {
00426   NPNVxDisplay = 1,
00427   NPNVxtAppContext,
00428   NPNVnetscapeWindow,
00429   NPNVjavascriptEnabledBool,
00430   NPNVasdEnabledBool,
00431   NPNVisOfflineBool,
00432 
00433   /* 10 and over are available on Mozilla builds starting with 0.9.4 */
00434   NPNVserviceManager = (10 | NP_ABI_MASK),
00435   NPNVDOMElement     = (11 | NP_ABI_MASK),   /* available in Mozilla 1.2 */
00436   NPNVDOMWindow      = (12 | NP_ABI_MASK),
00437   NPNVToolkit        = (13 | NP_ABI_MASK),
00438   NPNVSupportsXEmbedBool = 14,
00439 
00440   /* Get the NPObject wrapper for the browser window. */
00441   NPNVWindowNPObject = 15,
00442 
00443   /* Get the NPObject wrapper for the plugins DOM element. */
00444   NPNVPluginElementNPObject = 16,
00445 
00446   NPNVSupportsWindowless = 17
00447 
00448 #ifdef XP_MACOSX
00449   /* Used for negotiating drawing models */
00450   , NPNVpluginDrawingModel = 1000
00451 #ifndef NP_NO_QUICKDRAW
00452   , NPNVsupportsQuickDrawBool = 2000
00453 #endif
00454   , NPNVsupportsCoreGraphicsBool = 2001
00455 #endif
00456 } NPNVariable;

Enumerator:
NPPVpluginNameString 
NPPVpluginDescriptionString 
NPPVpluginWindowBool 
NPPVpluginTransparentBool 
NPPVjavaClass 
NPPVpluginWindowSize 
NPPVpluginTimerInterval 
NPPVpluginScriptableInstance 
NPPVpluginScriptableIID 
NPPVjavascriptPushCallerBool 
NPPVpluginKeepLibraryInMemory 
NPPVpluginNeedsXEmbed 
NPPVpluginScriptableNPObject 
NPPVformValue 

Definition at line 386 of file npapi.h.

00386              {
00387   NPPVpluginNameString = 1,
00388   NPPVpluginDescriptionString,
00389   NPPVpluginWindowBool,
00390   NPPVpluginTransparentBool,
00391   NPPVjavaClass,                /* Not implemented in Mozilla 1.0 */
00392   NPPVpluginWindowSize,
00393   NPPVpluginTimerInterval,
00394 
00395   NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
00396   NPPVpluginScriptableIID = 11,
00397 
00398   /* Introduced in Mozilla 0.9.9 */
00399   NPPVjavascriptPushCallerBool = 12,
00400 
00401   /* Introduced in Mozilla 1.0 */
00402   NPPVpluginKeepLibraryInMemory = 13,
00403   NPPVpluginNeedsXEmbed         = 14,
00404 
00405   /* Get the NPObject for scripting the plugin. Introduced in Firefox
00406    * 1.0 (NPAPI minor version 14).
00407    */
00408   NPPVpluginScriptableNPObject  = 15,
00409 
00410   /* Get the plugin value (as \0-terminated UTF-8 string data) for
00411    * form submission if the plugin is part of a form. Use
00412    * NPN_MemAlloc() to allocate memory for the string data. Introduced
00413    * in Mozilla 1.8b2 (NPAPI minor version 15).
00414    */
00415   NPPVformValue = 16
00416 #ifdef XP_MACOSX
00417   /* Used for negotiating drawing models */
00418   , NPPVpluginDrawingModel = 1000
00419 #endif
00420 } NPPVariable;

Enumerator:
NPWindowTypeWindow 
NPWindowTypeDrawable 

Definition at line 470 of file npapi.h.

00470              {
00471   NPWindowTypeWindow = 1,
00472   NPWindowTypeDrawable
00473 } NPWindowType;


Function Documentation

NPError NP_LOADDS NPN_DestroyStream ( NPP  instance,
NPStream stream,
NPReason  reason 
)

Definition at line 170 of file npunix.c.

00171 {
00172     return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream,
00173                         instance, stream, reason);
00174 }

void NP_LOADDS NPN_ForceRedraw ( NPP  instance  ) 

Definition at line 237 of file npunix.c.

00238 {
00239     CallNPN_ForceRedrawProc(gNetscapeFuncs.forceredraw, instance);
00240 }

NPError NP_LOADDS NPN_GetURL ( NPP  instance,
const char *  url,
const char *  target 
)

Definition at line 120 of file npunix.c.

00121 {
00122     return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window);
00123 }

NPError NP_LOADDS NPN_GetURLNotify ( NPP  instance,
const char *  url,
const char *  target,
void *  notifyData 
)

Definition at line 126 of file npunix.c.

00127 {
00128     return CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData);
00129 }

NPError NP_LOADDS NPN_GetValue ( NPP  instance,
NPNVariable  variable,
void *  value 
)

Definition at line 106 of file npunix.c.

00107 {
00108     return CallNPN_GetValueProc(gNetscapeFuncs.getvalue,
00109                     instance, variable, r_value);
00110 }

void NP_LOADDS NPN_InvalidateRect ( NPP  instance,
NPRect invalidRect 
)

Definition at line 223 of file npunix.c.

00224 {
00225     CallNPN_InvalidateRectProc(gNetscapeFuncs.invalidaterect, instance,
00226         invalidRect);
00227 }

void NP_LOADDS NPN_InvalidateRegion ( NPP  instance,
NPRegion  invalidRegion 
)

Definition at line 230 of file npunix.c.

00231 {
00232     CallNPN_InvalidateRegionProc(gNetscapeFuncs.invalidateregion, instance,
00233         invalidRegion);
00234 }

void* NP_LOADDS NPN_MemAlloc ( uint32  size  ) 

Definition at line 189 of file npunix.c.

00190 {
00191     return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
00192 }

uint32 NP_LOADDS NPN_MemFlush ( uint32  size  ) 

Definition at line 199 of file npunix.c.

00200 {
00201     return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
00202 }

void NP_LOADDS NPN_MemFree ( void *  ptr  ) 

Definition at line 194 of file npunix.c.

00195 {
00196     CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
00197 }

NPError NP_LOADDS NPN_NewStream ( NPP  instance,
NPMIMEType  type,
const char *  target,
NPStream **  stream 
)

Definition at line 155 of file npunix.c.

00157 {
00158     return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance,
00159                     type, window, stream_ptr);
00160 }

void NP_LOADDS NPN_PluginThreadAsyncCall ( NPP  instance,
void(*)(void *)  func,
void *  userData 
)

Definition at line 700 of file npunix.c.

00702 {
00703    CallNPN_PluginThreadAsyncCallProc (
00704        gNetscapeFuncs.pluginthreadasynccall,
00705        instance,
00706        func,
00707        userData);
00708 } 

void NP_LOADDS NPN_PopPopupsEnabledState ( NPP  instance  ) 

Definition at line 248 of file npunix.c.

NPError NP_LOADDS NPN_PostURL ( NPP  instance,
const char *  url,
const char *  target,
uint32  len,
const char *  buf,
NPBool  file 
)

Definition at line 132 of file npunix.c.

00134 {
00135     return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance,
00136                     url, window, len, buf, file);
00137 }

NPError NP_LOADDS NPN_PostURLNotify ( NPP  instance,
const char *  url,
const char *  target,
uint32  len,
const char *  buf,
NPBool  file,
void *  notifyData 
)

Definition at line 140 of file npunix.c.

00142 {
00143     return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify,
00144             instance, url, window, len, buf, file, notifyData);
00145 }

void NP_LOADDS NPN_PushPopupsEnabledState ( NPP  instance,
NPBool  enabled 
)

Definition at line 242 of file npunix.c.

00243 {
00244     CallNPN_PushPopupsEnabledStateProc(gNetscapeFuncs.pushpopupsenabledstate,
00245         instance, enabled);
00246 }

void NP_LOADDS NPN_ReloadPlugins ( NPBool  reloadPages  ) 

Definition at line 204 of file npunix.c.

00205 {
00206     CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
00207 }

NPError NP_LOADDS NPN_RequestRead ( NPStream stream,
NPByteRange rangeList 
)

Definition at line 148 of file npunix.c.

00149 {
00150     return CallNPN_RequestReadProc(gNetscapeFuncs.requestread,
00151                     stream, rangeList);
00152 }

NPError NP_LOADDS NPN_SetValue ( NPP  instance,
NPPVariable  variable,
void *  value 
)

Definition at line 113 of file npunix.c.

00114 {
00115     return CallNPN_SetValueProc(gNetscapeFuncs.setvalue,
00116                     instance, variable, value);
00117 }

void NP_LOADDS NPN_Status ( NPP  instance,
const char *  message 
)

Definition at line 177 of file npunix.c.

00178 {
00179     CallNPN_StatusProc(gNetscapeFuncs.status, instance, message);
00180 }

const char* NP_LOADDS NPN_UserAgent ( NPP  instance  ) 

Definition at line 183 of file npunix.c.

00184 {
00185     return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
00186 }

void NP_LOADDS NPN_Version ( int *  plugin_major,
int *  plugin_minor,
int *  netscape_major,
int *  netscape_minor 
)

Definition at line 93 of file npunix.c.

00095 {
00096     *plugin_major = NP_VERSION_MAJOR;
00097     *plugin_minor = NP_VERSION_MINOR;
00098 
00099     /* Major version is in high byte */
00100     *netscape_major = gNetscapeFuncs.version >> 8;
00101     /* Minor version is in low byte */
00102     *netscape_minor = gNetscapeFuncs.version & 0xFF;
00103 }

int32 NP_LOADDS NPN_Write ( NPP  instance,
NPStream stream,
int32  len,
void *  buffer 
)

Definition at line 163 of file npunix.c.

00164 {
00165     return CallNPN_WriteProc(gNetscapeFuncs.write, instance,
00166                     stream, len, buffer);
00167 }

NPError NP_LOADDS NPP_Destroy ( NPP  instance,
NPSavedData **  save 
)

Definition at line 545 of file RioBrowserPlugin.c.

00546 {
00547     NPError         result;
00548     PluginInstance *This;
00549 
00550     #ifdef RIO_DEBUG1
00551     fprintf( stderr, "[RioBrowserPlugin - NPP_Destroy] Start\n" );
00552     #endif
00553 
00554     result = NPERR_INVALID_INSTANCE_ERROR;
00555     if( instance != NULL )
00556     {
00557         This = ( PluginInstance* ) instance->pdata;
00558         if( This != NULL )
00559         {
00560             if( This->pid )
00561                 kill( This->pid, 15 );
00562             NPN_MemFree( instance->pdata );
00563             instance->pdata = NULL;
00564         }
00565         result = NPERR_NO_ERROR;
00566     }
00567 
00568     #ifdef RIO_DEBUG1
00569     fprintf( stderr, "[RioBrowserPlugin - NPP_Destroy] Finish\n" );
00570     #endif
00571 
00572     return result;
00573 }

NPError NP_LOADDS NPP_DestroyStream ( NPP  instance,
NPStream stream,
NPReason  reason 
)

Definition at line 725 of file RioBrowserPlugin.c.

00726 {
00727     PluginInstance *This;
00728 
00729     #ifdef RIO_DEBUG1
00730     fprintf( stderr, "[RioBrowserPlugin - NPP_DestroyStream] Start\n" );
00731     #endif
00732 
00733     if( instance == NULL )
00734     {
00735         
00736         #ifdef RIO_DEBUG1
00737         fprintf( stderr, "[RioBrowserPlugin - NPP_DestroyStream] Finish1\n" );
00738         #endif
00739 
00740         return NPERR_INVALID_INSTANCE_ERROR;
00741     }
00742     This = ( PluginInstance * )instance->pdata;
00743 
00744     #ifdef RIO_DEBUG1
00745     fprintf( stderr, "[RioBrowserPlugin - NPP_DestroyStream] Finish2\n" );
00746     #endif
00747 
00748     return NPERR_NO_ERROR;
00749 }

NPError NP_LOADDS NPP_GetValue ( NPP  instance,
NPPVariable  variable,
void *  value 
)

Definition at line 328 of file RioBrowserPlugin.c.

00329 {
00330     NPError err = NPERR_NO_ERROR;
00331 
00332     #ifdef RIO_DEBUG1
00333     fprintf( stderr, "[RioBrowserPlugin - NPP_GetValue] Start\n" );
00334     #endif
00335 
00336     #ifdef RIO_DEBUG2
00337     fprintf( stderr, "NPP_GetValue : inicio da funcao. instance = %p ",
00338              instance );
00339     fprintf( stderr, "variable = %d\n", variable );
00340     #endif        
00341 
00342     if( variable == NPPVpluginNameString )
00343         *( ( char ** ) value ) = PLUGIN_NAME;
00344     else if( variable == NPPVpluginDescriptionString )
00345         *( ( char ** ) value ) = PLUGIN_DESCRIPTION;
00346     else
00347         err = NPERR_GENERIC_ERROR;
00348 
00349     #ifdef RIO_DEBUG2
00350     fprintf( stderr, "NPP_GetValue : fim da funcao. err = %d\n", err );
00351     #endif        
00352 
00353     #ifdef RIO_DEBUG1
00354     fprintf( stderr, "[RioBrowserPlugin - NPP_GetValue] Finish\n" );
00355     #endif
00356 
00357     return err;
00358 }

int16 NP_LOADDS NPP_HandleEvent ( NPP  instance,
void *  event 
)
NPError NP_LOADDS NPP_Initialize ( void   ) 

Definition at line 368 of file RioBrowserPlugin.c.

00369 {
00370     int plugin_major, plugin_minor, netscape_major, netscape_minor;
00371     int error;
00372 
00373     #ifdef RIO_DEBUG1
00374     fprintf( stderr, "[RioBrowserPlugin - NPP_Initialize] Start\n" );
00375     #endif
00376 
00377     // Obtem as versoes do plugin e do browser.
00378 
00379     NPN_Version( &plugin_major, &plugin_minor, &netscape_major, 
00380                  &netscape_minor );
00381 
00382     #ifdef RIO_DEBUG2
00383     fprintf( stderr, "NPP_Initialize: NPP_New plugin_major = %d\n", 
00384              plugin_major );
00385     fprintf( stderr, "NPP_Initialize: NPP_New plugin_minor = %d\n", 
00386              plugin_minor );
00387     fprintf( stderr, "NPP_Initialize: NPP_New netscape_major = %d\n", 
00388              netscape_major );
00389     fprintf( stderr, "NPP_Initialize: NPP_New netscape_minor = %d\n", 
00390              netscape_minor );
00391     #endif         
00392 
00393     // Cria o semaforo, se a versao for a adequada do plugin e do browser.
00394     
00395     if( netscape_minor < NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL )
00396     {
00397         #ifdef RIO_DEBUG2
00398         fprintf( stderr, "NPP_Initialize: NPN_PluginThreadAsyncCall nao " );
00399         fprintf( stderr, "disponivel. Usando a implementacao original do " );
00400         fprintf( stderr, "plugin!\n");
00401         #endif         
00402         UseChangeSlide = 0;
00403     }
00404     else
00405     {
00406         #ifdef RIO_DEBUG2
00407         fprintf( stderr, "NPP_Initialize: NPN_PluginThreadAsyncCall " );
00408         fprintf( stderr, "disponivel. Usando a nova implementacao!\n" );
00409         #endif         
00410         // Cria o semaforo ChangeSlideSemaphore. O semaforo e inicializado com
00411         // 0 porque a thread startListenerThread deve ser bloqueada ao executar
00412         // sem_wait, pois precisa esperar que a transparencia seja mudada.
00413         if( sem_init( &ChangeSlideSemaphore, 0, 0 ) < 0 )
00414         {
00415             error = errno;
00416             fprintf( stderr, "[cederj]: sem_init failed with error %d (%s) ", 
00417                      error, strerror( error ) );
00418             fprintf( stderr, ". Using previous implementation!\n" );
00419             UseChangeSlide = 0;
00420         }
00421         else
00422         {
00423             #ifdef RIO_DEBUG2
00424             fprintf( stderr, "NPP_Initialize: Semaforo criado com sucesso!\n" );
00425             #endif         
00426             UseChangeSlide = 1;         
00427         }
00428     }
00429 
00430     #ifdef RIO_DEBUG1
00431     fprintf( stderr, "[RioBrowserPlugin - NPP_Initialize] Finish\n" );
00432     #endif
00433 
00434     return NPERR_NO_ERROR;
00435 }

NPError NP_LOADDS NPP_New ( NPMIMEType  pluginType,
NPP  instance,
uint16  mode,
int16  argc,
char *  argn[],
char *  argv[],
NPSavedData saved 
)

Definition at line 486 of file RioBrowserPlugin.c.

00488 {
00489     int             i, mask;
00490     NPError         result;
00491     PluginInstance *This;
00492 
00493     #ifdef RIO_DEBUG1
00494     fprintf( stderr, "[RioBrowserPlugin - NPP_New] Start\n" );
00495     #endif
00496 
00497     result = NPERR_INVALID_INSTANCE_ERROR;
00498     if( instance != NULL )
00499     {
00500         instance->pdata = NPN_MemAlloc( sizeof( PluginInstance ) );
00501         This = ( PluginInstance * ) instance->pdata;
00502         if( This != NULL )
00503         {
00504             This->window = 0;
00505             This->fMode = mode;
00506             This->mask = 0;
00507             This->pid = 0;
00508             for( i = 0; i < argc; i++ )
00509             {
00510                 if( strcasecmp( argn[ i ], "server" ) == 0 )
00511                     strcpy( server, argv[ i ] );
00512                 if( strcasecmp( argn[ i ], "file" ) == 0 )
00513                     strcpy( media, argv[ i ] );
00514                 if( strcasecmp( argn[ i ], "mask" ) == 0 )
00515                 {
00516                     mask = atoi( argv[ i ] );
00517                     This->mask = ( mask & PLUGINS_MASK );
00518                     if( MaskComplete == 0 )
00519                         MaskComplete = ( mask >> MAX_PLUGINS );
00520 
00521                     /* Sanity Check */
00522                     if( ( mask >> MAX_PLUGINS ) == MaskComplete )
00523                     {
00524                         CurMask = CurMask | ( mask & PLUGINS_MASK );
00525                         /* All plugins are loaded */
00526                     }
00527                 }
00528             }
00529             result = NPERR_NO_ERROR;
00530         }
00531         else
00532         {
00533             result = NPERR_OUT_OF_MEMORY_ERROR;
00534         }
00535     }
00536 
00537     #ifdef RIO_DEBUG1
00538     fprintf( stderr, "[RioBrowserPlugin - NPP_New] Finish\n" );
00539     #endif
00540 
00541     return result;
00542 }

NPError NP_LOADDS NPP_NewStream ( NPP  instance,
NPMIMEType  type,
NPStream stream,
NPBool  seekable,
uint16 stype 
)

Definition at line 649 of file RioBrowserPlugin.c.

00651 {
00652     PluginInstance* This;
00653 
00654     #ifdef RIO_DEBUG1
00655     fprintf( stderr, "[RioBrowserPlugin - NPP_NewStream] Start\n" );
00656     #endif
00657 
00658     if (instance == NULL)
00659         return NPERR_INVALID_INSTANCE_ERROR;
00660 
00661     This = ( PluginInstance* ) instance->pdata;
00662 
00663     #ifdef RIO_DEBUG1
00664     fprintf( stderr, "[RioBrowserPlugin - NPP_NewStream] Finish\n" );
00665     #endif
00666 
00667     return NPERR_NO_ERROR;
00668 }

void NP_LOADDS NPP_Print ( NPP  instance,
NPPrint platformPrint 
)

Definition at line 769 of file RioBrowserPlugin.c.

00770 {
00771     #ifdef RIO_DEBUG1
00772     fprintf( stderr, "[RioBrowserPlugin - NPP_Print] Start-Finish\n" );
00773     #endif
00774 }

NPError NP_LOADDS NPP_SetValue ( NPP  instance,
NPNVariable  variable,
void *  value 
)
NPError NP_LOADDS NPP_SetWindow ( NPP  instance,
NPWindow window 
)

Definition at line 575 of file RioBrowserPlugin.c.

00576 {
00577     int             port = 0;
00578     NPError         result;
00579     PluginInstance *This;
00580 
00581     #ifdef RIO_DEBUG1
00582     fprintf( stderr, "[RioBrowserPlugin - NPP_SetWindow] Start\n" );
00583     #endif
00584 
00585     result = NPERR_INVALID_INSTANCE_ERROR;
00586     if( instance != NULL )
00587     {
00588         This = ( PluginInstance * )instance->pdata;
00589 
00590         /*
00591          * PLUGIN DEVELOPERS:
00592          *  Before setting window to point to the
00593          *  new window, you may wish to compare the new window
00594          *  info to the previous window (if any) to note window
00595          *  size changes, etc.
00596          */
00597         This->window  = ( Window ) window->window;
00598         This->x       = window->x;
00599         This->y       = window->y;
00600         This->width   = window->width;
00601         This->height  = window->height;
00602         This->fWindow = window;
00603         This->display = ( ( NPSetWindowCallbackStruct * ) window->ws_info )
00604                                                                       ->display;
00605 
00606         switch( This->mask )
00607         {
00608             case MASK_MPLAYER:   
00609                 mID = This->window; 
00610                 break;
00611             case MASK_RIOCLIENT: 
00612                 rID = This->window; 
00613                 break;
00614             case MASK_TGIF:      
00615                 tID = This->window; 
00616                 break;
00617             case MASK_INDEX:     
00618                 iID = This->window; 
00619                 break;
00620         }
00621 
00622         if( isComplete() )
00623         {
00624             if( ( MaskComplete & MASK_MPLAYER )   != 0 &&
00625                 ( MaskComplete & MASK_RIOCLIENT ) != 0 )
00626             {
00627                 if( ( MaskComplete & MASK_TGIF ) == 0 )
00628                     if( ( port = startListenerThread( instance ) ) == 0 )
00629                     {
00630                         fprintf( stderr, "[cederj]: Could not find a free " );
00631                         fprintf( stderr, "UDP port\n" );
00632                     }
00633                 startRioClient( This, port );
00634             }
00635             MaskComplete = CurMask = 0;
00636             mID = rID = tID = iID  = 0;
00637         }
00638         result = NPERR_NO_ERROR;
00639     }
00640 
00641     #ifdef RIO_DEBUG1
00642     fprintf( stderr, "[RioBrowserPlugin - NPP_SetWindow] Finish\n" );
00643     #endif
00644 
00645     return result;
00646 }

void NP_LOADDS NPP_Shutdown ( void   ) 

Definition at line 454 of file RioBrowserPlugin.c.

00455 {
00456     int error;
00457 
00458     #ifdef RIO_DEBUG1
00459     fprintf( stderr, "[RioBrowserPlugin - NPP_Shutdown] Start\n" );
00460     #endif
00461 
00462     // Remove o semaforo, se estivermos usando a nova implementacao
00463 
00464     if( UseChangeSlide )
00465     {
00466         #ifdef RIO_DEBUG2
00467         fprintf( stderr, "NPP_Shutdown: Removendo o semaforo criado!\n" );
00468         #endif
00469         if( sem_destroy( &ChangeSlideSemaphore ) < 0 )
00470         {
00471              error = errno;
00472              fprintf( stderr, "[cederj]: sem_destroy failed with error " );
00473              fprintf( stderr, "%d (%s)\n", error, strerror( error ) );
00474         }
00475     }
00476 
00477     #ifdef RIO_DEBUG1
00478     fprintf( stderr, "[RioBrowserPlugin - NPP_Shutdown] Finish\n" );
00479     #endif
00480 }

void NP_LOADDS NPP_StreamAsFile ( NPP  instance,
NPStream stream,
const char *  fname 
)

Definition at line 752 of file RioBrowserPlugin.c.

00753 {
00754     PluginInstance *This;
00755 
00756     #ifdef RIO_DEBUG1
00757     fprintf( stderr, "[RioBrowserPlugin - NPP_StreamAsFile] Start\n" );
00758     #endif
00759 
00760     if( instance != NULL )
00761         This = ( PluginInstance * )instance->pdata;
00762 
00763     #ifdef RIO_DEBUG1
00764     fprintf( stderr, "[RioBrowserPlugin - NPP_StreamAsFile] Finish\n" );
00765     #endif
00766 }

void NP_LOADDS NPP_URLNotify ( NPP  instance,
const char *  url,
NPReason  reason,
void *  notifyData 
)

Definition at line 778 of file RioBrowserPlugin.c.

00780 {
00781     #ifdef RIO_DEBUG1
00782     fprintf( stderr, "[RioBrowserPlugin - NPP_URLNotify] Start-Finish\n" );
00783     #endif
00784 }

int32 NP_LOADDS NPP_Write ( NPP  instance,
NPStream stream,
int32  offset,
int32  len,
void *  buffer 
)

Definition at line 706 of file RioBrowserPlugin.c.

00708 {
00709     PluginInstance *This;
00710 
00711     #ifdef RIO_DEBUG1
00712     fprintf( stderr, "[RioBrowserPlugin - NPP_Write] Start\n" );
00713     #endif
00714 
00715     if( instance != NULL )
00716         This = ( PluginInstance * )instance->pdata;
00717 
00718     #ifdef RIO_DEBUG1
00719     fprintf( stderr, "[RioBrowserPlugin - NPP_Write] Finish\n" );
00720     #endif
00721 
00722     return len; /* The number of bytes accepted */
00723 }

int32 NP_LOADDS NPP_WriteReady ( NPP  instance,
NPStream stream 
)

Definition at line 686 of file RioBrowserPlugin.c.

00687 {
00688     PluginInstance *This;
00689 
00690     #ifdef RIO_DEBUG1
00691     fprintf( stderr, "[RioBrowserPlugin - NPP_WriteReady] Start\n" );
00692     #endif
00693 
00694     if( instance != NULL )
00695         This = ( PluginInstance * )instance->pdata;
00696 
00697     #ifdef RIO_DEBUG1
00698     fprintf( stderr, "[RioBrowserPlugin - NPP_WriteReady] Finish\n" );
00699     #endif
00700 
00701     /* Number of bytes ready to accept in NPP_Write() */
00702     return STREAMBUFSIZE;
00703 }

Generated on Wed Jul 4 16:03:30 2012 for RIO by  doxygen 1.6.3