[Bf-blender-cvs] [dd7feb09c9b] master: Cleanup: rename x1/x2/y1/y2 to x/y/width/height

Jacques Lucke noreply at git.blender.org
Fri Mar 19 20:25:07 CET 2021


Commit: dd7feb09c9ba5dc0daac419297b89439dbfdfd80
Author: Jacques Lucke
Date:   Fri Mar 19 20:22:37 2021 +0100
Branches: master
https://developer.blender.org/rBdd7feb09c9ba5dc0daac419297b89439dbfdfd80

Cleanup: rename x1/x2/y1/y2 to x/y/width/height

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

M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface_utils.c

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

diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index d23daf7f0e3..dfe0898a85b 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -1574,10 +1574,10 @@ uiBut *uiDefAutoButR(uiBlock *block,
                      int index,
                      const char *name,
                      int icon,
-                     int x1,
-                     int y1,
-                     int x2,
-                     int y2);
+                     int x,
+                     int y,
+                     int width,
+                     int height);
 eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout,
                                      struct PointerRNA *ptr,
                                      bool (*check_prop)(struct PointerRNA *ptr,
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 877800c1ba2..6ad1de68a1f 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -62,10 +62,10 @@ uiBut *uiDefAutoButR(uiBlock *block,
                      int index,
                      const char *name,
                      int icon,
-                     int x1,
-                     int y1,
-                     int x2,
-                     int y2)
+                     int x,
+                     int y,
+                     int width,
+                     int height)
 {
   uiBut *but = NULL;
 
@@ -80,10 +80,10 @@ uiBut *uiDefAutoButR(uiBlock *block,
                                  UI_BTYPE_ICON_TOGGLE,
                                  0,
                                  icon,
-                                 x1,
-                                 y1,
-                                 x2,
-                                 y2,
+                                 x,
+                                 y,
+                                 width,
+                                 height,
                                  ptr,
                                  prop,
                                  index,
@@ -99,10 +99,10 @@ uiBut *uiDefAutoButR(uiBlock *block,
                                      0,
                                      icon,
                                      name,
-                                     x1,
-                                     y1,
-                                     x2,
-                                     y2,
+                                     x,
+                                     y,
+                                     width,
+                                     height,
                                      ptr,
                                      prop,
                                      index,
@@ -117,10 +117,10 @@ uiBut *uiDefAutoButR(uiBlock *block,
                              UI_BTYPE_CHECKBOX,
                              0,
                              name,
-                             x1,
-                             y1,
-                             x2,
-                             y2,
+                             x,
+                             y,
+                             width,
+                             height,
                              ptr,
                              prop,
                              index,
@@ -136,8 +136,22 @@ uiBut *uiDefAutoButR(uiBlock *block,
     case PROP_FLOAT: {
       if (RNA_property_array_check(prop) && index == -1) {
         if (ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA)) {
-          but = uiDefButR_prop(
-              block, UI_BTYPE_COLOR, 0, name, x1, y1, x2, y2, ptr, prop, -1, 0, 0, 0, 0, NULL);
+          but = uiDefButR_prop(block,
+                               UI_BTYPE_COLOR,
+                               0,
+                               name,
+                               x,
+                               y,
+                               width,
+                               height,
+                               ptr,
+                               prop,
+                               -1,
+                               0,
+                               0,
+                               0,
+                               0,
+                               NULL);
         }
         else {
           return NULL;
@@ -149,10 +163,10 @@ uiBut *uiDefAutoButR(uiBlock *block,
                              UI_BTYPE_NUM_SLIDER,
                              0,
                              name,
-                             x1,
-                             y1,
-                             x2,
-                             y2,
+                             x,
+                             y,
+                             width,
+                             height,
                              ptr,
                              prop,
                              index,
@@ -164,7 +178,7 @@ uiBut *uiDefAutoButR(uiBlock *block,
       }
       else {
         but = uiDefButR_prop(
-            block, UI_BTYPE_NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, 0, 0, NULL);
+            block, UI_BTYPE_NUM, 0, name, x, y, width, height, ptr, prop, index, 0, 0, 0, 0, NULL);
       }
 
       if (RNA_property_flag(prop) & PROP_TEXTEDIT_UPDATE) {
@@ -174,8 +188,22 @@ uiBut *uiDefAutoButR(uiBlock *block,
     }
     case PROP_ENUM:
       if (icon && name && name[0] == '\0') {
-        but = uiDefIconButR_prop(
-            block, UI_BTYPE_MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+        but = uiDefIconButR_prop(block,
+                                 UI_BTYPE_MENU,
+                                 0,
+                                 icon,
+                                 x,
+                                 y,
+                                 width,
+                                 height,
+                                 ptr,
+                                 prop,
+                                 index,
+                                 0,
+                                 0,
+                                 -1,
+                                 -1,
+                                 NULL);
       }
       else if (icon) {
         but = uiDefIconTextButR_prop(block,
@@ -183,10 +211,10 @@ uiBut *uiDefAutoButR(uiBlock *block,
                                      0,
                                      icon,
                                      NULL,
-                                     x1,
-                                     y1,
-                                     x2,
-                                     y2,
+                                     x,
+                                     y,
+                                     width,
+                                     height,
                                      ptr,
                                      prop,
                                      index,
@@ -197,14 +225,42 @@ uiBut *uiDefAutoButR(uiBlock *block,
                                      NULL);
       }
       else {
-        but = uiDefButR_prop(
-            block, UI_BTYPE_MENU, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+        but = uiDefButR_prop(block,
+                             UI_BTYPE_MENU,
+                             0,
+                             name,
+                             x,
+                             y,
+                             width,
+                             height,
+                             ptr,
+                             prop,
+                             index,
+                             0,
+                             0,
+                             -1,
+                             -1,
+                             NULL);
       }
       break;
     case PROP_STRING:
       if (icon && name && name[0] == '\0') {
-        but = uiDefIconButR_prop(
-            block, UI_BTYPE_TEXT, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+        but = uiDefIconButR_prop(block,
+                                 UI_BTYPE_TEXT,
+                                 0,
+                                 icon,
+                                 x,
+                                 y,
+                                 width,
+                                 height,
+                                 ptr,
+                                 prop,
+                                 index,
+                                 0,
+                                 0,
+                                 -1,
+                                 -1,
+                                 NULL);
       }
       else if (icon) {
         but = uiDefIconTextButR_prop(block,
@@ -212,10 +268,10 @@ uiBut *uiDefAutoButR(uiBlock *block,
                                      0,
                                      icon,
                                      name,
-                                     x1,
-                                     y1,
-                                     x2,
-                                     y2,
+                                     x,
+                                     y,
+                                     width,
+                                     height,
                                      ptr,
                                      prop,
                                      index,
@@ -226,8 +282,22 @@ uiBut *uiDefAutoButR(uiBlock *block,
                                      NULL);
       }
       else {
-        but = uiDefButR_prop(
-            block, UI_BTYPE_TEXT, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+        but = uiDefButR_prop(block,
+                             UI_BTYPE_TEXT,
+                             0,
+                             name,
+                             x,
+                             y,
+                             width,
+                             height,
+                             ptr,
+                             prop,
+                             index,
+                             0,
+                             0,
+                             -1,
+                             -1,
+                             NUL

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list