mirror of https://github.com/procxx/kepka.git
				
				
				
			some winrt macro changes
This commit is contained in:
		
							parent
							
								
									27856d830b
								
							
						
					
					
						commit
						a2f5acdff1
					
				|  | @ -107,6 +107,7 @@ void AboutBox::paintEvent(QPaintEvent *e) { | ||||||
| 	paintTitle(p, qsl("Telegram Desktop")); | 	paintTitle(p, qsl("Telegram Desktop")); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | #ifndef TDESKTOP_DISABLE_CRASH_REPORTS | ||||||
| QString _getCrashReportFile(const QMimeData *m) { | QString _getCrashReportFile(const QMimeData *m) { | ||||||
| 	if (!m || m->urls().size() != 1) return QString(); | 	if (!m || m->urls().size() != 1) return QString(); | ||||||
| 
 | 
 | ||||||
|  | @ -115,19 +116,24 @@ QString _getCrashReportFile(const QMimeData *m) { | ||||||
| 
 | 
 | ||||||
| 	return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString(); | 	return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString(); | ||||||
| } | } | ||||||
|  | #endif // !TDESKTOP_DISABLE_CRASH_REPORTS
 | ||||||
| 
 | 
 | ||||||
| void AboutBox::dragEnterEvent(QDragEnterEvent *e) { | void AboutBox::dragEnterEvent(QDragEnterEvent *e) { | ||||||
|  | #ifndef TDESKTOP_DISABLE_CRASH_REPORTS | ||||||
| 	if (!_getCrashReportFile(e->mimeData()).isEmpty()) { | 	if (!_getCrashReportFile(e->mimeData()).isEmpty()) { | ||||||
| 		e->setDropAction(Qt::CopyAction); | 		e->setDropAction(Qt::CopyAction); | ||||||
| 		e->accept(); | 		e->accept(); | ||||||
| 	} | 	} | ||||||
|  | #endif | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void AboutBox::dropEvent(QDropEvent *e) { | void AboutBox::dropEvent(QDropEvent *e) { | ||||||
|  | #ifndef TDESKTOP_DISABLE_CRASH_REPORTS | ||||||
| 	if (!_getCrashReportFile(e->mimeData()).isEmpty()) { | 	if (!_getCrashReportFile(e->mimeData()).isEmpty()) { | ||||||
| 		e->acceptProposedAction(); | 		e->acceptProposedAction(); | ||||||
| 		showCrashReportWindow(_getCrashReportFile(e->mimeData())); | 		showCrashReportWindow(_getCrashReportFile(e->mimeData())); | ||||||
| 	} | 	} | ||||||
|  | #endif // !TDESKTOP_DISABLE_CRASH_REPORTS
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| QString telegramFaqLink() { | QString telegramFaqLink() { | ||||||
|  |  | ||||||
|  | @ -149,7 +149,7 @@ bool _filedialogGetFiles(QStringList &files, QByteArray &remoteContent, const QS | ||||||
| 		cSetDialogLastPath(path); | 		cSetDialogLastPath(path); | ||||||
| 		Local::writeUserSettings(); | 		Local::writeUserSettings(); | ||||||
| 	} | 	} | ||||||
| 	 | 
 | ||||||
| 	if (res == QDialog::Accepted) { | 	if (res == QDialog::Accepted) { | ||||||
| 		if (multipleFiles > 0) { | 		if (multipleFiles > 0) { | ||||||
| 			files = dialog.selectedFiles(); | 			files = dialog.selectedFiles(); | ||||||
|  | @ -157,9 +157,9 @@ bool _filedialogGetFiles(QStringList &files, QByteArray &remoteContent, const QS | ||||||
| 			files = dialog.selectedFiles().mid(0, 1); | 			files = dialog.selectedFiles().mid(0, 1); | ||||||
| 		} | 		} | ||||||
| 		if (multipleFiles >= 0) { | 		if (multipleFiles >= 0) { | ||||||
| #ifdef Q_OS_WIN | #if defined Q_OS_WIN && !defined Q_OS_WINRT | ||||||
| 			remoteContent = dialog.selectedRemoteContent(); | 			remoteContent = dialog.selectedRemoteContent(); | ||||||
| #endif | #endif // Q_OS_WIN && !Q_OS_WINRT
 | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -1654,6 +1654,7 @@ public: | ||||||
| 				*_getSymbolUpon = true; | 				*_getSymbolUpon = true; | ||||||
| 				return false; | 				return false; | ||||||
| 			} else if (_p) { | 			} else if (_p) { | ||||||
|  | #ifndef TDESKTOP_WINRT // temp
 | ||||||
| 				QTextCharFormat format; | 				QTextCharFormat format; | ||||||
| 				QTextItemInt gf(glyphs.mid(glyphsStart, glyphsEnd - glyphsStart), | 				QTextItemInt gf(glyphs.mid(glyphsStart, glyphsEnd - glyphsStart), | ||||||
| 								&_e->fnt, engine.layoutData->string.unicode() + itemStart, | 								&_e->fnt, engine.layoutData->string.unicode() + itemStart, | ||||||
|  | @ -1662,7 +1663,7 @@ public: | ||||||
| 				gf.width = itemWidth; | 				gf.width = itemWidth; | ||||||
| 				gf.justified = false; | 				gf.justified = false; | ||||||
| 				gf.initWithScriptItem(si); | 				gf.initWithScriptItem(si); | ||||||
| 
 | #endif // !TDESKTOP_WINRT
 | ||||||
| 				if (_localFrom + itemStart < _selectedTo && _localFrom + itemEnd > _selectedFrom) { | 				if (_localFrom + itemStart < _selectedTo && _localFrom + itemEnd > _selectedFrom) { | ||||||
| 					QFixed selX = x, selWidth = itemWidth; | 					QFixed selX = x, selWidth = itemWidth; | ||||||
| 					if (_localFrom + itemEnd > _selectedTo || _localFrom + itemStart < _selectedFrom) { | 					if (_localFrom + itemEnd > _selectedTo || _localFrom + itemStart < _selectedFrom) { | ||||||
|  | @ -1703,7 +1704,9 @@ public: | ||||||
| 					_p->fillRect(QRectF(selX.toReal(), _y + _yDelta, selWidth.toReal(), _fontHeight), _textStyle->selectBg->b); | 					_p->fillRect(QRectF(selX.toReal(), _y + _yDelta, selWidth.toReal(), _fontHeight), _textStyle->selectBg->b); | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
|  | #ifndef TDESKTOP_WINRT // temp
 | ||||||
| 				_p->drawTextItem(QPointF(x.toReal(), textY), gf); | 				_p->drawTextItem(QPointF(x.toReal(), textY), gf); | ||||||
|  | #endif // !TDESKTOP_WINRT
 | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			x += itemWidth; | 			x += itemWidth; | ||||||
|  |  | ||||||
|  | @ -30,8 +30,10 @@ int main(int argc, char *argv[]) { | ||||||
| 		return psFixPrevious(); | 		return psFixPrevious(); | ||||||
| 	} else if (cLaunchMode() == LaunchModeCleanup) { | 	} else if (cLaunchMode() == LaunchModeCleanup) { | ||||||
| 		return psCleanup(); | 		return psCleanup(); | ||||||
|  | #ifndef TDESKTOP_DISABLE_CRASH_REPORTS | ||||||
| 	} else if (cLaunchMode() == LaunchModeShowCrash) { | 	} else if (cLaunchMode() == LaunchModeShowCrash) { | ||||||
| 		return showCrashReportWindow(QFileInfo(cStartUrl()).absoluteFilePath()); | 		return showCrashReportWindow(QFileInfo(cStartUrl()).absoluteFilePath()); | ||||||
|  | #endif // !TDESKTOP_DISABLE_CRASH_REPORTS
 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// both are finished in Application::closeApplication
 | 	// both are finished in Application::closeApplication
 | ||||||
|  | @ -72,4 +74,6 @@ int main(int argc, char *argv[]) { | ||||||
| 	SignalHandlers::finish(); | 	SignalHandlers::finish(); | ||||||
| 	PlatformSpecific::finish(); | 	PlatformSpecific::finish(); | ||||||
| 	Logs::finish(); | 	Logs::finish(); | ||||||
|  | 
 | ||||||
|  | 	return result; | ||||||
| } | } | ||||||
|  |  | ||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -104,7 +104,7 @@ protected: | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
| 	HWND ps_hWnd; | 	HWND ps_hWnd; | ||||||
| 	HWND ps_tbHider_hWnd; | //	HWND ps_tbHider_hWnd;
 | ||||||
| 	HMENU ps_menu; | 	HMENU ps_menu; | ||||||
| 	HICON ps_iconBig, ps_iconSmall, ps_iconOverlay; | 	HICON ps_iconBig, ps_iconSmall, ps_iconOverlay; | ||||||
| 
 | 
 | ||||||
|  | @ -115,7 +115,6 @@ private: | ||||||
| 
 | 
 | ||||||
| void psWriteDump(); | void psWriteDump(); | ||||||
| void psWriteStackTrace(); | void psWriteStackTrace(); | ||||||
| QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile); |  | ||||||
| 
 | 
 | ||||||
| void psDeleteDir(const QString &dir); | void psDeleteDir(const QString &dir); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -21,10 +21,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org | ||||||
| #include "stdafx.h" | #include "stdafx.h" | ||||||
| #include <QtCore/QtPlugin> | #include <QtCore/QtPlugin> | ||||||
| 
 | 
 | ||||||
| #ifdef Q_OS_WIN | #ifdef Q_OS_WINRT | ||||||
|  | //Q_IMPORT_PLUGIN(QWinRTIntegrationPlugin)
 | ||||||
|  | //Q_IMPORT_PLUGIN(QWbmpPlugin)
 | ||||||
|  | #elif defined Q_OS_WIN // Q_OS_WINRT
 | ||||||
| Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) | Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) | ||||||
| Q_IMPORT_PLUGIN(QWebpPlugin) | Q_IMPORT_PLUGIN(QWebpPlugin) | ||||||
| #elif defined Q_OS_MAC | #elif defined Q_OS_MAC // Q_OS_WIN
 | ||||||
| Q_IMPORT_PLUGIN(QGenericEnginePlugin) | Q_IMPORT_PLUGIN(QGenericEnginePlugin) | ||||||
| Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) | Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) | ||||||
| Q_IMPORT_PLUGIN(QDDSPlugin) | Q_IMPORT_PLUGIN(QDDSPlugin) | ||||||
|  | @ -36,7 +39,7 @@ Q_IMPORT_PLUGIN(QTgaPlugin) | ||||||
| Q_IMPORT_PLUGIN(QTiffPlugin) | Q_IMPORT_PLUGIN(QTiffPlugin) | ||||||
| Q_IMPORT_PLUGIN(QWbmpPlugin) | Q_IMPORT_PLUGIN(QWbmpPlugin) | ||||||
| Q_IMPORT_PLUGIN(QWebpPlugin) | Q_IMPORT_PLUGIN(QWebpPlugin) | ||||||
| #elif defined Q_OS_LINUX | #elif defined Q_OS_LINUX // Q_OS_LINUX
 | ||||||
| Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin) | Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin) | ||||||
| Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin) | Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin) | ||||||
| Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin) | Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin) | ||||||
|  |  | ||||||
|  | @ -18,11 +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-2016 John Preston, https://desktop.telegram.org
 | Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
 | ||||||
| */ | */ | ||||||
|  | #ifdef TDESKTOP_WINRT | ||||||
|  | 
 | ||||||
|  | #include <wrl.h> | ||||||
|  | #include <wrl/client.h> | ||||||
|  | 
 | ||||||
|  | #else // TDESKTOP_WINRT
 | ||||||
|  | 
 | ||||||
| #define __HUGE | #define __HUGE | ||||||
| #define PSAPI_VERSION 1 // fix WinXP
 | #define PSAPI_VERSION 1 // fix WinXP
 | ||||||
| 
 | 
 | ||||||
| #define __STDC_FORMAT_MACROS // fix breakpad for mac
 | #define __STDC_FORMAT_MACROS // fix breakpad for mac
 | ||||||
| 
 | 
 | ||||||
|  | #endif // else of TDESKTOP_WINRT
 | ||||||
|  | 
 | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| 
 | 
 | ||||||
| #include <numeric> | #include <numeric> | ||||||
|  | @ -43,9 +52,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org | ||||||
| 
 | 
 | ||||||
| #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 | #else // Q_OS_WIN
 | ||||||
| #include <lzma.h> | #include <lzma.h> | ||||||
| #endif | #endif // else of Q_OS_WIN
 | ||||||
| 
 | 
 | ||||||
| extern "C" { | extern "C" { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -82,9 +82,9 @@ NotifyWindow::NotifyWindow(HistoryItem *msg, int32 x, int32 y, int32 fwdCount) : | ||||||
| , history(msg->history()) | , history(msg->history()) | ||||||
| , item(msg) | , item(msg) | ||||||
| , fwdCount(fwdCount) | , fwdCount(fwdCount) | ||||||
| #ifdef Q_OS_WIN | #if defined Q_OS_WIN && !defined Q_OS_WINRT | ||||||
| , started(GetTickCount()) | , started(GetTickCount()) | ||||||
| #endif | #endif // Q_OS_WIN && !Q_OS_WINRT
 | ||||||
| , close(this, st::notifyClose) | , close(this, st::notifyClose) | ||||||
| , alphaDuration(st::notifyFastAnim) | , alphaDuration(st::notifyFastAnim) | ||||||
| , posDuration(st::notifyFastAnim) | , posDuration(st::notifyFastAnim) | ||||||
|  | @ -126,7 +126,7 @@ NotifyWindow::NotifyWindow(HistoryItem *msg, int32 x, int32 y, int32 fwdCount) : | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void NotifyWindow::checkLastInput() { | void NotifyWindow::checkLastInput() { | ||||||
| #ifdef Q_OS_WIN | #if defined Q_OS_WIN && !defined Q_OS_WINRT | ||||||
| 	LASTINPUTINFO lii; | 	LASTINPUTINFO lii; | ||||||
| 	lii.cbSize = sizeof(LASTINPUTINFO); | 	lii.cbSize = sizeof(LASTINPUTINFO); | ||||||
| 	BOOL res = GetLastInputInfo(&lii); | 	BOOL res = GetLastInputInfo(&lii); | ||||||
|  | @ -135,14 +135,14 @@ void NotifyWindow::checkLastInput() { | ||||||
| 	} else { | 	} else { | ||||||
| 		inputTimer.start(300); | 		inputTimer.start(300); | ||||||
| 	} | 	} | ||||||
| #else | #else // Q_OS_WIN && !Q_OS_WINRT
 | ||||||
|     // TODO
 |     // TODO
 | ||||||
| 	if (true) { | 	if (true) { | ||||||
| 		hideTimer.start(st::notifyWaitLongHide); | 		hideTimer.start(st::notifyWaitLongHide); | ||||||
| 	} else { | 	} else { | ||||||
| 		inputTimer.start(300); | 		inputTimer.start(300); | ||||||
| 	} | 	} | ||||||
| #endif | #endif // else for Q_OS_WIN && !Q_OS_WINRT
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void NotifyWindow::moveTo(int32 x, int32 y, int32 index) { | void NotifyWindow::moveTo(int32 x, int32 y, int32 index) { | ||||||
|  | @ -3096,6 +3096,7 @@ void ShowCrashReportWindow::closeEvent(QCloseEvent *e) { | ||||||
|     deleteLater(); |     deleteLater(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | #ifndef TDESKTOP_DISABLE_CRASH_REPORTS | ||||||
| int showCrashReportWindow(const QString &crashdump) { | int showCrashReportWindow(const QString &crashdump) { | ||||||
| 	QString text; | 	QString text; | ||||||
| 
 | 
 | ||||||
|  | @ -3120,3 +3121,4 @@ int showCrashReportWindow(const QString &crashdump) { | ||||||
| 	ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); | 	ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); | ||||||
| 	return app.exec(); | 	return app.exec(); | ||||||
| } | } | ||||||
|  | #endif // !TDESKTOP_DISABLE_CRASH_REPORTS
 | ||||||
|  |  | ||||||
|  | @ -98,9 +98,9 @@ public slots: | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
| 
 | 
 | ||||||
| #ifdef Q_OS_WIN | #if defined Q_OS_WIN && !defined Q_OS_WINRT | ||||||
| 	DWORD started; | 	DWORD started; | ||||||
| #endif | #endif // Q_OS_WIN && !Q_OS_WINRT
 | ||||||
| 	History *history; | 	History *history; | ||||||
| 	HistoryItem *item; | 	HistoryItem *item; | ||||||
| 	int32 fwdCount; | 	int32 fwdCount; | ||||||
|  | @ -573,4 +573,6 @@ private: | ||||||
| 
 | 
 | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | #ifndef TDESKTOP_DISABLE_CRASH_REPORTS | ||||||
| int showCrashReportWindow(const QString &crashdump); | int showCrashReportWindow(const QString &crashdump); | ||||||
|  | #endif // !TDESKTOP_DISABLE_CRASH_REPORTS
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue