|
Blender V4.3
|
#include <Python.h>#include "BLI_listbase.h"#include "BLI_utildefines.h"#include "BKE_context.hh"#include "BKE_main.hh"#include "BKE_screen.hh"#include "BKE_workspace.hh"#include "WM_api.hh"#include "WM_types.hh"#include "bpy_rna_context.hh"#include "../generic/python_compat.hh"#include "RNA_access.hh"#include "RNA_prototypes.hh"#include "bpy_rna.hh"Go to the source code of this file.
Classes | |
| struct | ContextStore |
| struct | BPyContextTempOverride |
Functions | |
Private Utility Functions | |
| static void | bpy_rna_context_temp_set_screen_for_window (bContext *C, wmWindow *win, bScreen *screen) |
| static bool | wm_check_screen_switch_supported (const bScreen *screen) |
| static bool | wm_check_window_exists (const Main *bmain, const wmWindow *win) |
| static bool | wm_check_screen_exists (const Main *bmain, const bScreen *screen) |
| static bool | wm_check_area_exists (const wmWindow *win, const bScreen *screen, const ScrArea *area) |
| static bool | wm_check_region_exists (const bScreen *screen, const ScrArea *area, const ARegion *region) |
Context Temporary Override Method | |
| static PyObject * | bpy_context_temp_override_extract_known_args (const char *const *kwds_static, PyObject *kwds) |
| PyDoc_STRVAR (bpy_context_temp_override_doc, ".. method:: temp_override(*, window=None, area=None, region=None, **keywords)\n" "\n" " Context manager to temporarily override members in the context.\n" "\n" " :arg window: Window override or None.\n" " :type window: :class:`bpy.types.Window`\n" " :arg screen: Screen override or None.\n" "\n" " .. note:: Switching to or away from full-screen areas & temporary screens " "isn't supported. Passing in these screens will raise an exception, " "actions that leave the context such screens won't restore the prior screen.\n" "\n" " .. note:: Changing the screen has wider implications " "than other arguments as it will also change the works-space " "and potentially the scene (when pinned).\n" "\n" " :type screen: :class:`bpy.types.Screen`\n" " :arg area: Area override or None.\n" " :type area: :class:`bpy.types.Area`\n" " :arg region: Region override or None.\n" " :type region: :class:`bpy.types.Region`\n" " :arg keywords: Additional keywords override context members.\n" " :return: The context manager .\n" " :rtype: ContextTempOverride\n") | |
| static PyObject * | bpy_context_temp_override (PyObject *self, PyObject *args, PyObject *kwds) |
Temporary Context Override (Python Context Manager) | |
| static PyMethodDef | bpy_rna_context_temp_override__tp_methods [] |
| static PyTypeObject | BPyContextTempOverride_Type |
| static void | bpy_rna_context_temp_override__tp_dealloc (BPyContextTempOverride *self) |
| static PyObject * | bpy_rna_context_temp_override_enter (BPyContextTempOverride *self) |
| static PyObject * | bpy_rna_context_temp_override_exit (BPyContextTempOverride *self, PyObject *) |
Public Type Definition | |
| PyMethodDef | BPY_rna_context_temp_override_method_def |
| void | bpy_rna_context_types_init () |
This file adds some helper methods to the context, that cannot fit well in RNA itself.
Definition in file bpy_rna_context.cc.
|
static |
Definition at line 599 of file bpy_rna_context.cc.
References ContextStore::area, ContextStore::area_is_set, bpy_context_temp_override_extract_known_args(), BPyContextTempOverride_Type, C, CTX_py_dict_get(), PointerRNA::data, params, PY_ARG_PARSER_HEAD_COMPAT, pyrna_struct_as_ptr(), pyrna_struct_as_ptr_or_null_parse(), ContextStore::region, ContextStore::region_is_set, ret, ContextStore::screen, ContextStore::screen_is_set, self, ContextStore::win, and ContextStore::win_is_set.
|
static |
Definition at line 551 of file bpy_rna_context.cc.
References BLI_assert_unreachable.
Referenced by bpy_context_temp_override().
|
static |
Definition at line 154 of file bpy_rna_context.cc.
References self.
|
static |
Definition at line 159 of file bpy_rna_context.cc.
References BKE_workspace_layout_find_global(), bpy_rna_context_temp_set_screen_for_window(), CTX_data_main(), CTX_py_state_push(), CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_screen(), CTX_wm_screen_set(), CTX_wm_window(), CTX_wm_window_set(), LISTBASE_FOREACH, self, Main::wm, wm_check_area_exists(), wm_check_region_exists(), wm_check_screen_exists(), wm_check_screen_switch_supported(), wm_check_window_exists(), and WM_window_get_active_screen().
|
static |
Definition at line 322 of file bpy_rna_context.cc.
References bpy_rna_context_temp_set_screen_for_window(), CTX_data_main(), CTX_py_dict_get(), CTX_py_state_pop(), CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_screen(), CTX_wm_screen_set(), CTX_wm_window(), CTX_wm_window_set(), self, UNUSED_VARS, wm_check_area_exists(), wm_check_region_exists(), wm_check_screen_exists(), wm_check_screen_switch_supported(), wm_check_window_exists(), and WM_window_get_active_screen().
|
static |
Definition at line 37 of file bpy_rna_context.cc.
References BKE_workspace_layout_find_global(), CTX_data_main(), WM_window_get_active_screen(), WM_window_set_active_screen(), and WM_window_set_active_workspace().
Referenced by bpy_rna_context_temp_override_enter(), and bpy_rna_context_temp_override_exit().
| void bpy_rna_context_types_init | ( | void | ) |
Definition at line 734 of file bpy_rna_context.cc.
References BLI_assert_unreachable, and BPyContextTempOverride_Type.
Referenced by BPY_rna_types_extend_capi().
| PyDoc_STRVAR | ( | bpy_context_temp_override_doc | , |
| ".. method:: temp_override(*, window=None, area=None, region=None, **keywords)\n" "\n" " Context manager to temporarily override members in the context.\n" "\n" " :arg window: Window override or None.\n" " :type window: :class:`bpy.types.Window`\n" " :arg screen: Screen override or None.\n" "\n" " .. note:: Switching to or away from full-screen areas & temporary screens " "isn't supported. Passing in these screens will raise an | exception, | ||
| " "actions that leave the context such screens won 't restore the prior screen.\n" "\n" " .. note::Changing the screen has wider implications " "than other arguments as it will also change the works-space " "and potentially the scene(when pinned).\n" "\n" " :type screen::class:`bpy.types.Screen`\n" " :arg area:Area override or None.\n" " :type area::class:`bpy.types.Area`\n" " :arg region:Region override or None.\n" " :type region::class:`bpy.types.Region`\n" " :arg keywords:Additional keywords override context members.\n" " :return:The context manager .\n" " :rtype:ContextTempOverride\n" | ) |
|
static |
Definition at line 85 of file bpy_rna_context.cc.
References ScrAreaMap::areabase, BLI_findindex(), and wmWindow::global_areas.
Referenced by bpy_rna_context_temp_override_enter(), and bpy_rna_context_temp_override_exit().
|
static |
Definition at line 96 of file bpy_rna_context.cc.
References BLI_findindex().
Referenced by bpy_rna_context_temp_override_enter(), and bpy_rna_context_temp_override_exit().
Definition at line 77 of file bpy_rna_context.cc.
References BLI_findindex(), and Main::screens.
Referenced by bpy_rna_context_temp_override_enter(), and bpy_rna_context_temp_override_exit().
|
static |
Switching to or away from this screen is not supported.
Definition at line 56 of file bpy_rna_context.cc.
References BKE_screen_is_fullscreen_area().
Referenced by bpy_rna_context_temp_override_enter(), and bpy_rna_context_temp_override_exit().
Definition at line 67 of file bpy_rna_context.cc.
References BLI_findindex(), LISTBASE_FOREACH, and Main::wm.
Referenced by bpy_rna_context_temp_override_enter(), and bpy_rna_context_temp_override_exit().
|
static |
Definition at line 483 of file bpy_rna_context.cc.
| PyMethodDef BPY_rna_context_temp_override_method_def |
Definition at line 723 of file bpy_rna_context.cc.
Referenced by BPY_rna_types_extend_capi().
|
static |
Definition at line 493 of file bpy_rna_context.cc.
Referenced by bpy_context_temp_override(), and bpy_rna_context_types_init().