Blender V5.3
gizmo_utils.cc
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#include <cstring>
12
13#include "BLI_utildefines.hh"
14
15#include "BKE_context.hh"
16
17#include "DNA_workspace_types.h"
18
19#include "WM_api.hh"
20#include "WM_toolsystem.hh"
21#include "WM_types.hh"
22
23#include "ED_gizmo_utils.hh"
24
25namespace blender {
26
28 wmGizmoGroupType *gzgt,
29 const char *idname)
30{
31#if 0
32 /* Causes selection to continue showing the last gizmo. */
34#else
36 wmOperator *op = wm->runtime->operators.last();
37#endif
38
39 if (op == nullptr || !STREQ(op->type->idname, idname)) {
41 return false;
42 }
43 return true;
44}
45
47 wmGizmoGroupType *gzgt,
48 const char *gzgt_idname)
49{
51 if ((tref_rt == nullptr) || !STREQ(gzgt_idname, tref_rt->gizmo_group)) {
52 ScrArea *area = CTX_wm_area(C);
55 if (gzgt->users == 0) {
57 }
58 return false;
59 }
60 return true;
61}
62
67
68} // namespace blender
#define C
Definition RandGen.cpp:29
#define STREQ(a, b)
BMesh Iterators.
bool ED_gizmo_poll_or_unlink_delayed_from_tool_ex(const bContext *C, wmGizmoGroupType *gzgt, const char *gzgt_idname)
ScrArea * CTX_wm_area(const bContext *C)
void WM_gizmo_group_unlink_delayed_ptr_from_space(wmGizmoGroupType *gzgt, wmGizmoMapType *gzmap_type, ScrArea *area)
void WM_gizmo_group_type_unlink_delayed_ptr(wmGizmoGroupType *gzgt)
bToolRef_Runtime * WM_toolsystem_runtime_from_context(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
wmGizmoMapType * WM_gizmomaptype_ensure(const wmGizmoMapType_Params *gzmap_params)
wmOperator * WM_operator_last_redo(const bContext *C)
bool ED_gizmo_poll_or_unlink_delayed_from_tool(const bContext *C, wmGizmoGroupType *gzgt)
bool ED_gizmo_poll_or_unlink_delayed_from_operator(const bContext *C, wmGizmoGroupType *gzgt, const char *idname)
wmGizmoMapType_Params gzmap_params
struct wmOperatorType * type