69 Commits

Author SHA1 Message Date
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
3d3bc74884 Cleanup: remove redundant const qualifiers for POD types
MSVC used to warn about const mismatch for arguments passed by value.
Remove these as newer versions of MSVC no longer show this warning.
2022-01-07 14:16:26 +11:00
9e365069af Cleanup: move public doc-strings into headers for 'blenlib'
- Added space below non doc-string comments to make it clear
  these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.

Ref T92709
2021-12-09 20:01:44 +11:00
Jeroen Bakker
e2f0b4a0cb Cleanup: Use rcti marking dirty regions when texture painting.
Dirty regions when painting are not using rcti. Meaning less
understandable code. Found issue when refactoring the image_gpu partial
update. In a future change gpu partial update API will be using rcti
also what makes the code even cleaner.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D13260
2021-12-07 10:33:23 +01:00
60befc8f02 Clean-up: Fix BLI_rect.h collision with windows.h
windows.h `#defines rct1` as a number which is
problematic if we include `BLI_rect.h` after
`windows.h` .

by renaming `rct1/2` to `rct_a/b` we side step
the collision and straighten up the naming with
the functions directly above it.
2021-11-23 10:51:09 -07:00
7785a9c9d2 BLI_rect: add a float version of the 'pad' function 2020-11-17 23:57:16 +11:00
66800a1deb BLI_rect: add resize_x/y functions
Without this, it's inconvenient to resize a single axis
and doesn't read very well.
2020-10-27 14:07:34 +11:00
2115232a16 Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix
No functional changes
2020-09-04 21:04:16 +02:00
91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
c2b0c64843 UI: Add an outer boundary for edge panning, use in outliner
Currently if you drag and drop an item from the outliner elsewhere in
the Blender window, the outliner will scroll the entire time, even if the
mouse is far away. This commit adds optional behavior for the edge pan
operator that makes it only act if the mouse is close enough to the region.

Differential Revision: https://developer.blender.org/D8193
2020-07-21 10:12:35 -04:00
2d1cce8331 Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
649659aa24 Merge branch 'blender-v2.82-release' 2020-01-27 19:48:54 +11:00
3ca9eaf187 BLI_rect: add rect-rect intersection checks on a single axis 2020-01-27 17:57:51 +11:00
Julian Eisel
388d43d85a BLI_rct: Utilities for sanitizing coordinates (ensuring min <= max)
This might be useful in some places. Much of the code makes the implicit
assumption that the rectangle has valid coordinate order, good to make
it more explicit.
2020-01-14 16:30:38 +01:00
fd7352e5a2 Cleanup: use term pad instead of padding
- Use min/max instead of bottom/top
  (in keeping with the rest of the BLI_rect API).
- Swap args (was passing in max, min).
2019-05-21 22:39:04 +10:00
b03ee4828b Graph Editor: view-selected takes scrubbing and marker region into account 2019-05-21 11:59:15 +02:00
909665a0d4 ClangFormat: run with ReflowComments on source/
Prepare for enabling ReflowComments.
2019-05-01 11:13:14 +10:00
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
dca3d3ef0e Cleanup: use BLI_compiler_compat.h for BLI_INLINE 2018-11-07 12:17:58 +11:00
8cd6e22ec0 Cleanup: use const arg for BLI_rect inside check 2018-09-04 17:33:12 +10:00
c90452e111 BLI_rect: Function to calculate a matrix from 2 rctf's 2017-08-27 16:19:34 +10:00
bddb4de47c Fix T51845 2017-06-23 11:05:54 +03:00
6f3f891c58 Rename BLI_rct*_init_pt_size -> radius 2017-03-08 23:23:39 +11:00
4a4d71414e BLI_rect: add init from point functions
Initialize a rectangle from point+size.
2017-03-05 20:51:23 +11:00
e6aa464757 BLI_rect: add BLI_rctf_clamp
Clamp one rect within another.

This is done inline in the UI code, which gets verbose.
2015-10-17 00:03:29 +11:00
6cee6607a2 UI: avoid subtracting shadow from winrct
For popup interactions we need to know if events are in the region or not,
however subtracting the shadow isn't so reliable, since its not always added to all sides of a popup.

