core: rename mbgl namespace to mln (#4487)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Bart Louwers
2026-08-14 23:25:20 +02:00
committed by GitHub
parent 836b862984
commit 550f64be22
1970 changed files with 8931 additions and 8967 deletions

View File

@@ -5,7 +5,7 @@
#include <cassert>
namespace mbgl {
namespace mln {
namespace util {
AsyncTask::Impl::Impl(std::function<void()>&& fn)
@@ -37,4 +37,4 @@ void AsyncTask::send() {
}
} // namespace util
} // namespace mbgl
} // namespace mln

View File

@@ -7,7 +7,7 @@
#include <functional>
#include <atomic>
namespace mbgl {
namespace mln {
namespace util {
class RunLoop;
@@ -34,4 +34,4 @@ private:
};
} // namespace util
} // namespace mbgl
} // namespace mln

View File

@@ -2,7 +2,7 @@
#include <memory>
namespace mbgl {
namespace mln {
// This stub implementation is stateless and doesn't implement the private
// methods used by the ICU BiDi
@@ -50,4 +50,4 @@ std::vector<StyledText> BiDi::processStyledText(const StyledText& input, std::se
return transformedLines;
}
} // end namespace mbgl
} // end namespace mln

View File

@@ -4,7 +4,7 @@
#include <QOpenGLFunctions>
#include <QOpenGLExtraFunctions>
namespace mbgl {
namespace mln {
namespace platform {
/* OpenGL ES 2.0 */
@@ -907,4 +907,4 @@ void (*const glGetInternalformativ)(GLenum, GLenum, GLenum, GLsizei, GLint*) = [
};
} // namespace platform
} // namespace mbgl
} // namespace mln

View File

@@ -5,7 +5,7 @@
#include <cassert>
namespace mbgl {
namespace mln {
namespace gl {
class QtBackendImpl final : public HeadlessBackend::Impl {
@@ -40,4 +40,4 @@ void HeadlessBackend::createImpl() {
}
} // namespace gl
} // namespace mbgl
} // namespace mln

View File

@@ -9,7 +9,7 @@
#include <QNetworkReply>
#include <QSslConfiguration>
namespace mbgl {
namespace mln {
HTTPFileSource::Impl::Impl(const ResourceOptions& resourceOptions, const ClientOptions& clientOptions)
: m_manager(new QNetworkAccessManager(this)),
@@ -139,4 +139,4 @@ ClientOptions HTTPFileSource::getClientOptions() {
return impl->getClientOptions();
}
} // namespace mbgl
} // namespace mln

View File

@@ -14,7 +14,7 @@
#include <QUrl>
#include <QVector>
namespace mbgl {
namespace mln {
class HTTPRequest;
@@ -44,4 +44,4 @@ private:
ClientOptions m_clientOptions;
};
} // namespace mbgl
} // namespace mln

View File

@@ -11,7 +11,7 @@
#include <QNetworkReply>
#include <QPair>
namespace mbgl {
namespace mln {
HTTPRequest::HTTPRequest(HTTPFileSource::Impl* context, const Resource& resource, FileSource::Callback callback)
: m_context(context),
@@ -71,7 +71,7 @@ void HTTPRequest::handleNetworkReply(QNetworkReply* reply, const QByteArray& dat
// Calling `callback` may result in deleting `this`.
// Copy data to temporaries first.
auto callback = m_callback;
mbgl::Response response;
mln::Response response;
using Error = Response::Error;
@@ -155,4 +155,4 @@ void HTTPRequest::handleNetworkReply(QNetworkReply* reply, const QByteArray& dat
callback(response);
}
} // namespace mbgl
} // namespace mln

View File

@@ -8,7 +8,7 @@
#include <QNetworkRequest>
#include <QUrl>
namespace mbgl {
namespace mln {
class Response;
@@ -30,4 +30,4 @@ private:
bool m_handled = false;
};
} // namespace mbgl
} // namespace mln

View File

