From 60712d12eb89fe85204f9a0dbc86e361b8ad6c58 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 23 Mar 2018 14:13:13 +0100 Subject: [PATCH 1/3] UI: 4-column layout for the editor-type selector menu The list of editor-types is rather long by now, so better to arrange them into sections. Original patch by @jeske with updates by @Blendify and myself. Design Task: T36028 Patch: D3112 --- source/blender/makesrna/intern/rna_space.c | 36 ++++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ca24cdd27ec..d6a304f4dfe 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -63,28 +63,38 @@ const EnumPropertyItem rna_enum_space_type_items[] = { /* empty must be here for python, is skipped for UI */ {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""}, + + /* General */ + {0, "", ICON_NONE, "General", ""}, {SPACE_VIEW3D, "VIEW_3D", ICON_VIEW3D, "3D View", "3D viewport"}, - {0, "", ICON_NONE, NULL, NULL}, + {SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", "View and edit images and UV Maps"}, + {SPACE_NODE, "NODE_EDITOR", ICON_NODETREE, "Node Editor", "Editor for node-based shading and compositing tools"}, + {SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequencer", "Video editing tools"}, + {SPACE_CLIP, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", "Motion tracking tools"}, + + /* Animation */ + {0, "", ICON_NONE, "Animation", ""}, {SPACE_TIME, "TIMELINE", ICON_TIME, "Timeline", "Timeline and playback controls"}, {SPACE_IPO, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", "Edit drivers and keyframe interpolation"}, {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", "Adjust timing of keyframes"}, {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "NLA Editor", "Combine and layer Actions"}, - {0, "", ICON_NONE, NULL, NULL}, - {SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", "View and edit images and UV Maps"}, - {SPACE_CLIP, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", "Motion tracking tools"}, - {SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", "Video editing tools"}, - {SPACE_NODE, "NODE_EDITOR", ICON_NODETREE, "Node Editor", "Editor for node-based shading and compositing tools"}, + + /* Scripting */ + {0, "", ICON_NONE, "Scripting", ""}, {SPACE_TEXT, "TEXT_EDITOR", ICON_TEXT, "Text Editor", "Edit scripts and in-file documentation"}, {SPACE_LOGIC, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", "Game logic editing"}, - {0, "", ICON_NONE, NULL, NULL}, - {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related data-blocks"}, + {SPACE_CONSOLE, "CONSOLE", ICON_CONSOLE, "Python Console", "Interactive programmatic console for " + "advanced editing and script development"}, + {SPACE_INFO, "INFO", ICON_INFO, "Info", "Main menu bar and list of error messages " + "(drag down to expand and display)"}, + + /* Data */ + {0, "", ICON_NONE, "Data", ""}, {SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", "Overview of scene graph and all available data-blocks"}, - {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", "Edit persistent configuration settings"}, - {SPACE_INFO, "INFO", ICON_INFO, "Info", "Main menu bar and list of error messages (drag down to expand and display)"}, - {0, "", ICON_NONE, NULL, NULL}, + {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related data-blocks"}, {SPACE_FILE, "FILE_BROWSER", ICON_FILESEL, "File Browser", "Browse for files and assets"}, - {0, "", ICON_NONE, NULL, NULL}, - {SPACE_CONSOLE, "CONSOLE", ICON_CONSOLE, "Python Console", "Interactive programmatic console for advanced editing and script development"}, + {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", + "Edit persistent configuration settings"}, {0, NULL, 0, NULL, NULL} }; From ab48e6355dfb279ac70f05637e5533548eea773a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 23 Mar 2018 14:32:18 +0100 Subject: [PATCH 2/3] Glog/gflags: Reduce amount of local modifications With better directory layout and more proper include statements we can avoid several local modifications, such as changing config.h for Windows Glog and the ones related on pass-through statements in logging headers in Glog. This commit also makes unused functions not-a-warning for external code. --- CMakeLists.txt | 3 ++- extern/ceres/CMakeLists.txt | 12 ++---------- extern/ceres/bundle.sh | 12 ++---------- extern/gflags/README.blender | 5 ----- extern/gflags/src/gflags.cc | 6 +++--- extern/gflags/src/gflags_completions.cc | 2 -- extern/glog/CMakeLists.txt | 14 +++++++------- extern/glog/README.blender | 2 ++ extern/glog/{src => include}/glog/log_severity.h | 0 extern/glog/{src => include}/glog/logging.h | 7 ------- extern/glog/{src => include}/glog/raw_logging.h | 6 ------ extern/glog/{src => include}/glog/stl_logging.h | 6 ------ extern/glog/{src => include}/glog/vlog_is_on.h | 0 extern/glog/src/windows/glog/logging.h | 2 +- intern/cycles/util/util_logging.h | 1 + intern/libmv/CMakeLists.txt | 2 +- intern/libmv/bundle.sh | 2 +- 17 files changed, 22 insertions(+), 60 deletions(-) rename extern/glog/{src => include}/glog/log_severity.h (100%) rename extern/glog/{src => include}/glog/logging.h (99%) rename extern/glog/{src => include}/glog/raw_logging.h (98%) rename extern/glog/{src => include}/glog/stl_logging.h (98%) rename extern/glog/{src => include}/glog/vlog_is_on.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9909544cd1a..212587d6d08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1294,7 +1294,7 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING)) if(WIN32) set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src/windows) else() - set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src) + set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/include) endif() endif() endif() @@ -1431,6 +1431,7 @@ if(CMAKE_COMPILER_IS_GNUCC) # flags to undo strict flags ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations) ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter) + ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function) if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0")) ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough) diff --git a/extern/ceres/CMakeLists.txt b/extern/ceres/CMakeLists.txt index a6e9cd9c356..82695133a15 100644 --- a/extern/ceres/CMakeLists.txt +++ b/extern/ceres/CMakeLists.txt @@ -36,6 +36,8 @@ set(INC set(INC_SYS ${EIGEN3_INCLUDE_DIRS} + ${GFLAGS_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} ) set(SRC @@ -303,16 +305,6 @@ else() add_definitions(-DCERES_RESTRICT_SCHUR_SPECIALIZATION) endif() -if(WIN32) - list(APPEND INC - ../glog/src/windows - ) -else() - list(APPEND INC - ../glog/src - ) -endif() - add_definitions(${GFLAGS_DEFINES}) add_definitions(${GLOG_DEFINES}) add_definitions(${CERES_DEFINES}) diff --git a/extern/ceres/bundle.sh b/extern/ceres/bundle.sh index a4f703ac33d..1c9a2e729e5 100755 --- a/extern/ceres/bundle.sh +++ b/extern/ceres/bundle.sh @@ -129,6 +129,8 @@ set(INC set(INC_SYS \${EIGEN3_INCLUDE_DIRS} + \${GFLAGS_INCLUDE_DIRS} + \${GLOG_INCLUDE_DIRS} ) set(SRC @@ -145,16 +147,6 @@ else() add_definitions(-DCERES_RESTRICT_SCHUR_SPECIALIZATION) endif() -if(WIN32) - list(APPEND INC - ../glog/src/windows - ) -else() - list(APPEND INC - ../glog/src - ) -endif() - add_definitions(\${GFLAGS_DEFINES}) add_definitions(\${GLOG_DEFINES}) add_definitions(\${CERES_DEFINES}) diff --git a/extern/gflags/README.blender b/extern/gflags/README.blender index 68dba114329..c57f5ce53ca 100644 --- a/extern/gflags/README.blender +++ b/extern/gflags/README.blender @@ -17,10 +17,5 @@ Local modifications: - Applied some modifications from fork https://github.com/Nazg-Gul/gflags.git (see https://github.com/gflags/gflags/pull/129) -- Made `google::{anonymous}::FlagValue::ValueSize() const` inlined, so it does - not trigger strict compiler warning. - -- Did the same for CommandLineFlagParser::ValidateFlags(). - - Ifdef-ed __attribute((unused)) in gflags.h. This file is compile-time configurable in upstream, so can not avoid change here. diff --git a/extern/gflags/src/gflags.cc b/extern/gflags/src/gflags.cc index 60965d3d201..f27079862f0 100644 --- a/extern/gflags/src/gflags.cc +++ b/extern/gflags/src/gflags.cc @@ -225,7 +225,7 @@ class FlagValue { bool Equal(const FlagValue& x) const; FlagValue* New() const; // creates a new one with default value void CopyFrom(const FlagValue& x); - inline int ValueSize() const; + int ValueSize() const; // Calls the given validate-fn on value_buffer_, and returns // whatever it returns. But first casts validate_fn_proto to a @@ -485,7 +485,7 @@ void FlagValue::CopyFrom(const FlagValue& x) { } } -inline int FlagValue::ValueSize() const { +int FlagValue::ValueSize() const { if (type_ > FV_MAX_INDEX) { assert(false); // unknown type return 0; @@ -1257,7 +1257,7 @@ void CommandLineFlagParser::ValidateFlags(bool all) { } } -inline void CommandLineFlagParser::ValidateAllFlags() { +void CommandLineFlagParser::ValidateAllFlags() { ValidateFlags(true); } diff --git a/extern/gflags/src/gflags_completions.cc b/extern/gflags/src/gflags_completions.cc index c663453c59c..f7724864d58 100644 --- a/extern/gflags/src/gflags_completions.cc +++ b/extern/gflags/src/gflags_completions.cc @@ -55,8 +55,6 @@ #include #include -#include "gflags_completions.h" - #include "config.h" #include "gflags/gflags.h" #include "gflags/gflags_completions.h" diff --git a/extern/glog/CMakeLists.txt b/extern/glog/CMakeLists.txt index 59833151e4e..df64718ee95 100644 --- a/extern/glog/CMakeLists.txt +++ b/extern/glog/CMakeLists.txt @@ -23,6 +23,7 @@ # ***** END GPL LICENSE BLOCK ***** set(INC + src ../gflags/src ) @@ -70,24 +71,23 @@ if(WIN32) list(APPEND INC src/windows - src ) else() list(APPEND INC - src + include ) - list(APPEND SRC src/demangle.cc src/signalhandler.cc src/symbolize.cc src/demangle.h - src/glog/logging.h - src/glog/log_severity.h - src/glog/raw_logging.h - src/glog/vlog_is_on.h src/symbolize.h + + include/glog/logging.h + include/glog/log_severity.h + include/glog/raw_logging.h + include/glog/vlog_is_on.h ) endif() diff --git a/extern/glog/README.blender b/extern/glog/README.blender index c48bc468e4c..38d5ff05c86 100644 --- a/extern/glog/README.blender +++ b/extern/glog/README.blender @@ -5,3 +5,5 @@ Upstream version: 0.3.5, a6a166db069 Local modifications: * Added per-platform config.h files so no configuration-time checks for functions and so are needed. +* Added special definitions of HAVE_SNPRINTF and HAVE_LIB_GFLAGS + in Windows' specific config.h. diff --git a/extern/glog/src/glog/log_severity.h b/extern/glog/include/glog/log_severity.h similarity index 100% rename from extern/glog/src/glog/log_severity.h rename to extern/glog/include/glog/log_severity.h diff --git a/extern/glog/src/glog/logging.h b/extern/glog/include/glog/logging.h similarity index 99% rename from extern/glog/src/glog/logging.h rename to extern/glog/include/glog/logging.h index 7aac880a952..8238ca9610f 100644 --- a/extern/glog/src/glog/logging.h +++ b/extern/glog/include/glog/logging.h @@ -33,11 +33,6 @@ // Pretty much everybody needs to #include this file so that they can // log various happenings. // - -#ifdef WIN32 -# include "windows/glog/logging.h" -#else // WIN32 - #ifndef _LOGGING_H_ #define _LOGGING_H_ @@ -1628,5 +1623,3 @@ GOOGLE_GLOG_DLL_DECL void InstallFailureWriter( } #endif // _LOGGING_H_ - -#endif // WIN32 diff --git a/extern/glog/src/glog/raw_logging.h b/extern/glog/include/glog/raw_logging.h similarity index 98% rename from extern/glog/src/glog/raw_logging.h rename to extern/glog/include/glog/raw_logging.h index b030f7f736d..65278f62803 100644 --- a/extern/glog/src/glog/raw_logging.h +++ b/extern/glog/include/glog/raw_logging.h @@ -33,10 +33,6 @@ // acquire any locks, and can therefore be used by low-level memory // allocation and synchronization code. -#ifdef WIN32 -# include "windows/glog/raw_logging.h" -#else // WIN32 - #ifndef BASE_RAW_LOGGING_H_ #define BASE_RAW_LOGGING_H_ @@ -187,5 +183,3 @@ GOOGLE_GLOG_DLL_DECL void RawLog__SetLastTime(const struct tm& t, int usecs); } #endif // BASE_RAW_LOGGING_H_ - -#endif // WIN32 diff --git a/extern/glog/src/glog/stl_logging.h b/extern/glog/include/glog/stl_logging.h similarity index 98% rename from extern/glog/src/glog/stl_logging.h rename to extern/glog/include/glog/stl_logging.h index bd000152738..40a15aa4578 100644 --- a/extern/glog/src/glog/stl_logging.h +++ b/extern/glog/include/glog/stl_logging.h @@ -44,10 +44,6 @@ // - GLOG_STL_LOGGING_FOR_EXT_SLIST - // -#ifdef WIN32 -# include "windows/glog/stl_logging.h" -#else // WIN32 - #ifndef UTIL_GTL_STL_LOGGING_INL_H_ #define UTIL_GTL_STL_LOGGING_INL_H_ @@ -222,5 +218,3 @@ inline void PrintSequence(std::ostream& out, Iter begin, Iter end) { namespace std { using ::operator<<; } #endif // UTIL_GTL_STL_LOGGING_INL_H_ - -#endif // WIN32 diff --git a/extern/glog/src/glog/vlog_is_on.h b/extern/glog/include/glog/vlog_is_on.h similarity index 100% rename from extern/glog/src/glog/vlog_is_on.h rename to extern/glog/include/glog/vlog_is_on.h diff --git a/extern/glog/src/windows/glog/logging.h b/extern/glog/src/windows/glog/logging.h index 606831f211c..f521a2b9424 100644 --- a/extern/glog/src/windows/glog/logging.h +++ b/extern/glog/src/windows/glog/logging.h @@ -86,7 +86,7 @@ #include // a third place for uint16_t or u_int16_t #endif -#if 1 +#if 0 #include #endif diff --git a/intern/cycles/util/util_logging.h b/intern/cycles/util/util_logging.h index 492f830e67c..5c84b6593d3 100644 --- a/intern/cycles/util/util_logging.h +++ b/intern/cycles/util/util_logging.h @@ -18,6 +18,7 @@ #define __UTIL_LOGGING_H__ #if defined(WITH_CYCLES_LOGGING) && !defined(__KERNEL_GPU__) +# include # include #endif diff --git a/intern/libmv/CMakeLists.txt b/intern/libmv/CMakeLists.txt index b67a23b4159..bc555fa7ff6 100644 --- a/intern/libmv/CMakeLists.txt +++ b/intern/libmv/CMakeLists.txt @@ -45,7 +45,7 @@ if(WITH_LIBMV) list(APPEND INC ${GFLAGS_INCLUDE_DIRS} - ../../extern/glog/src + ${GLOG_INCLUDE_DIRS} ../../extern/ceres/include ../../extern/ceres/config ../guardedalloc diff --git a/intern/libmv/bundle.sh b/intern/libmv/bundle.sh index d155d050782..093095f5f5c 100755 --- a/intern/libmv/bundle.sh +++ b/intern/libmv/bundle.sh @@ -124,7 +124,7 @@ if(WITH_LIBMV) list(APPEND INC \${GFLAGS_INCLUDE_DIRS} - ../../extern/glog/src + \${GLOG_INCLUDE_DIRS} ../../extern/ceres/include ../../extern/ceres/config ../guardedalloc From 4f8e407086068e3eeca50db6b37b5c8a5a358696 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 23 Mar 2018 15:05:08 +0100 Subject: [PATCH 3/3] Libmv: Fix compilation error on Windows --- intern/libmv/intern/logging.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/intern/libmv/intern/logging.cc b/intern/libmv/intern/logging.cc index 863832cb72b..701881b3971 100644 --- a/intern/libmv/intern/logging.cc +++ b/intern/libmv/intern/logging.cc @@ -24,6 +24,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include + #include "intern/logging.h" #include "intern/utildefines.h" #include "libmv/logging/logging.h"