Instead, get the winrct value from a popup using the block rect, otherwise the winrct as-is.
2015-08-18 14:16:58 +10:00
Julian Eisel
939948c233 File Browser Arrow Keys Navigation
Adds support for selecting/deselecting files in File Browser using the
arrow keys. All directions (up, down, left, right) are possible.

When to Select, When to Deselect?
Standard behaviour is selecting, however if we move into a block of
already selected files (meaning 2+ files are selected) we start
deselecting

Possible Selection Methods
Simple selection (arrow-key): All other files are deselected
Expand selection (Shift+arrow key): Add to/remove from existing
selection
ill-Expand selection (Ctrl+Shift+arrow key): Add to/remove from existing
selection and fill everything in-between

From which file do we start navigating?
From each available selection method (Mouse-, Walk-, All-, Border
Select), we use the last selected file. If there's no selection at all
we use the first (down/right arrow) or last (up/left arrow) file.
(Ideally, the view would automatically be set to the new selection, but
this behaviour overlaps with an other patch I've been working on, so
prefer to do that separately)

(Also tweaks color for highlighted file for better feedback)

D1297, Review done by @campbellbarton, thx a lot :)
2015-06-11 17:20:29 +02:00
3eb33b804d Fix T44118: Rotated background image disappears
Image clipping didn't take rotation into account.
2015-03-25 19:49:14 +11:00
a6e8137983 Convenience macro for print_ funcs, saves passing id each time 2014-03-30 15:04:20 +11:00
6a4567b9ab BLI Rect: utility function to transform a point using 2 rect's 2014-03-09 15:48:09 +11:00
72d950ba49 Rectangle API: add single axis intersection check 2013-12-06 18:48:55 +11:00
Lukas Toenne
61c411068b Patch #37274: Circle select for node editor, by Henrik Aarnio (hjaarnio).
Circle select was missing from node editor, and C key was assigned to now defunct "show cyclic dependencies". This patch remaps the key and adds circle select operator.
Functions to check intersection between rctf/rcti and a circle were also added to rct.c for code cleanliness and consistency.
2013-11-06 19:21:42 +00:00
9b5be450d8 text rendering: shadow offset was causing text to clip, now check for clipping without the shadow since not-drawing characters because of subtle effect is rather annoying. 2013-06-06 21:43:52 +00:00
d466e1d3b4 add BLI_rcti,f_recenter()
fix for uninitialized variable use in radial_control_get_properties() and bad cast in bpy api's foreach_parse_args()
2013-03-19 10:54:52 +00:00
221a383366 use 'bool' for BLI_/BKE_ functions. 2013-03-09 05:35:49 +00:00
f68e9db583 add padding for node view-all, view-home operators. 2013-01-11 04:34:15 +00:00
42dc0dc5ef Fix #33226: error loading .blend files with different endian on Mac. The cause
was wrong inline and pure attributes on the endian switch function.
2012-11-26 20:37:04 +00:00
c3ca19800c refactor screen foreach functions to accept float[2] arguments rather then int pairs.
overall means less converting between float and int (and short in some cases).
2012-10-10 01:22:19 +00:00
3ff23b753e rect/point clamping function: BLI_rct*_clamp_pt_v 2012-09-22 12:23:17 +00:00
8e641348f9 fix own error BLI_rctf_cent_x/y were incorrectly returning int's, also quiet some warnings. 2012-09-18 08:00:19 +00:00
232571c61a code cleanup: replace macro for BLI_rect size/center with inline functions. 2012-09-15 11:48:20 +00:00
56b28635e7 code cleanup: rename BLI_in_rctf() --> BLI_rctf_isect_pt(), to conform with our naming convention. 2012-08-23 18:25:45 +00:00
26f073b327 macros for rectangle center and size 2012-08-20 15:29:02 +00:00
ab662a1e02 fix for own commit r49991, this exposed bad logic in rect copy function. 2012-08-18 20:54:43 +00:00
9cce2d8645 smooth-view for 2d views, graph editor, sequencer, node view, works with border zoom, view selected, view all. 2012-08-12 01:07:31 +00:00
7cc5af4ef3 minor refactor for rect functions. more consistent naming. 2012-07-15 00:29:56 +00:00
38f91db37c add bli rect min/max functions. 2012-07-12 09:24:17 +00:00