diff --git a/CMakeLists.txt b/CMakeLists.txt index e63ccea93..10444463e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ if(UNIX) add_subdirectory(src/gperftools) endif() add_subdirectory(src/core) +add_subdirectory(src/ui) add_subdirectory(src/app) add_dependencies(frictioncore Engine) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index e47f0114f..a68f9f992 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -40,11 +40,6 @@ if(${WIN_DEPLOY}) add_definitions(-DWIN_DEPLOY) endif() -option(USE_ROBOTO "Use Roboto font" OFF) -if(${USE_ROBOTO}) - add_definitions(-DFRICTION_BUNDLE_ROBOTO) -endif() - option(USE_SKIA_SYSTEM_LIBS "Use skia (third-party) system libraries on Linux" ON) if(${USE_SKIA_SYSTEM_LIBS} AND UNIX) pkg_check_modules(EXPAT REQUIRED expat) @@ -111,15 +106,12 @@ if(WIN32) ) endif() -if(UNIX AND NOT APPLE) - pkg_check_modules(UNWIND REQUIRED libunwind) -endif() - include_directories( #${QUAZIP_INCLUDE_DIRS} ${QSCINTILLA_INCLUDE_DIRS} ${FFMPEG_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../core + ${CMAKE_CURRENT_SOURCE_DIR}/../ui ${CMAKE_CURRENT_SOURCE_DIR}/../engine/skia ) @@ -136,8 +128,8 @@ if(${USE_SKIA_SYSTEM_LIBS} AND UNIX) ) endif() -if(UNIX) - include_directories(${CMAKE_CURRENT_BINARY_DIR}/../gperftools) +if(UNIX AND NOT APPLE) + include_directories(${GPERF_INCLUDE_DIRS}) configure_file( app.desktop.in ${CMAKE_BINARY_DIR}/${PROJECT_FREEDESKTOP}.desktop @@ -158,18 +150,13 @@ endif() set( SOURCES main.cpp - GUI/BoxesList/OptimalScrollArea/scrollvisiblepartbase.cpp GUI/BoxesList/boxscroller.cpp #GUI/BrushWidgets/bookmarkedbrushes.cpp #GUI/BrushWidgets/brushlabel.cpp GUI/ColorWidgets/bookmarkedcolors.cpp GUI/ColorWidgets/paintcolorwidget.cpp - GUI/Dialogs/animationtopaintdialog.cpp - GUI/Dialogs/applyexpressiondialog.cpp + #GUI/Dialogs/animationtopaintdialog.cpp GUI/Dialogs/dialogsinterfaceimpl.cpp - GUI/Dialogs/durationrectsettingsdialog.cpp - GUI/Dialogs/exportsvgdialog.cpp - GUI/Dialogs/scenesettingsdialog.cpp GUI/Expressions/expressiondialog.cpp GUI/Expressions/expressioneditor.cpp GUI/Expressions/expressionhighlighter.cpp @@ -185,31 +172,18 @@ set( GUI/Settings/pluginssettingswidget.cpp GUI/Settings/presetsettingswidget.cpp GUI/aboutwidget.cpp - GUI/alignwidget.cpp - GUI/audiohandler.cpp - GUI/assetswidget.cpp - GUI/bookmarkedwidget.cpp - GUI/buttonbase.cpp - GUI/buttonslist.cpp GUI/canvasbasewrappernode.cpp GUI/canvaswindowevents.cpp GUI/canvaswrappernode.cpp - GUI/changewidthwidget.cpp #GUI/closesignalingdockwidget.cpp - GUI/ecombobox.cpp - GUI/editablecombobox.cpp GUI/ekeyfilter.cpp GUI/ewidgetsimpl.cpp - GUI/fakemenubar.cpp GUI/layouthandler.cpp - GUI/scenechooser.cpp GUI/timelinebasewrappernode.cpp GUI/timelinedockwidget.cpp GUI/timelinehighlightwidget.cpp GUI/timelinewidget.cpp GUI/timelinewrappernode.cpp - GUI/triggerlabel.cpp - GUI/twocolumnlayout.cpp GUI/welcomedialog.cpp GUI/widgetstack.cpp GUI/ColorWidgets/colorlabel.cpp @@ -229,13 +203,7 @@ set( eimporters.cpp evfileio.cpp iconloader.cpp - outputsettings.cpp renderhandler.cpp - rendersettings.cpp - GUI/BoxesList/OptimalScrollArea/scrollarea.cpp - GUI/BoxesList/OptimalScrollArea/scrollwidget.cpp - GUI/BoxesList/OptimalScrollArea/scrollwidgetvisiblepart.cpp - GUI/BoxesList/OptimalScrollArea/singlewidget.cpp GUI/BoxesList/boxsinglewidget.cpp GUI/BoxesList/boxscrollwidget.cpp GUI/BoxesList/boolpropertywidget.cpp @@ -243,18 +211,14 @@ set( memoryhandler.cpp GUI/RenderWidgets/renderwidget.cpp GUI/RenderWidgets/renderinstancewidget.cpp - renderinstancesettings.cpp GUI/GradientWidgets/gradientslistwidget.cpp GUI/GradientWidgets/displayedgradientswidget.cpp GUI/GradientWidgets/currentgradientwidget.cpp GUI/RenderWidgets/closablecontainer.cpp GUI/BoxesList/boxtargetwidget.cpp - GUI/BoxesList/OptimalScrollArea/minimalscrollwidget.cpp GUI/BoxesList/boxscrollarea.cpp - videoencoder.cpp GUI/RenderWidgets/outputsettingsprofilesdialog.cpp GUI/RenderWidgets/outputsettingsdisplaywidget.cpp - GUI/actionbutton.cpp GUI/animationdockwidget.cpp GUI/animationwidgetscrollbar.cpp GUI/canvaswindow.cpp @@ -269,32 +233,22 @@ set( GUI/qrealanimatorvalueslider.cpp GUI/glwindow.cpp GUI/fontswidget.cpp - #GUI/filesourcelist.cpp - GUI/customfpsdialog.cpp GUI/fillstrokesettings.cpp #GUI/BrushWidgets/brushselectionwidget.cpp - GUI/flowlayout.cpp GUI/ColorWidgets/colorwidgetshaders.cpp - GUI/namedcontainer.cpp #GUI/BrushWidgets/brushwidget.cpp - GUI/Settings/labeledslider.cpp - GUI/uilayout.cpp + GUI/toolbox.cpp ) set( HEADERS - GUI/BoxesList/OptimalScrollArea/scrollvisiblepartbase.h GUI/BoxesList/boxscroller.h #GUI/BrushWidgets/bookmarkedbrushes.h #GUI/BrushWidgets/brushlabel.h GUI/ColorWidgets/bookmarkedcolors.h GUI/ColorWidgets/paintcolorwidget.h - GUI/Dialogs/animationtopaintdialog.h - GUI/Dialogs/applyexpressiondialog.h + #GUI/Dialogs/animationtopaintdialog.h GUI/Dialogs/dialogsinterfaceimpl.h - GUI/Dialogs/durationrectsettingsdialog.h - GUI/Dialogs/exportsvgdialog.h - GUI/Dialogs/scenesettingsdialog.h GUI/Expressions/expressiondialog.h GUI/Expressions/expressioneditor.h GUI/Expressions/expressionhighlighter.h @@ -310,31 +264,17 @@ set( GUI/Settings/pluginssettingswidget.h GUI/Settings/presetsettingswidget.h GUI/aboutwidget.h - GUI/alignwidget.h - GUI/audiohandler.h - GUI/assetswidget.h - GUI/bookmarkedwidget.h - GUI/buttonbase.h - GUI/buttonslist.h GUI/canvasbasewrappernode.h GUI/canvaswrappernode.h - GUI/changewidthwidget.h #GUI/closesignalingdockwidget.h - GUI/ecombobox.h - GUI/editablecombobox.h GUI/ekeyfilter.h GUI/ewidgetsimpl.h - GUI/fakemenubar.h GUI/layouthandler.h - GUI/scenechooser.h GUI/timelinebasewrappernode.h GUI/timelinedockwidget.h GUI/timelinehighlightwidget.h GUI/timelinewidget.h GUI/timelinewrappernode.h - GUI/toolbutton.h - GUI/triggerlabel.h - GUI/twocolumnlayout.h GUI/welcomedialog.h GUI/widgetstack.h GUI/ColorWidgets/colorlabel.h @@ -352,14 +292,7 @@ set( effectsloader.h eimporters.h iconloader.h - outputsettings.h renderhandler.h - rendersettings.h - keypoint.h - GUI/BoxesList/OptimalScrollArea/scrollarea.h - GUI/BoxesList/OptimalScrollArea/scrollwidget.h - GUI/BoxesList/OptimalScrollArea/scrollwidgetvisiblepart.h - GUI/BoxesList/OptimalScrollArea/singlewidget.h GUI/BoxesList/boxsinglewidget.h GUI/BoxesList/boxscrollwidget.h GUI/BoxesList/boolpropertywidget.h @@ -367,23 +300,17 @@ set( memoryhandler.h GUI/RenderWidgets/renderwidget.h GUI/RenderWidgets/renderinstancewidget.h - renderinstancesettings.h GUI/GradientWidgets/gradientslistwidget.h GUI/GradientWidgets/displayedgradientswidget.h GUI/GradientWidgets/currentgradientwidget.h GUI/RenderWidgets/closablecontainer.h GUI/BoxesList/boxtargetwidget.h - GUI/BoxesList/OptimalScrollArea/minimalscrollwidget.h GUI/BoxesList/boxscrollarea.h - videoencoder.h GUI/RenderWidgets/outputsettingsprofilesdialog.h GUI/RenderWidgets/outputsettingsdisplaywidget.h - GUI/actionbutton.h GUI/animationdockwidget.h GUI/animationwidgetscrollbar.h GUI/canvaswindow.h - GUI/customfpsdialog.h - #GUI/filesourcelist.h GUI/fillstrokesettings.h GUI/fontswidget.h GUI/keyfocustarget.h @@ -397,14 +324,8 @@ set( GUI/qrealpointvaluedialog.h GUI/renderoutputwidget.h #GUI/BrushWidgets/brushselectionwidget.h - GUI/flowlayout.h GUI/ColorWidgets/colorwidgetshaders.h - GUI/namedcontainer.h #GUI/BrushWidgets/brushwidget.h - boxtypemenu.h - GUI/Settings/labeledslider.h - GUI/uilayout.h - GUI/vlabel.h ) set( @@ -423,10 +344,6 @@ else() list(APPEND RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../docs/docs.qrc) endif() -if(${USE_ROBOTO}) - list(APPEND RESOURCES fonts.qrc) -endif() - add_executable( ${PROJECT_NAME} ${ICON_FILE} @@ -472,6 +389,7 @@ target_link_libraries( ${PROJECT_NAME} PRIVATE ${PROJECT_NAME}core + ${PROJECT_NAME}ui ${QT_LIBRARIES} #${QUAZIP_LIBRARIES} ${QSCINTILLA_LIBRARIES} @@ -507,22 +425,12 @@ if(APPLE) ) endif() -if(UNIX) +if(UNIX AND NOT APPLE) target_link_libraries( ${PROJECT_NAME} PRIVATE - tcmalloc_static + ${GPERF_LIBRARIES} ) - if(NOT APPLE) - target_link_libraries( - ${PROJECT_NAME} - PRIVATE - ${UNWIND_LIBRARIES} - ) - endif() -endif() - -if(UNIX AND NOT APPLE) include(GNUInstallDirs) install( TARGETS diff --git a/src/app/GUI/BoxesList/boolpropertywidget.cpp b/src/app/GUI/BoxesList/boolpropertywidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/BoxesList/boolpropertywidget.h b/src/app/GUI/BoxesList/boolpropertywidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/BoxesList/boxscrollarea.cpp b/src/app/GUI/BoxesList/boxscrollarea.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/BoxesList/boxscrollarea.h b/src/app/GUI/BoxesList/boxscrollarea.h old mode 100755 new mode 100644 index fb6add842..d8ff78acd --- a/src/app/GUI/BoxesList/boxscrollarea.h +++ b/src/app/GUI/BoxesList/boxscrollarea.h @@ -25,7 +25,7 @@ #ifndef BOXSCROLLAREA_H #define BOXSCROLLAREA_H -#include "OptimalScrollArea/scrollarea.h" +#include "optimalscrollarena/scrollarea.h" class BoxScrollArea : public ScrollArea { public: diff --git a/src/app/GUI/BoxesList/boxscroller.cpp b/src/app/GUI/BoxesList/boxscroller.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/BoxesList/boxscroller.h b/src/app/GUI/BoxesList/boxscroller.h old mode 100755 new mode 100644 index 40c272eb2..a67d9efb7 --- a/src/app/GUI/BoxesList/boxscroller.h +++ b/src/app/GUI/BoxesList/boxscroller.h @@ -27,7 +27,7 @@ #define BOXSCROLLWIDGETVISIBLEPART_H #include -#include "OptimalScrollArea/scrollwidgetvisiblepart.h" +#include "optimalscrollarena/scrollwidgetvisiblepart.h" #include "singlewidgettarget.h" #include "framerange.h" diff --git a/src/app/GUI/BoxesList/boxscrollwidget.cpp b/src/app/GUI/BoxesList/boxscrollwidget.cpp old mode 100755 new mode 100644 index c59f97b69..cbeee5e54 --- a/src/app/GUI/BoxesList/boxscrollwidget.cpp +++ b/src/app/GUI/BoxesList/boxscrollwidget.cpp @@ -24,7 +24,7 @@ // Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner #include "boxscrollwidget.h" -#include "GUI/BoxesList/OptimalScrollArea/scrollarea.h" +#include "optimalscrollarena/scrollarea.h" #include "Boxes/boundingbox.h" #include "boxscroller.h" #include "GUI/canvaswindow.h" diff --git a/src/app/GUI/BoxesList/boxscrollwidget.h b/src/app/GUI/BoxesList/boxscrollwidget.h old mode 100755 new mode 100644 index be34fa5be..26582fe32 --- a/src/app/GUI/BoxesList/boxscrollwidget.h +++ b/src/app/GUI/BoxesList/boxscrollwidget.h @@ -26,7 +26,7 @@ #ifndef BOXSCROLLWIDGET_H #define BOXSCROLLWIDGET_H -#include "OptimalScrollArea/scrollwidget.h" +#include "optimalscrollarena/scrollwidget.h" #include "GUI/keyfocustarget.h" class BoxScroller; class ScrollArea; diff --git a/src/app/GUI/BoxesList/boxsinglewidget.cpp b/src/app/GUI/BoxesList/boxsinglewidget.cpp old mode 100755 new mode 100644 index ef6d037eb..b56f08036 --- a/src/app/GUI/BoxesList/boxsinglewidget.cpp +++ b/src/app/GUI/BoxesList/boxsinglewidget.cpp @@ -26,7 +26,7 @@ #include "boxsinglewidget.h" #include "swt_abstraction.h" #include "singlewidgettarget.h" -#include "OptimalScrollArea/scrollwidgetvisiblepart.h" +#include "optimalscrollarena/scrollwidgetvisiblepart.h" #include "GUI/ColorWidgets/colorsettingswidget.h" #include "Boxes/containerbox.h" @@ -84,7 +84,7 @@ bool BoxSingleWidget::sStaticPixmapsLoaded = false; #include "PathEffects/patheffectcollection.h" #include "Sound/esoundobjectbase.h" -#include "GUI/ecombobox.h" +#include "widgets/ecombobox.h" #include #include diff --git a/src/app/GUI/BoxesList/boxsinglewidget.h b/src/app/GUI/BoxesList/boxsinglewidget.h old mode 100755 new mode 100644 index 529f028eb..efe4953f5 --- a/src/app/GUI/BoxesList/boxsinglewidget.h +++ b/src/app/GUI/BoxesList/boxsinglewidget.h @@ -26,7 +26,7 @@ #ifndef BOXSINGLEWIDGET_H #define BOXSINGLEWIDGET_H -#include "OptimalScrollArea/singlewidget.h" +#include "optimalscrollarena/singlewidget.h" #include #include #include diff --git a/src/app/GUI/BoxesList/boxtargetwidget.cpp b/src/app/GUI/BoxesList/boxtargetwidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/BoxesList/boxtargetwidget.h b/src/app/GUI/BoxesList/boxtargetwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/bookmarkedcolors.cpp b/src/app/GUI/ColorWidgets/bookmarkedcolors.cpp old mode 100755 new mode 100644 index d577a65c5..6355c1edd --- a/src/app/GUI/ColorWidgets/bookmarkedcolors.cpp +++ b/src/app/GUI/ColorWidgets/bookmarkedcolors.cpp @@ -1,3 +1,28 @@ +/* +# +# Friction - https://friction.graphics +# +# Copyright (c) Friction contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# See 'README.md' for more information. +# +*/ + +// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner + #include "bookmarkedcolors.h" #include "savedcolorbutton.h" #include "Private/document.h" diff --git a/src/app/GUI/ColorWidgets/bookmarkedcolors.h b/src/app/GUI/ColorWidgets/bookmarkedcolors.h old mode 100755 new mode 100644 index cb971993f..8f8c70bd8 --- a/src/app/GUI/ColorWidgets/bookmarkedcolors.h +++ b/src/app/GUI/ColorWidgets/bookmarkedcolors.h @@ -1,8 +1,35 @@ +/* +# +# Friction - https://friction.graphics +# +# Copyright (c) Friction contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# See 'README.md' for more information. +# +*/ + +// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner + #ifndef BOOKMARKEDCOLORS_H #define BOOKMARKEDCOLORS_H -#include "../bookmarkedwidget.h" -class BookmarkedColors : public BookmarkedWidget { +#include "widgets/bookmarkedwidget.h" + +class BookmarkedColors : public BookmarkedWidget +{ Q_OBJECT public: BookmarkedColors(const bool vertical, diff --git a/src/app/GUI/ColorWidgets/colorlabel.cpp b/src/app/GUI/ColorWidgets/colorlabel.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorlabel.h b/src/app/GUI/ColorWidgets/colorlabel.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorpickingwidget.cpp b/src/app/GUI/ColorWidgets/colorpickingwidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorpickingwidget.h b/src/app/GUI/ColorWidgets/colorpickingwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorsettingswidget.cpp b/src/app/GUI/ColorWidgets/colorsettingswidget.cpp old mode 100755 new mode 100644 index a8b2818b9..08485df1f --- a/src/app/GUI/ColorWidgets/colorsettingswidget.cpp +++ b/src/app/GUI/ColorWidgets/colorsettingswidget.cpp @@ -32,7 +32,7 @@ #include "colorhelpers.h" #include "colorlabel.h" #include "GUI/global.h" -#include "GUI/actionbutton.h" +#include "widgets/actionbutton.h" #include "GUI/ColorWidgets/savedcolorswidget.h" #include "appsupport.h" diff --git a/src/app/GUI/ColorWidgets/colorsettingswidget.h b/src/app/GUI/ColorWidgets/colorsettingswidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorvaluerect.cpp b/src/app/GUI/ColorWidgets/colorvaluerect.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorvaluerect.h b/src/app/GUI/ColorWidgets/colorvaluerect.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorwidget.cpp b/src/app/GUI/ColorWidgets/colorwidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorwidget.h b/src/app/GUI/ColorWidgets/colorwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorwidgetshaders.cpp b/src/app/GUI/ColorWidgets/colorwidgetshaders.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/colorwidgetshaders.h b/src/app/GUI/ColorWidgets/colorwidgetshaders.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/glwidget.cpp b/src/app/GUI/ColorWidgets/glwidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/glwidget.h b/src/app/GUI/ColorWidgets/glwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/h_wheel_sv_triangle.cpp b/src/app/GUI/ColorWidgets/h_wheel_sv_triangle.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/h_wheel_sv_triangle.h b/src/app/GUI/ColorWidgets/h_wheel_sv_triangle.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/paintcolorwidget.cpp b/src/app/GUI/ColorWidgets/paintcolorwidget.cpp old mode 100755 new mode 100644 index 3a7618366..6530e4d92 --- a/src/app/GUI/ColorWidgets/paintcolorwidget.cpp +++ b/src/app/GUI/ColorWidgets/paintcolorwidget.cpp @@ -29,7 +29,7 @@ #include "colorlabel.h" #include "colorpickingwidget.h" #include "GUI/mainwindow.h" -#include "GUI/actionbutton.h" +#include "widgets/actionbutton.h" #include #include diff --git a/src/app/GUI/ColorWidgets/paintcolorwidget.h b/src/app/GUI/ColorWidgets/paintcolorwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/savedcolorbutton.cpp b/src/app/GUI/ColorWidgets/savedcolorbutton.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/savedcolorbutton.h b/src/app/GUI/ColorWidgets/savedcolorbutton.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/savedcolorswidget.cpp b/src/app/GUI/ColorWidgets/savedcolorswidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ColorWidgets/savedcolorswidget.h b/src/app/GUI/ColorWidgets/savedcolorswidget.h old mode 100755 new mode 100644 index 4379dadc9..fda67e2b8 --- a/src/app/GUI/ColorWidgets/savedcolorswidget.h +++ b/src/app/GUI/ColorWidgets/savedcolorswidget.h @@ -27,7 +27,7 @@ #define SAVEDCOLORSWIDGET_H #include -#include "GUI/flowlayout.h" +#include "widgets/flowlayout.h" #include "colorhelpers.h" class SavedColorButton; diff --git a/src/app/GUI/Dialogs/animationtopaintdialog.cpp b/src/app/GUI/Dialogs/animationtopaintdialog.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/Dialogs/animationtopaintdialog.h b/src/app/GUI/Dialogs/animationtopaintdialog.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Dialogs/dialogsinterfaceimpl.cpp b/src/app/GUI/Dialogs/dialogsinterfaceimpl.cpp old mode 100755 new mode 100644 index 5c86bf846..a0e9ad425 --- a/src/app/GUI/Dialogs/dialogsinterfaceimpl.cpp +++ b/src/app/GUI/Dialogs/dialogsinterfaceimpl.cpp @@ -31,14 +31,14 @@ #include #include -#include "../buttonslist.h" +#include "widgets/buttonslist.h" #include "GUI/global.h" #include "GUI/mainwindow.h" #include "GUI/Expressions/expressiondialog.h" -#include "GUI/Dialogs/durationrectsettingsdialog.h" -#include "GUI/Dialogs/animationtopaintdialog.h" -#include "GUI/Dialogs/applyexpressiondialog.h" -#include "GUI/Dialogs/scenesettingsdialog.h" +#include "dialogs/durationrectsettingsdialog.h" +//#include "GUI/Dialogs/animationtopaintdialog.h" +#include "dialogs/applyexpressiondialog.h" +#include "dialogs/scenesettingsdialog.h" DialogsInterfaceImpl DialogsInterfaceImpl::sInstance; diff --git a/src/app/GUI/Dialogs/dialogsinterfaceimpl.h b/src/app/GUI/Dialogs/dialogsinterfaceimpl.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Expressions/expressiondialog.cpp b/src/app/GUI/Expressions/expressiondialog.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/Expressions/expressiondialog.h b/src/app/GUI/Expressions/expressiondialog.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Expressions/expressioneditor.cpp b/src/app/GUI/Expressions/expressioneditor.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/Expressions/expressioneditor.h b/src/app/GUI/Expressions/expressioneditor.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Expressions/expressionhighlighter.cpp b/src/app/GUI/Expressions/expressionhighlighter.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/Expressions/expressionhighlighter.h b/src/app/GUI/Expressions/expressionhighlighter.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/GradientWidgets/currentgradientwidget.cpp b/src/app/GUI/GradientWidgets/currentgradientwidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/GradientWidgets/currentgradientwidget.h b/src/app/GUI/GradientWidgets/currentgradientwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/GradientWidgets/displayedgradientswidget.cpp b/src/app/GUI/GradientWidgets/displayedgradientswidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/GradientWidgets/displayedgradientswidget.h b/src/app/GUI/GradientWidgets/displayedgradientswidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/GradientWidgets/gradientslistwidget.cpp b/src/app/GUI/GradientWidgets/gradientslistwidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/GradientWidgets/gradientslistwidget.h b/src/app/GUI/GradientWidgets/gradientslistwidget.h old mode 100755 new mode 100644 index 41c49b383..2cb2953c4 --- a/src/app/GUI/GradientWidgets/gradientslistwidget.h +++ b/src/app/GUI/GradientWidgets/gradientslistwidget.h @@ -26,7 +26,7 @@ #ifndef GRADIENTSLISTWIDGET_H #define GRADIENTSLISTWIDGET_H -#include "GUI/BoxesList/OptimalScrollArea/scrollarea.h" +#include "optimalscrollarena/scrollarea.h" class GradientWidget; class DisplayedGradientsWidget; diff --git a/src/app/GUI/GradientWidgets/gradientwidget.cpp b/src/app/GUI/GradientWidgets/gradientwidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/GradientWidgets/gradientwidget.h b/src/app/GUI/GradientWidgets/gradientwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/closablecontainer.cpp b/src/app/GUI/RenderWidgets/closablecontainer.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/closablecontainer.h b/src/app/GUI/RenderWidgets/closablecontainer.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/outputsettingsdialog.cpp b/src/app/GUI/RenderWidgets/outputsettingsdialog.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/outputsettingsdialog.h b/src/app/GUI/RenderWidgets/outputsettingsdialog.h old mode 100755 new mode 100644 index 56f61e49a..af442ef86 --- a/src/app/GUI/RenderWidgets/outputsettingsdialog.h +++ b/src/app/GUI/RenderWidgets/outputsettingsdialog.h @@ -34,7 +34,7 @@ #include #include #include "renderinstancesettings.h" -#include "GUI/twocolumnlayout.h" +#include "widgets/twocolumnlayout.h" #define COMPLIENCE FF_COMPLIANCE_NORMAL class OutputSettingsDialog : public QDialog { diff --git a/src/app/GUI/RenderWidgets/outputsettingsdisplaywidget.cpp b/src/app/GUI/RenderWidgets/outputsettingsdisplaywidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/outputsettingsdisplaywidget.h b/src/app/GUI/RenderWidgets/outputsettingsdisplaywidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/outputsettingsprofilesdialog.cpp b/src/app/GUI/RenderWidgets/outputsettingsprofilesdialog.cpp old mode 100755 new mode 100644 index 6470313d4..c82454888 --- a/src/app/GUI/RenderWidgets/outputsettingsprofilesdialog.cpp +++ b/src/app/GUI/RenderWidgets/outputsettingsprofilesdialog.cpp @@ -28,7 +28,7 @@ #include "outputsettingsdialog.h" #include "outputsettingsdisplaywidget.h" #include "GUI/global.h" -#include "GUI/editablecombobox.h" +#include "widgets/editablecombobox.h" OutputProfilesDialog::OutputProfilesDialog( const OutputSettings ¤tSettings, diff --git a/src/app/GUI/RenderWidgets/outputsettingsprofilesdialog.h b/src/app/GUI/RenderWidgets/outputsettingsprofilesdialog.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/renderinstancewidget.cpp b/src/app/GUI/RenderWidgets/renderinstancewidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/renderinstancewidget.h b/src/app/GUI/RenderWidgets/renderinstancewidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/rendersettingsdialog.cpp b/src/app/GUI/RenderWidgets/rendersettingsdialog.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/rendersettingsdialog.h b/src/app/GUI/RenderWidgets/rendersettingsdialog.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/rendersettingsdisplaywidget.cpp b/src/app/GUI/RenderWidgets/rendersettingsdisplaywidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/rendersettingsdisplaywidget.h b/src/app/GUI/RenderWidgets/rendersettingsdisplaywidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/RenderWidgets/renderwidget.cpp b/src/app/GUI/RenderWidgets/renderwidget.cpp old mode 100755 new mode 100644 index bf1808def..bc6d9ff8c --- a/src/app/GUI/RenderWidgets/renderwidget.cpp +++ b/src/app/GUI/RenderWidgets/renderwidget.cpp @@ -27,7 +27,7 @@ #include "canvas.h" #include "GUI/global.h" #include "renderinstancewidget.h" -#include "GUI/BoxesList/OptimalScrollArea/scrollarea.h" +#include "optimalscrollarena/scrollarea.h" #include "videoencoder.h" #include "renderhandler.h" #include "videoencoder.h" diff --git a/src/app/GUI/RenderWidgets/renderwidget.h b/src/app/GUI/RenderWidgets/renderwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/canvassettingswidget.cpp b/src/app/GUI/Settings/canvassettingswidget.cpp index cde39c59d..e7c73bdde 100644 --- a/src/app/GUI/Settings/canvassettingswidget.cpp +++ b/src/app/GUI/Settings/canvassettingswidget.cpp @@ -26,9 +26,9 @@ #include "canvassettingswidget.h" #include "Private/esettings.h" -#include "labeledslider.h" +#include "widgets/labeledslider.h" #include "GUI/coloranimatorbutton.h" -#include "GUI/twocolumnlayout.h" +#include "widgets/twocolumnlayout.h" #include diff --git a/src/app/GUI/Settings/generalsettingswidget.cpp b/src/app/GUI/Settings/generalsettingswidget.cpp old mode 100755 new mode 100644 index a9fcc7b36..966a12f55 --- a/src/app/GUI/Settings/generalsettingswidget.cpp +++ b/src/app/GUI/Settings/generalsettingswidget.cpp @@ -31,7 +31,6 @@ #include "Private/esettings.h" #include "GUI/global.h" -#include "labeledslider.h" #include "../mainwindow.h" diff --git a/src/app/GUI/Settings/generalsettingswidget.h b/src/app/GUI/Settings/generalsettingswidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/performancesettingswidget.cpp b/src/app/GUI/Settings/performancesettingswidget.cpp old mode 100755 new mode 100644 index c09cf6162..1b19166a8 --- a/src/app/GUI/Settings/performancesettingswidget.cpp +++ b/src/app/GUI/Settings/performancesettingswidget.cpp @@ -4,7 +4,7 @@ #include "hardwareinfo.h" #include "GUI/global.h" -#include "../audiohandler.h" +#include "Sound/audiohandler.h" #include "appsupport.h" #include diff --git a/src/app/GUI/Settings/performancesettingswidget.h b/src/app/GUI/Settings/performancesettingswidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/pluginssettingswidget.cpp b/src/app/GUI/Settings/pluginssettingswidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/pluginssettingswidget.h b/src/app/GUI/Settings/pluginssettingswidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/presetsettingswidget.cpp b/src/app/GUI/Settings/presetsettingswidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/presetsettingswidget.h b/src/app/GUI/Settings/presetsettingswidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/settingsdialog.cpp b/src/app/GUI/Settings/settingsdialog.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/settingsdialog.h b/src/app/GUI/Settings/settingsdialog.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/settingswidget.cpp b/src/app/GUI/Settings/settingswidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/settingswidget.h b/src/app/GUI/Settings/settingswidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/timelinesettingswidget.cpp b/src/app/GUI/Settings/timelinesettingswidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/Settings/timelinesettingswidget.h b/src/app/GUI/Settings/timelinesettingswidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/aboutwidget.cpp b/src/app/GUI/aboutwidget.cpp index 9f0215ba9..e718fea92 100644 --- a/src/app/GUI/aboutwidget.cpp +++ b/src/app/GUI/aboutwidget.cpp @@ -41,14 +41,18 @@ AboutWidget::AboutWidget(QWidget *parent) const auto mTopLabel = new QLabel(this); - mTopLabel->setText(QString::fromUtf8("
" - "" - "

%3
%1

" - "
") - .arg(AppSupport::getAppVersion(true), - QString::number(96), - AppSupport::getAppDisplayName(), - AppSupport::getAppName())); + QString label = QString::fromUtf8("
" + "" + "

%3
%1

" + "
").arg(AppSupport::getAppVersion(), + QString::number(96), + AppSupport::getAppDisplayName(), + AppSupport::getAppName()); + const auto buildInfo = AppSupport::getAppBuildInfo(true); + if (!buildInfo.isEmpty()) { + label.append(buildInfo); + } + mTopLabel->setText(label); mTopLayout->addStretch(); mTopLayout->addWidget(mTopLabel); diff --git a/src/app/GUI/animationdockwidget.cpp b/src/app/GUI/animationdockwidget.cpp old mode 100755 new mode 100644 index 3b3a03cdf..a6f9ff43c --- a/src/app/GUI/animationdockwidget.cpp +++ b/src/app/GUI/animationdockwidget.cpp @@ -27,7 +27,7 @@ #include "GUI/global.h" #include "keysview.h" -#include "actionbutton.h" +#include "widgets/actionbutton.h" #include "Private/esettings.h" AnimationDockWidget::AnimationDockWidget(QWidget *parent, diff --git a/src/app/GUI/animationdockwidget.h b/src/app/GUI/animationdockwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/animationwidgetscrollbar.cpp b/src/app/GUI/animationwidgetscrollbar.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/animationwidgetscrollbar.h b/src/app/GUI/animationwidgetscrollbar.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/bookmarkedwidget.h b/src/app/GUI/bookmarkedwidget.h deleted file mode 100755 index 294aae8b7..000000000 --- a/src/app/GUI/bookmarkedwidget.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef BOOKMARKEDWIDGET_H -#define BOOKMARKEDWIDGET_H - -#include -#include - -class BookmarkedWidget : public QWidget { -public: - explicit BookmarkedWidget(const bool vertical, - const int dimension, - QWidget *parent = nullptr); - - void addWidget(QWidget* const wid); - void removeWidget(QWidget* const wid); - QWidget* getWidget(const int id) const; - int count() const - { return mWidgets.count(); } - void updateSize(); -protected: - void resizeEvent(QResizeEvent *event); -private: - void updateLayout(); - - const bool mVertical; - const int mDimension; - QPushButton* mUpArrow; - QPushButton* mDownArrow; - QList mWidgets; - int mFirstViewed = 0; - int mLastViewed = 0; -}; - -#endif // BOOKMARKEDWIDGET_H diff --git a/src/app/GUI/canvasbasewrappernode.cpp b/src/app/GUI/canvasbasewrappernode.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/canvasbasewrappernode.h b/src/app/GUI/canvasbasewrappernode.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/canvaswindow.cpp b/src/app/GUI/canvaswindow.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/canvaswindow.h b/src/app/GUI/canvaswindow.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/canvaswindowevents.cpp b/src/app/GUI/canvaswindowevents.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/canvaswrappernode.cpp b/src/app/GUI/canvaswrappernode.cpp old mode 100755 new mode 100644 index d7f6afd2a..378d023aa --- a/src/app/GUI/canvaswrappernode.cpp +++ b/src/app/GUI/canvaswrappernode.cpp @@ -24,7 +24,7 @@ // Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner #include "canvaswrappernode.h" -#include "scenechooser.h" +#include "widgets/scenechooser.h" #include "Private/document.h" class CanvasWrapperMenuBar : public StackWrapperMenu { diff --git a/src/app/GUI/canvaswrappernode.h b/src/app/GUI/canvaswrappernode.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/customfpsdialog.cpp b/src/app/GUI/customfpsdialog.cpp deleted file mode 100755 index 15ea9e44e..000000000 --- a/src/app/GUI/customfpsdialog.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#include "customfpsdialog.h" -#include - -CustomFpsDialog::CustomFpsDialog() { - mMainLayout = new QVBoxLayout(this); - setLayout(mMainLayout); - - mCheckBox = new QCheckBox("Enabled", this); - - mFpsLayout = new QHBoxLayout(); - mFpsLabel = new QLabel("Fps", this); - mSpinBox = new QDoubleSpinBox(this); - mSpinBox->setRange(1., 100.); - - mFpsLayout->addWidget(mFpsLabel); - mFpsLayout->addWidget(mSpinBox); - - mButtonsLayout = new QHBoxLayout(); - mMainLayout->addLayout(mButtonsLayout); - mAcceptButton = new QPushButton("Ok", this); - mCancelButton = new QPushButton("Cancel", this); - mButtonsLayout->addWidget(mAcceptButton); - mButtonsLayout->addWidget(mCancelButton); - connect(mAcceptButton, SIGNAL(released()), - this, SLOT(accept())); - connect(mCancelButton, SIGNAL(released()), - this, SLOT(reject())); - - mMainLayout->addWidget(mCheckBox); - mMainLayout->addLayout(mFpsLayout); - mMainLayout->addLayout(mButtonsLayout); -} diff --git a/src/app/GUI/customfpsdialog.h b/src/app/GUI/customfpsdialog.h deleted file mode 100755 index 9812e6481..000000000 --- a/src/app/GUI/customfpsdialog.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#ifndef CUSTOMFPSDIALOG_H -#define CUSTOMFPSDIALOG_H -#include -#include -#include -#include -#include - -class CustomFpsDialog : public QDialog -{ -public: - CustomFpsDialog(); - - void setFps(const qreal fps) { - mSpinBox->setValue(fps); - } - void setEnabled(const bool bT) { - mCheckBox->setChecked(bT); - } - - qreal getFps() { - return mSpinBox->value(); - } - - bool getFpsEnabled() { - return mCheckBox->isChecked(); - } -protected: - QVBoxLayout *mMainLayout = nullptr; - - QHBoxLayout *mFpsLayout = nullptr; - - QLabel *mFpsLabel = nullptr; - - QCheckBox *mCheckBox = nullptr; - QDoubleSpinBox *mSpinBox = nullptr; - - QHBoxLayout *mButtonsLayout = nullptr; - QPushButton *mAcceptButton = nullptr; - QPushButton *mCancelButton = nullptr; -}; - -#endif // CUSTOMFPSDIALOG_H diff --git a/src/app/GUI/ekeyfilter.cpp b/src/app/GUI/ekeyfilter.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ekeyfilter.h b/src/app/GUI/ekeyfilter.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/ewidgetsimpl.cpp b/src/app/GUI/ewidgetsimpl.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/ewidgetsimpl.h b/src/app/GUI/ewidgetsimpl.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/filesourcelist.cpp b/src/app/GUI/filesourcelist.cpp deleted file mode 100755 index 837dae196..000000000 --- a/src/app/GUI/filesourcelist.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#include "filesourcelist.h" -#include "GUI/global.h" -#include -#include -#include -#include "mainwindow.h" -#include -#include -#include "FileCacheHandlers/videocachehandler.h" -#include "FileCacheHandlers/imagecachehandler.h" -#include "FileCacheHandlers/imagesequencecachehandler.h" - -FileSourceWidget::FileSourceWidget(FileSourceListVisibleWidget *parent) : - QWidget(parent) { - mParentVisibleWidget = parent; - eSizesUI::widget.add(this, [this](const int size) { - setFixedHeight(size); - }); -} - -void FileSourceWidget::setTargetCache(FileCacheHandlerAbstraction *target) { - mTargetCache = target; - if(!mTargetCache) { - setToolTip(""); - } else { - setToolTip(mTargetCache->getName()); - } -} - -void FileSourceWidget::mouseMoveEvent(QMouseEvent *event) { - if(!(event->buttons() & Qt::LeftButton)) { - return; - } - if((event->pos() - mDragStartPos).manhattanLength() - < QApplication::startDragDistance()) { - return; - } - QDrag *drag = new QDrag(this); - - QMimeData *mimeData = new QMimeData(); - const QString path = mTargetCache->getName(); - const QUrl url = QUrl::fromLocalFile(path); - mimeData->setUrls(QList() << url); - drag->setMimeData(mimeData); - - drag->installEventFilter(MainWindow::sGetInstance()); - drag->exec(Qt::CopyAction | Qt::MoveAction); -} - - -void FileSourceWidget::paintEvent(QPaintEvent *) { - if(!mTargetCache || width() <= 2*eSizesUI::widget) return; - QPainter p(this); - - QString pathString = mTargetCache->getName(); - if(mFileNameOnly) pathString = pathString.split("/").last(); - const auto fm = p.fontMetrics(); - const int spaceForPath = int(width() - 1.5*eSizesUI::widget); - pathString = fm.elidedText(pathString, Qt::ElideLeft, spaceForPath); - const int pathWidth = fm.width(pathString); - - if(mTargetCache->fSelected) { - p.fillRect(QRect(0.5*eSizesUI::widget, 0, - pathWidth + eSizesUI::widget, eSizesUI::widget), - QColor(180, 180, 180)); - p.setPen(Qt::black); - } - if(mTargetCache->isFileMissing()) p.setPen(Qt::red); - - p.drawText(rect().adjusted(eSizesUI::widget, 0, - -0.5*eSizesUI::widget, 0), - Qt::AlignVCenter | Qt::AlignLeft, - pathString); - - p.end(); -} - -void FileSourceWidget::switchFileNameOnly() { - mFileNameOnly = !mFileNameOnly; -} - -void FileSourceWidget::mousePressEvent(QMouseEvent *event) { - mDragStartPos = event->pos(); -} - -void FileSourceWidget::mouseReleaseEvent(QMouseEvent *event) { - if(!mTargetCache) return; - if(event->button() == Qt::LeftButton) { - if(event->modifiers() & Qt::ShiftModifier) { - mTargetCache->switchSelected(); - } else { - mParentVisibleWidget->clearSelected(); - mTargetCache->setSelected(true); - } - } else { - if(!mTargetCache->fSelected) { - mParentVisibleWidget->clearSelected(); - mTargetCache->setSelected(true); - } - mParentVisibleWidget->showContextMenu(event->globalPos()); - } - - update(); -} - -FileSourceListScrollWidget::FileSourceListScrollWidget(ScrollArea *parent) : - MinimalScrollWidget(new FileSourceListVisibleWidget(this), parent) { - //updateHeight(); -} - -void FileSourceListScrollWidget::updateHeight() { - const auto visWid = static_cast( - visiblePartWidget()); - setFixedHeight((visWid->getCacheListCount() + 0.5) * eSizesUI::widget); -} - -FileSourceListVisibleWidget::FileSourceListVisibleWidget(MinimalScrollWidget *parent) : - ScrollVisiblePartBase(parent) { - connect(FilesHandler::sInstance, &FilesHandler::addedCacheHandler, - this, &FileSourceListVisibleWidget::addCacheHandlerToList); - connect(FilesHandler::sInstance, &FilesHandler::removedCacheHandler, - this, &FileSourceListVisibleWidget::removeCacheHandlerFromList); -} - -void FileSourceListVisibleWidget::paintEvent(QPaintEvent *) { - QPainter p(this); - - int currY = eSizesUI::widget; - p.setPen(QPen(QColor(40, 40, 40), 1.)); - while(currY < height()) { - p.drawLine(0, currY, width(), currY); - - currY += eSizesUI::widget; - } - -// if(mDragging) { -// p.setPen(QPen(Qt::white, 3.)); -// p.drawLine(0, mCurrentDragPosId*MIN_WIDGET_HEIGHT, -// width(), mCurrentDragPosId*MIN_WIDGET_HEIGHT); -// } - - p.end(); -} - -void FileSourceListVisibleWidget::updateVisibleWidgetsContent() { - int firstVisibleId = visibleTop()/eSizesUI::widget; - - int iTarget = firstVisibleId; - const auto& wids = widgets(); - const int nWidgets = wids.count(); - for(int iWidget = 0; iWidget < nWidgets; iWidget++) { - const auto fsw = static_cast(wids.at(iWidget)); - if(iTarget < mCacheList.count()) { - fsw->setTargetCache(mCacheList.at(iTarget++).get()); - fsw->show(); - } else { - fsw->setTargetCache(nullptr); - fsw->hide(); - } - } -} - -QWidget *FileSourceListVisibleWidget::createNewSingleWidget() { - return new FileSourceWidget(this); -} - -void FileSourceListVisibleWidget::addCacheHandlerToList(FileCacheHandler * const handler) { - mCacheList << std::make_shared(handler, this); - scheduleContentUpdate(); -} - -void FileSourceListVisibleWidget::removeCacheHandlerFromList( - FileCacheHandler * const handler) { - for(int i = 0; i < mCacheList.count(); i++) { - const auto& abs = mCacheList.at(i); - if(abs->fTarget == handler) { - if(abs->fSelected) removeFromSelectedList(abs.get()); - mCacheList.removeAt(i); - scheduleContentUpdate(); - return; - } - } -} - -void FileSourceListVisibleWidget::showContextMenu(const QPoint &globalPos) { - QMenu menu; - menu.addAction("Reload"); - if(mSelectedList.count() == 1) menu.addAction("Replace..."); - menu.addSeparator(); - menu.addAction("Delete"); - const auto selected_action = menu.exec(globalPos); - if(selected_action) { - if(selected_action->text() == "Reload") { - for(const auto& abs : mSelectedList) { - abs->fTarget->reloadAction(); - } - } else if(selected_action->text() == "Replace...") { - mSelectedList.first()->fTarget->replace(); - } else if(selected_action->text() == "Delete") { - for(const auto& abs : mSelectedList) { - abs->fTarget->deleteAction(); - } - } - - Document::sInstance->actionFinished(); - } -} - -FileSourceList::FileSourceList(QWidget *parent) : ScrollArea(parent) { - mScrollWidget = new FileSourceListScrollWidget(this); - setWidget(mScrollWidget); - - connect(verticalScrollBar(), &QScrollBar::valueChanged, - mScrollWidget, &FileSourceListScrollWidget::changeVisibleTop); - connect(this, &FileSourceList::heightChanged, - mScrollWidget, &FileSourceListScrollWidget::changeVisibleHeight); - connect(this, &FileSourceList::widthChanged, - mScrollWidget, &FileSourceListScrollWidget::setWidth); - - verticalScrollBar()->setSingleStep(eSizesUI::widget); - setAcceptDrops(true); -} - -void FileSourceList::dropEvent(QDropEvent *event) { - if(event->mimeData()->hasUrls()) { - const QList urlList = event->mimeData()->urls(); - for(const QUrl &url : urlList) { - if(url.isLocalFile()) { - const QString urlStr = url.toLocalFile(); - const QFileInfo fInfo(urlStr); - const QString ext = fInfo.suffix(); - const auto filesHandler = FilesHandler::sInstance; - if(fInfo.isDir()) { - filesHandler->getFileHandler(urlStr); - } else if(isSoundExt(ext)) { - filesHandler->getFileHandler(urlStr); - } else if(isImageExt(ext) || isLayersExt(ext)) { - filesHandler->getFileHandler(urlStr); - } else if(isVideoExt(ext)) { - filesHandler->getFileHandler(urlStr); - } - } - } - event->acceptProposedAction(); - } - Document::sInstance->actionFinished(); -} - -void FileSourceList::dragMoveEvent(QDragMoveEvent *event) { - event->acceptProposedAction(); -} - -void FileSourceList::dragEnterEvent(QDragEnterEvent *event) { - if(event->mimeData()->hasUrls()) { - event->acceptProposedAction(); - } -} - -void FileCacheHandlerAbstraction::setSelected(const bool bT) { - if(bT == fSelected) return; - fSelected = bT; - if(fSelected) { - fParentVisibleWidget->addToSelectedList(this); - } else { - fParentVisibleWidget->removeFromSelectedList(this); - } -} diff --git a/src/app/GUI/filesourcelist.h b/src/app/GUI/filesourcelist.h deleted file mode 100755 index d41f1e5a4..000000000 --- a/src/app/GUI/filesourcelist.h +++ /dev/null @@ -1,150 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#ifndef FILESOURCELIST_H -#define FILESOURCELIST_H -#include "FileCacheHandlers/filecachehandler.h" -#include "filesourcescache.h" -#include -#include "GUI/BoxesList/OptimalScrollArea/scrollvisiblepartbase.h" -#include "GUI/BoxesList/OptimalScrollArea/scrollarea.h" -#include "GUI/BoxesList/OptimalScrollArea/minimalscrollwidget.h" -#include "fileshandler.h" -class FileSourceListVisibleWidget; -struct FileCacheHandlerAbstraction : public QObject { - FileCacheHandlerAbstraction( - FileCacheHandler *target, - FileSourceListVisibleWidget *parent) : - QObject(target), fTarget(target), - fParentVisibleWidget(parent) {} - - FileCacheHandler * const fTarget; - FileSourceListVisibleWidget * const fParentVisibleWidget; - bool fSelected = false; - - void switchSelected() { - setSelected(!fSelected); - } - - void setSelected(const bool bT); - - const QString &getName() { - return fTarget->path(); - } - - bool isFileMissing() { - return fTarget->fileMissing(); - } - -}; - -class FileSourceWidget : public QWidget { -public: - FileSourceWidget(FileSourceListVisibleWidget *parent = nullptr); - - void setTargetCache(FileCacheHandlerAbstraction *target); - - void switchFileNameOnly(); - -protected: - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void paintEvent(QPaintEvent *); -private: - bool mFileNameOnly = true; - qptr mTargetCache; - FileSourceListVisibleWidget *mParentVisibleWidget = nullptr; - QPoint mDragStartPos; -}; - -class FileSourceListScrollWidget : public MinimalScrollWidget { -public: - FileSourceListScrollWidget(ScrollArea *parent); - - void updateHeight(); -}; - -class FileSourceListVisibleWidget : public ScrollVisiblePartBase { -public: - FileSourceListVisibleWidget(MinimalScrollWidget *parent = nullptr); - - void updateVisibleWidgetsContent(); - QWidget *createNewSingleWidget(); - - void addCacheHandlerToList(FileCacheHandler * const handler); - void removeCacheHandlerFromList(FileCacheHandler * const handler); - - void addToSelectedList(FileCacheHandlerAbstraction *item) { - mSelectedList << item; - update(); - } - - void removeFromSelectedList(FileCacheHandlerAbstraction *item) { - mSelectedList.removeOne(item); - update(); - } - - void clear() { - clearSelected(); - mCacheList.clear(); - } - - void clearSelected() { - for(const auto& abs : mSelectedList) { - abs->fSelected = false; - } - - mSelectedList.clear(); - update(); - } - - void showContextMenu(const QPoint &globalPos); - - int getCacheListCount() { - return mCacheList.count(); - } -protected: - QList mSelectedList; - QList> mCacheList; - void paintEvent(QPaintEvent *); -}; - -class FileSourceList : public ScrollArea { - Q_OBJECT -public: - FileSourceList(QWidget *parent = nullptr); -signals: - void doubleClicked(); -protected: - void dropEvent(QDropEvent *event); - void dragEnterEvent(QDragEnterEvent *event); - void dragMoveEvent(QDragMoveEvent *event); - void mouseDoubleClickEvent(QMouseEvent *) { emit doubleClicked(); } -private: - FileSourceListScrollWidget *mScrollWidget; -}; - -#endif // FILESOURCELIST_H diff --git a/src/app/GUI/fillstrokesettings.cpp b/src/app/GUI/fillstrokesettings.cpp old mode 100755 new mode 100644 index b3ec8f5da..074226557 --- a/src/app/GUI/fillstrokesettings.cpp +++ b/src/app/GUI/fillstrokesettings.cpp @@ -30,10 +30,9 @@ #include "qrealanimatorvalueslider.h" #include "GUI/ColorWidgets/colorsettingswidget.h" #include "GUI/canvaswindow.h" -#include "actionbutton.h" +#include "widgets/actionbutton.h" #include "qdoubleslider.h" //#include "segment1deditor.h" -#include "namedcontainer.h" #include #include "paintsettingsapplier.h" #include "Animators/gradient.h" diff --git a/src/app/GUI/fillstrokesettings.h b/src/app/GUI/fillstrokesettings.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/fontswidget.cpp b/src/app/GUI/fontswidget.cpp old mode 100755 new mode 100644 index 3d8df6745..ad06cac62 --- a/src/app/GUI/fontswidget.cpp +++ b/src/app/GUI/fontswidget.cpp @@ -31,7 +31,7 @@ #include #include -#include "editablecombobox.h" +#include "widgets/editablecombobox.h" FontsWidget::FontsWidget(QWidget *parent) : QWidget(parent) diff --git a/src/app/GUI/fontswidget.h b/src/app/GUI/fontswidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/glwindow.cpp b/src/app/GUI/glwindow.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/glwindow.h b/src/app/GUI/glwindow.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/graphboxeslist.cpp b/src/app/GUI/graphboxeslist.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/keyfocustarget.cpp b/src/app/GUI/keyfocustarget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/keyfocustarget.h b/src/app/GUI/keyfocustarget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/keysview.cpp b/src/app/GUI/keysview.cpp old mode 100755 new mode 100644 index a3991eb10..25d24b3b4 --- a/src/app/GUI/keysview.cpp +++ b/src/app/GUI/keysview.cpp @@ -36,7 +36,6 @@ #include "GUI/global.h" #include "pointhelpers.h" #include "canvaswindow.h" -#include "GUI/Dialogs/durationrectsettingsdialog.h" #include #include "clipboardcontainer.h" #include "Animators/qrealpoint.h" diff --git a/src/app/GUI/keysview.h b/src/app/GUI/keysview.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/layouthandler.cpp b/src/app/GUI/layouthandler.cpp old mode 100755 new mode 100644 index 419673a0d..f066e60fe --- a/src/app/GUI/layouthandler.cpp +++ b/src/app/GUI/layouthandler.cpp @@ -25,7 +25,7 @@ #include "layouthandler.h" #include "Private/document.h" -#include "editablecombobox.h" +#include "widgets/editablecombobox.h" #include diff --git a/src/app/GUI/layouthandler.h b/src/app/GUI/layouthandler.h old mode 100755 new mode 100644 index 6ad7d5c13..2eb147f2e --- a/src/app/GUI/layouthandler.h +++ b/src/app/GUI/layouthandler.h @@ -29,7 +29,7 @@ #include "timelinebasewrappernode.h" #include "canvasbasewrappernode.h" #include "canvas.h" -#include "audiohandler.h" +#include "Sound/audiohandler.h" #include "XML/runtimewriteid.h" #include diff --git a/src/app/GUI/mainwindow.cpp b/src/app/GUI/mainwindow.cpp old mode 100755 new mode 100644 index 5510118f5..f2aff3257 --- a/src/app/GUI/mainwindow.cpp +++ b/src/app/GUI/mainwindow.cpp @@ -21,6 +21,8 @@ # */ +// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner + #include "mainwindow.h" #include "canvas.h" #include @@ -38,42 +40,29 @@ #include #include -#include "GUI/ColorWidgets/colorsettingswidget.h" #include "GUI/edialogs.h" #include "timelinedockwidget.h" -#include "Private/Tasks/taskexecutor.h" -#include "qdoubleslider.h" #include "canvaswindow.h" #include "GUI/BoxesList/boxscrollwidget.h" #include "clipboardcontainer.h" -#include "GUI/BoxesList/OptimalScrollArea/scrollarea.h" +#include "optimalscrollarena/scrollarea.h" #include "GUI/BoxesList/boxscroller.h" #include "GUI/RenderWidgets/renderwidget.h" -#include "actionbutton.h" #include "fontswidget.h" #include "GUI/global.h" #include "filesourcescache.h" -//#include "filesourcelist.h" -#include "videoencoder.h" #include "fillstrokesettings.h" -#include "editablecombobox.h" +#include "widgets/editablecombobox.h" #include "Sound/soundcomposition.h" #include "GUI/BoxesList/boxsinglewidget.h" #include "memoryhandler.h" -#include "Animators/gradient.h" -#include "GUI/GradientWidgets/gradientwidget.h" -#include "GUI/Dialogs/scenesettingsdialog.h" -#include "ShaderEffects/shadereffectprogram.h" +#include "dialogs/scenesettingsdialog.h" #include "importhandler.h" -#include "ColorWidgets/bookmarkedcolors.h" #include "GUI/edialogs.h" -#include "GUI/dialogsinterface.h" -//#include "closesignalingdockwidget.h" #include "eimporters.h" -//#include "ColorWidgets/paintcolorwidget.h" -#include "Dialogs/exportsvgdialog.h" -#include "alignwidget.h" +#include "dialogs/exportsvgdialog.h" +#include "widgets/alignwidget.h" #include "welcomedialog.h" #include "Boxes/textbox.h" #include "noshortcutaction.h" @@ -81,7 +70,7 @@ #include "Settings/settingsdialog.h" #include "appsupport.h" -#include "GUI/assetswidget.h" +#include "widgets/assetswidget.h" MainWindow *MainWindow::sInstance = nullptr; @@ -100,11 +89,22 @@ MainWindow::MainWindow(Document& document, , mWelcomeDialog(nullptr) //, mCentralWidget(nullptr) , mStackWidget(nullptr) - , mTopSideBarWidget(nullptr) - , mBottomSideBarWidget(nullptr) + , mTabColorText(nullptr) + , mTabProperties(nullptr) , mTimeline(nullptr) , mRenderWidget(nullptr) + , mToolBoxStack(nullptr) + , mToolBoxMainIndex(0) + , mToolBoxNodesIndex(0) + , mToolBoxDrawIndex(0) , mToolbar(nullptr) + , mToolBoxButton(nullptr) + , mToolBoxGroupMain(nullptr) + , mToolBoxGroupNodes(nullptr) + , mToolBoxMain(nullptr) + , mToolBoxNodes(nullptr) + , mToolBoxDraw(nullptr) + , mUI(nullptr) //, mFillStrokeSettingsDockBar(nullptr) //, mTimelineDockBar(nullptr) //, mSelectedObjectDockBar(nullptr) @@ -119,7 +119,6 @@ MainWindow::MainWindow(Document& document, , mFontWidgetAct(nullptr) , mDrawPathAuto(nullptr) , mDrawPathSmooth(nullptr) - , mDrawPathSmoothAct(nullptr) , mDrawPathMaxError(nullptr) , mDocument(document) , mActions(actions) @@ -147,10 +146,10 @@ MainWindow::MainWindow(Document& document, Q_ASSERT(!sInstance); sInstance = this; - //ImportHandler::sInstance->addImporter(); // not supported yet + //ImportHandler::sInstance->addImporter(); // not supported yet, see own branch ImportHandler::sInstance->addImporter(); ImportHandler::sInstance->addImporter(); - //ImportHandler::sInstance->addImporter(); // removed + //ImportHandler::sInstance->addImporter(); // removed, will be added back soonish connect(&mDocument, &Document::evFilePathChanged, this, &MainWindow::updateTitle); @@ -169,39 +168,12 @@ MainWindow::MainWindow(Document& document, this, &MainWindow::closeWelcomeDialog); connect(&mDocument, &Document::openTextEditor, this, [this] () { - mTopSideBarWidget->setCurrentIndex(mTabTextIndex); + mTabColorText->setCurrentIndex(mTabTextIndex); mFontWidget->setTextFocus(); }); - //const auto iconDir = eSettings::sIconsDir(); setWindowIcon(QIcon::fromTheme(AppSupport::getAppName())); - /*const auto downArr = iconDir + "/down-arrow.png"; - const auto upArr = iconDir + "/up-arrow.png"; - const auto dockClose = iconDir + "/dockClose.png"; - const auto dockMaximize = iconDir + "/dockMaximize.png"; - - const QString iconSS = - "QComboBox::down-arrow { image: url(" + downArr + "); }" - "QScrollBar::sub-line { image: url(" + upArr + "); }" - "QScrollBar::add-line { image: url(" + downArr + "); }" - "QDockWidget {" - "titlebar-close-icon: url(" + dockClose + ");" - "titlebar-normal-icon: url(" + dockMaximize + ");" - "}";*/ - - /*QFile customSS(eSettings::sSettingsDir() + "/stylesheet.qss"); - if(customSS.exists()) { - if(customSS.open(QIODevice::ReadOnly | QIODevice::Text)) { - setStyleSheet(customSS.readAll()); - customSS.close(); - } - } else { - QFile file(":/styles/stylesheet.qss"); - if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { - setStyleSheet(file.readAll() + iconSS); - file.close(); - } - }*/ + setMinimumSize(1024, 576); mAutoSaveTimer = new QTimer(this); connect (mAutoSaveTimer, &QTimer::timeout, @@ -262,35 +234,11 @@ MainWindow::MainWindow(Document& document, connect(mObjectSettingsScrollArea, &ScrollArea::widthChanged, mObjectSettingsWidget, &BoxScrollWidget::setWidth); - /*const auto fsl = new FileSourceList(this); - connect(fsl, &FileSourceList::doubleClicked, - this, &MainWindow::importFile);*/ - const auto assets = new AssetsWidget(this); - QToolBar *viewerToolBar = new QToolBar(this); - viewerToolBar->setOrientation(Qt::Vertical); - eSizesUI::widget.add(viewerToolBar, [viewerToolBar](const int size) { - viewerToolBar->setIconSize(QSize(size, size)); - }); - - mViewerNodeBar = new QToolBar(this); - mViewerNodeBar->setObjectName(QString::fromUtf8("ViewerNodeBar")); - mViewerNodeBar->setOrientation(Qt::Vertical); - eSizesUI::widget.add(mViewerNodeBar, [this](const int size) { - mViewerNodeBar->setIconSize(QSize(size, size)); - }); - - mViewerDrawBar = new QToolBar(this); - mViewerDrawBar->setObjectName(QString::fromUtf8("ViewerDrawBar")); - mViewerDrawBar->setOrientation(Qt::Horizontal); - eSizesUI::widget.add(mViewerDrawBar, [this](const int size) { - mViewerDrawBar->setIconSize(QSize(size, size)); - }); - + setupToolBox(); setupToolBar(); setupMenuBar(); - setupDrawPathSpins(); connectToolBarActions(); @@ -315,7 +263,7 @@ MainWindow::MainWindow(Document& document, mStackIndexScene = mStackWidget->addWidget(mLayoutHandler->sceneLayout()); mStackIndexWelcome = mStackWidget->addWidget(mWelcomeDialog); - QLabel *resolutionLabel = new QLabel(tr("Resolution"), this); + const auto resolutionLabel = new QLabel(tr("Resolution"), this); resolutionLabel->setContentsMargins(5, 0, 5, 0); statusBar()->addPermanentWidget(resolutionLabel); @@ -335,141 +283,126 @@ MainWindow::MainWindow(Document& document, this, &MainWindow::setResolutionText); statusBar()->addPermanentWidget(mResolutionComboBox); - QLabel *layoutComboLabel = new QLabel(tr("Layout"), this); + const auto layoutComboLabel = new QLabel(tr("Layout"), this); layoutComboLabel->setContentsMargins(5, 0, 5, 0); statusBar()->addPermanentWidget(layoutComboLabel); statusBar()->addPermanentWidget(mLayoutHandler->comboWidget()); - viewerToolBar->addActions(mToolbarActGroup->actions()); - - QWidget *spacerWidget1 = new QWidget(this); - spacerWidget1->setSizePolicy(QSizePolicy::Minimum, - QSizePolicy::Expanding); - viewerToolBar->addWidget(spacerWidget1); - viewerToolBar->addAction(mLocalPivotAct); - - mViewerNodeBar->addActions(mToolBarNodeGroup->actions()); - - QWidget *spacerWidget2 = new QWidget(this); - spacerWidget2->setSizePolicy(QSizePolicy::Minimum, - QSizePolicy::Expanding); - mViewerNodeBar->addWidget(spacerWidget2); - mViewerNodeBar->addWidget(mNodeVisibility); - - QWidget *fontWidget = new QWidget(this); + const auto fontWidget = new QWidget(this); fontWidget->setAutoFillBackground(true); fontWidget->setPalette(AppSupport::getNotSoDarkPalette()); - QVBoxLayout *fontLayout = new QVBoxLayout(fontWidget); + const auto fontLayout = new QVBoxLayout(fontWidget); fontLayout->addWidget(mFontWidget); QMargins frictionMargins(0, 0, 0, 0); int frictionSpacing = 0; - const auto darkPal= AppSupport::getDarkPalette(); + const auto darkPal = AppSupport::getDarkPalette(); mObjectSettingsScrollArea->setAutoFillBackground(true); mObjectSettingsScrollArea->setPalette(darkPal); - QWidget *frictionTopWidget = new QWidget(this); - frictionTopWidget->setContentsMargins(frictionMargins); - - QHBoxLayout *frictionTopLayout = new QHBoxLayout(frictionTopWidget); - frictionTopLayout->setContentsMargins(frictionMargins); - frictionTopLayout->setSpacing(frictionSpacing); - - mTopSideBarWidget = new QTabWidget(this); - mTopSideBarWidget->tabBar()->setFocusPolicy(Qt::NoFocus); - mTopSideBarWidget->setContentsMargins(frictionMargins); - mTopSideBarWidget->setMinimumWidth(sideBarMin); - mTopSideBarWidget->setTabPosition(QTabWidget::South); - eSizesUI::widget.add(mTopSideBarWidget, [this](const int size) { - mTopSideBarWidget->setIconSize(QSize(size, size)); + // setup "Fill and Stroke" and "Text and Font" tab + mTabColorText = new QTabWidget(this); + mTabColorText->tabBar()->setFocusPolicy(Qt::NoFocus); + mTabColorText->setContentsMargins(frictionMargins); + mTabColorText->setMinimumWidth(sideBarMin); + mTabColorText->setTabPosition(QTabWidget::South); + eSizesUI::widget.add(mTabColorText, [this](const int size) { + mTabColorText->setIconSize(QSize(size, size)); }); - mTabColorIndex = mTopSideBarWidget->addTab(mFillStrokeSettings, - QIcon::fromTheme("color"), - tr("Fill and Stroke")); - mTabTextIndex = mTopSideBarWidget->addTab(fontWidget, - QIcon::fromTheme("textCreate"), - tr("Text and Font")); + mTabColorIndex = mTabColorText->addTab(mFillStrokeSettings, + QIcon::fromTheme("color"), + tr("Fill and Stroke")); + mTabTextIndex = mTabColorText->addTab(fontWidget, + QIcon::fromTheme("textCreate"), + tr("Text and Font")); + + // setup "Properties", "Assets", "Queue" tab + mTabProperties = new QTabWidget(this); + mTabProperties->tabBar()->setFocusPolicy(Qt::NoFocus); + mTabProperties->setContentsMargins(frictionMargins); + mTabProperties->setMinimumWidth(sideBarMin); + mTabProperties->setTabPosition(QTabWidget::South); + eSizesUI::widget.add(mTabProperties, [this](const int size) { + mTabProperties->setIconSize(QSize(size, size)); + }); - QWidget *propertiesWidget = new QWidget(this); - QVBoxLayout *propertiesLayout = new QVBoxLayout(propertiesWidget); + const auto propertiesWidget = new QWidget(this); + const auto propertiesLayout = new QVBoxLayout(propertiesWidget); propertiesLayout->setContentsMargins(frictionMargins); propertiesLayout->setSpacing(frictionSpacing); propertiesLayout->addWidget(mObjectSettingsScrollArea); propertiesLayout->addWidget(alignWidget); - QWidget *viewerWidget = new QWidget(this); + mTabPropertiesIndex = mTabProperties->addTab(propertiesWidget, + QIcon::fromTheme("drawPathAutoChecked"), + tr("Properties")); + mTabAssetsIndex = mTabProperties->addTab(assets, + QIcon::fromTheme("asset_manager"), + tr("Assets")); + mTabQueueIndex = mTabProperties->addTab(mRenderWidget, + QIcon::fromTheme("render_animation"), + tr("Queue")); + + // setup toolbox and viewer + const auto viewerWidget = new QWidget(this); viewerWidget->setContentsMargins(frictionMargins); - QVBoxLayout *viewerLayout = new QVBoxLayout(viewerWidget); + viewerWidget->setSizePolicy(QSizePolicy::Expanding, + QSizePolicy::Expanding); + const auto viewerLayout = new QHBoxLayout(viewerWidget); viewerLayout->setContentsMargins(frictionMargins); - viewerLayout->setSpacing(frictionSpacing); - viewerLayout->addWidget(mStackWidget); - viewerLayout->addWidget(mViewerDrawBar); - - frictionTopLayout->addWidget(viewerToolBar); - frictionTopLayout->addWidget(mViewerNodeBar); - frictionTopLayout->addWidget(viewerWidget); - - mBottomSideBarWidget = new QTabWidget(this); - mBottomSideBarWidget->tabBar()->setFocusPolicy(Qt::NoFocus); - mBottomSideBarWidget->setContentsMargins(frictionMargins); - mBottomSideBarWidget->setMinimumWidth(sideBarMin); - mBottomSideBarWidget->setTabPosition(QTabWidget::South); - eSizesUI::widget.add(mBottomSideBarWidget, [this](const int size) { - mBottomSideBarWidget->setIconSize(QSize(size, size)); - }); - - mTabPropertiesIndex = mBottomSideBarWidget->addTab(propertiesWidget, - QIcon::fromTheme("drawPathAutoChecked"), - tr("Properties")); - mTabAssetsIndex = mBottomSideBarWidget->addTab(assets, - QIcon::fromTheme("asset_manager"), - tr("Assets")); - mTabQueueIndex = mBottomSideBarWidget->addTab(mRenderWidget, - QIcon::fromTheme("render_animation"), - tr("Queue")); - - mSplitterMain = new QSplitter(this); - - mSplitterLeft = new QSplitter(this); - mSplitterRight = new QSplitter(this); - - mSplitterLeftTop = new QSplitter(this); - mSplitterLeftBottom = new QSplitter(this); - - mSplitterRightTop = new QSplitter(this); - mSplitterRightBottom = new QSplitter(this); - - mSplitterMain->setOrientation(Qt::Horizontal); - - mSplitterLeft->setOrientation(Qt::Vertical); - mSplitterRight->setOrientation(Qt::Vertical); - - mSplitterLeftTop->setOrientation(Qt::Horizontal); - mSplitterLeftBottom->setOrientation(Qt::Horizontal); - - mSplitterRightTop->setOrientation(Qt::Horizontal); - mSplitterRightBottom->setOrientation(Qt::Horizontal); - - mSplitterMain->addWidget(mSplitterLeft); - mSplitterMain->addWidget(mSplitterRight); + viewerLayout->setSpacing(0); - mSplitterLeft->addWidget(mSplitterLeftTop); - mSplitterLeft->addWidget(mSplitterLeftBottom); - - mSplitterRight->addWidget(mSplitterRightTop); - mSplitterRight->addWidget(mSplitterRightBottom); + const auto toolBoxWidget = new QWidget(this); + toolBoxWidget->setSizePolicy(QSizePolicy::Fixed, + QSizePolicy::Expanding); + toolBoxWidget->setContentsMargins(0, 0, 0, 0); + const auto toolBoxLayout = new QVBoxLayout(toolBoxWidget); + toolBoxLayout->setContentsMargins(0, 0, 0, 0); + toolBoxLayout->setSpacing(0); - mSplitterLeftTop->addWidget(frictionTopWidget); - mSplitterLeftBottom->addWidget(mTimeline); + toolBoxLayout->addWidget(mToolBoxButton); + toolBoxLayout->addWidget(mToolBoxStack); - mSplitterRightTop->addWidget(mTopSideBarWidget); - mSplitterRightBottom->addWidget(mBottomSideBarWidget); + viewerLayout->addWidget(toolBoxWidget); + viewerLayout->addWidget(mStackWidget); - setCentralWidget(mSplitterMain); + // final layout + mUI = new UILayout(this); + std::vector docks; + docks.push_back({UIDock::Position::Up, + -1, + tr("Viewer"), + viewerWidget, + false, + false, + false}); + docks.push_back({UIDock::Position::Down, + -1, + tr("Timeline"), + mTimeline, + false, + false, + false}); + docks.push_back({UIDock::Position::Right, + -1, + tr("Color and Text"), + mTabColorText, + false, + true, + false}); + docks.push_back({UIDock::Position::Right, + -1, + tr("Properties"), + mTabProperties, + false, + true, + false}); + mUI->addDocks(docks); + setCentralWidget(mUI); readSettings(openProject); } @@ -503,11 +436,11 @@ void MainWindow::setupMenuBar() this, qOverload<>(&MainWindow::openFile), Qt::CTRL + Qt::Key_O); - QToolButton *loadToolBtn = new QToolButton(this); + const auto loadToolBtn = new QToolButton(this); loadToolBtn->setPopupMode(QToolButton::MenuButtonPopup); loadToolBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); loadToolBtn->setFocusPolicy(Qt::NoFocus); - QMenu *loadToolMenu = new QMenu(this); + const auto loadToolMenu = new QMenu(this); loadToolBtn->setMenu(loadToolMenu); mToolbar->addWidget(loadToolBtn); @@ -541,11 +474,11 @@ void MainWindow::setupMenuBar() tr("Revert", "MenuBar_File"), this, &MainWindow::revert); - QToolButton *saveToolBtn = new QToolButton(this); + const auto saveToolBtn = new QToolButton(this); saveToolBtn->setPopupMode(QToolButton::MenuButtonPopup); saveToolBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); saveToolBtn->setFocusPolicy(Qt::NoFocus); - QMenu *saveToolMenu = new QMenu(this); + const auto saveToolMenu = new QMenu(this); saveToolBtn->setMenu(saveToolMenu); mToolbar->addWidget(saveToolBtn); @@ -694,7 +627,7 @@ void MainWindow::setupMenuBar() mViewMenu = mMenuBar->addMenu(tr("View", "MenuBar")); //auto mToolsMenu = mMenuBar->addMenu(tr("Tools", "MenuBar")); - //mToolsMenu->addActions(mToolbarActGroup->actions()); + //mToolsMenu->addActions(mToolBoxGroupMain->actions()); mObjectMenu = mMenuBar->addMenu(tr("Object", "MenuBar")); @@ -858,13 +791,13 @@ void MainWindow::setupMenuBar() // mEffectsMenu->addAction("Blur"); - QToolButton *sceneToolBtn = new QToolButton(this); + const auto sceneToolBtn = new QToolButton(this); sceneToolBtn->setText(tr("Scene")); sceneToolBtn->setIcon(QIcon::fromTheme("sequence")); sceneToolBtn->setPopupMode(QToolButton::MenuButtonPopup); sceneToolBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); sceneToolBtn->setFocusPolicy(Qt::NoFocus); - QMenu *sceneToolMenu = new QMenu(this); + const auto sceneToolMenu = new QMenu(this); sceneToolBtn->setMenu(sceneToolMenu); mToolbar->addWidget(sceneToolBtn); @@ -929,8 +862,6 @@ void MainWindow::setupMenuBar() cwTarget->zoomOutView(); }); - - mFitViewAction = zoomMenu->addAction(tr("Fit to Canvas", "MenuBar_View_Zoom")); mFitViewAction->setShortcut(QKeySequence("Ctrl+0")); connect(mFitViewAction, &QAction::triggered, @@ -1064,7 +995,9 @@ void MainWindow::setupMenuBar() this, [this](bool triggered) { if (mTimelineWindowAct->isChecked()) { openTimelineWindow(); - } else { mTimeline->setVisible(triggered); } + } else { + mUI->setDockVisible(tr("Timeline"), triggered); + } }); mTimelineWindowAct = mViewMenu->addAction(tr("Timeline Window")); @@ -1072,8 +1005,8 @@ void MainWindow::setupMenuBar() connect(mTimelineWindowAct, &QAction::triggered, this, [this](bool triggered) { if (!triggered) { - statusBar()->showMessage(tr("Restart Friction to apply"), 5000); - // TODO: move widget from window to main ui without restart + mUI->addDockWidget(tr("Timeline"), mTimeline); + mTimelineWindow->deleteLater(); } else { openTimelineWindow(); } @@ -1087,8 +1020,10 @@ void MainWindow::setupMenuBar() connect(mRenderWindowAct, &QAction::triggered, this, [this](bool triggered) { if (!triggered) { - statusBar()->showMessage(tr("Restart Friction to apply"), 5000); - // TODO: move widget from window to main ui without restart + mTabQueueIndex = mTabProperties->addTab(mRenderWidget, + QIcon::fromTheme("render_animation"), + tr("Queue")); + mRenderWindow->deleteLater(); } else { openRenderQueueWindow(); } @@ -1198,7 +1133,7 @@ void MainWindow::setupMenuBar() setMenuBar(mMenuBar); // spacer - QWidget* spacer = new QWidget(this); + const auto spacer = new QWidget(this); spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); mToolbar->addWidget(spacer); @@ -1221,7 +1156,7 @@ void MainWindow::setResolutionText(QString text) setResolutionValue(res); } -QAction *MainWindow::addSlider(const QString &name, +/*QAction *MainWindow::addSlider(const QString &name, QDoubleSlider * const slider, QToolBar * const toolBar) { @@ -1234,47 +1169,7 @@ QAction *MainWindow::addSlider(const QString &name, layout->addWidget(label); layout->addWidget(slider); return toolBar->addWidget(widget); -} - -void MainWindow::setupDrawPathSpins() -{ - mDocument.fDrawPathManual = false; - mDrawPathAuto = new QAction(mDocument.fDrawPathManual ? QIcon::fromTheme("drawPathAutoUnchecked") : QIcon::fromTheme("drawPathAutoChecked"), - tr("Automatic/Manual Fitting"), - this); - connect(mDrawPathAuto, &QAction::triggered, - this, [this]() { - mDocument.fDrawPathManual = !mDocument.fDrawPathManual; - qDebug() << "manual fitting?" << mDocument.fDrawPathManual; - mDrawPathMaxErrorAct->setDisabled(mDocument.fDrawPathManual); - mDrawPathAuto->setIcon(mDocument.fDrawPathManual ? QIcon::fromTheme("drawPathAutoUnchecked") : QIcon::fromTheme("drawPathAutoChecked")); - }); - mViewerDrawBar->addAction(mDrawPathAuto); - - mDrawPathMaxError = new QDoubleSlider(1, 200, 1, this); - mDrawPathMaxError->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); - mDrawPathMaxError->setNumberDecimals(0); - mDrawPathMaxError->setDisplayedValue(mDocument.fDrawPathMaxError); - connect(mDrawPathMaxError, &QDoubleSlider::valueEdited, - this, [this](const qreal value) { - mDocument.fDrawPathMaxError = qFloor(value); - }); - mDrawPathMaxErrorAct = addSlider(tr("Max Error"), - mDrawPathMaxError, - mViewerDrawBar); - - mDrawPathSmooth = new QDoubleSlider(1, 200, 1, this); - mDrawPathSmooth->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); - mDrawPathSmooth->setNumberDecimals(0); - mDrawPathSmooth->setDisplayedValue(mDocument.fDrawPathSmooth); - connect(mDrawPathSmooth, &QDoubleSlider::valueEdited, - this, [this](const qreal value) { - mDocument.fDrawPathSmooth = qFloor(value); - }); - mDrawPathSmoothAct = addSlider(tr("Smooth"), - mDrawPathSmooth, - mViewerDrawBar); -} +}*/ void MainWindow::checkAutoSaveTimer() { @@ -1312,6 +1207,7 @@ void MainWindow::openTimelineWindow() true, true, true); + mUI->setDockVisible(tr("Timeline"), false); } mTimelineWindow->focusWindow(); } @@ -1319,7 +1215,7 @@ void MainWindow::openTimelineWindow() void MainWindow::openRenderQueueWindow(const bool &focus) { if (!mRenderWindow) { - mBottomSideBarWidget->removeTab(mTabQueueIndex); + mTabProperties->removeTab(mTabQueueIndex); mRenderWidget->setVisible(true); mRenderWindow = new Window(this, mRenderWidget, @@ -1347,7 +1243,7 @@ void MainWindow::addCanvasToRenderQue() { if (!mDocument.fActiveScene) { return; } if (mRenderWindowAct->isChecked()) { openRenderQueueWindow(); } - else { mBottomSideBarWidget->setCurrentIndex(mTabQueueIndex); } + else { mTabProperties->setCurrentIndex(mTabQueueIndex); } mRenderWidget->createNewRenderInstanceWidgetForCanvas(mDocument.fActiveScene); } @@ -1392,376 +1288,18 @@ void MainWindow::setupToolBar() }); addToolBar(mToolbar); - mToolbarActGroup = new QActionGroup(this); - mToolBarNodeGroup = new QActionGroup(this); - - // boxTransform - QAction *boxTransformAct = new QAction(QIcon::fromTheme("boxTransform"), - tr("Object"), - this); - boxTransformAct->setCheckable(true); - boxTransformAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "boxTransform", - "F1").toString())); - connect(boxTransformAct, - &QAction::triggered, - this, - [boxTransformAct, this]() { - if (boxTransformAct->isChecked()) { mActions.setMovePathMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, boxTransformAct]() { - if (mDocument.fCanvasMode == CanvasMode::boxTransform) { - boxTransformAct->setChecked(true); - } - }); - boxTransformAct->setChecked(true); // default - mToolbarActGroup->addAction(boxTransformAct); - - // pointTransform - QAction *pointTransformAct = new QAction(QIcon::fromTheme("pointTransform"), - tr("Point"), - this); - pointTransformAct->setCheckable(true); - pointTransformAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "pointTransform", - "F2").toString())); - connect(pointTransformAct, - &QAction::triggered, - this, - [pointTransformAct, this]() { - if (pointTransformAct->isChecked()) { mActions.setMovePointMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, pointTransformAct]() { - if (mDocument.fCanvasMode == CanvasMode::pointTransform) { - pointTransformAct->setChecked(true); - } - }); - mToolbarActGroup->addAction(pointTransformAct); - - // addPointMode - QAction *addPointModeAct = new QAction(QIcon::fromTheme("pathCreate"), - tr("Add Path"), - this); - addPointModeAct->setCheckable(true); - addPointModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "pathCreate", - "F3").toString())); - connect(addPointModeAct, - &QAction::triggered, - this, - [addPointModeAct, this]() { - if (addPointModeAct->isChecked()) { mActions.setAddPointMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, addPointModeAct]() { - if (mDocument.fCanvasMode == CanvasMode::pathCreate) { - addPointModeAct->setChecked(true); - } - }); - mToolbarActGroup->addAction(addPointModeAct); - - // drawPathMode - QAction *drawPathModeAct = new QAction(QIcon::fromTheme("drawPath"), - tr("Draw Path"), - this); - drawPathModeAct->setCheckable(true); - drawPathModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "drawPath", - "F4").toString())); - connect(drawPathModeAct, - &QAction::triggered, - this, - [drawPathModeAct, this]() { - if (drawPathModeAct->isChecked()) { mActions.setDrawPathMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, drawPathModeAct]() { - if (mDocument.fCanvasMode == CanvasMode::drawPath) { - drawPathModeAct->setChecked(true); - } - }); - mToolbarActGroup->addAction(drawPathModeAct); - - // paintMode - /*QAction *paintModeAct = new QAction(QIcon::fromTheme("paint"), - tr("Paint"), - this); - paintModeAct->setCheckable(true); - paintModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "paintMode", - "F5").toString())); - connect(paintModeAct, - &QAction::triggered, - this, - [paintModeAct, this]() { - if (paintModeAct->isChecked()) { mActions.setPaintMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, paintModeAct]() { - if (mDocument.fCanvasMode == CanvasMode::paint) { - paintModeAct->setChecked(true); - } - }); - mToolbarActGroup->addAction(paintModeAct);*/ - - // circleMode - QAction *circleModeAct = new QAction(QIcon::fromTheme("circleCreate"), - tr("Add Circle"), - this); - circleModeAct->setCheckable(true); - circleModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "circleMode", - "F5").toString())); - connect(circleModeAct, - &QAction::triggered, - this, - [circleModeAct, this]() { - if (circleModeAct->isChecked()) { mActions.setCircleMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, circleModeAct]() { - if (mDocument.fCanvasMode == CanvasMode::circleCreate) { - circleModeAct->setChecked(true); - } - }); - mToolbarActGroup->addAction(circleModeAct); - - // rectangleMode - QAction *rectModeAct = new QAction(QIcon::fromTheme("rectCreate"), - tr("Add Rectangle"), - this); - rectModeAct->setCheckable(true); - rectModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "rectMode", - "F6").toString())); - connect(rectModeAct, - &QAction::triggered, - this, - [rectModeAct, this]() { - if (rectModeAct->isChecked()) { mActions.setRectangleMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, rectModeAct]() { - if (mDocument.fCanvasMode == CanvasMode::rectCreate) { - rectModeAct->setChecked(true); - } - }); - mToolbarActGroup->addAction(rectModeAct); - - // textMode - QAction *textModeAct = new QAction(QIcon::fromTheme("textCreate"), - tr("Add Text"), - this); - textModeAct->setCheckable(true); - textModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "textMode", - "F7").toString())); - connect(textModeAct, - &QAction::triggered, - this, - [textModeAct, this]() { - if (textModeAct->isChecked()) { mActions.setTextMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, textModeAct]() { - if (mDocument.fCanvasMode == CanvasMode::textCreate) { - mTopSideBarWidget->setCurrentIndex(mTabTextIndex); - textModeAct->setChecked(true); - } - }); - mToolbarActGroup->addAction(textModeAct); - - // nullMode - QAction *nullModeAct = new QAction(QIcon::fromTheme("nullCreate"), - tr("Add Null Object"), - this); - nullModeAct->setCheckable(true); - nullModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "nullMode", - "F8").toString())); - connect(nullModeAct, - &QAction::triggered, - this, - [nullModeAct, this]() { - if (nullModeAct->isChecked()) { mActions.setNullMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, nullModeAct]() { - if (mDocument.fCanvasMode == CanvasMode::nullCreate) { - nullModeAct->setChecked(true); - } - }); - mToolbarActGroup->addAction(nullModeAct); - - // pickMode - QAction *pickModeAct = new QAction(QIcon::fromTheme("pick"), - tr("Pick"), - this); - pickModeAct->setCheckable(true); - pickModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "pickMode", - "F9").toString())); - connect(pickModeAct, - &QAction::triggered, - this, - [pickModeAct, this]() { - if (pickModeAct->isChecked()) { mActions.setPickPaintSettingsMode(); } - }); - connect(&mDocument, - &Document::canvasModeSet, - this, - [this, pickModeAct]() { - if (mDocument.fCanvasMode == CanvasMode::pickFillStroke) { - pickModeAct->setChecked(true); - } - }); - mToolbarActGroup->addAction(pickModeAct); - - // pivot - mLocalPivotAct = new QAction(mDocument.fLocalPivot ? QIcon::fromTheme("pivotLocal") : QIcon::fromTheme("pivotGlobal"), - tr("Pivot Global / Local"), - this); - mLocalPivotAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", - "localPivot", - "P").toString())); - connect(mLocalPivotAct, &QAction::triggered, - this, [this]() { - mDocument.fLocalPivot = !mDocument.fLocalPivot; - for (const auto& scene : mDocument.fScenes) { scene->updatePivot(); } - Document::sInstance->actionFinished(); - mLocalPivotAct->setIcon(mDocument.fLocalPivot ? QIcon::fromTheme("pivotLocal") : QIcon::fromTheme("pivotGlobal")); - }); + + // add toolbar group actions //mToolBar->addSeparator(); - //mToolBar->addActions(mToolbarActGroup->actions()); + //mToolBar->addActions(mToolBoxGroupMain->actions()); // spacer /*QWidget* spacer1 = new QWidget(this); spacer1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); mToolBar->addWidget(spacer1);*/ - // nodeConnect - mActionConnectPointsAct = new QAction(QIcon::fromTheme("nodeConnect"), - tr("Connect Nodes"), - this); - connect(mActionConnectPointsAct, &QAction::triggered, - this, [this]() { mActions.connectPointsSlot(); }); - mToolBarNodeGroup->addAction(mActionConnectPointsAct); - - // nodeDisconnect - mActionDisconnectPointsAct = new QAction(QIcon::fromTheme("nodeDisconnect"), - tr("Disconnect Nodes"), - this); - connect(mActionDisconnectPointsAct, &QAction::triggered, - this, [this]() { mActions.disconnectPointsSlot(); }); - mToolBarNodeGroup->addAction(mActionDisconnectPointsAct); - - // nodeMerge - mActionMergePointsAct = new QAction(QIcon::fromTheme("nodeMerge"), - tr("Merge Nodes"), - this); - connect(mActionMergePointsAct, &QAction::triggered, - this, [this]() { mActions.mergePointsSlot(); }); - mToolBarNodeGroup->addAction(mActionMergePointsAct); - - // nodeNew - mActionNewNodeAct = new QAction(QIcon::fromTheme("nodeNew"), - tr("New Node"), - this); - connect(mActionNewNodeAct, &QAction::triggered, - this, [this]() { mActions.subdivideSegments(); }); - mToolBarNodeGroup->addAction(mActionNewNodeAct); - - // nodeSymmetric - mActionSymmetricPointCtrlsAct = new QAction(QIcon::fromTheme("nodeSymmetric"), - tr("Symmetric Nodes"), - this); - connect(mActionSymmetricPointCtrlsAct, &QAction::triggered, - this, [this]() { mActions.makePointCtrlsSymmetric(); }); - mToolBarNodeGroup->addAction(mActionSymmetricPointCtrlsAct); - - // nodeSmooth - mActionSmoothPointCtrlsAct = new QAction(QIcon::fromTheme("nodeSmooth"), - tr("Smooth Nodes"), - this); - connect(mActionSmoothPointCtrlsAct, &QAction::triggered, - this, [this]() { mActions.makePointCtrlsSmooth(); }); - mToolBarNodeGroup->addAction(mActionSmoothPointCtrlsAct); - - // nodeCorner - mActionCornerPointCtrlsAct = new QAction(QIcon::fromTheme("nodeCorner"), - tr("Corner Nodes"), - this); - connect(mActionCornerPointCtrlsAct, &QAction::triggered, - this, [this]() { mActions.makePointCtrlsCorner(); }); - mToolBarNodeGroup->addAction(mActionCornerPointCtrlsAct); - - //mSeparator2 = mToolBar->addSeparator(); - - // segmentLine - mActionLineAct = new QAction(QIcon::fromTheme("segmentLine"), - tr("Make Segment Line"), - this); - connect(mActionLineAct, &QAction::triggered, - this, [this]() { mActions.makeSegmentLine(); }); - mToolBarNodeGroup->addAction(mActionLineAct); - - // segmentCurve - mActionCurveAct = new QAction(QIcon::fromTheme("segmentCurve"), - tr("Make Segment Curve"), - this); - connect(mActionCurveAct, &QAction::triggered, - this, [this]() { mActions.makeSegmentCurve(); }); - mToolBarNodeGroup->addAction(mActionCurveAct); - - // nodeVisibility - mNodeVisibility = new QToolButton(this); - mNodeVisibility->setObjectName(QString::fromUtf8("ToolButton")); - mNodeVisibility->setPopupMode(QToolButton::InstantPopup); - QAction *nodeVisibilityAction1 = new QAction(QIcon::fromTheme("dissolvedAndNormalNodes"), - tr("Dissolved and normal nodes"), - this); - nodeVisibilityAction1->setData(0); - QAction *nodeVisibilityAction2 = new QAction(QIcon::fromTheme("dissolvedNodesOnly"), - tr("Dissolved nodes only"), - this); - nodeVisibilityAction2->setData(1); - QAction *nodeVisibilityAction3 = new QAction(QIcon::fromTheme("normalNodesOnly"), - tr("Normal nodes only"), - this); - nodeVisibilityAction3->setData(2); - mNodeVisibility->addAction(nodeVisibilityAction1); - mNodeVisibility->addAction(nodeVisibilityAction2); - mNodeVisibility->addAction(nodeVisibilityAction3); - mNodeVisibility->setDefaultAction(nodeVisibilityAction1); - connect(mNodeVisibility, &QToolButton::triggered, - this, [this](QAction *act) { - qDebug() << "set node visibility" << act->data().toInt(); - mNodeVisibility->setDefaultAction(act); - mDocument.fNodeVisibility = static_cast(act->data().toInt()); - Document::sInstance->actionFinished(); - }); // fontWidget //mFontWidget = new FontsWidget(this); @@ -1782,9 +1320,6 @@ void MainWindow::setupToolBar() // add toolbar //addToolBar(mToolBar); - - // set default mode - mDocument.setCanvasMode(CanvasMode::boxTransform); } void MainWindow::connectToolBarActions() @@ -1811,25 +1346,16 @@ void MainWindow::updateCanvasModeButtonsChecked() const CanvasMode mode = mDocument.fCanvasMode; //mCentralWidget->setCanvasMode(mode); - //const bool boxMode = mode == CanvasMode::boxTransform; + //mFontWidgetAct->setVisible(boxMode); + const bool boxMode = mode == CanvasMode::boxTransform; const bool pointMode = mode == CanvasMode::pointTransform; + const bool drawMode = mode == CanvasMode::drawPath; - mViewerDrawBar->setVisible(mode == CanvasMode::drawPath); - mViewerNodeBar->setVisible(pointMode); - mActionConnectPointsAct->setVisible(pointMode); - mActionDisconnectPointsAct->setVisible(pointMode); - mActionMergePointsAct->setVisible(pointMode); - mActionNewNodeAct->setVisible(pointMode); - mActionSymmetricPointCtrlsAct->setVisible(pointMode); - mActionSmoothPointCtrlsAct->setVisible(pointMode); - mActionCornerPointCtrlsAct->setVisible(pointMode); - mActionLineAct->setVisible(pointMode); - mActionCurveAct->setVisible(pointMode); - - mLocalPivotAct->setVisible(mode == CanvasMode::pointTransform || - mode == CanvasMode::boxTransform); + mToolBoxButton->setVisible(pointMode || drawMode); + mToolBoxStack->setCurrentIndex(drawMode ? mToolBoxDrawIndex : (pointMode ? mToolBoxNodesIndex : mToolBoxMainIndex)); + mLocalPivotAct->setVisible(pointMode || boxMode); //const bool paintMode = mode == CanvasMode::paint; //mActionNewEmptyPaintFrameAct->setVisible(paintMode); @@ -2059,24 +1585,12 @@ bool MainWindow::processKeyEvent(QKeyEvent *event) void MainWindow::readSettings(const QString &openProject) { + mUI->readSettings(); restoreState(AppSupport::getSettings("ui", "state").toByteArray()); restoreGeometry(AppSupport::getSettings("ui", "geometry").toByteArray()); - mSplitterMain->restoreState(AppSupport::getSettings("ui", - "SplitterMain").toByteArray()); - mSplitterLeft->restoreState(AppSupport::getSettings("ui", - "SplitterLeft").toByteArray()); - mSplitterRight->restoreState(AppSupport::getSettings("ui", - "SplitterRight").toByteArray()); - mSplitterLeftTop->restoreState(AppSupport::getSettings("ui", - "SplitterLeftTop").toByteArray()); - mSplitterLeftBottom->restoreState(AppSupport::getSettings("ui", - "SplitterLeftBottom").toByteArray()); - mSplitterRightTop->restoreState(AppSupport::getSettings("ui", - "SplitterRightTop").toByteArray()); - mSplitterRightBottom->restoreState(AppSupport::getSettings("ui", - "SplitterRightBottom").toByteArray()); + bool isMax = AppSupport::getSettings("ui", "maximized", false).toBool(); @@ -2122,13 +1636,6 @@ void MainWindow::writeSettings() { AppSupport::setSettings("ui", "state", saveState()); AppSupport::setSettings("ui", "geometry", saveGeometry()); - AppSupport::setSettings("ui", "SplitterMain", mSplitterMain->saveState()); - AppSupport::setSettings("ui", "SplitterLeft", mSplitterLeft->saveState()); - AppSupport::setSettings("ui", "SplitterRight", mSplitterRight->saveState()); - AppSupport::setSettings("ui", "SplitterLeftTop", mSplitterLeftTop->saveState()); - AppSupport::setSettings("ui", "SplitterLeftBottom", mSplitterLeftBottom->saveState()); - AppSupport::setSettings("ui", "SplitterRightTop", mSplitterRightTop->saveState()); - AppSupport::setSettings("ui", "SplitterRightBottom", mSplitterRightBottom->saveState()); AppSupport::setSettings("ui", "maximized", isMaximized()); AppSupport::setSettings("ui", "fullScreen", isFullScreen()); } @@ -2419,7 +1926,7 @@ void MainWindow::openRendererWindow() addCanvasToRenderQue(); } else { if (mRenderWindowAct->isChecked()) { openRenderQueueWindow(); } - else { mBottomSideBarWidget->setCurrentIndex(mTabQueueIndex); } + else { mTabProperties->setCurrentIndex(mTabQueueIndex); } } } @@ -2481,8 +1988,8 @@ void MainWindow::addRecentFile(const QString &recent) void MainWindow::readRecentFiles() { - QStringList files = AppSupport::getSettings("files", - "recentSaved").toStringList(); + const auto files = AppSupport::getSettings("files", + "recentSaved").toStringList(); for (const auto &file : files) { mRecentFiles.append(file); } } diff --git a/src/app/GUI/mainwindow.h b/src/app/GUI/mainwindow.h old mode 100755 new mode 100644 index e1c46516c..2ddbc16b7 --- a/src/app/GUI/mainwindow.h +++ b/src/app/GUI/mainwindow.h @@ -21,6 +21,8 @@ # */ +// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner + #ifndef MAINWINDOW_H #define MAINWINDOW_H @@ -31,21 +33,17 @@ #include #include #include -#include #include #include #include #include #include -#include "undoredo.h" #include "Private/Tasks/taskscheduler.h" -#include "effectsloader.h" #include "Private/document.h" -#include "audiohandler.h" +#include "Sound/audiohandler.h" #include "actions.h" #include "layouthandler.h" -#include "Private/esettings.h" #include "renderhandler.h" #include "fileshandler.h" #include "ekeyfilter.h" @@ -53,6 +51,8 @@ #include "GUI/qdoubleslider.h" #include "window.h" #include "GUI/aboutwidget.h" +#include "widgets/uilayout.h" +#include "widgets/toolbutton.h" class VideoEncoder; class RenderWidget; @@ -202,8 +202,8 @@ class MainWindow : public QMainWindow //CentralWidget *mCentralWidget; QStackedWidget *mStackWidget; - QTabWidget *mTopSideBarWidget; - QTabWidget *mBottomSideBarWidget; + QTabWidget *mTabColorText; + QTabWidget *mTabProperties; void openWelcomeDialog(); void closeWelcomeDialog(); @@ -261,21 +261,24 @@ class MainWindow : public QMainWindow //QStatusBar* mStatusBar; //UsageWidget* mUsageWidget = nullptr; + + QStackedWidget *mToolBoxStack; + int mToolBoxMainIndex; + int mToolBoxNodesIndex; + int mToolBoxDrawIndex; + QToolBar *mToolbar; - QActionGroup *mToolbarActGroup; - QActionGroup *mToolBarNodeGroup; + ToolButton *mToolBoxButton; - QToolBar *mViewerNodeBar; - QToolBar *mViewerDrawBar; + QActionGroup *mToolBoxGroupMain; + QActionGroup *mToolBoxGroupNodes; - QSplitter *mSplitterMain; - QSplitter *mSplitterLeft; - QSplitter *mSplitterRight; - QSplitter *mSplitterLeftTop; - QSplitter *mSplitterLeftBottom; - QSplitter *mSplitterRightTop; - QSplitter *mSplitterRightBottom; + QToolBar *mToolBoxMain; + QToolBar *mToolBoxNodes; + QToolBar *mToolBoxDraw; + + UILayout *mUI; QAction *mSaveAct; @@ -318,9 +321,7 @@ class MainWindow : public QMainWindow QAction *mDrawPathAuto; QDoubleSlider *mDrawPathSmooth; - QAction *mDrawPathSmoothAct; QDoubleSlider *mDrawPathMaxError; - QAction *mDrawPathMaxErrorAct; QMenuBar *mMenuBar; QMenu *mFileMenu; @@ -375,10 +376,14 @@ class MainWindow : public QMainWindow QComboBox *mResolutionComboBox; void setResolutionText(QString text); - QAction* addSlider(const QString &name, + /*QAction* addSlider(const QString &name, QDoubleSlider* const slider, - QToolBar* const toolBar); - void setupDrawPathSpins(); + QToolBar* const toolBar);*/ + + void setupToolBox(); + void setupToolBoxMain(); + void setupToolBoxNodes(); + void setupToolBoxDraw(); bool mBackupOnSave; bool mAutoSave; diff --git a/src/app/GUI/namedcontainer.cpp b/src/app/GUI/namedcontainer.cpp deleted file mode 100755 index 804c1e724..000000000 --- a/src/app/GUI/namedcontainer.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#include "namedcontainer.h" - -NamedContainer::NamedContainer(const QString& name, QWidget *widget, - const bool vertical, - QWidget *parent) : QWidget(parent) { - mNameLabel = new QLabel("
" + name + "
", this); - mNameLabel->setObjectName("dockLabel"); - mNameLabel->setSizePolicy(QSizePolicy::MinimumExpanding, - QSizePolicy::Fixed); - if(vertical) mLayout = new QVBoxLayout(this); - else mLayout = new QHBoxLayout(this); - mLayout->setSpacing(0); - mLayout->addWidget(mNameLabel); - mLayout->addWidget(widget); - setLayout(mLayout); -} diff --git a/src/app/GUI/noshortcutaction.cpp b/src/app/GUI/noshortcutaction.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/noshortcutaction.h b/src/app/GUI/noshortcutaction.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/qdoubleslider.cpp b/src/app/GUI/qdoubleslider.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/qdoubleslider.h b/src/app/GUI/qdoubleslider.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/qrealanimatorvalueslider.cpp b/src/app/GUI/qrealanimatorvalueslider.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/qrealanimatorvalueslider.h b/src/app/GUI/qrealanimatorvalueslider.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/qrealpointvaluedialog.cpp b/src/app/GUI/qrealpointvaluedialog.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/qrealpointvaluedialog.h b/src/app/GUI/qrealpointvaluedialog.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/renderoutputwidget.cpp b/src/app/GUI/renderoutputwidget.cpp old mode 100755 new mode 100644 index eee981630..06ce7720e --- a/src/app/GUI/renderoutputwidget.cpp +++ b/src/app/GUI/renderoutputwidget.cpp @@ -26,7 +26,7 @@ #include "renderoutputwidget.h" #include "GUI/edialogs.h" -#include "editablecombobox.h" +#include "widgets/editablecombobox.h" #include #include diff --git a/src/app/GUI/renderoutputwidget.h b/src/app/GUI/renderoutputwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/timelinebasewrappernode.cpp b/src/app/GUI/timelinebasewrappernode.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/timelinebasewrappernode.h b/src/app/GUI/timelinebasewrappernode.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/timelinedockwidget.cpp b/src/app/GUI/timelinedockwidget.cpp old mode 100755 new mode 100644 index e2b070c66..94a431856 --- a/src/app/GUI/timelinedockwidget.cpp +++ b/src/app/GUI/timelinedockwidget.cpp @@ -38,7 +38,7 @@ #include "canvas.h" #include "animationdockwidget.h" #include "widgetstack.h" -#include "actionbutton.h" +#include "widgets/actionbutton.h" #include "timelinewidget.h" #include "animationwidgetscrollbar.h" #include "renderinstancesettings.h" diff --git a/src/app/GUI/timelinedockwidget.h b/src/app/GUI/timelinedockwidget.h old mode 100755 new mode 100644 index 8d0cdeb09..f8888a036 --- a/src/app/GUI/timelinedockwidget.h +++ b/src/app/GUI/timelinedockwidget.h @@ -46,7 +46,6 @@ #include "smartPointers/ememory.h" #include "framerange.h" #include "timelinebasewrappernode.h" -#include "triggerlabel.h" #include "qdoubleslider.h" #include "renderhandler.h" diff --git a/src/app/GUI/timelinehighlightwidget.cpp b/src/app/GUI/timelinehighlightwidget.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/timelinehighlightwidget.h b/src/app/GUI/timelinehighlightwidget.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/timelinewidget.cpp b/src/app/GUI/timelinewidget.cpp old mode 100755 new mode 100644 index 0438cb5af..1f8ea5bf5 --- a/src/app/GUI/timelinewidget.cpp +++ b/src/app/GUI/timelinewidget.cpp @@ -40,8 +40,8 @@ #include "animationdockwidget.h" #include "GUI/global.h" #include "canvas.h" -#include "scenechooser.h" -#include "changewidthwidget.h" +#include "widgets/scenechooser.h" +#include "widgets/changewidthwidget.h" #include "timelinehighlightwidget.h" TimelineWidget::TimelineWidget(Document &document, diff --git a/src/app/GUI/timelinewidget.h b/src/app/GUI/timelinewidget.h old mode 100755 new mode 100644 index 8c971c354..b4671a919 --- a/src/app/GUI/timelinewidget.h +++ b/src/app/GUI/timelinewidget.h @@ -35,7 +35,7 @@ #include "smartPointers/stdselfref.h" #include "framerange.h" #include "ReadWrite/basicreadwrite.h" -#include "fakemenubar.h" +#include "widgets/fakemenubar.h" #include "XML/runtimewriteid.h" class SWT_Abstraction; diff --git a/src/app/GUI/timelinewrappernode.cpp b/src/app/GUI/timelinewrappernode.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/timelinewrappernode.h b/src/app/GUI/timelinewrappernode.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/tipswidget.cpp b/src/app/GUI/tipswidget.cpp deleted file mode 100644 index 2f9ee94e0..000000000 --- a/src/app/GUI/tipswidget.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#include "tipswidget.h" - -#include "Private/esettings.h" -#include "GUI/global.h" - -#include -#include -#include - -TipsWidget::TipsWidget(QWidget* const parent) : QWidget(parent) { - const auto mainLayout = new QVBoxLayout; - mainLayout->setContentsMargins(0, 0, 0, 0); - const auto titleLayout = new QHBoxLayout; - titleLayout->setContentsMargins(0, 0, 0, 0); - - const QString iconsDir = eSettings::sIconsDir(); - - const QIcon leftIcon(iconsDir + "/left-arrow.png"); - const auto leftButton = new QPushButton(leftIcon, ""); - leftButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); - connect(leftButton, &QPushButton::released, - this, &TipsWidget::showPreviousTip); - titleLayout->addWidget(leftButton); - - mNumber = new QLabel(this); - mNumber->setAlignment(Qt::AlignCenter); - titleLayout->addWidget(mNumber); - - const QIcon rightIcon(iconsDir + "/right-arrow.png"); - const auto rightButton = new QPushButton(rightIcon, ""); - rightButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); - connect(rightButton, &QPushButton::released, - this, &TipsWidget::showNextTip); - titleLayout->addWidget(rightButton); - - mainLayout->addLayout(titleLayout); - eSizesUI::widget.addSpacing(mainLayout); - - mTitle = new QLabel(this); - mainLayout->addWidget(mTitle, 0, Qt::AlignTop); - eSizesUI::widget.addHalfSpacing(mainLayout); - - mGif = new QLabel(this); - - mGif->setMovie(&mMovie); - mainLayout->addWidget(mGif, 0, Qt::AlignTop); - eSizesUI::widget.addHalfSpacing(mainLayout); - - mDesc = new QLabel(this); - mDesc->setAlignment(Qt::AlignTop | Qt::AlignLeft); - mDesc->setWordWrap(true); - mainLayout->addWidget(mDesc, 0, Qt::AlignTop); - eSizesUI::widget.addHalfSpacing(mainLayout); - - setLayout(mainLayout); - - eSizesUI::widget.add(this, [this](const int size) { - setFixedWidth(12*size); - mGif->setFixedWidth(12*size); - mGif->setFixedHeight(6*size); - mDesc->setFixedHeight(6*size); - }); -} - -void TipsWidget::load() { - const QDir tipsDir(":/tips"); - if(!tipsDir.exists()) return; - const QDir::Filters filter = QDir::NoDotAndDotDot | QDir::AllEntries; - const QFileInfoList entryList = tipsDir.entryInfoList(filter, QDir::Name); - std::map tips; - for(const QFileInfo& fileInfo : entryList) { - if(!fileInfo.isFile()) continue; - const QString name = fileInfo.completeBaseName(); - const QString path = fileInfo.filePath(); - const QString suffix = fileInfo.suffix(); - - auto& tip = tips[name]; - if(suffix == "txt") { - QFile file(path); - const bool succ = file.open(QIODevice::ReadOnly); - if(!succ) continue; - QTextStream stream(&file); - tip.fTitle = stream.readLine(); - while(!stream.atEnd()) { - if(!tip.fDesc.isEmpty()) tip.fDesc += "
"; - tip.fDesc += stream.readLine(); - } - file.close(); - } else if(suffix == "gif") { - tip.fGifPath = path; - } - } - - mTips.clear(); - for(const auto& tip : tips) { - mTips << tip.second; - } -} - -void TipsWidget::showPreviousTip() { - int tip = mCurrentTip - 1; - if(tip < 0) tip = mTips.count() - 1; - setTip(tip); -} - -void TipsWidget::showNextTip() { - int tip = mCurrentTip + 1; - if(tip >= mTips.count()) tip = 0; - setTip(tip); -} - -void TipsWidget::showRandomTip() { - if(mTips.isEmpty()) return; - setTip(qrand() % mTips.count()); -} - -void TipsWidget::showEvent(QShowEvent* const e) { - QWidget::showEvent(e); - showRandomTip(); -} - -void TipsWidget::setTip(const int id) { - if(id < 0 || id >= mTips.count()) return; - mCurrentTip = id; - setTip(mTips.at(id)); -} - -void TipsWidget::setTip(const Tip& tip) { - mNumber->setText(QString::number(mCurrentTip + 1) + "/" + - QString::number(mTips.count())); - mTitle->setText("

" + tip.fTitle + "

"); - mMovie.stop(); - mMovie.setFileName(tip.fGifPath); - mMovie.setScaledSize(mGif->size()); - mMovie.start(); - mDesc->setText(tip.fDesc); -} diff --git a/src/app/GUI/tipswidget.h b/src/app/GUI/tipswidget.h deleted file mode 100644 index ad43957ed..000000000 --- a/src/app/GUI/tipswidget.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#ifndef TIPSWIDGET_H -#define TIPSWIDGET_H - -#include -#include - -class TipsWidget : public QWidget { - Q_OBJECT -public: - explicit TipsWidget(QWidget* const parent); - - void load(); - - void showPreviousTip(); - void showNextTip(); - void showRandomTip(); -protected: - void showEvent(QShowEvent* const e) override; -private: - struct Tip { - QString fTitle; - QString fDesc; - QString fGifPath; - }; - - void setTip(const int id); - void setTip(const Tip& tip); - - int mCurrentTip = -1; - - QLabel* mNumber; - QLabel* mTitle; - QLabel* mGif; - QLabel* mDesc; - - QMovie mMovie; - QList mTips; -}; - -#endif // TIPSWIDGET_H diff --git a/src/app/GUI/toolbox.cpp b/src/app/GUI/toolbox.cpp new file mode 100644 index 000000000..7e88fc09e --- /dev/null +++ b/src/app/GUI/toolbox.cpp @@ -0,0 +1,512 @@ +/* +# +# Friction - https://friction.graphics +# +# Copyright (c) Friction contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# See 'README.md' for more information. +# +*/ + +#include "mainwindow.h" + +#include "appsupport.h" +#include "widgets/vlabel.h" + +void MainWindow::setupToolBox() +{ + mToolBoxButton = new ToolButton(this, true); + mToolBoxButton->setPopupMode(QToolButton::InstantPopup); + mToolBoxButton->setIcon(QIcon::fromTheme("friction")); + mToolBoxButton->setToolTip(QString()); + mToolBoxButton->setFocusPolicy(Qt::NoFocus); + mToolBoxButton->setObjectName(QString::fromUtf8("ToolButton")); + mToolBoxButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + + mToolBoxStack = new QStackedWidget(this); + mToolBoxStack->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); + + setupToolBoxMain(); + setupToolBoxNodes(); + setupToolBoxDraw(); + + eSizesUI::widget.add(mToolBoxMain, [this](const int size) { + mToolBoxButton->setIconSize(QSize(size, size)); + mToolBoxMain->setIconSize(QSize(size, size)); + mToolBoxNodes->setIconSize(QSize(size, size)); + mToolBoxDraw->setIconSize(QSize(size, size)); + }); + + mToolBoxMainIndex = mToolBoxStack->addWidget(mToolBoxMain); + mToolBoxNodesIndex = mToolBoxStack->addWidget(mToolBoxNodes); + mToolBoxDrawIndex = mToolBoxStack->addWidget(mToolBoxDraw); + mToolBoxStack->setCurrentIndex(mToolBoxMainIndex); + + mToolBoxButton->addActions(mToolBoxGroupMain->actions()); + for (const auto &toolAct : mToolBoxGroupMain->actions()) { + connect(toolAct, &QAction::triggered, + this, [this, toolAct](const auto &checked) { + if (checked) { mToolBoxButton->setDefaultAction(toolAct); } + }); + } + + // set default + mDocument.setCanvasMode(CanvasMode::boxTransform); +} + +void MainWindow::setupToolBoxMain() +{ + mToolBoxMain = new QToolBar(this); + mToolBoxMain->setOrientation(Qt::Vertical); + + mToolBoxGroupMain = new QActionGroup(this); + + // boxTransform + QAction *boxTransformAct = new QAction(QIcon::fromTheme("boxTransform"), + tr("Object"), + this); + boxTransformAct->setCheckable(true); + boxTransformAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "boxTransform", + "F1").toString())); + connect(boxTransformAct, + &QAction::triggered, + this, + [boxTransformAct, this]() { + if (boxTransformAct->isChecked()) { mActions.setMovePathMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, boxTransformAct]() { + if (mDocument.fCanvasMode == CanvasMode::boxTransform) { + boxTransformAct->setChecked(true); + } + }); + boxTransformAct->setChecked(true); // default + mToolBoxGroupMain->addAction(boxTransformAct); + + // pointTransform + QAction *pointTransformAct = new QAction(QIcon::fromTheme("pointTransform"), + tr("Point"), + this); + pointTransformAct->setCheckable(true); + pointTransformAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "pointTransform", + "F2").toString())); + connect(pointTransformAct, + &QAction::triggered, + this, + [pointTransformAct, this]() { + if (pointTransformAct->isChecked()) { mActions.setMovePointMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, pointTransformAct]() { + if (mDocument.fCanvasMode == CanvasMode::pointTransform) { + pointTransformAct->setChecked(true); + } + }); + mToolBoxGroupMain->addAction(pointTransformAct); + + // addPointMode + QAction *addPointModeAct = new QAction(QIcon::fromTheme("pathCreate"), + tr("Add Path"), + this); + addPointModeAct->setCheckable(true); + addPointModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "pathCreate", + "F3").toString())); + connect(addPointModeAct, + &QAction::triggered, + this, + [addPointModeAct, this]() { + if (addPointModeAct->isChecked()) { mActions.setAddPointMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, addPointModeAct]() { + if (mDocument.fCanvasMode == CanvasMode::pathCreate) { + addPointModeAct->setChecked(true); + } + }); + mToolBoxGroupMain->addAction(addPointModeAct); + + // drawPathMode + QAction *drawPathModeAct = new QAction(QIcon::fromTheme("drawPath"), + tr("Draw Path"), + this); + drawPathModeAct->setCheckable(true); + drawPathModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "drawPath", + "F4").toString())); + connect(drawPathModeAct, + &QAction::triggered, + this, + [drawPathModeAct, this]() { + if (drawPathModeAct->isChecked()) { mActions.setDrawPathMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, drawPathModeAct]() { + if (mDocument.fCanvasMode == CanvasMode::drawPath) { + drawPathModeAct->setChecked(true); + } + }); + mToolBoxGroupMain->addAction(drawPathModeAct); + + // paintMode + /*QAction *paintModeAct = new QAction(QIcon::fromTheme("paint"), + tr("Paint"), + this); + paintModeAct->setCheckable(true); + paintModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "paintMode", + "F5").toString())); + connect(paintModeAct, + &QAction::triggered, + this, + [paintModeAct, this]() { + if (paintModeAct->isChecked()) { mActions.setPaintMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, paintModeAct]() { + if (mDocument.fCanvasMode == CanvasMode::paint) { + paintModeAct->setChecked(true); + } + }); + mToolBoxGroupMain->addAction(paintModeAct);*/ + + // circleMode + QAction *circleModeAct = new QAction(QIcon::fromTheme("circleCreate"), + tr("Add Circle"), + this); + circleModeAct->setCheckable(true); + circleModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "circleMode", + "F5").toString())); + connect(circleModeAct, + &QAction::triggered, + this, + [circleModeAct, this]() { + if (circleModeAct->isChecked()) { mActions.setCircleMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, circleModeAct]() { + if (mDocument.fCanvasMode == CanvasMode::circleCreate) { + circleModeAct->setChecked(true); + } + }); + mToolBoxGroupMain->addAction(circleModeAct); + + // rectangleMode + QAction *rectModeAct = new QAction(QIcon::fromTheme("rectCreate"), + tr("Add Rectangle"), + this); + rectModeAct->setCheckable(true); + rectModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "rectMode", + "F6").toString())); + connect(rectModeAct, + &QAction::triggered, + this, + [rectModeAct, this]() { + if (rectModeAct->isChecked()) { mActions.setRectangleMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, rectModeAct]() { + if (mDocument.fCanvasMode == CanvasMode::rectCreate) { + rectModeAct->setChecked(true); + } + }); + mToolBoxGroupMain->addAction(rectModeAct); + + // textMode + QAction *textModeAct = new QAction(QIcon::fromTheme("textCreate"), + tr("Add Text"), + this); + textModeAct->setCheckable(true); + textModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "textMode", + "F7").toString())); + connect(textModeAct, + &QAction::triggered, + this, + [textModeAct, this]() { + if (textModeAct->isChecked()) { mActions.setTextMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, textModeAct]() { + if (mDocument.fCanvasMode == CanvasMode::textCreate) { + mTabColorText->setCurrentIndex(mTabTextIndex); + textModeAct->setChecked(true); + } + }); + mToolBoxGroupMain->addAction(textModeAct); + + // nullMode + QAction *nullModeAct = new QAction(QIcon::fromTheme("nullCreate"), + tr("Add Null Object"), + this); + nullModeAct->setCheckable(true); + nullModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "nullMode", + "F8").toString())); + connect(nullModeAct, + &QAction::triggered, + this, + [nullModeAct, this]() { + if (nullModeAct->isChecked()) { mActions.setNullMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, nullModeAct]() { + if (mDocument.fCanvasMode == CanvasMode::nullCreate) { + nullModeAct->setChecked(true); + } + }); + mToolBoxGroupMain->addAction(nullModeAct); + + // pickMode + QAction *pickModeAct = new QAction(QIcon::fromTheme("pick"), + tr("Pick"), + this); + pickModeAct->setCheckable(true); + pickModeAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "pickMode", + "F9").toString())); + connect(pickModeAct, + &QAction::triggered, + this, + [pickModeAct, this]() { + if (pickModeAct->isChecked()) { mActions.setPickPaintSettingsMode(); } + }); + connect(&mDocument, + &Document::canvasModeSet, + this, + [this, pickModeAct]() { + if (mDocument.fCanvasMode == CanvasMode::pickFillStroke) { + pickModeAct->setChecked(true); + } + }); + mToolBoxGroupMain->addAction(pickModeAct); + + mToolBoxMain->addActions(mToolBoxGroupMain->actions()); + + // pivot + mLocalPivotAct = new QAction(mDocument.fLocalPivot ? QIcon::fromTheme("pivotLocal") : QIcon::fromTheme("pivotGlobal"), + tr("Pivot Global / Local"), + this); + connect(mLocalPivotAct, &QAction::triggered, + this, [this]() { + mDocument.fLocalPivot = !mDocument.fLocalPivot; + for (const auto& scene : mDocument.fScenes) { scene->updatePivot(); } + Document::sInstance->actionFinished(); + mLocalPivotAct->setIcon(mDocument.fLocalPivot ? QIcon::fromTheme("pivotLocal") : QIcon::fromTheme("pivotGlobal")); + }); + + const auto spacer = new QWidget(this); + spacer->setSizePolicy(QSizePolicy::Minimum, + QSizePolicy::Expanding); + mToolBoxMain->addWidget(spacer); + mToolBoxMain->addAction(mLocalPivotAct); +} + +void MainWindow::setupToolBoxNodes() +{ + mToolBoxNodes = new QToolBar(this); + mToolBoxNodes->setObjectName(QString::fromUtf8("ViewerNodeBar")); + mToolBoxNodes->setOrientation(Qt::Vertical); + + mToolBoxGroupNodes = new QActionGroup(this); + + // nodeConnect + mActionConnectPointsAct = new QAction(QIcon::fromTheme("nodeConnect"), + tr("Connect Nodes"), + this); + connect(mActionConnectPointsAct, &QAction::triggered, + this, [this]() { mActions.connectPointsSlot(); }); + mToolBoxGroupNodes->addAction(mActionConnectPointsAct); + + // nodeDisconnect + mActionDisconnectPointsAct = new QAction(QIcon::fromTheme("nodeDisconnect"), + tr("Disconnect Nodes"), + this); + connect(mActionDisconnectPointsAct, &QAction::triggered, + this, [this]() { mActions.disconnectPointsSlot(); }); + mToolBoxGroupNodes->addAction(mActionDisconnectPointsAct); + + // nodeMerge + mActionMergePointsAct = new QAction(QIcon::fromTheme("nodeMerge"), + tr("Merge Nodes"), + this); + connect(mActionMergePointsAct, &QAction::triggered, + this, [this]() { mActions.mergePointsSlot(); }); + mToolBoxGroupNodes->addAction(mActionMergePointsAct); + + // nodeNew + mActionNewNodeAct = new QAction(QIcon::fromTheme("nodeNew"), + tr("New Node"), + this); + connect(mActionNewNodeAct, &QAction::triggered, + this, [this]() { mActions.subdivideSegments(); }); + mToolBoxGroupNodes->addAction(mActionNewNodeAct); + + // nodeSymmetric + mActionSymmetricPointCtrlsAct = new QAction(QIcon::fromTheme("nodeSymmetric"), + tr("Symmetric Nodes"), + this); + connect(mActionSymmetricPointCtrlsAct, &QAction::triggered, + this, [this]() { mActions.makePointCtrlsSymmetric(); }); + mToolBoxGroupNodes->addAction(mActionSymmetricPointCtrlsAct); + + // nodeSmooth + mActionSmoothPointCtrlsAct = new QAction(QIcon::fromTheme("nodeSmooth"), + tr("Smooth Nodes"), + this); + connect(mActionSmoothPointCtrlsAct, &QAction::triggered, + this, [this]() { mActions.makePointCtrlsSmooth(); }); + mToolBoxGroupNodes->addAction(mActionSmoothPointCtrlsAct); + + // nodeCorner + mActionCornerPointCtrlsAct = new QAction(QIcon::fromTheme("nodeCorner"), + tr("Corner Nodes"), + this); + connect(mActionCornerPointCtrlsAct, &QAction::triggered, + this, [this]() { mActions.makePointCtrlsCorner(); }); + mToolBoxGroupNodes->addAction(mActionCornerPointCtrlsAct); + + // segmentLine + mActionLineAct = new QAction(QIcon::fromTheme("segmentLine"), + tr("Make Segment Line"), + this); + connect(mActionLineAct, &QAction::triggered, + this, [this]() { mActions.makeSegmentLine(); }); + mToolBoxGroupNodes->addAction(mActionLineAct); + + // segmentCurve + mActionCurveAct = new QAction(QIcon::fromTheme("segmentCurve"), + tr("Make Segment Curve"), + this); + connect(mActionCurveAct, &QAction::triggered, + this, [this]() { mActions.makeSegmentCurve(); }); + mToolBoxGroupNodes->addAction(mActionCurveAct); + + mToolBoxNodes->addActions(mToolBoxGroupNodes->actions()); + + // nodeVisibility + mNodeVisibility = new QToolButton(this); + mNodeVisibility->setObjectName(QString::fromUtf8("ToolButton")); + mNodeVisibility->setPopupMode(QToolButton::InstantPopup); + QAction *nodeVisibilityAction1 = new QAction(QIcon::fromTheme("dissolvedAndNormalNodes"), + tr("Dissolved and normal nodes"), + this); + nodeVisibilityAction1->setData(0); + QAction *nodeVisibilityAction2 = new QAction(QIcon::fromTheme("dissolvedNodesOnly"), + tr("Dissolved nodes only"), + this); + nodeVisibilityAction2->setData(1); + QAction *nodeVisibilityAction3 = new QAction(QIcon::fromTheme("normalNodesOnly"), + tr("Normal nodes only"), + this); + nodeVisibilityAction3->setData(2); + mNodeVisibility->addAction(nodeVisibilityAction1); + mNodeVisibility->addAction(nodeVisibilityAction2); + mNodeVisibility->addAction(nodeVisibilityAction3); + mNodeVisibility->setDefaultAction(nodeVisibilityAction1); + connect(mNodeVisibility, &QToolButton::triggered, + this, [this](QAction *act) { + qDebug() << "set node visibility" << act->data().toInt(); + mNodeVisibility->setDefaultAction(act); + mDocument.fNodeVisibility = static_cast(act->data().toInt()); + Document::sInstance->actionFinished(); + }); + + QWidget *spacer = new QWidget(this); + spacer->setSizePolicy(QSizePolicy::Minimum, + QSizePolicy::Expanding); + mToolBoxNodes->addWidget(spacer); + mToolBoxNodes->addWidget(mNodeVisibility); +} + +void MainWindow::setupToolBoxDraw() +{ + mDocument.fDrawPathManual = false; + mDrawPathAuto = new QAction(mDocument.fDrawPathManual ? QIcon::fromTheme("drawPathAutoUnchecked") : QIcon::fromTheme("drawPathAutoChecked"), + tr("Automatic/Manual Fitting"), + this); + connect(mDrawPathAuto, &QAction::triggered, + this, [this]() { + mDocument.fDrawPathManual = !mDocument.fDrawPathManual; + qDebug() << "manual fitting?" << mDocument.fDrawPathManual; + mDrawPathMaxError->setDisabled(mDocument.fDrawPathManual); + mDrawPathAuto->setIcon(mDocument.fDrawPathManual ? QIcon::fromTheme("drawPathAutoUnchecked") : QIcon::fromTheme("drawPathAutoChecked")); + }); + + mDrawPathMaxError = new QDoubleSlider(1, 200, 1, this, false); + mDrawPathMaxError->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + mDrawPathMaxError->setNumberDecimals(0); + mDrawPathMaxError->setMinimumHeight(25); + mDrawPathMaxError->setDisplayedValue(mDocument.fDrawPathMaxError); + connect(mDrawPathMaxError, &QDoubleSlider::valueEdited, + this, [this](const qreal value) { + mDocument.fDrawPathMaxError = qFloor(value); + }); + + mDrawPathSmooth = new QDoubleSlider(1, 200, 1, this, false); + mDrawPathSmooth->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + mDrawPathSmooth->setMinimumHeight(25); + mDrawPathSmooth->setNumberDecimals(0); + mDrawPathSmooth->setDisplayedValue(mDocument.fDrawPathSmooth); + connect(mDrawPathSmooth, &QDoubleSlider::valueEdited, + this, [this](const qreal value) { + mDocument.fDrawPathSmooth = qFloor(value); + }); + + const auto label1 = new VLabel(QString("%1 :").arg(tr("Max Error")), this); + const auto label2 = new VLabel(QString("%1 :").arg(tr("Smooth")), this); + + const auto spacer = new QWidget(this); + spacer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); + + mToolBoxDraw = new QToolBar(this); + mToolBoxDraw->setObjectName(QString::fromUtf8("ViewerNodeBar")); + mToolBoxDraw->setOrientation(Qt::Vertical); + + mToolBoxDraw->addSeparator(); + mToolBoxDraw->addWidget(label1); + mToolBoxDraw->addSeparator(); + mToolBoxDraw->addWidget(mDrawPathMaxError); + mToolBoxDraw->addSeparator(); + mToolBoxDraw->addWidget(label2); + mToolBoxDraw->addSeparator(); + mToolBoxDraw->addWidget(mDrawPathSmooth); + mToolBoxDraw->addWidget(spacer); + mToolBoxDraw->addAction(mDrawPathAuto); +} + diff --git a/src/app/GUI/triggerlabel.cpp b/src/app/GUI/triggerlabel.cpp deleted file mode 100755 index 66821f95a..000000000 --- a/src/app/GUI/triggerlabel.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "triggerlabel.h" -#include - -void TriggerLabel::mousePressEvent(QMouseEvent *ev) { - if(ev->button() == Qt::LeftButton) - emit triggered(); - else if(ev->button() == Qt::RightButton) - emit requestContextMenu(ev->globalPos()); -} diff --git a/src/app/GUI/triggerlabel.h b/src/app/GUI/triggerlabel.h deleted file mode 100755 index d210c2928..000000000 --- a/src/app/GUI/triggerlabel.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef TRIGGERLABEL_H -#define TRIGGERLABEL_H -#include - -class TriggerLabel : public QLabel { - Q_OBJECT -public: - using QLabel::QLabel; -protected: - void mousePressEvent(QMouseEvent *ev); -signals: - void triggered(); - void requestContextMenu(QPoint); -private: -}; - -#endif // TRIGGERLABEL_H diff --git a/src/app/GUI/welcomedialog.cpp b/src/app/GUI/welcomedialog.cpp old mode 100755 new mode 100644 index 94b1a220d..a303e53dd --- a/src/app/GUI/welcomedialog.cpp +++ b/src/app/GUI/welcomedialog.cpp @@ -30,6 +30,7 @@ #include #include +#include "widgets/toolbutton.h" #include "appsupport.h" WelcomeDialog::WelcomeDialog(QMenu *recentMenu, @@ -57,7 +58,7 @@ WelcomeDialog::WelcomeDialog(QMenu *recentMenu, "

" "

%3
%1

" "") - .arg(AppSupport::getAppVersion(false), + .arg(AppSupport::getAppVersion(), QString::number(logoSize), AppSupport::getAppDisplayName(), AppSupport::getAppName())); @@ -80,11 +81,13 @@ WelcomeDialog::WelcomeDialog(QMenu *recentMenu, QSizePolicy::Expanding); connect(openButton, &QPushButton::released, openFunc); - const auto recentButton = new QPushButton(tr("Open Recent"), this); + const auto recentButton = new ToolButton(this, true); + const auto recentDefaultAct = new QAction(tr("Open Recent"), this); + recentButton->setDefaultAction(recentDefaultAct); recentButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); recentButton->setContentsMargins(0, 0, 0, 0); - recentButton->setObjectName("WelcomeRecentButton"); + recentButton->setObjectName("FlatButton"); recentButton->setMenu(recentMenu); thisLay->addWidget(mainWid, 0, Qt::AlignHCenter | Qt::AlignVCenter); diff --git a/src/app/GUI/welcomedialog.h b/src/app/GUI/welcomedialog.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/widgetstack.cpp b/src/app/GUI/widgetstack.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/widgetstack.h b/src/app/GUI/widgetstack.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/widgetwrappernode.cpp b/src/app/GUI/widgetwrappernode.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/widgetwrappernode.h b/src/app/GUI/widgetwrappernode.h old mode 100755 new mode 100644 index 413a4db45..d087232b2 --- a/src/app/GUI/widgetwrappernode.h +++ b/src/app/GUI/widgetwrappernode.h @@ -29,7 +29,7 @@ #include #include "Private/esettings.h" #include "wrappernode.h" -#include "fakemenubar.h" +#include "widgets/fakemenubar.h" class StackWrapperMenu : public FakeMenuBar { friend class StackWidgetWrapper; diff --git a/src/app/GUI/wrappernode.cpp b/src/app/GUI/wrappernode.cpp old mode 100755 new mode 100644 diff --git a/src/app/GUI/wrappernode.h b/src/app/GUI/wrappernode.h old mode 100755 new mode 100644 diff --git a/src/app/app.desktop.in b/src/app/app.desktop.in old mode 100755 new mode 100644 diff --git a/src/app/boxtypemenu.h b/src/app/boxtypemenu.h deleted file mode 100755 index 1a917b2b5..000000000 --- a/src/app/boxtypemenu.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#ifndef POINTTYPEMENU_H -#define POINTTYPEMENU_H -#include "typemenu.h" - -#endif // POINTTYPEMENU_H diff --git a/src/app/effectsloader.cpp b/src/app/effectsloader.cpp old mode 100755 new mode 100644 diff --git a/src/app/effectsloader.h b/src/app/effectsloader.h old mode 100755 new mode 100644 diff --git a/src/app/eimporters.cpp b/src/app/eimporters.cpp old mode 100755 new mode 100644 diff --git a/src/app/eimporters.h b/src/app/eimporters.h old mode 100755 new mode 100644 diff --git a/src/app/evfileio.cpp b/src/app/evfileio.cpp old mode 100755 new mode 100644 diff --git a/src/app/fonts.qrc b/src/app/fonts.qrc deleted file mode 100755 index 325001f75..000000000 --- a/src/app/fonts.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - fonts/LICENSE.txt - fonts/Roboto-Medium.ttf - - diff --git a/src/app/fonts/LICENSE.txt b/src/app/fonts/LICENSE.txt deleted file mode 100644 index 75b52484e..000000000 --- a/src/app/fonts/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/app/fonts/Roboto-Medium.ttf b/src/app/fonts/Roboto-Medium.ttf deleted file mode 100644 index ac0f908b9..000000000 Binary files a/src/app/fonts/Roboto-Medium.ttf and /dev/null differ diff --git a/src/app/friction.qss b/src/app/friction.qss index bd29e7eed..630678041 100644 --- a/src/app/friction.qss +++ b/src/app/friction.qss @@ -42,6 +42,10 @@ QToolBar#ViewerDrawBar, background-color: rgb(33, 33, 38); } +QToolBar::separator { + border-color: none; +} + QComboBox#blendModeCombo, QWidget#menuBarWidget QPushButton, QLineEdit#SearchLine, diff --git a/src/app/iconloader.cpp b/src/app/iconloader.cpp old mode 100755 new mode 100644 diff --git a/src/app/iconloader.h b/src/app/iconloader.h old mode 100755 new mode 100644 diff --git a/src/app/icons/hicolor/128x128/actions/split_h.png b/src/app/icons/hicolor/128x128/actions/split_h.png index d64690a67..f816cd734 100644 Binary files a/src/app/icons/hicolor/128x128/actions/split_h.png and b/src/app/icons/hicolor/128x128/actions/split_h.png differ diff --git a/src/app/icons/hicolor/128x128/actions/split_v.png b/src/app/icons/hicolor/128x128/actions/split_v.png index ce1c8c005..10cfe4345 100644 Binary files a/src/app/icons/hicolor/128x128/actions/split_v.png and b/src/app/icons/hicolor/128x128/actions/split_v.png differ diff --git a/src/app/icons/hicolor/16x16/actions/split_h.png b/src/app/icons/hicolor/16x16/actions/split_h.png index 3362a7abc..ff9d9396a 100644 Binary files a/src/app/icons/hicolor/16x16/actions/split_h.png and b/src/app/icons/hicolor/16x16/actions/split_h.png differ diff --git a/src/app/icons/hicolor/16x16/actions/split_v.png b/src/app/icons/hicolor/16x16/actions/split_v.png index c3d789c75..ded9c5f83 100644 Binary files a/src/app/icons/hicolor/16x16/actions/split_v.png and b/src/app/icons/hicolor/16x16/actions/split_v.png differ diff --git a/src/app/icons/hicolor/192x192/actions/split_h.png b/src/app/icons/hicolor/192x192/actions/split_h.png index 628e13c03..1a85831d5 100644 Binary files a/src/app/icons/hicolor/192x192/actions/split_h.png and b/src/app/icons/hicolor/192x192/actions/split_h.png differ diff --git a/src/app/icons/hicolor/192x192/actions/split_v.png b/src/app/icons/hicolor/192x192/actions/split_v.png index e8c782b8d..1b92c2e46 100644 Binary files a/src/app/icons/hicolor/192x192/actions/split_v.png and b/src/app/icons/hicolor/192x192/actions/split_v.png differ diff --git a/src/app/icons/hicolor/22x22/actions/split_h.png b/src/app/icons/hicolor/22x22/actions/split_h.png index da5ade8f5..c214ab6f7 100644 Binary files a/src/app/icons/hicolor/22x22/actions/split_h.png and b/src/app/icons/hicolor/22x22/actions/split_h.png differ diff --git a/src/app/icons/hicolor/22x22/actions/split_v.png b/src/app/icons/hicolor/22x22/actions/split_v.png index bc7f6bb77..0af68d98f 100644 Binary files a/src/app/icons/hicolor/22x22/actions/split_v.png and b/src/app/icons/hicolor/22x22/actions/split_v.png differ diff --git a/src/app/icons/hicolor/256x256/actions/split_h.png b/src/app/icons/hicolor/256x256/actions/split_h.png index cbdf72e49..ada04b9f8 100644 Binary files a/src/app/icons/hicolor/256x256/actions/split_h.png and b/src/app/icons/hicolor/256x256/actions/split_h.png differ diff --git a/src/app/icons/hicolor/256x256/actions/split_v.png b/src/app/icons/hicolor/256x256/actions/split_v.png index f7d172342..c136eadda 100644 Binary files a/src/app/icons/hicolor/256x256/actions/split_v.png and b/src/app/icons/hicolor/256x256/actions/split_v.png differ diff --git a/src/app/icons/hicolor/32x32/actions/split_h.png b/src/app/icons/hicolor/32x32/actions/split_h.png index d53afae63..8d0ea0019 100644 Binary files a/src/app/icons/hicolor/32x32/actions/split_h.png and b/src/app/icons/hicolor/32x32/actions/split_h.png differ diff --git a/src/app/icons/hicolor/32x32/actions/split_v.png b/src/app/icons/hicolor/32x32/actions/split_v.png index b9743a93c..0fea13f81 100644 Binary files a/src/app/icons/hicolor/32x32/actions/split_v.png and b/src/app/icons/hicolor/32x32/actions/split_v.png differ diff --git a/src/app/icons/hicolor/48x48/actions/split_h.png b/src/app/icons/hicolor/48x48/actions/split_h.png index 6b2da6c62..b26280173 100644 Binary files a/src/app/icons/hicolor/48x48/actions/split_h.png and b/src/app/icons/hicolor/48x48/actions/split_h.png differ diff --git a/src/app/icons/hicolor/48x48/actions/split_v.png b/src/app/icons/hicolor/48x48/actions/split_v.png index da18ab4dc..217871a02 100644 Binary files a/src/app/icons/hicolor/48x48/actions/split_v.png and b/src/app/icons/hicolor/48x48/actions/split_v.png differ diff --git a/src/app/icons/hicolor/64x64/actions/split_h.png b/src/app/icons/hicolor/64x64/actions/split_h.png index 804954c14..fbea43f0d 100644 Binary files a/src/app/icons/hicolor/64x64/actions/split_h.png and b/src/app/icons/hicolor/64x64/actions/split_h.png differ diff --git a/src/app/icons/hicolor/64x64/actions/split_v.png b/src/app/icons/hicolor/64x64/actions/split_v.png index 84a3c4286..369d5997d 100644 Binary files a/src/app/icons/hicolor/64x64/actions/split_v.png and b/src/app/icons/hicolor/64x64/actions/split_v.png differ diff --git a/src/app/icons/hicolor/96x96/actions/split_h.png b/src/app/icons/hicolor/96x96/actions/split_h.png index 28cd815b2..9a71777c4 100644 Binary files a/src/app/icons/hicolor/96x96/actions/split_h.png and b/src/app/icons/hicolor/96x96/actions/split_h.png differ diff --git a/src/app/icons/hicolor/96x96/actions/split_v.png b/src/app/icons/hicolor/96x96/actions/split_v.png index 000e2cf3d..aed9f8a4a 100644 Binary files a/src/app/icons/hicolor/96x96/actions/split_v.png and b/src/app/icons/hicolor/96x96/actions/split_v.png differ diff --git a/src/app/icons/hicolor/scalable/actions/split_h.svg b/src/app/icons/hicolor/scalable/actions/split_h.svg index a2c7ac333..6695880d6 100644 --- a/src/app/icons/hicolor/scalable/actions/split_h.svg +++ b/src/app/icons/hicolor/scalable/actions/split_h.svg @@ -23,17 +23,24 @@ borderopacity="1.0" inkscape:pageshadow="2" inkscape:pageopacity="0.0" - inkscape:pagecheckerboard="0" + inkscape:pagecheckerboard="true" showgrid="false" inkscape:zoom="68.943101" - inkscape:cx="4.7357893" - inkscape:cy="6.1427466" + inkscape:cx="4.7720511" + inkscape:cy="4.6777704" inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-height="1026" inkscape:window-x="0" - inkscape:window-y="27" + inkscape:window-y="0" inkscape:window-maximized="1" - inkscape:current-layer="svg1500" /> + inkscape:current-layer="svg1500" + showguides="true" + inkscape:guide-bbox="true"> + + + id="path2568" + style="fill:#ffffff;fill-opacity:1;stroke-width:0.0386154" + d="M 2.1559003,0.756543 C 2.1502553,0.57976852 2.0567892,0.4898926 1.8752973,0.4898926 H 0.77045516 c -0.1873463,0 -0.280603,0.0959703 -0.280603,0.28422037 V 1.0805542 H 2.1559003 V 0.77411297 c 0,-0.005883 1.821e-4,-0.0118676 0,-0.01757 z m 0,0.8087361 H 0.48985216 v 0.3074748 c 0,0.1891538 0.094164,0.2831869 0.280603,0.2831869 H 1.8752973 c 0.186439,0 0.280603,-0.094033 0.280603,-0.2831869 z" /> diff --git a/src/app/icons/hicolor/scalable/actions/split_v.svg b/src/app/icons/hicolor/scalable/actions/split_v.svg index 8eea3661b..7c61ed0de 100644 --- a/src/app/icons/hicolor/scalable/actions/split_v.svg +++ b/src/app/icons/hicolor/scalable/actions/split_v.svg @@ -23,17 +23,24 @@ borderopacity="1.0" inkscape:pageshadow="2" inkscape:pageopacity="0.0" - inkscape:pagecheckerboard="0" + inkscape:pagecheckerboard="true" showgrid="false" - inkscape:zoom="68.943101" - inkscape:cx="4.7357893" - inkscape:cy="6.1427466" + inkscape:zoom="49.36484" + inkscape:cx="3.7476066" + inkscape:cy="4.3451979" inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-height="1026" inkscape:window-x="0" - inkscape:window-y="27" + inkscape:window-y="0" inkscape:window-maximized="1" - inkscape:current-layer="svg1500" /> + inkscape:current-layer="svg1500" + showguides="true" + inkscape:guide-bbox="true"> + + diff --git a/src/app/main.cpp b/src/app/main.cpp old mode 100755 new mode 100644 index d838290cf..4153f0589 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -28,10 +28,6 @@ #include //#include -#ifdef FRICTION_BUNDLE_ROBOTO -#include -#endif - #include "hardwareinfo.h" #include "Private/esettings.h" #include "GUI/ewidgetsimpl.h" @@ -116,11 +112,6 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); setlocale(LC_NUMERIC, "C"); -#ifdef FRICTION_BUNDLE_ROBOTO - int fid = QFontDatabase::addApplicationFont(":/fonts/Roboto-Medium.ttf"); - QApplication::setFont(QFontDatabase::applicationFontFamilies(fid).at(0)); -#endif - #ifdef Q_OS_WIN // we ship a custom build of Qt 5.12.12 (with this feature backported) on Windows, so ignore this check // #if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) diff --git a/src/app/memorychecker.cpp b/src/app/memorychecker.cpp old mode 100755 new mode 100644 diff --git a/src/app/memorychecker.h b/src/app/memorychecker.h old mode 100755 new mode 100644 diff --git a/src/app/memoryhandler.cpp b/src/app/memoryhandler.cpp old mode 100755 new mode 100644 diff --git a/src/app/memoryhandler.h b/src/app/memoryhandler.h old mode 100755 new mode 100644 diff --git a/src/app/renderhandler.cpp b/src/app/renderhandler.cpp old mode 100755 new mode 100644 diff --git a/src/app/renderhandler.h b/src/app/renderhandler.h old mode 100755 new mode 100644 index 30fdc810c..488868c6c --- a/src/app/renderhandler.h +++ b/src/app/renderhandler.h @@ -26,7 +26,7 @@ #ifndef RENDERHANDLER_H #define RENDERHANDLER_H #include "framerange.h" -#include "GUI/audiohandler.h" +#include "Sound/audiohandler.h" #include "smartPointers/ememory.h" #include "CacheHandlers/usepointer.h" #include "CacheHandlers/cachecontainer.h" diff --git a/src/app/resources.qrc b/src/app/resources.qrc old mode 100755 new mode 100644 diff --git a/src/cmake/friction-common.cmake b/src/cmake/friction-common.cmake index 09c90aab3..20b8ed5c1 100644 --- a/src/cmake/friction-common.cmake +++ b/src/cmake/friction-common.cmake @@ -106,5 +106,8 @@ else() skia fontconfig ${OPENGL_LIBRARY}) + pkg_check_modules(UNWIND REQUIRED libunwind) + set(GPERF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/../gperftools ${UNWIND_INCLUDE_DIRS}) + set(GPERF_LIBRARIES tcmalloc_static ${UNWIND_LIBRARIES}) endif() endif() diff --git a/src/core/Animators/SmartPath/listofnodes.cpp b/src/core/Animators/SmartPath/listofnodes.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/listofnodes.h b/src/core/Animators/SmartPath/listofnodes.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/node.cpp b/src/core/Animators/SmartPath/node.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/node.h b/src/core/Animators/SmartPath/node.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/nodelist.cpp b/src/core/Animators/SmartPath/nodelist.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/nodelist.h b/src/core/Animators/SmartPath/nodelist.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/smartpath.cpp b/src/core/Animators/SmartPath/smartpath.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/smartpath.h b/src/core/Animators/SmartPath/smartpath.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/smartpathanimator.cpp b/src/core/Animators/SmartPath/smartpathanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/smartpathanimator.h b/src/core/Animators/SmartPath/smartpathanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/smartpathanimatoractions.cpp b/src/core/Animators/SmartPath/smartpathanimatoractions.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/smartpathcollection.cpp b/src/core/Animators/SmartPath/smartpathcollection.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/SmartPath/smartpathcollection.h b/src/core/Animators/SmartPath/smartpathcollection.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/animator.cpp b/src/core/Animators/animator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/animator.h b/src/core/Animators/animator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/animatort.cpp b/src/core/Animators/animatort.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/animatort.h b/src/core/Animators/animatort.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/basedanimatort.cpp b/src/core/Animators/basedanimatort.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/basedanimatort.h b/src/core/Animators/basedanimatort.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/basedkeyt.cpp b/src/core/Animators/basedkeyt.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/basedkeyt.h b/src/core/Animators/basedkeyt.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/boolanimator.cpp b/src/core/Animators/boolanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/boolanimator.h b/src/core/Animators/boolanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/brushsettingsanimator.cpp b/src/core/Animators/brushsettingsanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/brushsettingsanimator.h b/src/core/Animators/brushsettingsanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/clampedpoint.cpp b/src/core/Animators/clampedpoint.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/clampedpoint.h b/src/core/Animators/clampedpoint.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/clampedvalue.cpp b/src/core/Animators/clampedvalue.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/clampedvalue.h b/src/core/Animators/clampedvalue.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/coloranimator.cpp b/src/core/Animators/coloranimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/coloranimator.h b/src/core/Animators/coloranimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/complexanimator.cpp b/src/core/Animators/complexanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/complexanimator.h b/src/core/Animators/complexanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/complexkey.cpp b/src/core/Animators/complexkey.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/complexkey.h b/src/core/Animators/complexkey.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/customproperties.cpp b/src/core/Animators/customproperties.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/customproperties.h b/src/core/Animators/customproperties.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/dynamiccomplexanimator.h b/src/core/Animators/dynamiccomplexanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/eboxorsound.cpp b/src/core/Animators/eboxorsound.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/eboxorsound.h b/src/core/Animators/eboxorsound.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/eeffect.cpp b/src/core/Animators/eeffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/eeffect.h b/src/core/Animators/eeffect.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/gradient.cpp b/src/core/Animators/gradient.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/gradient.h b/src/core/Animators/gradient.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/gradientpoints.cpp b/src/core/Animators/gradientpoints.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/gradientpoints.h b/src/core/Animators/gradientpoints.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/graphanimator.cpp b/src/core/Animators/graphanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/graphanimator.h b/src/core/Animators/graphanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/graphanimatort.cpp b/src/core/Animators/graphanimatort.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/graphanimatort.h b/src/core/Animators/graphanimatort.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/graphkey.cpp b/src/core/Animators/graphkey.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/graphkey.h b/src/core/Animators/graphkey.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/graphkeyt.cpp b/src/core/Animators/graphkeyt.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/graphkeyt.h b/src/core/Animators/graphkeyt.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/intanimator.cpp b/src/core/Animators/intanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/intanimator.h b/src/core/Animators/intanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/interoptimalanimatort.h b/src/core/Animators/interoptimalanimatort.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/interpolationanimator.cpp b/src/core/Animators/interpolationanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/interpolationanimator.h b/src/core/Animators/interpolationanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/interpolationanimatort.cpp b/src/core/Animators/interpolationanimatort.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/interpolationanimatort.h b/src/core/Animators/interpolationanimatort.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/interpolationkey.cpp b/src/core/Animators/interpolationkey.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/interpolationkey.h b/src/core/Animators/interpolationkey.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/interpolationkeyt.cpp b/src/core/Animators/interpolationkeyt.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/interpolationkeyt.h b/src/core/Animators/interpolationkeyt.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/key.cpp b/src/core/Animators/key.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/key.h b/src/core/Animators/key.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/keyt.cpp b/src/core/Animators/keyt.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/keyt.h b/src/core/Animators/keyt.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/outlinesettingsanimator.cpp b/src/core/Animators/outlinesettingsanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/outlinesettingsanimator.h b/src/core/Animators/outlinesettingsanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/overlappingkeylist.cpp b/src/core/Animators/overlappingkeylist.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/overlappingkeylist.h b/src/core/Animators/overlappingkeylist.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/overlappingkeys.cpp b/src/core/Animators/overlappingkeys.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/overlappingkeys.h b/src/core/Animators/overlappingkeys.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/paintsettingsanimator.cpp b/src/core/Animators/paintsettingsanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/paintsettingsanimator.h b/src/core/Animators/paintsettingsanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/qcubicsegment1danimator.cpp b/src/core/Animators/qcubicsegment1danimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/qcubicsegment1danimator.h b/src/core/Animators/qcubicsegment1danimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/qpointfanimator.cpp b/src/core/Animators/qpointfanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/qpointfanimator.h b/src/core/Animators/qpointfanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealanimator.cpp b/src/core/Animators/qrealanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealanimator.h b/src/core/Animators/qrealanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealkey.cpp b/src/core/Animators/qrealkey.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealkey.h b/src/core/Animators/qrealkey.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealpoint.cpp b/src/core/Animators/qrealpoint.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealpoint.h b/src/core/Animators/qrealpoint.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealsnapshot.cpp b/src/core/Animators/qrealsnapshot.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealsnapshot.h b/src/core/Animators/qrealsnapshot.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealvalueeffect.cpp b/src/core/Animators/qrealvalueeffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/qrealvalueeffect.h b/src/core/Animators/qrealvalueeffect.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/qstringanimator.cpp b/src/core/Animators/qstringanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/qstringanimator.h b/src/core/Animators/qstringanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/sceneboundgradient.cpp b/src/core/Animators/sceneboundgradient.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/sceneboundgradient.h b/src/core/Animators/sceneboundgradient.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/staticcomplexanimator.cpp b/src/core/Animators/staticcomplexanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/staticcomplexanimator.h b/src/core/Animators/staticcomplexanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/steppedanimator.cpp b/src/core/Animators/steppedanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/steppedanimator.h b/src/core/Animators/steppedanimator.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/texteffectcollection.cpp b/src/core/Animators/texteffectcollection.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/texteffectcollection.h b/src/core/Animators/texteffectcollection.h old mode 100755 new mode 100644 diff --git a/src/core/Animators/transformanimator.cpp b/src/core/Animators/transformanimator.cpp old mode 100755 new mode 100644 diff --git a/src/core/Animators/transformanimator.h b/src/core/Animators/transformanimator.h old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/blendeffect.cpp b/src/core/BlendEffects/blendeffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/blendeffect.h b/src/core/BlendEffects/blendeffect.h old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/blendeffectboxshadow.cpp b/src/core/BlendEffects/blendeffectboxshadow.cpp old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/blendeffectboxshadow.h b/src/core/BlendEffects/blendeffectboxshadow.h old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/blendeffectcollection.cpp b/src/core/BlendEffects/blendeffectcollection.cpp old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/blendeffectcollection.h b/src/core/BlendEffects/blendeffectcollection.h old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/moveblendeffect.cpp b/src/core/BlendEffects/moveblendeffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/moveblendeffect.h b/src/core/BlendEffects/moveblendeffect.h old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/targetedblendeffect.cpp b/src/core/BlendEffects/targetedblendeffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/BlendEffects/targetedblendeffect.h b/src/core/BlendEffects/targetedblendeffect.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/animationbox.cpp b/src/core/Boxes/animationbox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/animationbox.h b/src/core/Boxes/animationbox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/boundingbox.cpp b/src/core/Boxes/boundingbox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/boundingbox.h b/src/core/Boxes/boundingbox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/boxrendercontainer.cpp b/src/core/Boxes/boxrendercontainer.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/boxrendercontainer.h b/src/core/Boxes/boxrendercontainer.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/boxrenderdata.cpp b/src/core/Boxes/boxrenderdata.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/boxrenderdata.h b/src/core/Boxes/boxrenderdata.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/boxwithpatheffects.cpp b/src/core/Boxes/boxwithpatheffects.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/boxwithpatheffects.h b/src/core/Boxes/boxwithpatheffects.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/canvasrenderdata.cpp b/src/core/Boxes/canvasrenderdata.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/canvasrenderdata.h b/src/core/Boxes/canvasrenderdata.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/circle.cpp b/src/core/Boxes/circle.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/circle.h b/src/core/Boxes/circle.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/containerbox.cpp b/src/core/Boxes/containerbox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/containerbox.h b/src/core/Boxes/containerbox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/customboxcreator.h b/src/core/Boxes/customboxcreator.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/ecustombox.cpp b/src/core/Boxes/ecustombox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/ecustombox.h b/src/core/Boxes/ecustombox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/effectsrenderer.cpp b/src/core/Boxes/effectsrenderer.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/effectsrenderer.h b/src/core/Boxes/effectsrenderer.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/effectsubtaskspawner.cpp b/src/core/Boxes/effectsubtaskspawner.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/effectsubtaskspawner.h b/src/core/Boxes/effectsubtaskspawner.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/externallinkboxt.h b/src/core/Boxes/externallinkboxt.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/frameremapping.cpp b/src/core/Boxes/frameremapping.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/frameremapping.h b/src/core/Boxes/frameremapping.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/imagebox.cpp b/src/core/Boxes/imagebox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/imagebox.h b/src/core/Boxes/imagebox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/imagerenderdata.cpp b/src/core/Boxes/imagerenderdata.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/imagerenderdata.h b/src/core/Boxes/imagerenderdata.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/imagesequencebox.cpp b/src/core/Boxes/imagesequencebox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/imagesequencebox.h b/src/core/Boxes/imagesequencebox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/internallinkbox.cpp b/src/core/Boxes/internallinkbox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/internallinkbox.h b/src/core/Boxes/internallinkbox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/internallinkboxbase.h b/src/core/Boxes/internallinkboxbase.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/internallinkcanvas.cpp b/src/core/Boxes/internallinkcanvas.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/internallinkcanvas.h b/src/core/Boxes/internallinkcanvas.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/internallinkgroupbox.cpp b/src/core/Boxes/internallinkgroupbox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/internallinkgroupbox.h b/src/core/Boxes/internallinkgroupbox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/layerboxrenderdata.cpp b/src/core/Boxes/layerboxrenderdata.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/layerboxrenderdata.h b/src/core/Boxes/layerboxrenderdata.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/linkcanvasrenderdata.cpp b/src/core/Boxes/linkcanvasrenderdata.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/linkcanvasrenderdata.h b/src/core/Boxes/linkcanvasrenderdata.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/pathbox.cpp b/src/core/Boxes/pathbox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/pathbox.h b/src/core/Boxes/pathbox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/pathboxrenderdata.cpp b/src/core/Boxes/pathboxrenderdata.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/pathboxrenderdata.h b/src/core/Boxes/pathboxrenderdata.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/patheffectsmenu.cpp b/src/core/Boxes/patheffectsmenu.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/patheffectsmenu.h b/src/core/Boxes/patheffectsmenu.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/rectangle.cpp b/src/core/Boxes/rectangle.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/rectangle.h b/src/core/Boxes/rectangle.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/renderdatahandler.cpp b/src/core/Boxes/renderdatahandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/renderdatahandler.h b/src/core/Boxes/renderdatahandler.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/smartvectorpath.cpp b/src/core/Boxes/smartvectorpath.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/smartvectorpath.h b/src/core/Boxes/smartvectorpath.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/svglinkbox.cpp b/src/core/Boxes/svglinkbox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/svglinkbox.h b/src/core/Boxes/svglinkbox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/textbox.cpp b/src/core/Boxes/textbox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/textbox.h b/src/core/Boxes/textbox.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/textboxrenderdata.cpp b/src/core/Boxes/textboxrenderdata.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/textboxrenderdata.h b/src/core/Boxes/textboxrenderdata.h old mode 100755 new mode 100644 diff --git a/src/core/Boxes/videobox.cpp b/src/core/Boxes/videobox.cpp old mode 100755 new mode 100644 diff --git a/src/core/Boxes/videobox.h b/src/core/Boxes/videobox.h old mode 100755 new mode 100644 diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 1991f9381..9e9689bbb 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -33,7 +33,7 @@ message("-- ffmpeg libraries: ${FFMPEG_LIBRARIES_DIRS} ${FFMPEG_LIBRARIES}") message("-- skia libraries: ${SKIA_LIBRARIES}") add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}") -add_definitions(-DPROJECT_GIT="${GIT_COMMIT}") +add_definitions(-DPROJECT_COMMIT="${GIT_COMMIT}") add_definitions(-DPROJECT_BRANCH="${GIT_BRANCH}") add_definitions(-DCORE_LIBRARY) @@ -209,6 +209,7 @@ set( ShaderEffects/shadereffectprogram.cpp ShaderEffects/shadervaluehandler.cpp ShaderEffects/uniformspecifiercreator.cpp + Sound/audiohandler.cpp Sound/eindependentsound.cpp Sound/esound.cpp Sound/esoundlink.cpp @@ -286,12 +287,10 @@ set( swt_abstraction.cpp swt_rulescollection.cpp texteffect.cpp - texteffectcaller.cpp transformvalues.cpp undoredo.cpp exceptions.cpp glhelpers.cpp - skia/skimagecopy.cpp skia/skqtconversions.cpp pointhelpers.cpp simplemath.cpp @@ -344,6 +343,10 @@ set( wrappedint.cpp zipfileloader.cpp zipfilesaver.cpp + outputsettings.cpp + rendersettings.cpp + renderinstancesettings.cpp + videoencoder.cpp ) set( @@ -530,6 +533,7 @@ set( ShaderEffects/shadereffectprogram.h ShaderEffects/shadervaluehandler.h ShaderEffects/uniformspecifiercreator.h + Sound/audiohandler.h Sound/eindependentsound.h Sound/esound.h Sound/esoundlink.h @@ -613,14 +617,12 @@ set( swt_abstraction.h swt_rulescollection.h texteffect.h - texteffectcaller.h transformvalues.h undoredo.h exceptions.h glhelpers.h skia/skiadefines.h skia/skiaincludes.h - skia/skimagecopy.h skia/skqtconversions.h pointhelpers.h simplemath.h @@ -675,6 +677,10 @@ set( windowsincludes.h zipfileloader.h zipfilesaver.h + outputsettings.h + rendersettings.h + renderinstancesettings.h + videoencoder.h ) if(NOT WIN32) diff --git a/src/core/CacheHandlers/cachecontainer.cpp b/src/core/CacheHandlers/cachecontainer.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/cachecontainer.h b/src/core/CacheHandlers/cachecontainer.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/hddcachablecachehandler.cpp b/src/core/CacheHandlers/hddcachablecachehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/hddcachablecachehandler.h b/src/core/CacheHandlers/hddcachablecachehandler.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/hddcachablecont.cpp b/src/core/CacheHandlers/hddcachablecont.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/hddcachablecont.h b/src/core/CacheHandlers/hddcachablecont.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/hddcachablerangecont.cpp b/src/core/CacheHandlers/hddcachablerangecont.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/hddcachablerangecont.h b/src/core/CacheHandlers/hddcachablerangecont.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/imagecachecontainer.cpp b/src/core/CacheHandlers/imagecachecontainer.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/imagecachecontainer.h b/src/core/CacheHandlers/imagecachecontainer.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/imagedatahandler.cpp b/src/core/CacheHandlers/imagedatahandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/imagedatahandler.h b/src/core/CacheHandlers/imagedatahandler.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/samples.cpp b/src/core/CacheHandlers/samples.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/samples.h b/src/core/CacheHandlers/samples.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/sceneframecontainer.cpp b/src/core/CacheHandlers/sceneframecontainer.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/sceneframecontainer.h b/src/core/CacheHandlers/sceneframecontainer.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/soundcachecontainer.cpp b/src/core/CacheHandlers/soundcachecontainer.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/soundcachecontainer.h b/src/core/CacheHandlers/soundcachecontainer.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/soundcachehandler.cpp b/src/core/CacheHandlers/soundcachehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/soundcachehandler.h b/src/core/CacheHandlers/soundcachehandler.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/soundtmpfilehandlers.cpp b/src/core/CacheHandlers/soundtmpfilehandlers.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/soundtmpfilehandlers.h b/src/core/CacheHandlers/soundtmpfilehandlers.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/tmpdeleter.cpp b/src/core/CacheHandlers/tmpdeleter.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/tmpdeleter.h b/src/core/CacheHandlers/tmpdeleter.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/tmploader.cpp b/src/core/CacheHandlers/tmploader.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/tmploader.h b/src/core/CacheHandlers/tmploader.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/tmpsaver.cpp b/src/core/CacheHandlers/tmpsaver.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/tmpsaver.h b/src/core/CacheHandlers/tmpsaver.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/usedrange.cpp b/src/core/CacheHandlers/usedrange.cpp old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/usedrange.h b/src/core/CacheHandlers/usedrange.h old mode 100755 new mode 100644 diff --git a/src/core/CacheHandlers/usepointer.h b/src/core/CacheHandlers/usepointer.h old mode 100755 new mode 100644 diff --git a/src/core/Expressions/expression.cpp b/src/core/Expressions/expression.cpp old mode 100755 new mode 100644 diff --git a/src/core/Expressions/expression.h b/src/core/Expressions/expression.h old mode 100755 new mode 100644 diff --git a/src/core/Expressions/framebinding.cpp b/src/core/Expressions/framebinding.cpp old mode 100755 new mode 100644 diff --git a/src/core/Expressions/framebinding.h b/src/core/Expressions/framebinding.h old mode 100755 new mode 100644 diff --git a/src/core/Expressions/propertybinding.cpp b/src/core/Expressions/propertybinding.cpp old mode 100755 new mode 100644 diff --git a/src/core/Expressions/propertybinding.h b/src/core/Expressions/propertybinding.h old mode 100755 new mode 100644 diff --git a/src/core/Expressions/propertybindingbase.cpp b/src/core/Expressions/propertybindingbase.cpp old mode 100755 new mode 100644 diff --git a/src/core/Expressions/propertybindingbase.h b/src/core/Expressions/propertybindingbase.h old mode 100755 new mode 100644 diff --git a/src/core/Expressions/propertybindingparser.cpp b/src/core/Expressions/propertybindingparser.cpp old mode 100755 new mode 100644 diff --git a/src/core/Expressions/propertybindingparser.h b/src/core/Expressions/propertybindingparser.h old mode 100755 new mode 100644 diff --git a/src/core/Expressions/valuebinding.cpp b/src/core/Expressions/valuebinding.cpp old mode 100755 new mode 100644 diff --git a/src/core/Expressions/valuebinding.h b/src/core/Expressions/valuebinding.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/animationcachehandler.cpp b/src/core/FileCacheHandlers/animationcachehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/animationcachehandler.h b/src/core/FileCacheHandlers/animationcachehandler.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/audiostreamsdata.cpp b/src/core/FileCacheHandlers/audiostreamsdata.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/audiostreamsdata.h b/src/core/FileCacheHandlers/audiostreamsdata.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/filecachehandler.cpp b/src/core/FileCacheHandlers/filecachehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/filecachehandler.h b/src/core/FileCacheHandlers/filecachehandler.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/filedatacachehandler.cpp b/src/core/FileCacheHandlers/filedatacachehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/filedatacachehandler.h b/src/core/FileCacheHandlers/filedatacachehandler.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/filehandlerobjref.cpp b/src/core/FileCacheHandlers/filehandlerobjref.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/filehandlerobjref.h b/src/core/FileCacheHandlers/filehandlerobjref.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/imagecachehandler.cpp b/src/core/FileCacheHandlers/imagecachehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/imagecachehandler.h b/src/core/FileCacheHandlers/imagecachehandler.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/imagesequencecachehandler.cpp b/src/core/FileCacheHandlers/imagesequencecachehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/imagesequencecachehandler.h b/src/core/FileCacheHandlers/imagesequencecachehandler.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/soundreader.cpp b/src/core/FileCacheHandlers/soundreader.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/soundreader.h b/src/core/FileCacheHandlers/soundreader.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/svgfilecachehandler.cpp b/src/core/FileCacheHandlers/svgfilecachehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/svgfilecachehandler.h b/src/core/FileCacheHandlers/svgfilecachehandler.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/videocachehandler.cpp b/src/core/FileCacheHandlers/videocachehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/videocachehandler.h b/src/core/FileCacheHandlers/videocachehandler.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/videoframeloader.cpp b/src/core/FileCacheHandlers/videoframeloader.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/videoframeloader.h b/src/core/FileCacheHandlers/videoframeloader.h old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/videostreamsdata.cpp b/src/core/FileCacheHandlers/videostreamsdata.cpp old mode 100755 new mode 100644 diff --git a/src/core/FileCacheHandlers/videostreamsdata.h b/src/core/FileCacheHandlers/videostreamsdata.h old mode 100755 new mode 100644 diff --git a/src/core/GUI/boxeslistactionbutton.cpp b/src/core/GUI/boxeslistactionbutton.cpp old mode 100755 new mode 100644 diff --git a/src/core/GUI/boxeslistactionbutton.h b/src/core/GUI/boxeslistactionbutton.h old mode 100755 new mode 100644 diff --git a/src/core/GUI/coloranimatorbutton.cpp b/src/core/GUI/coloranimatorbutton.cpp old mode 100755 new mode 100644 diff --git a/src/core/GUI/coloranimatorbutton.h b/src/core/GUI/coloranimatorbutton.h old mode 100755 new mode 100644 diff --git a/src/core/GUI/dialogsinterface.cpp b/src/core/GUI/dialogsinterface.cpp old mode 100755 new mode 100644 diff --git a/src/core/GUI/dialogsinterface.h b/src/core/GUI/dialogsinterface.h old mode 100755 new mode 100644 diff --git a/src/core/GUI/edialogs.cpp b/src/core/GUI/edialogs.cpp old mode 100755 new mode 100644 diff --git a/src/core/GUI/edialogs.h b/src/core/GUI/edialogs.h old mode 100755 new mode 100644 diff --git a/src/core/GUI/ewidgets.cpp b/src/core/GUI/ewidgets.cpp old mode 100755 new mode 100644 diff --git a/src/core/GUI/ewidgets.h b/src/core/GUI/ewidgets.h old mode 100755 new mode 100644 diff --git a/src/core/GUI/global.cpp b/src/core/GUI/global.cpp old mode 100755 new mode 100644 diff --git a/src/core/GUI/global.h b/src/core/GUI/global.h old mode 100755 new mode 100644 diff --git a/src/core/GUI/propertynamedialog.cpp b/src/core/GUI/propertynamedialog.cpp old mode 100755 new mode 100644 diff --git a/src/core/GUI/propertynamedialog.h b/src/core/GUI/propertynamedialog.h old mode 100755 new mode 100644 diff --git a/src/core/GUI/valueinput.cpp b/src/core/GUI/valueinput.cpp old mode 100755 new mode 100644 diff --git a/src/core/GUI/valueinput.h b/src/core/GUI/valueinput.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/animatedpoint.cpp b/src/core/MovablePoints/animatedpoint.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/animatedpoint.h b/src/core/MovablePoints/animatedpoint.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/boxpathpoint.cpp b/src/core/MovablePoints/boxpathpoint.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/boxpathpoint.h b/src/core/MovablePoints/boxpathpoint.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/gradientpoint.cpp b/src/core/MovablePoints/gradientpoint.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/gradientpoint.h b/src/core/MovablePoints/gradientpoint.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/movablepoint.cpp b/src/core/MovablePoints/movablepoint.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/movablepoint.h b/src/core/MovablePoints/movablepoint.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/nonanimatedmovablepoint.cpp b/src/core/MovablePoints/nonanimatedmovablepoint.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/nonanimatedmovablepoint.h b/src/core/MovablePoints/nonanimatedmovablepoint.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/pathpivot.cpp b/src/core/MovablePoints/pathpivot.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/pathpivot.h b/src/core/MovablePoints/pathpivot.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/pathpointshandler.cpp b/src/core/MovablePoints/pathpointshandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/pathpointshandler.h b/src/core/MovablePoints/pathpointshandler.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/pointshandler.cpp b/src/core/MovablePoints/pointshandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/pointshandler.h b/src/core/MovablePoints/pointshandler.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/segment.cpp b/src/core/MovablePoints/segment.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/segment.h b/src/core/MovablePoints/segment.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/smartctrlpoint.cpp b/src/core/MovablePoints/smartctrlpoint.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/smartctrlpoint.h b/src/core/MovablePoints/smartctrlpoint.h old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/smartnodepoint.cpp b/src/core/MovablePoints/smartnodepoint.cpp old mode 100755 new mode 100644 diff --git a/src/core/MovablePoints/smartnodepoint.h b/src/core/MovablePoints/smartnodepoint.h old mode 100755 new mode 100644 diff --git a/src/core/Paint/brushcontexedwrapper.cpp b/src/core/Paint/brushcontexedwrapper.cpp old mode 100755 new mode 100644 diff --git a/src/core/Paint/brushcontexedwrapper.h b/src/core/Paint/brushcontexedwrapper.h old mode 100755 new mode 100644 diff --git a/src/core/Paint/brushescontext.cpp b/src/core/Paint/brushescontext.cpp old mode 100755 new mode 100644 diff --git a/src/core/Paint/brushescontext.h b/src/core/Paint/brushescontext.h old mode 100755 new mode 100644 diff --git a/src/core/Paint/simplebrushwrapper.cpp b/src/core/Paint/simplebrushwrapper.cpp old mode 100755 new mode 100644 diff --git a/src/core/Paint/simplebrushwrapper.h b/src/core/Paint/simplebrushwrapper.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/custompatheffect.cpp b/src/core/PathEffects/custompatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/custompatheffect.h b/src/core/PathEffects/custompatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/custompatheffectcreator.h b/src/core/PathEffects/custompatheffectcreator.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/dashpatheffect.cpp b/src/core/PathEffects/dashpatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/dashpatheffect.h b/src/core/PathEffects/dashpatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/displacepatheffect.cpp b/src/core/PathEffects/displacepatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/displacepatheffect.h b/src/core/PathEffects/displacepatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/duplicatepatheffect.cpp b/src/core/PathEffects/duplicatepatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/duplicatepatheffect.h b/src/core/PathEffects/duplicatepatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/linespatheffect.cpp b/src/core/PathEffects/linespatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/linespatheffect.h b/src/core/PathEffects/linespatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/patheffect.cpp b/src/core/PathEffects/patheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/patheffect.h b/src/core/PathEffects/patheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/patheffectcaller.cpp b/src/core/PathEffects/patheffectcaller.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/patheffectcaller.h b/src/core/PathEffects/patheffectcaller.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/patheffectcollection.cpp b/src/core/PathEffects/patheffectcollection.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/patheffectcollection.h b/src/core/PathEffects/patheffectcollection.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/patheffectsinclude.h b/src/core/PathEffects/patheffectsinclude.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/patheffectstask.cpp b/src/core/PathEffects/patheffectstask.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/patheffectstask.h b/src/core/PathEffects/patheffectstask.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/solidifypatheffect.cpp b/src/core/PathEffects/solidifypatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/solidifypatheffect.h b/src/core/PathEffects/solidifypatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/spatialdisplacepatheffect.cpp b/src/core/PathEffects/spatialdisplacepatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/spatialdisplacepatheffect.h b/src/core/PathEffects/spatialdisplacepatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/subdividepatheffect.cpp b/src/core/PathEffects/subdividepatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/subdividepatheffect.h b/src/core/PathEffects/subdividepatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/subpatheffect.cpp b/src/core/PathEffects/subpatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/subpatheffect.h b/src/core/PathEffects/subpatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/sumpatheffect.cpp b/src/core/PathEffects/sumpatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/sumpatheffect.h b/src/core/PathEffects/sumpatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/zigzagpatheffect.cpp b/src/core/PathEffects/zigzagpatheffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/PathEffects/zigzagpatheffect.h b/src/core/PathEffects/zigzagpatheffect.h old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/complextask.cpp b/src/core/Private/Tasks/complextask.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/complextask.h b/src/core/Private/Tasks/complextask.h old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/execcontroller.cpp b/src/core/Private/Tasks/execcontroller.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/execcontroller.h b/src/core/Private/Tasks/execcontroller.h old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/gputaskexecutor.cpp b/src/core/Private/Tasks/gputaskexecutor.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/gputaskexecutor.h b/src/core/Private/Tasks/gputaskexecutor.h old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/offscreenqgl33c.cpp b/src/core/Private/Tasks/offscreenqgl33c.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/offscreenqgl33c.h b/src/core/Private/Tasks/offscreenqgl33c.h old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/taskexecutor.cpp b/src/core/Private/Tasks/taskexecutor.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/taskexecutor.h b/src/core/Private/Tasks/taskexecutor.h old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/taskque.cpp b/src/core/Private/Tasks/taskque.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/taskque.h b/src/core/Private/Tasks/taskque.h old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/taskquehandler.cpp b/src/core/Private/Tasks/taskquehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/taskquehandler.h b/src/core/Private/Tasks/taskquehandler.h old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/taskscheduler.cpp b/src/core/Private/Tasks/taskscheduler.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/Tasks/taskscheduler.h b/src/core/Private/Tasks/taskscheduler.h old mode 100755 new mode 100644 diff --git a/src/core/Private/document.cpp b/src/core/Private/document.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/document.h b/src/core/Private/document.h old mode 100755 new mode 100644 diff --git a/src/core/Private/documentrw.cpp b/src/core/Private/documentrw.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/esettings.cpp b/src/core/Private/esettings.cpp old mode 100755 new mode 100644 index aa016668e..1569f21ef --- a/src/core/Private/esettings.cpp +++ b/src/core/Private/esettings.cpp @@ -35,6 +35,7 @@ struct eSetting { eSetting(const QString& name) : fName(name) {} + virtual ~eSetting() = default; virtual bool setValueString(const QString& value) = 0; virtual void writeValue() const = 0; diff --git a/src/core/Private/esettings.h b/src/core/Private/esettings.h old mode 100755 new mode 100644 diff --git a/src/core/Private/memorystructs.cpp b/src/core/Private/memorystructs.cpp old mode 100755 new mode 100644 diff --git a/src/core/Private/memorystructs.h b/src/core/Private/memorystructs.h old mode 100755 new mode 100644 diff --git a/src/core/Private/qatomiclist.h b/src/core/Private/qatomiclist.h old mode 100755 new mode 100644 diff --git a/src/core/Properties/boolproperty.cpp b/src/core/Properties/boolproperty.cpp old mode 100755 new mode 100644 diff --git a/src/core/Properties/boolproperty.h b/src/core/Properties/boolproperty.h old mode 100755 new mode 100644 diff --git a/src/core/Properties/boolpropertycontainer.cpp b/src/core/Properties/boolpropertycontainer.cpp old mode 100755 new mode 100644 diff --git a/src/core/Properties/boolpropertycontainer.h b/src/core/Properties/boolpropertycontainer.h old mode 100755 new mode 100644 diff --git a/src/core/Properties/boxtargetproperty.cpp b/src/core/Properties/boxtargetproperty.cpp old mode 100755 new mode 100644 diff --git a/src/core/Properties/boxtargetproperty.h b/src/core/Properties/boxtargetproperty.h old mode 100755 new mode 100644 diff --git a/src/core/Properties/comboboxproperty.cpp b/src/core/Properties/comboboxproperty.cpp old mode 100755 new mode 100644 diff --git a/src/core/Properties/comboboxproperty.h b/src/core/Properties/comboboxproperty.h old mode 100755 new mode 100644 diff --git a/src/core/Properties/emimedata.cpp b/src/core/Properties/emimedata.cpp old mode 100755 new mode 100644 diff --git a/src/core/Properties/emimedata.h b/src/core/Properties/emimedata.h old mode 100755 new mode 100644 diff --git a/src/core/Properties/namedproperty.h b/src/core/Properties/namedproperty.h old mode 100755 new mode 100644 diff --git a/src/core/Properties/property.cpp b/src/core/Properties/property.cpp old mode 100755 new mode 100644 diff --git a/src/core/Properties/property.h b/src/core/Properties/property.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/blureffect.cpp b/src/core/RasterEffects/blureffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/blureffect.h b/src/core/RasterEffects/blureffect.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/brightnesscontrasteffect.cpp b/src/core/RasterEffects/brightnesscontrasteffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/brightnesscontrasteffect.h b/src/core/RasterEffects/brightnesscontrasteffect.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/colorizeeffect.cpp b/src/core/RasterEffects/colorizeeffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/colorizeeffect.h b/src/core/RasterEffects/colorizeeffect.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/customrastereffect.cpp b/src/core/RasterEffects/customrastereffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/customrastereffect.h b/src/core/RasterEffects/customrastereffect.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/customrastereffectcreator.h b/src/core/RasterEffects/customrastereffectcreator.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/motionblureffect.cpp b/src/core/RasterEffects/motionblureffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/motionblureffect.h b/src/core/RasterEffects/motionblureffect.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/noisefadeeffect.cpp b/src/core/RasterEffects/noisefadeeffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/noisefadeeffect.h b/src/core/RasterEffects/noisefadeeffect.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/rastereffect.cpp b/src/core/RasterEffects/rastereffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/rastereffect.h b/src/core/RasterEffects/rastereffect.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/rastereffectcaller.cpp b/src/core/RasterEffects/rastereffectcaller.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/rastereffectcaller.h b/src/core/RasterEffects/rastereffectcaller.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/rastereffectcollection.cpp b/src/core/RasterEffects/rastereffectcollection.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/rastereffectcollection.h b/src/core/RasterEffects/rastereffectcollection.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/rastereffectmenucreator.cpp b/src/core/RasterEffects/rastereffectmenucreator.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/rastereffectmenucreator.h b/src/core/RasterEffects/rastereffectmenucreator.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/rastereffectsinclude.h b/src/core/RasterEffects/rastereffectsinclude.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/shadoweffect.cpp b/src/core/RasterEffects/shadoweffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/shadoweffect.h b/src/core/RasterEffects/shadoweffect.h old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/wipeeffect.cpp b/src/core/RasterEffects/wipeeffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/RasterEffects/wipeeffect.h b/src/core/RasterEffects/wipeeffect.h old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/basicreadwrite.cpp b/src/core/ReadWrite/basicreadwrite.cpp old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/basicreadwrite.h b/src/core/ReadWrite/basicreadwrite.h old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/efuturepos.h b/src/core/ReadWrite/efuturepos.h old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/ereadstream.cpp b/src/core/ReadWrite/ereadstream.cpp old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/ereadstream.h b/src/core/ReadWrite/ereadstream.h old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/evformat.h b/src/core/ReadWrite/evformat.h old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/ewritestream.cpp b/src/core/ReadWrite/ewritestream.cpp old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/ewritestream.h b/src/core/ReadWrite/ewritestream.h old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/filefooter.cpp b/src/core/ReadWrite/filefooter.cpp old mode 100755 new mode 100644 diff --git a/src/core/ReadWrite/filefooter.h b/src/core/ReadWrite/filefooter.h old mode 100755 new mode 100644 diff --git a/src/core/Segments/conicsegment.cpp b/src/core/Segments/conicsegment.cpp old mode 100755 new mode 100644 diff --git a/src/core/Segments/conicsegment.h b/src/core/Segments/conicsegment.h old mode 100755 new mode 100644 diff --git a/src/core/Segments/cubiclist.cpp b/src/core/Segments/cubiclist.cpp old mode 100755 new mode 100644 diff --git a/src/core/Segments/cubiclist.h b/src/core/Segments/cubiclist.h old mode 100755 new mode 100644 diff --git a/src/core/Segments/cubicnode.cpp b/src/core/Segments/cubicnode.cpp old mode 100755 new mode 100644 diff --git a/src/core/Segments/cubicnode.h b/src/core/Segments/cubicnode.h old mode 100755 new mode 100644 diff --git a/src/core/Segments/fitcurves.cpp b/src/core/Segments/fitcurves.cpp old mode 100755 new mode 100644 diff --git a/src/core/Segments/fitcurves.h b/src/core/Segments/fitcurves.h old mode 100755 new mode 100644 diff --git a/src/core/Segments/qcubicsegment1d.cpp b/src/core/Segments/qcubicsegment1d.cpp old mode 100755 new mode 100644 diff --git a/src/core/Segments/qcubicsegment1d.h b/src/core/Segments/qcubicsegment1d.h old mode 100755 new mode 100644 diff --git a/src/core/Segments/qcubicsegment2d.cpp b/src/core/Segments/qcubicsegment2d.cpp old mode 100755 new mode 100644 diff --git a/src/core/Segments/qcubicsegment2d.h b/src/core/Segments/qcubicsegment2d.h old mode 100755 new mode 100644 diff --git a/src/core/Segments/quadsegment.cpp b/src/core/Segments/quadsegment.cpp old mode 100755 new mode 100644 diff --git a/src/core/Segments/quadsegment.h b/src/core/Segments/quadsegment.h old mode 100755 new mode 100644 diff --git a/src/core/Segments/smoothcurves.cpp b/src/core/Segments/smoothcurves.cpp old mode 100755 new mode 100644 diff --git a/src/core/Segments/smoothcurves.h b/src/core/Segments/smoothcurves.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/PropertyCreators/coloranimatorcreator.h b/src/core/ShaderEffects/PropertyCreators/coloranimatorcreator.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/PropertyCreators/intanimatorcreator.h b/src/core/ShaderEffects/PropertyCreators/intanimatorcreator.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/PropertyCreators/qpointfanimatorcreator.h b/src/core/ShaderEffects/PropertyCreators/qpointfanimatorcreator.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/PropertyCreators/qrealanimatorcreator.h b/src/core/ShaderEffects/PropertyCreators/qrealanimatorcreator.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/PropertyCreators/shaderpropertycreator.h b/src/core/ShaderEffects/PropertyCreators/shaderpropertycreator.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffect.cpp b/src/core/ShaderEffects/shadereffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffect.h b/src/core/ShaderEffects/shadereffect.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffectcaller.cpp b/src/core/ShaderEffects/shadereffectcaller.cpp old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffectcaller.h b/src/core/ShaderEffects/shadereffectcaller.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffectcreator.cpp b/src/core/ShaderEffects/shadereffectcreator.cpp old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffectcreator.h b/src/core/ShaderEffects/shadereffectcreator.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffectjs.cpp b/src/core/ShaderEffects/shadereffectjs.cpp old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffectjs.h b/src/core/ShaderEffects/shadereffectjs.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffectprogram.cpp b/src/core/ShaderEffects/shadereffectprogram.cpp old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadereffectprogram.h b/src/core/ShaderEffects/shadereffectprogram.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadervaluehandler.cpp b/src/core/ShaderEffects/shadervaluehandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/shadervaluehandler.h b/src/core/ShaderEffects/shadervaluehandler.h old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/uniformspecifiercreator.cpp b/src/core/ShaderEffects/uniformspecifiercreator.cpp old mode 100755 new mode 100644 diff --git a/src/core/ShaderEffects/uniformspecifiercreator.h b/src/core/ShaderEffects/uniformspecifiercreator.h old mode 100755 new mode 100644 diff --git a/src/app/GUI/audiohandler.cpp b/src/core/Sound/audiohandler.cpp old mode 100755 new mode 100644 similarity index 99% rename from src/app/GUI/audiohandler.cpp rename to src/core/Sound/audiohandler.cpp index 5920a38bd..f34d71723 --- a/src/app/GUI/audiohandler.cpp +++ b/src/core/Sound/audiohandler.cpp @@ -24,7 +24,7 @@ // Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner #include "audiohandler.h" -#include "Sound/soundcomposition.h" +#include "soundcomposition.h" #include "appsupport.h" #include diff --git a/src/app/GUI/audiohandler.h b/src/core/Sound/audiohandler.h old mode 100755 new mode 100644 similarity index 95% rename from src/app/GUI/audiohandler.h rename to src/core/Sound/audiohandler.h index c62a0c53a..78adc8cad --- a/src/app/GUI/audiohandler.h +++ b/src/core/Sound/audiohandler.h @@ -26,12 +26,14 @@ #ifndef AUDIOHANDLER_H #define AUDIOHANDLER_H +#include "core_global.h" + #include #include -struct eSoundSettingsData; +struct CORE_EXPORT eSoundSettingsData; -class AudioHandler : public QObject +class CORE_EXPORT AudioHandler : public QObject { Q_OBJECT public: diff --git a/src/core/Sound/eindependentsound.cpp b/src/core/Sound/eindependentsound.cpp old mode 100755 new mode 100644 diff --git a/src/core/Sound/eindependentsound.h b/src/core/Sound/eindependentsound.h old mode 100755 new mode 100644 diff --git a/src/core/Sound/esound.cpp b/src/core/Sound/esound.cpp old mode 100755 new mode 100644 diff --git a/src/core/Sound/esound.h b/src/core/Sound/esound.h old mode 100755 new mode 100644 diff --git a/src/core/Sound/esoundlink.cpp b/src/core/Sound/esoundlink.cpp old mode 100755 new mode 100644 diff --git a/src/core/Sound/esoundlink.h b/src/core/Sound/esoundlink.h old mode 100755 new mode 100644 diff --git a/src/core/Sound/esoundobjectbase.cpp b/src/core/Sound/esoundobjectbase.cpp old mode 100755 new mode 100644 diff --git a/src/core/Sound/esoundobjectbase.h b/src/core/Sound/esoundobjectbase.h old mode 100755 new mode 100644 diff --git a/src/core/Sound/esoundsettings.cpp b/src/core/Sound/esoundsettings.cpp old mode 100755 new mode 100644 diff --git a/src/core/Sound/esoundsettings.h b/src/core/Sound/esoundsettings.h old mode 100755 new mode 100644 diff --git a/src/core/Sound/evideosound.cpp b/src/core/Sound/evideosound.cpp old mode 100755 new mode 100644 diff --git a/src/core/Sound/evideosound.h b/src/core/Sound/evideosound.h old mode 100755 new mode 100644 diff --git a/src/core/Sound/soundcomposition.cpp b/src/core/Sound/soundcomposition.cpp old mode 100755 new mode 100644 diff --git a/src/core/Sound/soundcomposition.h b/src/core/Sound/soundcomposition.h old mode 100755 new mode 100644 diff --git a/src/core/Sound/soundmerger.cpp b/src/core/Sound/soundmerger.cpp old mode 100755 new mode 100644 index f6ed72ba0..9a19065a4 --- a/src/core/Sound/soundmerger.cpp +++ b/src/core/Sound/soundmerger.cpp @@ -101,8 +101,8 @@ void mergePlanarDataSigned(T const * const * const src, const int nChannels) { int dstId = dstRange.fMin; int srcId = srcRange.fMin; - const qreal min = std::numeric_limits::min(); - const qreal max = std::numeric_limits::max(); + const qreal min = (qreal)std::numeric_limits::min(); + const qreal max = (qreal)std::numeric_limits::max(); if(volIt.staticValue()) { const qreal vol = volIt.getValueAndProgress(1); for(int i = 0; i < nSamples; i++) { @@ -132,8 +132,8 @@ void mergeInterleavedDataSigned(const T* const src, const int nChannels) { int dstId = dstRange.fMin*nChannels; int srcId = srcRange.fMin*nChannels; - const qreal min = std::numeric_limits::min(); - const qreal max = std::numeric_limits::max(); + const qreal min = (qreal)std::numeric_limits::min(); + const qreal max = (qreal)std::numeric_limits::max(); if(volIt.staticValue()) { const qreal vol = volIt.getValueAndProgress(1); for(int i = 0; i < nSamples; i++) { diff --git a/src/core/Sound/soundmerger.h b/src/core/Sound/soundmerger.h old mode 100755 new mode 100644 diff --git a/src/core/Tasks/domeletask.cpp b/src/core/Tasks/domeletask.cpp old mode 100755 new mode 100644 diff --git a/src/core/Tasks/domeletask.h b/src/core/Tasks/domeletask.h old mode 100755 new mode 100644 diff --git a/src/core/Tasks/etask.cpp b/src/core/Tasks/etask.cpp old mode 100755 new mode 100644 diff --git a/src/core/Tasks/etask.h b/src/core/Tasks/etask.h old mode 100755 new mode 100644 diff --git a/src/core/Tasks/etaskbase.cpp b/src/core/Tasks/etaskbase.cpp old mode 100755 new mode 100644 diff --git a/src/core/Tasks/etaskbase.h b/src/core/Tasks/etaskbase.h old mode 100755 new mode 100644 diff --git a/src/core/Tasks/updatable.cpp b/src/core/Tasks/updatable.cpp old mode 100755 new mode 100644 diff --git a/src/core/Tasks/updatable.h b/src/core/Tasks/updatable.h old mode 100755 new mode 100644 diff --git a/src/core/Timeline/animationrect.cpp b/src/core/Timeline/animationrect.cpp old mode 100755 new mode 100644 diff --git a/src/core/Timeline/animationrect.h b/src/core/Timeline/animationrect.h old mode 100755 new mode 100644 diff --git a/src/core/Timeline/durationrectangle.cpp b/src/core/Timeline/durationrectangle.cpp old mode 100755 new mode 100644 diff --git a/src/core/Timeline/durationrectangle.h b/src/core/Timeline/durationrectangle.h old mode 100755 new mode 100644 diff --git a/src/core/Timeline/fixedlenanimationrect.cpp b/src/core/Timeline/fixedlenanimationrect.cpp old mode 100755 new mode 100644 diff --git a/src/core/Timeline/fixedlenanimationrect.h b/src/core/Timeline/fixedlenanimationrect.h old mode 100755 new mode 100644 diff --git a/src/core/action.cpp b/src/core/action.cpp old mode 100755 new mode 100644 diff --git a/src/core/action.h b/src/core/action.h old mode 100755 new mode 100644 diff --git a/src/core/actions.cpp b/src/core/actions.cpp old mode 100755 new mode 100644 diff --git a/src/core/actions.h b/src/core/actions.h old mode 100755 new mode 100644 diff --git a/src/core/appsupport.cpp b/src/core/appsupport.cpp index 59fa0f225..ba5e6024d 100644 --- a/src/core/appsupport.cpp +++ b/src/core/appsupport.cpp @@ -150,35 +150,41 @@ const QString AppSupport::getAppUrl() return QString::fromUtf8("https://friction.graphics"); } -const QString AppSupport::getAppVersion(bool html) +const QString AppSupport::getAppVersion() { - QString version = QString::fromUtf8("0.9.6"); // fallback, should not happen -#ifdef PROJECT_VERSION - version = QString::fromUtf8(PROJECT_VERSION); -#endif + QString version = QString::fromUtf8(PROJECT_VERSION); #ifndef PROJECT_OFFICIAL version.append("-dev"); #endif - QString git; -#ifdef PROJECT_GIT - git = QString::fromUtf8(PROJECT_GIT); -#endif - QString branch; -#ifdef PROJECT_BRANCH - branch = QString::fromUtf8(PROJECT_BRANCH); -#endif - if (!branch.isEmpty()) { - version.append(QString::fromUtf8(" %1").arg(branch)); - } - if (!git.isEmpty()) { - if (branch.isEmpty()) { version.append(QString::fromUtf8(" ")); } - else { version.append(QString::fromUtf8("/")); } - version.append(html ? QString::fromUtf8("%1").arg(git, - getAppCommitUrl()) : git); - } return version; } +const QString AppSupport::getAppBuildInfo(bool html) +{ +#if defined(PROJECT_COMMIT) && defined(PROJECT_BRANCH) + const auto commit = QString::fromUtf8(PROJECT_COMMIT); + const auto branch = QString::fromUtf8(PROJECT_BRANCH); + if (commit.isEmpty() || branch.isEmpty()) { return QString(); } + if (!html) { + return QString("%1 %2 %3 %4.").arg(tr("Built from"), + commit, + tr("on"), + branch); + } else { + return QString("%1 %2 %3 %4.") + .arg(tr("Built from"), + commit, + tr("on"), + branch, + getAppCommitUrl(), + getAppBranchUrl()); + } +#else + Q_UNUSED(html) +#endif + return QString(); +} + const QString AppSupport::getAppDesc() { return QString::fromUtf8("Motion Graphics"); @@ -209,6 +215,11 @@ const QString AppSupport::getAppCommitUrl() return QString::fromUtf8("https://github.com/friction2d/friction/commit"); } +const QString AppSupport::getAppBranchUrl() +{ + return QString::fromUtf8("https://github.com/friction2d/friction/tree"); +} + const QString AppSupport::getAppConfigPath() { QString path = QString::fromUtf8("%1/%2") diff --git a/src/core/appsupport.h b/src/core/appsupport.h index f302464ad..03b01a278 100644 --- a/src/core/appsupport.h +++ b/src/core/appsupport.h @@ -63,13 +63,15 @@ class CORE_EXPORT AppSupport : public QObject static const QString getAppDomain(); static const QString getAppID(); static const QString getAppUrl(); - static const QString getAppVersion(bool html = false); + static const QString getAppVersion(); + static const QString getAppBuildInfo(bool html = false); static const QString getAppDesc(); static const QString getAppCompany(); static const QString getAppContributorsUrl(); static const QString getAppIssuesUrl(); static const QString getAppLatestReleaseUrl(); static const QString getAppCommitUrl(); + static const QString getAppBranchUrl(); static const QString getAppConfigPath(); static const QString getAppOutputProfilesPath(); static const QString getAppPathEffectsPath(); diff --git a/src/core/canvas.cpp b/src/core/canvas.cpp old mode 100755 new mode 100644 diff --git a/src/core/canvas.h b/src/core/canvas.h old mode 100755 new mode 100644 diff --git a/src/core/canvasbase.cpp b/src/core/canvasbase.cpp old mode 100755 new mode 100644 diff --git a/src/core/canvasbase.h b/src/core/canvasbase.h old mode 100755 new mode 100644 diff --git a/src/core/canvashandlesmartpath.cpp b/src/core/canvashandlesmartpath.cpp old mode 100755 new mode 100644 diff --git a/src/core/canvasmouseevents.cpp b/src/core/canvasmouseevents.cpp old mode 100755 new mode 100644 diff --git a/src/core/canvasmouseinteractions.cpp b/src/core/canvasmouseinteractions.cpp old mode 100755 new mode 100644 diff --git a/src/core/canvasselectedboxesactions.cpp b/src/core/canvasselectedboxesactions.cpp old mode 100755 new mode 100644 diff --git a/src/core/canvasselectedpointsactions.cpp b/src/core/canvasselectedpointsactions.cpp old mode 100755 new mode 100644 diff --git a/src/core/clipboardcontainer.cpp b/src/core/clipboardcontainer.cpp old mode 100755 new mode 100644 diff --git a/src/core/clipboardcontainer.h b/src/core/clipboardcontainer.h old mode 100755 new mode 100644 diff --git a/src/core/colorhelpers.cpp b/src/core/colorhelpers.cpp old mode 100755 new mode 100644 diff --git a/src/core/colorhelpers.h b/src/core/colorhelpers.h old mode 100755 new mode 100644 diff --git a/src/core/colorsetting.cpp b/src/core/colorsetting.cpp old mode 100755 new mode 100644 diff --git a/src/core/colorsetting.h b/src/core/colorsetting.h old mode 100755 new mode 100644 diff --git a/src/core/conncontext.cpp b/src/core/conncontext.cpp old mode 100755 new mode 100644 diff --git a/src/core/conncontext.h b/src/core/conncontext.h old mode 100755 new mode 100644 diff --git a/src/core/conncontextobjlist.h b/src/core/conncontextobjlist.h old mode 100755 new mode 100644 diff --git a/src/core/conncontextptr.h b/src/core/conncontextptr.h old mode 100755 new mode 100644 diff --git a/src/core/core_global.h b/src/core/core_global.h old mode 100755 new mode 100644 diff --git a/src/core/cpurendertools.cpp b/src/core/cpurendertools.cpp old mode 100755 new mode 100644 diff --git a/src/core/cpurendertools.h b/src/core/cpurendertools.h old mode 100755 new mode 100644 diff --git a/src/core/customhandler.h b/src/core/customhandler.h old mode 100755 new mode 100644 diff --git a/src/core/customidentifier.h b/src/core/customidentifier.h old mode 100755 new mode 100644 diff --git a/src/core/differsinterpolate.cpp b/src/core/differsinterpolate.cpp old mode 100755 new mode 100644 diff --git a/src/core/differsinterpolate.h b/src/core/differsinterpolate.h old mode 100755 new mode 100644 diff --git a/src/core/drawpath.cpp b/src/core/drawpath.cpp old mode 100755 new mode 100644 diff --git a/src/core/drawpath.h b/src/core/drawpath.h old mode 100755 new mode 100644 diff --git a/src/core/efiltersettings.cpp b/src/core/efiltersettings.cpp old mode 100755 new mode 100644 diff --git a/src/core/efiltersettings.h b/src/core/efiltersettings.h old mode 100755 new mode 100644 diff --git a/src/core/etexture.cpp b/src/core/etexture.cpp old mode 100755 new mode 100644 diff --git a/src/core/etexture.h b/src/core/etexture.h old mode 100755 new mode 100644 diff --git a/src/core/etextureframebuffer.cpp b/src/core/etextureframebuffer.cpp old mode 100755 new mode 100644 diff --git a/src/core/etextureframebuffer.h b/src/core/etextureframebuffer.h old mode 100755 new mode 100644 diff --git a/src/core/exceptions.cpp b/src/core/exceptions.cpp old mode 100755 new mode 100644 diff --git a/src/core/exceptions.h b/src/core/exceptions.h old mode 100755 new mode 100644 diff --git a/src/core/fileshandler.cpp b/src/core/fileshandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/fileshandler.h b/src/core/fileshandler.h old mode 100755 new mode 100644 diff --git a/src/core/filesourcescache.cpp b/src/core/filesourcescache.cpp old mode 100755 new mode 100644 diff --git a/src/core/filesourcescache.h b/src/core/filesourcescache.h old mode 100755 new mode 100644 diff --git a/src/core/framerange.cpp b/src/core/framerange.cpp old mode 100755 new mode 100644 diff --git a/src/core/framerange.h b/src/core/framerange.h old mode 100755 new mode 100644 diff --git a/src/core/glhelpers.cpp b/src/core/glhelpers.cpp old mode 100755 new mode 100644 diff --git a/src/core/glhelpers.h b/src/core/glhelpers.h old mode 100755 new mode 100644 diff --git a/src/core/gpurendertools.cpp b/src/core/gpurendertools.cpp old mode 100755 new mode 100644 diff --git a/src/core/gpurendertools.h b/src/core/gpurendertools.h old mode 100755 new mode 100644 diff --git a/src/core/hardwareenums.h b/src/core/hardwareenums.h old mode 100755 new mode 100644 diff --git a/src/core/hardwareinfo.cpp b/src/core/hardwareinfo.cpp old mode 100755 new mode 100644 diff --git a/src/core/hardwareinfo.h b/src/core/hardwareinfo.h old mode 100755 new mode 100644 diff --git a/src/core/importhandler.cpp b/src/core/importhandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/importhandler.h b/src/core/importhandler.h old mode 100755 new mode 100644 diff --git a/src/core/matrixdecomposition.cpp b/src/core/matrixdecomposition.cpp old mode 100755 new mode 100644 diff --git a/src/core/matrixdecomposition.h b/src/core/matrixdecomposition.h old mode 100755 new mode 100644 diff --git a/src/core/memorydatahandler.cpp b/src/core/memorydatahandler.cpp old mode 100755 new mode 100644 diff --git a/src/core/memorydatahandler.h b/src/core/memorydatahandler.h old mode 100755 new mode 100644 diff --git a/src/core/namefixer.cpp b/src/core/namefixer.cpp old mode 100755 new mode 100644 diff --git a/src/core/namefixer.h b/src/core/namefixer.h old mode 100755 new mode 100644 diff --git a/src/core/nodepointvalues.cpp b/src/core/nodepointvalues.cpp old mode 100755 new mode 100644 diff --git a/src/core/nodepointvalues.h b/src/core/nodepointvalues.h old mode 100755 new mode 100644 diff --git a/src/app/outputsettings.cpp b/src/core/outputsettings.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/outputsettings.cpp rename to src/core/outputsettings.cpp diff --git a/src/app/outputsettings.h b/src/core/outputsettings.h old mode 100755 new mode 100644 similarity index 95% rename from src/app/outputsettings.h rename to src/core/outputsettings.h index 40246f4ee..acb59f9c3 --- a/src/app/outputsettings.h +++ b/src/core/outputsettings.h @@ -23,6 +23,8 @@ #ifndef OUTPUTSETTINGS_H #define OUTPUTSETTINGS_H +#include "core_global.h" + #include #include "Private/esettings.h" #include "smartPointers/ememory.h" @@ -38,7 +40,7 @@ extern "C" { #include } -struct OutputSettings +struct CORE_EXPORT OutputSettings { static const std::map sSampleFormatNames; static QString sGetChannelsLayoutName(const uint64_t &layout); @@ -62,7 +64,7 @@ struct OutputSettings int fAudioBitrate = 0; }; -class OutputSettingsProfile : public SelfRef +class CORE_EXPORT OutputSettingsProfile : public SelfRef { Q_OBJECT e_OBJECT diff --git a/src/core/paintsettings.cpp b/src/core/paintsettings.cpp old mode 100755 new mode 100644 diff --git a/src/core/paintsettings.h b/src/core/paintsettings.h old mode 100755 new mode 100644 diff --git a/src/core/paintsettingsapplier.cpp b/src/core/paintsettingsapplier.cpp old mode 100755 new mode 100644 diff --git a/src/core/paintsettingsapplier.h b/src/core/paintsettingsapplier.h old mode 100755 new mode 100644 diff --git a/src/core/pathoperations.cpp b/src/core/pathoperations.cpp old mode 100755 new mode 100644 diff --git a/src/core/pathoperations.h b/src/core/pathoperations.h old mode 100755 new mode 100644 diff --git a/src/core/pointhelpers.cpp b/src/core/pointhelpers.cpp old mode 100755 new mode 100644 diff --git a/src/core/pointhelpers.h b/src/core/pointhelpers.h old mode 100755 new mode 100644 diff --git a/src/core/pointtypemenu.h b/src/core/pointtypemenu.h old mode 100755 new mode 100644 diff --git a/src/core/randomgrid.cpp b/src/core/randomgrid.cpp old mode 100755 new mode 100644 diff --git a/src/core/randomgrid.h b/src/core/randomgrid.h old mode 100755 new mode 100644 diff --git a/src/core/rangemap.h b/src/core/rangemap.h old mode 100755 new mode 100644 diff --git a/src/core/regexhelpers.h b/src/core/regexhelpers.h old mode 100755 new mode 100644 diff --git a/src/app/renderinstancesettings.cpp b/src/core/renderinstancesettings.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/renderinstancesettings.cpp rename to src/core/renderinstancesettings.cpp diff --git a/src/app/renderinstancesettings.h b/src/core/renderinstancesettings.h old mode 100755 new mode 100644 similarity index 95% rename from src/app/renderinstancesettings.h rename to src/core/renderinstancesettings.h index e8551ec29..3558426d6 --- a/src/app/renderinstancesettings.h +++ b/src/core/renderinstancesettings.h @@ -26,6 +26,8 @@ #ifndef RENDERINSTANCESETTINGS_H #define RENDERINSTANCESETTINGS_H +#include "core_global.h" + #include "outputsettings.h" #include "rendersettings.h" #include "smartPointers/ememory.h" @@ -34,7 +36,7 @@ class Canvas; -enum class RenderState { +enum class CORE_EXPORT RenderState { none, error, finished, @@ -43,7 +45,7 @@ enum class RenderState { waiting }; -class RenderInstanceSettings : public QObject { +class CORE_EXPORT RenderInstanceSettings : public QObject { Q_OBJECT public: RenderInstanceSettings(Canvas* canvas); diff --git a/src/app/rendersettings.cpp b/src/core/rendersettings.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/rendersettings.cpp rename to src/core/rendersettings.cpp diff --git a/src/app/rendersettings.h b/src/core/rendersettings.h old mode 100755 new mode 100644 similarity index 96% rename from src/app/rendersettings.h rename to src/core/rendersettings.h index 3f27d088f..5ca3176c2 --- a/src/app/rendersettings.h +++ b/src/core/rendersettings.h @@ -26,6 +26,8 @@ #ifndef RENDERSETTINGS_H #define RENDERSETTINGS_H +#include "core_global.h" + #include #include "ReadWrite/basicreadwrite.h" @@ -39,7 +41,7 @@ extern "C" { #include } -struct RenderSettings { +struct CORE_EXPORT RenderSettings { void write(eWriteStream& dst) const; void read(eReadStream& src); diff --git a/src/core/simplemath.cpp b/src/core/simplemath.cpp old mode 100755 new mode 100644 index b10762bf2..e4b73bf65 --- a/src/core/simplemath.cpp +++ b/src/core/simplemath.cpp @@ -42,7 +42,7 @@ qreal gRandF(const qreal fMin, const qreal fMax) { } float gSkRandF(const float fMin, const float fMax) { - float f = static_cast(QRandomGenerator::global()->generate())/RAND_MAX; + float f = static_cast(QRandomGenerator::global()->generate())/(float)RAND_MAX; return fMin + f * (fMax - fMin); } diff --git a/src/core/simplemath.h b/src/core/simplemath.h old mode 100755 new mode 100644 diff --git a/src/core/simpletask.cpp b/src/core/simpletask.cpp old mode 100755 new mode 100644 diff --git a/src/core/simpletask.h b/src/core/simpletask.h old mode 100755 new mode 100644 diff --git a/src/core/singlewidgettarget.cpp b/src/core/singlewidgettarget.cpp old mode 100755 new mode 100644 diff --git a/src/core/singlewidgettarget.h b/src/core/singlewidgettarget.h old mode 100755 new mode 100644 diff --git a/src/core/skia/skiadefines.h b/src/core/skia/skiadefines.h old mode 100755 new mode 100644 diff --git a/src/core/skia/skiahelpers.cpp b/src/core/skia/skiahelpers.cpp old mode 100755 new mode 100644 diff --git a/src/core/skia/skiahelpers.h b/src/core/skia/skiahelpers.h old mode 100755 new mode 100644 diff --git a/src/core/skia/skiaincludes.h b/src/core/skia/skiaincludes.h old mode 100755 new mode 100644 diff --git a/src/core/skia/skimagecopy.cpp b/src/core/skia/skimagecopy.cpp deleted file mode 100755 index ba78d26c8..000000000 --- a/src/core/skia/skimagecopy.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#include "skimagecopy.h" - diff --git a/src/core/skia/skimagecopy.h b/src/core/skia/skimagecopy.h deleted file mode 100755 index 6d12fd5db..000000000 --- a/src/core/skia/skimagecopy.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -# -# Friction - https://friction.graphics -# -# Copyright (c) Friction contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# See 'README.md' for more information. -# -*/ - -// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner - -#ifndef SKIMAGECOPY_H -#define SKIMAGECOPY_H - - -#endif // SKIMAGECOPY_H diff --git a/src/core/skia/skqtconversions.cpp b/src/core/skia/skqtconversions.cpp old mode 100755 new mode 100644 diff --git a/src/core/skia/skqtconversions.h b/src/core/skia/skqtconversions.h old mode 100755 new mode 100644 diff --git a/src/core/smartPointers/ememory.h b/src/core/smartPointers/ememory.h old mode 100755 new mode 100644 diff --git a/src/core/smartPointers/eobject.h b/src/core/smartPointers/eobject.h old mode 100755 new mode 100644 diff --git a/src/core/smartPointers/selfref.h b/src/core/smartPointers/selfref.h old mode 100755 new mode 100644 diff --git a/src/core/smartPointers/stdpointer.cpp b/src/core/smartPointers/stdpointer.cpp old mode 100755 new mode 100644 diff --git a/src/core/smartPointers/stdpointer.h b/src/core/smartPointers/stdpointer.h old mode 100755 new mode 100644 diff --git a/src/core/smartPointers/stdselfref.cpp b/src/core/smartPointers/stdselfref.cpp old mode 100755 new mode 100644 diff --git a/src/core/smartPointers/stdselfref.h b/src/core/smartPointers/stdselfref.h old mode 100755 new mode 100644 diff --git a/src/core/svgexporter.cpp b/src/core/svgexporter.cpp old mode 100755 new mode 100644 diff --git a/src/core/svgexporter.h b/src/core/svgexporter.h old mode 100755 new mode 100644 diff --git a/src/core/svgexporthelpers.cpp b/src/core/svgexporthelpers.cpp old mode 100755 new mode 100644 diff --git a/src/core/svgexporthelpers.h b/src/core/svgexporthelpers.h old mode 100755 new mode 100644 diff --git a/src/core/svgimporter.cpp b/src/core/svgimporter.cpp old mode 100755 new mode 100644 diff --git a/src/core/svgimporter.h b/src/core/svgimporter.h old mode 100755 new mode 100644 diff --git a/src/core/switchablecontext.cpp b/src/core/switchablecontext.cpp old mode 100755 new mode 100644 diff --git a/src/core/switchablecontext.h b/src/core/switchablecontext.h old mode 100755 new mode 100644 diff --git a/src/core/swt_abstraction.cpp b/src/core/swt_abstraction.cpp old mode 100755 new mode 100644 diff --git a/src/core/swt_abstraction.h b/src/core/swt_abstraction.h old mode 100755 new mode 100644 diff --git a/src/core/swt_rulescollection.cpp b/src/core/swt_rulescollection.cpp old mode 100755 new mode 100644 diff --git a/src/core/swt_rulescollection.h b/src/core/swt_rulescollection.h old mode 100755 new mode 100644 diff --git a/src/core/texteffect.cpp b/src/core/texteffect.cpp old mode 100755 new mode 100644 diff --git a/src/core/texteffect.h b/src/core/texteffect.h old mode 100755 new mode 100644 diff --git a/src/core/texteffectcaller.cpp b/src/core/texteffectcaller.cpp deleted file mode 100755 index 7a1a87e9e..000000000 --- a/src/core/texteffectcaller.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "texteffectcaller.h" - -#include "texteffect.h" -#include "Boxes/textboxrenderdata.h" - - -//void TextEffectCaller::applyToLetter(PathBoxRenderData * const letterData, -// const qreal influence) const { -// if(isZero4Dec(influence)) return; -// const qreal relFrame = letterData->fRelFrame; -// const auto transform = mTransform->getPartialRelTransform(relFrame, influence); -// letterData->fRelTransform *= transform; -// letterData->fTotalTransform *= transform; -//} - -//void TextEffectCaller::apply(TextBoxRenderData * const textData) { -// switch(fTarget) { -// case TextEffectTarget::letters: { -// const auto infls = influenceGuide(textData->fLetters.count()); -// int i = 0; -// for(const auto& letter : textData->fLetters) { -// applyToLetter(letter.get(), infls.getValue(i++)); -// } -// } break; -// case TextEffectTarget::words: { -//// const auto infls = influenceGuide(textData->fWords.count(), -//// textData->fRelFrame); -//// int i = 0; -//// for(const auto& word : textData->fWords) { -//// applyToWord(word.get(), infls.getValue(i++)); -//// } -// } break; -// case TextEffectTarget::lines: { -//// const auto infls = influenceGuide(textData->fLines.count(), -//// textData->fRelFrame); -//// int i = 0; -//// for(const auto& line : textData->fLines) { -//// applyToLine(line.get(), infls.getValue(i++)); -//// } -// } break; -// } -//} - -//QrealSnapshot TextEffectCaller::influenceGuide(const int nTargets) { -// QrealSnapshot result(fAmpl, 1, fAmpl); - -// const qreal first = fCenter - qCeil(fCenter); -// const qreal last = first + nTargets + 2*fFrequency; -// bool up = qRound((fCenter - first)/fFrequency) % 2; -// for(qreal i = first ; i < last; i += fFrequency) { -// qreal baseInfl; -// if(isZero4Dec(fDiminish)) { -// baseInfl = 0; -// } else { -// qreal val; -// if(fDiminish > 0) val = 1 - qAbs(i - fCenter)/fDiminish; -// else val = -qAbs(i - fCenter)/fDiminish; -// baseInfl = qBound(0., val, 1.); -// if(qAbs(fDiminish) < 1) baseInfl *= qAbs(fDiminish); -// } - -// const qreal freqInfl = up ? 1 : 0; -// up = !up; - -// const qreal infl = fMinInfl + (baseInfl*freqInfl)*fRemInfl; -// result.appendKey(i, infl, i, infl, i, infl); -// } -// return result; -//} diff --git a/src/core/texteffectcaller.h b/src/core/texteffectcaller.h deleted file mode 100755 index 506a134eb..000000000 --- a/src/core/texteffectcaller.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef TEXTEFFECTCALLER_H -#define TEXTEFFECTCALLER_H - -//#include "smartPointers/stdselfref.h" -//#include "Animators/qrealsnapshot.h" - -//enum class TextEffectTarget : short { -// letters, words, lines -//}; - -//class TextBoxRenderData; - -//class TextEffectCaller : public StdSelfRef { -// void apply(TextBoxRenderData * const textData); - -// TextEffectTarget fTarget; - -// qreal fAmpl; -// qreal fMinInfl; -// qreal fRemInfl; -// qreal fFrequency; -// qreal fCenter; -// qreal fDiminish; - -//private: -// QrealSnapshot influenceGuide(const int nTargets); -//}; - -#endif // TEXTEFFECTCALLER_H diff --git a/src/core/transformvalues.cpp b/src/core/transformvalues.cpp old mode 100755 new mode 100644 diff --git a/src/core/transformvalues.h b/src/core/transformvalues.h old mode 100755 new mode 100644 diff --git a/src/core/typemenu.cpp b/src/core/typemenu.cpp old mode 100755 new mode 100644 diff --git a/src/core/typemenu.h b/src/core/typemenu.h old mode 100755 new mode 100644 diff --git a/src/core/undoredo.cpp b/src/core/undoredo.cpp old mode 100755 new mode 100644 diff --git a/src/core/undoredo.h b/src/core/undoredo.h old mode 100755 new mode 100644 diff --git a/src/app/videoencoder.cpp b/src/core/videoencoder.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/videoencoder.cpp rename to src/core/videoencoder.cpp diff --git a/src/app/videoencoder.h b/src/core/videoencoder.h old mode 100755 new mode 100644 similarity index 97% rename from src/app/videoencoder.h rename to src/core/videoencoder.h index 1779c77a7..dde378159 --- a/src/app/videoencoder.h +++ b/src/core/videoencoder.h @@ -25,6 +25,9 @@ #ifndef VIDEOENCODER_H #define VIDEOENCODER_H + +#include "core_global.h" + #include #include #include "skia/skiaincludes.h" @@ -33,6 +36,7 @@ #include "framerange.h" #include "CacheHandlers/samples.h" #include "Sound/esoundsettings.h" + extern "C" { #include #include @@ -43,9 +47,10 @@ extern "C" { #include #include } + class SceneFrameContainer; -class SoundIterator { +class CORE_EXPORT SoundIterator { public: SoundIterator() {} @@ -153,7 +158,7 @@ class SoundIterator { QList> mSamples; }; -typedef struct OutputStream { +typedef struct CORE_EXPORT OutputStream { // pts of the next frame that will be generated int64_t fNextPts; @@ -165,7 +170,7 @@ typedef struct OutputStream { struct SwrContext *fSwrCtx = nullptr; } OutputStream; -class VideoEncoderEmitter : public QObject { +class CORE_EXPORT VideoEncoderEmitter : public QObject { Q_OBJECT public: VideoEncoderEmitter() {} @@ -178,7 +183,7 @@ class VideoEncoderEmitter : public QObject { void encodingFailed(); }; -class VideoEncoder : public eHddTask { +class CORE_EXPORT VideoEncoder : public eHddTask { e_OBJECT protected: VideoEncoder(); diff --git a/src/core/wrappedint.cpp b/src/core/wrappedint.cpp old mode 100755 new mode 100644 diff --git a/src/core/wrappedint.h b/src/core/wrappedint.h old mode 100755 new mode 100644 diff --git a/src/core/zipfileloader.cpp b/src/core/zipfileloader.cpp old mode 100755 new mode 100644 diff --git a/src/core/zipfileloader.h b/src/core/zipfileloader.h old mode 100755 new mode 100644 diff --git a/src/core/zipfilesaver.cpp b/src/core/zipfilesaver.cpp old mode 100755 new mode 100644 diff --git a/src/core/zipfilesaver.h b/src/core/zipfilesaver.h old mode 100755 new mode 100644 diff --git a/src/patches/qt/README.md b/src/patches/qt/README.md deleted file mode 100644 index 8fa4e409b..000000000 --- a/src/patches/qt/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Qt 5.12.12 patches - -Patches used in Windows releases of Friction. - diff --git a/src/patches/qt/hidpi.patch b/src/patches/qt/hidpi.patch deleted file mode 100644 index baedfca4b..000000000 --- a/src/patches/qt/hidpi.patch +++ /dev/null @@ -1,2273 +0,0 @@ -From 26a7cc5c8f97c0a4fc38d67fcf46da9648dd4f6d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= -Date: Mon, 25 Apr 2016 09:27:48 +0200 -Subject: [PATCH 37/47] Compute logical DPI on a per-screen basis - -The logical DPI reported to applications is the platform screen -logical DPI divided by the platform screen scale factor. - -Use the screen in question when calculating the DPI instead of -the values from the main screen. - -QHighDpiScaling::logicalDpi now takes a QScreen pointer. - -Done-with: Friedemann Kleint -Task-number: QTBUG-53022 -Change-Id: I0f62b5878c37e3488e9a8cc48aef183ff822d0c4 -Reviewed-by: Friedemann Kleint -(cherry picked from commit dd9da0441b18d1946a7b3d28e4e8819b1921de6f) ---- - src/gui/kernel/qhighdpiscaling.cpp | 20 +++++++++----------- - src/gui/kernel/qhighdpiscaling_p.h | 2 +- - src/gui/kernel/qscreen.cpp | 6 +++--- - 3 files changed, 13 insertions(+), 15 deletions(-) - -diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp -index 64f1397771..95790b96a9 100644 ---- a/src/gui/kernel/qhighdpiscaling.cpp -+++ b/src/gui/kernel/qhighdpiscaling.cpp -@@ -226,7 +226,6 @@ bool QHighDpiScaling::m_usePixelDensity = false; // use scale factor from platfo - bool QHighDpiScaling::m_pixelDensityScalingActive = false; // pixel density scale factor > 1 - bool QHighDpiScaling::m_globalScalingActive = false; // global scale factor is active - bool QHighDpiScaling::m_screenFactorSet = false; // QHighDpiScaling::setScreenFactor has been used --QDpi QHighDpiScaling::m_logicalDpi = QDpi(-1,-1); // The scaled logical DPI of the primary screen - - /* - Initializes the QHighDpiScaling global variables. Called before the -@@ -314,14 +313,6 @@ void QHighDpiScaling::updateHighDpiScaling() - } - } - m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive; -- -- QScreen *primaryScreen = QGuiApplication::primaryScreen(); -- if (!primaryScreen) -- return; -- QPlatformScreen *platformScreen = primaryScreen->handle(); -- qreal sf = screenSubfactor(platformScreen); -- QDpi primaryDpi = platformScreen->logicalDpi(); -- m_logicalDpi = QDpi(primaryDpi.first / sf, primaryDpi.second / sf); - } - - /* -@@ -447,9 +438,16 @@ qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen) - return factor; - } - --QDpi QHighDpiScaling::logicalDpi() -+QDpi QHighDpiScaling::logicalDpi(const QScreen *screen) - { -- return m_logicalDpi; -+ // (Note: m_active test is performed at call site.) -+ if (!screen) -+ return QDpi(96, 96); -+ -+ qreal platformScreenfactor = screenSubfactor(screen->handle()); -+ QDpi platformScreenDpi = screen->handle()->logicalDpi(); -+ return QDpi(platformScreenDpi.first / platformScreenfactor, -+ platformScreenDpi.second / platformScreenfactor); - } - - QHighDpiScaling::ScaleAndOrigin QHighDpiScaling::scaleAndOrigin(const QPlatformScreen *platformScreen, QPoint *nativePosition) -diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h -index 674b737808..e578625305 100644 ---- a/src/gui/kernel/qhighdpiscaling_p.h -+++ b/src/gui/kernel/qhighdpiscaling_p.h -@@ -98,7 +98,7 @@ public: - static QPoint mapPositionToNative(const QPoint &pos, const QPlatformScreen *platformScreen); - static QPoint mapPositionToGlobal(const QPoint &pos, const QPoint &windowGlobalPosition, const QWindow *window); - static QPoint mapPositionFromGlobal(const QPoint &pos, const QPoint &windowGlobalPosition, const QWindow *window); -- static QDpi logicalDpi(); -+ static QDpi logicalDpi(const QScreen *screen); - - private: - static qreal screenSubfactor(const QPlatformScreen *screen); -diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp -index f208eb02be..82ee62e6b4 100644 ---- a/src/gui/kernel/qscreen.cpp -+++ b/src/gui/kernel/qscreen.cpp -@@ -279,7 +279,7 @@ qreal QScreen::logicalDotsPerInchX() const - { - Q_D(const QScreen); - if (QHighDpiScaling::isActive()) -- return QHighDpiScaling::logicalDpi().first; -+ return QHighDpiScaling::logicalDpi(this).first; - return d->logicalDpi.first; - } - -@@ -295,7 +295,7 @@ qreal QScreen::logicalDotsPerInchY() const - { - Q_D(const QScreen); - if (QHighDpiScaling::isActive()) -- return QHighDpiScaling::logicalDpi().second; -+ return QHighDpiScaling::logicalDpi(this).second; - return d->logicalDpi.second; - } - -@@ -314,7 +314,7 @@ qreal QScreen::logicalDotsPerInchY() const - qreal QScreen::logicalDotsPerInch() const - { - Q_D(const QScreen); -- QDpi dpi = QHighDpiScaling::isActive() ? QHighDpiScaling::logicalDpi() : d->logicalDpi; -+ QDpi dpi = QHighDpiScaling::isActive() ? QHighDpiScaling::logicalDpi(this) : d->logicalDpi; - return (dpi.first + dpi.second) * qreal(0.5); - } - --- -2.20.1.windows.1 - -From 328000e223dad2d9cf0f4a8bf9eadeed03303af1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= -Date: Mon, 25 Apr 2016 11:31:34 +0200 -Subject: [PATCH 38/47] Update Dpi and scale factor computation - -Remove pixelScale() in favor of logicalBaseDpi(). Compute scale factor -based on logical DPI and logical base DPI, or optionally based on the -physical DPI. - -Add policies for running the scale factor and adjusting the logical -DPI reported to the application. The policies are set via environment -variables: - - QT_SCALE_FACTOR_ROUNDING_POLICY=Round|Ceil|Floor|RoundPreferFloor|PassThrough - QT_DPI_ADJUSTMENT_POLICY=AdjustDpi|DontAdjustDpi|AdjustUpOnly - QT_USE_PHYSICAL_DPI=0|1 - -Done-with: Friedemann Kleint -Task-number: QTBUG-53022 -Change-Id: I4846f223186df665eb0a9c827eaef0a96d1f458f -Reviewed-by: Friedemann Kleint -(cherry picked from commit 900f2cb6f7070b4d426f3b83787ac489b8a2e827) ---- - src/gui/kernel/qhighdpiscaling.cpp | 234 ++++++++++++++++-- - src/gui/kernel/qhighdpiscaling_p.h | 29 +++ - src/gui/kernel/qplatformscreen.cpp | 14 ++ - src/gui/kernel/qplatformscreen.h | 1 + - .../android/qandroidplatformscreen.cpp | 8 +- - .../android/qandroidplatformscreen.h | 2 +- - src/plugins/platforms/cocoa/qcocoascreen.h | 1 + - .../platforms/windows/qwindowsscreen.cpp | 9 - - .../platforms/windows/qwindowsscreen.h | 2 +- - src/plugins/platforms/xcb/qxcbscreen.cpp | 13 - - src/plugins/platforms/xcb/qxcbscreen.h | 3 +- - tests/manual/highdpi/highdpi.pro | 1 + - 12 files changed, 264 insertions(+), 53 deletions(-) - -diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp -index 95790b96a9..7ffbfbe1e5 100644 ---- a/src/gui/kernel/qhighdpiscaling.cpp -+++ b/src/gui/kernel/qhighdpiscaling.cpp -@@ -46,6 +46,9 @@ - #include - - #include -+#include -+ -+#include - - QT_BEGIN_NAMESPACE - -@@ -56,6 +59,18 @@ static const char legacyDevicePixelEnvVar[] = "QT_DEVICE_PIXEL_RATIO"; - static const char scaleFactorEnvVar[] = "QT_SCALE_FACTOR"; - static const char autoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR"; - static const char screenFactorsEnvVar[] = "QT_SCREEN_SCALE_FACTORS"; -+static const char scaleFactorRoundingPolicyEnvVar[] = "QT_SCALE_FACTOR_ROUNDING_POLICY"; -+static const char dpiAdjustmentPolicyEnvVar[] = "QT_DPI_ADJUSTMENT_POLICY"; -+static const char usePhysicalDpiEnvVar[] = "QT_USE_PHYSICAL_DPI"; -+ -+// Reads and interprets the given environment variable as a bool, -+// returns the default value if not set. -+static bool qEnvironmentVariableAsBool(const char *name, bool defaultValue) -+{ -+ bool ok = false; -+ int value = qEnvironmentVariableIntValue(name, &ok); -+ return ok ? value > 0 : defaultValue; -+} - - static inline qreal initialGlobalScaleFactor() - { -@@ -249,6 +264,191 @@ static inline bool usePixelDensity() - qgetenv(legacyDevicePixelEnvVar).compare("auto", Qt::CaseInsensitive) == 0); - } - -+qreal QHighDpiScaling::rawScaleFactor(const QPlatformScreen *screen) -+{ -+ // Determine if physical DPI should be used -+ static const bool usePhysicalDpi = qEnvironmentVariableAsBool(usePhysicalDpiEnvVar, false); -+ -+ // Calculate scale factor beased on platform screen DPI values -+ qreal factor; -+ QDpi platformBaseDpi = screen->logicalBaseDpi(); -+ if (usePhysicalDpi) { -+ qreal platformPhysicalDpi = screen->screen()->physicalDotsPerInch(); -+ factor = qreal(platformPhysicalDpi) / qreal(platformBaseDpi.first); -+ } else { -+ QDpi platformLogicalDpi = screen->logicalDpi(); -+ factor = qreal(platformLogicalDpi.first) / qreal(platformBaseDpi.first); -+ } -+ -+ return factor; -+} -+ -+template -+struct EnumLookup -+{ -+ const char *name; -+ EnumType value; -+}; -+ -+template -+static bool operator==(const EnumLookup &e1, const EnumLookup &e2) -+{ -+ return qstricmp(e1.name, e2.name) == 0; -+} -+ -+template -+static QByteArray joinEnumValues(const EnumLookup *i1, const EnumLookup *i2) -+{ -+ QByteArray result; -+ for (; i1 < i2; ++i1) { -+ if (!result.isEmpty()) -+ result += QByteArrayLiteral(", "); -+ result += i1->name; -+ } -+ return result; -+} -+ -+using ScaleFactorRoundingPolicyLookup = EnumLookup; -+ -+static const ScaleFactorRoundingPolicyLookup scaleFactorRoundingPolicyLookup[] = -+{ -+ {"Round", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Round}, -+ {"Ceil", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Ceil}, -+ {"Floor", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Floor}, -+ {"RoundPreferFloor", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor}, -+ {"PassThrough", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::PassThrough} -+}; -+ -+static QHighDpiScaling::HighDpiScaleFactorRoundingPolicy -+ lookupScaleFactorRoundingPolicy(const QByteArray &v) -+{ -+ auto end = std::end(scaleFactorRoundingPolicyLookup); -+ auto it = std::find(std::begin(scaleFactorRoundingPolicyLookup), end, -+ ScaleFactorRoundingPolicyLookup{v.constData(), QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Unset}); -+ return it != end ? it->value : QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Unset; -+} -+ -+using DpiAdjustmentPolicyLookup = EnumLookup; -+ -+static const DpiAdjustmentPolicyLookup dpiAdjustmentPolicyLookup[] = -+{ -+ {"AdjustDpi", QHighDpiScaling::DpiAdjustmentPolicy::Enabled}, -+ {"DontAdjustDpi", QHighDpiScaling::DpiAdjustmentPolicy::Disabled}, -+ {"AdjustUpOnly", QHighDpiScaling::DpiAdjustmentPolicy::UpOnly} -+}; -+ -+static QHighDpiScaling::DpiAdjustmentPolicy -+ lookupDpiAdjustmentPolicy(const QByteArray &v) -+{ -+ auto end = std::end(dpiAdjustmentPolicyLookup); -+ auto it = std::find(std::begin(dpiAdjustmentPolicyLookup), end, -+ DpiAdjustmentPolicyLookup{v.constData(), QHighDpiScaling::DpiAdjustmentPolicy::Unset}); -+ return it != end ? it->value : QHighDpiScaling::DpiAdjustmentPolicy::Unset; -+} -+ -+qreal QHighDpiScaling::roundScaleFactor(qreal rawFactor) -+{ -+ // Apply scale factor rounding policy. Using mathematically correct rounding -+ // may not give the most desirable visual results, especially for -+ // critical fractions like .5. In general, rounding down results in visual -+ // sizes that are smaller than the ideal size, and opposite for rounding up. -+ // Rounding down is then preferable since "small UI" is a more acceptable -+ // high-DPI experience than "large UI". -+ static auto scaleFactorRoundingPolicy = HighDpiScaleFactorRoundingPolicy::Unset; -+ -+ // Determine rounding policy -+ if (scaleFactorRoundingPolicy == HighDpiScaleFactorRoundingPolicy::Unset) { -+ // Check environment -+ if (qEnvironmentVariableIsSet(scaleFactorRoundingPolicyEnvVar)) { -+ QByteArray policyText = qgetenv(scaleFactorRoundingPolicyEnvVar); -+ auto policyEnumValue = lookupScaleFactorRoundingPolicy(policyText); -+ if (policyEnumValue != HighDpiScaleFactorRoundingPolicy::Unset) { -+ scaleFactorRoundingPolicy = policyEnumValue; -+ } else { -+ auto values = joinEnumValues(std::begin(scaleFactorRoundingPolicyLookup), -+ std::end(scaleFactorRoundingPolicyLookup)); -+ qWarning("Unknown scale factor rounding policy: %s. Supported values are: %s.", -+ policyText.constData(), values.constData()); -+ } -+ } else { -+ // Set default policy if no environment variable is set. -+ scaleFactorRoundingPolicy = HighDpiScaleFactorRoundingPolicy::RoundPreferFloor; -+ } -+ } -+ -+ // Apply rounding policy. -+ qreal roundedFactor = rawFactor; -+ switch (scaleFactorRoundingPolicy) { -+ case HighDpiScaleFactorRoundingPolicy::Round: -+ roundedFactor = qRound(rawFactor); -+ break; -+ case HighDpiScaleFactorRoundingPolicy::Ceil: -+ roundedFactor = qCeil(rawFactor); -+ break; -+ case HighDpiScaleFactorRoundingPolicy::Floor: -+ roundedFactor = qFloor(rawFactor); -+ break; -+ case HighDpiScaleFactorRoundingPolicy::RoundPreferFloor: -+ // Round up for .75 and higher. This favors "small UI" over "large UI". -+ roundedFactor = rawFactor - qFloor(rawFactor) < 0.75 -+ ? qFloor(rawFactor) : qCeil(rawFactor); -+ break; -+ case HighDpiScaleFactorRoundingPolicy::PassThrough: -+ case HighDpiScaleFactorRoundingPolicy::Unset: -+ break; -+ } -+ -+ // Don't round down to to zero; clamp the minimum (rounded) factor to 1. -+ // This is not a common case but can happen if a display reports a very -+ // low DPI. -+ if (scaleFactorRoundingPolicy != HighDpiScaleFactorRoundingPolicy::PassThrough) -+ roundedFactor = qMax(roundedFactor, qreal(1)); -+ -+ return roundedFactor; -+} -+ -+QDpi QHighDpiScaling::effectiveLogicalDpi(const QPlatformScreen *screen, qreal rawFactor, qreal roundedFactor) -+{ -+ // Apply DPI adjustment policy, if needed. If enabled this will change the -+ // reported logical DPI to account for the difference between the rounded -+ // scale factor and the actual scale factor. The effect is that text size -+ // will be correct for the screen dpi, but may be (slightly) out of sync -+ // with the rest of the UI. The amount of out-of-synch-ness depends on how -+ // well user code handles a non-standard DPI values, but since the -+ // adjustment is small (typically +/- 48 max) this might be OK. -+ static auto dpiAdjustmentPolicy = DpiAdjustmentPolicy::Unset; -+ -+ // Determine adjustment policy. -+ if (dpiAdjustmentPolicy == DpiAdjustmentPolicy::Unset) { -+ if (qEnvironmentVariableIsSet(dpiAdjustmentPolicyEnvVar)) { -+ QByteArray policyText = qgetenv(dpiAdjustmentPolicyEnvVar); -+ auto policyEnumValue = lookupDpiAdjustmentPolicy(policyText); -+ if (policyEnumValue != DpiAdjustmentPolicy::Unset) { -+ dpiAdjustmentPolicy = policyEnumValue; -+ } else { -+ auto values = joinEnumValues(std::begin(dpiAdjustmentPolicyLookup), -+ std::end(dpiAdjustmentPolicyLookup)); -+ qWarning("Unknown DPI adjustment policy: %s. Supported values are: %s.", -+ policyText.constData(), values.constData()); -+ } -+ } -+ if (dpiAdjustmentPolicy == DpiAdjustmentPolicy::Unset) -+ dpiAdjustmentPolicy = DpiAdjustmentPolicy::UpOnly; -+ } -+ -+ // Apply adjustment policy. -+ const QDpi baseDpi = screen->logicalBaseDpi(); -+ const qreal dpiAdjustmentFactor = rawFactor / roundedFactor; -+ -+ // Return the base DPI for cases where there is no adjustment -+ if (dpiAdjustmentPolicy == DpiAdjustmentPolicy::Disabled) -+ return baseDpi; -+ if (dpiAdjustmentPolicy == DpiAdjustmentPolicy::UpOnly && dpiAdjustmentFactor < 1) -+ return baseDpi; -+ -+ return QDpi(baseDpi.first * dpiAdjustmentFactor, baseDpi.second * dpiAdjustmentFactor); -+} -+ - void QHighDpiScaling::initHighDpiScaling() - { - // Determine if there is a global scale factor set. -@@ -259,8 +459,6 @@ void QHighDpiScaling::initHighDpiScaling() - - m_pixelDensityScalingActive = false; //set in updateHighDpiScaling below - -- // we update m_active in updateHighDpiScaling, but while we create the -- // screens, we have to assume that m_usePixelDensity implies scaling - m_active = m_globalScalingActive || m_usePixelDensity; - } - -@@ -312,7 +510,7 @@ void QHighDpiScaling::updateHighDpiScaling() - ++i; - } - } -- m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive; -+ m_active = m_globalScalingActive || m_usePixelDensity; - } - - /* -@@ -413,22 +611,8 @@ qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen) - { - qreal factor = qreal(1.0); - if (screen) { -- if (m_usePixelDensity) { -- qreal pixelDensity = screen->pixelDensity(); -- -- // Pixel density reported by the screen is sometimes not precise enough, -- // so recalculate it: divide px (physical pixels) by dp (device-independent pixels) -- // for both width and height, and then use the average if it is different from -- // the one initially reported by the screen -- QRect screenGeometry = screen->geometry(); -- qreal wFactor = qreal(screenGeometry.width()) / qRound(screenGeometry.width() / pixelDensity); -- qreal hFactor = qreal(screenGeometry.height()) / qRound(screenGeometry.height() / pixelDensity); -- qreal averageDensity = (wFactor + hFactor) / 2; -- if (!qFuzzyCompare(pixelDensity, averageDensity)) -- pixelDensity = averageDensity; -- -- factor *= pixelDensity; -- } -+ if (m_usePixelDensity) -+ factor *= roundScaleFactor(rawScaleFactor(screen)); - if (m_screenFactorSet) { - QVariant screenFactor = screen->screen()->property(scaleFactorProperty); - if (screenFactor.isValid()) -@@ -441,13 +625,15 @@ qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen) - QDpi QHighDpiScaling::logicalDpi(const QScreen *screen) - { - // (Note: m_active test is performed at call site.) -- if (!screen) -+ if (!screen || !screen->handle()) - return QDpi(96, 96); - -- qreal platformScreenfactor = screenSubfactor(screen->handle()); -- QDpi platformScreenDpi = screen->handle()->logicalDpi(); -- return QDpi(platformScreenDpi.first / platformScreenfactor, -- platformScreenDpi.second / platformScreenfactor); -+ if (!m_usePixelDensity) -+ return screen->handle()->logicalDpi(); -+ -+ const qreal scaleFactor = rawScaleFactor(screen->handle()); -+ const qreal roundedScaleFactor = roundScaleFactor(scaleFactor); -+ return effectiveLogicalDpi(screen->handle(), scaleFactor, roundedScaleFactor); - } - - QHighDpiScaling::ScaleAndOrigin QHighDpiScaling::scaleAndOrigin(const QPlatformScreen *platformScreen, QPoint *nativePosition) -diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h -index e578625305..e24628a69a 100644 ---- a/src/gui/kernel/qhighdpiscaling_p.h -+++ b/src/gui/kernel/qhighdpiscaling_p.h -@@ -72,7 +72,33 @@ typedef QPair QDpi; - - #ifndef QT_NO_HIGHDPISCALING - class Q_GUI_EXPORT QHighDpiScaling { -+ Q_GADGET - public: -+ enum class HighDpiScaleFactorRoundingPolicy { -+ Unset, -+ Round, -+ Ceil, -+ Floor, -+ RoundPreferFloor, -+ PassThrough -+ }; -+ Q_ENUM(HighDpiScaleFactorRoundingPolicy) -+ -+ enum class DpiAdjustmentPolicy { -+ Unset, -+ Enabled, -+ Disabled, -+ UpOnly -+ }; -+ Q_ENUM(DpiAdjustmentPolicy) -+ -+ QHighDpiScaling() = delete; -+ ~QHighDpiScaling() = delete; -+ QHighDpiScaling(const QHighDpiScaling &) = delete; -+ QHighDpiScaling &operator=(const QHighDpiScaling &) = delete; -+ QHighDpiScaling(QHighDpiScaling &&) = delete; -+ QHighDpiScaling &operator=(QHighDpiScaling &&) = delete; -+ - static void initHighDpiScaling(); - static void updateHighDpiScaling(); - static void setGlobalFactor(qreal factor); -@@ -101,6 +127,9 @@ public: - static QDpi logicalDpi(const QScreen *screen); - - private: -+ static qreal rawScaleFactor(const QPlatformScreen *screen); -+ static qreal roundScaleFactor(qreal rawFactor); -+ static QDpi effectiveLogicalDpi(const QPlatformScreen *screen, qreal rawFactor, qreal roundedFactor); - static qreal screenSubfactor(const QPlatformScreen *screen); - - static qreal m_factor; -diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp -index 21ae75ba8f..ff76528a0e 100644 ---- a/src/gui/kernel/qplatformscreen.cpp -+++ b/src/gui/kernel/qplatformscreen.cpp -@@ -197,6 +197,20 @@ QDpi QPlatformScreen::logicalDpi() const - 25.4 * s.height() / ps.height()); - } - -+/*! -+ Reimplement to return the base logical DPI for the platform. This -+ DPI value should correspond to a standard-DPI (1x) display. The -+ default implementation returns 96. -+ -+ QtGui will use this value (together with logicalDpi) to compute -+ the scale factor when high-DPI scaling is enabled: -+ factor = logicalDPI / baseDPI -+*/ -+QDpi QPlatformScreen::logicalBaseDpi() const -+{ -+ return QDpi(96, 96); -+} -+ - /*! - Reimplement this function in subclass to return the device pixel ratio - for the screen. This is the ratio between physical pixels and the -diff --git a/src/gui/kernel/qplatformscreen.h b/src/gui/kernel/qplatformscreen.h -index e9d64c8a29..63b5d5a4a7 100644 ---- a/src/gui/kernel/qplatformscreen.h -+++ b/src/gui/kernel/qplatformscreen.h -@@ -113,6 +113,7 @@ public: - - virtual QSizeF physicalSize() const; - virtual QDpi logicalDpi() const; -+ virtual QDpi logicalBaseDpi() const; - virtual qreal devicePixelRatio() const; - virtual qreal pixelDensity() const; - -diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp -index 7dc8bb8080..80757c2135 100644 ---- a/src/plugins/platforms/android/qandroidplatformscreen.cpp -+++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp -@@ -401,15 +401,17 @@ void QAndroidPlatformScreen::doRedraw() - m_dirtyRect = QRect(); - } - -+static const int androidLogicalDpi = 72; -+ - QDpi QAndroidPlatformScreen::logicalDpi() const - { -- qreal lDpi = QtAndroid::scaledDensity() * 72; -+ qreal lDpi = QtAndroid::scaledDensity() * androidLogicalDpi; - return QDpi(lDpi, lDpi); - } - --qreal QAndroidPlatformScreen::pixelDensity() const -+QDpi QAndroidPlatformScreen::logicalBaseDpi() const - { -- return QtAndroid::pixelDensity(); -+ return QDpi(androidLogicalDpi, androidLogicalDpi); - } - - Qt::ScreenOrientation QAndroidPlatformScreen::orientation() const -diff --git a/src/plugins/platforms/android/qandroidplatformscreen.h b/src/plugins/platforms/android/qandroidplatformscreen.h -index f15aeae3fd..5dc158e351 100644 ---- a/src/plugins/platforms/android/qandroidplatformscreen.h -+++ b/src/plugins/platforms/android/qandroidplatformscreen.h -@@ -103,7 +103,7 @@ protected: - - private: - QDpi logicalDpi() const override; -- qreal pixelDensity() const override; -+ QDpi logicalBaseDpi() const override; - Qt::ScreenOrientation orientation() const override; - Qt::ScreenOrientation nativeOrientation() const override; - void surfaceChanged(JNIEnv *env, jobject surface, int w, int h) override; -diff --git a/src/plugins/platforms/cocoa/qcocoascreen.h b/src/plugins/platforms/cocoa/qcocoascreen.h -index 9ded98df32..a73b97c771 100644 ---- a/src/plugins/platforms/cocoa/qcocoascreen.h -+++ b/src/plugins/platforms/cocoa/qcocoascreen.h -@@ -64,6 +64,7 @@ public: - qreal devicePixelRatio() const override; - QSizeF physicalSize() const override { return m_physicalSize; } - QDpi logicalDpi() const override { return m_logicalDpi; } -+ QDpi logicalBaseDpi() const override { return m_logicalDpi; } - qreal refreshRate() const override { return m_refreshRate; } - QString name() const override { return m_name; } - QPlatformCursor *cursor() const override { return m_cursor; } -diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp -index 46e107d75e..88881e9cab 100644 ---- a/src/plugins/platforms/windows/qwindowsscreen.cpp -+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp -@@ -257,15 +257,6 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags) - return result; - } - --qreal QWindowsScreen::pixelDensity() const --{ -- // QTBUG-49195: Use logical DPI instead of physical DPI to calculate -- // the pixel density since it is reflects the Windows UI scaling. -- // High DPI auto scaling should be disabled when the user chooses -- // small fonts on a High DPI monitor, resulting in lower logical DPI. -- return qMax(1, qRound(logicalDpi().first / 96)); --} -- - /*! - \brief Determine siblings in a virtual desktop system. - -diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h -index 3eb2d35b27..c3cb87d3b7 100644 ---- a/src/plugins/platforms/windows/qwindowsscreen.h -+++ b/src/plugins/platforms/windows/qwindowsscreen.h -@@ -87,7 +87,7 @@ public: - QImage::Format format() const override { return m_data.format; } - QSizeF physicalSize() const override { return m_data.physicalSizeMM; } - QDpi logicalDpi() const override { return m_data.dpi; } -- qreal pixelDensity() const override; -+ QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; - qreal devicePixelRatio() const override { return 1.0; } - qreal refreshRate() const override { return m_data.refreshRateHz; } - QString name() const override { return m_data.name; } -diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp -index 39e83e0451..ab5faa7212 100644 ---- a/src/plugins/platforms/xcb/qxcbscreen.cpp -+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp -@@ -679,11 +679,6 @@ QDpi QXcbScreen::logicalDpi() const - return m_virtualDesktop->dpi(); - } - --qreal QXcbScreen::pixelDensity() const --{ -- return m_pixelDensity; --} -- - QPlatformCursor *QXcbScreen::cursor() const - { - return m_cursor; -@@ -747,14 +742,6 @@ void QXcbScreen::updateGeometry(const QRect &geometry, uint8_t rotation) - if (m_sizeMillimeters.isEmpty()) - m_sizeMillimeters = sizeInMillimeters(geometry.size(), m_virtualDesktop->dpi()); - -- qreal dpi = forcedDpi(); -- if (dpi <= 0) -- dpi = geometry.width() / physicalSize().width() * qreal(25.4); -- -- // Use 128 as a reference DPI on small screens. This favors "small UI" over "large UI". -- qreal referenceDpi = physicalSize().width() <= 320 ? 128 : 96; -- -- m_pixelDensity = qMax(1, qRound(dpi/referenceDpi)); - m_geometry = geometry; - m_availableGeometry = geometry & m_virtualDesktop->workArea(); - QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry); -diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h -index ec3b07bfb7..62931d2500 100644 ---- a/src/plugins/platforms/xcb/qxcbscreen.h -+++ b/src/plugins/platforms/xcb/qxcbscreen.h -@@ -161,7 +161,7 @@ public: - QImage::Format format() const override; - QSizeF physicalSize() const override { return m_sizeMillimeters; } - QDpi logicalDpi() const override; -- qreal pixelDensity() const override; -+ QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; - QPlatformCursor *cursor() const override; - qreal refreshRate() const override { return m_refreshRate; } - Qt::ScreenOrientation orientation() const override { return m_orientation; } -@@ -227,7 +227,6 @@ private: - Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; - QXcbCursor *m_cursor; - int m_refreshRate = 60; -- int m_pixelDensity = 1; - QEdidParser m_edid; - }; - -diff --git a/tests/manual/highdpi/highdpi.pro b/tests/manual/highdpi/highdpi.pro -index 9db083cd82..2de8ed3bb5 100644 ---- a/tests/manual/highdpi/highdpi.pro -+++ b/tests/manual/highdpi/highdpi.pro -@@ -15,3 +15,4 @@ HEADERS += \ - RESOURCES += \ - highdpi.qrc - -+DEFINES += HAVE_SCREEN_BASE_DPI --- -2.20.1.windows.1 - -From a1f512aa3c0b32c597661aba5561541113144dc9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= -Date: Thu, 2 Jun 2016 09:52:21 +0200 -Subject: [PATCH 39/47] Move QT_FONT_DPI to cross-platform code - -This makes it possible to test the effects of setting -Qt::AA_HighDpiScaling/QT_AUTO_SCREEN_SCALE_FACTOR, with different DPI -values on all platforms. - -This also makes it possible to access the actual DPI values reported -by the OS/WS via the QPlatformScreen API. - -A drawback is that there is no single place to check the environment -variable; currently done in three places. This may be -further simplified later on. - -Done-with: Friedemann Kleint -Task-number: QTBUG-53022 -Change-Id: Idd6463219d3ae58fe0ab72c17686cce2eb9dbadd -Reviewed-by: Friedemann Kleint -(cherry picked from commit 70a893e9bee7c1b8994a1218038a302e406d0aa3) ---- - src/gui/kernel/qhighdpiscaling.cpp | 4 ++-- - src/gui/kernel/qplatformscreen.cpp | 8 ++++++++ - src/gui/kernel/qplatformscreen.h | 2 ++ - src/gui/kernel/qscreen.cpp | 7 +++++-- - src/gui/kernel/qwindowsysteminterface.cpp | 4 ++-- - src/plugins/platforms/xcb/qxcbscreen.cpp | 4 ---- - 6 files changed, 19 insertions(+), 10 deletions(-) - -diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp -index 7ffbfbe1e5..c8a2634929 100644 ---- a/src/gui/kernel/qhighdpiscaling.cpp -+++ b/src/gui/kernel/qhighdpiscaling.cpp -@@ -276,7 +276,7 @@ qreal QHighDpiScaling::rawScaleFactor(const QPlatformScreen *screen) - qreal platformPhysicalDpi = screen->screen()->physicalDotsPerInch(); - factor = qreal(platformPhysicalDpi) / qreal(platformBaseDpi.first); - } else { -- QDpi platformLogicalDpi = screen->logicalDpi(); -+ const QDpi platformLogicalDpi = QPlatformScreen::overrideDpi(screen->logicalDpi()); - factor = qreal(platformLogicalDpi.first) / qreal(platformBaseDpi.first); - } - -@@ -629,7 +629,7 @@ QDpi QHighDpiScaling::logicalDpi(const QScreen *screen) - return QDpi(96, 96); - - if (!m_usePixelDensity) -- return screen->handle()->logicalDpi(); -+ return QPlatformScreen::overrideDpi(screen->handle()->logicalDpi()); - - const qreal scaleFactor = rawScaleFactor(screen->handle()); - const qreal roundedScaleFactor = roundScaleFactor(scaleFactor); -diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp -index ff76528a0e..9e684c9fbf 100644 ---- a/src/gui/kernel/qplatformscreen.cpp -+++ b/src/gui/kernel/qplatformscreen.cpp -@@ -197,6 +197,14 @@ QDpi QPlatformScreen::logicalDpi() const - 25.4 * s.height() / ps.height()); - } - -+// Helper function for accessing the platform screen logical dpi -+// which accounts for QT_FONT_DPI. -+QPair QPlatformScreen::overrideDpi(const QPair &in) -+{ -+ static const int overrideDpi = qEnvironmentVariableIntValue("QT_FONT_DPI"); -+ return overrideDpi > 0 ? QDpi(overrideDpi, overrideDpi) : in; -+} -+ - /*! - Reimplement to return the base logical DPI for the platform. This - DPI value should correspond to a standard-DPI (1x) display. The -diff --git a/src/gui/kernel/qplatformscreen.h b/src/gui/kernel/qplatformscreen.h -index 63b5d5a4a7..32e6bf7ec7 100644 ---- a/src/gui/kernel/qplatformscreen.h -+++ b/src/gui/kernel/qplatformscreen.h -@@ -159,6 +159,8 @@ public: - // The platform screen's geometry in device independent coordinates - QRect deviceIndependentGeometry() const; - -+ static QDpi overrideDpi(const QDpi &in); -+ - protected: - void resizeMaximizedWindows(); - -diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp -index 82ee62e6b4..b856435f67 100644 ---- a/src/gui/kernel/qscreen.cpp -+++ b/src/gui/kernel/qscreen.cpp -@@ -84,8 +84,11 @@ void QScreenPrivate::setPlatformScreen(QPlatformScreen *screen) - platformScreen->d_func()->screen = q; - orientation = platformScreen->orientation(); - geometry = platformScreen->deviceIndependentGeometry(); -- availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), QHighDpiScaling::factor(platformScreen), geometry.topLeft()); -- logicalDpi = platformScreen->logicalDpi(); -+ availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), -+ QHighDpiScaling::factor(platformScreen), geometry.topLeft()); -+ -+ logicalDpi = QPlatformScreen::overrideDpi(platformScreen->logicalDpi()); -+ - refreshRate = platformScreen->refreshRate(); - // safeguard ourselves against buggy platform behavior... - if (refreshRate < 1.0) -diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp -index 5caf4802a0..7ce0e6b0ef 100644 ---- a/src/gui/kernel/qwindowsysteminterface.cpp -+++ b/src/gui/kernel/qwindowsysteminterface.cpp -@@ -871,8 +871,8 @@ void QWindowSystemInterface::handleScreenGeometryChange(QScreen *screen, const Q - - void QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QScreen *screen, qreal dpiX, qreal dpiY) - { -- QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e = -- new QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent(screen, dpiX, dpiY); // ### tja -+ const QDpi effectiveDpi = QPlatformScreen::overrideDpi(QDpi{dpiX, dpiY}); -+ auto e = new QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent(screen, effectiveDpi.first, effectiveDpi.second); - QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); - } - -diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp -index ab5faa7212..ccd1a672bc 100644 ---- a/src/plugins/platforms/xcb/qxcbscreen.cpp -+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp -@@ -660,10 +660,6 @@ QImage::Format QXcbScreen::format() const - - int QXcbScreen::forcedDpi() const - { -- static const int overrideDpi = qEnvironmentVariableIntValue("QT_FONT_DPI"); -- if (overrideDpi) -- return overrideDpi; -- - const int forcedDpi = m_virtualDesktop->forcedDpi(); - if (forcedDpi > 0) - return forcedDpi; --- -2.20.1.windows.1 - -From f2b8beb68acb5acedc418c7c140d964a4c5df6f7 Mon Sep 17 00:00:00 2001 -From: Friedemann Kleint -Date: Wed, 27 Feb 2019 08:46:47 +0100 -Subject: [PATCH 40/47] Update QT_SCREEN_SCALE_FACTORS -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Store name->factor associations in a global QHash instead of on the -QScreen object, making them survive QScreen object deletion, for -example on disconnect/ connect cycles. - -Make factors set with QT_SCREEN_SCALE_FACTORS override the screen -factors computed from platform plugin DPI values. This matches the use -case for QT_SCREEN_SCALE_FACTORS (but not the general scale factors -combine by multiplication”principle) - -Done-with: Friedemann Kleint -Task-number: QTBUG-53022 -Change-Id: I12771249314ab0c073e609d62f57ac0d18d3b6ce -Reviewed-by: Friedemann Kleint -(cherry picked from commit 35da4eeba263db411d929fd278a4617dd7cf5c22) ---- - src/gui/kernel/qhighdpiscaling.cpp | 61 ++++++++++++++++++++++-------- - src/gui/kernel/qhighdpiscaling_p.h | 2 +- - 2 files changed, 46 insertions(+), 17 deletions(-) - -diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp -index c8a2634929..3de67d5cfa 100644 ---- a/src/gui/kernel/qhighdpiscaling.cpp -+++ b/src/gui/kernel/qhighdpiscaling.cpp -@@ -63,6 +63,12 @@ static const char scaleFactorRoundingPolicyEnvVar[] = "QT_SCALE_FACTOR_ROUNDING_ - static const char dpiAdjustmentPolicyEnvVar[] = "QT_DPI_ADJUSTMENT_POLICY"; - static const char usePhysicalDpiEnvVar[] = "QT_USE_PHYSICAL_DPI"; - -+// Per-screen scale factors for named screens set with QT_SCREEN_SCALE_FACTORS -+// are stored here. Use a global hash to keep the factor across screen -+// disconnect/connect cycles where the screen object may be deleted. -+typedef QHash QScreenScaleFactorHash; -+Q_GLOBAL_STATIC(QScreenScaleFactorHash, qNamedScreenScaleFactors); -+ - // Reads and interprets the given environment variable as a bool, - // returns the default value if not set. - static bool qEnvironmentVariableAsBool(const char *name, bool defaultValue) -@@ -480,20 +486,19 @@ void QHighDpiScaling::updateHighDpiScaling() - int i = 0; - const auto specs = qgetenv(screenFactorsEnvVar).split(';'); - for (const QByteArray &spec : specs) { -- QScreen *screen = 0; - int equalsPos = spec.lastIndexOf('='); -- double factor = 0; -+ qreal factor = 0; - if (equalsPos > 0) { - // support "name=factor" - QByteArray name = spec.mid(0, equalsPos); - QByteArray f = spec.mid(equalsPos + 1); - bool ok; - factor = f.toDouble(&ok); -- if (ok) { -+ if (ok && factor > 0 ) { - const auto screens = QGuiApplication::screens(); - for (QScreen *s : screens) { - if (s->name() == QString::fromLocal8Bit(name)) { -- screen = s; -+ setScreenFactor(s, factor); - break; - } - } -@@ -502,11 +507,11 @@ void QHighDpiScaling::updateHighDpiScaling() - // listing screens in order - bool ok; - factor = spec.toDouble(&ok); -- if (ok && i < QGuiApplication::screens().count()) -- screen = QGuiApplication::screens().at(i); -+ if (ok && factor > 0 && i < QGuiApplication::screens().count()) { -+ QScreen *screen = QGuiApplication::screens().at(i); -+ setScreenFactor(screen, factor); -+ } - } -- if (screen) -- setScreenFactor(screen, factor); - ++i; - } - } -@@ -542,7 +547,14 @@ void QHighDpiScaling::setScreenFactor(QScreen *screen, qreal factor) - m_screenFactorSet = true; - m_active = true; - } -- screen->setProperty(scaleFactorProperty, QVariant(factor)); -+ -+ // Prefer associating the factor with screen name over the object -+ // since the screen object may be deleted on screen disconnects. -+ const QString name = screen->name(); -+ if (name.isEmpty()) -+ screen->setProperty(scaleFactorProperty, QVariant(factor)); -+ else -+ qNamedScreenScaleFactors()->insert(name, factor); - - // hack to force re-evaluation of screen geometry - if (screen->handle()) -@@ -610,15 +622,32 @@ QPoint QHighDpiScaling::mapPositionFromGlobal(const QPoint &pos, const QPoint &w - qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen) - { - qreal factor = qreal(1.0); -- if (screen) { -- if (m_usePixelDensity) -- factor *= roundScaleFactor(rawScaleFactor(screen)); -- if (m_screenFactorSet) { -- QVariant screenFactor = screen->screen()->property(scaleFactorProperty); -- if (screenFactor.isValid()) -- factor *= screenFactor.toReal(); -+ if (!screen) -+ return factor; -+ -+ // Unlike the other code where factors are combined by multiplication, -+ // factors from QT_SCREEN_SCALE_FACTORS takes precedence over the factor -+ // computed from platform plugin DPI. The rationale is that the user is -+ // setting the factor to override erroneous DPI values. -+ bool screenPropertyUsed = false; -+ if (m_screenFactorSet) { -+ // Check if there is a factor set on the screen object or associated -+ // with the screen name. These are mutually exclusive, so checking -+ // order is not significant. -+ QVariant byIndex = screen->screen()->property(scaleFactorProperty); -+ auto byNameIt = qNamedScreenScaleFactors()->constFind(screen->name()); -+ if (byIndex.isValid()) { -+ screenPropertyUsed = true; -+ factor = byIndex.toReal(); -+ } else if (byNameIt != qNamedScreenScaleFactors()->cend()) { -+ screenPropertyUsed = true; -+ factor = *byNameIt; - } - } -+ -+ if (!screenPropertyUsed && m_usePixelDensity) -+ factor = roundScaleFactor(rawScaleFactor(screen)); -+ - return factor; - } - -diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h -index e24628a69a..9c24fa506d 100644 ---- a/src/gui/kernel/qhighdpiscaling_p.h -+++ b/src/gui/kernel/qhighdpiscaling_p.h -@@ -102,7 +102,7 @@ public: - static void initHighDpiScaling(); - static void updateHighDpiScaling(); - static void setGlobalFactor(qreal factor); -- static void setScreenFactor(QScreen *window, qreal factor); -+ static void setScreenFactor(QScreen *screen, qreal factor); - - static bool isActive() { return m_active; } - --- -2.20.1.windows.1 - -From 1f0d4dcf4688864c3313ca4ec512d4094e58ad32 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= -Date: Thu, 10 Nov 2016 14:17:53 +0100 -Subject: [PATCH 41/47] Deprecate QT_AUTO_SCREEN_SCALE_FACTOR -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Replace by QT_ENABLE_HIGHDPI_SCALING. - -QT_AUTO_SCREEN_SCALE_FACTOR has the usability problem that it mixes -enabling the high-DPI scaling mode with the method of getting screen -scale factors (“auto”). Due to this, it ends up with a slightly -strange name. - -QT_ENABLE_HIGHDPI_SCALING matches the C++ option -(Qt::AA_EnableHighDPiScaling), and leaves the scale factor acquisition -method unspecified, possibly to be set by some other means (like -QT_SCREEN_SCALE_FACTORS). - -Done-with: Friedemann Kleint -Task-number: QTBUG-53022 -Change-Id: I30033d91175a00db7837efc9c48c33396f5f0449 -Reviewed-by: Friedemann Kleint -(cherry picked from commit 1de8b01d2b6db8a4fe2eddd0c595d9e680964db5) ---- - src/gui/kernel/qhighdpiscaling.cpp | 29 +++++++++++++++++++++++------ - 1 file changed, 23 insertions(+), 6 deletions(-) - -diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp -index 3de67d5cfa..4a9c9a9934 100644 ---- a/src/gui/kernel/qhighdpiscaling.cpp -+++ b/src/gui/kernel/qhighdpiscaling.cpp -@@ -56,8 +56,10 @@ Q_LOGGING_CATEGORY(lcScaling, "qt.scaling"); - - #ifndef QT_NO_HIGHDPISCALING - static const char legacyDevicePixelEnvVar[] = "QT_DEVICE_PIXEL_RATIO"; -+static const char legacyAutoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR"; -+ -+static const char enableHighDpiScalingEnvVar[] = "QT_ENABLE_HIGHDPI_SCALING"; - static const char scaleFactorEnvVar[] = "QT_SCALE_FACTOR"; --static const char autoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR"; - static const char screenFactorsEnvVar[] = "QT_SCREEN_SCALE_FACTORS"; - static const char scaleFactorRoundingPolicyEnvVar[] = "QT_SCALE_FACTOR_ROUNDING_POLICY"; - static const char dpiAdjustmentPolicyEnvVar[] = "QT_DPI_ADJUSTMENT_POLICY"; -@@ -90,17 +92,24 @@ static inline qreal initialGlobalScaleFactor() - result = f; - } - } else { -+ // Check for deprecated environment variables. - if (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar)) { - qWarning("Warning: %s is deprecated. Instead use:\n" - " %s to enable platform plugin controlled per-screen factors.\n" -- " %s to set per-screen factors.\n" -+ " %s to set per-screen DPI.\n" - " %s to set the application global scale factor.", -- legacyDevicePixelEnvVar, autoScreenEnvVar, screenFactorsEnvVar, scaleFactorEnvVar); -+ legacyDevicePixelEnvVar, legacyAutoScreenEnvVar, screenFactorsEnvVar, scaleFactorEnvVar); - - int dpr = qEnvironmentVariableIntValue(legacyDevicePixelEnvVar); - if (dpr > 0) - result = dpr; - } -+ -+ if (qEnvironmentVariableIsSet(legacyAutoScreenEnvVar)) { -+ qWarning("Warning: %s is deprecated. Instead use:\n" -+ " %s to enable platform plugin controlled per-screen factors.", -+ legacyAutoScreenEnvVar, enableHighDpiScalingEnvVar); -+ } - } - return result; - } -@@ -258,16 +267,24 @@ static inline bool usePixelDensity() - // Determine if we should set a scale factor based on the pixel density - // reported by the platform plugin. There are several enablers and several - // disablers. A single disable may veto all other enablers. -+ -+ // First, check of there is an explicit disable. - if (QCoreApplication::testAttribute(Qt::AA_DisableHighDpiScaling)) - return false; - bool screenEnvValueOk; -- const int screenEnvValue = qEnvironmentVariableIntValue(autoScreenEnvVar, &screenEnvValueOk); -+ const int screenEnvValue = qEnvironmentVariableIntValue(legacyAutoScreenEnvVar, &screenEnvValueOk); - if (screenEnvValueOk && screenEnvValue < 1) - return false; -+ bool enableEnvValueOk; -+ const int enableEnvValue = qEnvironmentVariableIntValue(enableHighDpiScalingEnvVar, &enableEnvValueOk); -+ if (enableEnvValueOk && enableEnvValue < 1) -+ return false; -+ -+ // Then return if there was an enable. - return QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling) - || (screenEnvValueOk && screenEnvValue > 0) -- || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) && -- qgetenv(legacyDevicePixelEnvVar).compare("auto", Qt::CaseInsensitive) == 0); -+ || (enableEnvValueOk && enableEnvValue > 0) -+ || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) && qgetenv(legacyDevicePixelEnvVar).toLower() == "auto"); - } - - qreal QHighDpiScaling::rawScaleFactor(const QPlatformScreen *screen) --- -2.20.1.windows.1 - -From befc66fd17772478fbb1212831dba86048e707ac Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= -Date: Sat, 7 Oct 2017 01:35:29 +0200 -Subject: [PATCH 42/47] Add high-DPI scale factor rounding policy C++ API - -This API enables tuning of how Qt rounds fractional scale factors, and -corresponds to the QT_SCALE_FACTOR_ROUNDING_POLICY environment -variable - -New API: - Qt::HighDPiScaleFactorRoundingPolicy - QGuiApplication::setHighDpiScaleFactorRoundingPolicy() - QGuiApplication::highDpiScaleFactorRoundingPolicy() - -Done-with: Friedemann Kleint -Task-number: QTBUG-53022 -Change-Id: Ic360f26a173caa757e4ebde35ce08a6b74290b7d -Reviewed-by: Friedemann Kleint -(cherry picked from commit f1e40dd6d6968c59885231f61f94787abd4cf783) ---- - src/corelib/global/qnamespace.h | 10 +++++++ - src/corelib/global/qnamespace.qdoc | 22 ++++++++++++++ - src/gui/kernel/qguiapplication.cpp | 44 ++++++++++++++++++++++++++++ - src/gui/kernel/qguiapplication.h | 3 ++ - src/gui/kernel/qguiapplication_p.h | 1 + - src/gui/kernel/qhighdpiscaling.cpp | 47 +++++++++++++++++------------- - src/gui/kernel/qhighdpiscaling_p.h | 10 ------- - 7 files changed, 106 insertions(+), 31 deletions(-) - -diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h -index 3ab9921986..423c9b4a5b 100644 ---- a/src/corelib/global/qnamespace.h -+++ b/src/corelib/global/qnamespace.h -@@ -1728,6 +1728,15 @@ public: - ChecksumItuV41 - }; - -+ enum class HighDpiScaleFactorRoundingPolicy { -+ Unset, -+ Round, -+ Ceil, -+ Floor, -+ RoundPreferFloor, -+ PassThrough -+ }; -+ - #ifndef Q_QDOC - // NOTE: Generally, do not add QT_Q_ENUM if a corresponding Q_Q_FLAG exists. - QT_Q_ENUM(ScrollBarPolicy) -@@ -1813,6 +1822,7 @@ public: - QT_Q_ENUM(MouseEventSource) - QT_Q_FLAG(MouseEventFlag) - QT_Q_ENUM(ChecksumType) -+ QT_Q_ENUM(HighDpiScaleFactorRoundingPolicy) - QT_Q_ENUM(TabFocusBehavior) - #endif // Q_DOC - -diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc -index 5bba8c5fe5..cce67eb376 100644 ---- a/src/corelib/global/qnamespace.qdoc -+++ b/src/corelib/global/qnamespace.qdoc -@@ -3252,3 +3252,25 @@ - - \value ChecksumItuV41 Checksum calculation based on ITU-V.41. - */ -+ -+/*! -+ \enum Qt::HighDpiScaleFactorRoundingPolicy -+ \since 5.14 -+ -+ This enum describes the possible High-DPI scale factor rounding policies, which -+ decide how non-integer scale factors (such as Windows 150%) are handled. -+ -+ The active policy is set by calling QGuiApplication::setHighDdpiScaleFactorRoundingPolicy() before -+ the application object is created, or by setting the QT_SCALE_FACTOR_ROUNDING_POLICY -+ environment variable. -+ -+ \sa QGuiApplication::setHighDdpiScaleFactorRoundingPolicy() -+ \sa AA_EnableHighDpiScaling. -+ -+ \omitvalue Unset -+ \value Round Round up for .5 and above. -+ \value Ceil Always round up. -+ \value Floor Always round down. -+ \value RoundPreferFloor Round up for .75 and above. -+ \value PassThrough Don't round. -+*/ -diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp -index a86bd22588..9a409d0288 100644 ---- a/src/gui/kernel/qguiapplication.cpp -+++ b/src/gui/kernel/qguiapplication.cpp -@@ -146,6 +146,8 @@ QString QGuiApplicationPrivate::styleOverride; - - Qt::ApplicationState QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive; - -+Qt::HighDpiScaleFactorRoundingPolicy QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy = -+ Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor; - bool QGuiApplicationPrivate::highDpiScalingUpdated = false; - - QPointer QGuiApplicationPrivate::currentDragWindow; -@@ -685,6 +687,8 @@ QGuiApplication::~QGuiApplication() - QGuiApplicationPrivate::lastCursorPosition = {qInf(), qInf()}; - QGuiApplicationPrivate::currentMousePressWindow = QGuiApplicationPrivate::currentMouseWindow = nullptr; - QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive; -+ QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy = -+ Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor; - QGuiApplicationPrivate::highDpiScalingUpdated = false; - QGuiApplicationPrivate::currentDragWindow = nullptr; - QGuiApplicationPrivate::tabletDevicePoints.clear(); -@@ -3522,6 +3526,46 @@ Qt::ApplicationState QGuiApplication::applicationState() - return QGuiApplicationPrivate::applicationState; - } - -+/*! -+ \since 5.14 -+ -+ Sets the high-DPI scale factor rounding policy for the application. The -+ policy decides how non-integer scale factors (such as Windows 150%) are -+ handled, for applications that have AA_EnableHighDpiScaling enabled. -+ -+ The two principal options are whether fractional scale factors should -+ be rounded to an integer or not. Keeping the scale factor as-is will -+ make the user interface size match the OS setting exactly, but may cause -+ painting errors, for example with the Windows style. -+ -+ If rounding is wanted, then which type of rounding should be decided -+ next. Mathematically correct rounding is supported but may not give -+ the best visual results: Consider if you want to render 1.5x as 1x -+ ("small UI") or as 2x ("large UI"). See the Qt::HighDpiScaleFactorRoundingPolicy -+ enum for a complete list of all options. -+ -+ This function must be called before creating the application object, -+ and can be overridden by setting the QT_SCALE_FACTOR_ROUNDING_POLICY -+ environment variable. The QGuiApplication::highDpiScaleFactorRoundingPolicy() -+ accessor will reflect the environment, if set. -+ -+ The default value is Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor. -+*/ -+void QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy) -+{ -+ QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy = policy; -+} -+ -+/*! -+ \since 5.14 -+ -+ Returns the high-DPI scale factor rounding policy. -+*/ -+Qt::HighDpiScaleFactorRoundingPolicy QGuiApplication::highDpiScaleFactorRoundingPolicy() -+{ -+ return QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy; -+} -+ - /*! - \since 5.2 - \fn void QGuiApplication::applicationStateChanged(Qt::ApplicationState state) -diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h -index 02dffef0fe..2814ba1d1b 100644 ---- a/src/gui/kernel/qguiapplication.h -+++ b/src/gui/kernel/qguiapplication.h -@@ -156,6 +156,9 @@ public: - - static Qt::ApplicationState applicationState(); - -+ static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy); -+ static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy(); -+ - static int exec(); - bool notify(QObject *, QEvent *) override; - -diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h -index ca7af43706..aaf6dd4c58 100644 ---- a/src/gui/kernel/qguiapplication_p.h -+++ b/src/gui/kernel/qguiapplication_p.h -@@ -216,6 +216,7 @@ public: - static QPointer currentMouseWindow; - static QPointer currentMousePressWindow; - static Qt::ApplicationState applicationState; -+ static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy; - static bool highDpiScalingUpdated; - static QPointer currentDragWindow; - -diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp -index 4a9c9a9934..c031885d5d 100644 ---- a/src/gui/kernel/qhighdpiscaling.cpp -+++ b/src/gui/kernel/qhighdpiscaling.cpp -@@ -331,24 +331,24 @@ static QByteArray joinEnumValues(const EnumLookup *i1, const EnumLooku - return result; - } - --using ScaleFactorRoundingPolicyLookup = EnumLookup; -+using ScaleFactorRoundingPolicyLookup = EnumLookup; - - static const ScaleFactorRoundingPolicyLookup scaleFactorRoundingPolicyLookup[] = - { -- {"Round", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Round}, -- {"Ceil", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Ceil}, -- {"Floor", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Floor}, -- {"RoundPreferFloor", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor}, -- {"PassThrough", QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::PassThrough} -+ {"Round", Qt::HighDpiScaleFactorRoundingPolicy::Round}, -+ {"Ceil", Qt::HighDpiScaleFactorRoundingPolicy::Ceil}, -+ {"Floor", Qt::HighDpiScaleFactorRoundingPolicy::Floor}, -+ {"RoundPreferFloor", Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor}, -+ {"PassThrough", Qt::HighDpiScaleFactorRoundingPolicy::PassThrough} - }; - --static QHighDpiScaling::HighDpiScaleFactorRoundingPolicy -+static Qt::HighDpiScaleFactorRoundingPolicy - lookupScaleFactorRoundingPolicy(const QByteArray &v) - { - auto end = std::end(scaleFactorRoundingPolicyLookup); - auto it = std::find(std::begin(scaleFactorRoundingPolicyLookup), end, -- ScaleFactorRoundingPolicyLookup{v.constData(), QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Unset}); -- return it != end ? it->value : QHighDpiScaling::HighDpiScaleFactorRoundingPolicy::Unset; -+ ScaleFactorRoundingPolicyLookup{v.constData(), Qt::HighDpiScaleFactorRoundingPolicy::Unset}); -+ return it != end ? it->value : Qt::HighDpiScaleFactorRoundingPolicy::Unset; - } - - using DpiAdjustmentPolicyLookup = EnumLookup; -@@ -377,15 +377,15 @@ qreal QHighDpiScaling::roundScaleFactor(qreal rawFactor) - // sizes that are smaller than the ideal size, and opposite for rounding up. - // Rounding down is then preferable since "small UI" is a more acceptable - // high-DPI experience than "large UI". -- static auto scaleFactorRoundingPolicy = HighDpiScaleFactorRoundingPolicy::Unset; -+ static auto scaleFactorRoundingPolicy = Qt::HighDpiScaleFactorRoundingPolicy::Unset; - - // Determine rounding policy -- if (scaleFactorRoundingPolicy == HighDpiScaleFactorRoundingPolicy::Unset) { -+ if (scaleFactorRoundingPolicy == Qt::HighDpiScaleFactorRoundingPolicy::Unset) { - // Check environment - if (qEnvironmentVariableIsSet(scaleFactorRoundingPolicyEnvVar)) { - QByteArray policyText = qgetenv(scaleFactorRoundingPolicyEnvVar); - auto policyEnumValue = lookupScaleFactorRoundingPolicy(policyText); -- if (policyEnumValue != HighDpiScaleFactorRoundingPolicy::Unset) { -+ if (policyEnumValue != Qt::HighDpiScaleFactorRoundingPolicy::Unset) { - scaleFactorRoundingPolicy = policyEnumValue; - } else { - auto values = joinEnumValues(std::begin(scaleFactorRoundingPolicyLookup), -@@ -393,38 +393,43 @@ qreal QHighDpiScaling::roundScaleFactor(qreal rawFactor) - qWarning("Unknown scale factor rounding policy: %s. Supported values are: %s.", - policyText.constData(), values.constData()); - } -+ } -+ -+ // Check application object if no environment value was set. -+ if (scaleFactorRoundingPolicy == Qt::HighDpiScaleFactorRoundingPolicy::Unset) { -+ scaleFactorRoundingPolicy = QGuiApplication::highDpiScaleFactorRoundingPolicy(); - } else { -- // Set default policy if no environment variable is set. -- scaleFactorRoundingPolicy = HighDpiScaleFactorRoundingPolicy::RoundPreferFloor; -+ // Make application setting reflect environment -+ QGuiApplication::setHighDpiScaleFactorRoundingPolicy(scaleFactorRoundingPolicy); - } - } - - // Apply rounding policy. - qreal roundedFactor = rawFactor; - switch (scaleFactorRoundingPolicy) { -- case HighDpiScaleFactorRoundingPolicy::Round: -+ case Qt::HighDpiScaleFactorRoundingPolicy::Round: - roundedFactor = qRound(rawFactor); - break; -- case HighDpiScaleFactorRoundingPolicy::Ceil: -+ case Qt::HighDpiScaleFactorRoundingPolicy::Ceil: - roundedFactor = qCeil(rawFactor); - break; -- case HighDpiScaleFactorRoundingPolicy::Floor: -+ case Qt::HighDpiScaleFactorRoundingPolicy::Floor: - roundedFactor = qFloor(rawFactor); - break; -- case HighDpiScaleFactorRoundingPolicy::RoundPreferFloor: -+ case Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor: - // Round up for .75 and higher. This favors "small UI" over "large UI". - roundedFactor = rawFactor - qFloor(rawFactor) < 0.75 - ? qFloor(rawFactor) : qCeil(rawFactor); - break; -- case HighDpiScaleFactorRoundingPolicy::PassThrough: -- case HighDpiScaleFactorRoundingPolicy::Unset: -+ case Qt::HighDpiScaleFactorRoundingPolicy::PassThrough: -+ case Qt::HighDpiScaleFactorRoundingPolicy::Unset: - break; - } - - // Don't round down to to zero; clamp the minimum (rounded) factor to 1. - // This is not a common case but can happen if a display reports a very - // low DPI. -- if (scaleFactorRoundingPolicy != HighDpiScaleFactorRoundingPolicy::PassThrough) -+ if (scaleFactorRoundingPolicy != Qt::HighDpiScaleFactorRoundingPolicy::PassThrough) - roundedFactor = qMax(roundedFactor, qreal(1)); - - return roundedFactor; -diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h -index 9c24fa506d..f58944a7d2 100644 ---- a/src/gui/kernel/qhighdpiscaling_p.h -+++ b/src/gui/kernel/qhighdpiscaling_p.h -@@ -74,16 +74,6 @@ typedef QPair QDpi; - class Q_GUI_EXPORT QHighDpiScaling { - Q_GADGET - public: -- enum class HighDpiScaleFactorRoundingPolicy { -- Unset, -- Round, -- Ceil, -- Floor, -- RoundPreferFloor, -- PassThrough -- }; -- Q_ENUM(HighDpiScaleFactorRoundingPolicy) -- - enum class DpiAdjustmentPolicy { - Unset, - Enabled, --- -2.20.1.windows.1 - -From a1d02092cd8aa9bd940bb6b744166ad9411a69a4 Mon Sep 17 00:00:00 2001 -From: Friedemann Kleint -Date: Tue, 3 Sep 2019 13:43:58 +0200 -Subject: [PATCH 43/47] QtGui: Refactor parsing of the High DPI scaling env - variables -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Use qEnvironmentVariable() where applicable and refactor the -parsing of QT_SCREEN_SCALE_FACTORS to use QStringRef. - -Task-number: QTBUG-53022 -Change-Id: I8956c6cecd7b634679eb5e66d2a87cccaf9e7936 -Reviewed-by: Morten Johan Sørvig -(cherry picked from commit 18088d4706bdd2fefafe7dbb44dc467126f2c795) ---- - src/gui/kernel/qhighdpiscaling.cpp | 19 ++++++++++--------- - 1 file changed, 10 insertions(+), 9 deletions(-) - -diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp -index c031885d5d..ec4feeba8b 100644 ---- a/src/gui/kernel/qhighdpiscaling.cpp -+++ b/src/gui/kernel/qhighdpiscaling.cpp -@@ -86,7 +86,7 @@ static inline qreal initialGlobalScaleFactor() - qreal result = 1; - if (qEnvironmentVariableIsSet(scaleFactorEnvVar)) { - bool ok; -- const qreal f = qgetenv(scaleFactorEnvVar).toDouble(&ok); -+ const qreal f = qEnvironmentVariable(scaleFactorEnvVar).toDouble(&ok); - if (ok && f > 0) { - qCDebug(lcScaling) << "Apply " << scaleFactorEnvVar << f; - result = f; -@@ -284,7 +284,8 @@ static inline bool usePixelDensity() - return QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling) - || (screenEnvValueOk && screenEnvValue > 0) - || (enableEnvValueOk && enableEnvValue > 0) -- || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) && qgetenv(legacyDevicePixelEnvVar).toLower() == "auto"); -+ || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) -+ && qEnvironmentVariable(legacyDevicePixelEnvVar).compare(QLatin1String("auto"), Qt::CaseInsensitive) == 0); - } - - qreal QHighDpiScaling::rawScaleFactor(const QPlatformScreen *screen) -@@ -506,20 +507,20 @@ void QHighDpiScaling::updateHighDpiScaling() - } - if (qEnvironmentVariableIsSet(screenFactorsEnvVar)) { - int i = 0; -- const auto specs = qgetenv(screenFactorsEnvVar).split(';'); -- for (const QByteArray &spec : specs) { -- int equalsPos = spec.lastIndexOf('='); -+ const QString spec = qEnvironmentVariable(screenFactorsEnvVar); -+ const auto specs = spec.splitRef(QLatin1Char(';')); -+ for (const QStringRef &spec : specs) { -+ int equalsPos = spec.lastIndexOf(QLatin1Char('=')); - qreal factor = 0; - if (equalsPos > 0) { - // support "name=factor" -- QByteArray name = spec.mid(0, equalsPos); -- QByteArray f = spec.mid(equalsPos + 1); - bool ok; -- factor = f.toDouble(&ok); -+ const auto name = spec.left(equalsPos); -+ factor = spec.mid(equalsPos + 1).toDouble(&ok); - if (ok && factor > 0 ) { - const auto screens = QGuiApplication::screens(); - for (QScreen *s : screens) { -- if (s->name() == QString::fromLocal8Bit(name)) { -+ if (s->name() == name) { - setScreenFactor(s, factor); - break; - } --- -2.20.1.windows.1 - -From dbb7b892861a702ad9bc9bd3cccacd4e943dbe54 Mon Sep 17 00:00:00 2001 -From: Vitaly Fanaskov -Date: Fri, 25 Oct 2019 14:47:15 +0200 -Subject: [PATCH 44/47] QHighDpiScaling: fix potential null pointer dereference - -It's not guaranteed that QPlatformScreen::screen should always return a -valid pointer. Furthermore, you can run into this situation with, for -example, two screens setup. - -Task-number: QTBUG-53022 -Change-Id: Ic23bb2c30b1245f98a793a44cc5e0b39f9afac4b -Reviewed-by: Friedemann Kleint -(cherry picked from commit ed20f3209804d865804f9eb14c3fcfb4b7941140) ---- - src/gui/kernel/qhighdpiscaling.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp -index ec4feeba8b..0ac4928504 100644 ---- a/src/gui/kernel/qhighdpiscaling.cpp -+++ b/src/gui/kernel/qhighdpiscaling.cpp -@@ -657,7 +657,8 @@ qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen) - // Check if there is a factor set on the screen object or associated - // with the screen name. These are mutually exclusive, so checking - // order is not significant. -- QVariant byIndex = screen->screen()->property(scaleFactorProperty); -+ auto qScreen = screen->screen(); -+ auto byIndex = qScreen ? qScreen->property(scaleFactorProperty) : QVariant(); - auto byNameIt = qNamedScreenScaleFactors()->constFind(screen->name()); - if (byIndex.isValid()) { - screenPropertyUsed = true; --- -2.20.1.windows.1 - -From 1492decc76d6cbb8d86bb5146ff2e1dae365df96 Mon Sep 17 00:00:00 2001 -From: Vitaly Fanaskov -Date: Wed, 6 Nov 2019 21:37:48 +0100 -Subject: [PATCH 45/47] QHighDpiScaling: impove readability of screenSubfactor - method - -Task-number: QTBUG-53022 -Change-Id: Idae4379dd78d3125c375fad37a5a3af5bbcdc51e -Reviewed-by: Friedemann Kleint -(cherry picked from commit a866055d18b2c2efc0f3cf5307d8eac78cce26eb) ---- - src/gui/kernel/qhighdpiscaling.cpp | 21 +++++++++++---------- - 1 file changed, 11 insertions(+), 10 deletions(-) - -diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp -index 0ac4928504..fe9ac85c7d 100644 ---- a/src/gui/kernel/qhighdpiscaling.cpp -+++ b/src/gui/kernel/qhighdpiscaling.cpp -@@ -644,7 +644,7 @@ QPoint QHighDpiScaling::mapPositionFromGlobal(const QPoint &pos, const QPoint &w - - qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen) - { -- qreal factor = qreal(1.0); -+ auto factor = qreal(1.0); - if (!screen) - return factor; - -@@ -657,15 +657,16 @@ qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen) - // Check if there is a factor set on the screen object or associated - // with the screen name. These are mutually exclusive, so checking - // order is not significant. -- auto qScreen = screen->screen(); -- auto byIndex = qScreen ? qScreen->property(scaleFactorProperty) : QVariant(); -- auto byNameIt = qNamedScreenScaleFactors()->constFind(screen->name()); -- if (byIndex.isValid()) { -- screenPropertyUsed = true; -- factor = byIndex.toReal(); -- } else if (byNameIt != qNamedScreenScaleFactors()->cend()) { -- screenPropertyUsed = true; -- factor = *byNameIt; -+ if (auto qScreen = screen->screen()) { -+ auto screenFactor = qScreen->property(scaleFactorProperty).toReal(&screenPropertyUsed); -+ if (screenPropertyUsed) -+ factor = screenFactor; -+ } -+ -+ if (!screenPropertyUsed) { -+ auto byNameIt = qNamedScreenScaleFactors()->constFind(screen->name()); -+ if ((screenPropertyUsed = byNameIt != qNamedScreenScaleFactors()->cend())) -+ factor = *byNameIt; - } - } - --- -2.20.1.windows.1 - -From da873ea0ac11df032f82e080996737ebd291b577 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= -Date: Tue, 1 Dec 2020 15:24:23 +0100 -Subject: [PATCH 46/47] Windows: Add support for PerMonitorV2 DPI awareness -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add support for opting in to PerMonitorV2 DPI awareness -on the command line: - -platform windows:dpiawareness=3 - -This mode is supported on Windows 10 and up. Setting it -requires using the new SetProcessDpiAwarenessContext -API, which can be resolved from user32.dll. - -Task-number: QTBUG-68712 -Change-Id: I37821e27a67e08c2e9fef25e494cfd7abed13314 -Reviewed-by: Tor Arne Vestbø -(cherry picked from commit c35643dba3efabaf3fa036895f152bf5b8725f5e) ---- - .../platforms/windows/qtwindowsglobal.h | 11 +++++++++- - .../platforms/windows/qwindowscontext.cpp | 22 +++++++++++++++++++ - .../platforms/windows/qwindowscontext.h | 5 +++++ - .../platforms/windows/qwindowsintegration.cpp | 19 +++++++++++----- - 4 files changed, 51 insertions(+), 6 deletions(-) - -diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h -index 985f13bdc5..573a8d07c8 100644 ---- a/src/plugins/platforms/windows/qtwindowsglobal.h -+++ b/src/plugins/platforms/windows/qtwindowsglobal.h -@@ -76,6 +76,14 @@ - # define WM_POINTERHWHEEL 0x024F - #endif // WM_POINTERUPDATE - -+#if !defined(_DPI_AWARENESS_CONTEXTS_) -+# define DPI_AWARENESS_CONTEXT_UNAWARE ((HANDLE)-1) -+# define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((HANDLE)-2) -+# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((HANDLE)-3) -+# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((HANDLE)-4) -+# define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((HANDLE)-5) -+#endif -+ - QT_BEGIN_NAMESPACE - - namespace QtWindows -@@ -167,7 +175,8 @@ enum ProcessDpiAwareness - { - ProcessDpiUnaware, - ProcessSystemDpiAware, -- ProcessPerMonitorDpiAware -+ ProcessPerMonitorDpiAware, -+ ProcessPerMonitorV2DpiAware // Qt extension (not in Process_DPI_Awareness) - }; - - } // namespace QtWindows -diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp -index 38b9823d6b..25faa73374 100644 ---- a/src/plugins/platforms/windows/qwindowscontext.cpp -+++ b/src/plugins/platforms/windows/qwindowscontext.cpp -@@ -189,6 +189,7 @@ void QWindowsUser32DLL::init() - { - QSystemLibrary library(QStringLiteral("user32")); - setProcessDPIAware = (SetProcessDPIAware)library.resolve("SetProcessDPIAware"); -+ setProcessDpiAwarenessContext = (SetProcessDpiAwarenessContext)library.resolve("SetProcessDpiAwarenessContext"); - - addClipboardFormatListener = (AddClipboardFormatListener)library.resolve("AddClipboardFormatListener"); - removeClipboardFormatListener = (RemoveClipboardFormatListener)library.resolve("RemoveClipboardFormatListener"); -@@ -273,8 +274,11 @@ struct QWindowsContextPrivate { - const HRESULT m_oleInitializeResult; - QWindow *m_lastActiveWindow = nullptr; - bool m_asyncExpose = false; -+ static bool m_v2DpiAware; - }; - -+bool QWindowsContextPrivate::m_v2DpiAware = false; -+ - QWindowsContextPrivate::QWindowsContextPrivate() - : m_oleInitializeResult(OleInitialize(nullptr)) - { -@@ -425,6 +429,23 @@ void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiA - } - } - -+void QWindowsContext::setProcessDpiV2Awareness() -+{ -+ qCDebug(lcQpaWindows) << __FUNCTION__; -+ const BOOL ok = QWindowsContext::user32dll.setProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); -+ if (ok) { -+ QWindowsContextPrivate::m_v2DpiAware = true; -+ } else { -+ const HRESULT errorCode = GetLastError(); -+ // E_ACCESSDENIED means set externally (MSVC manifest or external app loading Qt plugin). -+ // Silence warning in that case unless debug is enabled. -+ if (errorCode != E_ACCESSDENIED || lcQpaWindows().isDebugEnabled()) { -+ qWarning().noquote().nospace() << "setProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) failed: " -+ << QWindowsContext::comErrorString(errorCode); -+ } -+ } -+} -+ - QWindowsContext *QWindowsContext::instance() - { - return m_instance; -@@ -991,6 +1012,7 @@ static inline bool resizeOnDpiChanged(const QWindow *w) - bool QWindowsContext::shouldHaveNonClientDpiScaling(const QWindow *window) - { - return QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10 -+ && !QWindowsContextPrivate::m_v2DpiAware // V2 implies NonClientDpiScaling; no need to enable - && window->isTopLevel() - && !window->property(QWindowsWindow::embeddedNativeParentHandleProperty).isValid() - #if QT_CONFIG(opengl) // /QTBUG-62901, EnableNonClientDpiScaling has problems with GL -diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h -index 4908f14629..012dd4e75d 100644 ---- a/src/plugins/platforms/windows/qwindowscontext.h -+++ b/src/plugins/platforms/windows/qwindowscontext.h -@@ -98,6 +98,7 @@ struct QWindowsUser32DLL - typedef BOOL (WINAPI *GetPointerPenInfoHistory)(UINT32, UINT32 *, PVOID); - typedef BOOL (WINAPI *SkipPointerFrameMessages)(UINT32); - typedef BOOL (WINAPI *SetProcessDPIAware)(); -+ typedef BOOL (WINAPI *SetProcessDpiAwarenessContext)(HANDLE); - typedef BOOL (WINAPI *AddClipboardFormatListener)(HWND); - typedef BOOL (WINAPI *RemoveClipboardFormatListener)(HWND); - typedef BOOL (WINAPI *GetDisplayAutoRotationPreferences)(DWORD *); -@@ -123,6 +124,9 @@ struct QWindowsUser32DLL - // Windows Vista onwards - SetProcessDPIAware setProcessDPIAware = nullptr; - -+ // Windows 10 version 1703 onwards -+ SetProcessDpiAwarenessContext setProcessDpiAwarenessContext = nullptr; -+ - // Clipboard listeners are present on Windows Vista onwards - // but missing in MinGW 4.9 stub libs. Can be removed in MinGW 5. - AddClipboardFormatListener addClipboardFormatListener = nullptr; -@@ -222,6 +226,7 @@ public: - void setTabletAbsoluteRange(int a); - void setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness); - static int processDpiAwareness(); -+ void setProcessDpiV2Awareness(); - - void setDetectAltGrModifier(bool a); - -diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp -index 47b2bbeb02..8923972d49 100644 ---- a/src/plugins/platforms/windows/qwindowsintegration.cpp -+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp -@@ -210,7 +210,7 @@ static inline unsigned parseOptions(const QStringList ¶mList, - options |= QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch; - } else if (parseIntOption(param, QLatin1String("verbose"), 0, INT_MAX, &QWindowsContext::verbose) - || parseIntOption(param, QLatin1String("tabletabsoluterange"), 0, INT_MAX, tabletAbsoluteRange) -- || parseIntOption(param, QLatin1String("dpiawareness"), QtWindows::ProcessDpiUnaware, QtWindows::ProcessPerMonitorDpiAware, dpiAwareness)) { -+ || parseIntOption(param, QLatin1String("dpiawareness"), QtWindows::ProcessDpiUnaware, QtWindows::ProcessPerMonitorV2DpiAware, dpiAwareness)) { - } else if (param == QLatin1String("menus=native")) { - options |= QWindowsIntegration::AlwaysUseNativeMenus; - } else if (param == QLatin1String("menus=none")) { -@@ -259,10 +259,19 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mL - - if (!dpiAwarenessSet) { // Set only once in case of repeated instantiations of QGuiApplication. - if (!QCoreApplication::testAttribute(Qt::AA_PluginApplication)) { -- m_context.setProcessDpiAwareness(dpiAwareness); -- qCDebug(lcQpaWindows) -- << __FUNCTION__ << "DpiAwareness=" << dpiAwareness -- << "effective process DPI awareness=" << QWindowsContext::processDpiAwareness(); -+ -+ // DpiAwareV2 requires using new API -+ bool hasDpiAwarenessContext = QWindowsContext::user32dll.setProcessDpiAwarenessContext != nullptr; -+ if (dpiAwareness == QtWindows::ProcessPerMonitorV2DpiAware && hasDpiAwarenessContext) { -+ m_context.setProcessDpiV2Awareness(); -+ qCDebug(lcQpaWindows) -+ << __FUNCTION__ << "DpiAwareness: DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2"; -+ } else { -+ m_context.setProcessDpiAwareness(dpiAwareness); -+ qCDebug(lcQpaWindows) -+ << __FUNCTION__ << "DpiAwareness=" << dpiAwareness -+ << "effective process DPI awareness=" << QWindowsContext::processDpiAwareness(); -+ } - } - dpiAwarenessSet = true; - } --- -2.20.1.windows.1 - -From af038fed43912698170de6b637ddfc286ec82e0c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= -Date: Thu, 21 Jan 2021 14:17:28 +0100 -Subject: [PATCH 47/47] Windows: Change default to ProcessPerMonitorV2DpiAware -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes: QTBUG-68712 -Change-Id: Id73c4a5422e50b5bee2160468feb4d2f09c5461a -Reviewed-by: Tor Arne Vestbø -(cherry picked from commit d66cb667efbc33b3a81ecc495e90a2e2f44616b2) ---- - src/plugins/platforms/windows/qwindowsintegration.cpp | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp -index 8923972d49..9c2f3c43d7 100644 ---- a/src/plugins/platforms/windows/qwindowsintegration.cpp -+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp -@@ -230,9 +230,11 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mL - - static bool dpiAwarenessSet = false; - int tabletAbsoluteRange = -1; -- // Default to per-monitor awareness to avoid being scaled when monitors with different DPI -- // are connected to Windows 8.1 -- QtWindows::ProcessDpiAwareness dpiAwareness = QtWindows::ProcessPerMonitorDpiAware; -+ static bool hasDpiAwarenessContext = QWindowsContext::user32dll.setProcessDpiAwarenessContext != nullptr; -+ // Default to per-monitor-v2 awareness (if available) -+ QtWindows::ProcessDpiAwareness dpiAwareness = hasDpiAwarenessContext ? -+ QtWindows::ProcessPerMonitorV2DpiAware : QtWindows::ProcessPerMonitorDpiAware; -+ - m_options = parseOptions(paramList, &tabletAbsoluteRange, &dpiAwareness); - QWindowsFontDatabase::setFontOptions(m_options); - -@@ -261,7 +263,6 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mL - if (!QCoreApplication::testAttribute(Qt::AA_PluginApplication)) { - - // DpiAwareV2 requires using new API -- bool hasDpiAwarenessContext = QWindowsContext::user32dll.setProcessDpiAwarenessContext != nullptr; - if (dpiAwareness == QtWindows::ProcessPerMonitorV2DpiAware && hasDpiAwarenessContext) { - m_context.setProcessDpiV2Awareness(); - qCDebug(lcQpaWindows) --- -2.20.1.windows.1 - -From 1bac06d0ee5c12a53dc9191b91e56207e089f8ea Mon Sep 17 00:00:00 2001 -From: Joni Poikelin -Date: Thu, 3 Jan 2019 11:52:15 +0200 -Subject: [PATCH 1/3] Add faster path for scaling QRegion with multiple regions - -Fixes: QTBUG-72821 -Change-Id: Ic4fa349087239337a77b0e280be551b46c75af71 -Reviewed-by: Giuseppe D'Angelo -(cherry picked from commit 64fab8f7e2d225e37aa731db7501b5d5b82eab64) ---- - src/gui/painting/qtransform.cpp | 19 ++++++- - .../auto/gui/painting/qregion/tst_qregion.cpp | 55 +++++++++++++++++++ - 2 files changed, 72 insertions(+), 2 deletions(-) - -diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp -index 040d33fc2a..6354b154c5 100644 ---- a/src/gui/painting/qtransform.cpp -+++ b/src/gui/painting/qtransform.cpp -@@ -1517,8 +1517,23 @@ QRegion QTransform::map(const QRegion &r) const - return copy; - } - -- if (t == TxScale && r.rectCount() == 1) -- return QRegion(mapRect(r.boundingRect())); -+ if (t == TxScale) { -+ QRegion res; -+ if (m11() < 0 || m22() < 0) { -+ for (const QRect &rect : r) -+ res += mapRect(rect); -+ } else { -+ QVarLengthArray rects; -+ rects.reserve(r.rectCount()); -+ for (const QRect &rect : r) { -+ QRect nr = mapRect(rect); -+ if (!nr.isEmpty()) -+ rects.append(nr); -+ } -+ res.setRects(rects.constData(), rects.count()); -+ } -+ return res; -+ } - - QPainterPath p = map(qt_regionToPath(r)); - return p.toFillPolygon(QTransform()).toPolygon(); -diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp -index 5256fbd1dc..24c4583819 100644 ---- a/tests/auto/gui/painting/qregion/tst_qregion.cpp -+++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp -@@ -84,6 +84,8 @@ private slots: - #endif - - void regionFromPath(); -+ void scaleRegions_data(); -+ void scaleRegions(); - - #ifdef QT_BUILD_INTERNAL - void regionToPath_data(); -@@ -973,6 +975,59 @@ void tst_QRegion::regionFromPath() - } - } - -+void tst_QRegion::scaleRegions_data() -+{ -+ QTest::addColumn("scale"); -+ QTest::addColumn>("inputRects"); -+ QTest::addColumn>("expectedRects"); -+ -+ QTest::newRow("1.0 single") << 1.0 -+ << QVector{ QRect(10, 10, 20, 20) } -+ << QVector{ QRect(10, 10, 20, 20) }; -+ QTest::newRow("1.0 multi") << 1.0 -+ << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } -+ << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }; -+ QTest::newRow("2.0 single") << 2.0 -+ << QVector{ QRect(10, 10, 20, 20) } -+ << QVector{ QRect(20, 20, 40, 40) }; -+ QTest::newRow("2.0 multi") << 2.0 -+ << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } -+ << QVector{ QRect(20, 20, 40, 40), QRect(80, 20, 40, 40) }; -+ QTest::newRow("-1.0 single") << -1.0 -+ << QVector{ QRect(10, 10, 20, 20) } -+ << QVector{ QRect(-30, -30, 20, 20) }; -+ QTest::newRow("-1.0 multi") << -1.0 -+ << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } -+ << QVector{ QRect(-60, -30, 20, 20), QRect(-30, -30, 20, 20) }; -+ QTest::newRow("-2.0 single") << -2.0 -+ << QVector{ QRect(10, 10, 20, 20) } -+ << QVector{ QRect(-60, -60, 40, 40) }; -+ QTest::newRow("-2.0 multi") << -2.0 -+ << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } -+ << QVector{ QRect(-120, -60, 40, 40), QRect(-60, -60, 40, 40) }; -+} -+ -+void tst_QRegion::scaleRegions() -+{ -+ QFETCH(qreal, scale); -+ QFETCH(QVector, inputRects); -+ QFETCH(QVector, expectedRects); -+ -+ QRegion region; -+ region.setRects(inputRects.constData(), inputRects.size()); -+ -+ QRegion expected(expectedRects.first()); -+ expected.setRects(expectedRects.constData(), expectedRects.size()); -+ -+ QTransform t; -+ t.scale(scale, scale); -+ -+ auto result = t.map(region); -+ -+ QCOMPARE(result.rectCount(), expectedRects.size()); -+ QCOMPARE(result, expected); -+} -+ - Q_DECLARE_METATYPE(QPainterPath) - - #ifdef QT_BUILD_INTERNAL --- -2.24.1.windows.2 - -From 038da48a6c2279f4964e8f82635bd2ae606ce518 Mon Sep 17 00:00:00 2001 -From: Eirik Aavitsland -Date: Thu, 17 Oct 2019 13:25:06 +0200 -Subject: [PATCH 2/3] Fix: QPainter off-by-one clipping for some non-integer - scalings - -For some scalings, setClipRect(QRect) would produce a clip one pixel -different from setClipRect(QRectF) because of different -rounding. Ditto for setClipRegion. Fix by making sure to transform -QRectFs instead of QRects. - -Fixes: QTBUG-78962 -Fixes: QTBUG-78963 -Change-Id: I0be721133858c30769ec6d81e978962a3d6b70cf -Reviewed-by: Christoph Cullmann -Reviewed-by: Allan Sandfeld Jensen -(cherry picked from commit 19f29802bf7daafacd0fd824c2a1349e80eac536) ---- - src/gui/painting/qpaintengine_raster.cpp | 2 +- - src/gui/painting/qtransform.cpp | 4 +- - .../gui/painting/qpainter/tst_qpainter.cpp | 49 ++++++++++++++++++- - 3 files changed, 51 insertions(+), 4 deletions(-) - -diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp -index 4dfdf20bf0..99ed691135 100644 ---- a/src/gui/painting/qpaintengine_raster.cpp -+++ b/src/gui/painting/qpaintengine_raster.cpp -@@ -1341,7 +1341,7 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) - QPaintEngineEx::clip(rect, op); - return; - -- } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(rect), op)) { -+ } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(QRectF(rect)).toRect(), op)) { - QPaintEngineEx::clip(rect, op); - return; - } -diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp -index 6354b154c5..336493d7c5 100644 ---- a/src/gui/painting/qtransform.cpp -+++ b/src/gui/painting/qtransform.cpp -@@ -1521,12 +1521,12 @@ QRegion QTransform::map(const QRegion &r) const - QRegion res; - if (m11() < 0 || m22() < 0) { - for (const QRect &rect : r) -- res += mapRect(rect); -+ res += mapRect(QRectF(rect)).toRect(); - } else { - QVarLengthArray rects; - rects.reserve(r.rectCount()); - for (const QRect &rect : r) { -- QRect nr = mapRect(rect); -+ QRect nr = mapRect(QRectF(rect)).toRect(); - if (!nr.isEmpty()) - rects.append(nr); - } -diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp -index bc0baed15c..bdac1c2430 100644 ---- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp -+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp -@@ -153,10 +153,10 @@ private slots: - void clippedLines(); - void clippedPolygon_data(); - void clippedPolygon(); -- - void clippedText(); - - void clipBoundingRect(); -+ void transformedClip(); - - void setOpacity_data(); - void setOpacity(); -@@ -4533,6 +4533,53 @@ void tst_QPainter::clipBoundingRect() - - } - -+void tst_QPainter::transformedClip() -+{ -+ QImage img(8, 4, QImage::Format_ARGB32_Premultiplied); -+ QImage img2(img.size(), img.format()); -+ QRect clip(0, 0, 2, 1); -+ QTransform xf; -+ xf.translate(0.2, 0); -+ xf.scale(2.2, 1); -+ // setClipRect(QRectF) -+ { -+ img.fill(Qt::green); -+ QPainter p(&img); -+ p.setTransform(xf); -+ p.setClipRect(QRectF(clip)); -+ p.fillRect(img.rect(), Qt::white); -+ } -+ // setClipRect(QRect) -+ { -+ img2.fill(Qt::green); -+ QPainter p(&img2); -+ p.setTransform(xf); -+ p.setClipRect(clip); -+ p.fillRect(img2.rect(), Qt::white); -+ QCOMPARE(img, img2); -+ } -+ // setClipRegion -+ { -+ img2.fill(Qt::green); -+ QPainter p(&img2); -+ p.setTransform(xf); -+ p.setClipRegion(QRegion(clip) + QRect(0, 3, 1, 1)); // dummy extra rect to avoid single-rect codepath -+ p.fillRect(img2.rect(), Qt::white); -+ QCOMPARE(img.copy(0, 0, 8, 2), img2.copy(0, 0, 8, 2)); -+ } -+ // setClipPath -+ { -+ img2.fill(Qt::green); -+ QPainter p(&img2); -+ p.setTransform(xf); -+ QPainterPath path; -+ path.addRect(clip); -+ p.setClipPath(path); -+ p.fillRect(img2.rect(), Qt::white); -+ QCOMPARE(img, img2); -+ } -+} -+ - #if defined(Q_OS_MAC) - // Only Mac supports sub pixel positions in raster engine currently - void tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053() --- -2.24.1.windows.2 - -From b9570898b780f9981010fb07f49875ad55467e4a Mon Sep 17 00:00:00 2001 -From: Tang HaiXiang -Date: Fri, 24 Jul 2020 16:48:36 +0800 -Subject: [PATCH 3/3] Fix under non-integer scaling incorrect update area - -Given some decimal scaling, the clipping of the QRegion/QRect passed to the QRegion/QRect done inside paintEvent cannot handle the decimal scaling. -Solved by only converting QRect to a certain QRectF and calling QRectF overload instead of QRect. - -Fixes: QTBUG-82601 -Fixes: QTBUG-64854 -Change-Id: I0d8f4193aabfc0d917612db68d2a39ebb726fa2f -Reviewed-by: Eirik Aavitsland -(cherry picked from commit b4aee30692c166025b4e2283c19dbc1247bcce54) -Reviewed-by: Qt Cherry-pick Bot -(cherry picked from commit 5de4b9b1e5eb1ae8d922ee96d88eb6bba05b2b45) ---- - src/gui/kernel/qhighdpiscaling_p.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h -index f58944a7d2..dd30b1e758 100644 ---- a/src/gui/kernel/qhighdpiscaling_p.h -+++ b/src/gui/kernel/qhighdpiscaling_p.h -@@ -204,7 +204,7 @@ inline QRegion scale(const QRegion ®ion, qreal scaleFactor, QPoint origin = Q - - QRegion scaled; - for (const QRect &rect : region) -- scaled += scale(rect, scaleFactor, origin); -+ scaled += scale(QRectF(rect), scaleFactor, origin).toRect(); - return scaled; - } - --- -2.24.1.windows.2 - -From 86c5197abc5e4f4314a14eb8a36ff0432817c7d2 Mon Sep 17 00:00:00 2001 -From: Friedemann Kleint -Date: Thu, 12 Sep 2019 08:54:58 +0200 -Subject: [PATCH 2/5] Windows QPA: Fix missing resize when changing the scale - factor -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Do not suppress the resize event caused by the handling of -WM_DPICHANGED unless the screen really changed. - -Fixes: QTBUG-76510 -Change-Id: I8b9ae41ad7deb863c1633ec5901bc04304b2165c -Reviewed-by: Tor Arne Vestbø -(cherry picked from commit 2dd781df87b98697c815183e4abeb226577230ab) ---- - src/plugins/platforms/windows/qwindowswindow.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp -index adf0f918ca..bba01b9818 100644 ---- a/src/plugins/platforms/windows/qwindowswindow.cpp -+++ b/src/plugins/platforms/windows/qwindowswindow.cpp -@@ -1897,8 +1897,10 @@ void QWindowsWindow::handleGeometryChange() - { - const QRect previousGeometry = m_data.geometry; - m_data.geometry = geometry_sys(); -- if (testFlag(WithinDpiChanged)) -- return; // QGuiApplication will send resize -+ if (testFlag(WithinDpiChanged) -+ && QWindowsContext::instance()->screenManager().screenForHwnd(m_data.hwnd) != screen()) { -+ return; // QGuiApplication will send resize when screen actually changes -+ } - QWindowSystemInterface::handleGeometryChange(window(), m_data.geometry); - // QTBUG-32121: OpenGL/normal windows (with exception of ANGLE) do not receive - // expose events when shrinking, synthesize. --- -2.24.1.windows.2 - -From 60f67a2cb5f3c1148ef6b5803183f46b2b3f9478 Mon Sep 17 00:00:00 2001 -From: Oliver Wolff -Date: Fri, 21 Feb 2020 09:10:28 +0100 -Subject: [PATCH 3/5] qwindowswindow: Fix screen changes between different DPI - screens for native windows -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When asynchronous events are used for notifications about screen changes -it is possible that we run into a race condition where the scale factor -has not yet been updated for the new screen. This results in a wrong -geometry being set for the window that is moved between the screens. -We do not have that problem with synchronous events. - -Change-Id: I4eb6d2a7cb49517d271901b479f973e273a0926a -Amends: 7eed1e40d4d3b6a066bac52995eed7e75d17de2d -Task-number: QTBUG-65580 -Fixes: QTBUG-82312 -Reviewed-by: Friedemann Kleint -Reviewed-by: Tor Arne Vestbø -(cherry picked from commit 529cfe4e22cc02dc7c29f653e8ff23656aa16ff9) ---- - src/plugins/platforms/windows/qwindowswindow.cpp | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp -index bba01b9818..a3374a237d 100644 ---- a/src/plugins/platforms/windows/qwindowswindow.cpp -+++ b/src/plugins/platforms/windows/qwindowswindow.cpp -@@ -1887,10 +1887,8 @@ void QWindowsWindow::checkForScreenChanged(ScreenChangeMode mode) - qCDebug(lcQpaWindows).noquote().nospace() << __FUNCTION__ - << ' ' << window() << " \"" << (currentScreen ? currentScreen->name() : QString()) - << "\"->\"" << newScreen->name() << '"'; -- if (mode == FromGeometryChange) -- setFlag(SynchronousGeometryChangeEvent); - updateFullFrameMargins(); -- QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); -+ QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); - } - - void QWindowsWindow::handleGeometryChange() --- -2.24.1.windows.2 - -From 2901b92720135e8e2f0d2a1266826c6b47163875 Mon Sep 17 00:00:00 2001 -From: Friedemann Kleint -Date: Tue, 14 Apr 2020 11:03:32 +0200 -Subject: [PATCH 4/5] Windows QPA: Fix geometry when firing a full expose -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -There are several places in the code where a full expose -event is fired, but the geometry in logical coordinates is -used (pre-dating High DPI scaling). Fix by introducing a -helper function for it. - -Task-number: QTBUG-83449 -Change-Id: Ie8bb306de0b9b2b85306ed1bb6ba71181b76a958 -Reviewed-by: André de la Rocha -Reviewed-by: Oliver Wolff -(cherry picked from commit 4bb803477bacc70f756b1aaea9e048b2bae0fa6a) ---- - src/plugins/platforms/windows/qwindowswindow.cpp | 13 +++++++++---- - src/plugins/platforms/windows/qwindowswindow.h | 1 + - 2 files changed, 10 insertions(+), 4 deletions(-) - -diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp -index a3374a237d..1a78c692b1 100644 ---- a/src/plugins/platforms/windows/qwindowswindow.cpp -+++ b/src/plugins/platforms/windows/qwindowswindow.cpp -@@ -1341,6 +1341,11 @@ void QWindowsWindow::fireExpose(const QRegion ®ion, bool force) - QWindowSystemInterface::handleExposeEvent(window(), region); - } - -+void QWindowsWindow::fireFullExpose(bool force) -+{ -+ fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), force); -+} -+ - void QWindowsWindow::destroyWindow() - { - qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << m_data.hwnd; -@@ -1501,7 +1506,7 @@ void QWindowsWindow::setVisible(bool visible) - // over the rendering of the window - // There is nobody waiting for this, so we don't need to flush afterwards. - if (isLayered()) -- fireExpose(QRect(0, 0, win->width(), win->height())); -+ fireFullExpose(); - // QTBUG-44928, QTBUG-7386: This is to resolve the problem where popups are - // opened from the system tray and not being implicitly activated - -@@ -1906,7 +1911,7 @@ void QWindowsWindow::handleGeometryChange() - && m_data.geometry.size() != previousGeometry.size() // Exclude plain move - // One dimension grew -> Windows will send expose, no need to synthesize. - && !(m_data.geometry.width() > previousGeometry.width() || m_data.geometry.height() > previousGeometry.height())) { -- fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), true); -+ fireFullExpose(true); - } - - const bool wasSync = testFlag(SynchronousGeometryChangeEvent); -@@ -2094,7 +2099,7 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state) - QWindow *w = window(); - bool exposeEventsSent = false; - if (isLayered()) { -- fireExpose(QRegion(0, 0, w->width(), w->height())); -+ fireFullExpose(); - exposeEventsSent = true; - } - const QWindowList allWindows = QGuiApplication::allWindows(); -@@ -2102,7 +2107,7 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state) - if (child != w && child->isVisible() && child->transientParent() == w) { - QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(child); - if (platformWindow && platformWindow->isLayered()) { -- platformWindow->fireExpose(QRegion(0, 0, child->width(), child->height())); -+ platformWindow->fireFullExpose(); - exposeEventsSent = true; - } - } -diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h -index ce67e46df3..9fb4492150 100644 ---- a/src/plugins/platforms/windows/qwindowswindow.h -+++ b/src/plugins/platforms/windows/qwindowswindow.h -@@ -361,6 +361,7 @@ private: - void handleWindowStateChange(Qt::WindowStates state); - inline void destroyIcon(); - void fireExpose(const QRegion ®ion, bool force=false); -+ void fireFullExpose(bool force=false); - - mutable QWindowsWindowData m_data; - QPointer m_menuBar; --- -2.24.1.windows.2 - -From 8b6300ddaf36b11ab54a504f438c96c19e545f7d Mon Sep 17 00:00:00 2001 -From: Friedemann Kleint -Date: Tue, 14 Apr 2020 08:09:04 +0200 -Subject: [PATCH 5/5] Windows QPA: Fix restoring from fullscreen in High DPI - setups - -The logic for checking whether the saved geometry (native pixels) -is still within a screen compared them against logical coordinates. -Work with the platform screen geometry instead. - -Fixes: QTBUG-83448 -Change-Id: Ib68f967d1a33a490f88a7bec6dcc788788a10389 -Reviewed-by: Oliver Wolff -(cherry picked from commit c92fedd761206231f13838528943619b84df55bf) ---- - src/plugins/platforms/windows/qwindowswindow.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp -index 1a78c692b1..66f0d3cb39 100644 ---- a/src/plugins/platforms/windows/qwindowswindow.cpp -+++ b/src/plugins/platforms/windows/qwindowswindow.cpp -@@ -2221,8 +2221,10 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowStates newState) - if (!screen) - screen = QGuiApplication::primaryScreen(); - // That area of the virtual desktop might not be covered by a screen anymore. -- if (!screen->geometry().intersects(m_savedFrameGeometry)) -- m_savedFrameGeometry.moveTo(screen->geometry().topLeft()); -+ if (const auto platformScreen = screen->handle()) { -+ if (!platformScreen->geometry().intersects(m_savedFrameGeometry)) -+ m_savedFrameGeometry.moveTo(platformScreen->geometry().topLeft()); -+ } - - if (newState & Qt::WindowMinimized) { - setMinimizedGeometry(m_data.hwnd, m_savedFrameGeometry); --- -2.24.1.windows.2 - diff --git a/src/patches/qt/include-limits.diff b/src/patches/qt/include-limits.diff deleted file mode 100644 index 24e598f2e..000000000 --- a/src/patches/qt/include-limits.diff +++ /dev/null @@ -1,51 +0,0 @@ ---- qtdeclarative/src/qmldebug/qqmlprofilerevent_p.h.orig 2023-08-27 18:42:23.217200254 +0200 -+++ qtdeclarative/src/qmldebug/qqmlprofilerevent_p.h 2023-08-27 18:42:39.177914148 +0200 -@@ -40,6 +40,7 @@ - #ifndef QQMLPROFILEREVENT_P_H - #define QQMLPROFILEREVENT_P_H - -+#include - #include "qqmlprofilerclientdefinitions_p.h" - - #include ---- qtdeclarative/src/qml/jsruntime/qv4regexp_p.h.orig 2023-08-27 18:28:00.494732255 +0200 -+++ qtdeclarative/src/qml/jsruntime/qv4regexp_p.h 2023-08-27 18:28:11.015002704 +0200 -@@ -57,7 +57,7 @@ - #include - #include - --#include -+#include - - #include - #include ---- qtdeclarative/src/qml/jsruntime/qv4propertykey_p.h.orig 2023-08-27 18:25:13.146447812 +0200 -+++ qtdeclarative/src/qml/jsruntime/qv4propertykey_p.h 2023-08-27 18:25:37.631072376 +0200 -@@ -50,6 +50,7 @@ - // We mean it. - // - -+#include - #include - - QT_BEGIN_NAMESPACE ---- qtbase/src/corelib/global/qendian.h.orig 2023-08-27 17:57:14.217737111 +0200 -+++ qtbase/src/corelib/global/qendian.h 2023-08-27 17:57:28.366116283 +0200 -@@ -41,6 +41,7 @@ - #ifndef QENDIAN_H - #define QENDIAN_H - -+#include - #include - #include - ---- qtbase/src/corelib/tools/qbytearraymatcher.h.orig 2023-08-27 17:58:30.455782238 +0200 -+++ qtbase/src/corelib/tools/qbytearraymatcher.h 2023-08-27 17:58:42.956118008 +0200 -@@ -40,6 +40,7 @@ - #ifndef QBYTEARRAYMATCHER_H - #define QBYTEARRAYMATCHER_H - -+#include - #include - - QT_BEGIN_NAMESPACE diff --git a/src/patches/qt/set-has-border-in-full-screen-default.patch b/src/patches/qt/set-has-border-in-full-screen-default.patch deleted file mode 100644 index f818fd843..000000000 --- a/src/patches/qt/set-has-border-in-full-screen-default.patch +++ /dev/null @@ -1,162 +0,0 @@ -From f377ab8da1acb279e5b23ab1d2ef4afabe5f481c Mon Sep 17 00:00:00 2001 -From: Friedemann Kleint -Date: Wed, 21 Nov 2018 09:06:50 +0100 -Subject: [PATCH] Windows: Add a default setting for hasBorderInFullScreen - -The hasBorderInFullScreen only has an effect when set before -the window is shown or switched to fullscreen. This is currently -not possible in the QML case since the window is only accessible -after all properties (including visibility) have been set. -Add a function to set a default value. - -[ChangeLog][QtPlatformHeaders][QWindowsWindowFunctions] Add a default -setting for hasBorderInFullScreen - -Task-number: QTBUG-47247 -Task-number: QTBUG-71855 -Change-Id: I3952e3f34bc4eb134cf1c5265b4489fc74112688 -Reviewed-by: Andre de la Rocha -Reviewed-by: Andy Shaw -(cherry picked from commit 7264bf19dbc47b805bb7af5df584ce1aae081962) ---- - .../qwindowswindowfunctions.h | 9 +++++ - .../qwindowswindowfunctions.qdoc | 33 +++++++++++++++++++ - .../windows/qwindowsnativeinterface.cpp | 2 ++ - .../platforms/windows/qwindowswindow.cpp | 8 ++++- - .../platforms/windows/qwindowswindow.h | 2 ++ - 5 files changed, 53 insertions(+), 1 deletion(-) - -diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h -index e51c2fde67..032dcafa6e 100644 ---- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h -+++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h -@@ -81,6 +81,15 @@ public: - func(window, border); - } - -+ typedef void (*SetHasBorderInFullScreenDefault)(bool border); -+ static const QByteArray setHasBorderInFullScreenDefaultIdentifier() { return QByteArrayLiteral("WindowsSetHasBorderInFullScreenDefault"); } -+ static void setHasBorderInFullScreenDefault(bool border) -+ { -+ auto func = reinterpret_cast(QGuiApplication::platformFunction(setHasBorderInFullScreenDefaultIdentifier())); -+ if (func) -+ func(border); -+ } -+ - typedef void (*SetWindowActivationBehaviorType)(WindowActivationBehavior); - static const QByteArray setWindowActivationBehaviorIdentifier() { return QByteArrayLiteral("WindowsSetWindowActivationBehavior"); } - -diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc -index a52bbe061b..0c52cde753 100644 ---- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc -+++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc -@@ -93,7 +93,40 @@ - is true then it will enable the WS_BORDER flag in full screen mode to enable other top level windows - inside the application to appear on top when required. - -+ \note The setting must be applied before showing the window or switching it -+ to full screen. For QML, setHasBorderInFullScreenDefault() can be used to -+ set a default value. -+ -+ See also \l [QtDoc] {Fullscreen OpenGL Based Windows} -+*/ -+ -+/*! -+ \typedef QWindowsWindowFunctions::SetHasBorderInFullScreenDefault -+ \since 5.13 -+ -+ This is the typedef for the function returned by QGuiApplication::platformFunction -+ when passed setHasBorderInFullScreenDefaultIdentifier. -+*/ -+ -+/*! -+ \fn QByteArray QWindowsWindowFunctions::setHasBorderInFullScreenDefaultIdentifier() -+ \since 5.13 -+ -+ This function returns the bytearray that can be used to query -+ QGuiApplication::platformFunction to retrieve the SetHasBorderInFullScreen function. -+*/ -+ -+/*! -+ \fn void QWindowsWindowFunctions::setHasBorderInFullScreenDefault(bool border) -+ \since 5.13 -+ -+ This is a convenience function that can be used directly instead of resolving -+ the function pointer. \a border will be relayed to the function retrieved by -+ QGuiApplication. When \a border is true, the WS_BORDER flag will be set -+ in full screen mode for all windows by default. -+ - See also \l [QtDoc] {Fullscreen OpenGL Based Windows} -+ \sa setHasBorderInFullScreen() - */ - - /*! -diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp -index 05d6ac9201..eeb1aa58a3 100644 ---- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp -+++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp -@@ -293,6 +293,8 @@ QFunctionPointer QWindowsNativeInterface::platformFunction(const QByteArray &fun - return QFunctionPointer(QWindowsWindow::setTouchWindowTouchTypeStatic); - if (function == QWindowsWindowFunctions::setHasBorderInFullScreenIdentifier()) - return QFunctionPointer(QWindowsWindow::setHasBorderInFullScreenStatic); -+ if (function == QWindowsWindowFunctions::setHasBorderInFullScreenDefaultIdentifier()) -+ return QFunctionPointer(QWindowsWindow::setHasBorderInFullScreenDefault); - if (function == QWindowsWindowFunctions::setWindowActivationBehaviorIdentifier()) - return QFunctionPointer(QWindowsNativeInterface::setWindowActivationBehavior); - if (function == QWindowsWindowFunctions::isTabletModeIdentifier()) -diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp -index 910d8dd209..9705eb7293 100644 ---- a/src/plugins/platforms/windows/qwindowswindow.cpp -+++ b/src/plugins/platforms/windows/qwindowswindow.cpp -@@ -1180,6 +1180,7 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w, - - const char *QWindowsWindow::embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle"; - const char *QWindowsWindow::hasBorderInFullScreenProperty = "_q_has_border_in_fullscreen"; -+bool QWindowsWindow::m_borderInFullScreenDefault = false; - - QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) : - QWindowsBaseWindow(aWindow), -@@ -1217,7 +1218,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) - - if (aWindow->isTopLevel()) - setWindowIcon(aWindow->icon()); -- if (aWindow->property(hasBorderInFullScreenProperty).toBool()) -+ if (m_borderInFullScreenDefault || aWindow->property(hasBorderInFullScreenProperty).toBool()) - setFlag(HasBorderInFullScreen); - clearFlag(WithinCreate); - } -@@ -2820,6 +2821,11 @@ void QWindowsWindow::setHasBorderInFullScreenStatic(QWindow *window, bool border - window->setProperty(hasBorderInFullScreenProperty, QVariant(border)); - } - -+void QWindowsWindow::setHasBorderInFullScreenDefault(bool border) -+{ -+ m_borderInFullScreenDefault = border; -+} -+ - void QWindowsWindow::setHasBorderInFullScreen(bool border) - { - if (testFlag(HasBorderInFullScreen) == border) -diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h -index b9b398b67b..b07bd15d2a 100644 ---- a/src/plugins/platforms/windows/qwindowswindow.h -+++ b/src/plugins/platforms/windows/qwindowswindow.h -@@ -341,6 +341,7 @@ public: - static void setTouchWindowTouchTypeStatic(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes); - void registerTouchWindow(QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes = QWindowsWindowFunctions::NormalTouch); - static void setHasBorderInFullScreenStatic(QWindow *window, bool border); -+ static void setHasBorderInFullScreenDefault(bool border); - void setHasBorderInFullScreen(bool border); - static QString formatWindowTitle(const QString &title); - -@@ -386,6 +387,7 @@ private: - // note: intentionally not using void * in order to avoid breaking x86 - VkSurfaceKHR m_vkSurface = 0; - #endif -+ static bool m_borderInFullScreenDefault; - }; - - #ifndef QT_NO_DEBUG_STREAM --- -2.18.0.windows.1 - diff --git a/src/scripts/build_ci.sh b/src/scripts/build_ci.sh index e9adc8d78..e7f005856 100755 --- a/src/scripts/build_ci.sh +++ b/src/scripts/build_ci.sh @@ -73,7 +73,7 @@ fi CWD=`pwd` MKJOBS=${MKJOBS:-4} -COMMIT=`git rev-parse --short HEAD` +COMMIT=`git rev-parse --short=8 HEAD` BRANCH=`git rev-parse --abbrev-ref HEAD` if [ "${BRANCH}" = "main" ]; then diff --git a/src/scripts/build_docker.sh b/src/scripts/build_docker.sh index a1a1aa824..9ec6f2e35 100755 --- a/src/scripts/build_docker.sh +++ b/src/scripts/build_docker.sh @@ -37,13 +37,13 @@ if [ "${DISTRO_ID}" != "ubuntu" ]; then exit 1 fi -DISTRO_VERSION_ID=`cat /etc/os-release | sed '/^VERSION_ID=/!d;s/VERSION_ID=//;s/"//g'` -DID="${DISTRO_ID}${DISTRO_VERSION_ID}" +DISTRO_VERSION_ID=`cat /etc/os-release | sed '/^VERSION_CODENAME=/!d;s/VERSION_CODENAME=//;s/"//g;'` +DID="${DISTRO_ID}-${DISTRO_VERSION_ID}" FRICTION_ROOT="/friction.graphics" FRICTION_DIR="${FRICTION_ROOT}/friction" FRICTION_SRC_DIR="${FRICTION_DIR}/src" -FRICTION_OUT_DIR="/snapshots" +FRICTION_OUT_DIR="/distfiles/builds" FRICTION_BRANCH=${FRICTION_BRANCH:-""} FRICTION_COMMIT=${FRICTION_COMMIT:-""} @@ -79,12 +79,12 @@ if [ ! -d "${FRICTION_SRC_DIR}" ]; then if [ "${FRICTION_TAG}" != "" ]; then (cd friction; git checkout tags/${FRICTION_TAG}) fi - #(cd friction; git submodule update -i docs) + (cd friction; git submodule update -i --recursive) fi cd ${FRICTION_DIR} -COMMIT=`git rev-parse --short HEAD` +COMMIT=`git rev-parse --short=8 HEAD` BRANCH=`git rev-parse --abbrev-ref HEAD` VERSION="dev" @@ -101,6 +101,8 @@ CMAKE_EXTRA="${CMAKE_EXTRA} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clan if [ "${REL}" = 1 ]; then cmake -G Ninja \ -DFRICTION_OFFICIAL_RELEASE=ON \ + -DGIT_COMMIT=${COMMIT} \ + -DGIT_BRANCH=${BRANCH} \ ${CMAKE_EXTRA} .. VERSION=`cat version.txt` else @@ -109,7 +111,7 @@ else -DGIT_BRANCH=${BRANCH} \ ${CMAKE_EXTRA} .. VERSION=`cat version.txt` - VERSION="${VERSION}-dev-${COMMIT}" + VERSION="${VERSION}-${BRANCH}-${COMMIT}" fi cmake --build . diff --git a/src/scripts/build_vfxplatform.sh b/src/scripts/build_vfxplatform.sh index e1d0e6e83..4f2fb462f 100755 --- a/src/scripts/build_vfxplatform.sh +++ b/src/scripts/build_vfxplatform.sh @@ -32,6 +32,15 @@ MKJOBS=${MKJOBS:-4} SDK_VERSION=${SDK_VERSION:-""} ONLY_SDK=${ONLY_SDK:-0} SDK_TAR="${DISTFILES}/friction-vfxplatform-sdk-${SDK_VERSION}.tar" +BUILD_RPM=${REL} +DOWNLOAD_SDK=${DOWNLOAD_SDK:-0} + +# Download SDK +if [ "${DOWNLOAD_SDK}" = 1 ] && [ ! -f "${SDK_TAR}.xz" ]; then + (cd ${DISTFILES} ; + wget https://download.friction.graphics/distfiles/vfxplatform/friction-vfxplatform-sdk-${SDK_VERSION}.tar.xz + ) +fi # Build SDK if [ ! -d "${SDK}" ]; then @@ -69,8 +78,9 @@ ${BUILD}/build_vfxplatform_friction.sh # Get Friction version VERSION=`cat ${BUILD}/friction/build-vfxplatform/version.txt` if [ "${REL}" != 1 ]; then - GIT=`(cd ${BUILD}/friction ; git rev-parse --short HEAD)` - VERSION="${VERSION}-dev-${GIT}" + GIT_COMMIT=`(cd ${BUILD}/friction ; git rev-parse --short=8 HEAD)` + GIT_BRANCH=`(cd ${BUILD}/friction ; git rev-parse --abbrev-ref HEAD)` + VERSION="${VERSION}-${GIT_BRANCH}-${GIT_COMMIT}" fi # Package Friction @@ -78,4 +88,5 @@ SDK=${SDK} \ DISTFILES=${DISTFILES} \ BUILD=${BUILD} \ VERSION=${VERSION} \ +PKG_RPM=${BUILD_RPM} \ ${BUILD}/build_vfxplatform_package.sh diff --git a/src/scripts/build_vfxplatform_friction.sh b/src/scripts/build_vfxplatform_friction.sh index 98c962458..af191f2a1 100755 --- a/src/scripts/build_vfxplatform_friction.sh +++ b/src/scripts/build_vfxplatform_friction.sh @@ -76,6 +76,11 @@ fi cp -a ${SDK}/include/libunw* /usr/include/ cp -a ${SDK}/lib/libunw* /usr/lib64/ +CMAKE_EXTRA="" + +GIT_COMMIT=`git rev-parse --short=8 HEAD` +GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` + cmake -GNinja \ -DCMAKE_INSTALL_PREFIX=${SDK} \ -DCMAKE_PREFIX_PATH=${SDK} \ @@ -88,12 +93,13 @@ cmake -GNinja \ -DQSCINTILLA_LIBRARIES=qscintilla2_friction_qt5 \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang \ +-DGIT_COMMIT=${GIT_COMMIT} \ +-DGIT_BRANCH=${GIT_BRANCH} \ .. VERSION=`cat version.txt` if [ "${REL}" != 1 ]; then - GIT=`git rev-parse --short HEAD` - VERSION="${VERSION}-dev-${GIT}" + VERSION="${VERSION}-${GIT_BRANCH}-${GIT_COMMIT}" fi cmake --build . diff --git a/src/scripts/build_vfxplatform_package.sh b/src/scripts/build_vfxplatform_package.sh index fe30f884a..bd8569dc9 100755 --- a/src/scripts/build_vfxplatform_package.sh +++ b/src/scripts/build_vfxplatform_package.sh @@ -26,6 +26,8 @@ BUILD=${BUILD:-"${HOME}"} VERSION=${VERSION:-""} APPID="graphics.friction.Friction" FRICTION_PKG=friction-${VERSION} +PKG_RPM=${PKG_RPM:-1} +PKG_APP=${PKG_APP:-1} if [ "${VERSION}" = "" ]; then echo "Missing version" @@ -38,8 +40,8 @@ if [ ! -d "${BUILD}/${FRICTION_PKG}" ]; then exit 1 fi -if [ ! -d "${DISTFILES}/builds" ]; then - mkdir -p ${DISTFILES}/builds +if [ ! -d "${DISTFILES}/builds/${VERSION}" ]; then + mkdir -p ${DISTFILES}/builds/${VERSION} fi export PATH="${SDK}/bin:${PATH}" @@ -132,6 +134,8 @@ strip -s ${BUILD}/${FRICTION_PKG}/opt/friction/bin/friction strip -s ${BUILD}/${FRICTION_PKG}/opt/friction/lib/*so* strip -s ${BUILD}/${FRICTION_PKG}/opt/friction/plugins/*/*.so +# RPM +if [ "${PKG_RPM}" = 1 ]; then cd ${BUILD} tar cvf ${FRICTION_PKG}.tar ${FRICTION_PKG} @@ -142,9 +146,9 @@ fi mv ${FRICTION_PKG}.tar ${HOME}/rpmbuild/SOURCES/ cat ${BUILD}/friction/src/scripts/vfxplatform.spec | sed 's/__FRICTION_PKG_VERSION__/'${PKG_VERSION}'/g;s/__FRICTION_VERSION__/'${VERSION}'/g;s/__APPID__/'${APPID}'/g' > rpm.spec -# RPM rpmbuild -bb rpm.spec -cp -a ${HOME}/rpmbuild/RPMS/*/*.rpm ${DISTFILES}/builds/ +cp -a ${HOME}/rpmbuild/RPMS/*/*.rpm ${DISTFILES}/builds/${VERSION}/ +fi # Portable FRICTION_PORTABLE=${FRICTION_PKG}-linux-X11-x86_64 @@ -184,9 +188,10 @@ done cd ${BUILD} tar cvf ${FRICTION_PORTABLE}.tar ${FRICTION_PORTABLE} xz -9 ${FRICTION_PORTABLE}.tar -cp -a ${FRICTION_PORTABLE}.tar.xz ${DISTFILES}/builds/ +cp -a ${FRICTION_PORTABLE}.tar.xz ${DISTFILES}/builds/${VERSION}/ # AppImage +if [ "${PKG_APP}" = 1 ]; then (cd ${FRICTION_PORTABLE_DIR} ; rm -f friction mkdir usr @@ -196,8 +201,14 @@ ln -sf usr/share/applications/${APPID}.desktop . ln -sf usr/share/icons/hicolor/256x256/apps/${APPID}.png . ln -sf usr/share/icons/hicolor/256x256/apps/${APPID}.png .DirIcon ) +if [ ! -f "${DISTFILES}/appimagetool.tar.xz" ]; then + (cd ${DISTFILES} ; + wget https://download.friction.graphics/distfiles/misc/appimagetool.tar.xz + ) +fi tar xf ${DISTFILES}/appimagetool.tar.xz ARCH=x86_64 ./appimagetool/AppRun ${FRICTION_PORTABLE} -cp -a *.AppImage ${DISTFILES}/builds/ +cp -a *.AppImage ${DISTFILES}/builds/${VERSION}/ +fi -echo "PKG DONE" +echo "FRICTION PACKAGE DONE" diff --git a/src/scripts/run_docker.sh b/src/scripts/run_docker.sh index 97750e9c1..540a54b01 100755 --- a/src/scripts/run_docker.sh +++ b/src/scripts/run_docker.sh @@ -26,15 +26,15 @@ REL=${REL:-0} BRANCH=${BRANCH:-""} COMMIT=${COMMIT:-""} TAG=${TAG:-""} -MKJOBS=${JOBS:-4} +MKJOBS=${MKJOBS:-4} JAMMY=${JAMMY:-1} MANTIC=${MANTIC:-1} NOBLE=${NOBLE:-1} -MOUNT_DIR="snapshots" +MOUNT_DIR="distfiles" DOCKER_MOUNT="-t --mount type=bind,source=${CWD}/${MOUNT_DIR},target=/${MOUNT_DIR}" -DOCKER="docker run -e REL=${REL} -e MKJOBS=${JOBS}" +DOCKER="docker run -e REL=${REL} -e MKJOBS=${MKJOBS}" if [ "${BRANCH}" != "" ]; then DOCKER="${DOCKER} -e FRICTION_BRANCH=${BRANCH}" diff --git a/src/scripts/run_vfxplatform.sh b/src/scripts/run_vfxplatform.sh index bfe4dc2ae..eb2fcf73d 100755 --- a/src/scripts/run_vfxplatform.sh +++ b/src/scripts/run_vfxplatform.sh @@ -8,16 +8,15 @@ COMMIT=${COMMIT:-""} TAG=${TAG:-""} MKJOBS=${JOBS:-4} ONLY_SDK=${ONLY_SDK:-0} - +DOWNLOAD_SDK=${DOWNLOAD_SDK:-0} SDK_VERSION="20240123" DOCKER="docker run" -DOCKER="${DOCKER} -e REL=${REL} -e MKJOBS=${JOBS} -e SDK_VERSION=${SDK_VERSION} -e ONLY_SDK=${ONLY_SDK} -e BRANCH=${BRANCH} -e COMMIT=${COMMIT} -e TAG=${TAG}" +DOCKER="${DOCKER} -e REL=${REL} -e MKJOBS=${JOBS} -e SDK_VERSION=${SDK_VERSION} -e ONLY_SDK=${ONLY_SDK} -e DOWNLOAD_SDK=${DOWNLOAD_SDK} -e BRANCH=${BRANCH} -e COMMIT=${COMMIT} -e TAG=${TAG}" DOCKER="${DOCKER} -t --mount type=bind,source=${CWD}/distfiles,target=/mnt" if [ ! -d "${CWD}/distfiles" ]; then - echo "No distfiles!" - exit 1 + mkdir -p ${CWD}/distfiles fi (cd src/scripts; docker build -t friction-vfxplatform -f Dockerfile.vfxplatform .) diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt new file mode 100644 index 000000000..03b02b45e --- /dev/null +++ b/src/ui/CMakeLists.txt @@ -0,0 +1,138 @@ +# +# Friction - https://friction.graphics +# +# Copyright (c) Friction contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +cmake_minimum_required(VERSION 3.12) +project(frictionui LANGUAGES CXX) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") + +include(friction-version) +include(friction-meta) +include(friction-common) +include(friction-ffmpeg) + +message("-- ffmpeg include: ${FFMPEG_INCLUDE_DIRS}") +message("-- ffmpeg libraries: ${FFMPEG_LIBRARIES_DIRS} ${FFMPEG_LIBRARIES}") +message("-- skia libraries: ${SKIA_LIBRARIES}") + +add_definitions(-DUI_LIBRARY) + +include_directories( + ${FFMPEG_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../core + ${CMAKE_CURRENT_SOURCE_DIR}/../engine/skia +) + +set( + SOURCES + dialogs/applyexpressiondialog.cpp + dialogs/durationrectsettingsdialog.cpp + dialogs/exportsvgdialog.cpp + dialogs/scenesettingsdialog.cpp + optimalscrollarena/minimalscrollwidget.cpp + optimalscrollarena/scrollarea.cpp + optimalscrollarena/scrollvisiblepartbase.cpp + optimalscrollarena/scrollwidget.cpp + optimalscrollarena/scrollwidgetvisiblepart.cpp + optimalscrollarena/singlewidget.cpp + widgets/actionbutton.cpp + widgets/alignwidget.cpp + widgets/assetswidget.cpp + widgets/bookmarkedwidget.cpp + widgets/buttonbase.cpp + widgets/buttonslist.cpp + widgets/changewidthwidget.cpp + widgets/ecombobox.cpp + widgets/editablecombobox.cpp + widgets/fakemenubar.cpp + widgets/flowlayout.cpp + widgets/labeledslider.cpp + widgets/scenechooser.cpp + widgets/twocolumnlayout.cpp + widgets/uilayout.cpp +) + +set( + HEADERS + ui_global.h + dialogs/applyexpressiondialog.h + dialogs/durationrectsettingsdialog.h + dialogs/exportsvgdialog.h + dialogs/scenesettingsdialog.h + optimalscrollarena/minimalscrollwidget.h + optimalscrollarena/scrollarea.h + optimalscrollarena/scrollvisiblepartbase.h + optimalscrollarena/scrollwidget.h + optimalscrollarena/scrollwidgetvisiblepart.h + optimalscrollarena/singlewidget.h + widgets/actionbutton.h + widgets/alignwidget.h + widgets/assetswidget.h + widgets/bookmarkedwidget.h + widgets/buttonbase.h + widgets/buttonslist.h + widgets/changewidthwidget.h + widgets/ecombobox.h + widgets/editablecombobox.h + widgets/fakemenubar.h + widgets/flowlayout.h + widgets/labeledslider.h + widgets/scenechooser.h + widgets/toolbutton.h + widgets/twocolumnlayout.h + widgets/uilayout.h + widgets/vlabel.h +) + +if(NOT WIN32) + add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES}) +else() + add_library(${PROJECT_NAME} SHARED ${HEADERS} ${SOURCES}) +endif() + +set_target_properties( + ${PROJECT_NAME} + PROPERTIES + VERSION + ${PROJECT_VERSION} +) + +set_target_properties( + ${PROJECT_NAME} + PROPERTIES + SOVERSION + ${PROJECT_VERSION_MAJOR} +) + +target_link_directories( + ${PROJECT_NAME} + PRIVATE + ${FFMPEG_LIBRARIES_DIRS} + ${CMAKE_CURRENT_BINARY_DIR}/../engine/skia +) + +target_link_libraries( + ${PROJECT_NAME} + PRIVATE + frictioncore + ${QT_LIBRARIES} + ${SKIA_LIBRARIES} + ${FFMPEG_LIBRARIES} +) diff --git a/src/app/GUI/Dialogs/applyexpressiondialog.cpp b/src/ui/dialogs/applyexpressiondialog.cpp old mode 100755 new mode 100644 similarity index 98% rename from src/app/GUI/Dialogs/applyexpressiondialog.cpp rename to src/ui/dialogs/applyexpressiondialog.cpp index a9599952e..5ea054a19 --- a/src/app/GUI/Dialogs/applyexpressiondialog.cpp +++ b/src/ui/dialogs/applyexpressiondialog.cpp @@ -28,7 +28,7 @@ #include #include -#include "GUI/twocolumnlayout.h" +#include "widgets/twocolumnlayout.h" #include "GUI/global.h" #include "canvas.h" #include "Private/document.h" diff --git a/src/app/GUI/Dialogs/applyexpressiondialog.h b/src/ui/dialogs/applyexpressiondialog.h old mode 100755 new mode 100644 similarity index 94% rename from src/app/GUI/Dialogs/applyexpressiondialog.h rename to src/ui/dialogs/applyexpressiondialog.h index 4246d2aa3..18ac5cf27 --- a/src/app/GUI/Dialogs/applyexpressiondialog.h +++ b/src/ui/dialogs/applyexpressiondialog.h @@ -26,13 +26,16 @@ #ifndef APPLYEXPRESSIONDIALOG_H #define APPLYEXPRESSIONDIALOG_H +#include "ui_global.h" + #include #include #include "Animators/qrealanimator.h" -class ApplyExpressionDialog : public QDialog { +class UI_EXPORT ApplyExpressionDialog : public QDialog +{ public: ApplyExpressionDialog(QrealAnimator* const target, QWidget * const parent = nullptr); diff --git a/src/app/GUI/Dialogs/durationrectsettingsdialog.cpp b/src/ui/dialogs/durationrectsettingsdialog.cpp old mode 100755 new mode 100644 similarity index 98% rename from src/app/GUI/Dialogs/durationrectsettingsdialog.cpp rename to src/ui/dialogs/durationrectsettingsdialog.cpp index f951a1e61..9c9821880 --- a/src/app/GUI/Dialogs/durationrectsettingsdialog.cpp +++ b/src/ui/dialogs/durationrectsettingsdialog.cpp @@ -24,7 +24,7 @@ // Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner #include "durationrectsettingsdialog.h" -#include "../twocolumnlayout.h" +#include "widgets/twocolumnlayout.h" #include diff --git a/src/app/GUI/Dialogs/durationrectsettingsdialog.h b/src/ui/dialogs/durationrectsettingsdialog.h old mode 100755 new mode 100644 similarity index 94% rename from src/app/GUI/Dialogs/durationrectsettingsdialog.h rename to src/ui/dialogs/durationrectsettingsdialog.h index 05e8a9646..fdc5c1a90 --- a/src/app/GUI/Dialogs/durationrectsettingsdialog.h +++ b/src/ui/dialogs/durationrectsettingsdialog.h @@ -25,16 +25,21 @@ #ifndef DURATIONRECTSETTINGSDIALOG_H #define DURATIONRECTSETTINGSDIALOG_H + +#include "ui_global.h" + #include #include #include #include #include "Timeline/durationrectangle.h" + class QHBoxLayout; class QVBoxLayout; class TwoColumnLayout; -class DurationRectSettingsDialog : public QDialog { +class UI_EXPORT DurationRectSettingsDialog : public QDialog +{ public: DurationRectSettingsDialog(DurationRectangle* const target, QWidget *parent = nullptr); @@ -42,6 +47,7 @@ class DurationRectSettingsDialog : public QDialog { int getMinFrame() const; int getMaxFrame() const; int getShift() const; + private: DurationRectangle* const mTarget; diff --git a/src/app/GUI/Dialogs/exportsvgdialog.cpp b/src/ui/dialogs/exportsvgdialog.cpp old mode 100755 new mode 100644 similarity index 99% rename from src/app/GUI/Dialogs/exportsvgdialog.cpp rename to src/ui/dialogs/exportsvgdialog.cpp index 227a921ac..c16936495 --- a/src/app/GUI/Dialogs/exportsvgdialog.cpp +++ b/src/ui/dialogs/exportsvgdialog.cpp @@ -22,12 +22,12 @@ #include "exportsvgdialog.h" #include "Private/document.h" -#include "GUI/scenechooser.h" +#include "widgets/scenechooser.h" #include "GUI/global.h" #include "canvas.h" #include "svgexporter.h" #include "GUI/edialogs.h" -#include "GUI/twocolumnlayout.h" +#include "widgets/twocolumnlayout.h" #include "appsupport.h" #include diff --git a/src/app/GUI/Dialogs/exportsvgdialog.h b/src/ui/dialogs/exportsvgdialog.h old mode 100755 new mode 100644 similarity index 95% rename from src/app/GUI/Dialogs/exportsvgdialog.h rename to src/ui/dialogs/exportsvgdialog.h index bf1daab28..e021a49a6 --- a/src/app/GUI/Dialogs/exportsvgdialog.h +++ b/src/ui/dialogs/exportsvgdialog.h @@ -22,6 +22,8 @@ #ifndef EXPORTSVGDIALOG_H #define EXPORTSVGDIALOG_H +#include "ui_global.h" + #include #include #include @@ -31,7 +33,7 @@ class SceneChooser; class ComplexTask; -class ExportSvgDialog : public QDialog +class UI_EXPORT ExportSvgDialog : public QDialog { public: ExportSvgDialog(QWidget* const parent = nullptr); diff --git a/src/app/GUI/Dialogs/scenesettingsdialog.cpp b/src/ui/dialogs/scenesettingsdialog.cpp similarity index 100% rename from src/app/GUI/Dialogs/scenesettingsdialog.cpp rename to src/ui/dialogs/scenesettingsdialog.cpp diff --git a/src/app/GUI/Dialogs/scenesettingsdialog.h b/src/ui/dialogs/scenesettingsdialog.h similarity index 97% rename from src/app/GUI/Dialogs/scenesettingsdialog.h rename to src/ui/dialogs/scenesettingsdialog.h index 2f10b5752..26eb1465d 100644 --- a/src/app/GUI/Dialogs/scenesettingsdialog.h +++ b/src/ui/dialogs/scenesettingsdialog.h @@ -26,6 +26,8 @@ #ifndef SCENESETTINGSDIALOG_H #define SCENESETTINGSDIALOG_H +#include "ui_global.h" + #include #include #include @@ -38,13 +40,13 @@ #include "smartPointers/ememory.h" #include "framerange.h" - class Document; class Canvas; class ColorAnimator; class ColorAnimatorButton; -class SceneSettingsDialog : public QDialog { +class UI_EXPORT SceneSettingsDialog : public QDialog +{ public: SceneSettingsDialog(Canvas * const canvas, QWidget * const parent = nullptr); @@ -70,6 +72,7 @@ class SceneSettingsDialog : public QDialog { void applySettingsToCanvas(Canvas * const canvas) const; static void sNewSceneDialog(Document &document, QWidget * const parent); + private: bool validate(); diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/minimalscrollwidget.cpp b/src/ui/optimalscrollarena/minimalscrollwidget.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/BoxesList/OptimalScrollArea/minimalscrollwidget.cpp rename to src/ui/optimalscrollarena/minimalscrollwidget.cpp diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/minimalscrollwidget.h b/src/ui/optimalscrollarena/minimalscrollwidget.h old mode 100755 new mode 100644 similarity index 95% rename from src/app/GUI/BoxesList/OptimalScrollArea/minimalscrollwidget.h rename to src/ui/optimalscrollarena/minimalscrollwidget.h index 5820ef533..11bfa8561 --- a/src/app/GUI/BoxesList/OptimalScrollArea/minimalscrollwidget.h +++ b/src/ui/optimalscrollarena/minimalscrollwidget.h @@ -26,17 +26,20 @@ #ifndef MINIMALSCROLLWIDGET_H #define MINIMALSCROLLWIDGET_H +#include "ui_global.h" #include #include #include #include #include + class SingleWidget; class ScrollVisiblePartBase; class ScrollArea; -class MinimalScrollWidget : public QWidget { +class UI_EXPORT MinimalScrollWidget : public QWidget +{ Q_OBJECT public: explicit MinimalScrollWidget(ScrollVisiblePartBase * const visiblePart, @@ -51,9 +54,11 @@ class MinimalScrollWidget : public QWidget { void setWidth(const int width); int minHeight() const; + protected: ScrollVisiblePartBase* visiblePartWidget() const { return mVisiblePartWidget; } + private: ScrollVisiblePartBase * const mVisiblePartWidget; ScrollArea * const mParentScrollArea; diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/scrollarea.cpp b/src/ui/optimalscrollarena/scrollarea.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/BoxesList/OptimalScrollArea/scrollarea.cpp rename to src/ui/optimalscrollarena/scrollarea.cpp diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/scrollarea.h b/src/ui/optimalscrollarena/scrollarea.h old mode 100755 new mode 100644 similarity index 94% rename from src/app/GUI/BoxesList/OptimalScrollArea/scrollarea.h rename to src/ui/optimalscrollarena/scrollarea.h index 18928d4d0..1e9fcb578 --- a/src/app/GUI/BoxesList/OptimalScrollArea/scrollarea.h +++ b/src/ui/optimalscrollarena/scrollarea.h @@ -25,20 +25,28 @@ #ifndef SCROLLAREA_H #define SCROLLAREA_H + +#include "ui_global.h" + #include -class ScrollArea : public QScrollArea { +class UI_EXPORT ScrollArea : public QScrollArea +{ Q_OBJECT + public: ScrollArea(QWidget * const parent = nullptr); void scrollBy(const int x, const int y); void callWheelEvent(QWheelEvent *event); + signals: void heightChanged(int); void widthChanged(int); + protected: void resizeEvent(QResizeEvent *e); + private: int mLastHeight = 0; int mLastWidth = 0; diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/scrollvisiblepartbase.cpp b/src/ui/optimalscrollarena/scrollvisiblepartbase.cpp old mode 100755 new mode 100644 similarity index 99% rename from src/app/GUI/BoxesList/OptimalScrollArea/scrollvisiblepartbase.cpp rename to src/ui/optimalscrollarena/scrollvisiblepartbase.cpp index c8f08d355..c89a74193 --- a/src/app/GUI/BoxesList/OptimalScrollArea/scrollvisiblepartbase.cpp +++ b/src/ui/optimalscrollarena/scrollvisiblepartbase.cpp @@ -29,8 +29,8 @@ #include "singlewidget.h" #include "scrollwidget.h" #include "singlewidgettarget.h" -#include "GUI/mainwindow.h" #include "GUI/global.h" +#include ScrollVisiblePartBase::ScrollVisiblePartBase( MinimalScrollWidget * const parent) { diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/scrollvisiblepartbase.h b/src/ui/optimalscrollarena/scrollvisiblepartbase.h old mode 100755 new mode 100644 similarity index 96% rename from src/app/GUI/BoxesList/OptimalScrollArea/scrollvisiblepartbase.h rename to src/ui/optimalscrollarena/scrollvisiblepartbase.h index c93058e7e..d6c4089be --- a/src/app/GUI/BoxesList/OptimalScrollArea/scrollvisiblepartbase.h +++ b/src/ui/optimalscrollarena/scrollvisiblepartbase.h @@ -25,11 +25,16 @@ #ifndef SCROLLVISIBLEPARTBASE_H #define SCROLLVISIBLEPARTBASE_H + +#include "ui_global.h" + class MinimalScrollWidget; class SingleWidget; + #include -class ScrollVisiblePartBase : public QWidget { +class UI_EXPORT ScrollVisiblePartBase : public QWidget +{ public: ScrollVisiblePartBase(MinimalScrollWidget * const parent); @@ -62,8 +67,10 @@ class ScrollVisiblePartBase : public QWidget { const QList& widgets() const { return mSingleWidgets; } + protected: bool event(QEvent* event); + private: void postUpdateEvent(); diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/scrollwidget.cpp b/src/ui/optimalscrollarena/scrollwidget.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/BoxesList/OptimalScrollArea/scrollwidget.cpp rename to src/ui/optimalscrollarena/scrollwidget.cpp diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/scrollwidget.h b/src/ui/optimalscrollarena/scrollwidget.h old mode 100755 new mode 100644 similarity index 96% rename from src/app/GUI/BoxesList/OptimalScrollArea/scrollwidget.h rename to src/ui/optimalscrollarena/scrollwidget.h index aa4229f34..53708c833 --- a/src/app/GUI/BoxesList/OptimalScrollArea/scrollwidget.h +++ b/src/ui/optimalscrollarena/scrollwidget.h @@ -26,12 +26,15 @@ #ifndef SCROLLWIDGET_H #define SCROLLWIDGET_H +#include "ui_global.h" + #include #include #include #include "minimalscrollwidget.h" #include "smartPointers/ememory.h" #include "swt_rulescollection.h" + class SingleWidget; class ScrollWidgetVisiblePart; class SWT_Abstraction; @@ -42,8 +45,10 @@ enum class SWT_BoxRule : short; enum class SWT_Target : short; enum class SWT_Type : short; -class ScrollWidget : public MinimalScrollWidget { +class UI_EXPORT ScrollWidget : public MinimalScrollWidget +{ Q_OBJECT + public: explicit ScrollWidget(ScrollWidgetVisiblePart* const visiblePart, ScrollArea * const parent); @@ -74,9 +79,11 @@ class ScrollWidget : public MinimalScrollWidget { void updateVisible(); const QList &visibleWidgets(); + protected: ScrollWidgetVisiblePart* visiblePartWidget() const { return mVisiblePartWidget; } + private: void updateAbstraction(); void updateHeightAfterScrollAreaResize(const int parentHeight); diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/scrollwidgetvisiblepart.cpp b/src/ui/optimalscrollarena/scrollwidgetvisiblepart.cpp old mode 100755 new mode 100644 similarity index 99% rename from src/app/GUI/BoxesList/OptimalScrollArea/scrollwidgetvisiblepart.cpp rename to src/ui/optimalscrollarena/scrollwidgetvisiblepart.cpp index 2fe2ecf82..cd00d4490 --- a/src/app/GUI/BoxesList/OptimalScrollArea/scrollwidgetvisiblepart.cpp +++ b/src/ui/optimalscrollarena/scrollwidgetvisiblepart.cpp @@ -29,7 +29,6 @@ #include "singlewidget.h" #include "scrollwidget.h" #include "singlewidgettarget.h" -#include "GUI/mainwindow.h" #include "GUI/global.h" int ScrollWidgetVisiblePart::sNextId = 0; diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/scrollwidgetvisiblepart.h b/src/ui/optimalscrollarena/scrollwidgetvisiblepart.h old mode 100755 new mode 100644 similarity index 96% rename from src/app/GUI/BoxesList/OptimalScrollArea/scrollwidgetvisiblepart.h rename to src/ui/optimalscrollarena/scrollwidgetvisiblepart.h index e5cd8366f..c5ba775bf --- a/src/app/GUI/BoxesList/OptimalScrollArea/scrollwidgetvisiblepart.h +++ b/src/ui/optimalscrollarena/scrollwidgetvisiblepart.h @@ -26,6 +26,8 @@ #ifndef SCROLLWIDGETVISIBLEPART_H #define SCROLLWIDGETVISIBLEPART_H +#include "ui_global.h" + #include "scrollvisiblepartbase.h" #include #include @@ -33,11 +35,14 @@ #include #include "smartPointers/ememory.h" #include "singlewidgettarget.h" + class ScrollWidget; class SingleWidgetTarget; -class ScrollWidgetVisiblePart : public ScrollVisiblePartBase { +class UI_EXPORT ScrollWidgetVisiblePart : public ScrollVisiblePartBase +{ Q_OBJECT + public: ScrollWidgetVisiblePart(ScrollWidget * const parent); @@ -71,6 +76,7 @@ class ScrollWidgetVisiblePart : public ScrollVisiblePartBase { SWT_Abstraction* getMainAbstration() const { return mMainAbstraction; } + private: void setupUpdateFuncs(); void scheduleSearchUpdate(); diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/singlewidget.cpp b/src/ui/optimalscrollarena/singlewidget.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/BoxesList/OptimalScrollArea/singlewidget.cpp rename to src/ui/optimalscrollarena/singlewidget.cpp diff --git a/src/app/GUI/BoxesList/OptimalScrollArea/singlewidget.h b/src/ui/optimalscrollarena/singlewidget.h old mode 100755 new mode 100644 similarity index 94% rename from src/app/GUI/BoxesList/OptimalScrollArea/singlewidget.h rename to src/ui/optimalscrollarena/singlewidget.h index c1cf3f9e8..d912c60c6 --- a/src/app/GUI/BoxesList/OptimalScrollArea/singlewidget.h +++ b/src/ui/optimalscrollarena/singlewidget.h @@ -26,19 +26,25 @@ #ifndef SINGLEWIDGET_H #define SINGLEWIDGET_H +#include "ui_global.h" + #include #include "smartPointers/stdpointer.h" + class SWT_Abstraction; class ScrollWidgetVisiblePart; class SingleWidgetTarget; -class SingleWidget : public QWidget { +class UI_EXPORT SingleWidget : public QWidget +{ Q_OBJECT + public: SingleWidget(ScrollWidgetVisiblePart *parent = nullptr); virtual void setTargetAbstraction(SWT_Abstraction *abs); SWT_Abstraction *getTargetAbstraction(); SingleWidgetTarget *getTarget() const; + protected: stdptr mTarget; ScrollWidgetVisiblePart *mParent; diff --git a/src/app/keypoint.h b/src/ui/ui_global.h old mode 100755 new mode 100644 similarity index 80% rename from src/app/keypoint.h rename to src/ui/ui_global.h index 3d51eb794..8f28db9ec --- a/src/app/keypoint.h +++ b/src/ui/ui_global.h @@ -23,14 +23,15 @@ // Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner -#ifndef KEYPOINT_H -#define KEYPOINT_H +#ifndef UI_GLOBAL_H +#define UI_GLOBAL_H +#include -class KeyPoint -{ -public: - KeyPoint(); -}; +#if defined(UI_LIBRARY) +# define UI_EXPORT Q_DECL_EXPORT +#else +# define UI_EXPORT Q_DECL_IMPORT +#endif -#endif // KEYPOINT_H \ No newline at end of file +#endif // UI_GLOBAL_H diff --git a/src/app/GUI/actionbutton.cpp b/src/ui/widgets/actionbutton.cpp old mode 100755 new mode 100644 similarity index 97% rename from src/app/GUI/actionbutton.cpp rename to src/ui/widgets/actionbutton.cpp index 0ea57c204..694f02920 --- a/src/app/GUI/actionbutton.cpp +++ b/src/ui/widgets/actionbutton.cpp @@ -31,7 +31,8 @@ ActionButton::ActionButton(const QString &icon, const QString &toolTip, QWidget *parent) : - ButtonBase(toolTip, parent) { + ButtonBase(toolTip, parent) +{ eSizesUI::widget.add(this, [this, icon](int) { mIcon.load(eSettings::sIconsDir() + "/" + icon); setCurrentIcon(mIcon); diff --git a/src/app/GUI/actionbutton.h b/src/ui/widgets/actionbutton.h old mode 100755 new mode 100644 similarity index 93% rename from src/app/GUI/actionbutton.h rename to src/ui/widgets/actionbutton.h index 539293469..a8e1fcb61 --- a/src/app/GUI/actionbutton.h +++ b/src/ui/widgets/actionbutton.h @@ -26,9 +26,12 @@ #ifndef ACTIONBUTTON_H #define ACTIONBUTTON_H +#include "ui_global.h" + #include "buttonbase.h" -class ActionButton : public ButtonBase { +class UI_EXPORT ActionButton : public ButtonBase +{ Q_OBJECT public: explicit ActionButton(const QString &icon, diff --git a/src/app/GUI/alignwidget.cpp b/src/ui/widgets/alignwidget.cpp similarity index 100% rename from src/app/GUI/alignwidget.cpp rename to src/ui/widgets/alignwidget.cpp diff --git a/src/app/GUI/alignwidget.h b/src/ui/widgets/alignwidget.h similarity index 94% rename from src/app/GUI/alignwidget.h rename to src/ui/widgets/alignwidget.h index 1cb5dd945..529f25465 100644 --- a/src/app/GUI/alignwidget.h +++ b/src/ui/widgets/alignwidget.h @@ -26,12 +26,14 @@ #ifndef ALIGNWIDGET_H #define ALIGNWIDGET_H +#include "ui_global.h" + #include #include #include "canvas.h" -class AlignWidget : public QWidget +class UI_EXPORT AlignWidget : public QWidget { Q_OBJECT diff --git a/src/app/GUI/assetswidget.cpp b/src/ui/widgets/assetswidget.cpp similarity index 100% rename from src/app/GUI/assetswidget.cpp rename to src/ui/widgets/assetswidget.cpp diff --git a/src/app/GUI/assetswidget.h b/src/ui/widgets/assetswidget.h similarity index 91% rename from src/app/GUI/assetswidget.h rename to src/ui/widgets/assetswidget.h index e0a89402a..bcaad3378 100644 --- a/src/app/GUI/assetswidget.h +++ b/src/ui/widgets/assetswidget.h @@ -24,6 +24,8 @@ #ifndef ASSETSWIDGET_H #define ASSETSWIDGET_H +#include "ui_global.h" + #include #include #include @@ -37,7 +39,7 @@ #include "FileCacheHandlers/filecachehandler.h" #include "fileshandler.h" -class AssetsTreeWidget : public QTreeWidget +class UI_EXPORT AssetsTreeWidget : public QTreeWidget { public: explicit AssetsTreeWidget(QWidget *parent); @@ -49,7 +51,7 @@ class AssetsTreeWidget : public QTreeWidget void dragMoveEvent(QDragMoveEvent *event); }; -class AssetsWidgetItem : public QTreeWidgetItem +class UI_EXPORT AssetsWidgetItem : public QTreeWidgetItem { public: explicit AssetsWidgetItem(QTreeWidget *parent = nullptr, @@ -62,7 +64,7 @@ class AssetsWidgetItem : public QTreeWidgetItem bool missing); }; -class AssetsWidget : public QWidget +class UI_EXPORT AssetsWidget : public QWidget { Q_OBJECT diff --git a/src/app/GUI/bookmarkedwidget.cpp b/src/ui/widgets/bookmarkedwidget.cpp old mode 100755 new mode 100644 similarity index 82% rename from src/app/GUI/bookmarkedwidget.cpp rename to src/ui/widgets/bookmarkedwidget.cpp index f2f2ff0d8..c1e7cf2bc --- a/src/app/GUI/bookmarkedwidget.cpp +++ b/src/ui/widgets/bookmarkedwidget.cpp @@ -1,3 +1,28 @@ +/* +# +# Friction - https://friction.graphics +# +# Copyright (c) Friction contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# See 'README.md' for more information. +# +*/ + +// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner + #include "bookmarkedwidget.h" #include "Private/esettings.h" #include "GUI/global.h" diff --git a/src/app/GUI/namedcontainer.h b/src/ui/widgets/bookmarkedwidget.h old mode 100755 new mode 100644 similarity index 51% rename from src/app/GUI/namedcontainer.h rename to src/ui/widgets/bookmarkedwidget.h index 39bc1fec0..0ee904a72 --- a/src/app/GUI/namedcontainer.h +++ b/src/ui/widgets/bookmarkedwidget.h @@ -23,21 +23,41 @@ // Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner -#ifndef NAMEDCONTAINER_H -#define NAMEDCONTAINER_H +#ifndef BOOKMARKEDWIDGET_H +#define BOOKMARKEDWIDGET_H + +#include "ui_global.h" #include -#include -#include +#include -class NamedContainer : public QWidget { +class UI_EXPORT BookmarkedWidget : public QWidget +{ public: - explicit NamedContainer(const QString &name, - QWidget* widget, const bool vertical, - QWidget *parent = nullptr); + explicit BookmarkedWidget(const bool vertical, + const int dimension, + QWidget *parent = nullptr); + + void addWidget(QWidget* const wid); + void removeWidget(QWidget* const wid); + QWidget* getWidget(const int id) const; + int count() const + { return mWidgets.count(); } + void updateSize(); + +protected: + void resizeEvent(QResizeEvent *event); + private: - QLabel* mNameLabel; - QBoxLayout* mLayout; + void updateLayout(); + + const bool mVertical; + const int mDimension; + QPushButton* mUpArrow; + QPushButton* mDownArrow; + QList mWidgets; + int mFirstViewed = 0; + int mLastViewed = 0; }; -#endif // NAMEDCONTAINER_H +#endif // BOOKMARKEDWIDGET_H diff --git a/src/app/GUI/buttonbase.cpp b/src/ui/widgets/buttonbase.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/buttonbase.cpp rename to src/ui/widgets/buttonbase.cpp diff --git a/src/app/GUI/buttonbase.h b/src/ui/widgets/buttonbase.h old mode 100755 new mode 100644 similarity index 95% rename from src/app/GUI/buttonbase.h rename to src/ui/widgets/buttonbase.h index 04a04a755..86dd2146d --- a/src/app/GUI/buttonbase.h +++ b/src/ui/widgets/buttonbase.h @@ -26,9 +26,12 @@ #ifndef BUTTONBASE_H #define BUTTONBASE_H +#include "ui_global.h" + #include -class ButtonBase : public QWidget { +class UI_EXPORT ButtonBase : public QWidget +{ Q_OBJECT public: explicit ButtonBase(const QString &toolTip, diff --git a/src/app/GUI/buttonslist.cpp b/src/ui/widgets/buttonslist.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/buttonslist.cpp rename to src/ui/widgets/buttonslist.cpp diff --git a/src/app/GUI/buttonslist.h b/src/ui/widgets/buttonslist.h old mode 100755 new mode 100644 similarity index 94% rename from src/app/GUI/buttonslist.h rename to src/ui/widgets/buttonslist.h index 86386b329..f1cf9600d --- a/src/app/GUI/buttonslist.h +++ b/src/ui/widgets/buttonslist.h @@ -22,10 +22,13 @@ #ifndef BUTTONSLIST_H #define BUTTONSLIST_H +#include "ui_global.h" + #include #include -class ButtonsList : public QWidget { +class UI_EXPORT ButtonsList : public QWidget +{ public: using Trigger = std::function; using TextTrigger = std::pair; diff --git a/src/app/GUI/changewidthwidget.cpp b/src/ui/widgets/changewidthwidget.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/changewidthwidget.cpp rename to src/ui/widgets/changewidthwidget.cpp diff --git a/src/app/GUI/changewidthwidget.h b/src/ui/widgets/changewidthwidget.h old mode 100755 new mode 100644 similarity index 94% rename from src/app/GUI/changewidthwidget.h rename to src/ui/widgets/changewidthwidget.h index 8baaf5c5c..0f8147178 --- a/src/app/GUI/changewidthwidget.h +++ b/src/ui/widgets/changewidthwidget.h @@ -25,10 +25,15 @@ #ifndef CHANGEWIDTHWIDGET_H #define CHANGEWIDTHWIDGET_H + +#include "ui_global.h" + #include -class ChangeWidthWidget : public QWidget { +class UI_EXPORT ChangeWidthWidget : public QWidget +{ Q_OBJECT + public: ChangeWidthWidget(QWidget *parent = nullptr); @@ -49,6 +54,7 @@ class ChangeWidthWidget : public QWidget { signals: void widthSet(int); + private: bool mHover = false; bool mPressed = false; diff --git a/src/app/GUI/ecombobox.cpp b/src/ui/widgets/ecombobox.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/ecombobox.cpp rename to src/ui/widgets/ecombobox.cpp diff --git a/src/app/GUI/ecombobox.h b/src/ui/widgets/ecombobox.h old mode 100755 new mode 100644 similarity index 94% rename from src/app/GUI/ecombobox.h rename to src/ui/widgets/ecombobox.h index a441981f9..f537396f7 --- a/src/app/GUI/ecombobox.h +++ b/src/ui/widgets/ecombobox.h @@ -26,9 +26,12 @@ #ifndef ECOMBOBOX_H #define ECOMBOBOX_H +#include "ui_global.h" + #include -class eComboBox : public QComboBox { +class UI_EXPORT eComboBox : public QComboBox +{ public: using QComboBox::QComboBox; diff --git a/src/app/GUI/editablecombobox.cpp b/src/ui/widgets/editablecombobox.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/editablecombobox.cpp rename to src/ui/widgets/editablecombobox.cpp diff --git a/src/app/GUI/editablecombobox.h b/src/ui/widgets/editablecombobox.h old mode 100755 new mode 100644 similarity index 93% rename from src/app/GUI/editablecombobox.h rename to src/ui/widgets/editablecombobox.h index e6ccd3a2f..6f06d3673 --- a/src/app/GUI/editablecombobox.h +++ b/src/ui/widgets/editablecombobox.h @@ -26,9 +26,11 @@ #ifndef EDITABLECOMBOBOX_H #define EDITABLECOMBOBOX_H +#include "ui_global.h" + #include -class EditableComboBox : public QComboBox +class UI_EXPORT EditableComboBox : public QComboBox { public: EditableComboBox(QWidget* const parent, diff --git a/src/app/GUI/fakemenubar.cpp b/src/ui/widgets/fakemenubar.cpp similarity index 98% rename from src/app/GUI/fakemenubar.cpp rename to src/ui/widgets/fakemenubar.cpp index 06a077f76..c1b2978ae 100644 --- a/src/app/GUI/fakemenubar.cpp +++ b/src/ui/widgets/fakemenubar.cpp @@ -37,7 +37,7 @@ class QActionButton : public QPushButton { QPushButton(parent) { eSizesUI::widget.add(this, [this](const int size) { setFixedHeight(size); - setIconSize(QSize(size, size)); + //setIconSize(QSize(size, size)); }); //setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setObjectName("QActionButton"); diff --git a/src/app/GUI/fakemenubar.h b/src/ui/widgets/fakemenubar.h similarity index 95% rename from src/app/GUI/fakemenubar.h rename to src/ui/widgets/fakemenubar.h index c10f5bf0f..4387d17bc 100644 --- a/src/app/GUI/fakemenubar.h +++ b/src/ui/widgets/fakemenubar.h @@ -26,10 +26,13 @@ #ifndef FAKEMENUBAR_H #define FAKEMENUBAR_H +#include "ui_global.h" + #include #include -class FakeMenuBar : public QWidget { +class UI_EXPORT FakeMenuBar : public QWidget +{ public: explicit FakeMenuBar(QWidget* const parent = nullptr); diff --git a/src/app/GUI/flowlayout.cpp b/src/ui/widgets/flowlayout.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/flowlayout.cpp rename to src/ui/widgets/flowlayout.cpp diff --git a/src/app/GUI/flowlayout.h b/src/ui/widgets/flowlayout.h old mode 100755 new mode 100644 similarity index 96% rename from src/app/GUI/flowlayout.h rename to src/ui/widgets/flowlayout.h index 67143cfab..db08d58a2 --- a/src/app/GUI/flowlayout.h +++ b/src/ui/widgets/flowlayout.h @@ -25,11 +25,15 @@ #ifndef FLOWLAYOUT_H #define FLOWLAYOUT_H + +#include "ui_global.h" + #include #include #include -class FlowLayout : public QLayout { +class UI_EXPORT FlowLayout : public QLayout +{ public: explicit FlowLayout(QWidget *parent, const int margin = -1, diff --git a/src/app/GUI/Settings/labeledslider.cpp b/src/ui/widgets/labeledslider.cpp similarity index 100% rename from src/app/GUI/Settings/labeledslider.cpp rename to src/ui/widgets/labeledslider.cpp diff --git a/src/app/GUI/Settings/labeledslider.h b/src/ui/widgets/labeledslider.h similarity index 93% rename from src/app/GUI/Settings/labeledslider.h rename to src/ui/widgets/labeledslider.h index 57ddb5c85..8c1f0f3ea 100644 --- a/src/app/GUI/Settings/labeledslider.h +++ b/src/ui/widgets/labeledslider.h @@ -26,15 +26,19 @@ #ifndef LABELEDSLIDER_H #define LABELEDSLIDER_H +#include "ui_global.h" + #include #include -class LabeledSlider : public QHBoxLayout { +class UI_EXPORT LabeledSlider : public QHBoxLayout +{ public: explicit LabeledSlider(const QString& suffix, QWidget *parent = nullptr); QSlider* slider() const { return mSlider; } + private: QSlider* mSlider; }; diff --git a/src/app/GUI/scenechooser.cpp b/src/ui/widgets/scenechooser.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/scenechooser.cpp rename to src/ui/widgets/scenechooser.cpp diff --git a/src/app/GUI/scenechooser.h b/src/ui/widgets/scenechooser.h old mode 100755 new mode 100644 similarity index 95% rename from src/app/GUI/scenechooser.h rename to src/ui/widgets/scenechooser.h index b3b47ef4b..d03e9dda4 --- a/src/app/GUI/scenechooser.h +++ b/src/ui/widgets/scenechooser.h @@ -25,20 +25,28 @@ #ifndef SCENECHOOSER_H #define SCENECHOOSER_H + +#include "ui_global.h" + #include + class Canvas; class Document; -class SceneChooser : public QMenu { +class UI_EXPORT SceneChooser : public QMenu +{ Q_OBJECT + public: SceneChooser(Document &document, const bool active, QWidget * const parent = nullptr); void setCurrentScene(Canvas * const scene); Canvas* getCurrentScene() const { return mCurrentScene; } + signals: void currentChanged(Canvas*); + private: void addScene(Canvas * const scene); void removeScene(Canvas * const scene); diff --git a/src/app/GUI/toolbutton.h b/src/ui/widgets/toolbutton.h similarity index 96% rename from src/app/GUI/toolbutton.h rename to src/ui/widgets/toolbutton.h index b7ded9141..155a3ca8b 100644 --- a/src/app/GUI/toolbutton.h +++ b/src/ui/widgets/toolbutton.h @@ -24,6 +24,8 @@ #ifndef TOOLBUTTON_H #define TOOLBUTTON_H +#include "ui_global.h" + #include #include #include @@ -33,7 +35,7 @@ #include #include -class ToolButton : public QToolButton +class UI_EXPORT ToolButton : public QToolButton { Q_OBJECT public: diff --git a/src/app/GUI/twocolumnlayout.cpp b/src/ui/widgets/twocolumnlayout.cpp old mode 100755 new mode 100644 similarity index 100% rename from src/app/GUI/twocolumnlayout.cpp rename to src/ui/widgets/twocolumnlayout.cpp diff --git a/src/app/GUI/twocolumnlayout.h b/src/ui/widgets/twocolumnlayout.h old mode 100755 new mode 100644 similarity index 94% rename from src/app/GUI/twocolumnlayout.h rename to src/ui/widgets/twocolumnlayout.h index 90a83ceb1..51f1ee88d --- a/src/app/GUI/twocolumnlayout.h +++ b/src/ui/widgets/twocolumnlayout.h @@ -25,8 +25,13 @@ #ifndef TWOCOLUMNLAYOUT_H #define TWOCOLUMNLAYOUT_H + +#include "ui_global.h" + #include -class TwoColumnLayout : public QHBoxLayout { + +class UI_EXPORT TwoColumnLayout : public QHBoxLayout +{ public: TwoColumnLayout(); @@ -34,8 +39,8 @@ class TwoColumnLayout : public QHBoxLayout { void addWidgetToSecondColumn(QWidget *wid); void addPair(QWidget *column1, QWidget *column2); void addPair(QWidget *column1, QLayout *column2); - void addSpacing(const int size); + protected: QVBoxLayout *mLayout1 = nullptr; QVBoxLayout *mLayout2 = nullptr; diff --git a/src/app/GUI/uilayout.cpp b/src/ui/widgets/uilayout.cpp similarity index 100% rename from src/app/GUI/uilayout.cpp rename to src/ui/widgets/uilayout.cpp diff --git a/src/app/GUI/uilayout.h b/src/ui/widgets/uilayout.h similarity index 96% rename from src/app/GUI/uilayout.h rename to src/ui/widgets/uilayout.h index ab8f1bd4a..bab84a5f6 100644 --- a/src/app/GUI/uilayout.h +++ b/src/ui/widgets/uilayout.h @@ -24,12 +24,14 @@ #ifndef UILAYOUT_H #define UILAYOUT_H +#include "ui_global.h" + #include #include #include #include -class UIDock : public QWidget +class UI_EXPORT UIDock : public QWidget { Q_OBJECT @@ -69,7 +71,7 @@ class UIDock : public QWidget void writeSettings(); }; -class UILayout : public QSplitter +class UI_EXPORT UILayout : public QSplitter { Q_OBJECT diff --git a/src/app/GUI/vlabel.h b/src/ui/widgets/vlabel.h similarity index 96% rename from src/app/GUI/vlabel.h rename to src/ui/widgets/vlabel.h index d7e6b2797..f8ffc9cb4 100644 --- a/src/app/GUI/vlabel.h +++ b/src/ui/widgets/vlabel.h @@ -24,11 +24,13 @@ #ifndef VLABEL_H #define VLABEL_H +#include "ui_global.h" + #include #include #include -class VLabel : public QLabel +class UI_EXPORT VLabel : public QLabel { Q_OBJECT