From 2abfcebb0eb7989e3d1e7d03f37ecf5c088210af Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 10 Oct 2020 18:19:55 +1100 Subject: Cleanup: use C comments for descriptive text Follow our code style guide by using C-comments for text descriptions. --- source/blender/editors/space_graph/graph_buttons.c | 10 ++++---- source/blender/editors/space_graph/graph_edit.c | 29 +++++++++++----------- source/blender/editors/space_graph/graph_ops.c | 2 +- source/blender/editors/space_graph/graph_select.c | 24 +++++++++--------- source/blender/editors/space_graph/graph_utils.c | 10 ++++---- source/blender/editors/space_graph/space_graph.c | 17 +++++++------ 6 files changed, 48 insertions(+), 44 deletions(-) (limited to 'source/blender/editors/space_graph') diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index bbdca5280d4..be3e49fd810 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -64,7 +64,7 @@ #include "UI_interface.h" #include "UI_resources.h" -#include "graph_intern.h" // own include +#include "graph_intern.h" /* own include */ /* ******************* graph editor space & buttons ************** */ @@ -644,7 +644,7 @@ static void do_graph_region_driver_buttons(bContext *C, void *id_v, int event) } /* default for now */ - WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); // XXX could use better notifier + WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); /* XXX could use better notifier */ } /* callback to add a target variable to the active driver */ @@ -1120,7 +1120,7 @@ static void graph_draw_driver_settings_panel(uiLayout *layout, 0.0, 0.0, TIP_("Invalid variable name, click here for details")); - UI_but_func_set(but, driver_dvar_invalid_name_query_cb, dvar, NULL); // XXX: reports? + UI_but_func_set(but, driver_dvar_invalid_name_query_cb, dvar, NULL); /* XXX: reports? */ } /* 1.3) remove button */ @@ -1316,9 +1316,9 @@ static void graph_panel_drivers_popover(const bContext *C, Panel *panel) static void do_graph_region_modifier_buttons(bContext *C, void *UNUSED(arg), int event) { switch (event) { - case B_FMODIFIER_REDRAW: // XXX this should send depsgraph updates too + case B_FMODIFIER_REDRAW: /* XXX this should send depsgraph updates too */ WM_event_add_notifier( - C, NC_ANIMATION, NULL); // XXX need a notifier specially for F-Modifiers + C, NC_ANIMATION, NULL); /* XXX need a notifier specially for F-Modifiers */ break; } } diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index e99aeb82456..9fe6b4e06f6 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -243,7 +243,7 @@ static int graphkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op)) scene->r.pefra = round_fl_to_int(max); /* set notifier that things have changed */ - // XXX err... there's nothing for frame ranges yet, but this should do fine too + /* XXX err... there's nothing for frame ranges yet, but this should do fine too */ WM_event_add_notifier(C, NC_SCENE | ND_FRAME, ac.scene); return OPERATOR_FINISHED; @@ -258,7 +258,7 @@ void GRAPH_OT_previewrange_set(wmOperatorType *ot) /* api callbacks */ ot->exec = graphkeys_previewrange_exec; - // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... + /* XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier. */ ot->poll = ED_operator_graphedit_active; /* flags */ @@ -514,7 +514,7 @@ void GRAPH_OT_ghost_curves_create(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - // todo: add props for start/end frames + /* TODO: add props for start/end frames */ } /* ******************** Clear Ghost-Curves Operator *********************** */ @@ -1069,7 +1069,8 @@ void GRAPH_OT_paste(wmOperatorType *ot) "frame"; /* api callbacks */ - // ot->invoke = WM_operator_props_popup; // better wait for graph redo panel + + // ot->invoke = WM_operator_props_popup; /* better wait for graph redo panel */ ot->exec = graphkeys_paste_exec; ot->poll = graphop_editable_keyframes_poll; @@ -1292,7 +1293,7 @@ void GRAPH_OT_clean(wmOperatorType *ot) ot->description = "Simplify F-Curves by removing closely spaced keyframes"; /* api callbacks */ - // ot->invoke = // XXX we need that number popup for this! + // ot->invoke = ???; /* XXX we need that number popup for this! */ ot->exec = graphkeys_clean_exec; ot->poll = graphop_editable_keyframes_poll; @@ -1828,7 +1829,7 @@ static int graphkeys_bake_exec(bContext *C, wmOperator *UNUSED(op)) } /* for now, init start/end from preview-range extents */ - // TODO: add properties for this + /* TODO: add properties for this */ scene = ac.scene; start = PSFRA; end = PEFRA; @@ -1837,7 +1838,7 @@ static int graphkeys_bake_exec(bContext *C, wmOperator *UNUSED(op)) bake_graph_curves(&ac, start, end); /* set notifier that keyframes have changed */ - // NOTE: some distinction between order/number of keyframes and type should be made? + /* NOTE: some distinction between order/number of keyframes and type should be made? */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -1851,14 +1852,14 @@ void GRAPH_OT_bake(wmOperatorType *ot) ot->description = "Bake selected F-Curves to a set of sampled points defining a similar curve"; /* api callbacks */ - ot->invoke = WM_operator_confirm; // FIXME... + ot->invoke = WM_operator_confirm; /* FIXME */ ot->exec = graphkeys_bake_exec; ot->poll = graphop_selected_fcurve_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - // todo: add props for start/end frames + /* TODO: add props for start/end frames */ } #ifdef WITH_AUDASPACE @@ -1974,7 +1975,7 @@ static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -#else // WITH_AUDASPACE +#else /* WITH_AUDASPACE */ static int graphkeys_sound_bake_exec(bContext *UNUSED(C), wmOperator *op) { @@ -1983,7 +1984,7 @@ static int graphkeys_sound_bake_exec(bContext *UNUSED(C), wmOperator *op) return OPERATOR_CANCELLED; } -#endif // WITH_AUDASPACE +#endif /* WITH_AUDASPACE */ static int graphkeys_sound_bake_invoke(bContext *C, wmOperator *op, const wmEvent *event) { @@ -2224,7 +2225,7 @@ static void setexpo_graph_keys(bAnimContext *ac, short mode) if (mode == MAKE_CYCLIC_EXPO) { /* only add if one doesn't exist */ if (list_has_suitable_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_CYCLES, -1) == 0) { - // TODO: add some more preset versions which set different extrapolation options? + /* TODO: add some more preset versions which set different extrapolation options? */ add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_CYCLES, fcu); } } @@ -3249,8 +3250,8 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) /* filter data */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS); if (RNA_boolean_get(op->ptr, "only_active")) { - filter |= - ANIMFILTER_ACTIVE; // FIXME: enforce in this case only a single channel to get handled? + /* FIXME: enforce in this case only a single channel to get handled? */ + filter |= ANIMFILTER_ACTIVE; } else { filter |= (ANIMFILTER_SEL | ANIMFILTER_CURVE_VISIBLE); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 22c185e36e5..4d337fdeb5e 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -54,7 +54,7 @@ #include "WM_types.h" /* ************************** view-based operators **********************************/ -// XXX should these really be here? +/* XXX should these really be here? */ /* Set Cursor --------------------------------------------------------------------- */ /* The 'cursor' in the Graph Editor consists of two parts: diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 433d7d6774b..36c836b0a91 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -85,13 +85,13 @@ typedef enum eGraphVertIndex { } eGraphVertIndex; /* Tolerance for absolute radius (in pixels) of the vert from the cursor to use */ -// TODO: perhaps this should depend a bit on the size that the user set the vertices to be? +/* TODO: perhaps this should depend a bit on the size that the user set the vertices to be? */ #define GVERTSEL_TOL (10 * U.pixelsize) /* ....... */ /* check if its ok to select a handle */ -// XXX also need to check for int-values only? +/* XXX also need to check for int-values only? */ static bool fcurve_handle_sel_check(SpaceGraph *sipo, BezTriple *bezt) { if (sipo->flag & SIPO_NOHANDLES) { @@ -104,7 +104,7 @@ static bool fcurve_handle_sel_check(SpaceGraph *sipo, BezTriple *bezt) } /* check if the given vertex is within bounds or not */ -// TODO: should we return if we hit something? +/* TODO: should we return if we hit something? */ static void nearest_fcurve_vert_store(ListBase *matches, View2D *v2d, FCurve *fcu, @@ -158,7 +158,7 @@ static void nearest_fcurve_vert_store(ListBase *matches, nvi->frame = bezt->vec[1][0]; /* currently in global time... */ - nvi->sel = BEZT_ISSEL_ANY(bezt); // XXX... should this use the individual verts instead? + nvi->sel = BEZT_ISSEL_ANY(bezt); /* XXX... should this use the individual verts instead? */ /* add to list of matches if appropriate... */ if (replace == 0) { @@ -188,7 +188,7 @@ static void get_nearest_fcurve_verts_list(bAnimContext *ac, const int mval[2], L */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS); if (sipo->flag & - SIPO_SELCUVERTSONLY) { // FIXME: this should really be check for by the filtering code... + SIPO_SELCUVERTSONLY) { /* FIXME: this should really be check for by the filtering code... */ filter |= ANIMFILTER_SEL; } mapping_flag |= ANIM_get_normalization_flags(ac); @@ -257,7 +257,7 @@ static void get_nearest_fcurve_verts_list(bAnimContext *ac, const int mval[2], L } } else if (fcu->fpt) { - // TODO; do this for samples too + /* TODO; do this for samples too */ } /* un-apply NLA mapping from all the keyframes */ @@ -1480,7 +1480,7 @@ static int mouse_graph_keys(bAnimContext *ac, } /* if points can be selected on this F-Curve */ - // TODO: what about those with no keyframes? + /* TODO: what about those with no keyframes? */ if (!curves_only && ((nvi->fcu->flag & FCURVE_PROTECTED) == 0)) { /* only if there's keyframe */ if (nvi->bezt) { @@ -1515,7 +1515,7 @@ static int mouse_graph_keys(bAnimContext *ac, } } else if (nvi->fpt) { - // TODO: need to handle sample points + /* TODO: need to handle sample points */ } } else { @@ -1609,7 +1609,7 @@ static int graphkeys_mselect_column(bAnimContext *ac, } /* get frame number on which elements should be selected */ - // TODO: should we restrict to integer frames only? + /* TODO: should we restrict to integer frames only? */ selx = nvi->frame; if (select_mode != SELECT_REPLACE) { @@ -1739,7 +1739,7 @@ void GRAPH_OT_clickselect(wmOperatorType *ot) 0, "Extend Select", "Toggle keyframe selection instead of leaving newly selected " - "keyframes only"); // SHIFTKEY + "keyframes only"); /* SHIFTKEY */ RNA_def_property_flag(prop, PROP_SKIP_SAVE); prop = RNA_def_boolean(ot->srna, @@ -1754,14 +1754,14 @@ void GRAPH_OT_clickselect(wmOperatorType *ot) 0, "Column Select", "Select all keyframes that occur on the same frame as the one under " - "the mouse"); // ALTKEY + "the mouse"); /* ALTKEY */ RNA_def_property_flag(prop, PROP_SKIP_SAVE); prop = RNA_def_boolean(ot->srna, "curves", 0, "Only Curves", - "Select all the keyframes in the curve"); // CTRLKEY + ALTKEY + "Select all the keyframes in the curve"); /* CTRLKEY + ALTKEY */ RNA_def_property_flag(prop, PROP_SKIP_SAVE); } diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index ffac9f1c722..8463c21b1ad 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -46,7 +46,7 @@ #include "RNA_access.h" -#include "graph_intern.h" // own include +#include "graph_intern.h" /* own include */ /* ************************************************************** */ /* Set Up Drivers Editor */ @@ -141,7 +141,7 @@ bool graphop_visible_keyframes_poll(bContext *C) bool found = false; /* firstly, check if in Graph Editor */ - // TODO: also check for region? + /* TODO: also check for region? */ if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return found; } @@ -194,7 +194,7 @@ bool graphop_editable_keyframes_poll(bContext *C) bool found = false; /* firstly, check if in Graph Editor */ - // TODO: also check for region? + /* TODO: also check for region? */ if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return found; } @@ -246,7 +246,7 @@ bool graphop_active_fcurve_poll(bContext *C) bool has_fcurve = false; /* firstly, check if in Graph Editor */ - // TODO: also check for region? + /* TODO: also check for region? */ if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return has_fcurve; } @@ -299,7 +299,7 @@ bool graphop_selected_fcurve_poll(bContext *C) int filter; /* firstly, check if in Graph Editor */ - // TODO: also check for region? + /* TODO: also check for region? */ if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return false; } diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 97db9b756ad..791039498e8 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -60,7 +60,7 @@ #include "UI_resources.h" #include "UI_view2d.h" -#include "graph_intern.h" // own include +#include "graph_intern.h" /* own include */ /* ******************** default callbacks for ipo space ***************** */ @@ -317,7 +317,7 @@ static void graph_main_region_draw_overlay(const bContext *C, ARegion *region) ED_time_scrub_draw_current_frame(region, scene, sipo->flag & SIPO_DRAWTIME, draw_vert_line); /* scrollers */ - // FIXME: args for scrollers depend on the type of data being shown... + /* FIXME: args for scrollers depend on the type of data being shown. */ UI_view2d_scrollers_draw(v2d, NULL); /* scale numbers */ @@ -615,10 +615,13 @@ static void graph_listener(wmWindow *UNUSED(win), } break; - // XXX: restore the case below if not enough updates occur... - // default: - // if (wmn->data == ND_KEYS) - // ED_area_tag_redraw(area); +#if 0 /* XXX: restore the case below if not enough updates occur... */ + default: { + if (wmn->data == ND_KEYS) { + ED_area_tag_redraw(area); + } + } +#endif } } @@ -763,7 +766,7 @@ static void graph_refresh(const bContext *C, ScrArea *area) } /* region updates? */ - // XXX re-sizing y-extents of tot should go here? + /* XXX re-sizing y-extents of tot should go here? */ /* Update the state of the animchannels in response to changes from the data they represent * NOTE: the temp flag is used to indicate when this needs to be done, -- cgit v1.2.3