Blender  V3.3
wm_gizmo_intern.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #pragma once
8 
9 struct BLI_Buffer;
10 struct wmGizmoMap;
11 struct wmKeyConfig;
12 
13 #include "wm_gizmo_fn.h"
14 
15 /* -------------------------------------------------------------------- */
16 /* wmGizmo */
17 
25  struct wmGizmoMap *gzmap, struct wmGizmo *gz, bool select, bool use_array, bool use_callback);
26 bool wm_gizmo_select_and_highlight(bContext *C, struct wmGizmoMap *gzmap, struct wmGizmo *gz);
27 
28 void wm_gizmo_calculate_scale(struct wmGizmo *gz, const bContext *C);
29 void wm_gizmo_update(struct wmGizmo *gz, const bContext *C, bool refresh_map);
30 
31 int wm_gizmo_is_visible(struct wmGizmo *gz);
32 enum {
35 };
36 
37 /* -------------------------------------------------------------------- */
38 /* wmGizmoGroup */
39 
40 enum {
47 };
48 
53  struct wmGizmoGroupType *gzgt);
54 void wm_gizmogroup_free(bContext *C, struct wmGizmoGroup *gzgroup);
58 void wm_gizmogroup_gizmo_register(struct wmGizmoGroup *gzgroup, struct wmGizmo *gz);
60  const struct wmGizmoGroupType *gzgt);
62  const struct wmGizmoGroup *gzgroup,
63  struct bContext *C,
64  int event_modifier,
65  const int mval[2],
66  int *r_part);
72  const struct wmGizmoGroup *gzgroup,
73  int event_modifier,
74  struct BLI_Buffer *visible_gizmos);
76  eWM_GizmoFlagMapDrawStep drawstep);
77 
78 void wm_gizmogrouptype_setup_keymap(struct wmGizmoGroupType *gzgt, struct wmKeyConfig *keyconf);
79 
81 
82 /* -------------------------------------------------------------------- */
83 /* wmGizmoMap */
84 
85 typedef struct wmGizmoMapSelectState {
86  struct wmGizmo **items;
87  int len, len_alloc;
89 
90 struct wmGizmoMap {
91 
93  ListBase groups; /* wmGizmoGroup */
94 
95  /* private, update tagging (enum defined in C source). */
97 
99  bool is_init;
100 
103 
110  struct {
111  /* we redraw the gizmo-map when this changes */
113  /* User has clicked this gizmo and it gets all input. */
114  struct wmGizmo *modal;
115  /* array for all selected gizmos */
117  /* cursor location at point of entering modal (see: WM_GIZMO_MOVE_CURSOR) */
118  int event_xy[2];
120  /* until we have nice cursor push/pop API. */
123 };
124 
134  /* types of gizmo-groups for this gizmo-map type */
136 
137  /* eGizmoMapTypeUpdateFlags */
139 };
140 
141 void wm_gizmomap_select_array_clear(struct wmGizmoMap *gzmap);
146 bool wm_gizmomap_deselect_all(struct wmGizmoMap *gzmap);
147 void wm_gizmomap_select_array_shrink(struct wmGizmoMap *gzmap, int len_subtract);
148 void wm_gizmomap_select_array_push_back(struct wmGizmoMap *gzmap, wmGizmo *gz);
149 void wm_gizmomap_select_array_remove(struct wmGizmoMap *gzmap, wmGizmo *gz);
#define C
Definition: RandGen.cpp:25
eWM_GizmoFlagMapDrawStep
eWM_GizmoFlagMapTypeUpdateFlag
#define WM_GIZMOMAP_DRAWSTEP_MAX
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: avxb.h:154
struct wmGizmo ** items
struct wmGizmoMapType * next
eWM_GizmoFlagMapTypeUpdateFlag type_update_flag
ListBase grouptype_refs
struct wmGizmoMapType * prev
char update_flag[WM_GIZMOMAP_DRAWSTEP_MAX]
struct wmGizmoMapType * type
bool tag_remove_group
ListBase groups
struct wmGizmo * modal
short event_grabcursor
struct wmGizmo * highlight
struct wmGizmoMapSelectState select
struct wmGizmoMap::@1182 gzmap_context
Gizmo map runtime context.
void wm_gizmogroup_gizmo_register(struct wmGizmoGroup *gzgroup, struct wmGizmo *gz)
bool wm_gizmo_select_set_ex(struct wmGizmoMap *gzmap, struct wmGizmo *gz, bool select, bool use_array, bool use_callback)
Definition: wm_gizmo.c:357
@ TWEAK_MODAL_PRECISION_ON
@ TWEAK_MODAL_SNAP_ON
@ TWEAK_MODAL_PRECISION_OFF
@ TWEAK_MODAL_CONFIRM
@ TWEAK_MODAL_SNAP_OFF
@ TWEAK_MODAL_CANCEL
struct wmGizmoGroup * wm_gizmogroup_new_from_type(struct wmGizmoMap *gzmap, struct wmGizmoGroupType *gzgt)
void wm_gizmo_calculate_scale(struct wmGizmo *gz, const bContext *C)
Definition: wm_gizmo.c:433
@ WM_GIZMO_IS_VISIBLE_DRAW
@ WM_GIZMO_IS_VISIBLE_UPDATE
bool wm_gizmomap_deselect_all(struct wmGizmoMap *gzmap)
Definition: wm_gizmo_map.c:855
wmKeyMap * wm_gizmogroup_tweak_modal_keymap(struct wmKeyConfig *keyconf)
void wm_gizmogroup_free(bContext *C, struct wmGizmoGroup *gzgroup)
int wm_gizmo_is_visible(struct wmGizmo *gz)
Definition: wm_gizmo.c:482
void wm_gizmomap_select_array_shrink(struct wmGizmoMap *gzmap, int len_subtract)
Definition: wm_gizmo_map.c:103
struct wmGizmo * wm_gizmogroup_find_intersected_gizmo(wmWindowManager *wm, const struct wmGizmoGroup *gzgroup, struct bContext *C, int event_modifier, const int mval[2], int *r_part)
void wm_gizmogrouptype_setup_keymap(struct wmGizmoGroupType *gzgt, struct wmKeyConfig *keyconf)
void wm_gizmomap_select_array_clear(struct wmGizmoMap *gzmap)
Definition: wm_gizmo_map.c:95
bool wm_gizmo_select_and_highlight(bContext *C, struct wmGizmoMap *gzmap, struct wmGizmo *gz)
Definition: wm_gizmo.c:407
void wm_gizmogroup_intersectable_gizmos_to_list(wmWindowManager *wm, const struct wmGizmoGroup *gzgroup, int event_modifier, struct BLI_Buffer *visible_gizmos)
struct wmGizmoMapSelectState wmGizmoMapSelectState
bool wm_gizmogroup_is_visible_in_drawstep(const struct wmGizmoGroup *gzgroup, eWM_GizmoFlagMapDrawStep drawstep)
void wm_gizmomap_select_array_remove(struct wmGizmoMap *gzmap, wmGizmo *gz)
Definition: wm_gizmo_map.c:129
struct wmGizmoGroup * wm_gizmogroup_find_by_type(const struct wmGizmoMap *gzmap, const struct wmGizmoGroupType *gzgt)
void wm_gizmo_update(struct wmGizmo *gz, const bContext *C, bool refresh_map)
Definition: wm_gizmo.c:474
void wm_gizmomap_select_array_push_back(struct wmGizmoMap *gzmap, wmGizmo *gz)
Definition: wm_gizmo_map.c:118