MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla
Your Search Results

    NP_Port

    この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

    « Gecko Plugin API Reference « Plug-in Side Plug-in API

    Summary

    Used on Mac OS only

    Contains information required by the window field of an NPWindow structure.

    Syntax

    typedef struct NP_Port
    {
        CGrafPtr port;  /* Grafport */
        int32    portx; /* position inside the topmost window */
        int32    porty;
    } NP_Port;
    

    Fields

    The data structure has the following fields:

    port
    Standard Mac OS port into which the plug-in should draw.
    portx, porty
    Top-left corner of the plug-in rectangle in port coordinates (taking the scroll position into account).

    Description

    On Mac OS, the window field of an NPWindow structure points to an NP_Port object, which is allocated by the browser. The NP_Port is valid for the lifetime of the NPWindow, that is, until NPP_SetWindow is called again with a different value or the instance is destroyed.

    Since the port is shared between the plug-in and other plug-ins and the browser, the plug-in should always do the following:

    • Draw only within the area designated by the NPWindow.
    • Save the current port settings before changing the port for drawing.
    • Set the desired port settings before drawing.
    • Restore the previous port settings after drawing.

    See Also

    NPP_SetWindow, NPWindow

    ドキュメントのタグと貢献者

    タグ: 
    Contributors to this page: Pmash
    最終更新者: Pmash,