[Bf-blender-cvs] [6b26024ea41] master: Cleanup: comment length in interface

Campbell Barton noreply at git.blender.org
Wed Apr 17 08:53:46 CEST 2019


Commit: 6b26024ea41f4ec25bf52872c18f08ec8f78138a
Author: Campbell Barton
Date:   Wed Apr 17 08:44:38 2019 +0200
Branches: master
https://developer.blender.org/rB6b26024ea41f4ec25bf52872c18f08ec8f78138a

Cleanup: comment length in interface

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

M	source/blender/editors/interface/interface.c
M	source/blender/editors/interface/interface_align.c
M	source/blender/editors/interface/interface_handlers.c
M	source/blender/editors/interface/interface_icons.c
M	source/blender/editors/interface/interface_intern.h
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/interface/interface_region_color_picker.c
M	source/blender/editors/interface/interface_region_hud.c
M	source/blender/editors/interface/interface_region_menu_pie.c
M	source/blender/editors/interface/interface_region_search.c
M	source/blender/editors/interface/interface_region_tooltip.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/interface/interface_utils.c
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/interface/view2d.c
M	source/blender/editors/interface/view2d_ops.c

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

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index a9079cdd021..e6148ba8c93 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2422,8 +2422,10 @@ static float ui_get_but_step_unit(uiBut *but, float step_default)
 }
 
 /**
- * \param float_precision: For number buttons the precision to use or -1 to fallback to the button default.
- * \param use_exp_float: Use exponent representation of floats when out of reasonable range (outside of 1e3/1e-3).
+ * \param float_precision: For number buttons the precision
+ * to use or -1 to fallback to the button default.
+ * \param use_exp_float: Use exponent representation of floats
+ * when out of reasonable range (outside of 1e3/1e-3).
  */
 void ui_but_string_get_ex(uiBut *but,
                           char *str,
@@ -2752,10 +2754,10 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
 
           /* This is kind of hackish, in theory think we could only ever use the second member of
            * this if/else, since ui_searchbox_apply() is supposed to always set that pointer when
-           * we are storing pointers... But keeping str search first for now, to try to break as little as
-           * possible existing code. All this is band-aids anyway.
-           * Fact remains, using editstr as main 'reference' over whole search button thingy is utterly weak
-           * and should be redesigned imho, but that's not a simple task. */
+           * we are storing pointers... But keeping str search first for now,
+           * to try to break as little as possible existing code. All this is band-aids anyway.
+           * Fact remains, using editstr as main 'reference' over whole search button thingy
+           * is utterly weak and should be redesigned imho, but that's not a simple task. */
           if (prop && RNA_property_collection_lookup_string(&ptr, prop, str, &rptr)) {
             RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr);
           }
