diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-18 09:10:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-18 09:15:06 +0300 |
commit | d421adb83e8d39bd9d74ea3d526326b70e93c341 (patch) | |
tree | 4c5e16b5e2fcd8c587204aa85dde175a6951392a /source/blender/editors/include/ED_gizmo_utils.h | |
parent | 0a3b66cfb573a91ba3b19f30ead4a026bdfa6873 (diff) |
Gizmo: de-duplicate poll logic
Checking the active tool or operator was a common way to check
if the gizmo was still in use.
Diffstat (limited to 'source/blender/editors/include/ED_gizmo_utils.h')
-rw-r--r-- | source/blender/editors/include/ED_gizmo_utils.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_gizmo_utils.h b/source/blender/editors/include/ED_gizmo_utils.h new file mode 100644 index 00000000000..16b460f6ba5 --- /dev/null +++ b/source/blender/editors/include/ED_gizmo_utils.h @@ -0,0 +1,42 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file ED_gizmo_utils.h + * \ingroup editors + * + * \name Generic Gizmo Utilities. + */ + +#ifndef __ED_GIZMO_UTILS_H__ +#define __ED_GIZMO_UTILS_H__ + +struct bContext; +struct wmGizmoGroupType; + +/** Wrapper function (operator name can't be guessed). */ +bool ED_gizmo_poll_or_unlink_delayed_from_operator( + const struct bContext *C, struct wmGizmoGroupType *gzgt, + const char *idname); + +/** Use this as poll function directly for: #wmGizmoGroupType.poll */ +bool ED_gizmo_poll_or_unlink_delayed_from_tool( + const bContext *C, struct wmGizmoGroupType *gzgt); + +#endif /* __ED_GIZMO_UTILS_H__ */ |