diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-08-18 07:21:55 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-08-18 07:22:18 +0300 |
commit | b10d0058d72da3051895481ae5830a7b668b7d80 (patch) | |
tree | 987bcae7e565745b1371e60c7d74ffce2668aac7 /source/blender/editors/space_image | |
parent | a195dd15d4373ff0e240566795ff7795ca7485e6 (diff) |
NDOF: compile 3D mouse code only if WITH_INPUT_NDOF
When WITH_INPUT_NDOF is disabled, 3D mouse handling code is removed
from:
- GHOST (was mostly done, finished the job)
- window manager
- various editors
- RNA
- keymaps
The input tab of user prefs does not show 3D mouse settings. Key map
editor does not show NDOF mappings.
DNA does not change.
On my Mac the compiled binary is 42KB smaller after this change. It
runs fine WITH_INPUT_NDOF on or off.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 4 |
3 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h index 69993c3be65..52d04ad4956 100644 --- a/source/blender/editors/space_image/image_intern.h +++ b/source/blender/editors/space_image/image_intern.h @@ -64,7 +64,9 @@ void IMAGE_OT_view_zoom_in(struct wmOperatorType *ot); void IMAGE_OT_view_zoom_out(struct wmOperatorType *ot); void IMAGE_OT_view_zoom_ratio(struct wmOperatorType *ot); void IMAGE_OT_view_zoom_border(struct wmOperatorType *ot); +#ifdef WITH_INPUT_NDOF void IMAGE_OT_view_ndof(struct wmOperatorType *ot); +#endif void IMAGE_OT_new(struct wmOperatorType *ot); void IMAGE_OT_open(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 1158e692182..f9d76da9f87 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -656,6 +656,7 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN); } +#ifdef WITH_INPUT_NDOF /********************** NDOF operator *********************/ /* Combined pan/zoom from a 3D mouse device. @@ -705,6 +706,7 @@ void IMAGE_OT_view_ndof(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_LOCK_BYPASS; } +#endif /* WITH_INPUT_NDOF */ /********************** view all operator *********************/ diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 35a658eac23..6ddf78290aa 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -235,7 +235,9 @@ static void image_operatortypes(void) WM_operatortype_append(IMAGE_OT_view_zoom_out); WM_operatortype_append(IMAGE_OT_view_zoom_ratio); WM_operatortype_append(IMAGE_OT_view_zoom_border); +#ifdef WITH_INPUT_NDOF WM_operatortype_append(IMAGE_OT_view_ndof); +#endif WM_operatortype_append(IMAGE_OT_new); WM_operatortype_append(IMAGE_OT_open); @@ -296,8 +298,10 @@ static void image_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "IMAGE_OT_view_pan", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_pan", MOUSEPAN, 0, 0, 0); +#ifdef WITH_INPUT_NDOF WM_keymap_add_item(keymap, "IMAGE_OT_view_all", NDOF_BUTTON_FIT, KM_PRESS, 0, 0); // or view selected? WM_keymap_add_item(keymap, "IMAGE_OT_view_ndof", NDOF_MOTION, 0, 0, 0); +#endif WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_in", WHEELINMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_out", WHEELOUTMOUSE, KM_PRESS, 0, 0); |