2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011 Werner Schweer
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//=============================================================================
|
|
|
|
|
2012-07-16 15:49:24 +02:00
|
|
|
#include "config.h"
|
2015-02-03 13:42:37 +01:00
|
|
|
#include "musescoreCore.h"
|
2012-05-26 14:26:10 +02:00
|
|
|
#include "style.h"
|
|
|
|
#include "mscore.h"
|
|
|
|
#include "sequencer.h"
|
2014-06-24 16:42:47 +02:00
|
|
|
#include "element.h"
|
|
|
|
#include "dynamic.h"
|
2012-10-01 20:03:31 +02:00
|
|
|
#include "accidental.h"
|
2012-05-26 14:26:10 +02:00
|
|
|
#include "figuredbass.h"
|
2012-08-16 12:12:55 +02:00
|
|
|
#include "stafftype.h"
|
2012-08-04 15:46:43 +02:00
|
|
|
#include "note.h"
|
2012-09-12 11:16:36 +02:00
|
|
|
#include "spanner.h"
|
2012-09-17 15:37:31 +02:00
|
|
|
#include "volta.h"
|
2012-09-17 17:35:49 +02:00
|
|
|
#include "ottava.h"
|
2012-09-17 18:09:30 +02:00
|
|
|
#include "trill.h"
|
2013-02-25 14:56:34 +01:00
|
|
|
#include "repeat.h"
|
|
|
|
#include "jump.h"
|
|
|
|
#include "marker.h"
|
2013-10-05 23:13:33 +02:00
|
|
|
#include "layoutbreak.h"
|
2014-06-25 13:28:17 +02:00
|
|
|
#include "hairpin.h"
|
2014-06-25 14:46:43 +02:00
|
|
|
#include "glissando.h"
|
2014-03-18 15:53:52 +01:00
|
|
|
#include "page.h"
|
2014-04-25 18:43:25 +02:00
|
|
|
#include "slur.h"
|
|
|
|
#include "lyrics.h"
|
|
|
|
#include "accidental.h"
|
|
|
|
#include "notedot.h"
|
|
|
|
#include "tie.h"
|
|
|
|
#include "staff.h"
|
2014-06-26 07:45:09 +02:00
|
|
|
#include "beam.h"
|
2014-04-25 18:43:25 +02:00
|
|
|
#include "timesig.h"
|
|
|
|
#include "part.h"
|
|
|
|
#include "measure.h"
|
|
|
|
#include "score.h"
|
|
|
|
#include "keysig.h"
|
|
|
|
#include "harmony.h"
|
|
|
|
#include "cursor.h"
|
|
|
|
#include "stafftext.h"
|
|
|
|
#include "mscoreview.h"
|
2014-04-25 19:11:33 +02:00
|
|
|
#include "plugins.h"
|
Lyrics multi-system melisma and dashes
Implements melisma and dash lines for lyrics spanning several systems.
The melisma and dash line is based on the `SLine` class and its segments on the `LineSegment` class. Both the whole line and its segments are not selectable, marked as generated and not saved in the score file, which is not changed in any way.
For very wide dash segments, several dashes are drawn; the distance between the dashes is not configurable.
Lyrics layout code in `Measure` class and in `layout.cpp` file has been commented out as the lyrics line layout is all contained in the lyrics.cpp file
The line is registered with the `Score` (to have its layout delayed until all elements are positioned) with a mechanism similar to other `Spanner`'s, but in a different container (`_unmanagedSpanner`), as the owning `Lyrics` should decide when create, register, unregister and delete its line.
The line segments are registered with the `System` they belong to (to have them drawn), in the same way as other `Spanner`'s.
There is code for using the dash metrics of the lyrics font, but it is turned off via a conditional directive, as there does not seem to be a reliable way to determine the dash metrics; conventional values (determined by trials and errors and based on my taste!) are used when the conditional directive is off.
2015-01-11 10:11:44 +01:00
|
|
|
#include "chord.h"
|
2015-03-18 12:17:01 +01:00
|
|
|
#include "hook.h"
|
|
|
|
#include "stem.h"
|
2015-03-19 10:28:01 +01:00
|
|
|
#include "stemslash.h"
|
2015-04-07 10:26:33 +02:00
|
|
|
#include "fraction.h"
|
2015-04-22 21:22:06 +02:00
|
|
|
#include "excerpt.h"
|
2016-03-05 15:31:26 +01:00
|
|
|
#include "spatium.h"
|
2016-06-10 23:29:35 +02:00
|
|
|
#include "barline.h"
|
2018-09-03 09:54:09 +02:00
|
|
|
#include "skyline.h"
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
2016-10-07 13:21:05 +02:00
|
|
|
bool MScore::debugMode = false;
|
2016-06-02 12:12:40 +02:00
|
|
|
bool MScore::testMode = false;
|
|
|
|
|
2016-06-02 12:50:00 +02:00
|
|
|
// #ifndef NDEBUG
|
2016-06-03 17:54:21 +02:00
|
|
|
bool MScore::showSegmentShapes = false;
|
2018-10-25 15:43:59 +02:00
|
|
|
bool MScore::showSkylines = false;
|
2016-06-03 17:54:21 +02:00
|
|
|
bool MScore::showMeasureShapes = false;
|
2016-06-02 12:12:40 +02:00
|
|
|
bool MScore::noHorizontalStretch = false;
|
2016-06-03 17:54:21 +02:00
|
|
|
bool MScore::noVerticalStretch = false;
|
|
|
|
bool MScore::showBoundingRect = false;
|
2018-11-02 11:59:15 +01:00
|
|
|
bool MScore::showSystemBoundingRect = false;
|
2016-06-03 18:26:51 +02:00
|
|
|
bool MScore::showCorruptedMeasures = true;
|
2016-10-07 13:21:05 +02:00
|
|
|
bool MScore::useFallbackFont = true;
|
2017-08-16 16:56:34 +02:00
|
|
|
bool MScore::autoplaceSlurs = true;
|
2016-06-02 12:50:00 +02:00
|
|
|
// #endif
|
2016-06-02 12:12:40 +02:00
|
|
|
|
2014-12-17 16:38:49 +01:00
|
|
|
bool MScore::saveTemplateMode = false;
|
2014-02-28 11:14:43 +01:00
|
|
|
bool MScore::noGui = false;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2017-03-09 13:37:40 +01:00
|
|
|
MStyle* MScore::_defaultStyleForParts;
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
QString MScore::_globalShare;
|
|
|
|
int MScore::_vRaster;
|
|
|
|
int MScore::_hRaster;
|
2015-10-01 15:03:32 +02:00
|
|
|
bool MScore::_verticalOrientation = false;
|
2015-12-11 14:30:54 +01:00
|
|
|
qreal MScore::verticalPageGap = 5.0;
|
|
|
|
qreal MScore::horizontalPageGapEven = 1.0;
|
|
|
|
qreal MScore::horizontalPageGapOdd = 50.0;
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
QColor MScore::selectColor[VOICES];
|
|
|
|
QColor MScore::defaultColor;
|
|
|
|
QColor MScore::layoutBreakColor;
|
2013-07-04 21:07:38 +02:00
|
|
|
QColor MScore::frameMarginColor;
|
2012-05-26 14:26:10 +02:00
|
|
|
QColor MScore::bgColor;
|
|
|
|
QColor MScore::dropColor;
|
|
|
|
bool MScore::warnPitchRange;
|
|
|
|
|
|
|
|
bool MScore::playRepeats;
|
|
|
|
bool MScore::panPlayback;
|
|
|
|
qreal MScore::nudgeStep;
|
2013-08-26 14:45:01 +02:00
|
|
|
qreal MScore::nudgeStep10;
|
|
|
|
qreal MScore::nudgeStep50;
|
2012-05-26 14:26:10 +02:00
|
|
|
int MScore::defaultPlayDuration;
|
2017-01-05 11:23:47 +01:00
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
QString MScore::lastError;
|
2015-01-12 14:07:05 +01:00
|
|
|
int MScore::division = 480; // 3840; // pulses per quarter note (PPQ) // ticks per beat
|
2012-05-26 14:26:10 +02:00
|
|
|
int MScore::sampleRate = 44100;
|
|
|
|
int MScore::mtcType;
|
|
|
|
|
2014-03-04 17:40:23 +01:00
|
|
|
bool MScore::noExcerpts = false;
|
|
|
|
bool MScore::noImages = false;
|
2015-05-11 09:37:00 +02:00
|
|
|
bool MScore::pdfPrinting = false;
|
2017-05-17 19:36:59 +02:00
|
|
|
bool MScore::svgPrinting = false;
|
|
|
|
|
2016-09-03 17:45:59 +02:00
|
|
|
double MScore::pixelRatio = 0.8; // DPI / logicalDPI
|
|
|
|
|
|
|
|
MPaintDevice* MScore::_paintDevice;
|
2014-03-04 17:40:23 +01:00
|
|
|
|
2014-04-25 18:43:25 +02:00
|
|
|
#ifdef SCRIPT_INTERFACE
|
|
|
|
QQmlEngine* MScore::_qml = 0;
|
|
|
|
#endif
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
Sequencer* MScore::seq = 0;
|
2015-02-03 13:42:37 +01:00
|
|
|
MuseScoreCore* MuseScoreCore::mscoreCore;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
extern void initDrumset();
|
2013-11-11 16:53:03 +01:00
|
|
|
extern void initScoreFonts();
|
2014-04-25 19:11:33 +02:00
|
|
|
extern QString mscoreGlobalShare;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2016-11-28 17:25:26 +01:00
|
|
|
#define TR(a) QT_TRANSLATE_NOOP("error", a)
|
|
|
|
std::vector<MScoreError> MScore::errorList {
|
2016-12-12 10:31:37 +01:00
|
|
|
{ MS_NO_ERROR, 0, 0 },
|
|
|
|
|
|
|
|
{ NO_NOTE_SELECTED, "s1", TR("No note selected:\nPlease select a note and retry\n") },
|
|
|
|
{ NO_CHORD_REST_SELECTED, "s2", TR("No chord/rest selected:\nPlease select a chord or rest and retry") },
|
|
|
|
{ NO_LYRICS_SELECTED, "s3", TR("No note or lyrics selected:\nPlease select a note or lyrics and retry") },
|
|
|
|
{ NO_NOTE_REST_SELECTED, "s4", TR("No note or rest selected:\nPlease select a note or rest and retry") },
|
|
|
|
{ NO_NOTE_SLUR_SELECTED, "s5", TR("No note or slur selected:\nPlease select a note or slur and retry") },
|
|
|
|
{ NO_STAFF_SELECTED, "s6", TR("No staff selected:\nPlease select one or more staves and retry\n") },
|
|
|
|
{ NO_NOTE_FIGUREDBASS_SELECTED, "s7", TR("No note or figured bass selected:\nPlease select a note or figured bass and retry") },
|
|
|
|
|
|
|
|
{ CANNOT_INSERT_TUPLET, "t1", TR("Cannot insert chord/rest in tuplet") },
|
|
|
|
{ CANNOT_SPLIT_TUPLET, "t2", TR("Cannot split tuplet") },
|
|
|
|
{ CANNOT_SPLIT_MEASURE_FIRST_BEAT, "m1", TR("Cannot split measure here:\n" "First beat of measure") },
|
|
|
|
{ CANNOT_SPLIT_MEASURE_TUPLET, "m2", TR("Cannot split measure here:\n" "Cannot split tuplet") },
|
|
|
|
|
|
|
|
{ NO_DEST, "p1", TR("No destination to paste") },
|
|
|
|
{ DEST_TUPLET, "p2", TR("Cannot paste into tuplet") },
|
|
|
|
{ TUPLET_CROSSES_BAR, "p3", TR("Tuplet cannot cross barlines") },
|
|
|
|
{ DEST_LOCAL_TIME_SIGNATURE, "p4", TR("Cannot paste in local time signature") },
|
|
|
|
{ DEST_TREMOLO, "p5", TR("Cannot paste in tremolo") },
|
|
|
|
{ NO_MIME, "p6", TR("Nothing to paste") },
|
|
|
|
{ DEST_NO_CR, "p7", TR("Destination is not a chord or rest") },
|
|
|
|
{ CANNOT_CHANGE_LOCAL_TIMESIG, "l1", TR("Cannot change local time signature:\nMeasure is not empty") },
|
2016-11-28 17:25:26 +01:00
|
|
|
};
|
|
|
|
#undef TR
|
|
|
|
|
2016-11-28 18:25:27 +01:00
|
|
|
MsError MScore::_error { MS_NO_ERROR };
|
2016-11-28 17:25:26 +01:00
|
|
|
|
2016-03-02 13:20:19 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// Direction
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-06-22 12:42:14 +02:00
|
|
|
Direction toDirection(const QString& s)
|
2016-03-02 13:20:19 +01:00
|
|
|
{
|
2017-06-22 12:42:14 +02:00
|
|
|
Direction val;
|
2016-03-02 13:20:19 +01:00
|
|
|
if (s == "up")
|
2017-06-22 12:42:14 +02:00
|
|
|
val = Direction::UP;
|
2016-03-02 13:20:19 +01:00
|
|
|
else if (s == "down")
|
2017-06-22 12:42:14 +02:00
|
|
|
val = Direction::DOWN;
|
2016-03-02 13:20:19 +01:00
|
|
|
else if (s == "auto")
|
2017-06-22 12:42:14 +02:00
|
|
|
val = Direction::AUTO;
|
2016-03-02 13:20:19 +01:00
|
|
|
else
|
2017-06-22 12:42:14 +02:00
|
|
|
val = Direction(s.toInt());
|
|
|
|
return val;
|
2016-03-02 13:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// Direction::toString
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-06-22 12:42:14 +02:00
|
|
|
const char* toString(Direction val)
|
2016-03-02 13:20:19 +01:00
|
|
|
{
|
|
|
|
switch (val) {
|
2017-06-22 12:42:14 +02:00
|
|
|
case Direction::AUTO: return "auto";
|
|
|
|
case Direction::UP: return "up";
|
|
|
|
case Direction::DOWN: return "down";
|
2016-03-02 13:20:19 +01:00
|
|
|
}
|
Solved all compilation errors on MSVC
This commit contains changes required for MuseScore to compile under MSVC with no errors.
There are several general categories of problems that resulted in errors with the compilation. Main issues:
- Variable Length Arrays (VLA). This is a non-standard extension to C++, supported by clang toolchains, but not by MSVC. The initial workaround is to use std::vector<> instead of VLAs, eventually (if needed) with the original variable pointing to the beginning of the allocated array. More efficient alternatives are possible if profiling shows any code using VLAs to be timing-critical.
- Floating-point constants not suffixed with "f" are doubles by default; in some instances, this leads to narrowing conversion errors (in other instances, just warnings).
- MSVC does not support "or"/"and"/"not" in lieu of "||"/"&&"/"!". Changed unconditionally to use standard C++ symbols.
- MSVC does not support the "__builtin_unreachable()" compiler hint. A similar, albeit not exactly equal, alternative is "__assume(0)", which is MSVC-specific.
- MSVC does not support ranges in case statements. Replaced with list of cases instead of range (non-conditionally)
Detailed changes, with per-file comments:
- all.h: opt-in to deprecated features, include <io.h> and <process.h> instead of POSIX <unistd.h>, undefine "STRING_NONE" and "small", which Microsoft defines as macros, which result in compilation errors.
- effects/compressor/zita.cpp: eliminated narrowing conversion error by appending "f" to float constants.
- fluid/voice.cpp: appended "f" to float constants to eliminate narrowing conversion errors/warnings
- libmscore/beam.cpp: conditionally replaced VLA
- libmscore/edit.cpp: conditionally replaced VLA
- libmscore/element.cpp: appended "f" to float constant
- libmscore/fret.cpp: changed or -> ||
- libmscore/layout.cpp: conditionally replaced VLA
- libmscore/mscore.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- libmscore/scorefile.coo: use correct char representation conversion for MSVC
- libmscore/stringdata.cpp: conditionally replaced VLA
- libmscore/system.cpp: conditionally replaced VLA
- libmscroe/text.cpp: replaced range in case statement.
- manual/genManual.cpp: use getopt() replacement.
- midi/midifile.cpp: conditionally replaced VLA. This does not use the default replacement.
- mscore/bb.cpp: replaced range in case statement.
- mscore/capella.cpp: conditionally replaced VLA. Changed and -> &&
- mscore/driver:cpp: preclude errors due to macro redefinitions.
- mscore/editstyle.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- mscore/importgtp-gp6.cpp: conditionally replaced VLA.
- mscore/instrwidget.cpp: conditionally replaced VLA.
- mscore/jackaudio.cpp: conditionally replaced VLA. Preclude errors due to macro redefinitions.
- mscore/jackweakapi.cpp: Preclude errors due to macro redefinitions. Replacement for __atribute__((constructor)) through static object construction for MSVC. Force use of LoadLibraryA instead of LoadLibrary.
- mscore/mididriver.h: Changed not -> !
- mscore/musescore.cpp: Changed not -> !. Conditionally replaced VLA.
- mscore/resourceManager.cpp: conditionally replaced VLA.
- mscore/timeline.cpp: conditionally replaced VLA.
- omr/omrpage.cpp: conditionally replaced VLA.
- synthesizer/msynthesizer.cpp: replaced UNIX sleep(1) method with MSVC Sleep(1000) (equivalent, but in ms instead of seconds)
- synthesizer/msynthsizer.h: appended "f" to float constant
- thirdparty/poppler/config.h: set defines for MSVC to preclude the use of inexistent libraries.
- thirdparty/poppler/poppler/poppler-config.h: set defines for MSVC to preclude the use of inexistent libraries. Eliminated #defines for fmin and fmax which where causing problems.
- thirdparty/poppler/poppler/PSOutputDev.cc: added #include <algorithm> for std::min() and std::max(). Note this is required per-C++ standard.
- thirdparty/portmidi/pm_win/pmwinmm.c: undefined UNICODE to use char-based library functions.
- thirdparty/qzip/qzip.cpp: changed or -> ||
- thirdparty/rtf2html/rtf_keyword.h: file format changed from Apple to UNIX, as MSVC does not supported the former.
(NOT error related, just improvement on previous commit; manual/getopt/README.md: added link to source article)
2018-05-01 19:14:44 +02:00
|
|
|
#if (!defined (_MSCVER) && !defined (_MSC_VER))
|
2016-03-02 13:20:19 +01:00
|
|
|
__builtin_unreachable();
|
Solved all compilation errors on MSVC
This commit contains changes required for MuseScore to compile under MSVC with no errors.
There are several general categories of problems that resulted in errors with the compilation. Main issues:
- Variable Length Arrays (VLA). This is a non-standard extension to C++, supported by clang toolchains, but not by MSVC. The initial workaround is to use std::vector<> instead of VLAs, eventually (if needed) with the original variable pointing to the beginning of the allocated array. More efficient alternatives are possible if profiling shows any code using VLAs to be timing-critical.
- Floating-point constants not suffixed with "f" are doubles by default; in some instances, this leads to narrowing conversion errors (in other instances, just warnings).
- MSVC does not support "or"/"and"/"not" in lieu of "||"/"&&"/"!". Changed unconditionally to use standard C++ symbols.
- MSVC does not support the "__builtin_unreachable()" compiler hint. A similar, albeit not exactly equal, alternative is "__assume(0)", which is MSVC-specific.
- MSVC does not support ranges in case statements. Replaced with list of cases instead of range (non-conditionally)
Detailed changes, with per-file comments:
- all.h: opt-in to deprecated features, include <io.h> and <process.h> instead of POSIX <unistd.h>, undefine "STRING_NONE" and "small", which Microsoft defines as macros, which result in compilation errors.
- effects/compressor/zita.cpp: eliminated narrowing conversion error by appending "f" to float constants.
- fluid/voice.cpp: appended "f" to float constants to eliminate narrowing conversion errors/warnings
- libmscore/beam.cpp: conditionally replaced VLA
- libmscore/edit.cpp: conditionally replaced VLA
- libmscore/element.cpp: appended "f" to float constant
- libmscore/fret.cpp: changed or -> ||
- libmscore/layout.cpp: conditionally replaced VLA
- libmscore/mscore.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- libmscore/scorefile.coo: use correct char representation conversion for MSVC
- libmscore/stringdata.cpp: conditionally replaced VLA
- libmscore/system.cpp: conditionally replaced VLA
- libmscroe/text.cpp: replaced range in case statement.
- manual/genManual.cpp: use getopt() replacement.
- midi/midifile.cpp: conditionally replaced VLA. This does not use the default replacement.
- mscore/bb.cpp: replaced range in case statement.
- mscore/capella.cpp: conditionally replaced VLA. Changed and -> &&
- mscore/driver:cpp: preclude errors due to macro redefinitions.
- mscore/editstyle.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- mscore/importgtp-gp6.cpp: conditionally replaced VLA.
- mscore/instrwidget.cpp: conditionally replaced VLA.
- mscore/jackaudio.cpp: conditionally replaced VLA. Preclude errors due to macro redefinitions.
- mscore/jackweakapi.cpp: Preclude errors due to macro redefinitions. Replacement for __atribute__((constructor)) through static object construction for MSVC. Force use of LoadLibraryA instead of LoadLibrary.
- mscore/mididriver.h: Changed not -> !
- mscore/musescore.cpp: Changed not -> !. Conditionally replaced VLA.
- mscore/resourceManager.cpp: conditionally replaced VLA.
- mscore/timeline.cpp: conditionally replaced VLA.
- omr/omrpage.cpp: conditionally replaced VLA.
- synthesizer/msynthesizer.cpp: replaced UNIX sleep(1) method with MSVC Sleep(1000) (equivalent, but in ms instead of seconds)
- synthesizer/msynthsizer.h: appended "f" to float constant
- thirdparty/poppler/config.h: set defines for MSVC to preclude the use of inexistent libraries.
- thirdparty/poppler/poppler/poppler-config.h: set defines for MSVC to preclude the use of inexistent libraries. Eliminated #defines for fmin and fmax which where causing problems.
- thirdparty/poppler/poppler/PSOutputDev.cc: added #include <algorithm> for std::min() and std::max(). Note this is required per-C++ standard.
- thirdparty/portmidi/pm_win/pmwinmm.c: undefined UNICODE to use char-based library functions.
- thirdparty/qzip/qzip.cpp: changed or -> ||
- thirdparty/rtf2html/rtf_keyword.h: file format changed from Apple to UNIX, as MSVC does not supported the former.
(NOT error related, just improvement on previous commit; manual/getopt/README.md: added link to source article)
2018-05-01 19:14:44 +02:00
|
|
|
#else
|
|
|
|
// The MSVC __assume() optimizer hint is similar, though not identical, to __builtin_unreachable()
|
|
|
|
__assume(0);
|
|
|
|
#endif
|
2016-03-02 13:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// fillComboBox
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-06-22 12:42:14 +02:00
|
|
|
void fillComboBoxDirection(QComboBox* cb)
|
2016-03-02 13:20:19 +01:00
|
|
|
{
|
|
|
|
cb->clear();
|
2017-06-22 12:42:14 +02:00
|
|
|
cb->addItem(qApp->translate("Direction", "auto"), QVariant::fromValue<Direction>(Direction::AUTO));
|
|
|
|
cb->addItem(qApp->translate("Direction", "up"), QVariant::fromValue<Direction>(Direction::UP));
|
|
|
|
cb->addItem(qApp->translate("Direction", "down"), QVariant::fromValue<Direction>(Direction::DOWN));
|
2016-03-02 13:20:19 +01:00
|
|
|
}
|
|
|
|
|
2017-06-26 18:09:56 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// doubleToSpatium
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
static Spatium doubleToSpatium(double d)
|
|
|
|
{
|
|
|
|
return Spatium(d);
|
|
|
|
}
|
2016-03-05 15:31:26 +01:00
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// init
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void MScore::init()
|
|
|
|
{
|
2016-03-05 15:31:26 +01:00
|
|
|
if (!QMetaType::registerConverter<Spatium, double>(&Spatium::toDouble))
|
|
|
|
qFatal("registerConverter Spatium::toDouble failed");
|
|
|
|
if (!QMetaType::registerConverter<double, Spatium>(&doubleToSpatium))
|
2017-01-16 20:51:12 +01:00
|
|
|
qFatal("registerConverter doubleToSpatium failed");
|
2017-06-26 18:09:56 +02:00
|
|
|
// if (!QMetaType::registerComparators<Spatium>())
|
|
|
|
// qFatal("registerComparators for Spatium failed");
|
2016-03-05 15:31:26 +01:00
|
|
|
|
2012-07-13 16:11:39 +02:00
|
|
|
#ifdef SCRIPT_INTERFACE
|
2016-03-02 13:20:19 +01:00
|
|
|
qRegisterMetaType<Note::ValueType> ("ValueType");
|
|
|
|
|
2014-06-26 10:53:57 +02:00
|
|
|
qRegisterMetaType<MScore::DirectionH>("DirectionH");
|
2016-03-02 13:20:19 +01:00
|
|
|
qRegisterMetaType<Spanner::Anchor> ("Anchor");
|
|
|
|
qRegisterMetaType<NoteHead::Group> ("NoteHeadGroup");
|
2014-06-25 22:01:26 +02:00
|
|
|
qRegisterMetaType<NoteHead::Type>("NoteHeadType");
|
2017-03-08 13:12:26 +01:00
|
|
|
qRegisterMetaType<SegmentType>("SegmentType");
|
2012-08-11 01:15:22 +02:00
|
|
|
qRegisterMetaType<FiguredBassItem::Modifier>("Modifier");
|
|
|
|
qRegisterMetaType<FiguredBassItem::Parenthesis>("Parenthesis");
|
2014-06-25 13:28:17 +02:00
|
|
|
qRegisterMetaType<FiguredBassItem::ContLine>("ContLine");
|
2014-06-25 22:28:47 +02:00
|
|
|
qRegisterMetaType<Volta::Type>("VoltaType");
|
2017-03-08 14:18:34 +01:00
|
|
|
qRegisterMetaType<OttavaType>("OttavaType");
|
2014-06-25 14:07:43 +02:00
|
|
|
qRegisterMetaType<Trill::Type>("TrillType");
|
2014-06-24 16:42:47 +02:00
|
|
|
qRegisterMetaType<Dynamic::Range>("DynamicRange");
|
2014-06-26 08:18:17 +02:00
|
|
|
qRegisterMetaType<Jump::Type>("JumpType");
|
2014-06-25 19:43:43 +02:00
|
|
|
qRegisterMetaType<Marker::Type>("MarkerType");
|
2014-06-26 07:45:09 +02:00
|
|
|
qRegisterMetaType<Beam::Mode>("BeamMode");
|
2016-09-22 17:28:44 +02:00
|
|
|
qRegisterMetaType<HairpinType>("HairpinType");
|
2014-06-25 13:28:17 +02:00
|
|
|
qRegisterMetaType<Lyrics::Syllabic>("Syllabic");
|
2014-06-25 13:57:29 +02:00
|
|
|
qRegisterMetaType<LayoutBreak::Type>("LayoutBreakType");
|
2016-02-26 18:44:58 +01:00
|
|
|
|
|
|
|
//classed enumerations
|
2017-01-16 20:51:12 +01:00
|
|
|
// qRegisterMetaType<MSQE_StyledPropertyListIdx::E>("StyledPropertyListIdx");
|
2017-01-05 11:23:47 +01:00
|
|
|
// qRegisterMetaType<MSQE_BarLineType::E>("BarLineType");
|
2012-07-13 16:11:39 +02:00
|
|
|
#endif
|
2016-07-07 16:20:16 +02:00
|
|
|
qRegisterMetaType<Fraction>("Fraction");
|
2012-07-13 16:11:39 +02:00
|
|
|
|
2018-09-26 13:02:13 +02:00
|
|
|
if (!QMetaType::registerConverter<Fraction, QString>(&Fraction::toString))
|
|
|
|
qFatal("registerConverter Fraction::toString failed");
|
|
|
|
|
2013-05-16 16:12:22 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2012-05-26 14:26:10 +02:00
|
|
|
QDir dir(QCoreApplication::applicationDirPath() + QString("/../" INSTALL_NAME));
|
|
|
|
_globalShare = dir.absolutePath() + "/";
|
2013-05-16 16:12:22 +02:00
|
|
|
#elif defined(Q_OS_IOS)
|
2012-05-26 14:26:10 +02:00
|
|
|
{
|
|
|
|
extern QString resourcePath();
|
|
|
|
_globalShare = resourcePath();
|
|
|
|
}
|
2013-11-06 15:58:05 +01:00
|
|
|
|
2013-05-16 16:12:22 +02:00
|
|
|
#elif defined(Q_OS_MAC)
|
2012-05-26 14:26:10 +02:00
|
|
|
QDir dir(QCoreApplication::applicationDirPath() + QString("/../Resources"));
|
|
|
|
_globalShare = dir.absolutePath() + "/";
|
|
|
|
#else
|
2016-01-04 02:36:36 +01:00
|
|
|
// Try relative path (needed for portable AppImage and non-standard installations)
|
|
|
|
QDir dir(QCoreApplication::applicationDirPath() + QString("/../share/" INSTALL_NAME));
|
|
|
|
if (dir.exists())
|
|
|
|
_globalShare = dir.absolutePath() + "/";
|
|
|
|
else // Fall back to default location (e.g. if binary has moved relative to share)
|
|
|
|
_globalShare = QString( INSTPREFIX "/share/" INSTALL_NAME);
|
2012-05-26 14:26:10 +02:00
|
|
|
#endif
|
2012-11-20 23:07:37 +01:00
|
|
|
|
2014-09-09 00:33:51 +02:00
|
|
|
selectColor[0].setNamedColor("#1259d0"); //blue
|
|
|
|
selectColor[1].setNamedColor("#009234"); //green
|
|
|
|
selectColor[2].setNamedColor("#c04400"); //orange
|
|
|
|
selectColor[3].setNamedColor("#70167a"); //purple
|
2013-07-04 17:50:46 +02:00
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
defaultColor = Qt::black;
|
2014-09-09 00:33:51 +02:00
|
|
|
dropColor = QColor("#1778db");
|
2012-05-26 14:26:10 +02:00
|
|
|
defaultPlayDuration = 300; // ms
|
|
|
|
warnPitchRange = true;
|
2012-07-31 16:54:00 +02:00
|
|
|
playRepeats = true;
|
|
|
|
panPlayback = true;
|
2012-08-03 15:54:02 +02:00
|
|
|
|
2012-07-31 16:54:00 +02:00
|
|
|
lastError = "";
|
2012-08-03 15:54:02 +02:00
|
|
|
|
2014-08-31 19:22:21 +02:00
|
|
|
layoutBreakColor = QColor("#5999db");
|
|
|
|
frameMarginColor = QColor("#5999db");
|
2013-09-13 12:54:09 +02:00
|
|
|
bgColor.setNamedColor("#dddddd");
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2017-01-05 11:23:47 +01:00
|
|
|
//
|
|
|
|
// initialize styles
|
|
|
|
//
|
2017-03-09 13:37:40 +01:00
|
|
|
_baseStyle.precomputeValues();
|
2017-01-17 09:58:32 +01:00
|
|
|
QSettings s;
|
2018-02-16 00:05:38 +01:00
|
|
|
QString defStyle = s.value("score/style/defaultStyleFile").toString();
|
2017-03-31 13:03:15 +02:00
|
|
|
if (!(MScore::testMode || defStyle.isEmpty())) {
|
2017-01-17 09:58:32 +01:00
|
|
|
QFile f(defStyle);
|
|
|
|
if (f.open(QIODevice::ReadOnly)) {
|
2017-03-15 13:35:27 +01:00
|
|
|
qDebug("load default style <%s>", qPrintable(defStyle));
|
2017-01-17 09:58:32 +01:00
|
|
|
_defaultStyle.load(&f);
|
|
|
|
f.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_defaultStyle.precomputeValues();
|
2018-02-16 00:05:38 +01:00
|
|
|
QString partStyle = s.value("score/style/partStyleFile").toString();
|
2017-03-31 13:03:15 +02:00
|
|
|
if (!(MScore::testMode || partStyle.isEmpty())) {
|
2017-01-05 11:23:47 +01:00
|
|
|
QFile f(partStyle);
|
2017-03-09 13:37:40 +01:00
|
|
|
if (f.open(QIODevice::ReadOnly)) {
|
2017-03-15 13:35:27 +01:00
|
|
|
qDebug("load default style for parts <%s>", qPrintable(partStyle));
|
2017-03-09 13:37:40 +01:00
|
|
|
_defaultStyleForParts = new MStyle(_defaultStyle);
|
|
|
|
_defaultStyleForParts->load(&f);
|
|
|
|
_defaultStyleForParts->precomputeValues();
|
|
|
|
}
|
2017-01-05 11:23:47 +01:00
|
|
|
}
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// load internal fonts
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// do not load application specific fonts
|
|
|
|
// for MAC, they are in Resources/fonts
|
|
|
|
//
|
2013-05-16 16:12:22 +02:00
|
|
|
#if !defined(Q_OS_MAC) && !defined(Q_OS_IOS)
|
2012-05-26 14:26:10 +02:00
|
|
|
static const char* fonts[] = {
|
2016-10-26 20:36:47 +02:00
|
|
|
":/fonts/musejazz/MuseJazzText.otf",
|
2014-01-16 12:33:23 +01:00
|
|
|
":/fonts/FreeSans.ttf",
|
2014-01-22 16:19:54 +01:00
|
|
|
":/fonts/FreeSerif.ttf",
|
2014-01-16 12:33:23 +01:00
|
|
|
":/fonts/FreeSerifBold.ttf",
|
2015-04-15 14:10:07 +02:00
|
|
|
":/fonts/FreeSerifItalic.ttf",
|
|
|
|
":/fonts/FreeSerifBoldItalic.ttf",
|
2014-01-16 12:33:23 +01:00
|
|
|
":/fonts/mscoreTab.ttf",
|
|
|
|
":/fonts/mscore-BC.ttf",
|
2014-07-23 12:35:56 +02:00
|
|
|
":/fonts/bravura/BravuraText.otf",
|
2014-12-19 17:26:41 +01:00
|
|
|
":/fonts/gootville/GootvilleText.otf",
|
2014-07-23 17:08:48 +02:00
|
|
|
":/fonts/mscore/MScoreText.ttf",
|
2012-05-26 14:26:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < sizeof(fonts)/sizeof(*fonts); ++i) {
|
2018-09-25 15:55:08 +02:00
|
|
|
QString str(fonts[i]);
|
|
|
|
if (-1 == QFontDatabase::addApplicationFont(str)) {
|
2014-07-17 11:15:59 +02:00
|
|
|
if (!MScore::testMode)
|
2018-09-25 15:55:08 +02:00
|
|
|
qDebug("Mscore: fatal error: cannot load internal font <%s>", qPrintable(str));
|
2014-05-21 12:20:05 +02:00
|
|
|
if (!MScore::debugMode && !MScore::testMode)
|
2012-05-26 14:26:10 +02:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2013-11-06 15:58:05 +01:00
|
|
|
initScoreFonts();
|
2014-04-30 10:08:38 +02:00
|
|
|
StaffType::initStaffTypes();
|
2012-05-26 14:26:10 +02:00
|
|
|
initDrumset();
|
|
|
|
FiguredBass::readConfigFile(0);
|
2016-01-04 14:48:58 +01:00
|
|
|
|
|
|
|
#ifdef DEBUG_SHAPES
|
|
|
|
testShapes();
|
|
|
|
#endif
|
2017-11-29 08:21:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// readDefaultStyle
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
bool MScore::readDefaultStyle(QString file)
|
|
|
|
{
|
|
|
|
if (file.isEmpty())
|
|
|
|
return false;
|
|
|
|
MStyle style = defaultStyle();
|
|
|
|
QFile f(file);
|
|
|
|
if (!f.open(QIODevice::ReadOnly))
|
|
|
|
return false;
|
|
|
|
bool rv = style.load(&f);
|
|
|
|
if (rv)
|
|
|
|
setDefaultStyle(style);
|
|
|
|
f.close();
|
|
|
|
return rv;
|
2012-05-26 14:26:10 +02:00
|
|
|
}
|
|
|
|
|
2014-01-30 13:10:45 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// defaultStyleForPartsHasChanged
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void MScore::defaultStyleForPartsHasChanged()
|
|
|
|
{
|
2018-02-16 00:05:38 +01:00
|
|
|
// TODO what is needed here?
|
2017-01-05 11:23:47 +01:00
|
|
|
// delete _defaultStyleForParts;
|
|
|
|
// _defaultStyleForParts = 0;
|
2014-01-30 13:10:45 +01:00
|
|
|
}
|
|
|
|
|
2016-11-28 17:25:26 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// errorMessage
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
const char* MScore::errorMessage()
|
|
|
|
{
|
|
|
|
for (MScoreError& e : errorList) {
|
|
|
|
if (e.no == _error)
|
|
|
|
return e.txt;
|
|
|
|
}
|
|
|
|
return "unknown error";
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// errorGroup
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
const char* MScore::errorGroup()
|
|
|
|
{
|
|
|
|
for (MScoreError& e : errorList) {
|
|
|
|
if (e.no == _error)
|
|
|
|
return e.group;
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2014-05-19 15:19:36 +02:00
|
|
|
#ifdef SCRIPT_INTERFACE
|
2014-04-25 18:43:25 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// qml
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
QQmlEngine* MScore::qml()
|
|
|
|
{
|
|
|
|
if (_qml == 0) {
|
|
|
|
//-----------some qt bindings
|
|
|
|
_qml = new QQmlEngine;
|
2017-02-27 09:38:24 +01:00
|
|
|
|
2014-04-25 18:43:25 +02:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
QStringList importPaths;
|
|
|
|
QDir dir(QCoreApplication::applicationDirPath() + QString("/../qml"));
|
|
|
|
importPaths.append(dir.absolutePath());
|
|
|
|
_qml->setImportPathList(importPaths);
|
|
|
|
#endif
|
|
|
|
#ifdef Q_OS_MAC
|
|
|
|
QStringList importPaths;
|
|
|
|
QDir dir(mscoreGlobalShare + QString("/qml"));
|
|
|
|
importPaths.append(dir.absolutePath());
|
|
|
|
_qml->setImportPathList(importPaths);
|
|
|
|
#endif
|
2017-03-08 13:12:26 +01:00
|
|
|
const char* enumErr = "You can't create an enumeration";
|
2017-12-11 12:35:23 +01:00
|
|
|
//TODO-ws qmlRegisterType<MsProcess> ("MuseScore", 3, 0, "QProcess");
|
2017-06-28 15:18:59 +02:00
|
|
|
qmlRegisterType<FileIO, 1> ("FileIO", 3, 0, "FileIO");
|
2014-04-25 18:43:25 +02:00
|
|
|
//-----------mscore bindings
|
2017-06-28 15:18:59 +02:00
|
|
|
qmlRegisterUncreatableMetaObject(Ms::staticMetaObject, "MuseScore", 3, 0, "Ms", enumErr);
|
2017-08-11 11:51:24 +02:00
|
|
|
// qmlRegisterUncreatableType<Direction>("MuseScore", 3, 0, "Direction", QObject::tr(enumErr));
|
2016-03-02 13:20:19 +01:00
|
|
|
|
2017-06-28 15:18:59 +02:00
|
|
|
qmlRegisterType<MScore> ("MuseScore", 3, 0, "MScore");
|
2017-12-11 12:35:23 +01:00
|
|
|
//TODO-ws qmlRegisterType<MsScoreView>("MuseScore", 3, 0, "ScoreView");
|
2017-02-27 09:38:24 +01:00
|
|
|
|
2017-06-28 15:18:59 +02:00
|
|
|
qmlRegisterType<Score> ("MuseScore", 3, 0, "Score");
|
|
|
|
qmlRegisterType<Cursor> ("MuseScore", 3, 0, "Cursor");
|
|
|
|
qmlRegisterType<ElementW> ("MuseScore", 3, 0, "Element");
|
2017-02-27 09:38:24 +01:00
|
|
|
qRegisterMetaType<ElementW*>("ElementWrapper*");
|
|
|
|
#if 0
|
2014-04-25 18:43:25 +02:00
|
|
|
qmlRegisterType<Segment> ("MuseScore", 1, 0, "Segment");
|
|
|
|
qmlRegisterType<Chord> ("MuseScore", 1, 0, "Chord");
|
|
|
|
qmlRegisterType<Note> ("MuseScore", 1, 0, "Note");
|
2015-03-03 18:59:46 +01:00
|
|
|
qmlRegisterType<NoteHead> ("MuseScore", 1, 0, "NoteHead");
|
2014-04-25 18:43:25 +02:00
|
|
|
qmlRegisterType<Accidental> ("MuseScore", 1, 0, "Accidental");
|
|
|
|
qmlRegisterType<Rest> ("MuseScore", 1, 0, "Rest");
|
|
|
|
qmlRegisterType<Measure> ("MuseScore", 1, 0, "Measure");
|
|
|
|
qmlRegisterType<StaffText> ("MuseScore", 1, 0, "StaffText");
|
|
|
|
qmlRegisterType<Part> ("MuseScore", 1, 0, "Part");
|
|
|
|
qmlRegisterType<Staff> ("MuseScore", 1, 0, "Staff");
|
|
|
|
qmlRegisterType<Harmony> ("MuseScore", 1, 0, "Harmony");
|
|
|
|
qmlRegisterType<TimeSig> ("MuseScore", 1, 0, "TimeSig");
|
|
|
|
qmlRegisterType<KeySig> ("MuseScore", 1, 0, "KeySig");
|
|
|
|
qmlRegisterType<Slur> ("MuseScore", 1, 0, "Slur");
|
|
|
|
qmlRegisterType<Tie> ("MuseScore", 1, 0, "Tie");
|
|
|
|
qmlRegisterType<NoteDot> ("MuseScore", 1, 0, "NoteDot");
|
|
|
|
qmlRegisterType<FiguredBass>("MuseScore", 1, 0, "FiguredBass");
|
|
|
|
qmlRegisterType<Text> ("MuseScore", 1, 0, "MText");
|
|
|
|
qmlRegisterType<Lyrics> ("MuseScore", 1, 0, "Lyrics");
|
|
|
|
qmlRegisterType<FiguredBassItem>("MuseScore", 1, 0, "FiguredBassItem");
|
|
|
|
qmlRegisterType<LayoutBreak>("MuseScore", 1, 0, "LayoutBreak");
|
2015-03-18 12:17:01 +01:00
|
|
|
qmlRegisterType<Hook> ("MuseScore", 1, 0, "Hook");
|
|
|
|
qmlRegisterType<Stem> ("MuseScore", 1, 0, "Stem");
|
2015-03-19 10:28:01 +01:00
|
|
|
qmlRegisterType<StemSlash> ("MuseScore", 1, 0, "StemSlash");
|
2015-03-18 12:17:01 +01:00
|
|
|
qmlRegisterType<Beam> ("MuseScore", 1, 0, "Beam");
|
2015-04-22 21:22:06 +02:00
|
|
|
qmlRegisterType<Excerpt> ("MuseScore", 1, 0, "Excerpt");
|
2016-06-10 23:29:35 +02:00
|
|
|
qmlRegisterType<BarLine> ("MuseScore", 1, 0, "BarLine");
|
2016-07-07 16:20:16 +02:00
|
|
|
|
2014-04-25 18:43:25 +02:00
|
|
|
|
2016-02-26 18:44:58 +01:00
|
|
|
//classed enumerations
|
2017-08-11 11:51:24 +02:00
|
|
|
qmlRegisterUncreatableType<MSQE_StyledPropertyListIdx>("MuseScore", 1, 0, "StyledPropertyListIdx", QObject::tr("You can't create an enum"));
|
2017-03-08 13:12:26 +01:00
|
|
|
qmlRegisterUncreatableType<MSQE_BarLineType>("MuseScore", 1, 0, "BarLineType", enumErr);
|
2016-02-26 18:44:58 +01:00
|
|
|
|
2014-04-25 18:43:25 +02:00
|
|
|
//-----------virtual classes
|
|
|
|
qmlRegisterType<ChordRest>();
|
|
|
|
qmlRegisterType<SlurTie>();
|
|
|
|
qmlRegisterType<Spanner>();
|
2017-02-17 15:09:28 +01:00
|
|
|
#endif
|
2017-06-28 15:18:59 +02:00
|
|
|
qmlRegisterType<FractionWrapper> ("MuseScore", 3, 1, "Fraction");
|
2017-02-27 09:38:24 +01:00
|
|
|
qRegisterMetaType<FractionWrapper*>("FractionWrapper*");
|
2014-04-25 18:43:25 +02:00
|
|
|
}
|
|
|
|
return _qml;
|
|
|
|
}
|
2016-09-03 17:45:59 +02:00
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// paintDevice
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
MPaintDevice* MScore::paintDevice()
|
|
|
|
{
|
|
|
|
if (!_paintDevice)
|
|
|
|
_paintDevice = new MPaintDevice();
|
|
|
|
return _paintDevice;
|
|
|
|
}
|
|
|
|
|
2016-11-28 17:25:26 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// metric
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2016-09-03 17:45:59 +02:00
|
|
|
int MPaintDevice::metric(PaintDeviceMetric m) const
|
|
|
|
{
|
|
|
|
switch (m) {
|
|
|
|
case QPaintDevice::PdmDpiY:
|
|
|
|
return int(DPI);
|
|
|
|
default:
|
|
|
|
printf("debug: metric %d\n", int(m));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-28 17:25:26 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// paintEngine
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2016-09-03 17:45:59 +02:00
|
|
|
QPaintEngine* MPaintDevice::paintEngine() const
|
|
|
|
{
|
|
|
|
printf("paint engine\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-05-19 15:19:36 +02:00
|
|
|
#endif
|
2013-05-13 18:49:17 +02:00
|
|
|
}
|
|
|
|
|