2014-05-30 08:53:19 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2014-05-30 08:53:19 +00:00
|
|
|
*/
|
2016-03-24 08:57:11 +00:00
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
#define __HUGE
|
2016-04-14 13:03:03 +00:00
|
|
|
|
2016-02-01 10:12:37 +00:00
|
|
|
#ifdef __cplusplus
|
2016-01-21 06:58:58 +00:00
|
|
|
|
2016-04-01 08:50:02 +00:00
|
|
|
#include <cmath>
|
|
|
|
|
2016-04-14 13:03:03 +00:00
|
|
|
// False positive warning in clang for QMap member function value:
|
|
|
|
// const T QMap<Key, T>::value(const Key &akey, const T &adefaultValue)
|
|
|
|
// fires with "Returning address of local temporary object" which is not true.
|
|
|
|
#ifdef __clang__
|
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wreturn-stack-address"
|
2018-05-10 08:13:13 +00:00
|
|
|
#elif defined _MSC_VER && _MSC_VER >= 1914 // __clang__
|
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(disable:4180)
|
|
|
|
#endif // __clang__ || _MSC_VER >= 1914
|
2016-04-14 13:03:03 +00:00
|
|
|
|
2019-09-04 07:19:15 +00:00
|
|
|
#include <QtCore/QMap>
|
2016-04-14 13:03:03 +00:00
|
|
|
|
|
|
|
#ifdef __clang__
|
|
|
|
#pragma clang diagnostic pop
|
2018-05-10 08:13:13 +00:00
|
|
|
#elif defined _MSC_VER && _MSC_VER >= 1914 // __clang__
|
|
|
|
#pragma warning(pop)
|
|
|
|
#endif // __clang__ || _MSC_VER >= 1914
|
2016-04-14 13:03:03 +00:00
|
|
|
|
2019-09-04 07:19:15 +00:00
|
|
|
#include <QtCore/QtMath>
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
#include <QtCore/QPointer>
|
|
|
|
#include <QtCore/QMutex>
|
|
|
|
#include <QtCore/QReadWriteLock>
|
|
|
|
#include <QtCore/QDataStream>
|
|
|
|
#include <QtCore/QDir>
|
|
|
|
#include <QtCore/QFile>
|
|
|
|
#include <QtCore/QFileInfo>
|
|
|
|
#include <QtCore/QThread>
|
|
|
|
#include <QtCore/QByteArray>
|
|
|
|
#include <QtCore/QChar>
|
|
|
|
#include <QtCore/QDateTime>
|
|
|
|
#include <QtCore/QHash>
|
|
|
|
#include <QtCore/QList>
|
|
|
|
#include <QtCore/QMargins>
|
|
|
|
#include <QtCore/QPair>
|
|
|
|
#include <QtCore/QPoint>
|
|
|
|
#include <QtCore/QRect>
|
|
|
|
#include <QtCore/QRegularExpression>
|
|
|
|
#include <QtCore/QSet>
|
|
|
|
#include <QtCore/QSize>
|
|
|
|
#include <QtCore/QString>
|
|
|
|
#include <QtCore/QStringList>
|
|
|
|
#include <QtCore/QVector>
|
|
|
|
|
|
|
|
#include <QtGui/QIcon>
|
|
|
|
#include <QtGui/QImage>
|
|
|
|
#include <QtGui/QImageReader>
|
|
|
|
#include <QtGui/QPixmap>
|
|
|
|
#include <QtGui/QtEvents>
|
|
|
|
#include <QtGui/QBrush>
|
|
|
|
#include <QtGui/QColor>
|
|
|
|
#include <QtGui/QPainter>
|
|
|
|
#include <QtGui/QPainterPath>
|
|
|
|
#include <QtGui/QPen>
|
|
|
|
#include <QtGui/QRegion>
|
|
|
|
#include <QtGui/QRgb>
|
|
|
|
#include <QtGui/QFont>
|
|
|
|
#include <QtGui/QFontInfo>
|
|
|
|
|
|
|
|
#include <QtWidgets/QWidget>
|
2019-09-08 20:42:40 +00:00
|
|
|
|
|
|
|
#ifndef OS_MAC_OLD
|
2019-09-04 07:19:15 +00:00
|
|
|
#include <QtWidgets/QOpenGLWidget>
|
2019-09-08 20:42:40 +00:00
|
|
|
#endif // OS_MAC_OLD
|
2016-08-31 17:58:46 +00:00
|
|
|
|
2020-02-11 15:10:07 +00:00
|
|
|
// Fix Google Breakpad build for Mac App Store and Linux version
|
2020-06-13 01:03:23 +00:00
|
|
|
#ifdef Q_OS_UNIX
|
2019-09-04 07:19:15 +00:00
|
|
|
#define __STDC_FORMAT_MACROS
|
2020-06-13 01:03:23 +00:00
|
|
|
#endif // Q_OS_UNIX
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2020-07-27 14:19:26 +00:00
|
|
|
// Remove 'small' macro definition.
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
#include <rpc.h>
|
|
|
|
#ifdef small
|
|
|
|
#undef small
|
|
|
|
#endif // small
|
|
|
|
#endif // Q_OS_WIN
|
|
|
|
|
2017-08-13 16:17:16 +00:00
|
|
|
#include <array>
|
|
|
|
#include <vector>
|
|
|
|
#include <set>
|
|
|
|
#include <map>
|
2018-01-25 14:19:14 +00:00
|
|
|
#include <unordered_map>
|
2018-04-09 17:48:29 +00:00
|
|
|
#include <unordered_set>
|
2017-08-13 16:17:16 +00:00
|
|
|
#include <algorithm>
|
|
|
|
#include <memory>
|
2020-06-09 09:36:40 +00:00
|
|
|
#include <any>
|
2018-09-21 16:28:46 +00:00
|
|
|
#include <optional>
|
2017-11-24 21:05:14 +00:00
|
|
|
|
2017-11-19 14:37:07 +00:00
|
|
|
#include <range/v3/all.hpp>
|
2017-08-17 09:06:26 +00:00
|
|
|
|
|
|
|
// Redefine Ensures/Expects by our own assertions.
|
|
|
|
#include "base/assertion.h"
|
|
|
|
|
2017-08-13 16:17:16 +00:00
|
|
|
#include <gsl/gsl>
|
2017-09-20 18:40:23 +00:00
|
|
|
#include <rpl/rpl.h>
|
2017-12-17 18:41:34 +00:00
|
|
|
#include <crl/crl.h>
|
2017-09-20 18:40:23 +00:00
|
|
|
|
2017-08-14 12:47:46 +00:00
|
|
|
#include "base/variant.h"
|
2017-08-14 10:38:23 +00:00
|
|
|
#include "base/optional.h"
|
2017-08-14 12:47:46 +00:00
|
|
|
#include "base/algorithm.h"
|
2019-07-10 15:03:15 +00:00
|
|
|
#include "base/invoke_queued.h"
|
2017-09-04 11:40:02 +00:00
|
|
|
#include "base/flat_set.h"
|
|
|
|
#include "base/flat_map.h"
|
2018-06-04 15:35:11 +00:00
|
|
|
#include "base/weak_ptr.h"
|
2019-09-13 06:06:02 +00:00
|
|
|
#include "base/observer.h"
|
2017-09-04 11:40:02 +00:00
|
|
|
|
2018-07-30 20:34:23 +00:00
|
|
|
#include "base/basic_types.h"
|
2016-09-29 11:37:16 +00:00
|
|
|
#include "logs.h"
|
|
|
|
#include "core/utils.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2019-11-13 08:31:12 +00:00
|
|
|
#include "scheme.h"
|
|
|
|
#include "mtproto/type_utils.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-04-21 17:57:29 +00:00
|
|
|
#include "ui/style/style_core.h"
|
2016-10-28 12:44:28 +00:00
|
|
|
#include "styles/palette.h"
|
2016-04-21 17:57:29 +00:00
|
|
|
#include "styles/style_basic.h"
|
|
|
|
|
2018-10-23 09:44:42 +00:00
|
|
|
#include "ui/image/image_location.h"
|
2016-04-14 11:00:23 +00:00
|
|
|
#include "ui/text/text.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2017-09-26 11:49:16 +00:00
|
|
|
#include "data/data_types.h"
|
2016-02-01 10:12:37 +00:00
|
|
|
|
2016-03-24 12:57:10 +00:00
|
|
|
#endif // __cplusplus
|