[Bf-blender-cvs] [27388f7f46d] master: Cleanup: include argument names for drop-box callbacks

Campbell Barton noreply at git.blender.org
Thu Mar 17 00:24:40 CET 2022


Commit: 27388f7f46db6ce87d89bf1aa3350c899d56f42b
Author: Campbell Barton
Date:   Thu Mar 17 09:52:24 2022 +1100
Branches: master
https://developer.blender.org/rB27388f7f46db6ce87d89bf1aa3350c899d56f42b

Cleanup: include argument names for drop-box callbacks

Indicates typical names for callbacks and allows them to be documented.

===================================================================

M	source/blender/windowmanager/WM_types.h

===================================================================

diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 9edbafafdd3..6df65f2a2a3 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -1167,25 +1167,28 @@ typedef struct wmDropBox {
   struct wmDropBox *next, *prev;
 
   /** Test if the dropbox is active. */
-  bool (*poll)(struct bContext *, struct wmDrag *, const wmEvent *);
+  bool (*poll)(struct bContext *C, struct wmDrag *drag, const wmEvent *event);
 
   /** Before exec, this copies drag info to #wmDrop properties. */
-  void (*copy)(struct wmDrag *, struct wmDropBox *);
+  void (*copy)(struct wmDrag *drag, struct wmDropBox *drop);
 
   /**
-   * If the operator is cancelled (returns `OPERATOR_CANCELLED`), this can be used for cleanup of
+   * If the operator is canceled (returns `OPERATOR_CANCELLED`), this can be used for cleanup of
    * `copy()` resources.
    */
-  void (*cancel)(struct Main *, struct wmDrag *, struct wmDropBox *);
+  void (*cancel)(struct Main *bmain, struct wmDrag *drag, struct wmDropBox *drop);
 
-  /** Override the default drawing function. */
-  void (*draw)(struct bContext *, struct wmWindow *, struct wmDrag *, const int *);
+  /**
+   * Override the default drawing function.
+   * \param xy: Cursor location in window coordinates (#wmEvent.xy compatible).
+   */
+  void (*draw)(struct bContext *C, struct wmWindow *win, struct wmDrag *drag, const int xy[2]);
 
   /** Called when pool returns true the first time. */
-  void (*draw_activate)(struct wmDropBox *, struct wmDrag *drag);
+  void (*draw_activate)(struct wmDropBox *drop, struct wmDrag *drag);
 
   /** Called when pool returns false the first time or when the drag event ends. */
-  void (*draw_deactivate)(struct wmDropBox *, struct wmDrag *drag);
+  void (*draw_deactivate)(struct wmDropBox *drop, struct wmDrag *drag);
 
   /** Custom data for drawing. */
   void *draw_data;



More information about the Bf-blender-cvs mailing list