Is NPRect a correct structure to be used in WM_PAINT's lParam?

Rafał Chłodnicki rchl2k at gmail.com
Mon Jun 27 07:11:11 PDT 2011


https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Drawing_and_Event_Handling#Receiving_a_Paint_Message

states that:

"The lParam parameter of WM_PAINT holds a pointer to an NPRect structure
specifying the bounding box of the update area."

and NPRect structure looks like this:

typedef struct _NPRect
{
uint16_t top;
uint16_t left;
uint16_t bottom;
uint16_t right;
} NPRect;

The problem is that this will break painting for some plugins (witnessed
with Quicktime at least) as they expect members to be both 32bit in size and
in different order.

It looks like plugins really expect platform rect here and not NPAPI NPRect.
That would be RECT on Windows (
http://msdn.microsoft.com/en-us/library/dd162897(v=vs.85).aspx ). And this
is actually the format of rect that browsers seems to be using (checked
using special wrapper plugin).

So if what I'm saying is correct, I would expect documentation to be updated
to account for this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/plugin-futures/attachments/20110627/5f0e5cd4/attachment.html>


More information about the plugin-futures mailing list