Cleanup: Comment formatting, grammar
This commit is contained in:
@@ -20,9 +20,9 @@
|
|||||||
/** \file
|
/** \file
|
||||||
* \ingroup wm
|
* \ingroup wm
|
||||||
*
|
*
|
||||||
* Internal functions for managing UI registrable types (operator, UI and menu types)
|
* Internal functions for managing UI registrable types (operator, UI and menu types).
|
||||||
*
|
*
|
||||||
* Also Blenders main event loop (WM_main)
|
* Also Blender's main event loop (WM_main).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@@ -87,7 +87,7 @@ static void window_manager_foreach_id(ID *id, LibraryForeachIDData *data)
|
|||||||
if (win->workspace_hook != NULL) {
|
if (win->workspace_hook != NULL) {
|
||||||
ID *workspace = (ID *)BKE_workspace_active_get(win->workspace_hook);
|
ID *workspace = (ID *)BKE_workspace_active_get(win->workspace_hook);
|
||||||
BKE_LIB_FOREACHID_PROCESS_ID(data, workspace, IDWALK_CB_NOP);
|
BKE_LIB_FOREACHID_PROCESS_ID(data, workspace, IDWALK_CB_NOP);
|
||||||
/* allow callback to set a different workspace */
|
/* Allow callback to set a different workspace. */
|
||||||
BKE_workspace_active_set(win->workspace_hook, (WorkSpace *)workspace);
|
BKE_workspace_active_set(win->workspace_hook, (WorkSpace *)workspace);
|
||||||
}
|
}
|
||||||
if (BKE_lib_query_foreachid_process_flags_get(data) & IDWALK_INCLUDE_UI) {
|
if (BKE_lib_query_foreachid_process_flags_get(data) & IDWALK_INCLUDE_UI) {
|
||||||
@@ -129,8 +129,7 @@ void WM_operator_free(wmOperator *op)
|
|||||||
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
if (op->py_instance) {
|
if (op->py_instance) {
|
||||||
/* do this first in case there are any __del__ functions or
|
/* Do this first in case there are any __del__ functions or similar that use properties. */
|
||||||
* similar that use properties */
|
|
||||||
BPY_DECREF_RNA_INVALIDATE(op->py_instance);
|
BPY_DECREF_RNA_INVALIDATE(op->py_instance);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -180,13 +179,13 @@ void WM_operator_free_all_after(wmWindowManager *wm, struct wmOperator *op)
|
|||||||
*/
|
*/
|
||||||
void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
|
void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
|
||||||
{
|
{
|
||||||
/* not supported for Python */
|
/* Not supported for Python. */
|
||||||
BLI_assert(op->py_instance == NULL);
|
BLI_assert(op->py_instance == NULL);
|
||||||
|
|
||||||
op->type = ot;
|
op->type = ot;
|
||||||
op->ptr->type = ot->srna;
|
op->ptr->type = ot->srna;
|
||||||
|
|
||||||
/* ensure compatible properties */
|
/* Ensure compatible properties. */
|
||||||
if (op->properties) {
|
if (op->properties) {
|
||||||
PointerRNA ptr;
|
PointerRNA ptr;
|
||||||
|
|
||||||
@@ -208,8 +207,8 @@ static void wm_reports_free(wmWindowManager *wm)
|
|||||||
WM_event_remove_timer(wm, NULL, wm->reports.reporttimer);
|
WM_event_remove_timer(wm, NULL, wm->reports.reporttimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* all operations get registered in the windowmanager here */
|
/* All operations get registered in the windowmanager here. */
|
||||||
/* called on event handling by event_system.c */
|
/* Called on event handling by event_system.c. */
|
||||||
void wm_operator_register(bContext *C, wmOperator *op)
|
void wm_operator_register(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
wmWindowManager *wm = CTX_wm_manager(C);
|
wmWindowManager *wm = CTX_wm_manager(C);
|
||||||
@@ -217,7 +216,7 @@ void wm_operator_register(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
BLI_addtail(&wm->operators, op);
|
BLI_addtail(&wm->operators, op);
|
||||||
|
|
||||||
/* only count registered operators */
|
/* Only count registered operators. */
|
||||||
while (op) {
|
while (op) {
|
||||||
wmOperator *op_prev = op->prev;
|
wmOperator *op_prev = op->prev;
|
||||||
if (op->type->flag & OPTYPE_REGISTER) {
|
if (op->type->flag & OPTYPE_REGISTER) {
|
||||||
@@ -230,7 +229,7 @@ void wm_operator_register(bContext *C, wmOperator *op)
|
|||||||
op = op_prev;
|
op = op_prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* so the console is redrawn */
|
/* So the console is redrawn. */
|
||||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
|
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
|
||||||
WM_event_add_notifier(C, NC_WM | ND_HISTORY, NULL);
|
WM_event_add_notifier(C, NC_WM | ND_HISTORY, NULL);
|
||||||
}
|
}
|
||||||
@@ -287,7 +286,7 @@ void WM_keyconfig_init(bContext *C)
|
|||||||
{
|
{
|
||||||
wmWindowManager *wm = CTX_wm_manager(C);
|
wmWindowManager *wm = CTX_wm_manager(C);
|
||||||
|
|
||||||
/* create standard key configs */
|
/* Create standard key configs. */
|
||||||
if (wm->defaultconf == NULL) {
|
if (wm->defaultconf == NULL) {
|
||||||
/* Keep lowercase to match the preset filename. */
|
/* Keep lowercase to match the preset filename. */
|
||||||
wm->defaultconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT, false);
|
wm->defaultconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT, false);
|
||||||
@@ -299,8 +298,7 @@ void WM_keyconfig_init(bContext *C)
|
|||||||
wm->userconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " user", false);
|
wm->userconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " user", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize only after python init is done, for keymaps that
|
/* Initialize only after python init is done, for keymaps that use python operators. */
|
||||||
* use python operators */
|
|
||||||
if (CTX_py_init_get(C) && (wm->initialized & WM_KEYCONFIG_IS_INIT) == 0) {
|
if (CTX_py_init_get(C) && (wm->initialized & WM_KEYCONFIG_IS_INIT) == 0) {
|
||||||
/* create default key config, only initialize once,
|
/* create default key config, only initialize once,
|
||||||
* it's persistent across sessions */
|
* it's persistent across sessions */
|
||||||
@@ -325,7 +323,7 @@ void WM_check(bContext *C)
|
|||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
wmWindowManager *wm = CTX_wm_manager(C);
|
wmWindowManager *wm = CTX_wm_manager(C);
|
||||||
|
|
||||||
/* wm context */
|
/* WM context. */
|
||||||
if (wm == NULL) {
|
if (wm == NULL) {
|
||||||
wm = bmain->wm.first;
|
wm = bmain->wm.first;
|
||||||
CTX_wm_manager_set(C, wm);
|
CTX_wm_manager_set(C, wm);
|
||||||
@@ -341,18 +339,18 @@ void WM_check(bContext *C)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!G.background) {
|
if (!G.background) {
|
||||||
/* case: fileread */
|
/* Case: fileread. */
|
||||||
if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
|
if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
|
||||||
WM_keyconfig_init(C);
|
WM_keyconfig_init(C);
|
||||||
WM_autosave_init(wm);
|
WM_autosave_init(wm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* case: no open windows at all, for old file reads */
|
/* Case: no open windows at all, for old file reads. */
|
||||||
wm_window_ghostwindows_ensure(wm);
|
wm_window_ghostwindows_ensure(wm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* case: fileread */
|
/* Case: fileread. */
|
||||||
/* note: this runs in bg mode to set the screen context cb */
|
/* Note: this runs in background mode to set the screen context cb. */
|
||||||
if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
|
if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
|
||||||
ED_screens_init(bmain, wm);
|
ED_screens_init(bmain, wm);
|
||||||
wm->initialized |= WM_WINDOW_IS_INIT;
|
wm->initialized |= WM_WINDOW_IS_INIT;
|
||||||
@@ -364,7 +362,7 @@ void wm_clear_default_size(bContext *C)
|
|||||||
wmWindowManager *wm = CTX_wm_manager(C);
|
wmWindowManager *wm = CTX_wm_manager(C);
|
||||||
wmWindow *win;
|
wmWindow *win;
|
||||||
|
|
||||||
/* wm context */
|
/* WM context. */
|
||||||
if (wm == NULL) {
|
if (wm == NULL) {
|
||||||
wm = CTX_data_main(C)->wm.first;
|
wm = CTX_data_main(C)->wm.first;
|
||||||
CTX_wm_manager_set(C, wm);
|
CTX_wm_manager_set(C, wm);
|
||||||
@@ -382,7 +380,7 @@ void wm_clear_default_size(bContext *C)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* on startup, it adds all data, for matching */
|
/* On startup, it adds all data, for matching. */
|
||||||
void wm_add_default(Main *bmain, bContext *C)
|
void wm_add_default(Main *bmain, bContext *C)
|
||||||
{
|
{
|
||||||
wmWindowManager *wm = BKE_libblock_alloc(bmain, ID_WM, "WinMan", 0);
|
wmWindowManager *wm = BKE_libblock_alloc(bmain, ID_WM, "WinMan", 0);
|
||||||
@@ -404,7 +402,7 @@ void wm_add_default(Main *bmain, bContext *C)
|
|||||||
wm_window_make_drawable(wm, win);
|
wm_window_make_drawable(wm, win);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* context is allowed to be NULL, do not free wm itself (lib_id.c) */
|
/* Context is allowed to be NULL, do not free wm itself (lib_id.c). */
|
||||||
void wm_close_and_free(bContext *C, wmWindowManager *wm)
|
void wm_close_and_free(bContext *C, wmWindowManager *wm)
|
||||||
{
|
{
|
||||||
wmWindow *win;
|
wmWindow *win;
|
||||||
@@ -421,7 +419,7 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((win = BLI_pophead(&wm->windows))) {
|
while ((win = BLI_pophead(&wm->windows))) {
|
||||||
/* prevent draw clear to use screen */
|
/* Prevent draw clear to use screen. */
|
||||||
BKE_workspace_active_set(win->workspace_hook, NULL);
|
BKE_workspace_active_set(win->workspace_hook, NULL);
|
||||||
wm_window_free(C, wm, win);
|
wm_window_free(C, wm, win);
|
||||||
}
|
}
|
||||||
@@ -476,16 +474,16 @@ void WM_main(bContext *C)
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
/* get events from ghost, handle window events, add to window queues */
|
/* Get events from ghost, handle window events, add to window queues. */
|
||||||
wm_window_process_events(C);
|
wm_window_process_events(C);
|
||||||
|
|
||||||
/* per window, all events to the window, screen, area and region handlers */
|
/* Per window, all events to the window, screen, area and region handlers. */
|
||||||
wm_event_do_handlers(C);
|
wm_event_do_handlers(C);
|
||||||
|
|
||||||
/* events have left notes about changes, we handle and cache it */
|
/* Wvents have left notes about changes, we handle and cache it. */
|
||||||
wm_event_do_notifiers(C);
|
wm_event_do_notifiers(C);
|
||||||
|
|
||||||
/* execute cached changes draw */
|
/* Wxecute cached changes draw. */
|
||||||
wm_draw_update(C);
|
wm_draw_update(C);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -47,7 +47,7 @@
|
|||||||
#include "BLI_threads.h"
|
#include "BLI_threads.h"
|
||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
|
|
||||||
/* mostly init functions */
|
/* Mostly init functions. */
|
||||||
#include "BKE_appdir.h"
|
#include "BKE_appdir.h"
|
||||||
#include "BKE_blender.h"
|
#include "BKE_blender.h"
|
||||||
#include "BKE_brush.h"
|
#include "BKE_brush.h"
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
#include "DEG_depsgraph.h"
|
#include "DEG_depsgraph.h"
|
||||||
|
|
||||||
#include "IMB_imbuf.h" /* for IMB_init */
|
#include "IMB_imbuf.h" /* For #IMB_init. */
|
||||||
|
|
||||||
#include "RE_engine.h"
|
#include "RE_engine.h"
|
||||||
#include "RE_render_ext.h"
|
#include "RE_render_ext.h"
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
# include "sdlew.h"
|
# include "sdlew.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "creator_intern.h" /* own include */
|
#include "creator_intern.h" /* Own include. */
|
||||||
|
|
||||||
/* Local Function prototypes. */
|
/* Local Function prototypes. */
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ int main(int argc,
|
|||||||
|
|
||||||
/* --- end declarations --- */
|
/* --- end declarations --- */
|
||||||
|
|
||||||
/* ensure we free data on early-exit */
|
/* Ensure we free data on early-exit. */
|
||||||
struct CreatorAtExitData app_init_data = {NULL};
|
struct CreatorAtExitData app_init_data = {NULL};
|
||||||
BKE_blender_atexit_register(callback_main_atexit, &app_init_data);
|
BKE_blender_atexit_register(callback_main_atexit, &app_init_data);
|
||||||
|
|
||||||
@@ -320,7 +320,7 @@ int main(int argc,
|
|||||||
sdlewInit();
|
sdlewInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize logging */
|
/* Initialize logging. */
|
||||||
CLG_init();
|
CLG_init();
|
||||||
CLG_fatal_fn_set(callback_clg_fatal);
|
CLG_fatal_fn_set(callback_clg_fatal);
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ int main(int argc,
|
|||||||
fpsetmask(0);
|
fpsetmask(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* initialize path to executable */
|
/* Initialize path to executable. */
|
||||||
BKE_appdir_program_path_init(argv[0]);
|
BKE_appdir_program_path_init(argv[0]);
|
||||||
|
|
||||||
BLI_threadapi_init();
|
BLI_threadapi_init();
|
||||||
|
|||||||
Reference in New Issue
Block a user