[Bf-blender-cvs] [a8df2922649] master: Cleanup: comments in wm_event_system.c
Campbell Barton
noreply at git.blender.org
Thu Mar 3 06:46:50 CET 2022
Commit: a8df2922649195eee14072fd4d5b651d5b3ab335
Author: Campbell Barton
Date: Thu Mar 3 16:45:40 2022 +1100
Branches: master
https://developer.blender.org/rBa8df2922649195eee14072fd4d5b651d5b3ab335
Cleanup: comments in wm_event_system.c
===================================================================
M source/blender/windowmanager/intern/wm_event_system.c
===================================================================
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index b531467c52d..cd8be110c36 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -4,7 +4,7 @@
/** \file
* \ingroup wm
*
- * Handle events and notifiers from GHOST input (mouse, keyboard, tablet, ndof).
+ * Handle events and notifiers from GHOST input (mouse, keyboard, tablet, NDOF).
*
* Also some operator reports utility functions.
*/
@@ -174,7 +174,7 @@ void wm_event_free(wmEvent *event)
if (event->customdata) {
if (event->customdata_free) {
- /* NOTE: pointer to listbase struct elsewhere. */
+ /* NOTE: pointer to #ListBase struct elsewhere. */
if (event->custom == EVT_DATA_DRAGDROP) {
ListBase *lb = event->customdata;
WM_drag_free_list(lb);
@@ -335,21 +335,19 @@ void WM_main_remap_editor_id_reference(const struct IDRemapper *mappings)
static void wm_notifier_clear(wmNotifier *note)
{
- /* NULL the entire notifier, only leaving (next, prev) members intact. */
+ /* NULL the entire notifier, only leaving (`next`, `prev`) members intact. */
memset(((char *)note) + sizeof(Link), 0, sizeof(*note) - sizeof(Link));
}
void wm_event_do_depsgraph(bContext *C, bool is_after_open_file)
{
wmWindowManager *wm = CTX_wm_manager(C);
- /* The whole idea of locked interface is to prevent viewport and whatever
- * thread from modifying the same data. Because of this, we can not perform
- * dependency graph update.
- */
+ /* The whole idea of locked interface is to prevent viewport and whatever thread from
+ * modifying the same data. Because of this, we can not perform dependency graph update. */
if (wm->is_interface_locked) {
return;
}
- /* Combine datamasks so one window doesn't disable UV's in another T26448. */
+ /* Combine data-masks so one window doesn't disable UV's in another T26448. */
CustomData_MeshMasks win_combine_v3d_datamask = {0};
LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
const Scene *scene = WM_window_get_active_scene(win);
@@ -364,14 +362,13 @@ void wm_event_do_depsgraph(bContext *C, bool is_after_open_file)
Main *bmain = CTX_data_main(C);
/* Copied to set's in scene_update_tagged_recursive() */
scene->customdata_mask = win_combine_v3d_datamask;
- /* XXX, hack so operators can enforce datamasks T26482, gl render */
+ /* XXX, hack so operators can enforce data-masks T26482, GPU render. */
CustomData_MeshMasks_update(&scene->customdata_mask, &scene->customdata_mask_modal);
/* TODO(sergey): For now all dependency graphs which are evaluated from
* workspace are considered active. This will work all fine with "locked"
* view layer and time across windows. This is to be granted separately,
* and for until then we have to accept ambiguities when object is shared
- * across visible view layers and has overrides on it.
- */
+ * across visible view layers and has overrides on it. */
Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, view_layer);
if (is_after_open_file) {
DEG_graph_tag_on_visible_update(depsgraph, true);
@@ -421,7 +418,7 @@ static void wm_event_execute_timers(bContext *C)
void wm_event_do_notifiers(bContext *C)
{
- /* Run the timer before assigning 'wm' in the unlikely case a timer loads a file, see T80028. */
+ /* Run the timer before assigning `wm` in the unlikely case a timer loads a file, see T80028. */
wm_event_execute_timers(C);
wmWindowManager *wm = CTX_wm_manager(C);
@@ -468,7 +465,7 @@ void wm_event_do_notifiers(bContext *C)
WorkSpace *workspace = note->reference;
ED_workspace_delete(
- workspace, CTX_data_main(C), C, wm); /* XXX hrms, think this over! */
+ workspace, CTX_data_main(C), C, wm); /* XXX: hum, think this over! */
if (G.debug & G_DEBUG_EVENTS) {
printf("%s: Workspace delete %p\n", __func__, workspace);
}
@@ -476,10 +473,10 @@ void wm_event_do_notifiers(bContext *C)
else if (note->data == ND_LAYOUTBROWSE) {
bScreen *ref_screen = BKE_workspace_layout_screen_get(note->reference);
- /* free popup handlers only T35434. */
+ /* Free popup handlers only T35434. */
UI_popup_handlers_remove_all(C, &win->modalhandlers);
- ED_screen_change(C, ref_screen); /* XXX hrms, think this over! */
+ ED_screen_change(C, ref_screen); /* XXX: hum, think this over! */
if (G.debug & G_DEBUG_EVENTS) {
printf("%s: screen set %p\n", __func__, note->reference);
}
@@ -488,7 +485,7 @@ void wm_event_do_notifiers(bContext *C)
WorkSpace *workspace = WM_window_get_active_workspace(win);
WorkSpaceLayout *layout = note->reference;
- ED_workspace_layout_delete(workspace, layout, C); /* XXX hrms, think this over! */
+ ED_workspace_layout_delete(workspace, layout, C); /* XXX: hum, think this over! */
if (G.debug & G_DEBUG_EVENTS) {
printf("%s: screen delete %p\n", __func__, note->reference);
}
@@ -517,9 +514,9 @@ void wm_event_do_notifiers(bContext *C)
if (do_anim) {
- /* XXX, quick frame changes can cause a crash if framechange and rendering
+ /* XXX: quick frame changes can cause a crash if frame-change and rendering
* collide (happens on slow scenes), BKE_scene_graph_update_for_newframe can be called
- * twice which can depgraph update the same object at once */
+ * twice which can depsgraph update the same object at once. */
if (G.is_rendering == false) {
/* Depsgraph gets called, might send more notifiers. */
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
@@ -598,7 +595,7 @@ void wm_event_do_notifiers(bContext *C)
MEM_freeN(note);
}
-#endif /* if 1 (postpone disabling for in favor of message-bus), eventually. */
+#endif /* If 1 (postpone disabling for in favor of message-bus), eventually. */
/* Handle message bus. */
{
@@ -611,7 +608,7 @@ void wm_event_do_notifiers(bContext *C)
wm_event_do_refresh_wm_and_depsgraph(C);
- /* Status bar */
+ /* Status bar. */
if (wm->winactive) {
wmWindow *win = wm->winactive;
CTX_wm_window_set(C, win);
@@ -661,14 +658,14 @@ static int wm_handler_ui_call(bContext *C,
const bool is_wheel = ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, MOUSEPAN);
/* UI code doesn't handle return values - it just always returns break.
- * to make the DBL_CLICK conversion work, we just don't send this to UI, except mouse clicks. */
+ * to make the #DBL_CLICK conversion work, we just don't send this to UI, except mouse clicks. */
if (((handler->head.flag & WM_HANDLER_ACCEPT_DBL_CLICK) == 0) && !ISMOUSE_BUTTON(event->type) &&
(event->val == KM_DBL_CLICK)) {
return WM_HANDLER_CONTINUE;
}
/* UI is quite aggressive with swallowing events, like scroll-wheel. */
- /* I realize this is not extremely nice code... when UI gets keymaps it can be maybe smarter. */
+ /* I realize this is not extremely nice code... when UI gets key-maps it can be maybe smarter. */
if (do_wheel_ui == false) {
if (is_wheel) {
return WM_HANDLER_CONTINUE;
@@ -697,7 +694,7 @@ static int wm_handler_ui_call(bContext *C,
int retval = handler->handle_fn(C, event, handler->user_data);
- /* putting back screen context */
+ /* Putting back screen context. */
if ((retval != WM_UI_HANDLER_BREAK) || always_pass) {
CTX_wm_area_set(C, area);
CTX_wm_region_set(C, region);
@@ -714,7 +711,7 @@ static int wm_handler_ui_call(bContext *C,
return WM_HANDLER_BREAK;
}
- /* event not handled in UI, if wheel then we temporarily disable it */
+ /* Event not handled in UI, if wheel then we temporarily disable it. */
if (is_wheel) {
do_wheel_ui = false;
}
@@ -768,7 +765,7 @@ void WM_report_banner_show(void)
/* After adding reports to the global list, reset the report timer. */
WM_event_remove_timer(wm, NULL, wm_reports->reporttimer);
- /* Records time since last report was added */
+ /* Records time since last report was added. */
wm_reports->reporttimer = WM_event_add_timer(wm, wm->winactive, TIMERREPORT, 0.05);
ReportTimerInfo *rti = MEM_callocN(sizeof(ReportTimerInfo), "ReportTimerInfo");
@@ -795,7 +792,7 @@ static void wm_add_reports(ReportList *reports)
if (reports->list.first && (reports->flag & RPT_OP_HOLD) == 0) {
wmWindowManager *wm = G_MAIN->wm.first;
- /* add reports to the global list, otherwise they are not seen */
+ /* Add reports to the global list, otherwise they are not seen. */
BLI_movelisttolist(&wm->reports.list, &reports->list);
WM_report_banner_show();
@@ -905,10 +902,12 @@ void WM_operator_region_active_win_set(bContext *C)
}
}
-/* (caller_owns_reports == true) when called from python. */
+/**
+ * \param caller_owns_reports: True when called from Python.
+ */
static void wm_operator_reports(bContext *C, wmOperator *op, int retval, bool caller_owns_reports)
{
- if (G.background == 0 && caller_owns_reports == false) { /* popup */
+ if (G.background == 0 && caller_owns_reports == false) { /* Popup. */
if (op->reports->list.first) {
/* FIXME: temp setting window, see other call to #UI_popup_menu_reports for why. */
wmWindow *win_prev = CTX_wm_window(C);
@@ -944,7 +943,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, bool ca
}
}
- /* Refresh Info Editor with reports immediately, even if op returned OPERATOR_CANCELLED. */
+ /* Refresh Info Editor with reports immediately, even if op returned #OPERATOR_CANCELLED. */
if ((retval & OPERATOR_CANCELLED) && !BLI_listbase_is_empty(&op->reports->list)) {
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
}
@@ -1004,7 +1003,7 @@ static void wm_operator_finished(bContext *C, wmOperator *op, const bool repeat,
}
if (wm_operator_register_check(wm, op->type)) {
- /
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list