Cleanup: include argument names in callbacks

While not essential it gives a hint to the naming conventions for
function arguments.
This commit is contained in:
Campbell Barton
2023-10-05 13:45:19 +11:00
parent f5b71e5152
commit de89decd77

View File

@@ -940,7 +940,7 @@ struct wmOperatorType {
* any interface code or input device state.
* See defines below for return values.
*/
int (*exec)(bContext *, wmOperator *) ATTR_WARN_UNUSED_RESULT;
int (*exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT;
/**
* This callback executes on a running operator whenever as property
@@ -948,7 +948,7 @@ struct wmOperatorType {
* invalid settings in exceptional cases.
* Boolean return value, True denotes a change has been made and to redraw.
*/
bool (*check)(bContext *, wmOperator *);
bool (*check)(bContext *C, wmOperator *op);
/**
* For modal temporary operators, initially invoke is called, then
@@ -956,13 +956,13 @@ struct wmOperatorType {
* canceled due to some external reason, cancel is called
* See defines below for return values.
*/
int (*invoke)(bContext *, wmOperator *, const wmEvent *) ATTR_WARN_UNUSED_RESULT;
int (*invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT;
/**
* Called when a modal operator is canceled (not used often).
* Internal cleanup can be done here if needed.
*/
void (*cancel)(bContext *, wmOperator *);
void (*cancel)(bContext *C, wmOperator *op);
/**
* Modal is used for operators which continuously run. Fly mode, knife tool, circle select are
@@ -970,13 +970,13 @@ struct wmOperatorType {
* or execute other operators. They keep running until they don't return
* `OPERATOR_RUNNING_MODAL`.
*/
int (*modal)(bContext *, wmOperator *, const wmEvent *) ATTR_WARN_UNUSED_RESULT;
int (*modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT;
/**
* Verify if the operator can be executed in the current context. Note
* that the operator may still fail to execute even if this returns true.
*/
bool (*poll)(bContext *) ATTR_WARN_UNUSED_RESULT;
bool (*poll)(bContext *C) ATTR_WARN_UNUSED_RESULT;
/**
* Used to check if properties should be displayed in auto-generated UI.
@@ -987,12 +987,12 @@ struct wmOperatorType {
const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT;
/** Optional panel for redo and repeat, auto-generated if not set. */
void (*ui)(bContext *, wmOperator *);
void (*ui)(bContext *C, wmOperator *op);
/**
* Optional check for whether the #ui callback should be called (usually to create the redo
* panel interface).
*/
bool (*ui_poll)(wmOperatorType *, PointerRNA *);
bool (*ui_poll)(wmOperatorType *ot, PointerRNA *ptr);
/**
* Return a different name to use in the user interface, based on property values.
@@ -1002,13 +1002,13 @@ struct wmOperatorType {
* any definition of an operator button through the layout API will fail to execute it). See
* #112253 for details.
*/
std::string (*get_name)(wmOperatorType *, PointerRNA *);
std::string (*get_name)(wmOperatorType *ot, PointerRNA *ptr);
/**
* Return a different description to use in the user interface, based on property values.
* The returned string is expected to be translated if needed.
*/
std::string (*get_description)(bContext *C, wmOperatorType *, PointerRNA *);
std::string (*get_description)(bContext *C, wmOperatorType *op, PointerRNA *ptr);
/** RNA for properties */
StructRNA *srna;
@@ -1032,7 +1032,7 @@ struct wmOperatorType {
wmKeyMap *modalkeymap;
/** Python needs the operator type as well. */
bool (*pyop_poll)(bContext *, wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT;
bool (*pyop_poll)(bContext *C, wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT;
/** RNA integration */
ExtensionRNA rna_ext;
@@ -1156,7 +1156,10 @@ struct wmDragGreasePencilLayer {
GreasePencilLayer *layer;
};
using WMDropboxTooltipFunc = char *(*)(bContext *, wmDrag *, const int xy[2], wmDropBox *drop);
using WMDropboxTooltipFunc = char *(*)(bContext *C,
wmDrag *drag,
const int xy[2],
wmDropBox *drop);
struct wmDragActiveDropState {
/**