Search completed in 1.43 seconds.
NPP_New - Archive of obsolete content
instance Contains instance-specific private data for the plug-in and the browser. This data is stored in instance->pdata. mode Display mode of plug-in. ...
...nstance of this plug-in at the same URL. If non-null, the browser passes ownership of the NPSavedData object back to the plug-in. The plug-in is responsible for freeing the memory for the NPSavedData and the buffer it contains. Returns If successful, the function returns NPERR_NO_ERROR. If unsuccessful, the function returns an error code. For possible values, see Error Codes. Description
NPP_New creates a new instance of a plug-in. It is called after NP_Initialize and is passed the MIME type, embedded or full-screen display mode, and, for embedded plug-ins, information about HTML EMBED arguments. A new instance pointer (NPP instance) is created by the plug-in, which is valid until the instance is destroyed with NPP_Destroy. If instance data was saved from a previous instance of the plu...
...on about HTML EMBED arguments. A new instance pointer (NPP instance) is created by the plug-in, which is valid until the instance is destroyed with NPP_Destroy. If instance data was saved from a previous instance of the plug-in by the NPP_Destroy function, it is returned in the saved parameter for the current instance to use. All attributes in the EMBED tag (standard and private) are passed in
NPP_New in the argn and argv arrays. The browser ignores any non-standard attributes within an EMBED tag. This gives developers a chance to use private attributes to communicate instance-specific options or other information to the plug-in. Place private options at the end of the list of standard attributes in the EMBED Tag. See Also NPP_Destroy, NP_Shutdown, NPP, NPSavedData ...
NPP_NewStream - Archive of obsolete content
type Pointer to MIME type of the stream. stream Pointer to new stream. seekable Boolean indicating whether the stream is seekable: true: Seekable. ...
...entation note: some plugins, notably Silverlight, do not set this outparam, and rely on the outparam being initialized to a default NP_NORMAL value. Returns If successful, the function should return NPERR_NO_ERROR. If unsuccessful, the function should return one of the NPError Error Codes. This will cause the browser to destroy the stream without calling NPP_DestroyStream. Description
NPP_NewStream notifies the plug-in when a new stream is created. The NPStream* pointer is valid until the stream is destroyed. The plug-in can store plug-in-private data associated with the stream in stream->pdata. The MIME type of the stream is provided by the type parameter. The data in the stream can be the file specified in the SRC attribute of the EMBED tag, for an embedded instance, or the file it...
Streams - Plugins
ore than one stream object per instance. Streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. Each stream has an associated MIME type identifying the format of the data in the stream. Streams produced by the browser can be automatically sent to or requested by the plug-in instance. The browser calls the plug-in methods
NPP_NewStream, NPP_WriteReady, NPP_Write, and NPP_DestroyStream to, respectively, create a stream, find out how much data the plug-in can handle, push data into the stream, and delete it. The plug-in instance selects a transmission mode for streams produced by the browser. Stream data can be pushed by the browser, pulled by the plug-in, or saved to a local file and passed to the plug-in. Normal mode:...
...g-ins should implement an incremental stream-based interface wherever possible. Streams sent by the plug-in to the browser are like normal-mode streams produced by the browser, but in reverse. In normal-mode streams, the browser calls the plug-in to tell it when a stream is created and to push more data. In contrast, for streams produced by the plug-in, the plug-in calls the Plug-in API methods
NPP_NewStream, NPP_Write, and NPP_DestroyStream to create a stream, push data into it, and delete it. Receiving a Stream Sending a Stream Receiving a Stream When the browser sends a data stream to the plug-in, it has several tasks to perform: Telling the Plug-in When a Stream Is Created Telling the Plug-in When a Stream Is Deleted Finding Out How Much Data the Plug-in Can Accept Writing the ...
...asks to perform: Telling the Plug-in When a Stream Is Created Telling the Plug-in When a Stream Is Deleted Finding Out How Much Data the Plug-in Can Accept Writing the Stream to the Plug-in Sending the Stream in Random-Access Mode Sending the Stream in File Mode Telling the Plug-in When a Stream Is Created To tell the plug-in instance when a new stream is created, the browser calls the
NPP_NewStream method. This method also determines which mode it should use to send data to the plug-in. The browser can create a stream for several different types of data: for the file specified in the data attribute of the object element or the src attribute of the embed element for a data file for a full-page instance The
NPP_NewStream method has the following syntax: NPError
NPP_NewStream(NPP...
...And 8 more matches
Initialization and Destruction - Plugins
<< PreviousNext >> This chapter describes the methods that provide the basic processes of initialization, instance creation and destruction, and shutdown. Initialization: The browser calls the Plug-in API function NP_Initialize when the plug-in code is first loaded. Instance Creation: The browser calls the Plug-in API function
NPP_New when the instance is created. Instance Destruction: The plug-in instance is deleted when the user leaves the instance page or closes the instance window; the browser calls the function NPP_Destroy to tell the plug-in that the instance is being deleted. Shutdown: When the last instance of a plug-in is deleted, the plug-in code is unloaded from memory and the browser calls the function NP_Shutdown. Plug-ins consume no resources, other than disk s...
...eation After initialization, the plug-in instance is created. More than one instance of the same plug-in can exist if a single page contains multiple embedded plug-ins, or if several browser windows are open and display the same data type. At this point, a plug-in can call the NPN_SetValue function to specify whether it is windowed (the default) or windowless. ...
...n instance is created. More than one instance of the same plug-in can exist if a single page contains multiple embedded plug-ins, or if several browser windows are open and display the same data type. At this point, a plug-in can call the NPN_SetValue function to specify whether it is windowed (the default) or windowless. Plug-in instances are created with
NPP_New and destroyed with NPP_Destroy. ...
...And 4 more matches
NPP_Destroy - Archive of obsolete content
ide Plug-in API Summary Deletes a specific instance of a plug-in. Syntax #include <npapi.h> NPError NPP_Destroy(NPP instance, NPSavedData **save); Parameters The function has the following parameters: instance Pointer to the plug-in instance to delete. **save State or other information to save for reuse by a new instance of this plug-in at the same URL. Passed to
NPP_New. Returns If successful, the function returns NPERR_NO_ERROR. If unsuccessful, the plug-in is not loaded and the function returns an error code. For possible values, see Error Codes. Description NPP_Destroy releases the instance data and resources associated with a plug-in. The browser calls this function when a plug-in instance is deleted, typically because the user has left the page con...
...g the last instance of a plug-in, NP_Shutdown is subsequently called. Use NP_Shutdown to delete any data allocated in NP_Initialize and intended to be shared by all instances of a plug-in. Use the optional save parameter if you want to save and reuse some state or other information. Upon the user's return to the page, this information is passed to the new plug-in instance when it is created with
NPP_New. Avoid trying to save critical data with this function. Ownership of the buf field of the NPSavedData structure passes from the plug-in to the browser when NPP_Destroy returns. The browser can and will discard this data based on arbitrary criteria such as its size and the user's page history. To ensure that the browser does not crash or leak memory when the saved data is discarded, NPSavedData'...
...uf field should be a flat structure (a simple structure with no allocated substructures) allocated with NPN_MemAlloc. Mac OS If you want to restore state information if this plug-in is later recreated, use NP_MemAlloc to create an NPSavedData structure. NOTE: You should not perform any graphics operations in NPP_Destroy as the instance's window is no longer guaranteed to be valid. See Also
NPP_New, NP_Shutdown, NPP, NPN_MemAlloc, NPSavedData ...
NPStream - Archive of obsolete content
. The plug-in should copy this data before making use of it. The headers include the HTTP status line and all headers, verbatim as received from the server. Lines are terminated by newline characters ("\n"), and the headers are terminated by a newline followed by null ("\n\0"). Description The browser allocates and initializes the NPStream object and passes it to the plug-in in as a parameter to
NPP_NewStream or NPN_NewStream. The browser cannot delete the object until after it calls NPP_DestroyStream or the plug-in calls NPN_DestroyStream. Streams produced by the browser: the browser creates the NPStream object and passes it to the plug-in initially as a parameter to
NPP_NewStream. All API calls that operate on the stream (such as NPP_WriteReady and NPP_Write) use a pointer to this stream. The ...
...ream. All API calls that operate on the stream (such as NPP_WriteReady and NPP_Write) use a pointer to this stream. ...
...ream is about to be deleted through NPP_DestroyStream, after which the NPStream object is no longer valid. ...
Plug-in Basics - Plugins
to the browser. The browser calls them when the plug-in software is loaded and unloaded. These functions are exported from the plug-in DLL and accessed with a system table lookup, which means that they are not related to any particular plug-in instance. Again, see Initialization and Destruction for more information about initializing and destructing. The browser calls the plug-in API function
NPP_New when the instance is created. Multiple instances of the same plug-in can exist (a) if there are multiple embedded objects on a single page, or (b) if several browser windows are open and each displays the same data type. A plug-in instance is deleted when a user leaves the instance's page or closes its window; Gecko calls the function NPP_Destroy to inform the plug-in that the instance is being ...
...the plug-in API A plug-in is a native code library whose source conforms to standard C syntax. The Plug-in Application Programming Interface (API) is made up of two groups of functions and a set of shared data structures. Plug-in methods are functions that you implement in the plug-in; Gecko calls these functions. The names of all the plug-in functions in the API begin with NPP_, for example,
NPP_New. There are also a couple of functions (i.e., NP_Initialize and NP_Shutdown) that are direct library entry points and not related to any particular plug-in instance. Browser methods are functions implemented by Gecko; the plug-in calls these functions. The names of all the browser functions in the API begin with NPN_, for example, NPN_Write. Data structures are plug-in-specific types defined for...
...havior. For example, a plug-in that displays video could have private attributes that determine whether to start the plug-in automatically or loop the video automatically on playback, as in the following embed element: <embed src="myavi.avi" width="100" height="125" autostart="true" loop="true"> With this embed element, Gecko passes the values to the plug-in, using the arg parameters of the
NPP_New call that creates the plug-in instance. argc = 5 argn = {"src", "width", "height", "autostart", "loop"} argv = {"movie.avi", "100", "125", "true", "true"} Gecko interprets the attributes as follows: src: Load the data file and determine the MIME type of the data. width and height: Set the area of the page handled by the plug-in to 100 by 125 pixels. autostart and loop: Ignore these privat...
NPN_DestroyStream - Archive of obsolete content
d due to network problems. Returns If successful, the function returns NPERR_NO_ERROR. If unsuccessful, the plug-in is not loaded and the function returns an error code. ...
...ed and the function returns an error code. For possible values, see Error Codes. Description The plug-in calls the NPN_DestroyStream() function to close and delete a stream. ...
NPN_RequestRead - Archive of obsolete content
NPByteRange objects in a single call to NPN_RequestRead(), or multiple calls to NPN_RequestRead()), the browser can write individual ranges in any order, and with any number of NPP_WriteReady() and NPP_Write() calls. The plug-in must allocate NPByteRange objects, which the browser copies if necessary. The plug-in can free these as soon as the call returns. Seekable streams are created by calling
NPP_NewStream() with NP_SEEK as the stype mode. The plug-in can call NPN_RequestRead() on streams that were not initially in NP_SEEK mode as long as the stream is inherently seekable; NPN_RequestRead() automatically changes the mode to NP_SEEK. If the stream is not inherently seekable, the stream must have been put in NP_SEEK mode initially (since the browser must cache all the stream data on disk in ...
...st cache all the stream data on disk in order to access it randomly). ...
NPN_SetValue - Archive of obsolete content
uginScriptableNPObject NPPVformValue NPPVpluginDrawingModel value The value of the specified variable to be set. Returns If successful, the function should return NPERR_NO_ERROR. If unsuccessful, the function should return the most relevant NPAPI error code. For possible values, see Error Codes. Description A good place to set plugin operation mode such as windowless mode is
NPP_New, so the browser knows right away what mode the plugin is designed to operate in. NPPVpluginWindowBool (Windows and Unix) specifies that the plugin operates in windowed mode. The alternative is windowless where no window messages are sent to the plugin as there is no window associated with it. In windowless mode all the browser to plugin communications related to drawing, mouse, and keyboard inpu...
...er to a boolean. ...
NPP - Archive of obsolete content
-in can use to store a pointer to an internal data structure associated with the instance; this field isn't modified by the browser. ndata A private value, owned by the browser, which is used to store data associated with the instance; this value should not be modified by the plug-in. ...
...d passes a pointer to it to
NPP_New(). This pointer--which is an opaque instance handle of a plug-in--identifies the instance on which API calls should operate. NPP contains private instance data for both the plug-in and the browser. The NPP_Destroy() function informs the plug-in when the NPP instance is about to be deleted; after this call returns, the NPP pointer is no longer valid. ...
NPP_StreamAsFile - Archive of obsolete content
ame Pointer to full path to a local file. If an error occurs while retrieving the data or writing the file, fname may be null. ...
...ll. Description When the stream is complete, the browser calls NPP_StreamAsFile to provide the instance with a full path name for a local file for the stream. ...
NPP_Write - Archive of obsolete content
unsuccessful, the function signals an error by returning a negative value. The browser will destroy the stream by calling NPP_DestroyStream. Description The browser calls the NPP_Write function to deliver the data specified in a previous NPP_WriteReady call to the plug-in. A plug-in must consume at least as many bytes as indicated in the NPP_WriteReady call. After a stream is created by a call to
NPP_NewStream, the browser calls NPP_Write either: If the plug-in requested a normal-mode stream, the data in the stream is delivered to the plug-in instance in a series of calls to NPP_WriteReady and NPP_Write. If the plug-in requested a seekable stream, the NPN_RequestRead function requests reads of a specified byte range that results in a series of calls to NPP_WriteReady and NPP_Write. The plug-in ...
...fferent information depending in the type of stream. ...
NPAPI plug-in side API - Archive of obsolete content
with the browser. The names of all of these methods begin with NPP_ to indicate that they are implemented by the plug-in and called by the browser. ...
... browser. The names of all of these methods begin with NPP_ to indicate that they are implemented by the plug-in and called by the browser. ...
Getting the page URL in NPAPI plugin - Archive of obsolete content
ef" identifier. identifier = NPN_GetStringIdentifier( "href" ); // Get the location property from the location object. bool b2 = NPN_GetProperty( m_pNPInstance, locationObj, identifier, &variantValue ); This code is just a rough example. Remember to release any references after using them. Tradeoffs: Uses NPAPI only Works in most browsers Does not work in Mozillas older than Firefox 1.0 Via
NPP_NewStream From Braden McDaniel: If you want the URI of the resource for which the plug-in is invoked, the most NPAPI-friendly way to do that is to get it from the NPStream that is passed to
NPP_NewStream. Tradeoffs: NPAPI only Probably works in all browsers, all versions Is sort of backwards (?) Advantages / disadvantages ? Via DOM From Benjamin Smedberg: The NPAPI gives you the ability to get ...
Index - Archive of obsolete content
ecific instance of a plug-in. 3679 NPP_DestroyStream NPAPI, Plugins Tells the plug-in that a stream is about to be closed or destroyed. 3680 NPP_GetValue NPAPI, Plugins Allows the browser to query the plug-in for information. 3681 NPP_HandleEvent NPAPI, Plugins Delivers a platform-specific window event to the instance. 3682
NPP_New NPAPI, Plugins Creates a new instance of a plug-in. 3683
NPP_NewStream NPAPI, Plugins Notifies a plug-in instance of a new data stream. 3684 NPP_Print NPAPI, Plugins Requests a platform-specific print operation for an embedded or full-screen plug-in. 3685 NPP_SetValue NPAPI, Plugins Implemented by plugins. This call is used ...
Index of archived content - Archive of obsolete content
ption NPN_SetProperty NPN_SetValue NPN_SetValueForURL NPN_Status NPN_UTF8FromIdentifier NPN_UserAgent NPN_Version NPN_Write NPObject NPP NPPVariable NPP_Destroy NPP_DestroyStream NPP_GetValue NPP_HandleEvent
NPP_New NPP_NewStream NPP_Print NPP_SetValue NPP_SetWindow NPP_StreamAsFile NPP_URLNotify NPP_Write NPP_WriteReady NPPrint NPPrintCallbackStruct NPRect NPRegion NPSavedData NPSetWindowCallbackStruct NPStream NPStrin...
NPN_GetURL - Archive of obsolete content
RL types (such as mailto). The following recommendations about target choice apply to other methods that handle URLs as well. If the target parameter refers to the window or frame containing the current plug-in instance, the instance is destroyed and the plug-in may be unloaded. If target is null, the application creates a new stream and delivers the data to the plug-in instance, through calls to
NPP_NewStream(), NPP_WriteReady() and NPP_Write(), and NPP_DestroyStream(). This means that if you want the plug-in to handle a new stream, no matter what the MIME type is, use null. If the application cannot locate the URL and retrieve the data, it does not create a stream for the instance. When the plug-in instance is part of a regular browser window, and it uses a _blank target with a mailto or news U...
NPN NewStream - Archive of obsolete content
n all of its data into the stream, NPN_DestroyStream terminates the stream and deallocates the NPStream object. The target parameter is the name of the target window or frame, or one of several special target names. For parameter values and information about how to use them, see NPN_GetURL. If the new stream has the target of _self, this function should return an INVALID_PARAM NP Error. See Also
NPP_NewStream, NPP_Write, NPP_DestroyStream, NPStream, NPP ...
NPN_Write - Archive of obsolete content
tream; char* myData = "<HTML><B>This is a message from my plug-in!</B></HTML>"; int32 myLength = strlen(myData) + 1; /* Create the stream. */ err = NPN_NewStream(instance, "text/html", "_blank", &stream) /* Push data into the stream. */ err = NPN_Write(instance, stream, myLength, myData); /* Delete the stream. */ err = NPN_DestroyStream(instance, stream, NPRES_DONE); See also
NPP_NewStream() NPP_DestroyStream() NPP_Read() NPStream NPP ...
NPP_SetValue - Archive of obsolete content
the following parameters: instance Pointer to plugin instance on which to set the variable. variable The variable being set. value Value for the variable being set. Returns If successful, the function should return NPERR_NO_ERROR. If unsuccessful, the function should return the most relevant NPAPI error code. For possible values, see Error Codes. Description None See Also
NPP_New, NPP_GetValue, NPN_SetValue, NPN_GetValue ...
NPSavedData - Archive of obsolete content
the plug-in's NPP_Destroy() function to allocate an NPSavedData object using the NPN_MemAlloc() function, fill in the fields, and return it to the browser as an output parameter. See Instance Destruction for a code example that shows how to use NPSavedData. If the user revisits a web page that contains a plug-in, the browser returns the NPSavedData to the new instance of the plug-in in a call to
NPP_New(). After this, the plug-in is responsible for keeping or deleting the objects as necessary. See also
NPP_New() NPP_Destroy() ...
NP_Initialize - Archive of obsolete content
his is the first function that the browser calls. NP_Initialize tells the plug-in that the browser has loaded it and provides global initialization. Allocate any memory or resources shared by all instances of your plug-in at this time. After the last instance of a plug-in has been deleted, the browser calls NP_Shutdown, where you can release allocated memory or resources. See Also NP_Shutdown,
NPP_New ...
NPAPI plugin reference - Archive of obsolete content
a plug-in. You specify one of these to any NPAPI function that needs to know which plug-in to work with. NPP_Destroy Deletes a specific instance of a plug-in. NPP_DestroyStream Tells the plug-in that a stream is about to be closed or destroyed. NPP_GetValue Allows the browser to query the plug-in for information. NPP_HandleEvent Delivers a platform-specific window event to the instance.
NPP_New Creates a new instance of a plug-in.
NPP_NewStream Notifies a plug-in instance of a new data stream. NPP_Print Requests a platform-specific print operation for an embedded or full-screen plug-in. NPP_SetValue Implemented by plugins. This call is used to inform plugins of variable information controlled by the browser. NPP_SetWindow Tells the plug-in when a window is created, moved, sized...
Drawing and Event Handling - Plugins
lug-in is windowless, use the NPN_SetValue method. The instance parameter represents the current plug-in. The variable parameter contains plug-in information to set. The value parameter returns the name of the plug-in. To specify that a plug-in is windowless, use NPN_SetValue with NPPVpluginWindowBool as the value of variable and false as the value of value. The plug-in makes this call from its
NPP_New method. If a plug-in does not make this call, it is considered a windowed plug-in. Plug-ins on Mac OS X are always windowless. NPError
NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved) { ... NPError result = NPN_SetValue(instance, NPPVpluginWindowBool, (void*)false); } ...
Plug-in Side Plug-in API - Plugins
EntryPoints Undocumented. NP_GetMIMEDescription Registers the mime types supported by the plug-in (Unix, Mac OS). NPP_GetValue Allows the browser to query the plug-in for information. NP_GetValue Allows the browser to query the plug-in for information. NPP_HandleEvent Delivers a platform-specific window event to the instance. NP_Initialize Provides global initialization for a plug-in.
NPP_New Creates a new instance of a plug-in.
NPP_NewStream Notifies a plug-in instance of a new data stream. NPP_Print Requests a platform-specific print operation for an embedded or full-screen plug-in. NPP_SetValue Sets information about the plug-in. NPP_SetWindow Tells the plug-in when a window is created, moved, sized, or destroyed. NP_Shutdown Provides global deinitialization for a plug-i...
URLs - Plugins
cluding HTTP, FTP, news, or mailto. The target parameter represents the destination where the URL will be displayed, a window or frame. If target refers to the window or frame containing the plug-in instance, it is destroyed and the plug-in may be unloaded. If the target parameter is set to null, the application creates a new stream and delivers the data to the plug-in instance, through calls to
NPP_NewStream, NPP_WriteReady and NPP_Write, and NPP_DestroyStream. In general, if a URL works in the location box of the Navigator, it works as a target for NPN_GetURL, except for the _self target. Make sure that the target matches the URL type sent to it. For example, a null target does not make sense for some URL types (such as mailto). For some recommendations to help you with target parameter choi...
Gecko Plugin API Reference - Plugins
e plug-in object. The names of all of these methods begin with NPP_ to indicate that they are implemented by the plug-in and called by the browser. For an overview of how these two sides of the plug-in API interact, see the How Plug-ins Work and Overview of Plug-in Structure sections in the introduction. NPP_Destroy NPP_DestroyStream NPP_GetValue NP_GetValue NPP_HandleEvent NP_Initialize
NPP_New NPP_NewStream NPP_Print NPP_SetValue NPP_SetWindow NP_Shutdown NPP_StreamAsFile NPP_URLNotify NPP_Write NPP_WriteReady Browser Side Plug-in API This chapter describes methods in the plug-in API that are available from the browser. The names of all of these methods begin with NPN_ to indicate that they are implemented by the browser and called by the plug-in. For an overview of how t...