@@ -4,7 +4,7 @@
#include <QByteArray>
#include <QImage>
namespace mbgl {
namespace mln {
std::string encodePNG(const PremultipliedImage& pre) {
QImage image(pre.data.get(), pre.size.width, pre.size.height, QImage::Format_ARGB32_Premultiplied);
@@ -48,4 +48,4 @@ PremultipliedImage decodeImage(const std::string& string) {
return {{static_cast<uint32_t>(image.width()), static_cast<uint32_t>(image.height())}, std::move(img)};
}
} // namespace mbgl
} // namespace mln

View File

@@ -7,7 +7,7 @@
#include <QtGui/QImage>
#include <QtGui/QPainter>
#include <qglobal.h>
namespace mbgl {
namespace mln {
// 2x bitmap with 1x logical metrics.
constexpr int kLocalGlyphTextureScale = 2;
@@ -98,4 +98,4 @@ Glyph LocalGlyphRasterizer::rasterizeGlyph(const FontStack&, GlyphID glyphID) {
return glyph;
}
} // namespace mbgl
} // namespace mln

View File

@@ -3,10 +3,10 @@
#include <QDebug>
namespace mbgl {
namespace mln {
void Log::platformRecord(EventSeverity severity, const std::string &msg) {
qWarning() << "[" << Enum<EventSeverity>::toString(severity) << "] " << QString::fromStdString(msg);
}
} // namespace mbgl
} // namespace mln

View File

@@ -3,7 +3,7 @@
#include <QLocale>
#include <QString>
namespace mbgl {
namespace mln {
namespace platform {
std::string formatNumber(double number,
@@ -25,4 +25,4 @@ std::string formatNumber(double number,
}
} // namespace platform
} // namespace mbgl
} // namespace mln

View File

@@ -9,7 +9,7 @@
#include <functional>
#include <utility>
namespace mbgl {
namespace mln {
namespace util {
void RunLoop::Impl::onReadEvent(int fd) {
@@ -91,7 +91,7 @@ void RunLoop::runOnce() {
}
}
void RunLoop::waitForEmpty([[maybe_unused]] const mbgl::util::SimpleIdentity tag) {
void RunLoop::waitForEmpty([[maybe_unused]] const mln::util::SimpleIdentity tag) {
while (true) {
std::size_t remaining;
{
@@ -138,4 +138,4 @@ void RunLoop::removeWatch(int fd) {
}
} // namespace util
} // namespace mbgl
} // namespace mln

View File

@@ -10,7 +10,7 @@
#include <unordered_map>
namespace mbgl {
namespace mln {
namespace util {
using WatchCallback = std::function<void(int, RunLoop::Event)>;
@@ -36,4 +36,4 @@ public slots:
};
} // namespace util
} // namespace mbgl
} // namespace mln

View File

@@ -144,7 +144,7 @@ void Database::setBusyTimeout(std::chrono::milliseconds timeout) {
void DatabaseImpl::setBusyTimeout(std::chrono::milliseconds timeout) {
// std::chrono::milliseconds.count() is a long and Qt will cast
// internally to int, so we need to make sure the limits apply.
std::string timeoutStr = mbgl::util::toString(timeout.count() & INT_MAX);
std::string timeoutStr = mln::util::toString(timeout.count() & INT_MAX);
auto db = QSqlDatabase::database(connectionName);
QString connectOptions = db.connectOptions();
@@ -254,7 +254,7 @@ void Query::bind(int offset, uint8_t value) {
}
template <>
void Query::bind(int offset, mbgl::Timestamp value) {
void Query::bind(int offset, mln::Timestamp value) {
bind(offset, std::chrono::system_clock::to_time_t(value));
}
@@ -268,7 +268,7 @@ void Query::bind(int offset, std::optional<std::string> value) {
}
template <>
void Query::bind(int offset, std::optional<mbgl::Timestamp> value) {
void Query::bind(int offset, std::optional<mln::Timestamp> value) {
if (value) {
bind(offset, *value);
} else {
@@ -355,7 +355,7 @@ std::vector<uint8_t> Query::get(int offset) {
}
template <>
mbgl::Timestamp Query::get(int offset) {
mln::Timestamp Query::get(int offset) {
assert(stmt.impl && stmt.impl->query.isValid());
QVariant value = stmt.impl->query.value(offset);
checkQueryError(stmt.impl->query);
@@ -399,13 +399,13 @@ std::optional<std::string> Query::get(int offset) {
}
template <>
std::optional<mbgl::Timestamp> Query::get(int offset) {
std::optional<mln::Timestamp> Query::get(int offset) {
assert(stmt.impl && stmt.impl->query.isValid());
QVariant value = stmt.impl->query.value(offset);
checkQueryError(stmt.impl->query);
if (value.isNull()) return {};
return {
std::chrono::time_point_cast<mbgl::Seconds>(std::chrono::system_clock::from_time_t(value.value<::time_t>()))};
std::chrono::time_point_cast<mln::Seconds>(std::chrono::system_clock::from_time_t(value.value<::time_t>()))};
}
void Query::reset() {

View File

@@ -5,7 +5,7 @@
#include <string>
namespace mbgl {
namespace mln {
namespace platform {
std::string uppercase(const std::string& str) {
@@ -21,4 +21,4 @@ std::string lowercase(const std::string& str) {
}
} // namespace platform
} // namespace mbgl
} // namespace mln

View File

@@ -3,7 +3,7 @@
#include <string>
namespace mbgl {
namespace mln {
namespace platform {
std::string getCurrentThreadName() {
@@ -21,4 +21,4 @@ void attachThread() {}
void detachThread() {}
} // namespace platform
} // namespace mbgl
} // namespace mln

View File

@@ -5,7 +5,7 @@
#include <QThreadStorage>
namespace mbgl {
namespace mln {
namespace util {
namespace impl {
@@ -37,4 +37,4 @@ void ThreadLocalBase::set(void* ptr) {
} // namespace impl
} // namespace util
} // namespace mbgl
} // namespace mln

View File

@@ -7,7 +7,7 @@
#include <limits>
#include <memory>
namespace mbgl {
namespace mln {
namespace util {
namespace {
@@ -69,4 +69,4 @@ void Timer::stop() {
}
} // namespace util
} // namespace mbgl
} // namespace mln

View File

@@ -5,7 +5,7 @@
#include <QObject>
#include <QTimer>
namespace mbgl {
namespace mln {
namespace util {
class Timer::Impl : public QObject {
@@ -28,4 +28,4 @@ private:
};
} // namespace util
} // namespace mbgl
} // namespace mln

View File

@@ -2,7 +2,7 @@
#include <QString>
namespace mbgl {
namespace mln {
namespace util {
std::u16string convertUTF8ToUTF16(std::string const& utf8) {
@@ -14,4 +14,4 @@ std::u16string convertUTF8ToUTF16(std::string const& utf8) {
}
} // namespace util
} // namespace mbgl
} // namespace mln

View File

@@ -29,5 +29,5 @@ int main(int argc, char *argv[]) {
}
#endif
return mbgl::runTests(argc, argv);
return mln::runTests(argc, argv);
}