mirror of https://github.com/procxx/kepka.git
Tons of compilation bugs fixed
This commit is contained in:
parent
a2785b8a62
commit
7d3d01a117
|
@ -26,11 +26,11 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN // use Lzma SDK for win
|
//#ifdef Q_OS_WIN // use Lzma SDK for win
|
||||||
#include <LzmaLib.h>
|
//#include <LzmaLib.h>
|
||||||
#else // Q_OS_WIN
|
//#else // Q_OS_WIN
|
||||||
#include <lzma.h>
|
#include <lzma.h>
|
||||||
#endif // else of Q_OS_WIN
|
//#endif // else of Q_OS_WIN
|
||||||
|
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "platform/platform_specific.h"
|
#include "platform/platform_specific.h"
|
||||||
|
@ -244,11 +244,11 @@ void UpdateChecker::unpackUpdate() {
|
||||||
return fatalFail();
|
return fatalFail();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_WIN // use Lzma SDK for win
|
//#ifdef Q_OS_WIN // use Lzma SDK for win
|
||||||
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = LZMA_PROPS_SIZE, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hPropsLen + hOriginalSizeLen; // header
|
// const int32 hSigLen = 128, hShaLen = 20, hPropsLen = LZMA_PROPS_SIZE, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hPropsLen + hOriginalSizeLen; // header
|
||||||
#else // Q_OS_WIN
|
//#else // Q_OS_WIN
|
||||||
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = 0, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hOriginalSizeLen; // header
|
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = 0, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hOriginalSizeLen; // header
|
||||||
#endif // Q_OS_WIN
|
//#endif // Q_OS_WIN
|
||||||
|
|
||||||
QByteArray compressed = outputFile.readAll();
|
QByteArray compressed = outputFile.readAll();
|
||||||
int32 compressedLen = compressed.size() - hSize;
|
int32 compressedLen = compressed.size() - hSize;
|
||||||
|
@ -306,14 +306,14 @@ void UpdateChecker::unpackUpdate() {
|
||||||
uncompressed.resize(uncompressedLen);
|
uncompressed.resize(uncompressedLen);
|
||||||
|
|
||||||
size_t resultLen = uncompressed.size();
|
size_t resultLen = uncompressed.size();
|
||||||
#ifdef Q_OS_WIN // use Lzma SDK for win
|
//#ifdef Q_OS_WIN // use Lzma SDK for win
|
||||||
SizeT srcLen = compressedLen;
|
// SizeT srcLen = compressedLen;
|
||||||
int uncompressRes = LzmaUncompress((uchar*)uncompressed.data(), &resultLen, (const uchar*)(compressed.constData() + hSize), &srcLen, (const uchar*)(compressed.constData() + hSigLen + hShaLen), LZMA_PROPS_SIZE);
|
// int uncompressRes = LzmaUncompress((uchar*)uncompressed.data(), &resultLen, (const uchar*)(compressed.constData() + hSize), &srcLen, (const uchar*)(compressed.constData() + hSigLen + hShaLen), LZMA_PROPS_SIZE);
|
||||||
if (uncompressRes != SZ_OK) {
|
// if (uncompressRes != SZ_OK) {
|
||||||
LOG(("Update Error: could not uncompress lzma, code: %1").arg(uncompressRes));
|
// LOG(("Update Error: could not uncompress lzma, code: %1").arg(uncompressRes));
|
||||||
return fatalFail();
|
// return fatalFail();
|
||||||
}
|
// }
|
||||||
#else // Q_OS_WIN
|
//#else // Q_OS_WIN
|
||||||
lzma_stream stream = LZMA_STREAM_INIT;
|
lzma_stream stream = LZMA_STREAM_INIT;
|
||||||
|
|
||||||
lzma_ret ret = lzma_stream_decoder(&stream, UINT64_MAX, LZMA_CONCATENATED);
|
lzma_ret ret = lzma_stream_decoder(&stream, UINT64_MAX, LZMA_CONCATENATED);
|
||||||
|
@ -356,7 +356,7 @@ void UpdateChecker::unpackUpdate() {
|
||||||
LOG(("Error in decompression: %1 (error code %2)").arg(msg).arg(res));
|
LOG(("Error in decompression: %1 (error code %2)").arg(msg).arg(res));
|
||||||
return fatalFail();
|
return fatalFail();
|
||||||
}
|
}
|
||||||
#endif // Q_OS_WIN
|
//#endif // Q_OS_WIN
|
||||||
|
|
||||||
tempDir.mkdir(tempDir.absolutePath());
|
tempDir.mkdir(tempDir.absolutePath());
|
||||||
|
|
||||||
|
|
|
@ -806,9 +806,9 @@ bool Generator::writeReplacements() {
|
||||||
QMap<QChar, QVector<int>> byCharIndices;
|
QMap<QChar, QVector<int>> byCharIndices;
|
||||||
suggestionsSource_->stream() << "\
|
suggestionsSource_->stream() << "\
|
||||||
struct ReplacementStruct {\n\
|
struct ReplacementStruct {\n\
|
||||||
small emojiSize;\n\
|
smallchar emojiSize;\n\
|
||||||
small replacementSize;\n\
|
smallchar replacementSize;\n\
|
||||||
small wordsCount;\n\
|
smallchar wordsCount;\n\
|
||||||
};\n\
|
};\n\
|
||||||
\n\
|
\n\
|
||||||
const utf16char ReplacementData[] = {";
|
const utf16char ReplacementData[] = {";
|
||||||
|
@ -833,7 +833,7 @@ const utf16char ReplacementData[] = {";
|
||||||
}
|
}
|
||||||
suggestionsSource_->stream() << " };\n\
|
suggestionsSource_->stream() << " };\n\
|
||||||
\n\
|
\n\
|
||||||
const small ReplacementWordLengths[] = {";
|
const smallchar ReplacementWordLengths[] = {";
|
||||||
startBinary();
|
startBinary();
|
||||||
for (auto &replace : replaces_.list) {
|
for (auto &replace : replaces_.list) {
|
||||||
auto wordLengths = QStringList();
|
auto wordLengths = QStringList();
|
||||||
|
@ -846,7 +846,7 @@ const small ReplacementWordLengths[] = {";
|
||||||
const ReplacementStruct ReplacementInitData[] = {\n";
|
const ReplacementStruct ReplacementInitData[] = {\n";
|
||||||
for (auto &replace : replaces_.list) {
|
for (auto &replace : replaces_.list) {
|
||||||
suggestionsSource_->stream() << "\
|
suggestionsSource_->stream() << "\
|
||||||
{ small(" << replace.id.size() << "), small(" << replace.replacement.size() << "), small(" << replace.words.size() << ") },\n";
|
{ smallchar(" << replace.id.size() << "), smallchar(" << replace.replacement.size() << "), smallchar(" << replace.words.size() << ") },\n";
|
||||||
}
|
}
|
||||||
suggestionsSource_->stream() << "};\n\
|
suggestionsSource_->stream() << "};\n\
|
||||||
\n\
|
\n\
|
||||||
|
|
|
@ -44,8 +44,8 @@ int main(int argc, char *argv[]) {
|
||||||
#else
|
#else
|
||||||
QCoreApplication::addLibraryPath("/usr/lib/qt5/plugins");
|
QCoreApplication::addLibraryPath("/usr/lib/qt5/plugins");
|
||||||
#endif
|
#endif
|
||||||
setenv("QT_STYLE_OVERRIDE", "qwerty", false);
|
qputenv("QT_STYLE_OVERRIDE", "qwerty");
|
||||||
unsetenv("QT_QPA_PLATFORMTHEME");
|
qunsetenv("QT_QPA_PLATFORMTHEME");
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,20 +18,20 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
#include "platform/win/audio_win.h"
|
#include "platform/win/audio_win.h"
|
||||||
|
|
||||||
#include "platform/win/windows_dlls.h"
|
#include "platform/win/windows_dlls.h"
|
||||||
#include "media/media_audio.h"
|
#include "media/media_audio.h"
|
||||||
|
|
||||||
#include <mmdeviceapi.h>
|
|
||||||
#include <audioclient.h>
|
|
||||||
|
|
||||||
#include <wrl\client.h>
|
|
||||||
using namespace Microsoft::WRL;
|
using namespace Microsoft::WRL;
|
||||||
|
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
namespace Audio {
|
namespace Audio {
|
||||||
namespace {
|
namespace {
|
||||||
|
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
|
||||||
|
const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
|
||||||
|
|
||||||
// Inspired by Chromium.
|
// Inspired by Chromium.
|
||||||
class DeviceListener : public IMMNotificationClient {
|
class DeviceListener : public IMMNotificationClient {
|
||||||
|
|
|
@ -18,6 +18,8 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include <ShlGuid.h>
|
||||||
#include "platform/win/file_utilities_win.h"
|
#include "platform/win/file_utilities_win.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
@ -26,8 +28,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "messenger.h"
|
#include "messenger.h"
|
||||||
|
|
||||||
#include <Shlwapi.h>
|
|
||||||
#include <Windowsx.h>
|
|
||||||
|
|
||||||
HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &, int hbitmapFormat);
|
HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &, int hbitmapFormat);
|
||||||
|
|
||||||
|
@ -420,9 +420,9 @@ bool Get(QStringList &files, QByteArray &remoteContent, const QString &caption,
|
||||||
} else {
|
} else {
|
||||||
files = dialog.selectedFiles().mid(0, 1);
|
files = dialog.selectedFiles().mid(0, 1);
|
||||||
}
|
}
|
||||||
if (type == Type::ReadFile || type == Type::ReadFiles) {
|
// if (type == Type::ReadFile || type == Type::ReadFiles) {
|
||||||
remoteContent = dialog.selectedRemoteContent();
|
// remoteContent = dialog.selectedRemoteContent();
|
||||||
}
|
// }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,4 +432,4 @@ bool Get(QStringList &files, QByteArray &remoteContent, const QString &caption,
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace FileDialog
|
} // namespace FileDialog
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
|
@ -18,6 +18,7 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
#include "platform/win/main_window_win.h"
|
#include "platform/win/main_window_win.h"
|
||||||
|
|
||||||
#include "styles/style_window.h"
|
#include "styles/style_window.h"
|
||||||
|
@ -34,17 +35,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
|
|
||||||
#include <Shobjidl.h>
|
|
||||||
#include <shellapi.h>
|
|
||||||
#include <WtsApi32.h>
|
|
||||||
|
|
||||||
#include <roapi.h>
|
|
||||||
#include <wrl\client.h>
|
|
||||||
#include <wrl\implements.h>
|
|
||||||
#include <windows.ui.notifications.h>
|
|
||||||
|
|
||||||
#include <Windowsx.h>
|
|
||||||
|
|
||||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||||
#define max(a, b) ((a) < (b) ? (b) : (a))
|
#define max(a, b) ((a) < (b) ? (b) : (a))
|
||||||
#include <gdiplus.h>
|
#include <gdiplus.h>
|
||||||
|
@ -229,7 +219,7 @@ public:
|
||||||
destroy();
|
destroy();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SetWindowLong(hwnds[i], GWL_HWNDPARENT, (LONG)hwnd);
|
SetWindowLong(hwnds[i], GWLP_HWNDPARENT, (LONG)hwnd);
|
||||||
|
|
||||||
dcs[i] = CreateCompatibleDC(screenDC);
|
dcs[i] = CreateCompatibleDC(screenDC);
|
||||||
if (!dcs[i]) {
|
if (!dcs[i]) {
|
||||||
|
@ -705,18 +695,18 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case dbiwmWindowAndTray: {
|
case dbiwmWindowAndTray: {
|
||||||
psSetupTrayIcon();
|
psSetupTrayIcon();
|
||||||
HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT);
|
HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWLP_HWNDPARENT);
|
||||||
if (psOwner) {
|
if (psOwner) {
|
||||||
SetWindowLong(ps_hWnd, GWL_HWNDPARENT, 0);
|
SetWindowLong(ps_hWnd, GWLP_HWNDPARENT, 0);
|
||||||
psRefreshTaskbarIcon();
|
psRefreshTaskbarIcon();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case dbiwmTrayOnly: {
|
case dbiwmTrayOnly: {
|
||||||
psSetupTrayIcon();
|
psSetupTrayIcon();
|
||||||
HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT);
|
HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWLP_HWNDPARENT);
|
||||||
if (!psOwner) {
|
if (!psOwner) {
|
||||||
SetWindowLong(ps_hWnd, GWL_HWNDPARENT, (LONG)ps_tbHider_hWnd);
|
SetWindowLong(ps_hWnd, GWLP_HWNDPARENT, (LONG)ps_tbHider_hWnd);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -727,9 +717,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) {
|
||||||
}
|
}
|
||||||
trayIcon = 0;
|
trayIcon = 0;
|
||||||
|
|
||||||
HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT);
|
HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWLP_HWNDPARENT);
|
||||||
if (psOwner) {
|
if (psOwner) {
|
||||||
SetWindowLong(ps_hWnd, GWL_HWNDPARENT, 0);
|
SetWindowLong(ps_hWnd, GWLP_HWNDPARENT, 0);
|
||||||
psRefreshTaskbarIcon();
|
psRefreshTaskbarIcon();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
|
@ -18,6 +18,7 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
#include "platform/win/notifications_manager_win.h"
|
#include "platform/win/notifications_manager_win.h"
|
||||||
|
|
||||||
#include "window/notifications_utilities.h"
|
#include "window/notifications_utilities.h"
|
||||||
|
@ -27,14 +28,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "base/task_queue.h"
|
#include "base/task_queue.h"
|
||||||
|
|
||||||
#include <Shobjidl.h>
|
|
||||||
#include <shellapi.h>
|
|
||||||
|
|
||||||
#include <roapi.h>
|
|
||||||
#include <wrl\client.h>
|
|
||||||
#include <wrl\implements.h>
|
|
||||||
#include <windows.ui.notifications.h>
|
|
||||||
|
|
||||||
#include <strsafe.h>
|
#include <strsafe.h>
|
||||||
#include <intsafe.h>
|
#include <intsafe.h>
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
#include "platform/win/specific_win.h"
|
#include "platform/win/specific_win.h"
|
||||||
|
|
||||||
#include "platform/win/main_window_win.h"
|
#include "platform/win/main_window_win.h"
|
||||||
|
@ -33,35 +34,14 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
#include "passcodewidget.h"
|
#include "passcodewidget.h"
|
||||||
#include "base/task_queue.h"
|
#include "base/task_queue.h"
|
||||||
|
|
||||||
#include <Shobjidl.h>
|
|
||||||
#include <shellapi.h>
|
|
||||||
|
|
||||||
#include <roapi.h>
|
|
||||||
#include <wrl\client.h>
|
|
||||||
#include <wrl\implements.h>
|
|
||||||
#include <windows.ui.notifications.h>
|
|
||||||
|
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4091)
|
#pragma warning(disable:4091)
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include <Shlwapi.h>
|
|
||||||
#include <Strsafe.h>
|
|
||||||
#include <Windowsx.h>
|
|
||||||
#include <WtsApi32.h>
|
|
||||||
|
|
||||||
#include <SDKDDKVer.h>
|
|
||||||
|
|
||||||
#include <sal.h>
|
|
||||||
#include <Psapi.h>
|
|
||||||
#include <strsafe.h>
|
#include <strsafe.h>
|
||||||
#include <ObjBase.h>
|
|
||||||
#include <propvarutil.h>
|
|
||||||
#include <functiondiscoverykeys.h>
|
|
||||||
#include <intsafe.h>
|
|
||||||
#include <guiddef.h>
|
|
||||||
|
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
#include "platform/win/window_title_win.h"
|
#include "platform/win/window_title_win.h"
|
||||||
|
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
|
|
@ -18,17 +18,13 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
#include "platform/win/windows_app_user_model_id.h"
|
#include "platform/win/windows_app_user_model_id.h"
|
||||||
|
|
||||||
#include "platform/win/windows_dlls.h"
|
#include "platform/win/windows_dlls.h"
|
||||||
#include <propvarutil.h>
|
#include <propvarutil.h>
|
||||||
#include <propkey.h>
|
#include <propkey.h>
|
||||||
|
|
||||||
#include <roapi.h>
|
|
||||||
#include <wrl\client.h>
|
|
||||||
#include <wrl\implements.h>
|
|
||||||
#include <windows.ui.notifications.h>
|
|
||||||
|
|
||||||
using namespace Microsoft::WRL;
|
using namespace Microsoft::WRL;
|
||||||
|
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
|
|
|
@ -18,6 +18,7 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
#include "platform/win/windows_dlls.h"
|
#include "platform/win/windows_dlls.h"
|
||||||
|
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
|
|
|
@ -20,9 +20,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include <shlobj.h>
|
|
||||||
#include <roapi.h>
|
|
||||||
|
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
namespace Dlls {
|
namespace Dlls {
|
||||||
|
|
|
@ -18,6 +18,7 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
#include "platform/win/windows_event_filter.h"
|
#include "platform/win/windows_event_filter.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
|
@ -53,6 +53,36 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
#define MAC_USE_BREAKPAD
|
#define MAC_USE_BREAKPAD
|
||||||
#endif // OS_MAC_STORE
|
#endif // OS_MAC_STORE
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
#include <SDKDDKVer.h>
|
||||||
|
|
||||||
|
// Windows Header Files:
|
||||||
|
#include <Windows.h>
|
||||||
|
#include <Windowsx.h>
|
||||||
|
#include <sal.h>
|
||||||
|
#include <Psapi.h>
|
||||||
|
#include <strsafe.h>
|
||||||
|
#include <objbase.h>
|
||||||
|
#include <ShObjIdl.h>
|
||||||
|
#include <propvarutil.h>
|
||||||
|
#include <functiondiscoverykeys.h>
|
||||||
|
#include <intsafe.h>
|
||||||
|
#include <guiddef.h>
|
||||||
|
#include <Shlwapi.h>
|
||||||
|
|
||||||
|
#include <roapi.h>
|
||||||
|
#include <wrl\client.h>
|
||||||
|
#include <wrl\implements.h>
|
||||||
|
#include <windows.ui.notifications.h>
|
||||||
|
#include <ShlObj.h>
|
||||||
|
|
||||||
|
#include <Shobjidl.h>
|
||||||
|
#include <shellapi.h>
|
||||||
|
#include <WtsApi32.h>
|
||||||
|
#include <Mmdeviceapi.h>
|
||||||
|
#include <audioclient.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QtWidgets/QtWidgets>
|
#include <QtWidgets/QtWidgets>
|
||||||
#include <QtNetwork/QtNetwork>
|
#include <QtNetwork/QtNetwork>
|
||||||
|
|
||||||
|
|
|
@ -337,9 +337,9 @@ void NewAvatarButton::paintEvent(QPaintEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewAvatarButton::setImage(const QImage &image) {
|
void NewAvatarButton::setImage(const QImage &image) {
|
||||||
auto small = image.scaled(size() * cIntRetinaFactor(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
auto smallImg = image.scaled(size() * cIntRetinaFactor(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||||
Images::prepareCircle(small);
|
Images::prepareCircle(smallImg);
|
||||||
_image = App::pixmapFromImageInPlace(std::move(small));
|
_image = App::pixmapFromImageInPlace(std::move(smallImg));
|
||||||
_image.setDevicePixelRatio(cRetinaFactor());
|
_image.setDevicePixelRatio(cRetinaFactor());
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ private:
|
||||||
|
|
||||||
class UsedWordGuard {
|
class UsedWordGuard {
|
||||||
public:
|
public:
|
||||||
UsedWordGuard(std::vector<small> &map, int index);
|
UsedWordGuard(std::vector<smallchar> &map, int index);
|
||||||
UsedWordGuard(const UsedWordGuard &other) = delete;
|
UsedWordGuard(const UsedWordGuard &other) = delete;
|
||||||
UsedWordGuard(UsedWordGuard &&other);
|
UsedWordGuard(UsedWordGuard &&other);
|
||||||
UsedWordGuard &operator=(const UsedWordGuard &other) = delete;
|
UsedWordGuard &operator=(const UsedWordGuard &other) = delete;
|
||||||
|
@ -168,16 +168,16 @@ private:
|
||||||
~UsedWordGuard();
|
~UsedWordGuard();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<small> &_map;
|
std::vector<smallchar> &_map;
|
||||||
int _index = 0;
|
int _index = 0;
|
||||||
small _guarded = 0;
|
smallchar _guarded = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
std::vector<small> _currentItemWordsUsedMap;
|
std::vector<smallchar> _currentItemWordsUsedMap;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Completer::UsedWordGuard::UsedWordGuard(std::vector<small> &map, int index) : _map(map), _index(index) {
|
Completer::UsedWordGuard::UsedWordGuard(std::vector<smallchar> &map, int index) : _map(map), _index(index) {
|
||||||
Expects(_map.size() > _index);
|
Expects(_map.size() > _index);
|
||||||
if (!_map[_index]) {
|
if (!_map[_index]) {
|
||||||
_guarded = _map[_index] = 1;
|
_guarded = _map[_index] = 1;
|
||||||
|
@ -297,7 +297,7 @@ void Completer::initWordsTracking() {
|
||||||
maxWordsCount = wordsCount;
|
maxWordsCount = wordsCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_currentItemWordsUsedMap = std::vector<small>(maxWordsCount, 0);
|
_currentItemWordsUsedMap = std::vector<smallchar>(maxWordsCount, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Completer::filterInitialList() {
|
void Completer::filterInitialList() {
|
||||||
|
|
|
@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
namespace Emoji {
|
namespace Emoji {
|
||||||
|
|
||||||
using small = unsigned char;
|
using smallchar = unsigned char;
|
||||||
using medium = unsigned short;
|
using medium = unsigned short;
|
||||||
using utf16char = unsigned short;
|
using utf16char = unsigned short;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue