Blender  V2.93
gizmo_utils.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
23 #include <string.h>
24 
25 #include "BLI_utildefines.h"
26 
27 #include "BKE_context.h"
28 
29 #include "DNA_workspace_types.h"
30 
31 #include "WM_api.h"
32 #include "WM_toolsystem.h"
33 #include "WM_types.h"
34 
35 #include "ED_gizmo_utils.h"
36 
38  wmGizmoGroupType *gzgt,
39  const char *idname)
40 {
41 #if 0
42  /* Causes selection to continue showing the last gizmo. */
44 #else
46  wmOperator *op = wm->operators.last;
47 #endif
48 
49  if (op == NULL || !STREQ(op->type->idname, idname)) {
51  return false;
52  }
53  return true;
54 }
55 
57  wmGizmoGroupType *gzgt,
58  const char *gzgt_idname)
59 {
61  if ((tref_rt == NULL) || !STREQ(gzgt_idname, tref_rt->gizmo_group)) {
65  if (gzgt->users == 0) {
67  }
68  return false;
69  }
70  return true;
71 }
72 
75 {
77 }
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:714
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:689
#define STREQ(a, b)
#define C
Definition: RandGen.cpp:39
bool ED_gizmo_poll_or_unlink_delayed_from_tool(const bContext *C, wmGizmoGroupType *gzgt)
Definition: gizmo_utils.c:74
bool ED_gizmo_poll_or_unlink_delayed_from_operator(const bContext *C, wmGizmoGroupType *gzgt, const char *idname)
Definition: gizmo_utils.c:37
bool ED_gizmo_poll_or_unlink_delayed_from_tool_ex(const bContext *C, wmGizmoGroupType *gzgt, const char *gzgt_idname)
Definition: gizmo_utils.c:56
static void area(int d1, int d2, int e1, int e2, float weights[2])
void * last
Definition: DNA_listBase.h:47
const char * idname
struct wmGizmoMapType_Params gzmap_params
const char * idname
Definition: WM_types.h:723
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 struct wmGizmoMapType_Params *gzmap_params)
wmOperator * WM_operator_last_redo(const bContext *C)
struct bToolRef_Runtime * WM_toolsystem_runtime_from_context(struct bContext *C)
Definition: wm_toolsystem.c:91