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:
authorSergey Sharybin <sergey@blender.org>2020-08-12 13:12:29 +0300
committerSergey Sharybin <sergey@blender.org>2020-08-13 16:24:21 +0300
commit0df28e8c2044ece017c0a283625aba058c7ff5be (patch)
treedac1af8235161e8a10bbaabbec81d05f0ef8b4bb /source/blender/blenkernel/BKE_screen.h
parentc27123632bb4e40a36785dea148dcf0a00dce019 (diff)
View2D: Inform region type on current view changes
Allows to hook per-space code which is to be run on view navigation. This is required to have zoom-to-fit implemented in the sequencer. There might be more cases where the clalback is to be called from, but it could be easier to address those on the case-by-case basis when its needed.
Diffstat (limited to 'source/blender/blenkernel/BKE_screen.h')
-rw-r--r--source/blender/blenkernel/BKE_screen.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index edab543fc37..1090deae93f 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -183,6 +183,16 @@ typedef struct ARegionType {
/* return context data */
int (*context)(const struct bContext *C, const char *member, struct bContextDataResult *result);
+ /* Is called whenever the current visible View2D's region changes.
+ *
+ * Used from user code such as view navigation/zoom operators to inform region about changes.
+ * The goal is to support zoom-to-fit features which gets disabled when manual navigation is
+ * performed.
+ *
+ * This callback is not called on indirect changes of the current viewport (which could happen
+ * when the `v2d->tot is changed and `cur` is adopted accordingly). */
+ void (*on_view2d_changed)(const struct bContext *C, struct ARegion *region);
+
/* custom drawing callbacks */
ListBase drawcalls;