Added dummy platform files for text recognition.
This commit is contained in:
24
Telegram/SourceFiles/platform/linux/text_recognition_linux.h
Normal file
24
Telegram/SourceFiles/platform/linux/text_recognition_linux.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "platform/platform_text_recognition.h"
|
||||
|
||||
namespace Platform {
|
||||
namespace TextRecognition {
|
||||
|
||||
inline bool IsAvailable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline Result RecognizeText(const QImage &image) {
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace TextRecognition
|
||||
} // namespace Platform
|
||||
8
Telegram/SourceFiles/platform/mac/text_recognition_mac.h
Normal file
8
Telegram/SourceFiles/platform/mac/text_recognition_mac.h
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
22
Telegram/SourceFiles/platform/mac/text_recognition_mac.mm
Normal file
22
Telegram/SourceFiles/platform/mac/text_recognition_mac.mm
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "platform/platform_text_recognition.h"
|
||||
|
||||
namespace Platform {
|
||||
namespace TextRecognition {
|
||||
|
||||
bool IsAvailable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
Result RecognizeText(const QImage &image) {
|
||||
return Result();
|
||||
}
|
||||
|
||||
} // namespace TextRecognition
|
||||
} // namespace Platform
|
||||
41
Telegram/SourceFiles/platform/platform_text_recognition.h
Normal file
41
Telegram/SourceFiles/platform/platform_text_recognition.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
namespace Platform {
|
||||
namespace TextRecognition {
|
||||
|
||||
struct RectWithText {
|
||||
QString text;
|
||||
QRect rect;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
std::vector<RectWithText> items;
|
||||
bool success = false;
|
||||
|
||||
inline operator bool() const {
|
||||
return success;
|
||||
}
|
||||
};
|
||||
|
||||
[[nodiscard]] bool IsAvailable();
|
||||
[[nodiscard]] Result RecognizeText(const QImage &image);
|
||||
|
||||
} // namespace TextRecognition
|
||||
} // namespace Platform
|
||||
|
||||
// Platform dependent implementations.
|
||||
|
||||
#if defined Q_OS_WINRT || defined Q_OS_WIN
|
||||
#include "platform/win/text_recognition_win.h"
|
||||
#elif defined Q_OS_MAC // Q_OS_WINRT || Q_OS_WIN
|
||||
#include "platform/mac/text_recognition_mac.h"
|
||||
#else // Q_OS_WINRT || Q_OS_WIN || Q_OS_MAC
|
||||
#include "platform/linux/text_recognition_linux.h"
|
||||
#endif // else for Q_OS_WINRT || Q_OS_WIN || Q_OS_MAC
|
||||
24
Telegram/SourceFiles/platform/win/text_recognition_win.h
Normal file
24
Telegram/SourceFiles/platform/win/text_recognition_win.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "platform/platform_text_recognition.h"
|
||||
|
||||
namespace Platform {
|
||||
namespace TextRecognition {
|
||||
|
||||
inline bool IsAvailable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline Result RecognizeText(const QImage &image) {
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace TextRecognition
|
||||
} // namespace Platform
|
||||
@@ -239,14 +239,19 @@ PRIVATE
|
||||
|
||||
platform/linux/current_geo_location_linux.cpp
|
||||
platform/linux/current_geo_location_linux.h
|
||||
platform/linux/text_recognition_linux.h
|
||||
platform/mac/file_bookmark_mac.h
|
||||
platform/mac/file_bookmark_mac.mm
|
||||
platform/mac/current_geo_location_mac.h
|
||||
platform/mac/current_geo_location_mac.mm
|
||||
platform/mac/text_recognition_mac.h
|
||||
platform/mac/text_recognition_mac.mm
|
||||
platform/win/current_geo_location_win.cpp
|
||||
platform/win/current_geo_location_win.h
|
||||
platform/win/text_recognition_win.h
|
||||
platform/platform_file_bookmark.h
|
||||
platform/platform_current_geo_location.h
|
||||
platform/platform_text_recognition.h
|
||||
|
||||
settings/settings_common.cpp
|
||||
settings/settings_common.h
|
||||
|
||||
Reference in New Issue
Block a user