[Bf-blender-cvs] [903d0a35b3f] filebrowser_redesign: Update to new clang-format code style
Julian Eisel
noreply at git.blender.org
Wed Apr 24 15:16:53 CEST 2019
Commit: 903d0a35b3fe0d4bebda21b8134a80f2d67ad751
Author: Julian Eisel
Date: Sat Apr 20 00:14:54 2019 +0200
Branches: filebrowser_redesign
https://developer.blender.org/rB903d0a35b3fe0d4bebda21b8134a80f2d67ad751
Update to new clang-format code style
===================================================================
M source/blender/blenkernel/BKE_blender_version.h
M source/blender/editors/space_file/file_draw.c
M source/blender/editors/space_file/file_intern.h
M source/blender/editors/space_file/space_file.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index e2594832725..2433b856697 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -26,19 +26,19 @@
*
* \note Use #STRINGIFY() rather than defining with quotes.
*/
-#define BLENDER_VERSION 280
-#define BLENDER_SUBVERSION 58
+#define BLENDER_VERSION 280
+#define BLENDER_SUBVERSION 58
/** Several breakages with 280, e.g. collections vs layers. */
-#define BLENDER_MINVERSION 280
-#define BLENDER_MINSUBVERSION 0
+#define BLENDER_MINVERSION 280
+#define BLENDER_MINSUBVERSION 0
/** Used by packaging tools. */
/** Can be left blank, otherwise a,b,c... etc with no quotes. */
#define BLENDER_VERSION_CHAR
/** alpha/beta/rc/release, docs use this. */
-#define BLENDER_VERSION_CYCLE beta
+#define BLENDER_VERSION_CYCLE beta
/** Defined in from blender.c */
extern char versionstr[];
-#endif /* __BKE_BLENDER_VERSION_H__ */
+#endif /* __BKE_BLENDER_VERSION_H__ */
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 41364e648eb..f92c10fd39e 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -68,13 +68,13 @@
#include "filelist.h"
-#include "file_intern.h" // own include
+#include "file_intern.h" // own include
/* Dummy helper - we need dynamic tooltips here. */
static char *file_draw_tooltip_func(bContext *UNUSED(C), void *argN, const char *UNUSED(tip))
{
- char *dyn_tooltip = argN;
- return BLI_strdup(dyn_tooltip);
+ char *dyn_tooltip = argN;
+ return BLI_strdup(dyn_tooltip);
}
#if 0
@@ -93,85 +93,85 @@ static char *file_draw_tooltip_func(bContext *UNUSED(C), void *argN, const char
*/
void file_draw_filepath_buttons(const bContext *C, ARegion *ar)
{
- /* Button layout. */
- const int max_x = ar->winx - 10;
- const int line1_y = ar->winy - (IMASEL_BUTTONS_HEIGHT / 2 + IMASEL_BUTTONS_MARGIN);
- const int line2_y = line1_y - (IMASEL_BUTTONS_HEIGHT / 2 + IMASEL_BUTTONS_MARGIN);
- const int input_minw = 20;
- const int btn_h = UI_UNIT_Y;
- const int btn_fn_w = UI_UNIT_X;
- const int btn_minw = 80;
- const int btn_margin = 20;
- const int separator = 4;
-
- /* Additional locals. */
- char uiblockstr[32];
- int loadbutton;
- int fnumbuttons;
- int min_x = 10;
- int chan_offs = 0;
- int available_w = max_x - min_x;
- int line1_w = available_w;
- int line2_w = available_w;
-
- uiBut *but;
- uiBlock *block;
- SpaceFile *sfile = CTX_wm_space_file(C);
- FileSelectParams *params = ED_fileselect_get_params(sfile);
- ARegion *artmp;
- const bool is_browse_only = (sfile->op == NULL);
-
- /* Initialize UI block. */
- BLI_snprintf(uiblockstr, sizeof(uiblockstr), "win %p", (void *)ar);
- block = UI_block_begin(C, ar, uiblockstr, UI_EMBOSS);
-
- /* exception to make space for collapsed region icon */
- for (artmp = CTX_wm_area(C)->regionbase.first; artmp; artmp = artmp->next) {
- if (artmp->regiontype == RGN_TYPE_TOOLS && artmp->flag & RGN_FLAG_HIDDEN) {
- chan_offs = 16;
- min_x += chan_offs;
- available_w -= chan_offs;
- }
- }
-
- /* Is there enough space for the execute / cancel buttons? */
-
- if (is_browse_only) {
- loadbutton = 0;
- }
- else {
- const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
- loadbutton = UI_fontstyle_string_width(fstyle, params->title) + btn_margin;
- CLAMP_MIN(loadbutton, btn_minw);
- if (available_w <= loadbutton + separator + input_minw) {
- loadbutton = 0;
- }
- }
-
- if (loadbutton) {
- line1_w -= (loadbutton + separator);
- line2_w = line1_w;
- }
-
- /* Is there enough space for file number increment/decrement buttons? */
- fnumbuttons = 2 * btn_fn_w;
- if (!loadbutton || line2_w <= fnumbuttons + separator + input_minw) {
- fnumbuttons = 0;
- }
- else {
- line2_w -= (fnumbuttons + separator);
- }
-
- /* Text input fields for directory and file. */
- if (available_w > 0) {
+ /* Button layout. */
+ const int max_x = ar->winx - 10;
+ const int line1_y = ar->winy - (IMASEL_BUTTONS_HEIGHT / 2 + IMASEL_BUTTONS_MARGIN);
+ const int line2_y = line1_y - (IMASEL_BUTTONS_HEIGHT / 2 + IMASEL_BUTTONS_MARGIN);
+ const int input_minw = 20;
+ const int btn_h = UI_UNIT_Y;
+ const int btn_fn_w = UI_UNIT_X;
+ const int btn_minw = 80;
+ const int btn_margin = 20;
+ const int separator = 4;
+
+ /* Additional locals. */
+ char uiblockstr[32];
+ int loadbutton;
+ int fnumbuttons;
+ int min_x = 10;
+ int chan_offs = 0;
+ int available_w = max_x - min_x;
+ int line1_w = available_w;
+ int line2_w = available_w;
+
+ uiBut *but;
+ uiBlock *block;
+ SpaceFile *sfile = CTX_wm_space_file(C);
+ FileSelectParams *params = ED_fileselect_get_params(sfile);
+ ARegion *artmp;
+ const bool is_browse_only = (sfile->op == NULL);
+
+ /* Initialize UI block. */
+ BLI_snprintf(uiblockstr, sizeof(uiblockstr), "win %p", (void *)ar);
+ block = UI_block_begin(C, ar, uiblockstr, UI_EMBOSS);
+
+ /* exception to make space for collapsed region icon */
+ for (artmp = CTX_wm_area(C)->regionbase.first; artmp; artmp = artmp->next) {
+ if (artmp->regiontype == RGN_TYPE_TOOLS && artmp->flag & RGN_FLAG_HIDDEN) {
+ chan_offs = 16;
+ min_x += chan_offs;
+ available_w -= chan_offs;
+ }
+ }
+
+ /* Is there enough space for the execute / cancel buttons? */
+
+ if (is_browse_only) {
+ loadbutton = 0;
+ }
+ else {
+ const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
+ loadbutton = UI_fontstyle_string_width(fstyle, params->title) + btn_margin;
+ CLAMP_MIN(loadbutton, btn_minw);
+ if (available_w <= loadbutton + separator + input_minw) {
+ loadbutton = 0;
+ }
+ }
+
+ if (loadbutton) {
+ line1_w -= (loadbutton + separator);
+ line2_w = line1_w;
+ }
+
+ /* Is there enough space for file number increment/decrement buttons? */
+ fnumbuttons = 2 * btn_fn_w;
+ if (!loadbutton || line2_w <= fnumbuttons + separator + input_minw) {
+ fnumbuttons = 0;
+ }
+ else {
+ line2_w -= (fnumbuttons + separator);
+ }
+
+ /* Text input fields for directory and file. */
+ if (available_w > 0) {
const struct FileDirEntry *file = sfile->files ?
filelist_file(sfile->files, params->active_file) :
NULL;
- int overwrite_alert = file_draw_check_exists(sfile);
- const bool is_active_dir = file && (file->typeflag & FILE_TYPE_FOLDER);
+ int overwrite_alert = file_draw_check_exists(sfile);
+ const bool is_active_dir = file && (file->typeflag & FILE_TYPE_FOLDER);
- /* callbacks for operator check functions */
- UI_block_func_set(block, file_draw_check_cb, NULL, NULL);
+ /* callbacks for operator check functions */
+ UI_block_func_set(block, file_draw_check_cb, NULL, NULL);
but = uiDefBut(block,
UI_BTYPE_TEXT,
@@ -186,97 +186,103 @@ void file_draw_filepath_buttons(const bContext *C, ARegion *ar)
(float)FILE_MAX,
0,
0,
- TIP_("File path"));
- UI_but_func_complete_set(but, autocomplete_directory, NULL);
- UI_but_flag_enable(but, UI_BUT_NO_UTF8);
- UI_but_flag_disable(but, UI_BUT_UNDO);
- UI_but_funcN_set(but, file_directory_enter_handle, NULL, but);
-
- /* TODO, directory editing is non-functional while a library is loaded
- * until this is properly supported just disable it. */
- if (sfile->files && filelist_lib(sfile->files))
- UI_but_flag_enable(but, UI_BUT_DISABLED);
-
- /* clear func */
- UI_block_func_set(block, NULL, NULL, NULL);
- }
-
- UI_block_end(C, block);
- UI_block_draw(C, block);
+ TIP_("File path"));
+ UI_but_func_complete_set(but, autocomplete_directory, NULL);
+ UI_but_flag_enable(but, UI_BUT_NO_UTF8);
+ UI_but_flag_disable(but, UI_BUT_UNDO);
+ UI_but_funcN_set(but, file_directory_enter_handle, NULL, but);
+
+ /* TODO, directory editing is non-functional while a library is loaded
+ * until this is properly supported just disable it. */
+ if (sfile->files && filelist_lib(sfile->files))
+ UI_but_flag_enable(but, UI_BUT_DISABLED);
+
+ /* clear func */
+ UI_block_func_set(block, NULL, NULL, NULL);
+ }
+
+ UI_block_end(C, block);
+ UI_block_draw(C, block);
}
void file_draw_execute_buttons(const bContext *C, ARegion *ar)
{
- /* Button layout. */
- const int max_x = ar->winx - 10;
- const int line_y = ar->winy - (IMASEL_BUTTONS_HEIGHT / 2 + IMASEL_BUTTONS_MARGIN);
- const int input_minw = 20;
- const int btn_h = UI_UNIT_Y;
- const int btn_fn_w = UI_UNIT_X;
- const int btn_minw = 80;
- const int btn_margin = 20;
- const int separator = 4;
-
- SpaceFile *sfile = CTX_wm_space_file(C);
- FileSelectParams *params = ED_fileselect_get_params(sfile);
- const bool is_browse_only = (sfile->op == NULL);
-
- char uiblockstr[32];
- int loadbutton;
- int min_x = 10;
- int available_w = max_x - min_x;
- int line1_w = available_w;
- int line2_w = available_w;
-
- uiBlock *block;
- uiBut *but;
-
- /* Initialize UI block. */
- BLI_snprintf(uiblockstr, sizeof(uiblockstr), "win %p", (void *)ar);
- block = UI_block_begin(C, ar, uiblockstr, UI_EMBOSS);
-
- if (is_browse_only) {
- loadbutton = 0;
- }
- else {
- const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
- loadbutton = UI_fontstyle_string_width(fstyle, params->title) + btn_margin;
- CLAMP_MIN(loadbutton, btn_minw);
- if (available_w <= loadbutton + separator + input_minw) {
- loadbutton = 0;
- }
- }
-
- const struct FileDirEntry *file = sfile->files ? filelist_file(sfile->files, params->active_file) : NULL;
- int overwrite_alert = file_draw_check_exists(sfile);
- const bool is_active_dir = file && (file->typeflag & FILE_TYPE_FOLDER);
-
- if ((params->flag & FILE_DIRSEL_ONLY) == 0) {
- but = uiDefBut(block, UI_BTYPE_TEXT, -1, "",
- min_x, line_y, line2_w, btn_h,
- is_active_dir ? (char *)"" : params->file,
- 0.0,
- (float)FILE_MAXFILE,
- 0,
- 0,
- TIP_(overwrite_alert ? N_("File name, overwrite existing") : N_("File name")));
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list