« Gecko Plugin API Reference « Plug-in Side Plug-in API
typedef struct _NPWindow
{
void* window; /* Platform specific handle */
uint32 x; /* Coordinates of top left corner */
uint32 y; /* relative to a Netscape page */
uint32 width; /* Maximum window size */
uint32 height;
NPRect clipRect; /* Clipping rectangle coordinates */
/* in port - Used by Mac only */
#ifdef XP_UNIX
void * ws_info; /* Platform-dependent additional data */
#endif /* XP_UNIX */
NPWindowType type; /* Window or drawable target */
} NPWindow;
The data structure has the following fields:
The NPWindow structure represents the native window or a drawable, and contains information about coordinate position, size, whether the plug-in is windowed or windowless, and some platform-specific information. The plug-in area is a native window element on Windows and Unix, or a rectangle within a native window on Mac OS. The x, y, height, and width coordinates of NPWindow specify the position and size of this area.
The browser calls NPP_SetValue whenever the drawable changes.
A windowed plug-in is drawn into a native window (or portion of a native window) on a web page. For windowed plug-ins, the browser calls the NPP_SetWindow method with an NPWindow structure that represents a drawable (a pointer to an NPWindow allocated by the browser). This window is valid until NPP_SetWindow is called again with a different window or the instance is destroyed.
A windowless plug-in is drawn into a target called a drawable, which can be defined in several ways depending on the platform. For windowless plug-ins, the browser calls the NPP_SetWindow method with an NPWindow structure that represents a drawable.
The plug-in should not modify the field values in this structure.
Page last modified 04:03, 6 Aug 2007 by Karlt?