@@ -6184,9 +6186,9 @@ static void operator_enum_call_cb(struct bContext *UNUSED(C), void *but, void *a
     if (ot->prop) {
       RNA_property_enum_set(opptr, ot->prop, POINTER_AS_INT(arg2));
       /* We do not call op from here, will be called by button code.
-       * ui_apply_but_funcs_after() (in interface_handlers.c) called this func before checking operators,
-       * because one of its parameters is the button itself!
-       */
+       * ui_apply_but_funcs_after() (in interface_handlers.c)
+       * called this func before checking operators,
+       * because one of its parameters is the button itself! */
     }
     else {
       printf("%s: op->prop for '%s' is NULL\n", __func__, ot->idname);
@@ -6195,8 +6197,8 @@ static void operator_enum_call_cb(struct bContext *UNUSED(C), void *but, void *a
 }
 
 /**
- * Same parameters as for uiDefSearchBut, with additional operator type and properties, used by callback
- * to call again the right op with the right options (properties values).
+ * Same parameters as for uiDefSearchBut, with additional operator type and properties,
+ * used by callback to call again the right op with the right options (properties values).
  */
 uiBut *uiDefSearchButO_ptr(uiBlock *block,
                            wmOperatorType *ot,
diff --git a/source/blender/editors/interface/interface_align.c b/source/blender/editors/interface/interface_align.c
index 61f9005ce44..be02def1693 100644
--- a/source/blender/editors/interface/interface_align.c
+++ b/source/blender/editors/interface/interface_align.c
@@ -139,10 +139,11 @@ int ui_but_align_opposite_to_area_align_get(const ARegion *ar)
 }
 
 /**
- * This function checks a pair of buttons (assumed in a same align group), and if they are neighbors,
- * set needed data accordingly.
+ * This function checks a pair of buttons (assumed in a same align group),
+ * and if they are neighbors, set needed data accordingly.
  *
- * \note It is designed to be called in total random order of buttons. Order-based optimizations are done by caller.
+ * \note It is designed to be called in total random order of buttons.
+ * Order-based optimizations are done by caller.
  */
 static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other)
 {
@@ -268,13 +269,15 @@ static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other
  * +-----------+
  * </pre>
  *
- * Here, BUT 3 RIGHT side would not get 'dragged' to align with BUT 1 RIGHT side, since BUT 3 has not RIGHT neighbor.
- * So, this function, when called with BUT 1, will 'walk' the whole column in \a side_s1 direction (TOP or DOWN when
- * called for RIGHT side), and force buttons like BUT 3 to align as needed, if BUT 1 and BUT 3 were detected as needing
- * top-right corner stitching in #block_align_proximity_compute() step.
+ * Here, BUT 3 RIGHT side would not get 'dragged' to align with BUT 1 RIGHT side,
+ * since BUT 3 has not RIGHT neighbor.
+ * So, this function, when called with BUT 1, will 'walk' the whole column in \a side_s1 direction
+ * (TOP or DOWN when called for RIGHT side), and force buttons like BUT 3 to align as needed,
+ * if BUT 1 and BUT 3 were detected as needing top-right corner stitching in
+ * #block_align_proximity_compute() step.
  *
- * \note To avoid doing this twice, some stitching flags are cleared to break the 'stitching connection'
- *       between neighbors.
+ * \note To avoid doing this twice, some stitching flags are cleared to break the
+ * 'stitching connection' between neighbors.
  */
 static void block_align_stitch_neighbors(ButAlign *butal,
                                          const int side,
@@ -290,16 +293,17 @@ static void block_align_stitch_neighbors(ButAlign *butal,
   const int stitch_s1 = STITCH(side_s1);
   const int stitch_s2 = STITCH(side_s2);
 
-  /* We have to check stitching flags on both sides of the stitching, since we only clear one of them flags to break
-   * any future loop on same 'columns/side' case.
-   * Also, if butal is spanning over several rows or columns of neighbors, it may have both of its stitching flags
+  /* We have to check stitching flags on both sides of the stitching,
+   * since we only clear one of them flags to break any future loop on same 'columns/side' case.
+   * Also, if butal is spanning over several rows or columns of neighbors,
+   * it may have both of its stitching flags
    * set, but would not be the case of its immediate neighbor! */
   while ((butal->flags[side] & stitch_s1) && (butal = butal->neighbors[side_s1]) &&
          (butal->flags[side] & stitch_s2)) {
     butal_neighbor = butal->neighbors[side];
 
-    /* If we actually do have a neighbor, we directly set its values accordingly, and clear its matching 'dist'
-     * to prevent it being set again later... */
+    /* If we actually do have a neighbor, we directly set its values accordingly,
+     * and clear its matching 'dist' to prevent it being set again later... */
     if (butal_neighbor) {
       butal->but->drawflag |= align;
       butal_neighbor->but->drawflag |= align_opp;
@@ -389,7 +393,8 @@ static void ui_block_align_but_to_region(uiBut *but, const ARegion *region)
 /**
  * Compute the alignment of all 'align groups' of buttons in given block.
  *
- * This is using an order-independent algorithm, i.e. alignment of buttons should be OK regardless of order in which
+ * This is using an order-independent algorithm,
+ * i.e. alignment of buttons should be OK regardless of order in which
  * they are added to the block.
  */
 void ui_block_align_calc(uiBlock *block, const ARegion *region)
@@ -404,7 +409,8 @@ void ui_block_align_calc(uiBlock *block, const ARegion *region)
   int side;
   int i, j;
 
-  /* First loop: we count number of buttons belonging to an align group, and clear their align flag.
+  /* First loop: we count number of buttons belonging to an align group,
+   * and clear their align flag.
    * Tabs get some special treatment here, they get aligned to region border. */
   for (but = block->buttons.first; but; but = but->next) {
     /* special case: tabs need to be aligned to a region border, drawflag tells which one */
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 0fe12b21636..f0d9c7ec069 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -205,14 +205,20 @@ static void ui_selectcontext_apply(bContext *C,
 #  define DRAG_MULTINUM_THRESHOLD_DRAG_X (UI_UNIT_Y / 4)
 
 /**
- * how far to drag horizontally before we stop checking which buttons the gesture spans (in pixels),
- * locking down the buttons so we can drag freely without worrying about vertical movement. */
+ * How far to drag horizontally
+ * before we stop checking which buttons the gesture spans (in pixels),
+ * locking down the buttons so we can drag freely without worrying about vertical movement.
+ */
 #  define DRAG_MULTINUM_THRESHOLD_DRAG_Y (UI_UNIT_Y / 4)
 
 /**
- * how strict to be when detecting a vertical gesture, [0.5 == sloppy], [0.9 == strict], (unsigned dot-product)
- * note: we should be quite strict here, since doing a vertical gesture by accident should be avoided,
- * however with some care a user should be able to do a vertical movement without *missing*. */
+ * How strict to be when detecting a vertical gesture:
+ * [0.5 == sloppy], [0.9 == strict], (unsigned dot-product).
+ *
+ * \note We should be quite strict here,
+ * since doing a vertical gesture by accident should be avoided,
+ * however with some care a user should be able to do a vertical movement without _missing_.
+ */
 #  define DRAG_MULTINUM_THRESHOLD_VERTICAL (0.75f)
 
 /* a simple version of uiHandleButtonData when accessing multiple buttons */
@@ -912,8 +918,8 @@ static void ui_apply_but_TEX(bContext *C, uiBut *but, uiHandleButtonData *data)
    * feature used for bone renaming, channels, etc.
    * afterfunc frees rename_orig */
   if (data->origstr && (but->flag & UI_BUT_TEXTEDIT_UPDATE)) {
-    /* In this case, we need to keep origstr available, to restore real org string in

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list