Added dummy platform files for text recognition.

This commit is contained in:
23rd
2025-12-04 01:58:37 +03:00
committed by John Preston
parent 1053b30a6d
commit d2dd124be0
6 changed files with 124 additions and 0 deletions

View 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

View 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

View 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

View 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

View 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

View File

@@ -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