UI: Generalize drop target API, support them for UI views #105963

Closed
Julian Eisel wants to merge 8 commits from JulianEisel:temp-ui-view-drop-controller into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
10 changed files with 39 additions and 40 deletions
Showing only changes of commit 1bbfd4d700 - Show all commits

View File

@ -80,6 +80,7 @@ set(_CLANG_FIND_COMPONENTS
clangAST clangAST
clangLex clangLex
clangBasic clangBasic
clangSupport
) )
set(_CLANG_LIBRARIES) set(_CLANG_LIBRARIES)
@ -94,7 +95,9 @@ foreach(COMPONENT ${_CLANG_FIND_COMPONENTS})
PATH_SUFFIXES PATH_SUFFIXES
lib64 lib lib64 lib
) )
list(APPEND _CLANG_LIBRARIES "${CLANG_${UPPERCOMPONENT}_LIBRARY}") if(CLANG_${UPPERCOMPONENT}_LIBRARY)
list(APPEND _CLANG_LIBRARIES "${CLANG_${UPPERCOMPONENT}_LIBRARY}")
endif()
endforeach() endforeach()

View File

@ -7,7 +7,7 @@ set(INC
) )
set(INC_SYS set(INC_SYS
${X11_X11_INCLUDE_PATH}
) )
set(SRC set(SRC

View File

@ -19,12 +19,13 @@
# undef NOMINMAX # undef NOMINMAX
# endif # endif
# endif # endif
#else
# include <atomic>
# include <mutex>
# include "BLI_map.hh"
#endif #endif
#include <atomic>
#include <mutex>
#include "BLI_map.hh"
#include "BLI_utility_mixins.hh" #include "BLI_utility_mixins.hh"
namespace blender::threading { namespace blender::threading {

View File

@ -64,6 +64,22 @@ template<typename T> class SharedCache {
BLI_assert(cache_->mutex.is_cached()); BLI_assert(cache_->mutex.is_cached());
return cache_->data; return cache_->data;
} }
/**
* Return true if the cache currently does not exist or has been invalidated.
*/
bool is_dirty() const
{
return cache_->mutex.is_dirty();
}
/**
* Return true if the cache exists and is valid.
*/
bool is_cached() const
{
return cache_->mutex.is_cached();
}
}; };
} // namespace blender } // namespace blender

View File

