From d886e32270edb8273ec48a41d1bdcef1fe802835 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 23 May 2018 10:47:12 +0200 Subject: Cleanup: strip trailing space from interface files --- source/blender/editors/interface/interface_style.c | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'source/blender/editors/interface/interface_style.c') diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 8b41302b5bb..e5f1a69d3b3 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -4,7 +4,7 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,7 +17,7 @@ * * The Original Code is Copyright (C) 2009 Blender Foundation. * All rights reserved. - * + * * Contributor(s): Blender Foundation * * ***** END GPL LICENSE BLOCK ***** @@ -65,10 +65,10 @@ /* style + theme + layout-engine = UI */ /** - * This is a complete set of layout rules, the 'state' of the Layout - * Engine. Multiple styles are possible, defined via C or Python. Styles - * get a name, and will typically get activated per region type, like - * "Header", or "Listview" or "Toolbar". Properties of Style definitions + * This is a complete set of layout rules, the 'state' of the Layout + * Engine. Multiple styles are possible, defined via C or Python. Styles + * get a name, and will typically get activated per region type, like + * "Header", or "Listview" or "Toolbar". Properties of Style definitions * are: * * - default column properties, internal spacing, aligning, min/max width @@ -85,10 +85,10 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id) { uiStyle *style = MEM_callocN(sizeof(uiStyle), "new style"); - + BLI_addtail(styles, style); BLI_strncpy(style->name, name, MAX_STYLE_NAME); - + style->panelzoom = 1.0; /* unused */ style->paneltitle.uifont_id = uifont_id; @@ -129,14 +129,14 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id style->buttonspacey = 2; style->panelspace = 8; style->panelouter = 4; - + return style; } static uiFont *uifont_to_blfont(int id) { uiFont *font = U.uifonts.first; - + for (; font; font = font->next) { if (font->uifont_id == id) { return font; @@ -154,7 +154,7 @@ void UI_fontstyle_draw_ex( { int xofs = 0, yofs; int font_flag = BLF_CLIPPING; - + UI_fontstyle_set(fs); /* set the flag */ @@ -192,7 +192,7 @@ void UI_fontstyle_draw_ex( else if (fs->align == UI_STYLE_TEXT_RIGHT) { xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, len) - 0.1f * U.widget_unit; } - + /* clip is very strict, so we give it some space */ BLF_clipping(fs->uifont_id, rect->xmin - 2, rect->ymin - 4, rect->xmax + 1, rect->ymax + 4); BLF_position(fs->uifont_id, rect->xmin + xofs, rect->ymin + yofs, 0.0f); @@ -348,16 +348,16 @@ uiStyle *UI_style_get_dpi(void) { uiStyle *style = UI_style_get(); static uiStyle _style; - + _style = *style; - + _style.paneltitle.shadx = (short)(UI_DPI_FAC * _style.paneltitle.shadx); _style.paneltitle.shady = (short)(UI_DPI_FAC * _style.paneltitle.shady); _style.grouplabel.shadx = (short)(UI_DPI_FAC * _style.grouplabel.shadx); _style.grouplabel.shady = (short)(UI_DPI_FAC * _style.grouplabel.shady); _style.widgetlabel.shadx = (short)(UI_DPI_FAC * _style.widgetlabel.shadx); _style.widgetlabel.shady = (short)(UI_DPI_FAC * _style.widgetlabel.shady); - + _style.columnspace = (short)(UI_DPI_FAC * _style.columnspace); _style.templatespace = (short)(UI_DPI_FAC * _style.templatespace); _style.boxspace = (short)(UI_DPI_FAC * _style.boxspace); @@ -365,23 +365,23 @@ uiStyle *UI_style_get_dpi(void) _style.buttonspacey = (short)(UI_DPI_FAC * _style.buttonspacey); _style.panelspace = (short)(UI_DPI_FAC * _style.panelspace); _style.panelouter = (short)(UI_DPI_FAC * _style.panelouter); - + return &_style; } int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str) { int width; - + if (fs->kerning == 1) /* for BLF_width */ BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT); - + UI_fontstyle_set(fs); width = BLF_width(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX); - + if (fs->kerning == 1) BLF_disable(fs->uifont_id, BLF_KERNING_DEFAULT); - + return width; } @@ -402,12 +402,12 @@ void uiStyleInit(void) uiStyle *style = U.uistyles.first; int monofont_size = datatoc_bmonofont_ttf_size; unsigned char *monofont_ttf = (unsigned char *)datatoc_bmonofont_ttf; - + /* recover from uninitialized dpi */ if (U.dpi == 0) U.dpi = 72; CLAMP(U.dpi, 48, 144); - + for (font = U.uifonts.first; font; font = font->next) { BLF_unload_id(font->blf_id); } @@ -438,9 +438,9 @@ void uiStyleInit(void) BLI_strncpy(font->filename, "default", sizeof(font->filename)); font->uifont_id = UIFONT_DEFAULT; } - + for (font = U.uifonts.first; font; font = font->next) { - + if (font->uifont_id == UIFONT_DEFAULT) { #ifdef WITH_INTERNATIONAL int font_size = datatoc_bfont_ttf_size; @@ -492,11 +492,11 @@ void uiStyleInit(void) BLF_size(font->blf_id, 14 * U.pixelsize, U.dpi); } } - + if (style == NULL) { ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT); } - + #ifdef WITH_INTERNATIONAL /* use unicode font for text editor and interactive console */ if (U.transopts & USER_DOTRANSLATE) { @@ -520,7 +520,7 @@ void uiStyleInit(void) } BLF_size(blf_mono_font, 12 * U.pixelsize, 72); - + /** * Second for rendering else we get threading problems, * @@ -536,7 +536,7 @@ void uiStyleInit(void) void UI_fontstyle_set(const uiFontStyle *fs) { uiFont *font = uifont_to_blfont(fs->uifont_id); - + BLF_size(font->blf_id, fs->points * U.pixelsize, U.dpi); } -- cgit v1.2.3