Blender  V2.93
wm_gizmo_fn.h
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 #pragma once
24 
25 #include "BLI_compiler_attrs.h"
26 
27 struct wmMsgBus;
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /* wmGizmoGroup */
34 typedef bool (*wmGizmoGroupFnPoll)(const struct bContext *,
36 typedef void (*wmGizmoGroupFnInit)(const struct bContext *, struct wmGizmoGroup *);
37 typedef void (*wmGizmoGroupFnRefresh)(const struct bContext *, struct wmGizmoGroup *);
38 typedef void (*wmGizmoGroupFnDrawPrepare)(const struct bContext *, struct wmGizmoGroup *);
39 typedef void (*wmGizmoGroupFnInvokePrepare)(const struct bContext *,
40  struct wmGizmoGroup *,
41  struct wmGizmo *,
42  const struct wmEvent *);
43 typedef struct wmKeyMap *(*wmGizmoGroupFnSetupKeymap)(const struct wmGizmoGroupType *,
45 typedef void (*wmGizmoGroupFnMsgBusSubscribe)(const struct bContext *,
46  struct wmGizmoGroup *,
47  struct wmMsgBus *);
48 
49 /* wmGizmo */
50 /* See: wmGizmoType for docs on each type. */
51 
52 typedef void (*wmGizmoFnSetup)(struct wmGizmo *);
53 typedef void (*wmGizmoFnDraw)(const struct bContext *, struct wmGizmo *);
54 typedef void (*wmGizmoFnDrawSelect)(const struct bContext *, struct wmGizmo *, int);
55 typedef int (*wmGizmoFnTestSelect)(struct bContext *, struct wmGizmo *, const int mval[2]);
56 typedef int (*wmGizmoFnModal)(struct bContext *,
57  struct wmGizmo *,
58  const struct wmEvent *,
60 typedef void (*wmGizmoFnPropertyUpdate)(struct wmGizmo *, struct wmGizmoProperty *);
61 typedef void (*wmGizmoFnMatrixBasisGet)(const struct wmGizmo *, float[4][4]);
62 typedef int (*wmGizmoFnInvoke)(struct bContext *, struct wmGizmo *, const struct wmEvent *);
63 typedef void (*wmGizmoFnExit)(struct bContext *, struct wmGizmo *, const bool);
64 typedef int (*wmGizmoFnCursorGet)(struct wmGizmo *);
65 typedef bool (*wmGizmoFnScreenBoundsGet)(struct bContext *,
66  struct wmGizmo *,
67  rcti *r_bounding_box) ATTR_WARN_UNUSED_RESULT;
68 typedef void (*wmGizmoFnSelectRefresh)(struct wmGizmo *);
69 typedef void (*wmGizmoFnFree)(struct wmGizmo *);
70 
71 /* wmGizmoProperty ('value' type defined by 'wmGizmoProperty.data_type') */
72 typedef void (*wmGizmoPropertyFnGet)(const struct wmGizmo *,
73  struct wmGizmoProperty *,
74  /* typically 'float *' */
75  void *value);
76 typedef void (*wmGizmoPropertyFnSet)(const struct wmGizmo *,
77  struct wmGizmoProperty *,
78  /* typically 'const float *' */
79  const void *value);
80 typedef void (*wmGizmoPropertyFnRangeGet)(const struct wmGizmo *,
81  struct wmGizmoProperty *,
82  /* typically 'float[2]' */
83  void *range);
84 typedef void (*wmGizmoPropertyFnFree)(const struct wmGizmo *, struct wmGizmoProperty *);
85 
86 typedef struct wmGizmoPropertyFnParams {
91  void *user_data;
93 
94 #ifdef __cplusplus
95 }
96 #endif
void BLI_kdtree_nd_() int BLI_kdtree_nd_() int BLI_kdtree_nd_() int BLI_kdtree_nd_() ATTR_WARN_UNUSED_RESULT
eWM_GizmoFlagTweak
Gizmo tweak flag. Bitflag passed to gizmo while tweaking.
wmGizmoPropertyFnGet value_get_fn
Definition: wm_gizmo_fn.h:87
wmGizmoPropertyFnRangeGet range_get_fn
Definition: wm_gizmo_fn.h:89
wmGizmoPropertyFnFree free_fn
Definition: wm_gizmo_fn.h:90
wmGizmoPropertyFnSet value_set_fn
Definition: wm_gizmo_fn.h:88
void(* wmGizmoFnMatrixBasisGet)(const struct wmGizmo *, float[4][4])
Definition: wm_gizmo_fn.h:61
void(* wmGizmoPropertyFnRangeGet)(const struct wmGizmo *, struct wmGizmoProperty *, void *range)
Definition: wm_gizmo_fn.h:80
struct wmGizmoPropertyFnParams wmGizmoPropertyFnParams
int(* wmGizmoFnInvoke)(struct bContext *, struct wmGizmo *, const struct wmEvent *)
Definition: wm_gizmo_fn.h:62
void(* wmGizmoFnSetup)(struct wmGizmo *)
Definition: wm_gizmo_fn.h:52
void(* wmGizmoFnSelectRefresh)(struct wmGizmo *)
Definition: wm_gizmo_fn.h:68
bool(* wmGizmoGroupFnPoll)(const struct bContext *, struct wmGizmoGroupType *) ATTR_WARN_UNUSED_RESULT
Definition: wm_gizmo_fn.h:34
void(* wmGizmoGroupFnDrawPrepare)(const struct bContext *, struct wmGizmoGroup *)
Definition: wm_gizmo_fn.h:38
int(* wmGizmoFnCursorGet)(struct wmGizmo *)
Definition: wm_gizmo_fn.h:64
void(* wmGizmoFnPropertyUpdate)(struct wmGizmo *, struct wmGizmoProperty *)
Definition: wm_gizmo_fn.h:60
int(* wmGizmoFnModal)(struct bContext *, struct wmGizmo *, const struct wmEvent *, eWM_GizmoFlagTweak)
Definition: wm_gizmo_fn.h:56
void(* wmGizmoPropertyFnFree)(const struct wmGizmo *, struct wmGizmoProperty *)
Definition: wm_gizmo_fn.h:84
bool(* wmGizmoFnScreenBoundsGet)(struct bContext *, struct wmGizmo *, rcti *r_bounding_box) ATTR_WARN_UNUSED_RESULT
Definition: wm_gizmo_fn.h:65
void(* wmGizmoFnDrawSelect)(const struct bContext *, struct wmGizmo *, int)
Definition: wm_gizmo_fn.h:54
void(* wmGizmoGroupFnMsgBusSubscribe)(const struct bContext *, struct wmGizmoGroup *, struct wmMsgBus *)
Definition: wm_gizmo_fn.h:45
void(* wmGizmoGroupFnRefresh)(const struct bContext *, struct wmGizmoGroup *)
Definition: wm_gizmo_fn.h:37
void(* wmGizmoPropertyFnSet)(const struct wmGizmo *, struct wmGizmoProperty *, const void *value)
Definition: wm_gizmo_fn.h:76
void(* wmGizmoFnFree)(struct wmGizmo *)
Definition: wm_gizmo_fn.h:69
void(* wmGizmoGroupFnInvokePrepare)(const struct bContext *, struct wmGizmoGroup *, struct wmGizmo *, const struct wmEvent *)
Definition: wm_gizmo_fn.h:39
void(* wmGizmoFnExit)(struct bContext *, struct wmGizmo *, const bool)
Definition: wm_gizmo_fn.h:63
void(* wmGizmoFnDraw)(const struct bContext *, struct wmGizmo *)
Definition: wm_gizmo_fn.h:53
int(* wmGizmoFnTestSelect)(struct bContext *, struct wmGizmo *, const int mval[2])
Definition: wm_gizmo_fn.h:55
void(* wmGizmoPropertyFnGet)(const struct wmGizmo *, struct wmGizmoProperty *, void *value)
Definition: wm_gizmo_fn.h:72
void(* wmGizmoGroupFnInit)(const struct bContext *, struct wmGizmoGroup *)
Definition: wm_gizmo_fn.h:36