Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-08-12 06:17:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-12 06:17:10 +0300
commit444a0202d40705b6a6f21e59e883518be577cf4e (patch)
tree877cb7a3fb50a15a0d3d0cbbc983c0b08f990b40
parentb4b8d3ab0e4519e1eeb4663070aa6c429bde370f (diff)
Gizmo: add blank gizmo definition
Missed from 98c304e865f by accident.
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/blank3d_gizmo.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/source/blender/editors/gizmo_library/gizmo_types/blank3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/blank3d_gizmo.c
index 4dcdb7b7b3f..0c67e8c606d 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/blank3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/blank3d_gizmo.c
@@ -23,6 +23,14 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blank3d_gizmo.c
+ * \ingroup wm
+ *
+ * \name Blank Gizmo
+ *
+ * \brief Gizmo to use as a fallback (catch events).
+ */
+
#include "BLI_math.h"
#include "BKE_context.h"
@@ -37,6 +45,45 @@
#include "../gizmo_geometry.h"
#include "../gizmo_library_intern.h"
+
+static void gizmo_blank_draw(const bContext *UNUSED(C), wmGizmo *UNUSED(gz))
+{
+ /* pass */
+}
+
+static int gizmo_blank_invoke(
+ bContext *UNUSED(C), wmGizmo *UNUSED(gz), const wmEvent *UNUSED(event))
+{
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static int gizmo_blank_test_select(
+ bContext *UNUSED(C), wmGizmo *UNUSED(gz), const int UNUSED(mval[2]))
+{
+ return 0;
+}
+
+/* -------------------------------------------------------------------- */
+/** \name Blank Gizmo API
+ *
+ * \{ */
+
+static void GIZMO_GT_blank_3d(wmGizmoType *gzt)
+{
+ /* identifiers */
+ gzt->idname = "GIZMO_GT_blank_3d";
+
+ /* api callbacks */
+ gzt->draw = gizmo_blank_draw;
+ gzt->invoke = gizmo_blank_invoke;
+ gzt->test_select = gizmo_blank_test_select;
+
+ gzt->struct_size = sizeof(wmGizmo);
+}
+
void ED_gizmotypes_blank_3d(void)
{
+ WM_gizmotype_append(GIZMO_GT_blank_3d);
}
+
+/** \} */