42#ifndef ULTRALIGHT_CAPI_SURFACE_H
43#define ULTRALIGHT_CAPI_SURFACE_H
219typedef void* (*ULSurfaceDefinitionCreateCallback)(
unsigned int width,
unsigned int height);
264typedef void* (*ULSurfaceDefinitionLockPixelsCallback)(
void* user_data);
284 unsigned int height);
unsigned int(*) ULSurfaceDefinitionGetWidthCallback(void *user_data)
The callback invoked when a Surface's width (in pixels) is requested.
Definition CAPI_Surface.h:233
void ulSurfaceResize(ULSurface surface, unsigned int width, unsigned int height)
Resize the pixel buffer to a certain width and height (both in pixels).
unsigned int ulSurfaceGetRowBytes(ULSurface surface)
Number of bytes between rows (usually width * 4).
void * ulSurfaceLockPixels(ULSurface surface)
Lock the pixel buffer and get a pointer to the beginning of the data for reading/writing.
void ulSurfaceClearDirtyBounds(ULSurface surface)
Clear the dirty bounds.
void ulSurfaceUnlockPixels(ULSurface surface)
Unlock the pixel buffer.
void *(*) ULSurfaceDefinitionLockPixelsCallback(void *user_data)
The callback invoked when a Surface's pixel buffer is requested to be locked for reading/writing (sho...
Definition CAPI_Surface.h:264
bool(*) ULSurfaceDefinitionScrollCallback(void *user_data, ULIntRect rect, int dx, int dy)
The callback invoked when a Surface is asked to shift a rectangle of pixels by an offset.
Definition CAPI_Surface.h:323
void * ulSurfaceGetUserData(ULSurface surface)
Get the underlying user data pointer (this is only valid if you have set a custom surface implementat...
void(*) ULSurfaceDefinitionResizeCallback(void *user_data, unsigned int width, unsigned int height)
The callback invoked when a Surface is requested to be resized to a certain width/height.
Definition CAPI_Surface.h:283
void ulSurfaceSetDirtyBounds(ULSurface surface, ULIntRect bounds)
Set the dirty bounds to a certain value.
unsigned int ulSurfaceGetHeight(ULSurface surface)
Height (in pixels).
void ulSurfaceShiftPixels(void *pixels, unsigned int row_bytes, ULIntRect rect, int dx, int dy)
Shift a rectangle of 32-bit pixels in place.
size_t(*) ULSurfaceDefinitionGetSizeCallback(void *user_data)
The callback invoked when a Surface's size (in bytes) is requested.
Definition CAPI_Surface.h:256
ULIntRect ulSurfaceGetDirtyRect(ULSurface surface, unsigned int index)
Get a dirty rectangle by index.
unsigned int ulSurfaceGetWidth(ULSurface surface)
Width (in pixels).
bool ulSurfaceScroll(ULSurface surface, ULIntRect rect, int dx, int dy)
Shift a rectangle of pixels by a certain offset (see ULSurfaceDefinitionScrollCallback for the rules)...
void(*) ULSurfaceDefinitionUnlockPixelsCallback(void *user_data)
The callback invoked when a Surface's pixel buffer is requested to be unlocked after previously being...
Definition CAPI_Surface.h:272
void(*) ULSurfaceDefinitionDestroyCallback(void *user_data)
The callback invoked when a Surface is destroyed.
Definition CAPI_Surface.h:226
size_t ulSurfaceGetSize(ULSurface surface)
Size in bytes.
unsigned int ulSurfaceGetDirtyRectCount(ULSurface surface)
Get the number of dirty rectangles (0 when nothing has been painted since the last clear).
unsigned int(*) ULSurfaceDefinitionGetRowBytesCallback(void *user_data)
The callback invoked when a Surface's row bytes is requested.
Definition CAPI_Surface.h:249
ULIntRect ulSurfaceGetDirtyBounds(ULSurface surface)
Get the dirty bounds.
ULBitmap ulBitmapSurfaceGetBitmap(ULBitmapSurface surface)
Get the underlying Bitmap from the default Surface.
unsigned int(*) ULSurfaceDefinitionGetHeightCallback(void *user_data)
The callback invoked when a Surface's height (in pixels) is requested.
Definition CAPI_Surface.h:240
void *(*) ULSurfaceDefinitionCreateCallback(unsigned int width, unsigned int height)
The callback invoked when a Surface is created.
Definition CAPI_Surface.h:219
Various defines and utility functions for the C API.
struct C_Surface * ULBitmapSurface
Opaque handle to a BitmapSurface (the default Surface implementation).
Definition CAPI_Defines.h:125
#define ULExport
Definition CAPI_Defines.h:42
struct C_Surface * ULSurface
Opaque handle to a Surface object.
Definition CAPI_Defines.h:122
struct C_Bitmap * ULBitmap
Opaque handle to a Bitmap object.
Definition CAPI_Defines.h:93
Integer rectangle defined by left, top, right, and bottom coordinates.
Definition CAPI_Defines.h:548
User-defined surface interface.
Definition CAPI_Surface.h:335
ULSurfaceDefinitionGetHeightCallback get_height
Callback invoked to get the Surface height in pixels.
Definition CAPI_Surface.h:343
ULSurfaceDefinitionUnlockPixelsCallback unlock_pixels
Callback invoked to unlock the pixel buffer.
Definition CAPI_Surface.h:351
ULSurfaceDefinitionScrollCallback scroll
Callback invoked to shift a rectangle of pixels (may be NULL, the library then shifts the locked buff...
Definition CAPI_Surface.h:356
ULSurfaceDefinitionCreateCallback create
Callback invoked when a Surface is created.
Definition CAPI_Surface.h:337
ULSurfaceDefinitionResizeCallback resize
Callback invoked to resize the pixel buffer.
Definition CAPI_Surface.h:353
ULSurfaceDefinitionLockPixelsCallback lock_pixels
Callback invoked to lock the pixel buffer for reading/writing.
Definition CAPI_Surface.h:349
ULSurfaceDefinitionGetWidthCallback get_width
Callback invoked to get the Surface width in pixels.
Definition CAPI_Surface.h:341
ULSurfaceDefinitionGetRowBytesCallback get_row_bytes
Callback invoked to get the number of bytes per row.
Definition CAPI_Surface.h:345
ULSurfaceDefinitionGetSizeCallback get_size
Callback invoked to get the Surface size in bytes.
Definition CAPI_Surface.h:347
ULSurfaceDefinitionDestroyCallback destroy
Callback invoked when a Surface is destroyed.
Definition CAPI_Surface.h:339