Blender V5.0
GHOST_CursorGenerator Struct Reference

#include <GHOST_Types.h>

Public Attributes

uint8_t *(* generate_fn )(const struct GHOST_CursorGenerator *cursor_generator, int cursor_size, int cursor_size_max, uint8_t *(*alloc_fn)(size_t size), int r_bitmap_size[2], int r_hot_spot[2], bool *r_can_invert_color)
void(* free_fn )(struct GHOST_CursorGenerator *cursor_generator)
GHOST_TUserDataPtr user_data

Detailed Description

Pass this as an argument to GHOST so each ghost back-end can generate cursors on demand.

Definition at line 73 of file GHOST_Types.h.

Member Data Documentation

◆ free_fn

void(* GHOST_CursorGenerator::free_fn) (struct GHOST_CursorGenerator *cursor_generator)

Called once GHOST has finished with this object, Typically this would free user_data.

Definition at line 103 of file GHOST_Types.h.

Referenced by gwl_window_cursor_custom_free(), GHOST_Window::setWindowCustomCursorGenerator(), window_set_custom_cursor_generator(), and wm_cursor_text_generator().

◆ generate_fn

uint8_t *(* GHOST_CursorGenerator::generate_fn) (const struct GHOST_CursorGenerator *cursor_generator, int cursor_size, int cursor_size_max, uint8_t *(*alloc_fn)(size_t size), int r_bitmap_size[2], int r_hot_spot[2], bool *r_can_invert_color)

The main cursor generation callback.

Note
only supports RGBA cursors.
Parameters
cursor_generatorPass in to allow accessing the user argument.
cursor_sizeThe cursor size to generate.
cursor_size_maxThe maximum dimension (width or height).
r_bitmap_sizeThe bitmap width & height in pixels. The generator must guarantee the resulting size (dimensions written to r_bitmap_size) never exceeds cursor_size_max.
r_hot_spotThe cursor hot-spot.
r_can_invert_colorWhen true, the call it can be inverted too much dark themes.
Returns
the bitmap data or null if it could not be generated.
  • The color is "straight" (alpha is not pre-multiplied).
  • At least: sizeof(uint8_t[4]) * r_bitmap_size[0] * r_bitmap_size[1] allocated bytes.

Definition at line 92 of file GHOST_Types.h.

Referenced by ghost_wl_buffer_from_cursor_generator(), window_set_custom_cursor_generator(), and wm_cursor_text_generator().

◆ user_data

GHOST_TUserDataPtr GHOST_CursorGenerator::user_data

Implementation specific data used for rasterization (could contain SVG data for example).

Definition at line 108 of file GHOST_Types.h.

Referenced by window_set_custom_cursor_generator(), and wm_cursor_text_generator().


The documentation for this struct was generated from the following file: