[Bf-blender-cvs] [6dbe96757bc] master: Cleanup: return argument naming
Campbell Barton
noreply at git.blender.org
Mon Mar 25 02:21:54 CET 2019
Commit: 6dbe96757bc345efa8a432861b057f65b26ae69f
Author: Campbell Barton
Date: Mon Mar 25 12:19:55 2019 +1100
Branches: master
https://developer.blender.org/rB6dbe96757bc345efa8a432861b057f65b26ae69f
Cleanup: return argument naming
===================================================================
M source/blender/editors/include/UI_interface.h
M source/blender/editors/include/UI_view2d.h
M source/blender/editors/interface/interface_handlers.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_widgets.c
M source/blender/editors/interface/view2d.c
===================================================================
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 45b379f42ee..f6014f58043 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -906,7 +906,7 @@ int UI_autocomplete_end(AutoComplete *autocpl, char *autoname);
* not clear yet so we postpone that. */
void UI_panels_begin(const struct bContext *C, struct ARegion *ar);
-void UI_panels_end(const struct bContext *C, struct ARegion *ar, int *x, int *y);
+void UI_panels_end(const struct bContext *C, struct ARegion *ar, int *r_x, int *r_y);
void UI_panels_draw(const struct bContext *C, struct ARegion *ar);
struct Panel *UI_panel_find_by_type(struct ListBase *lb, struct PanelType *pt);
@@ -916,7 +916,7 @@ struct Panel *UI_panel_begin(
bool *r_open);
void UI_panel_end(uiBlock *block, int width, int height);
void UI_panels_scale(struct ARegion *ar, float new_width);
-void UI_panel_label_offset(struct uiBlock *block, int *x, int *y);
+void UI_panel_label_offset(struct uiBlock *block, int *r_x, int *r_y);
int UI_panel_size_y(const struct Panel *pa);
bool UI_panel_category_is_visible(struct ARegion *ar);
@@ -1034,7 +1034,7 @@ enum {
uiLayout *UI_block_layout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, struct uiStyle *style);
void UI_block_layout_set_current(uiBlock *block, uiLayout *layout);
-void UI_block_layout_resolve(uiBlock *block, int *x, int *y);
+void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y);
void UI_region_message_subscribe(struct ARegion *ar, struct wmMsgBus *mbus);
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h
index df1dd0f5f63..98e00eab9c9 100644
--- a/source/blender/editors/include/UI_view2d.h
+++ b/source/blender/editors/include/UI_view2d.h
@@ -209,10 +209,10 @@ bool UI_view2d_view_to_region_rcti_clip(struct View2D *v2d, const struct rctf *
struct View2D *UI_view2d_fromcontext(const struct bContext *C);
struct View2D *UI_view2d_fromcontext_rwin(const struct bContext *C);
-void UI_view2d_scale_get(struct View2D *v2d, float *x, float *y);
-void UI_view2d_scale_get_inverse(struct View2D *v2d, float *x, float *y);
+void UI_view2d_scale_get(struct View2D *v2d, float *r_x, float *r_y);
+void UI_view2d_scale_get_inverse(struct View2D *v2d, float *r_x, float *r_y);
-void UI_view2d_center_get(struct View2D *v2d, float *x, float *y);
+void UI_view2d_center_get(struct View2D *v2d, float *r_x, float *r_y);
void UI_view2d_center_set(struct View2D *v2d, float x, float y);
void UI_view2d_offset(struct View2D *v2d, float xfac, float yfac);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index b79bf86c03f..7448de07e0e 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -6016,7 +6016,7 @@ static bool ui_numedit_but_HSVCIRCLE(
}
- ui_hsvcircle_vals_from_pos(hsv, hsv + 1, &rect, mx_fl, my_fl);
+ ui_hsvcircle_vals_from_pos(&rect, mx_fl, my_fl, hsv, hsv + 1);
if ((cpicker->use_color_cubic) && (U.color_picker_type == USER_CP_CIRCLE_HSV)) {
hsv[1] = 1.0f - sqrt3f(1.0f - hsv[1]);
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 2b0bf853cae..58d81be1b51 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -462,8 +462,8 @@ extern void ui_but_v3_get(uiBut *but, float vec[3]);
extern void ui_but_v3_set(uiBut *but, const float vec[3]);
extern void ui_hsvcircle_vals_from_pos(
- float *val_rad, float *val_dist, const rcti *rect,
- const float mx, const float my);
+ const rcti *rect, const float mx, const float my,
+ float *r_val_rad, float *r_val_dist);
extern void ui_hsvcircle_pos_from_vals(const ColorPicker *cpicker, const rcti *rect, const float *hsv, float *xpos, float *ypos);
extern void ui_hsvcube_pos_from_vals(const struct uiBut *but, const rcti *rect, const float *hsv, float *xp, float *yp);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index bb3172d7174..160b12526b8 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -2135,24 +2135,24 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname
/* Pointer RNA button with search */
-static void search_id_collection(StructRNA *ptype, PointerRNA *ptr, PropertyRNA **prop)
+static void search_id_collection(StructRNA *ptype, PointerRNA *r_ptr, PropertyRNA **r_prop)
{
StructRNA *srna;
/* look for collection property in Main */
/* Note: using global Main is OK-ish here, UI shall not access other Mains anyay... */
- RNA_main_pointer_create(G_MAIN, ptr);
+ RNA_main_pointer_create(G_MAIN, r_ptr);
- *prop = NULL;
+ *r_prop = NULL;
- RNA_STRUCT_BEGIN (ptr, iprop)
+ RNA_STRUCT_BEGIN (r_ptr, iprop)
{
/* if it's a collection and has same pointer type, we've got it */
if (RNA_property_type(iprop) == PROP_COLLECTION) {
- srna = RNA_property_pointer_type(ptr, iprop);
+ srna = RNA_property_pointer_type(r_ptr, iprop);
if (ptype == srna) {
- *prop = iprop;
+ *r_prop = iprop;
break;
}
}
@@ -4442,7 +4442,7 @@ static void ui_item_layout(uiItem *item)
}
}
-static void ui_layout_end(uiBlock *block, uiLayout *layout, int *x, int *y)
+static void ui_layout_end(uiBlock *block, uiLayout *layout, int *r_x, int *r_y)
{
if (layout->root->handlefunc) {
UI_block_func_handle_set(block, layout->root->handlefunc, layout->root->argv);
@@ -4451,11 +4451,11 @@ static void ui_layout_end(uiBlock *block, uiLayout *layout, int *x, int *y)
ui_item_estimate(&layout->item);
ui_item_layout(&layout->item);
- if (x) {
- *x = layout->x;
+ if (r_x) {
+ *r_x = layout->x;
}
- if (y) {
- *y = layout->y;
+ if (r_y) {
+ *r_y = layout->y;
}
}
@@ -4599,17 +4599,17 @@ void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv)
layout->root->argv = argv;
}
-void UI_block_layout_resolve(uiBlock *block, int *x, int *y)
+void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
{
uiLayoutRoot *root;
BLI_assert(block->active);
- if (x) {
- *x = 0;
+ if (r_x) {
+ *r_x = 0;
}
- if (y) {
- *y = 0;
+ if (r_y) {
+ *r_y = 0;
}
block->curlayout = NULL;
@@ -4618,7 +4618,7 @@ void UI_block_layout_resolve(uiBlock *block, int *x, int *y)
ui_layout_add_padding_button(root);
/* NULL in advance so we don't interfere when adding button */
- ui_layout_end(block, root->layout, x, y);
+ ui_layout_end(block, root->layout, r_x, r_y);
ui_layout_free(root->layout);
}
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 9146e537dd5..c34992ceb9c 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -191,9 +191,9 @@ static bool panel_active_animation_changed(ListBase *lb, Panel **pa_animation, b
return false;
}
-static bool panels_need_realign(ScrArea *sa, ARegion *ar, Panel **pa_animate)
+static bool panels_need_realign(ScrArea *sa, ARegion *ar, Panel **r_pa_animate)
{
- *pa_animate = NULL;
+ *r_pa_animate = NULL;
if (sa->spacetype == SPACE_PROPERTIES && ar->regiontype == RGN_TYPE_WINDOW) {
SpaceProperties *sbuts = sa->spacedata.first;
@@ -219,7 +219,7 @@ static bool panels_need_realign(ScrArea *sa, ARegion *ar, Panel **pa_animate)
/* Detect panel marked for animation, if we're not already animating. */
if (pa_animation) {
if (!no_animation) {
- *pa_animate = pa_animation;
+ *r_pa_animate = pa_animation;
}
return true;
}
@@ -630,16 +630,16 @@ static void ui_draw_panel_dragwidget(uint pos, uint col, const rctf *rect)
}
/* For button layout next to label. */
-void UI_panel_label_offset(uiBlock *block, int *x, int *y)
+void UI_panel_label_offset(uiBlock *block, int *r_x, int *r_y)
{
Panel *panel = block->panel;
const bool is_subpanel = (panel->type && panel->type->parent);
- *x = UI_UNIT_X * 1.0f;
- *y = UI_UNIT_Y * 1.5f;
+ *r_x = UI_UNIT_X * 1.0f;
+ *r_y = UI_UNIT_Y * 1.5f;
if (is_subpanel) {
- *x += (0.7f * UI_UNIT_X);
+ *r_x += (0.7f * UI_UNIT_X);
}
}
@@ -1167,7 +1167,7 @@ static bool uiAlignPanelStep(ScrArea *sa, ARegion *ar, const float fac, const bo
return done;
}
-static void ui_panels_size(ScrArea *sa, ARegion *ar, int *x, int *y)
+static void ui_panels_size(ScrArea *sa, ARegion *ar, int *r_x, int *r_y)
{
Panel *pa;
int align = panel_aligned(sa, ar);
@@ -1200,8 +1200,8 @@ static void ui_panels_size(ScrArea *sa, ARegion *ar, int *x, int *y)
sizey = -UI_PANEL_WIDTH;
}
- *x = sizex;
- *y = sizey;
+ *r_x = sizex;
+ *r_y = sizey;
}
static void ui_do_animate(const bContext *C, Panel *panel)
@@ -1250,7 +1250,7 @@ void UI_panels_begin(const bContext *UNUSED(C), ARegion *ar)
}
/* only draws blocks with panels */
-void UI_panels_end(const bContext *C, ARegion *ar, int *x, int *y)
+void UI_panels_end(const bContext *C, ARegion *ar, int *r_x, int *r_y)
{
ScrArea *sa = CTX_wm_area(C);
uiBlock *block;
@@ -1313,7 +1313,7 @@ void UI_panels_end(const bContext *C, ARegion *ar, int *x, int *y)
}
/* compute size taken up by panel */
- ui_panels_size(sa, ar, x, y);
+ ui_panels_size(sa, ar, r_x, r_y);
}
void UI_panels_draw(const bContext *C, ARegion *ar)
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index f99cf389935..be571de4c4e 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2680,8 +2680,8 @@ static void ui_hsv_cursor(float x, float y)
}
void ui_hsvcircle_vals_from_pos(
- float *val_rad, float *val_dist, const rcti *rect,
- const float mx, const float my)
+ const rcti *rect, const float mx, const float my,
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list