diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2012-08-01 12:51:30 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2012-08-01 12:51:30 +0100 |
commit | bde04d10347414251b40af574d1bc94962d23a5a (patch) | |
tree | 8405dbd53052310d8e83502dbd1e53e8fb37d2e8 /include | |
parent | 56dd658e6265fb1902c92d6d88420c3accb79225 (diff) | |
download | libnsfb-bde04d10347414251b40af574d1bc94962d23a5a.tar.gz libnsfb-bde04d10347414251b40af574d1bc94962d23a5a.tar.bz2 |
Add support for offset mouse pointer hotspots.
Diffstat (limited to 'include')
-rw-r--r-- | include/cursor.h | 2 | ||||
-rw-r--r-- | include/libnsfb_cursor.h | 21 |
2 files changed, 16 insertions, 7 deletions
diff --git a/include/cursor.h b/include/cursor.h index e3a8a04..076e6c9 100644 --- a/include/cursor.h +++ b/include/cursor.h @@ -20,6 +20,8 @@ struct nsfb_cursor_s { int bmp_width; int bmp_height; int bmp_stride; + int hotspot_x; + int hotspot_y; /* current saved image */ nsfb_bbox_t savloc; diff --git a/include/libnsfb_cursor.h b/include/libnsfb_cursor.h index 4f36793..525bd83 100644 --- a/include/libnsfb_cursor.h +++ b/include/libnsfb_cursor.h @@ -17,15 +17,22 @@ bool nsfb_cursor_init(nsfb_t *nsfb); /** Set cursor parameters. * - * Set a cursor, the cursor will be shown at the specified location and - * size. The pixel data may be referenced untill the cursor is altered or - * cleared + * Set a cursor bitmap, the cursor will be shown at the location set by + * nsfb_cursor_loc_set. The pixel data may be referenced untill the cursor + * is altered or cleared * - * @param nsfb The frambuffer context. - * @param loc The location of the cursor - * @param pixel The pixel data for the cursor + * @param nsfb The frambuffer context + * @param pixel The cursor bitmap data + * @param bmp_width The width of the cursor bitmap + * @param bmp_height The height of the cursor bitmap + * @param bmp_stride The cursor bitmap's row stride + * @param hotspot_x Coordinate within cursor image to place over cursor loc + * @param hotspot_y Coordinate within cursor image to place over cursor loc + * + * (hot_spot_x, hot_spot_y) is from top left. (0, 0) means top left pixel of + * cursor bitmap is to be rendered over the cursor location. */ -bool nsfb_cursor_set(nsfb_t *nsfb, const nsfb_colour_t *pixel, int bmp_width, int bmp_height, int bmp_stride); +bool nsfb_cursor_set(nsfb_t *nsfb, const nsfb_colour_t *pixel, int bmp_width, int bmp_height, int bmp_stride, int hotspot_x, int hotspot_y); /** Set cursor location. * |