Blender V4.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
11#include <cstring>
12
13#include "BLI_utildefines.h"
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
26 wmGizmoGroupType *gzgt,
27 const char *idname)
28{
29#if 0
30 /* Causes selection to continue showing the last gizmo. */
32#else
34 wmOperator *op = static_cast<wmOperator *>(wm->operators.last);
35#endif
36
37 if (op == nullptr || !STREQ(op->type->idname, idname)) {
39 return false;
40 }
41 return true;
42}
43
45 wmGizmoGroupType *gzgt,
46 const char *gzgt_idname)
47{
49 if ((tref_rt == nullptr) || !STREQ(gzgt_idname, tref_rt->gizmo_group)) {
50 ScrArea *area = CTX_wm_area(C);
53 if (gzgt->users == 0) {
55 }
56 return false;
57 }
58 return true;
59}
60
ScrArea * CTX_wm_area(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
#define STREQ(a, b)
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)
bool ED_gizmo_poll_or_unlink_delayed_from_tool_ex(const bContext *C, wmGizmoGroupType *gzgt, const char *gzgt_idname)
void * last
const char * idname
wmGizmoMapType_Params gzmap_params
const char * idname
Definition WM_types.hh:992
struct wmOperatorType * type
void WM_gizmo_group_type_unlink_delayed_ptr(wmGizmoGroupType *gzgt)
void WM_gizmo_group_unlink_delayed_ptr_from_space(wmGizmoGroupType *gzgt, wmGizmoMapType *gzmap_type, ScrArea *area)
wmGizmoMapType * WM_gizmomaptype_ensure(const wmGizmoMapType_Params *gzmap_params)
wmOperator * WM_operator_last_redo(const bContext *C)
bToolRef_Runtime * WM_toolsystem_runtime_from_context(const bContext *C)