backport more fixes
authormirabilos <tg@debian.org>
Sun, 31 Jan 2021 21:17:54 +0000 (22:17 +0100)
committermirabilos <mirabilos@evolvis.org>
Sun, 31 Jan 2021 21:17:54 +0000 (22:17 +0100)
debian/changelog
debian/patches/backports/5507.patch [moved from debian/patches/upstream/5507.patch with 95% similarity]
debian/patches/backports/change-staff-name.diff [new file with mode: 0644]
debian/patches/backports/crash-F9.diff [new file with mode: 0644]
debian/patches/backports/plugin-onRun.diff [new file with mode: 0644]
debian/patches/backports/plugin-qml.diff [new file with mode: 0644]
debian/patches/backports/plugin-remove-el.diff [new file with mode: 0644]
debian/patches/backports/plugin-select.diff [new file with mode: 0644]
debian/patches/backports/plugin-size.diff [new file with mode: 0644]
debian/patches/series

index 588400d..b8a3e57 100644 (file)
@@ -2,10 +2,19 @@ musescore3 (3.2.3+dfsg2-8) unstable; urgency=medium
 
   * Sync SMuFL update to upstream
   * Update patch submission status
-  * Fix CFLAGS/CXXFLAGS extras to disable upstream-only warnings
-  * Update list of MScore.ttf copyright holders, again
-
- -- Thorsten Glaser <tg@mirbsd.de>  Sun, 17 Jan 2021 18:51:41 +0100
+  * Merge musescore2 (2.3.2+dfsg4-12) unstable; urgency=medium
+    - Fix CFLAGS/CXXFLAGS extras to disable upstream-only warnings
+    - Update list of MScore.ttf copyright holders, again
+    - Explicitly debundle GNU FreeFont
+  * Merge patches from upstream or submitted:
+    - do not delete courtesy accidentals on octave changes
+    - allow mid-score staff name changes
+    - fix crash hiding palettes (F9)
+    - various plugin-related fixes
+    - expose Score.selection object to access elements selected in GUI
+    - add removeElement API and restore Chord.{add,remove} for plugins
+
+ -- Thorsten Glaser <tg@mirbsd.de>  Sun, 31 Jan 2021 22:13:34 +0100
 
 musescore3 (3.2.3+dfsg1-7) unstable; urgency=medium
 
similarity index 95%
rename from debian/patches/upstream/5507.patch
rename to debian/patches/backports/5507.patch
index da9cfa2..1090bee 100644 (file)
@@ -5,7 +5,7 @@ Description: fix #292648: make courtesy accidentals stay if notes are
 
 --- a/libmscore/cmd.cpp
 +++ b/libmscore/cmd.cpp
