From 2f72b91a54faa7cfbdfd97eff608c8911df1d221 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 7 Feb 2010 23:39:44 +0000 Subject: Operator Execution Contexts Bugfix: This commit adds a few more execution contexts for operators, given the increasing tendency for some special regiontypes to exist within areas that must have their own set of special operators. Examples of these include the "channel" operators in the Animation Editors (i.e. those in the 'Channels' menu), and the "Fit to Preview Window" operator for the Sequencer. Previously, operators such as these would not function when clicked on from the menus, and they would not show the hotkeys they were mapped to. Also, fixed a few operator definitions in the Animation Editors which were missing ot->prop defines. This meant that some hotkeys (mainly selection) were shown incorrectly in the menus. --- source/blender/blenkernel/intern/screen.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/blender/blenkernel/intern/screen.c') diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index 0dc6bf359f6..b8ac8d99128 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -336,3 +336,19 @@ unsigned int BKE_screen_visible_layers(bScreen *screen, Scene *scene) return layer; } +/* ***************** Utilities ********************** */ + +/* Find a region of the specified type from the given area */ +ARegion *BKE_area_find_region_type(ScrArea *sa, int type) +{ + if (sa) { + ARegion *ar; + + for (ar=sa->regionbase.first; ar; ar= ar->next) { + if (ar->regiontype == type) + return ar; + } + } + return NULL; +} + -- cgit v1.2.3