Confirmed users
180
edits
Line 44: | Line 44: | ||
} NPImageFormat; | } NPImageFormat; | ||
typedef struct _NPImageData | typedef struct _NPImageData | ||
{ | { | ||
Line 50: | Line 51: | ||
int32_t stride; /* Stride of data image pointer */ | int32_t stride; /* Stride of data image pointer */ | ||
NPImageFormat format; /* Format of image pointer */ | NPImageFormat format; /* Format of image pointer */ | ||
/* size of plugin window in current buffer, used for scale information */ | |||
/* | NPSize pluginSize; | ||
/* "data" points to exposeX/Y point, which is also offset in plugin window area */ | |||
int32_t exposeX; | |||
int32_t exposeY; | |||
/* size of data buffer, size of area where plugin should paint */ | |||
/* exposeX/Y + exposeSize <= pluginSize */ | |||
NPSize exposeSize; | |||
} NPImageData; | |||
How to initialize cairo destination surface with this info: | |||
<pre> | |||
cairo_surface_t *src = plugin_window_image (probably cached) | |||
cairo_surface_t *dest = | |||
cairo_image_surface_create_for_data((unsigned char*)event->data, | |||
CAIRO_FORMAT_XXX(event->format), | |||
event->exposeSize.width, | |||
event->exposeSize.height, | |||
event->stride); | |||
cairo_t *cr = cairo_create(dest); | |||
cairo_set_source_surface (cr, src, -event->exposeRect.left, -event->exposeRect.top); | |||
</pre> | |||
= NPImageFormat Type Negotiation = | = NPImageFormat Type Negotiation = |