Commit Graph

21 Commits

Author SHA1 Message Date
Campbell Barton
3933f45f52 Cleanup: move doc-strings to declarations
Move into headers or to the top of the function body for internal
implementation details, in some cases remove duplicate doc-strings.
2025-04-18 22:58:36 +10:00
Brecht Van Lommel
3725fad82f Cleanup: Various clang-tidy warnings in editors
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
920e709069 Refactor: Make header files more clangd and clang-tidy friendly
When using clangd or running clang-tidy on headers there are
currently many errors. These are noisy in IDEs, make auto fixes
impossible, and break features like code completion, refactoring
and navigation.

This makes source/blender headers work by themselves, which is
generally the goal anyway. But #includes and forward declarations
were often incomplete.

* Add #includes and forward declarations
* Add IWYU pragma: export in a few places
* Remove some unused #includes (but there are many more)
* Tweak ShaderCreateInfo macros to work better with clangd

Some types of headers still have errors, these could be fixed or
worked around with more investigation. Mostly preprocessor
template headers like NOD_static_types.h.

Note that that disabling WITH_UNITY_BUILD is required for clangd to
work properly, otherwise compile_commands.json does not contain
the information for the relevant source files.

For more details see the developer docs:
https://developer.blender.org/docs/handbook/tooling/clangd/

Pull Request: https://projects.blender.org/blender/blender/pulls/132608
2025-01-07 12:39:13 +01:00
Julian Eisel
f0db870822 UI: Support persistent view state, write tree-view height to files
Adds support for saving some view state persistently and uses this to keep the
height of a tree-view, even as the region containing it is hidden, or the file
re-loaded.

Fixes #129058.

Basically the design is to have state stored in the region, so it can be saved
to files. Views types (tree-view, grid-view, etc) can decide themselves if they
have state to be preserved, and what state that is. If a view wants to preserve
state, it's stored in a list inside the region, identified by the view's idname.

Limitation is that multiple instances of the same view would share these bits of
state, in practice I don't think that's ever an issue.

More state can be added to be preserved as needed. Since different kinds of
views may require different state, I was thinking we could add ID properties to
`uiViewState` even, making it much more dynamic.

Pull Request: https://projects.blender.org/blender/blender/pulls/130292
2024-11-18 18:19:48 +01:00
Campbell Barton
9be29e1bbc Cleanup: match function & declaration names 2024-09-15 23:14:07 +10:00
Campbell Barton
111a40239a Cleanup: match argument names for function & declarations
Match function and declaration names, picking names based on
consistency with related code & clarity.

Also changes for old conventions, missed in previous cleanups:

- name -> filepath
- tname -> newname
- maxlen -> maxncpy
2024-07-27 13:32:51 +10:00
Campbell Barton
d5d1025e94 Cleanup: use const pointer arguments 2024-04-03 10:22:05 +11:00
Harley Acheson
d0eacbd6ba Merge branch 'blender-v4.1-release' 2024-03-20 09:07:40 -07:00
Harley Acheson
afbd733047 Fix #119635: File Browser Horizontal Display Never Compact
File Browser listings can clip content, remove columns, etc as the
available space narrows. This PR just makes this never happen for
the horizontal display mode, where files are shown in multiple columns,
as this is not applicable.

Pull Request: https://projects.blender.org/blender/blender/pulls/119673
2024-03-20 17:06:38 +01:00
Brecht Van Lommel
7a395e2e7f Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was f57e4c5b98.

After this one more fix was committed, this one is preserved as well:
67bd678887.
2024-03-18 15:04:12 +01:00
Hans Goudey
8b014b34aa Cleanup: Move some asset browser code to proper namespace
Also remove an unnecessary C wrapper of a C++ class.
2024-03-07 16:23:35 -05:00
Hans Goudey
2043df4816 Cleanup: Remove unnecessary AssetLibrary C wrapper type 2024-01-26 18:15:41 -05:00
Harley Acheson
07820b0703 UI: File Browser Display Narrowing
Change the format of columns, and remove columns, as the File Browser
window narrows.

Pull Request: https://projects.blender.org/blender/blender/pulls/112464
2023-11-17 00:11:40 +01:00
Hans Goudey
0c1bb82fc4 Cleanup: Remove unnecessary struct and typedef keywords from C++ headers 2023-11-14 09:51:41 +01:00
Harley Acheson
01c2f72f26 UI: Remove File Browser "small_size" Feature
Remove non-working feature that changes File Browser list view when the
thumbnails are smaller than 64x64.

Pull Request: https://projects.blender.org/blender/blender/pulls/112696
2023-09-22 17:47:42 +02:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
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.
2023-08-16 00:20:26 +10:00
Hans Goudey
c15d391e86 Cleanup: Various cleanups in newly C++ headers
Mostly remove unnecessary struct and typedef keywords.
Move a few more small wm headers to C++ as well.
2023-08-04 17:55:14 -04:00
Hans Goudey
8bb8cfb54e Cleanup: Remove unnecessary struct keyword from C++ headers
Pull Request: https://projects.blender.org/blender/blender/pulls/110734
2023-08-03 01:11:28 +02:00
Campbell Barton
d260e7f1ce Build: attempt to resolve a linking error on WIN32 2023-08-01 22:56:03 +10:00
Julian Eisel
3d6aed39b9 Cleanup: C++ cleanup for File Browser headers recently converted to C++
C++ Conversion Background: #103343

Generally these changes reduce visual noise in header files.
2023-08-01 12:29:39 +02:00
Julian Eisel
7bbf2f6754 Cleanup: Compile internal File/Asset Browser headers in C++
C++ Conversion Background: #103343
2023-08-01 12:21:56 +02:00