50#include "RNA_prototypes.hh"
60#define DEPTH_INVALID 1.0f
188#define MIN_MANHATTAN_PX (U.gp_manhattandist)
190#define MIN_EUCLIDEAN_PX (U.gp_euclideandist)
257 int dx = int(
fabsf(mval[0] - pmval[0]));
258 int dy = int(
fabsf(mval[1] - pmval[1]));
385 if ((num_points < 3) || (idx < 3) || (inf == 0.0f)) {
395 tGPspoint *pta = idx >= 4 ? &points[idx - 4] :
nullptr;
396 tGPspoint *ptb = idx >= 3 ? &points[idx - 3] :
nullptr;
397 tGPspoint *ptc = idx >= 2 ? &points[idx - 2] :
nullptr;
400 float sco[2] = {0.0f};
401 float a[2],
b[2], c[2], d[2];
402 const float average_fac = 1.0f / steps;
428 const float ref_point[2],
429 const float dir_cw[2],
430 const float dir_ccw[2],
434 stroke_points[0] = ref_point[0] + dir_cw[0] *
length *
sign;
435 stroke_points[1] = ref_point[1] + dir_cw[1] *
length *
sign;
436 stroke_points[2] = ref_point[0] + dir_ccw[0] *
length *
sign;
437 stroke_points[3] = ref_point[1] + dir_ccw[1] *
length *
sign;
441 const float stroke_dir[2],
443 float stroke_points[8],
444 const int arrow_style)
446 const int arrow_length = 8;
450 const float inv_norm_dir_clockwise[2] = {norm_dir[1], -norm_dir[0]};
451 const float inv_norm_dir_counterclockwise[2] = {-norm_dir[1], norm_dir[0]};
453 switch (arrow_style) {
456 stroke_points[0] = corner[0] + inv_norm_dir_clockwise[0] * arrow_length + norm_dir[0];
457 stroke_points[1] = corner[1] + inv_norm_dir_clockwise[1] * arrow_length + norm_dir[1];
458 stroke_points[2] = corner[0] + inv_norm_dir_counterclockwise[0] * arrow_length + norm_dir[0];
459 stroke_points[3] = corner[1] + inv_norm_dir_counterclockwise[1] * arrow_length + norm_dir[1];
464 inv_norm_dir_clockwise,
465 inv_norm_dir_counterclockwise,
471 if (point !=
nullptr) {
477 inv_norm_dir_clockwise,
478 inv_norm_dir_counterclockwise,
481 stroke_points[4] = corner[0] - norm_dir[0];
482 stroke_points[5] = corner[1] - norm_dir[1];
485 mul_v2_fl(norm_dir, arrow_length * 1.5f);
486 if (point !=
nullptr) {
492 inv_norm_dir_clockwise,
493 inv_norm_dir_counterclockwise,
494 arrow_length * 0.75f,
496 stroke_points[4] = stroke_points[0] - norm_dir[0];
497 stroke_points[5] = stroke_points[1] - norm_dir[1];
498 stroke_points[6] = stroke_points[2] - norm_dir[0];
499 stroke_points[7] = stroke_points[3] - norm_dir[1];
561 const float e_heading[2] = {start[0] - end[0], start[1] - end[1]};
568 const float s_heading[2] = {end[0] - start[0], end[1] - start[1]};
606 for (
int s = 0; s < 3; s++) {
704 const float real_co[2] = {co[co_idx], co[co_idx + 1]};
721 const float corner_point[3],
722 const float arrow_points[8])
734 const float arrow_points[8])
744 const float arrow_points[8])
758 const float corner_point[3],
759 const float arrow_points[8])
778 const float arrow_points[8],
781 float corner_conv[3];
959 float *depth_arr =
nullptr;
964 int interp_depth = 0;
977 depths, mval_i, mval_prev, depth_margin + 1, depth_arr +
i) == 0)))
988 if (found_depth ==
false) {
992 depth_arr[
i] = 0.9999f;
1016 for (
i = first_valid + 1;
i < last_valid;
i++) {
1020 interp_depth =
true;
1087 const int mval_i[2] = {
x,
y};
1097 if (depth_pt > depth_mval) {
1109 const float mval[2],
1139 bool do_cull =
false;
1268 if (curarea ==
nullptr) {
1342 if (clip ==
nullptr) {
1369 p->
imat[3][0] -= marker->
pos[0];
1370 p->
imat[3][1] -= marker->
pos[1];
1391 if (gpd_ptr ==
nullptr) {
1397 if (*gpd_ptr ==
nullptr) {
1453 p = MEM_new<tGPsdata>(
"Annotation Drawing Data");
1486 if (gpd ==
nullptr) {
1524 if (p->
gpl ==
nullptr) {
1546 bool has_layer_to_erase =
false;
1551 has_layer_to_erase =
true;
1558 if (has_layer_to_erase ==
false) {
1560 printf(
"Error: Eraser will not be affecting anything (gpencil_paint_init)\n");
1577 if (p->
gpf ==
nullptr) {
1729 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
1742 float viewport_size[4];
1744 immUniform2f(
"viewport_size", viewport_size[2], viewport_size[3]);
1793 if (totpoints < 2) {
1796 const tGPspoint *pt = &points[totpoints - 1];
1804 const float color[3] = {1.0f, 0.39f, 0.39f};
1808 const float radius = 4.0f;
1918 if (event !=
nullptr) {
1953 status.item(
IFACE_(
"Place Next Stroke Vertex"), ICON_MOUSE_LMB);
2003 float last_mouse[2];
2087 if ((dx > 0) || (dy > 0)) {
2125 p->
pressure =
event->tablet.pressure;
2173 mousef[0] = p->
mval[0];
2174 mousef[1] = p->
mval[1];
2214 p->
mval[0] = int(mousef[0]);
2215 p->
mval[1] = int(mousef[1]);
2350 printf(
"\t\t\tGP - wrong area execution abort!\n");
2393 float pt[2], a[2],
b[2];
2394 float factor = 10.0f;
2410 else if (dist >= factor) {
2411 int slices = 2 + int((dist - 1.0) / factor);
2412 float n = 1.0f / slices;
2413 for (
int i = 1;
i < slices;
i++) {
2483 "GPENCIL_OT_layer_annotation_add",
2560 bool in_bounds =
false;
2570 if (current_region) {
2574 p->
region = current_region;
2645 printf(
"\t\t\t\tGP - add error done!\n");
2660 switch (event->
type) {
2736 "Draw Straight Lines",
2737 "Draw straight line segment(s)"},
2742 "Click to place endpoints of straight line segments (connected)"},
2744 {0,
nullptr, 0,
nullptr,
nullptr},
2752 "ARROW_OPEN_INVERTED",
2755 "Use perpendicular segment style"},
2757 {0,
nullptr, 0,
nullptr,
nullptr},
2765 ot->name =
"Annotation Draw";
2766 ot->idname =
"GPENCIL_OT_annotate";
2767 ot->description =
"Make annotations on the active data";
2785 ot->srna,
"arrowstyle_start",
arrow_types, 0,
"Start Arrow Style",
"Stroke start style");
2787 ot->srna,
"arrowstyle_end",
arrow_types, 0,
"End Arrow Style",
"Stroke end style");
2792 "Helper to draw smooth and clean lines. Press Shift for an invert effect "
2793 "(even if this option is not active)");
2795 "stabilizer_factor",
2799 "Stabilizer Stroke Factor",
2800 "Higher values gives a smoother stroke",
2804 "stabilizer_radius",
2808 "Stabilizer Stroke Radius",
2809 "Minimum distance from last point before stroke continues",
2823 "Wait for first click instead of painting immediately");
@ BKE_CB_EVT_ANNOTATION_POST
@ BKE_CB_EVT_ANNOTATION_PRE
void BKE_callback_exec_id_depsgraph(Main *bmain, ID *id, Depsgraph *depsgraph, eCbEvent evt)
bScreen * CTX_wm_screen(const bContext *C)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
struct bGPDstroke * BKE_gpencil_stroke_delete_tagged_points(struct bGPdata *gpd, struct bGPDframe *gpf, struct bGPDstroke *gps, struct bGPDstroke *next_stroke, int tag_flags, bool select, bool flat_cap, int limit)
void BKE_gpencil_free_stroke_weights(struct bGPDstroke *gps)
struct bGPDlayer * BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive, bool add_to_header)
bool BKE_gpencil_layer_is_editable(const struct bGPDlayer *gpl)
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
struct bGPDstroke * BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, bool dup_points, bool dup_curve)
#define GPENCIL_STRENGTH_MIN
struct bGPdata * BKE_gpencil_data_addnew(struct Main *bmain, const char name[])
void BKE_report(ReportList *reports, eReportType type, const char *message)
ARegion * BKE_area_find_region_xy(const ScrArea *area, int regiontype, const int xy[2]) ATTR_NONNULL(3)
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
struct MovieTrackingObject * BKE_tracking_object_get_active(const struct MovieTracking *tracking)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
int interp_sparse_array(float *array, int list_size, float skipval)
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void unit_m4(float m[4][4])
MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f)
MINLINE float len_v2v2_int(const int v1[2], const int v2[2])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_fl(float r[2], float f)
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float normalize_v2(float n[2])
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void copy_v2_fl(float r[2], float f)
bool BLI_rcti_isect_pt_v(const struct rcti *rect, const int xy[2])
bool BLI_rcti_isect_pt(const struct rcti *rect, int x, int y)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Platform independent time functions.
double BLI_time_now_seconds(void)
#define ENUM_OPERATORS(_type, _max)
@ GP_STROKE_ARROWSTYLE_NONE
@ GP_STROKE_ARROWSTYLE_SEGMENT
@ GP_STROKE_ARROWSTYLE_CLOSED
@ GP_STROKE_ARROWSTYLE_OPEN
@ GP_STROKE_ARROWSTYLE_SQUARE
@ GP_STROKE_USE_ARROW_END
@ GP_STROKE_USE_ARROW_START
@ GP_PROJECT_DEPTH_STROKE_ENDPOINTS
@ GP_PROJECT_DEPTH_STROKE
@ GP_PROJECT_DEPTH_ONLY_SELECTED
@ GP_TOOL_FLAG_RETAIN_LAST
@ SEQ_PREVIEW_SHOW_GPENCIL
@ OP_IS_MODAL_CURSOR_REGION
MovieClip * ED_space_clip_get_clip(const SpaceClip *sc)
int ED_space_clip_get_clip_frame_number(const SpaceClip *sc)
bool ED_operator_regionactive(bContext *C)
const rcti * ED_region_visible_rect(ARegion *region)
void ED_region_tag_redraw(ARegion *region)
bool ED_view3d_depth_read_cached(const ViewDepths *vd, const int mval[2], int margin, float *r_depth)
void ED_view3d_win_to_delta(const ARegion *region, const float xy_delta[2], float zfac, float r_out[3], bool precise=false)
bool ED_view3d_depth_read_cached_seg(const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *r_depth)
void ED_view3d_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, bool use_overlay, ViewDepths **r_depths)
float ED_view3d_calc_depth_for_comparison(const RegionView3D *rv3d, const float co[3])
void view3d_region_operator_needs_gpu(ARegion *region)
float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3])
void ED_view3d_depths_free(ViewDepths *depths)
@ V3D_DEPTH_SELECTED_ONLY
bool ED_view3d_autodist_simple(ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
void ED_view3d_calc_camera_border(const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, bool no_shift, rctf *r_viewborder)
bool ED_view3d_depth_unproject_v3(const ARegion *region, const int mval[2], double depth, float r_location_world[3])
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_line_width(float width)
void GPU_line_smooth(bool enable)
void GPU_blend(GPUBlend blend)
void GPU_viewport_size_get_f(float coords[4])
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
#define RNA_BEGIN(sptr, itemptr, propname)
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void GPENCIL_OT_annotate(wmOperatorType *ot)
static void annotation_stroke_arrow_calc_points(tGPspoint *point, const float stroke_dir[2], float corner[2], float stroke_points[8], const int arrow_style)
static short annotation_stroke_addpoint(tGPsdata *p, const float mval[2], float pressure, double curtime)
static void annotation_arrow_create(tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, bGPDstroke *arrow_stroke, const float arrow_points[8], const int style)
static void annotation_arrow_create_square(tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float corner_point[3], const float arrow_points[8])
static bool annotation_stroke_eraser_is_occluded(tGPsdata *p, const bGPDspoint *pt, const int x, const int y)
static void annotation_stroke_eraser_dostroke(tGPsdata *p, bGPDframe *gpf, bGPDstroke *gps, const float mval[2], const int radius, const rcti *rect)
static void annotation_get_3d_reference(tGPsdata *p, float vec[3])
static void annotation_smooth_buffer(tGPsdata *p, float inf, int idx)
static bool annotation_session_initdata(bContext *C, tGPsdata *p)
@ GP_PAINTFLAG_SELECTMASK
@ GP_PAINTFLAG_USE_STABILIZER
@ GP_PAINTFLAG_STROKEADDED
@ GP_PAINTFLAG_V3D_ERASER_DEPTH
@ GP_PAINTFLAG_USE_STABILIZER_TEMP
static void annotation_stroke_end(wmOperator *op)
static void annotation_stroke_newfrombuffer(tGPsdata *p)
static wmOperatorStatus annotation_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool annotation_draw_poll(bContext *C)
static bool annotation_stroke_filtermval(tGPsdata *p, const float mval[2], const float pmval[2])
static void annotation_arrow_create_segm(tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float arrow_points[8])
static void annotation_stroke_added_enable(tGPsdata *p)
static bool annotation_area_exists(bContext *C, ScrArea *area_test)
static void annotation_draw_eraser(bContext *, const blender::int2 &xy, const blender::float2 &, void *p_ptr)
static void annotation_add_missing_events(bContext *C, wmOperator *op, const wmEvent *event, tGPsdata *p)
static void annotation_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Depsgraph *depsgraph)
static void annotation_stroke_arrow_init_point(tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float co[8], const int co_idx)
static void annotation_draw_exit(bContext *C, wmOperator *op)
static void annotation_draw_stabilizer(bContext *C, const blender::int2 &xy, const blender::float2 &, void *p_ptr)
static bool annotation_stroke_added_check(tGPsdata *p)
static void annotation_stroke_arrow_allocate(bGPDstroke *gps, const int totpoints)
static void annotation_stroke_arrow_calc_points_segment(float stroke_points[8], const float ref_point[2], const float dir_cw[2], const float dir_ccw[2], const float length, const float sign)
static void annotation_paint_strokeend(tGPsdata *p)
static void annotation_draw_toggle_stabilizer_cursor(tGPsdata *p, short enable)
static bool annotation_project_check(tGPsdata *p)
static bool annotation_is_tablet_eraser_active(const wmEvent *event)
static void annotation_draw_apply(wmOperator *op, tGPsdata *p, Depsgraph *depsgraph)
static wmOperatorStatus annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
static int annotation_draw_init(bContext *C, wmOperator *op, const wmEvent *event)
static void annotation_session_cleanup(tGPsdata *p)
static void annotation_draw_apply_event(wmOperator *op, const wmEvent *event, Depsgraph *depsgraph, float x, float y)
static void annotation_arrow_create_closed(tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float arrow_points[8])
static tGPsdata * annotation_stroke_begin(bContext *C, wmOperator *op)
static void annotation_draw_cancel(bContext *C, wmOperator *op)
static const EnumPropertyItem arrow_types[]
static void annotation_draw_cursor_set(tGPsdata *p)
static void annotation_draw_status_indicators(bContext *C, tGPsdata *p)
static void annotation_visible_on_space(tGPsdata *p)
static void annotation_arrow_create_open(tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float corner_point[3], const float arrow_points[8])
static void annotation_session_validatebuffer(tGPsdata *p)
static void annotation_stroke_doeraser(tGPsdata *p)
static void annotation_draw_toggle_eraser_cursor(tGPsdata *p, short enable)
static tGPsdata * annotation_session_initpaint(bContext *C)
static void annotation_session_free(tGPsdata *p)
static void annotation_stroke_arrow_init_point_default(bGPDspoint *pt)
static const EnumPropertyItem prop_gpencil_drawmodes[]
static void annotation_free_stroke(bGPDframe *gpf, bGPDstroke *gps)
static void annotation_paint_cleanup(tGPsdata *p)
static wmOperatorStatus annotation_draw_exec(bContext *C, wmOperator *op)
static void annotation_stroke_arrow_init_conv_point(bGPDspoint *pt, const float point[3])
static void annotation_stroke_convertcoords(tGPsdata *p, const blender::float2 mval, float out[3], const float *depth)
BPy_StructRNA * depsgraph
@ GP_PAINTMODE_DRAW_STRAIGHT
void gpencil_point_to_xy(const GP_SpaceConversion *gsc, const bGPDstroke *gps, const bGPDspoint *pt, int *r_x, int *r_y)
bool gpencil_stroke_inside_circle(const float mval[2], int rad, int x0, int y0, int x1, int y1)
bool ED_gpencil_stroke_can_use_direct(const ScrArea *area, const bGPDstroke *gps)
tGPspoint * ED_gpencil_sbuffer_ensure(tGPspoint *buffer_array, int *buffer_size, int *buffer_used, const bool clear)
bGPdata ** ED_annotation_data_get_pointers(const bContext *C, PointerRNA *r_ptr)
float length(VecOp< float, D >) RET
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
struct MovieTracking tracking
MovieTrackingTrack * active_track
struct ToolSettings * toolsettings
struct MDeformVert * dvert
eGPencil_PaintStatus status
eGPencil_PaintModes paintmode
eGPencil_PaintFlags flags
wmEventModifierFlag modifier
struct ReportList * reports
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2])
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
#define ISMOUSE_BUTTON(event_type)
#define ISMOUSE_MOTION(event_type)
#define ISKEYBOARD(event_type)
bool WM_paint_cursor_end(wmPaintCursor *handle)
wmPaintCursor * WM_paint_cursor_activate(short space_type, short region_type, bool(*poll)(bContext *C), wmPaintCursorDraw draw, void *customdata)