Cleanup: reference operators as symbols, spelling in comments

This commit is contained in:
Campbell Barton
2025-04-15 15:20:19 +10:00
parent 8e40e21124
commit c49e6a7dd4
22 changed files with 39 additions and 37 deletions

View File

@@ -909,7 +909,7 @@ static bool external_file_check_callback(BPathForeachPathData *bpath_data,
/**
* Do a check on any external files (.blend, textures, etc.) being used.
* The ASSET_OT_bundle_install operator only works on standalone .blend files
* The #ASSET_OT_bundle_install operator only works on standalone `.blend` files
* (catalog definition files are fine, though).
*
* \return true when there are external files, false otherwise.

View File

@@ -3472,7 +3472,7 @@ const uiStyle *UI_style_get(); /* use for fonts etc */
*/
const uiStyle *UI_style_get_dpi();
/* UI_OT_editsource helpers */
/* #UI_OT_editsource helpers. */
bool UI_editsource_enable_check();
void UI_editsource_active_but_test(uiBut *but);
/**

View File

@@ -21,7 +21,7 @@ void eyedropper_draw_cursor_text_region(const int xy[2], const char *name);
/**
* Utility to retrieve a button representing a RNA property that is currently under the cursor.
*
* This is to be used by any eyedroppers which fetch properties (e.g. UI_OT_eyedropper_driver).
* This is to be used by any eyedroppers which fetch properties (e.g. #UI_OT_eyedropper_driver).
* Especially during modal operations (e.g. as with the eyedroppers), context cannot be relied
* upon to provide this information, as it is not updated until the operator finishes.
*

View File

@@ -1096,7 +1096,7 @@ static uiBut *ui_item_with_label(uiLayout *layout,
}
}
/* BUTTONS_OT_file_browse calls UI_context_active_but_prop_get_filebrowser */
/* #BUTTONS_OT_file_browse calls #UI_context_active_but_prop_get_filebrowser. */
uiDefIconButO(block,
UI_BTYPE_BUT,
subtype == PROP_DIRPATH ? "BUTTONS_OT_directory_browse" :

View File

@@ -66,7 +66,7 @@
/* for Copy As Driver */
#include "ED_keyframing.hh"
/* only for UI_OT_editsource */
/* Only for #UI_OT_editsource. */
#include "BLI_ghash.h"
#include "ED_screen.hh"

View File

@@ -546,17 +546,18 @@ static wmOperatorStatus data_transfer_exec(bContext *C, wmOperator *op)
#endif
}
/* Used by both OBJECT_OT_data_transfer and OBJECT_OT_datalayout_transfer */
/* Note this context poll is only really partial,
* it cannot check for all possible invalid cases. */
/** Used by both #OBJECT_OT_data_transfer and #OBJECT_OT_datalayout_transfer. */
static bool data_transfer_poll(bContext *C)
{
/* Note this context poll is only really partial,
* it cannot check for all possible invalid cases. */
Object *ob = context_active_object(C);
ID *data = static_cast<ID *>((ob) ? ob->data : nullptr);
return (ob != nullptr && ob->type == OB_MESH && data != nullptr);
}
/* Used by both OBJECT_OT_data_transfer and OBJECT_OT_datalayout_transfer */
/** Used by both #OBJECT_OT_data_transfer and #OBJECT_OT_datalayout_transfer. */
static bool data_transfer_poll_property(const bContext * /*C*/,
wmOperator *op,
const PropertyRNA *prop)

View File

@@ -1020,8 +1020,8 @@ static void action_preview_render(IconPreview *preview, IconPreviewSize *preview
Depsgraph *depsgraph = preview->depsgraph;
/* Not all code paths that lead to this function actually provide a depsgraph.
* The "Refresh Asset Preview" button (ED_OT_lib_id_generate_preview) does,
* but WM_OT_previews_ensure does not. */
* The "Refresh Asset Preview" button (#ED_OT_lib_id_generate_preview) does,
* but #WM_OT_previews_ensure does not. */
BLI_assert(depsgraph != nullptr);
BLI_assert(preview->scene == DEG_get_input_scene(depsgraph));

View File

@@ -863,7 +863,7 @@ int /*eContextResult*/ buttons_context(const bContext *C,
{
SpaceProperties *sbuts = CTX_wm_space_properties(C);
if (sbuts && sbuts->path == nullptr) {
/* path is cleared for SCREEN_OT_redo_last, when global undo does a file-read which clears the
/* path is cleared for #SCREEN_OT_redo_last, when global undo does a file-read which clears the
* path (see lib_link_workspace_layout_restore). */
buttons_context_compute(C, sbuts);
}

View File

@@ -2141,7 +2141,7 @@ static std::string file_execute_get_description(bContext *C,
SpaceFile *sfile = CTX_wm_space_file(C);
if (sfile->op && sfile->op->type && sfile->op->type->description) {
/* Return the description of the executed operator. Don't use get_description
* as that will return file details for WM_OT_open_mainfile. */
* as that will return file details for #WM_OT_open_mainfile. */
return TIP_(sfile->op->type->description);
}
return {};

View File

@@ -39,7 +39,7 @@
/** \name Set Cursor
*
* The 'cursor' in the Graph Editor consists of two parts:
* 1) Current Frame Indicator (as per ANIM_OT_change_frame)
* 1) Current Frame Indicator (as per #ANIM_OT_change_frame)
* 2) Value Indicator (stored per Graph Editor instance)
* \{ */
@@ -67,9 +67,9 @@ static void graphview_cursor_apply(bContext *C, wmOperator *op)
sipo->cursorTime = frame;
}
else {
/* adjust the frame
* NOTE: sync this part of the code with ANIM_OT_change_frame
*/
/* Adjust the frame.
* NOTE: sync this part of the code with #ANIM_OT_change_frame. */
/* 1) frame is rounded to the nearest int, since frames are ints */
scene->r.cfra = round_fl_to_int(frame);

View File

@@ -339,7 +339,7 @@ bool space_image_main_region_poll(bContext *C)
return false;
}
/* For IMAGE_OT_curves_point_set to avoid sampling when in uv smooth mode or editmode */
/** For #IMAGE_OT_curves_point_set to avoid sampling when in uv smooth mode or edit-mode. */
static bool space_image_main_area_not_uv_brush_poll(bContext *C)
{
SpaceImage *sima = CTX_wm_space_image(C);

View File

@@ -153,7 +153,7 @@ void ED_operatormacros_node()
mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
WM_operatortype_macro_define(ot, "NODE_OT_attach");
/* NODE_OT_translate_attach with remove_on_cancel set to true. */
/* `NODE_OT_translate_attach` with remove_on_cancel set to true. */
ot = WM_operatortype_append_macro("NODE_OT_translate_attach_remove_on_cancel",
"Move and Attach",
"Move nodes and attach to frame",

View File

@@ -955,7 +955,7 @@ static wmOperatorStatus outliner_id_relocate_invoke(bContext *C,
WM_operator_properties_free(&op_props);
/* If the matching WM operator invoke was successful, it was added to modal handlers. This
* operator however is _not_ modal, and will memleak if it returns this status. */
* operator however is _not_ modal, and will leak memory if it returns this status. */
return (ret == OPERATOR_RUNNING_MODAL) ? OPERATOR_FINISHED : ret;
}

View File

@@ -482,9 +482,9 @@ enum {
struct SlipData {
NumInput num_input;
/* Initial mouse position in viewspace. */
/* Initial mouse position in view-space. */
float init_mouse_co[2];
/* Mouse and virtual mouse-cursor x-values in regionspace. */
/* Mouse and virtual mouse-cursor x-values in region-space. */
int prev_mval_x;
float virtual_mval_x;
/* Parsed offset (integer when in precision mode, float otherwise).*/
@@ -492,7 +492,7 @@ struct SlipData {
VectorSet<Strip *> strips;
bool precision;
bool clamp;
/* Determines whether to show subframe offset in header. */
/* Determines whether to show sub-frame offset in header. */
bool show_subframe;
};

View File

@@ -155,7 +155,7 @@ static void select_surrounding_handles(Scene *scene, Strip *test) /* XXX BRING B
}
}
/* Used for mouse selection in SEQUENCER_OT_select. */
/* Used for mouse selection in #SEQUENCER_OT_select. */
static void select_active_side(
const Scene *scene, ListBase *seqbase, int sel_side, int channel, int frame)
{
@@ -184,7 +184,7 @@ static void select_active_side(
}
}
/* Used for mouse selection in SEQUENCER_OT_select_side. */
/* Used for mouse selection in #SEQUENCER_OT_select_side. */
static void select_active_side_range(const Scene *scene,
ListBase *seqbase,
const int sel_side,
@@ -219,7 +219,7 @@ static void select_active_side_range(const Scene *scene,
}
}
/* Used alongside `select_linked_time` helper function in SEQUENCER_OT_select. */
/* Used alongside `select_linked_time` helper function in #SEQUENCER_OT_select. */
static void select_linked_time_seq(const Scene *scene,
const Strip *strip_source,
const eStripHandle handle_clicked)

View File

@@ -238,7 +238,7 @@ static wmOperatorStatus viewroll_invoke(bContext *C, wmOperator *op, const wmEve
viewroll_exec(C, op);
}
else {
/* The equivalent functionality for orbiting the view: VIEW3D_OT_orbit & VIEW3D_OT_rotate are
/* The equivalent functionality for orbiting the view: #VIEW3D_OT_orbit & #VIEW3D_OT_rotate are
* separate operators with different poll functions [which are only permissive for non-locked
* views]. This operator however mixes modal-interaction & instant-stepping into the same
* operator and its current poll function permissively finds the non-locked region in quad

View File

@@ -127,8 +127,10 @@ void VIEW3D_OT_camera_to_view(wmOperatorType *ot)
/** \name Camera Fit Frame to Selected Operator
* \{ */
/* unlike VIEW3D_OT_view_selected this is for framing a render and not
* meant to take into account vertex/bone selection for eg. */
/**
* Unlike #VIEW3D_OT_view_selected this is for framing a render and not
* meant to take into account vertex/bone selection for eg.
*/
static wmOperatorStatus view3d_camera_to_view_selected_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);

View File

@@ -277,7 +277,7 @@ static void seq_transform_cancel(TransInfo *t, Span<Strip *> transformed_strips)
for (Strip *strip : transformed_strips) {
/* Handle pre-existing overlapping strips even when operator is canceled.
* This is necessary for SEQUENCER_OT_duplicate_move macro for example. */
* This is necessary for #SEQUENCER_OT_duplicate_move macro for example. */
if (seq::transform_test_overlap(t->scene, seqbase, strip)) {
seq::transform_seqbase_shuffle(seqbase, strip, t->scene);
}

View File

@@ -341,9 +341,9 @@ static void TRANSFORM_OT_create_orientation(wmOperatorType *ot)
#ifdef USE_LOOPSLIDE_HACK
/**
* Special hack for MESH_OT_loopcut_slide so we get back to the selection mode
* Do this for all meshes in multi-object editmode so their selectmode is in sync for following
* operators
* Special hack for #MESH_OT_loopcut_slide so we get back to the selection mode
* Do this for all meshes in multi-object edit-mode so their select-mode is in sync
* for following operators
*/
static void transformops_loopsel_hack(bContext *C, wmOperator *op)
{

View File

@@ -393,7 +393,7 @@ typedef enum eStereo3dInterlaceType {
/**
* Generic image format settings,
* this is used for #NodeImageFile and IMAGE_OT_save_as operator too.
* this is used for #NodeImageFile and #IMAGE_OT_save_as operator too.
*
* NOTE: its a bit strange that even though this is an image format struct
* the imtype can still be used to select video formats.

View File

@@ -1715,7 +1715,7 @@ static StructRNA *rna_Operator_register(Main *bmain,
STRNCPY(temp_buffers.translation_context, BLT_I18NCONTEXT_OPERATOR_DEFAULT);
}
/* Convert foo.bar to FOO_OT_bar
/* Convert foo.bar to `FOO_OT_bar`
* allocate all strings at once. */
{
const char *strings[] = {
@@ -1889,7 +1889,7 @@ static StructRNA *rna_MacroOperator_register(Main *bmain,
STRNCPY(temp_buffers.translation_context, BLT_I18NCONTEXT_OPERATOR_DEFAULT);
}
/* Convert foo.bar to FOO_OT_bar
/* Convert `foo.bar` to `FOO_OT_bar`
* allocate all strings at once. */
{
const char *strings[] = {

View File

@@ -770,7 +770,6 @@ void BPy_init_modules(bContext *C)
BPY_rna_types_finalize_external_types(bpy_types);
PyModule_AddObject(mod, "props", BPY_rna_props());
/* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */
PyModule_AddObject(mod, "ops", BPY_operator_module());
PyModule_AddObject(mod, "app", BPY_app_struct());
PyModule_AddObject(mod, "_utils_units", BPY_utils_units());