cursor.h 1.0 KB

1234567891011121314151617181920212223242526272829
  1. /* Mouse-cursor images: the NBCUR1 bundle from /ramfs/cursors (see
  2. * include/cursor_abi.h), with a built-in 16x16 arrow as the fallback. */
  3. #ifndef CURSOR_H
  4. #define CURSOR_H
  5. #include "cursor_abi.h"
  6. struct cursor_image {
  7. const unsigned int *px; /* premultiplied ARGB8888, w*h */
  8. unsigned int w, h;
  9. unsigned int hot_x, hot_y;
  10. unsigned int frames; /* >= 1 */
  11. unsigned int delay_ms; /* per frame when frames > 1 */
  12. };
  13. /* (Re)load the bundle from the ramfs into page-allocated memory. Called
  14. * after ramfs_init() and from ramfs_replace(); the mouse is told to pick up
  15. * the new images. A missing or invalid bundle keeps the previous one (or
  16. * the built-in arrow). */
  17. void cursor_load(void);
  18. /* Fill *out with frame `frame` (mod the frame count) of `shape`. An
  19. * unknown shape, or one the bundle lacks, gives the default arrow. */
  20. void cursor_get(int shape, unsigned int frame, struct cursor_image *out);
  21. /* 1 when the bundle is loaded (0 = built-in arrow only). */
  22. int cursor_bundle_loaded(void);
  23. #endif