[Bf-blender-cvs] [3633221c9bf] gsoc-2018-many-light-sampling: Cleanup: strip trailing space from interface files
Campbell Barton
noreply at git.blender.org
Fri Jun 1 16:17:17 CEST 2018
Commit: 3633221c9bf12953b944216df53aa55d901d5ce6
Author: Campbell Barton
Date: Wed May 23 10:47:12 2018 +0200
Branches: gsoc-2018-many-light-sampling
https://developer.blender.org/rB3633221c9bf12953b944216df53aa55d901d5ce6
Cleanup: strip trailing space from interface files
===================================================================
M source/blender/editors/interface/interface.c
M source/blender/editors/interface/interface_align.c
M source/blender/editors/interface/interface_anim.c
M source/blender/editors/interface/interface_draw.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_ops.c
M source/blender/editors/interface/interface_panel.c
M source/blender/editors/interface/interface_regions.c
M source/blender/editors/interface/interface_style.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/resources.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 5f36c5e21bf..882d7de9af9 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -85,7 +85,7 @@
/**
* a full doc with API notes can be found in 'blender/doc/guides/interface_API.txt'
- *
+ *
* `uiBlahBlah()` external function.
* `ui_blah_blah()` internal function.
*/
@@ -290,7 +290,7 @@ void ui_block_bounds_calc(uiBlock *block)
{
uiBut *bt;
int xof;
-
+
if (BLI_listbase_is_empty(&block->buttons)) {
if (block->panel) {
block->rect.xmin = 0.0; block->rect.xmax = block->panel->sizex;
@@ -298,13 +298,13 @@ void ui_block_bounds_calc(uiBlock *block)
}
}
else {
-
+
BLI_rctf_init_minmax(&block->rect);
for (bt = block->buttons.first; bt; bt = bt->next) {
BLI_rctf_union(&block->rect, &bt->rect);
}
-
+
block->rect.xmin -= block->bounds;
block->rect.ymin -= block->bounds;
block->rect.xmax += block->bounds;
@@ -313,7 +313,7 @@ void ui_block_bounds_calc(uiBlock *block)
block->rect.xmax = block->rect.xmin + max_ff(BLI_rctf_size_x(&block->rect), block->minbounds);
- /* hardcoded exception... but that one is annoying with larger safety */
+ /* hardcoded exception... but that one is annoying with larger safety */
bt = block->buttons.first;
if (bt && STREQLEN(bt->str, "ERROR", 5)) xof = 10;
else xof = 40;
@@ -329,7 +329,7 @@ static void ui_block_bounds_calc_centered(wmWindow *window, uiBlock *block)
int xmax, ymax;
int startx, starty;
int width, height;
-
+
/* note: this is used for the splash where window bounds event has not been
* updated by ghost, get the window bounds from ghost directly */
@@ -337,18 +337,18 @@ static void ui_block_bounds_calc_centered(wmWindow *window, uiBlock *block)
ymax = WM_window_pixels_y(window);
ui_block_bounds_calc(block);
-
+
width = BLI_rctf_size_x(&block->rect);
height = BLI_rctf_size_y(&block->rect);
-
+
startx = (xmax * 0.5f) - (width * 0.5f);
starty = (ymax * 0.5f) - (height * 0.5f);
-
+
ui_block_translate(block, startx - block->rect.xmin, starty - block->rect.ymin);
-
+
/* now recompute bounds and safety */
ui_block_bounds_calc(block);
-
+
}
static void ui_block_bounds_calc_centered_pie(uiBlock *block)
@@ -378,7 +378,7 @@ static void ui_block_bounds_calc_popup(
/* compute mouse position with user defined offset */
ui_block_bounds_calc(block);
-
+
xmax = WM_window_pixels_x(window);
ymax = WM_window_pixels_y(window);
@@ -436,7 +436,7 @@ void UI_block_bounds_set_normal(uiBlock *block, int addval)
{
if (block == NULL)
return;
-
+
block->bounds = addval;
block->bounds_type = UI_BLOCK_BOUNDS;
}
@@ -511,12 +511,12 @@ static void ui_draw_linkline(uiLinkLine *line, int highlightActiveLines, int das
rcti rect;
if (line->from == NULL || line->to == NULL) return;
-
+
rect.xmin = BLI_rctf_cent_x(&line->from->rect);
rect.ymin = BLI_rctf_cent_y(&line->from->rect);
rect.xmax = BLI_rctf_cent_x(&line->to->rect);
rect.ymax = BLI_rctf_cent_y(&line->to->rect);
-
+
if (dashInactiveLines)
UI_ThemeColor(TH_GRID);
else if (line->flag & UI_SELECT)
@@ -629,12 +629,12 @@ static void ui_but_update_linklines(uiBlock *block, uiBut *oldbut, uiBut *newbut
{
uiLinkLine *line;
uiBut *but;
-
+
/* if active button is UI_BTYPE_LINK */
if (newbut->type == UI_BTYPE_LINK && newbut->link) {
-
+
SWAP(uiLink *, oldbut->link, newbut->link);
-
+
for (line = oldbut->link->lines.first; line; line = line->next) {
if (line->to == newbut)
line->to = oldbut;
@@ -642,7 +642,7 @@ static void ui_but_update_linklines(uiBlock *block, uiBut *oldbut, uiBut *newbut
line->from = oldbut;
}
}
-
+
/* check all other button links */
for (but = block->buttons.first; but; but = but->next) {
if (but != newbut && but->type == UI_BTYPE_LINK && but->link) {
@@ -811,7 +811,7 @@ bool UI_but_active_only(const bContext *C, ARegion *ar, uiBlock *block, uiBut *b
uiBlock *oldblock;
uiBut *oldbut;
bool activate = false, found = false, isactive = false;
-
+
oldblock = block->oldblock;
if (!oldblock) {
activate = true;
@@ -834,7 +834,7 @@ bool UI_but_active_only(const bContext *C, ARegion *ar, uiBlock *block, uiBut *b
ui_but_free(C, but);
return false;
}
-
+
return true;
}
@@ -1038,27 +1038,27 @@ static bool ui_but_event_property_operator_string(
"WM_OT_context_cycle_array",
"WM_OT_context_menu_enum",
NULL
- };
+ };
const size_t num_ops = sizeof(ctx_toggle_opnames) / sizeof(const char *);
-
+
bool found = false;
-
+
/* this version is only for finding hotkeys for properties (which get set via context using operators) */
if (but->rnaprop) {
- /* to avoid massive slowdowns on property panels, for now, we only check the
+ /* to avoid massive slowdowns on property panels, for now, we only check the
* hotkeys for Editor / Scene settings...
*
* TODO: userpref settings?
*/
// TODO: value (for enum stuff)?
char *data_path = NULL;
-
+
if (but->rnapoin.id.data) {
ID *id = but->rnapoin.id.data;
-
+
if (GS(id->name) == ID_SCR) {
- /* screen/editor property
- * NOTE: in most cases, there is actually no info for backwards tracing
+ /* screen/editor property
+ * NOTE: in most cases, there is actually no info for backwards tracing
* how to get back to ID from the editor data we may be dealing with
*/
if (RNA_struct_is_a(but->rnapoin.type, &RNA_Space)) {
@@ -1079,7 +1079,7 @@ static bool ui_but_event_property_operator_string(
}
else if (GS(id->name) == ID_SCE) {
if (RNA_struct_is_a(but->rnapoin.type, &RNA_ToolSettings)) {
- /* toolsettings property
+ /* toolsettings property
* NOTE: toolsettings is usually accessed directly (i.e. not through scene)
*/
data_path = RNA_path_from_ID_to_property(&but->rnapoin, but->rnaprop);
@@ -1087,7 +1087,7 @@ static bool ui_but_event_property_operator_string(
else {
/* scene property */
char *path = RNA_path_from_ID_to_property(&but->rnapoin, but->rnaprop);
-
+
if (path) {
data_path = BLI_sprintfN("scene.%s", path);
MEM_freeN(path);
@@ -1103,23 +1103,23 @@ static bool ui_but_event_property_operator_string(
else {
//puts("other id");
}
-
+
//printf("prop shortcut: '%s' (%s)\n", RNA_property_identifier(but->rnaprop), data_path);
}
-
+
/* we have a datapath! */
if (data_path) {
size_t i;
-
+
/* create a property to host the "datapath" property we're sending to the operators */
IDProperty *prop_path;
IDProperty *prop_path_value;
-
+
IDPropertyTemplate val = {0};
prop_path = IDP_New(IDP_GROUP, &val, __func__);
prop_path_value = IDP_NewString(data_path, "data_path", strlen(data_path) + 1);
IDP_AddToGroup(prop_path, prop_path_value);
-
+
/* check each until one works... */
for (i = 0; (i < num_ops) && (ctx_toggle_opnames[i]); i++) {
if (WM_key_event_operator_string(
@@ -1130,14 +1130,14 @@ static bool ui_but_event_property_operator_string(
break;
}
}
-
+
/* cleanup */
IDP_FreeProperty(prop_path);
MEM_freeN(prop_path);
MEM_freeN(data_path);
}
}
-
+
return found;
}
@@ -1294,7 +1294,7 @@ void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2], int r_x
if (block->flag & UI_BLOCK_LOOP) {
ui_menu_block_set_keymaps(C, block);
}
-
+
/* after keymaps! */
switch (block->bounds_type) {
case UI_BLOCK_BOUNDS_NONE:
@@ -1342,12 +1342,12 @@ void ui_fontscale(short *points, float aspect)
{
if (aspect < 0.9f || aspect > 1.1f) {
float pointsf = *points;
-
+
/* for some reason scaling fonts goes too fast compared to widget size */
/* XXX not true anymore? (ton) */
//aspect = sqrt(aspect);
pointsf /= aspect;
-
+
if (aspect > 1.0f)
*points = ceilf(pointsf);
else
@@ -1373,7 +1373,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
uiBut *but;
rcti rect;
int multisample_enabled;
-
+
/* get menu region or area region */
ar = CTX_wm_menu(C);
if (!ar)
@@ -1389,16 +1389,16 @@ void UI_block_draw(const bContext *C, uiBlock *block)
/* we set this only once */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
+
/* scale fonts */
ui_fontscale(&style.paneltitle.points, block->aspect);
ui_fontscale(&style.grouplabel.points, block->aspect);
ui_fontscale(&style.widgetlabel.points, block->aspect);
ui_fontscale(&style.widget.points, block->aspect);
-
+
/* scale block min/max to rect */
ui_but_to_pixelrect(&rect, ar, block, NULL);
-
+
/* pixel space for AA widgets */
glMatrixMode(GL_PROJECTION);
glPushMatrix();
@@ -1407,7 +1407,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
glLoadIdentity();
wmOrtho2_region_pixelspace(ar);
-
+
/* back */
if (block->flag & UI_BLOCK_RADIAL)
ui_draw_pie_center(block);
@@ -1420,14 +1420,14 @@ void UI_block_draw(const bContext *C, uiBlock *block)
for (but = block->buttons.first; but; but = but->next) {
if (!(but->flag & (UI_HIDDEN | UI_SCROLLED))) {
ui_but_to_pixelrect(&rect, ar, block, but);
-
+
/* XXX: figure out why invalid coordinates happen when closing render window */
/* and material preview is redrawn in main window (temp fix for bug #23848) */
if (rect.xmin < rect.xmax && rect.ymin < rect.ymax)
ui_draw_but(C, ar, &style, but, &rect);
}
}
-
+
/* restore matrix */
glMatrixMode(GL_PROJECTION);
glPopMatrix();
@@ -1436,7 +1436,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
if (multisample_enabled)
glEnable(GL_MULTISAMPLE);
-
+
ui_draw_links(block);
}
@@ -1524,7 +1524,7 @@ static void ui_but_update_select_flag(uiBut *but, double *value)
static uiBut *ui_linkline_find_inlink(uiBlock *block, void *poin)
{
uiBut *but;
-
+
but = block->buttons.first;
while (but) {
if (but->type == UI_BTYPE_INLINK) {
@@ -1538,7 +1538,7 @@ static uiBut *ui_linkline_find_inlink(uiBlock *block, void *poin)
static void ui_linkline_add(ListBase *listb, uiBut *but, uiBut *bt, short deactive)
{
uiLinkLine *lin
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list