Fields

Platform-specific handle to a native window element in the Netscape window hierarchy on Windows (HWND) and Unix (X Window ID). Mac OS: window is a pointer to an NP_Port.

x, y

The x and y coordinates for the top left corner of the plug-in relative to the page (and thus relative to the origin of the drawable). Should not be modified by the plug-in.

height, width

The height and width of the plug-in area. Should not be modified by the plug-in.

clipRect

Clipping rectangle of the plug-in; the origin is the top left corner of the drawable or window. Clipping to the clipRect prevents the plug-in from overwriting the status bar, scroll bars, and other page elements when partially scrolled off the screen. Mac OS: clipRect is the rectangle in port coordinates to which the plug-in should clip its drawing.

Unix/X11: not used. (The drawable is provided in a GraphicsExpose event, when the paint is requested.)

Description

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.

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.