Blender V5.0
WM_gizmo_types.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2016 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
13
14#pragma once
15
16#include "BLI_utildefines.h"
17#include "BLI_vector.hh"
18
19#include "DNA_listBase.h"
20
21#include "RNA_types.hh"
22
23struct IDProperty;
24struct wmGizmo;
25struct wmGizmoType;
26struct wmGizmoGroup;
27struct wmGizmoGroupType;
28struct wmGizmoMap;
29struct wmGizmoMapType;
30struct wmGizmoProperty;
32struct wmKeyConfig;
33struct wmOperatorType;
34
35/* -------------------------------------------------------------------- */
36/* Enum Typedef's. */
37
49
50
94
158
160
170
171
185
186/* -------------------------------------------------------------------- */
187/* #wmGizmo. */
188
189
201
202#include "wm_gizmo_fn.hh"
203
209
210 bool is_redo = false;
211};
212
214struct wmGizmo {
216
219
223
226
229
231
234
239
243
249
253
254 /* Transformation of the gizmo in 2d or 3d space.
255 * - Matrix axis are expected to be unit length (scale is applied after).
256 * - Behavior when axis aren't orthogonal depends on each gizmo.
257 * - Typically the +Z is the primary axis for gizmos to use.
258 * - 'matrix[3]' must be used for location,
259 * besides this it's up to the gizmos internal code how the
260 * rotation components are used for drawing and interaction. */
261
263 float matrix_space[4][4];
265 float matrix_basis[4][4];
267 float matrix_offset[4][4];
275 float color[4], color_hi[4];
276
279
283
285
286 /* TODO: Once wmGizmo itself gets an actual constructor, this can most likely become a
287 * `blender::Array`, since length is defined by the gizmo type. */
289
292
294 union {
295 float f;
297};
298
301 const wmGizmoPropertyType *type = nullptr;
302
304 PropertyRNA *prop = nullptr;
305 int index = -1;
306
307 /* Optional functions for converting to/from RNA. */
308 struct {
314 void *user_data = nullptr;
316};
317
330
337
339 short spaceid;
340 short regionid;
341};
342
410
411/* -------------------------------------------------------------------- */
412/* #wmGizmoGroup. */
413
419
476
505
506/* -------------------------------------------------------------------- */
507/* #wmGizmoMap. */
508
518#define WM_GIZMOMAP_DRAWSTEP_MAX 2
unsigned int uint
#define ENUM_OPERATORS(_type, _max)
These structs are the foundation for all linked lists in the library system.
eWM_GizmoFlagMapDrawStep
@ WM_GIZMOMAP_DRAWSTEP_3D
@ WM_GIZMOMAP_DRAWSTEP_2D
eWM_GizmoFlagTweak
Gizmo tweak flag. Bit-flag passed to gizmo while tweaking.
@ WM_GIZMO_TWEAK_PRECISE
@ WM_GIZMO_TWEAK_SNAP
eWM_GizmoFlagMapTypeUpdateFlag
@ WM_GIZMOMAPTYPE_UPDATE_REMOVE
@ WM_GIZMOMAPTYPE_KEYMAP_INIT
@ WM_GIZMOMAPTYPE_UPDATE_INIT
eWM_GizmoFlagGroupInitFlag
@ WM_GIZMOGROUP_INIT_REFRESH
@ WM_GIZMOGROUP_INIT_SETUP
eWM_GizmoFlag
@ WM_GIZMO_DRAW_NO_SCALE
@ WM_GIZMO_HIDDEN
@ WM_GIZMO_HIDDEN_KEYMAP
@ WM_GIZMO_EVENT_HANDLE_ALL
@ WM_GIZMO_OPERATOR_TOOL_INIT
@ WM_GIZMO_DRAW_VALUE
@ WM_GIZMO_MOVE_CURSOR
@ WM_GIZMO_DRAW_MODAL
@ WM_GIZMO_NEEDS_UNDO
@ WM_GIZMO_DRAW_HOVER
@ WM_GIZMO_DRAW_OFFSET_SCALE
@ WM_GIZMO_SELECT_BACKGROUND
@ WM_GIZMO_HIDDEN_SELECT
@ WM_GIZMO_NO_TOOLTIP
eWM_GizmoFlagGroupTypeFlag
@ WM_GIZMOGROUPTYPE_VR_REDRAWS
@ WM_GIZMOGROUPTYPE_DRAW_MODAL_EXCLUDE
@ WM_GIZMOGROUPTYPE_SCALE
@ WM_GIZMOGROUPTYPE_TOOL_INIT
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
@ WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK
@ WM_GIZMOGROUPTYPE_DEPTH_3D
@ WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL
@ WM_GIZMOGROUPTYPE_3D
@ WM_GIZMOGROUPTYPE_PERSISTENT
@ WM_GIZMOGROUPTYPE_SELECT
eWM_GizmoFlagState
@ WM_GIZMO_STATE_HIGHLIGHT
@ WM_GIZMO_STATE_MODAL
@ WM_GIZMO_STATE_SELECT
const PointerRNA PointerRNA_NULL
wmGizmoGroupTypeRef * next
wmGizmoGroupType * type
wmGizmoGroupTypeRef * prev
wmKeyConfig * keyconf
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnMsgBusSubscribe message_subscribe
wmGizmoGroupFnRefresh refresh
wmGizmoGroupFnInit setup
const char * idname
wmGizmoGroupFnInvokePrepare invoke_prepare
wmGizmoMapType_Params gzmap_params
eWM_GizmoFlagGroupTypeFlag flag
eWM_GizmoFlagMapTypeUpdateFlag type_update_flag
ExtensionRNA rna_ext
wmGizmoGroupFnPoll poll
wmGizmoGroupFnDrawPrepare draw_prepare
wmGizmoGroup * prev
eWM_GizmoFlagGroupInitFlag init_flag
wmGizmoMap * parent_gzmap
void(* customdata_free)(void *)
wmGizmoGroupType * type
union wmGizmoGroup::@064376176052321033251226316126272250076156203053 hide
wmGizmoGroup * next
uint delay_refresh_for_tweak
wmOperatorType * type
wmGizmoPropertyType * prev
wmGizmoPropertyType * next
wmGizmoPropertyFnRangeGet range_get_fn
const wmGizmoPropertyType * type
PropertyRNA * prop
wmGizmoPropertyFnGet value_get_fn
wmGizmoPropertyFnSet value_set_fn
struct wmGizmoProperty::@331027022007232055216276241130041346111314317052 custom_func
wmGizmoPropertyFnForeachRNAProp foreach_rna_prop_fn
wmGizmoPropertyFnFree free_fn
StructRNA * srna
wmGizmoFnSelectRefresh select_refresh
wmGizmoFnDraw draw
ExtensionRNA rna_ext
wmGizmoFnModal modal
wmGizmoFnScreenBoundsGet screen_bounds_get
ListBase target_property_defs
wmGizmoFnSetup setup
int target_property_defs_len
wmGizmoFnMatrixBasisGet matrix_basis_get
const char * idname
wmGizmoFnTestSelect test_select
wmGizmoFnExit exit
wmGizmoFnCursorGet cursor_get
wmGizmoFnInvoke invoke
wmGizmoFnFree free
wmGizmoFnDrawSelect draw_select
wmGizmoFnPropertyUpdate property_update
wmGizmoGroup * parent_gzgroup
const wmGizmoType * type
void * interaction_data
eWM_GizmoFlagState state
union wmGizmo::@212020261060256366012217133260074053150351165313 temp
float matrix_basis[4][4]
void * py_instance
blender::Vector< wmGizmoProperty, 0 > target_properties
float select_bias
float matrix_offset[4][4]
blender::Vector< wmGizmoOpElem, 4 > op_data
wmGizmo * prev
float color_hi[4]
float scale_final
float color[4]
IDProperty * properties
PointerRNA * ptr
float scale_basis
wmGizmo * next
float matrix_space[4][4]
float line_width
eWM_GizmoFlag flag
wmKeyMap * keymap
wmGizmoFnModal custom_modal
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