-@@ -1564,12 +1564,17 @@ void Score::upDown(bool up, UpDownMode mode)
+@@ -1494,12 +1494,17 @@ void Score::upDown(bool up, UpDownMode m
  
              if ((oNote->pitch() != newPitch) || (oNote->tpc1() != newTpc1) || oNote->tpc2() != newTpc2) {
                    // remove accidental if present to make sure
diff --git a/debian/patches/backports/change-staff-name.diff b/debian/patches/backports/change-staff-name.diff
new file mode 100644 (file)
index 0000000..6cbd192
--- /dev/null
@@ -0,0 +1,170 @@
+Origin: upstream, commit:c2a4051e6dd832ba6d8ff83cd4b3a70c262b944b
+Author: Marc Sabatella <marc@outsideshore.com>
+Description: fix #88861: allow mid-score staff name changes
+
+--- a/mscore/editstaff.cpp
++++ b/mscore/editstaff.cpp
+@@ -43,7 +43,7 @@ namespace Ms {
+ //   EditStaff
+ //---------------------------------------------------------
+-EditStaff::EditStaff(Staff* s, const Fraction& /*tick*/, QWidget* parent)
++EditStaff::EditStaff(Staff* s, const Fraction& tick, QWidget* parent)
+    : QDialog(parent)
+       {
+       setObjectName("EditStaff");
+@@ -52,7 +52,7 @@ EditStaff::EditStaff(Staff* s, const Fra
+       setModal(true);
+       staff = nullptr;
+-      setStaff(s);
++      setStaff(s, tick);
+       MuseScore::restoreGeometry(this);
+@@ -83,14 +83,14 @@ EditStaff::EditStaff(Staff* s, const Fra
+ //   setStaff
+ //---------------------------------------------------------
+-void EditStaff::setStaff(Staff* s)
++void EditStaff::setStaff(Staff* s, const Fraction& tick)
+       {
+       if (staff != nullptr)
+             delete staff;
+       orgStaff = s;
+       Part* part        = orgStaff->part();
+-      instrument        = *part->instrument(/*tick*/);
++      instrument        = *part->instrument(tick);
+       Score* score      = part->score();
+       staff             = new Staff(score);
+       staff->setStaffType(Fraction(0,1), *orgStaff->staffType(Fraction(0,1)));
+@@ -106,20 +106,16 @@ void EditStaff::setStaff(Staff* s)
+       staff->setHideSystemBarLine(orgStaff->hideSystemBarLine());
+       // get tick range for instrument
+-      auto i = part->instruments()->upper_bound(0);   // tick
++      auto i = part->instruments()->upper_bound(tick.ticks());
+       if (i == part->instruments()->end())
+             _tickEnd = Fraction(-1,1);
+       else
+             _tickEnd = Fraction::fromTicks(i->first);
+-#if 1
+-      _tickStart = Fraction(-1,1);
+-#else
+       --i;
+       if (i == part->instruments()->begin())
+-            _tickStart = 0;
++            _tickStart = Fraction(-1, 1);
+       else
+-            _tickStart = i->first;
+-#endif
++            _tickStart = Fraction::fromTicks(i->first);
+       // set dlg controls
+       spinExtraDistance->setValue(s->userDist() / score->spatium());
+@@ -254,7 +250,7 @@ void EditStaff::gotoNextStaff()
+       Staff* nextStaff = orgStaff->score()->staff(orgStaff->idx() + 1);
+       if (nextStaff)
+             {
+-            setStaff(nextStaff);
++            setStaff(nextStaff, _tickStart);
+             }
+       }
+@@ -267,7 +263,7 @@ void EditStaff::gotoPreviousStaff()
+       Staff* prevStaff = orgStaff->score()->staff(orgStaff->idx() - 1);
+       if (prevStaff)
+             {
+-            setStaff(prevStaff);
++            setStaff(prevStaff, _tickStart);
+             }
+       }
+@@ -350,16 +346,32 @@ void EditStaff::apply()
+       QString newPartName = partName->text().simplified();
+-      bool instrumentFieldChanged = !(instrument == *part->instrument());
+-      if (instrumentFieldChanged)
++      bool instrumentFieldChanged = !(instrument == *part->instrument(_tickStart));
++      if (instrumentFieldChanged && _tickStart == Fraction(-1, 1))
+             clefType = instrument.clefType(orgStaff->rstaff());
+       if (instrumentFieldChanged || part->partName() != newPartName) {
+             // instrument has changed
+             Interval v1 = instrument.transpose();
+-            Interval v2 = part->instrument()->transpose();
++            Interval v2 = part->instrument(_tickStart)->transpose();
+-            score->undo(new ChangePart(part, new Instrument(instrument), newPartName));
++            if (_tickStart == Fraction(-1, 1)) {
++                  // change instrument and part name globally
++                  score->undo(new ChangePart(part, new Instrument(instrument), newPartName));
++                  }
++            else {
++                  // change part name globally, instrument locally if possible
++                  if (part->partName() != newPartName)
++                        score->undo(new ChangePart(part, new Instrument(*part->instrument()), newPartName));
++                  if (instrumentFieldChanged) {
++                        Segment* s = score->tick2segment(_tickStart, true, SegmentType::ChordRest);
++                        Element* e = s ? s->findAnnotation(ElementType::INSTRUMENT_CHANGE, part->startTrack(), part->endTrack()) : nullptr;
++                        if (e)
++                              score->undo(new ChangeInstrument(toInstrumentChange(e), new Instrument(instrument)));
++                        else
++                              score->undo(new ChangePart(part, new Instrument(instrument), newPartName));
++                        }
++                  }
+             emit instrumentChanged();
+             if (v1 != v2)
+--- a/mscore/editstaff.h
++++ b/mscore/editstaff.h
+@@ -46,7 +46,7 @@ class EditStaff : public QDialog, privat
+       virtual void hideEvent(QHideEvent*);
+       void apply();
+-      void setStaff(Staff*);
++      void setStaff(Staff*, const Fraction& tick);
+       void updateInterval(const Interval&);
+       void updateStaffType();
+       void updateInstrument();
+--- a/mscore/propertymenu.cpp
++++ b/mscore/propertymenu.cpp
+@@ -62,6 +62,8 @@
+ #include "libmscore/jump.h"
+ #include "libmscore/marker.h"
+ #include "libmscore/measure.h"
++#include "libmscore/iname.h"
++#include "libmscore/system.h"
+ namespace Ms {
+@@ -522,12 +524,21 @@ void ScoreView::elementPropertyAction(co
+ //            editFretDiagram(static_cast<FretDiagram*>(e));
+       else if (cmd == "staff-props") {
+             Fraction tick = {-1,1};
+-            if (e->isChordRest())
+-                  tick = static_cast<ChordRest*>(e)->tick();
+-            else if (e->type() == ElementType::NOTE)
+-                  tick = static_cast<Note*>(e)->chord()->tick();
+-            else if (e->type() == ElementType::MEASURE)
+-                  tick = static_cast<Measure*>(e)->tick();
++            if (e->isChordRest()) {
++                  tick = toChordRest(e)->tick();
++                  }
++            else if (e->isNote()) {
++                  tick = toNote(e)->chord()->tick();
++                  }
++            else if (e->isMeasure()) {
++                  tick = toMeasure(e)->tick();
++                  }
++            else if (e->isInstrumentName()) {
++                  System* system = toSystem(toInstrumentName(e)->parent());
++                  Measure* m = system ? system->firstMeasure() : nullptr;
++                  if (m)
++                        tick = m->tick();
++                  }
+             EditStaff editStaff(e->staff(), tick, 0);
+             connect(&editStaff, SIGNAL(instrumentChanged()), mscore, SLOT(instrumentChanged()));
+             editStaff.exec();
diff --git a/debian/patches/backports/crash-F9.diff b/debian/patches/backports/crash-F9.diff
new file mode 100644 (file)
index 0000000..e383f46
--- /dev/null
@@ -0,0 +1,44 @@
+Origin: backport, commit:0c907ab8222859a645d9a2549da7d18ef11f8326
+Author: Marc Sabatella <marc@outsideshore.com>
+Description: fix #309333: crash hiding palettes
+ Resolves: https://musescore.org/en/node/309333
+ .
+ Crash happens on trying to set the focus upon closing the palette,
+ we try to restore the previous focused widget.
+ But it may no longer be valid.
+ .
+ Changed to return focus to the score view if possible,
+ otherwise let Qt worry about it.
+
+--- a/mscore/musescore.cpp
++++ b/mscore/musescore.cpp
+@@ -5791,17 +5791,14 @@ void MuseScore::cmd(QAction* a)
+             PaletteBox* pb = mscore->getPaletteBox();
+             QLineEdit* sb = pb->searchBox();
+             if (a->isChecked()) {
+-                  lastFocusWidget = QApplication::focusWidget();
+                   sb->setFocus();
+                   if (pb->noSelection())
+                         pb->setKeyboardNavigation(false);
+                   else
+                         pb->setKeyboardNavigation(true);
+                   }
+-            else {
+-                  if (lastFocusWidget)
+-                        lastFocusWidget->setFocus();
+-                  }
++            else if (cv)
++                  cv->setFocus();
+             return;
+             }
+       if (cmdn == "palette-search") {
+--- a/mscore/musescore.h
++++ b/mscore/musescore.h
+@@ -349,7 +349,6 @@ class MuseScore : public QMainWindow, pu
+       PaletteBox* paletteBox         { 0 };
+       Inspector* _inspector          { 0 };
+       OmrPanel* omrPanel             { 0 };
+-      QWidget* lastFocusWidget       { 0 };
+       QPushButton* showMidiImportButton {0};
diff --git a/debian/patches/backports/plugin-onRun.diff b/debian/patches/backports/plugin-onRun.diff
new file mode 100644 (file)
index 0000000..de888c6
--- /dev/null
@@ -0,0 +1,32 @@
+Origin: upstream, commit:9d8d23f87e2045dd9f20dd4a6c078c6454bcb0ad
+Author: Dmitri Ovodok <dmitrio95@yandex.ru>
+Description: fix #72416: fix onRun() being executed in a wrong instance of dock and dialog plugins
+
+--- a/mscore/plugin/mscorePlugins.cpp
++++ b/mscore/plugin/mscorePlugins.cpp
+@@ -422,11 +422,15 @@ void MuseScore::pluginTriggered(QString
+             delete obj;
+             return;
+             }
+-      p->setFilePath(pp.section('/', 0, -2));
+       if (p->pluginType() == "dock" || p->pluginType() == "dialog") {
+             QQuickView* view = new QQuickView(engine, 0);
+             view->setSource(QUrl::fromLocalFile(pp));
++            if (QmlPlugin* viewPluginInstance = qobject_cast<QmlPlugin*>(view->rootObject())) {
++                  // a new plugin instance was created by view, use it instead.
++                  delete p;
++                  p = viewPluginInstance;
++                  }
+             view->setTitle(p->menuPath().mid(p->menuPath().lastIndexOf(".") + 1));
+             view->setColor(QApplication::palette().color(QPalette::Window));
+             //p->setParentItem(view->contentItem());
+@@ -455,6 +459,8 @@ void MuseScore::pluginTriggered(QString
+                   }
+             }
++      p->setFilePath(pp.section('/', 0, -2));
++
+       // don’t call startCmd for non modal dialog
+       if (cs && p->pluginType() != "dock")
+             cs->startCmd();
diff --git a/debian/patches/backports/plugin-qml.diff b/debian/patches/backports/plugin-qml.diff
new file mode 100644 (file)
index 0000000..9b7f5b9
--- /dev/null
@@ -0,0 +1,72 @@
+Origin: upstream, commit:ec7d9a85d79b45c558a4230ef35251122167064e
+Author: Dmitri Ovodok <dmitrio95@yandex.ru>
+Description: fix #275268: don't list non-plugin QML files in Plugin Manager
+
+--- a/mscore/musescore.h
++++ b/mscore/musescore.h
+@@ -908,7 +908,7 @@ extern bool saveXml(Score*, QIODevice*);
+ extern bool saveXml(Score*, const QString& name);
+ struct PluginDescription;
+-extern void collectPluginMetaInformation(PluginDescription*);
++extern bool collectPluginMetaInformation(PluginDescription*);
+ extern QString getSharePath();
+ extern Score::FileError importMidi(MasterScore*, const QString& name);
+--- a/mscore/plugin/mscorePlugins.cpp
++++ b/mscore/plugin/mscorePlugins.cpp
+@@ -381,8 +381,8 @@ bool MuseScore::loadPlugin(const QString
+                   PluginDescription* p = new PluginDescription;
+                   p->path = path;
+                   p->load = false;
+-                  collectPluginMetaInformation(p);
+-                  registerPlugin(p);
++                  if (collectPluginMetaInformation(p))
++                        registerPlugin(p);
+                   result = true;
+                   }
+             }
+@@ -478,9 +478,11 @@ void MuseScore::pluginTriggered(QString
+ //---------------------------------------------------------
+ //   collectPluginMetaInformation
++///   returns false if loading a plugin for the given
++///   description has failed
+ //---------------------------------------------------------
+-void collectPluginMetaInformation(PluginDescription* d)
++bool collectPluginMetaInformation(PluginDescription* d)
+       {
+       qDebug("Collect meta for <%s>", qPrintable(d->path));
+@@ -491,14 +493,16 @@ void collectPluginMetaInformation(Plugin
+             foreach(QQmlError e, component.errors()) {
+                   qDebug("   line %d: %s", e.line(), qPrintable(e.description()));
+                   }
+-            return;
++            return false;
+             }
+       QmlPlugin* item = qobject_cast<QmlPlugin*>(obj);
++      const bool isQmlPlugin = bool(item);
+       if (item) {
+             d->version      = item->version();
+             d->description  = item->description();
+             }
+       delete obj;
++      return isQmlPlugin;
+       }
+ }
+--- a/mscore/plugin/pluginManager.cpp
++++ b/mscore/plugin/pluginManager.cpp
+@@ -167,8 +167,8 @@ static void updatePluginList(QList<QStri
+                               PluginDescription p;
+                               p.path = path;
+                               p.load = false;
+-                              collectPluginMetaInformation(&p);
+-                              pluginList.append(p);
++                              if (collectPluginMetaInformation(&p))
++                                    pluginList.append(p);
+                               }
+                         }
+                   }
diff --git a/debian/patches/backports/plugin-remove-el.diff b/debian/patches/backports/plugin-remove-el.diff
new file mode 100644 (file)
index 0000000..3f486fb
--- /dev/null
@@ -0,0 +1,138 @@
+Origin: upstream, commit:19677e38768db0cd46832f30038d70012bc750a9
+Author: Dale Larson <dlarson42@gmail.com>
+Description: Fix #291790, fix #267604: Restore Chord.remove() and Chord.add() methods.
+ Restore the add and remove QML methods for the
+ Chord object. Adds exposed Element.parent property.
+ These existed in v2.x. Finally it adds a removeElement
+ method to PluginAPI for general element disposal.
+
+--- a/mscore/plugin/api/elements.cpp
++++ b/mscore/plugin/api/elements.cpp
+@@ -70,6 +70,50 @@ void Note::setTpc(int val)
+       }
+ //---------------------------------------------------------
++//   Chord::add
++//---------------------------------------------------------
++
++void Chord::add(Ms::PluginAPI::Element* wrapped)
++      {
++      Ms::Element* s = wrapped->element();
++      if (s)
++            {
++            // Ensure that the object has the expected ownership
++            if (wrapped->ownership() == Ownership::SCORE) {
++                  qWarning("Chord::add: Cannot add this element. The element is already part of the score.");
++                  return;        // Don't allow operation.
++                  }
++            // Score now owns the object.
++            wrapped->setOwnership(Ownership::SCORE);
++            // Provide parentage for element.
++            s->setParent(chord());
++            // If a note, ensure the element has proper Tpc values. (Will crash otherwise)
++            if (s->isNote()) {
++                  s->setTrack(chord()->track());
++                  toNote(s)->setTpcFromPitch();
++                  }
++            // Create undo op and add the element.
++            chord()->score()->undoAddElement(s);
++            }
++      }
++
++//---------------------------------------------------------
++//   Chord::remove
++//---------------------------------------------------------
++
++void Chord::remove(Ms::PluginAPI::Element* wrapped)
++      {
++      Ms::Element* s = wrapped->element();
++      if (s->parent() != chord())
++            qWarning("PluginAPI::Chord::remove: The element is not a child of this chord. Use removeElement() instead.");
++      else if (chord()->notes().size() <= 1 && s->type() == ElementType::NOTE)
++            qWarning("PluginAPI::Chord::remove: Removal of final note is not allowed.");
++      else if (s)
++            chord()->score()->deleteItem(s); // Create undo op and remove the element.
++      }
++
++
++//---------------------------------------------------------
+ //   wrap
+ ///   \cond PLUGIN_API \private \endcond
+ ///   Wraps Ms::Element choosing the correct wrapper type
+--- a/mscore/plugin/api/elements.h
++++ b/mscore/plugin/api/elements.h
+@@ -22,6 +22,7 @@
+ #include "libmscore/notedot.h"
+ #include "libmscore/segment.h"
+ #include "libmscore/accidental.h"
++#include "libmscore/types.h"
+ namespace Ms {
+ namespace PluginAPI {
+@@ -78,6 +79,11 @@ class Element : public Ms::PluginAPI::Sc
+        * \see Element::offset
+        */
+       Q_PROPERTY(qreal offsetY READ offsetY WRITE setOffsetY)
++      /**
++       * Parent element for this element.
++       * \since 3.3
++       */
++      Q_PROPERTY(Ms::PluginAPI::Element* parent READ parent)
+       API_PROPERTY( subtype,                 SUBTYPE                   )
+       API_PROPERTY_READ_ONLY_T( bool, selected, SELECTED               )
+@@ -316,6 +322,8 @@ class Element : public Ms::PluginAPI::Sc
+       void setOffsetX(qreal offX);
+       void setOffsetY(qreal offY);
++      Ms::PluginAPI::Element* parent() const { return wrap(element()->parent()); }
++
+    public:
+       /// \cond MS_INTERNAL
+       Element(Ms::Element* e = nullptr, Ownership own = Ownership::PLUGIN)
+@@ -449,6 +457,13 @@ class Chord : public Element {
+       //QQmlListProperty<Element> hook()         { return wrapContainerProperty<Element>(this, chord()->hook());      }
+       Ms::NoteType noteType()                  { return chord()->noteType(); }
+       /// \endcond
++
++      /// Add to a chord's elements.
++      /// \since MuseScore 3.3
++      Q_INVOKABLE void add(Ms::PluginAPI::Element* wrapped);
++      /// Remove a chord's element.
++      /// \since MuseScore 3.3
++      Q_INVOKABLE void remove(Ms::PluginAPI::Element* wrapped);
+       };
+ //---------------------------------------------------------
+--- a/mscore/plugin/api/qmlpluginapi.cpp
++++ b/mscore/plugin/api/qmlpluginapi.cpp
+@@ -178,6 +178,19 @@ Element* PluginAPI::newElement(int eleme
+       }
+ //---------------------------------------------------------
++//   removeElement
++///   Disposes of an Element and its children.
++///   \param Element type.
++///   \since MuseScore 3.3
++//---------------------------------------------------------
++
++void PluginAPI::removeElement(Ms::PluginAPI::Element* wrapped)
++      {
++      Ms::Score* score = wrapped->element()->score();
++      score->deleteItem(wrapped->element());
++      }
++
++//---------------------------------------------------------
+ //   newScore
+ //---------------------------------------------------------
+--- a/mscore/plugin/api/qmlpluginapi.h
++++ b/mscore/plugin/api/qmlpluginapi.h
+@@ -165,6 +165,7 @@ class PluginAPI : public Ms::QmlPlugin {
+       Q_INVOKABLE Ms::PluginAPI::Score* newScore(const QString& name, const QString& part, int measures);
+       Q_INVOKABLE Ms::PluginAPI::Element* newElement(int);
++      Q_INVOKABLE void removeElement(Ms::PluginAPI::Element* wrapped);
+       Q_INVOKABLE void cmd(const QString&);
+       /** \cond PLUGIN_API \private \endcond */
+       Q_INVOKABLE Ms::PluginAPI::MsProcess* newQProcess();
diff --git a/debian/patches/backports/plugin-select.diff b/debian/patches/backports/plugin-select.diff
new file mode 100644 (file)
index 0000000..f077642
--- /dev/null
@@ -0,0 +1,198 @@
+Origin: upstream, commit:216188f7ed8d652066ee9a6a6034d4cfcc099b81
+Author: Dale Larson <dlarson42@gmail.com>
+Description: Fix #291708: Expose Score.selection object to access to GUI selected elements.
+ This commit exposes the Score.selection.elements list
+ enabling QML scripts to manipulate on user selected score elements.
+ The expectation is that additional selection information will be
+ provided on this object in the future.
+
+--- a/mscore/CMakeLists.txt
++++ b/mscore/CMakeLists.txt
+@@ -58,6 +58,7 @@ if (SCRIPT_INTERFACE)
+             plugin/api/fraction.h
+             plugin/api/excerpt.h
+             plugin/api/util.h
++            plugin/api/selection.h
+             plugin/api/enums.cpp
+             plugin/mscorePlugins.cpp plugin/pluginCreator.cpp plugin/pluginManager.cpp plugin/qmledit.cpp
+@@ -66,6 +67,7 @@ if (SCRIPT_INTERFACE)
+             plugin/api/score.cpp
+             plugin/api/excerpt.cpp
+             plugin/api/util.cpp
++            plugin/api/selection.cpp
+             )
+       set (SCRIPT_UI
+--- a/mscore/plugin/api/qmlpluginapi.cpp
++++ b/mscore/plugin/api/qmlpluginapi.cpp
+@@ -17,6 +17,8 @@
+ #include "score.h"
+ #include "part.h"
+ #include "util.h"
++#include "selection.h"
++
+ #ifndef TESTROOT
+ #include "shortcut.h"
+ #endif
+@@ -343,6 +345,7 @@ void PluginAPI::registerQmlTypes()
+       qmlRegisterType<Measure>();
+       qmlRegisterType<Part>();
+       qmlRegisterType<Excerpt>();
++      qmlRegisterType<Selection>();
+       //qmlRegisterType<Hook>();
+       //qmlRegisterType<Stem>();
+       //qmlRegisterType<StemSlash>();
+--- a/mscore/plugin/api/score.h
++++ b/mscore/plugin/api/score.h
+@@ -24,6 +24,10 @@ namespace PluginAPI {
+ class Cursor;
+ class Segment;
+ class Measure;
++class Selection;
++class Score;
++
++extern Selection* selectionWrap(Ms::Selection* select);
+ //---------------------------------------------------------
+ //   Score
+@@ -80,6 +84,8 @@ class Score : public Ms::PluginAPI::Scor
+       Q_PROPERTY(QString                        mscoreVersion     READ mscoreVersion)
+       /** MuseScore revision the score has been last saved with (includes autosave) (read only) */
+       Q_PROPERTY(QString                        mscoreRevision    READ mscoreRevision)
++      /** Current selections for the score. \since MuseScore 3.3 */
++      Q_PROPERTY(Ms::PluginAPI::Selection*      selection         READ selection)
+    public:
+       /// \cond MS_INTERNAL
+@@ -98,6 +104,8 @@ class Score : public Ms::PluginAPI::Scor
+       int lyricCount() { return score()->lyricCount(); }
+       QString lyricist() { return score()->metaTag("lyricist"); } // not the meanwhile obsolete "poet"
+       QString title() { return score()->metaTag("workTitle"); }
++      Ms::PluginAPI::Selection* selection() { return selectionWrap(&score()->selection()); }
++
+       /// \endcond
+       /// Returns as a string the metatag named \p tag
+--- a/mscore/plugin/api/scoreelement.h
++++ b/mscore/plugin/api/scoreelement.h
+@@ -114,7 +114,16 @@ public:
+             : QQmlListProperty<T>(obj, const_cast<void*>(static_cast<const void*>(&container)), &count, &at) {};
+       static int count(QQmlListProperty<T>* l)     { return int(static_cast<Container*>(l->data)->size()); }
+-      static T* at(QQmlListProperty<T>* l, int i)  { return wrap<T>(static_cast<Container*>(l->data)->at(i), Ownership::SCORE); }
++      static T* at(QQmlListProperty<T>* l, int i)
++            {
++            auto el = static_cast<Container*>(l->data)->at(i);
++            // If a polymorphic wrap() function is available
++            // for the requested type, use it for wrapping.
++            if (std::is_same<T*, decltype(wrap(el, Ownership::SCORE))>::value)
++                  return static_cast<T*>(wrap(el, Ownership::SCORE));
++            // Otherwise, wrap directly to the requested wrapper type.
++            return wrap<T>(el, Ownership::SCORE);
++            }
+       /// \endcond
+       };
+--- /dev/null
++++ b/mscore/plugin/api/selection.cpp
+@@ -0,0 +1,32 @@
++//=============================================================================
++//  MuseScore
++//  Music Composition & Notation
++//
++//  Copyright (C) 2019 Werner Schweer and others
++//
++//  This program is free software; you can redistribute it and/or modify
++//  it under the terms of the GNU General Public License version 2
++//  as published by the Free Software Foundation and appearing in
++//  the file LICENCE.GPL
++//=============================================================================
++
++#include "selection.h"
++#include "score.h"
++
++namespace Ms {
++namespace PluginAPI {
++
++//---------------------------------------------------------
++//   QmlPlayEventsListAccess::append
++//---------------------------------------------------------
++
++Selection* selectionWrap(Ms::Selection* select)
++      {
++      Selection* w = new Selection(select);
++      // All wrapper objects should belong to JavaScript code.
++      QQmlEngine::setObjectOwnership(w, QQmlEngine::JavaScriptOwnership);
++      return w;
++      }
++
++}
++}
+--- /dev/null
++++ b/mscore/plugin/api/selection.h
+@@ -0,0 +1,54 @@
++//=============================================================================
++//  MuseScore
++//  Music Composition & Notation
++//
++//  Copyright (C) 2019 Werner Schweer and others
++//
++//  This program is free software; you can redistribute it and/or modify
++//  it under the terms of the GNU General Public License version 2
++//  as published by the Free Software Foundation and appearing in
++//  the file LICENCE.GPL
++//=============================================================================
++
++#ifndef __PLUGIN_API_SELECTION_H__
++#define __PLUGIN_API_SELECTION_H__
++
++#include "elements.h"
++#include "score.h"
++
++namespace Ms {
++namespace PluginAPI {
++
++//---------------------------------------------------------
++//   Selection
++//    Wrapper class for internal Ms::Selection
++///  \since MuseScore 3.3 
++//---------------------------------------------------------
++
++class Selection : public QObject {
++      Q_OBJECT
++      /// Current GUI selections for the score.
++      /// \since MuseScore 3.3
++      Q_PROPERTY(QQmlListProperty<Ms::PluginAPI::Element> elements READ elements)
++
++      /// \cond MS_INTERNAL
++
++   protected:
++      Ms::Selection* _select;
++
++   public:
++
++      Selection(Ms::Selection* select) : QObject(), _select(select) {}
++      virtual ~Selection() { }
++
++      QQmlListProperty<Element> elements()
++            { return wrapContainerProperty<Element>(this, _select->elements()); }
++
++      /// \endcond
++};
++
++extern Selection* selectionWrap(Ms::Selection* select);
++
++} // namespace PluginAPI
++} // namespace Ms
++#endif
+--- a/mtest/CMakeLists.txt
++++ b/mtest/CMakeLists.txt
+@@ -106,6 +106,7 @@ set (SOURCE_LIB
+       ${PROJECT_SOURCE_DIR}/mscore/plugin/api/part.h
+       ${PROJECT_SOURCE_DIR}/mscore/plugin/api/excerpt.cpp
+       ${PROJECT_SOURCE_DIR}/mscore/plugin/api/util.cpp
++      ${PROJECT_SOURCE_DIR}/mscore/plugin/api/selection.cpp
+       ${PROJECT_SOURCE_DIR}/mscore/preferences.cpp
+       ${PROJECT_SOURCE_DIR}/mscore/shortcut.cpp
+       ${PROJECT_SOURCE_DIR}/mscore/stringutils.cpp
diff --git a/debian/patches/backports/plugin-size.diff b/debian/patches/backports/plugin-size.diff
new file mode 100644 (file)
index 0000000..75b21ce
--- /dev/null
@@ -0,0 +1,22 @@
+Origin: upstream, commit:0aa01f3ea381416e6489d57f03dfc7ca2325b4b1
+Author: Dmitri Ovodok <dmitrio95@yandex.ru>
+Description: Fix dock plugins appearing with zero height
+ Plugin should assign reasonable values to implicitHeight/implicitWidth
+ (or, less preferably, height/width) properties for this to work
+ properly.
+
+--- a/mscore/plugin/mscorePlugins.cpp
++++ b/mscore/plugin/mscorePlugins.cpp
+@@ -450,6 +450,12 @@ void MuseScore::pluginTriggered(QString
+                   QWidget* w = QWidget::createWindowContainer(view);
+                   dock->setWidget(w);
+                   addDockWidget(area, dock);
++                  const Qt::Orientation orientation =
++                     (area == Qt::RightDockWidgetArea || area == Qt::LeftDockWidgetArea)
++                     ? Qt::Vertical
++                     : Qt::Horizontal;
++                  const int size = (orientation == Qt::Vertical) ? view->initialSize().height() : view->initialSize().width();
++                  resizeDocks({ dock }, { size }, orientation);
+                   connect(engine, SIGNAL(quit()), dock, SLOT(close()));
+                   dock->show();
+                   }
index afe716a..533b2f6 100644 (file)
@@ -76,11 +76,18 @@ backports/59-blank-lines.diff
 upstream/wmclass.diff
 backports/62-measure-count.diff
 backports/63-minimise-window.diff
+backports/change-staff-name.diff
+backports/plugin-remove-el.diff
+backports/plugin-select.diff
+backports/plugin-onRun.diff
+backports/plugin-size.diff
+backports/plugin-qml.diff
+backports/5507.patch
+backports/crash-F9.diff
 upstream/silence-qdebug.diff
 upstream/statusline-pitch-onofftime.diff
 upstream/improve-mscore-font.diff
 upstream/fix-accidental-paren-pos.diff
-upstream/5507.patch
 experiments/element-barbeat.diff
 experiments/smufl-fixes.diff
 experiments/revert-restriking-patch.diff