@ -161,8 +161,6 @@ class DeferredLayer {
class DeferredPipeline { class DeferredPipeline {
private: private:
Instance &inst_;
/* Gbuffer filling passes. We could have an arbitrary number of them but for now we just have /* Gbuffer filling passes. We could have an arbitrary number of them but for now we just have
* a hardcoded number of them. */ * a hardcoded number of them. */
DeferredLayer opaque_layer_; DeferredLayer opaque_layer_;
@ -171,7 +169,7 @@ class DeferredPipeline {
public: public:
DeferredPipeline(Instance &inst) DeferredPipeline(Instance &inst)
: inst_(inst), opaque_layer_(inst), refraction_layer_(inst), volumetric_layer_(inst){}; : opaque_layer_(inst), refraction_layer_(inst), volumetric_layer_(inst){};
void begin_sync(); void begin_sync();
void end_sync(); void end_sync();

View File

@ -155,8 +155,6 @@ class AbstractGridView : public AbstractView {
* \{ */ * \{ */
class GridViewBuilder { class GridViewBuilder {
uiBlock &block_;
public: public:
GridViewBuilder(uiBlock &block); GridViewBuilder(uiBlock &block);

View File

@ -389,7 +389,7 @@ uiLayout *GridViewLayoutBuilder::current_layout() const
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
GridViewBuilder::GridViewBuilder(uiBlock &block) : block_(block) GridViewBuilder::GridViewBuilder(uiBlock & /*block*/)
{ {
} }

View File

@ -98,7 +98,7 @@ void initialize_volume_component_from_points(GeoNodeExecParams &params,
return; return;
} }
float voxel_size; float voxel_size = 0.0f;
if (storage.resolution_mode == GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_SIZE) { if (storage.resolution_mode == GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_SIZE) {
voxel_size = params.get_input<float>("Voxel Size"); voxel_size = params.get_input<float>("Voxel Size");
} }
@ -107,6 +107,9 @@ void initialize_volume_component_from_points(GeoNodeExecParams &params,
const float max_radius = *std::max_element(radii.begin(), radii.end()); const float max_radius = *std::max_element(radii.begin(), radii.end());
voxel_size = compute_voxel_size_from_amount(voxel_amount, positions, max_radius); voxel_size = compute_voxel_size_from_amount(voxel_amount, positions, max_radius);
} }
else {
BLI_assert_msg(0, "Unknown volume resolution mode");
}
const double determinant = std::pow(double(voxel_size), 3.0); const double determinant = std::pow(double(voxel_size), 3.0);
if (!BKE_volume_grid_determinant_valid(determinant)) { if (!BKE_volume_grid_determinant_valid(determinant)) {

View File

@ -414,6 +414,7 @@ if(WITH_PYTHON)
DESTINATION ${TARGETDIR_VER} DESTINATION ${TARGETDIR_VER}
PATTERN ".git" EXCLUDE PATTERN ".git" EXCLUDE
PATTERN ".gitignore" EXCLUDE PATTERN ".gitignore" EXCLUDE
PATTERN ".gitea" EXCLUDE
PATTERN ".github" EXCLUDE PATTERN ".github" EXCLUDE
PATTERN ".arcconfig" EXCLUDE PATTERN ".arcconfig" EXCLUDE
PATTERN "__pycache__" EXCLUDE PATTERN "__pycache__" EXCLUDE
@ -535,6 +536,9 @@ macro(install_dir from to)
DESTINATION ${to} DESTINATION ${to}
# Irrelevant files and caches. # Irrelevant files and caches.
PATTERN ".git" EXCLUDE PATTERN ".git" EXCLUDE
PATTERN ".gitignore" EXCLUDE
PATTERN ".gitea" EXCLUDE
PATTERN ".github" EXCLUDE
PATTERN ".svn" EXCLUDE PATTERN ".svn" EXCLUDE
PATTERN "*.pyc" EXCLUDE PATTERN "*.pyc" EXCLUDE
PATTERN "*.pyo" EXCLUDE PATTERN "*.pyo" EXCLUDE
@ -1294,33 +1298,6 @@ elseif(APPLE)
set_target_properties(blender PROPERTIES OUTPUT_NAME Blender) set_target_properties(blender PROPERTIES OUTPUT_NAME Blender)
endif() endif()
# Handy install macro to exclude files, we use \$ escape for the "to"
# argument when calling so `${BUILD_TYPE}` does not get expanded.
macro(install_dir from to)
install(
DIRECTORY ${from}
DESTINATION ${to}
PATTERN ".git" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "*.pyc" EXCLUDE
PATTERN "*.pyo" EXCLUDE
PATTERN "*.orig" EXCLUDE
PATTERN "*.rej" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "__MACOSX" EXCLUDE
PATTERN ".DS_Store" EXCLUDE
PATTERN "config-${PYTHON_VERSION}/*.a" EXCLUDE # static lib
PATTERN "lib2to3" EXCLUDE # ./lib2to3
PATTERN "tkinter" EXCLUDE # ./tkinter
PATTERN "lib-dynload/_tkinter.*" EXCLUDE # ./lib-dynload/_tkinter.co
PATTERN "idlelib" EXCLUDE # ./idlelib
PATTERN "test" EXCLUDE # ./test
PATTERN "turtledemo" EXCLUDE # ./turtledemo
PATTERN "turtle.py" EXCLUDE # ./turtle.py
PATTERN "wininst*.exe" EXCLUDE # from distutils, avoid malware false positive
)
endmacro()
set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/Blender.app) set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/Blender.app)
# Setup `Info.plist`. # Setup `Info.plist`.

View File

@ -39,6 +39,9 @@ global:
realpath; realpath;
sched_*; sched_*;
valloc; valloc;
/* needed on FreeBSD */
__progname;
environ;
local: local:
*; *;
}; };