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

@@ -15,7 +15,7 @@
#include <algorithm>
using namespace mbgl;
using namespace mln;
namespace {
@@ -135,7 +135,7 @@ TEST(Annotations, AntimeridianAnnotationLarge) {
AnnotationTest test;
double antimeridian = 180;
test.map.jumpTo(CameraOptions().withCenter(mbgl::LatLng(0.0, antimeridian)).withZoom(0.0));
test.map.jumpTo(CameraOptions().withCenter(mln::LatLng(0.0, antimeridian)).withZoom(0.0));
test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
LineString<double> line = {{{antimeridian, 20}, {antimeridian, -20}}};
@@ -397,7 +397,7 @@ TEST(Annotations, QueryFractionalZoomLevels) {
test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
test.map.addAnnotationImage(namedMarker("default_marker"));
std::vector<mbgl::AnnotationID> ids;
std::vector<mln::AnnotationID> ids;
for (int longitude = 0; longitude < 10; longitude += 2) {
for (int latitude = 0; latitude < 10; latitude += 2) {
ids.push_back(
@@ -405,7 +405,7 @@ TEST(Annotations, QueryFractionalZoomLevels) {
}
}
test.map.jumpTo(CameraOptions().withCenter(mbgl::LatLng(5.0, 5.0)).withZoom(0.0));
test.map.jumpTo(CameraOptions().withCenter(mln::LatLng(5.0, 5.0)).withZoom(0.0));
for (uint16_t zoomSteps = 10; zoomSteps <= 20; ++zoomSteps) {
test.map.jumpTo(CameraOptions().withZoom(zoomSteps / 10.0));
test.frontend.render(test.map);
@@ -434,9 +434,9 @@ TEST(Annotations, VisibleFeatures) {
test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
test.map.addAnnotationImage(namedMarker("default_marker"));
test.map.jumpTo(CameraOptions().withCenter(mbgl::LatLng(5.0, 5.0)).withZoom(3.0));
test.map.jumpTo(CameraOptions().withCenter(mln::LatLng(5.0, 5.0)).withZoom(3.0));
std::vector<mbgl::AnnotationID> ids;
std::vector<mln::AnnotationID> ids;
for (int longitude = 0; longitude < 10; longitude += 2) {
for (int latitude = 0; latitude <= 10; latitude += 2) {
ids.push_back(
@@ -515,7 +515,7 @@ TEST(Annotations, ViewFrustumCulling) {
std::vector<LatLng> latLngs = {tl, bl, tr, br, center};
std::vector<mbgl::AnnotationID> ids;
std::vector<mln::AnnotationID> ids;
for (auto latLng : latLngs) {
ids.push_back(
test.map.addAnnotation(SymbolAnnotation{{latLng.longitude(), latLng.latitude()}, "default_marker"}));

View File

@@ -11,7 +11,7 @@
#include <future>
using namespace mbgl;
using namespace mln;
TEST(API, RenderWithoutCallback) {
FixtureLog log;

View File

@@ -22,7 +22,7 @@
using namespace std::numbers;
class LineTestDrawableLayer : public mbgl::style::CustomDrawableLayerHost {
class LineTestDrawableLayer : public mln::style::CustomDrawableLayerHost {
public:
void initialize() override {}
@@ -35,7 +35,7 @@ public:
// add polylines
{
using namespace mbgl;
using namespace mln;
constexpr auto numLines = 6;
Interface::LineOptions options[numLines]{
@@ -128,7 +128,7 @@ public:
void deinitialize() override {}
};
class FillTestDrawableLayer : public mbgl::style::CustomDrawableLayerHost {
class FillTestDrawableLayer : public mln::style::CustomDrawableLayerHost {
public:
void initialize() override {}
@@ -141,7 +141,7 @@ public:
// add fill polygon
{
using namespace mbgl;
using namespace mln;
GeometryCollection geometry{
{
@@ -176,7 +176,7 @@ public:
void deinitialize() override {}
};
class SymbolIconTestDrawableLayer : public mbgl::style::CustomDrawableLayerHost {
class SymbolIconTestDrawableLayer : public mln::style::CustomDrawableLayerHost {
public:
void initialize() override {}
@@ -189,7 +189,7 @@ public:
// add symbol icon
{
using namespace mbgl;
using namespace mln;
GeometryCoordinate position{static_cast<int16_t>(util::EXTENT * 0.5f),
static_cast<int16_t>(util::EXTENT * 0.5f)};
@@ -235,8 +235,8 @@ public:
};
TEST(CustomDrawableLayer, Line) {
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
util::RunLoop loop;
@@ -259,8 +259,8 @@ TEST(CustomDrawableLayer, Line) {
}
TEST(CustomDrawableLayer, Fill) {
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
util::RunLoop loop;
@@ -283,8 +283,8 @@ TEST(CustomDrawableLayer, Fill) {
}
TEST(CustomDrawableLayer, SymbolIcon) {
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
util::RunLoop loop;

View File

@@ -13,8 +13,8 @@
#include <mbgl/util/mat4.hpp>
#include <mbgl/util/run_loop.hpp>
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
TEST(CustomGeometrySource, Grid) {
util::RunLoop loop;
@@ -28,7 +28,7 @@ TEST(CustomGeometrySource, Grid) {
map.jumpTo(CameraOptions().withCenter(LatLng{37.8, -122.5}).withZoom(10.0));
CustomGeometrySource::Options options;
options.fetchTileFunction = [&map](const mbgl::CanonicalTileID& tileID) {
options.fetchTileFunction = [&map](const mln::CanonicalTileID& tileID) {
double gridSpacing = 0.1;
FeatureCollection features;
const LatLngBounds bounds(tileID);

View File

@@ -17,9 +17,9 @@
#include <memory>
using namespace mbgl;
using namespace mbgl::style;
using namespace mbgl::platform;
using namespace mln;
using namespace mln::style;
using namespace mln::platform;
// Note that custom layers need to draw geometry with a z value of 1 to take
// advantage of depth-based fragment culling.
@@ -40,9 +40,9 @@ void main() {
// in the layer implementation because it is intended to reflect how someone
// using custom layers might actually write their own implementation.
class TestLayer : public mbgl::style::CustomLayerHost {
class TestLayer : public mln::style::CustomLayerHost {
public:
void initialize(const mbgl::style::CustomLayerInitParameters&) override {
void initialize(const mln::style::CustomLayerInitParameters&) override {
program = MBGL_CHECK_ERROR(glCreateProgram());
vertexShader = MBGL_CHECK_ERROR(glCreateShader(GL_VERTEX_SHADER));
fragmentShader = MBGL_CHECK_ERROR(glCreateShader(GL_FRAGMENT_SHADER));
@@ -62,7 +62,7 @@ public:
MBGL_CHECK_ERROR(glBufferData(GL_ARRAY_BUFFER, 6 * sizeof(GLfloat), triangle, GL_STATIC_DRAW));
}
void render(const mbgl::style::CustomLayerRenderParameters&) override {
void render(const mln::style::CustomLayerRenderParameters&) override {
MBGL_CHECK_ERROR(glUseProgram(program));
MBGL_CHECK_ERROR(glBindBuffer(GL_ARRAY_BUFFER, buffer));
MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_pos));

View File

@@ -15,9 +15,9 @@
#include <mbgl/renderer/renderer.hpp>
#include <mbgl/gfx/headless_frontend.hpp>
using namespace mbgl;
using namespace mbgl::style;
using namespace mbgl::style::expression;
using namespace mln;
using namespace mln::style;
using namespace mln::style::expression;
using namespace std::literals;
namespace {
@@ -114,7 +114,7 @@ TEST(Query, QueryRenderedFeaturesFilterLayer) {
}
TEST(Query, QueryRenderedFeaturesFilter) {
using namespace mbgl::style::expression::dsl;
using namespace mln::style::expression::dsl;
QueryTest test;
auto zz = test.map.pixelForLatLng({0, 0});
@@ -172,7 +172,7 @@ TEST(Query, QuerySourceFeaturesOptionValidation) {
}
TEST(Query, QuerySourceFeaturesFilter) {
using namespace mbgl::style::expression::dsl;
using namespace mln::style::expression::dsl;
QueryTest test;
@@ -193,7 +193,7 @@ TEST(Query, QueryFeatureExtensionsInvalidExtension) {
QueryTest test;
auto unknownExt = test.frontend.getRenderer()->queryFeatureExtensions("source4"s, {}, "unknown"s, "children"s);
auto unknownValue = unknownExt.get<mbgl::Value>();
auto unknownValue = unknownExt.get<mln::Value>();
EXPECT_TRUE(unknownValue.is<NullValue>());
}
@@ -240,8 +240,8 @@ TEST(Query, QueryFeatureExtensionsSuperclusterExpansionZoom) {
auto queryExpansionZoom2 = test.frontend.getRenderer()->queryFeatureExtensions(
"cluster_source"s, children[3], "supercluster"s, "expansion-zoom"s);
auto zoomValue1 = queryExpansionZoom1.get<mbgl::Value>();
auto zoomValue2 = queryExpansionZoom2.get<mbgl::Value>();
auto zoomValue1 = queryExpansionZoom1.get<mln::Value>();
auto zoomValue2 = queryExpansionZoom2.get<mln::Value>();
EXPECT_TRUE(zoomValue1.is<uint64_t>());
EXPECT_TRUE(zoomValue2.is<uint64_t>());
EXPECT_EQ(zoomValue1.get<uint64_t>(), 1u);
@@ -261,7 +261,7 @@ TEST(Query, QueryFeatureExtensionsSuperclusterLeaves) {
EXPECT_EQ(leaves.size(), 10u);
// Get leaves for cluster 1, with limit 3, offset 0.
const std::map<std::string, mbgl::Value> limitOpts = {{"limit"s, static_cast<uint64_t>(3u)}};
const std::map<std::string, mln::Value> limitOpts = {{"limit"s, static_cast<uint64_t>(3u)}};
auto queryClusterLeavesLimit3 = test.frontend.getRenderer()->queryFeatureExtensions(
"cluster_source"s, topClusterFeature[0], "supercluster"s, "leaves"s, limitOpts);
auto limitLeaves3 = queryClusterLeavesLimit3.get<FeatureCollection>();
@@ -272,8 +272,8 @@ TEST(Query, QueryFeatureExtensionsSuperclusterLeaves) {
EXPECT_EQ(limitLeaves3[2].properties["name"].get<std::string>(), "Cape Fear"s);
// Get leaves for cluster 1, with limit 3, offset 3.
const std::map<std::string, mbgl::Value> offsetOpts = {{"limit"s, static_cast<uint64_t>(3u)},
{"offset"s, static_cast<uint64_t>(3u)}};
const std::map<std::string, mln::Value> offsetOpts = {{"limit"s, static_cast<uint64_t>(3u)},
{"offset"s, static_cast<uint64_t>(3u)}};
auto queryClusterLeavesOffset3 = test.frontend.getRenderer()->queryFeatureExtensions(
"cluster_source"s, topClusterFeature[0], "supercluster"s, "leaves"s, offsetOpts);
auto offsetLeaves3 = queryClusterLeavesOffset3.get<FeatureCollection>();

View File

@@ -15,8 +15,8 @@
#include <mbgl/util/io.hpp>
#include <mbgl/util/run_loop.hpp>
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
TEST(API, RecycleMapUpdateImages) {
util::RunLoop loop;