Blender V5.0
wm_gizmo_fn.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#pragma once
12
13#include "DNA_windowmanager_enums.h" /* For `wmOperatorStatus`. */
14
15struct bContext;
16struct rcti;
17struct wmEvent;
18struct wmGizmo;
19struct wmGizmoGroup;
20struct wmGizmoGroupType;
21struct wmGizmoProperty;
22struct wmKeyConfig;
23struct wmKeyMap;
24struct wmMsgBus;
25
26/* #wmGizmoGroup. */
27using wmGizmoGroupFnPoll = bool (*)(const bContext *, wmGizmoGroupType *);
28using wmGizmoGroupFnInit = void (*)(const bContext *, wmGizmoGroup *);
29using wmGizmoGroupFnRefresh = void (*)(const bContext *, wmGizmoGroup *);
30using wmGizmoGroupFnDrawPrepare = void (*)(const bContext *, wmGizmoGroup *);
31using wmGizmoGroupFnInvokePrepare = void (*)(const bContext *,
33 wmGizmo *,
34 const wmEvent *);
37
38/* #wmGizmo. */
39/* See: wmGizmoType for docs on each type. */
40
41using wmGizmoFnSetup = void (*)(wmGizmo *);
42using wmGizmoFnDraw = void (*)(const bContext *, wmGizmo *);
43using wmGizmoFnDrawSelect = void (*)(const bContext *, wmGizmo *, int);
44using wmGizmoFnTestSelect = int (*)(bContext *, wmGizmo *, const int mval[2]);
46 wmGizmo *,
47 const wmEvent *,
50using wmGizmoFnMatrixBasisGet = void (*)(const wmGizmo *, float[4][4]);
52using wmGizmoFnExit = void (*)(bContext *, wmGizmo *, const bool);
53using wmGizmoFnCursorGet = int (*)(wmGizmo *);
54using wmGizmoFnScreenBoundsGet = bool (*)(bContext *, wmGizmo *, rcti *r_bounding_box);
55using wmGizmoFnSelectRefresh = void (*)(wmGizmo *);
56using wmGizmoFnFree = void (*)(wmGizmo *);
57
58/* #wmGizmoProperty ('value' type defined by 'wmGizmoProperty.data_type'). */
59using wmGizmoPropertyFnGet = void (*)(const wmGizmo *,
61 /* Typically `float *`. */
62 void *value);
63using wmGizmoPropertyFnSet = void (*)(const wmGizmo *,
65 /* Typically `const float *`. */
66 const void *value);
67using wmGizmoPropertyFnRangeGet = void (*)(const wmGizmo *,
69 /* Typically `float[2]`. */
70 void *range);
71/* To inspect the RNA properties gizmos are manipulating (can be multiple). Used e.g. for
72 * autokeying. */
75 const blender::FunctionRef<void(PointerRNA &ptr, PropertyRNA *prop, int index)> callback);
76
77using wmGizmoPropertyFnFree = void (*)(const wmGizmo *, wmGizmoProperty *);
78
eWM_GizmoFlagTweak
Gizmo tweak flag. Bit-flag passed to gizmo while tweaking.
wmGizmoPropertyFnGet value_get_fn
wmGizmoPropertyFnRangeGet range_get_fn
wmGizmoPropertyFnFree free_fn
wmGizmoPropertyFnForeachRNAProp foreach_rna_prop_fn
wmGizmoPropertyFnSet value_set_fn
PointerRNA * ptr
Definition wm_files.cc:4238
int(*)(bContext *, wmGizmo *, const int mval[2]) wmGizmoFnTestSelect
void(*)(wmGizmo *, wmGizmoProperty *) wmGizmoFnPropertyUpdate
void(*)(bContext *, wmGizmo *, const bool) wmGizmoFnExit
void(*)(const bContext *, wmGizmo *) wmGizmoFnDraw
bool(*)(const bContext *, wmGizmoGroupType *) wmGizmoGroupFnPoll
wmOperatorStatus(*)(bContext *, wmGizmo *, const wmEvent *) wmGizmoFnInvoke
void(*)( wmGizmoProperty *, const blender::FunctionRef< void(PointerRNA &ptr, PropertyRNA *prop, int index)> callback) wmGizmoPropertyFnForeachRNAProp
void(*)(wmGizmo *) wmGizmoFnSelectRefresh
void(*)(const bContext *, wmGizmoGroup *) wmGizmoGroupFnRefresh
void(*)(const bContext *, wmGizmoGroup *, wmGizmo *, const wmEvent *) wmGizmoGroupFnInvokePrepare
void(*)(const bContext *, wmGizmoGroup *, wmMsgBus *) wmGizmoGroupFnMsgBusSubscribe
void(*)(wmGizmo *) wmGizmoFnSetup
void(*)(wmGizmo *) wmGizmoFnFree
void(*)(const wmGizmo *, wmGizmoProperty *, void *value) wmGizmoPropertyFnGet
void(*)(const wmGizmo *, float[4][4]) wmGizmoFnMatrixBasisGet
void(*)(const wmGizmo *, wmGizmoProperty *, const void *value) wmGizmoPropertyFnSet
wmKeyMap *(*)(const wmGizmoGroupType *, wmKeyConfig *) wmGizmoGroupFnSetupKeymap
int(*)(wmGizmo *) wmGizmoFnCursorGet
void(*)(const wmGizmo *, wmGizmoProperty *, void *range) wmGizmoPropertyFnRangeGet
void(*)(const bContext *, wmGizmoGroup *) wmGizmoGroupFnDrawPrepare
void(*)(const bContext *, wmGizmoGroup *) wmGizmoGroupFnInit
bool(*)(bContext *, wmGizmo *, rcti *r_bounding_box) wmGizmoFnScreenBoundsGet
void(*)(const bContext *, wmGizmo *, int) wmGizmoFnDrawSelect
void(*)(const wmGizmo *, wmGizmoProperty *) wmGizmoPropertyFnFree
wmOperatorStatus(*)(bContext *, wmGizmo *, const wmEvent *, eWM_GizmoFlagTweak) wmGizmoFnModal