Listing the "Blender Foundation" as copyright holder implied the Blender Foundation holds copyright to files which may include work from many developers. While keeping copyright on headers makes sense for isolated libraries, Blender's own code may be refactored or moved between files in a way that makes the per file copyright holders less meaningful. Copyright references to the "Blender Foundation" have been replaced with "Blender Authors", with the exception of `./extern/` since these this contains libraries which are more isolated, any changed to license headers there can be handled on a case-by-case basis. Some directories in `./intern/` have also been excluded: - `./intern/cycles/` it's own `AUTHORS` file is planned. - `./intern/opensubdiv/`. An "AUTHORS" file has been added, using the chromium projects authors file as a template. Design task: #110784 Ref !110783.
44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup spfile
|
|
*/
|
|
|
|
#include "BLI_fileops.h"
|
|
#include "BLI_path_util.h"
|
|
#include "BLI_rect.h"
|
|
#include "BLI_string.h"
|
|
|
|
#include "BKE_blendfile.h"
|
|
#include "BKE_context.h"
|
|
|
|
#include "ED_fileselect.hh"
|
|
#include "ED_screen.hh"
|
|
|
|
#include "WM_types.hh"
|
|
|
|
#include "file_intern.hh"
|
|
|
|
void file_tile_boundbox(const ARegion *region, FileLayout *layout, const int file, rcti *r_bounds)
|
|
{
|
|
int xmin, ymax;
|
|
|
|
ED_fileselect_layout_tilepos(layout, file, &xmin, &ymax);
|
|
ymax = int(region->v2d.tot.ymax) - ymax; /* real, view space ymax */
|
|
BLI_rcti_init(r_bounds,
|
|
xmin,
|
|
xmin + layout->tile_w + layout->tile_border_x,
|
|
ymax - layout->tile_h - layout->tile_border_y,
|
|
ymax);
|
|
}
|
|
|
|
void file_path_to_ui_path(const char *path, char *r_path, int max_size)
|
|
{
|
|
char tmp_path[PATH_MAX];
|
|
STRNCPY(tmp_path, path);
|
|
BLI_path_slash_rstrip(tmp_path);
|
|
BLI_strncpy(r_path, BKE_blendfile_extension_check(tmp_path) ? tmp_path : path, max_size);
|
|
}
|