diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-02-26 18:05:13 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-02-27 16:29:06 +0200 |
commit | dd651691f37ecf9e2d59146b190d734e9a4e6148 (patch) | |
tree | e8f50fea841905ed825870377c34ab5951e95c00 /src/mbgl/map/map_impl.hpp | |
parent | edc6a5dd8bc293a9869581257d18ad1e054f724f (diff) | |
download | qtlocation-mapboxgl-dd651691f37ecf9e2d59146b190d734e9a4e6148.tar.gz |
[core] Move Map::Impl to its own def/impl files
Diffstat (limited to 'src/mbgl/map/map_impl.hpp')
-rw-r--r-- | src/mbgl/map/map_impl.hpp | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/mbgl/map/map_impl.hpp b/src/mbgl/map/map_impl.hpp new file mode 100644 index 0000000000..32dc728b70 --- /dev/null +++ b/src/mbgl/map/map_impl.hpp @@ -0,0 +1,86 @@ +#pragma once + +#include <mbgl/actor/scheduler.hpp> +#include <mbgl/annotation/annotation_manager.hpp> +#include <mbgl/map/map.hpp> +#include <mbgl/map/map_observer.hpp> +#include <mbgl/map/mode.hpp> +#include <mbgl/map/transform.hpp> +#include <mbgl/renderer/renderer_frontend.hpp> +#include <mbgl/renderer/renderer_observer.hpp> +#include <mbgl/storage/file_source.hpp> +#include <mbgl/style/observer.hpp> +#include <mbgl/style/source.hpp> +#include <mbgl/style/style.hpp> +#include <mbgl/util/size.hpp> + +namespace mbgl { + +struct StillImageRequest { + StillImageRequest(Map::StillImageCallback&& callback_) + : callback(std::move(callback_)) { + } + + Map::StillImageCallback callback; +}; + +class Map::Impl : public style::Observer, public RendererObserver { +public: + Impl(Map&, + RendererFrontend&, + MapObserver&, + FileSource&, + Scheduler&, + + Size size, + float pixelRatio, + + MapMode, + ConstrainMode, + ViewportMode, + bool crossSourceCollisions); + + ~Impl() final; + + // StyleObserver + void onSourceChanged(style::Source&) final; + void onUpdate() final; + void onStyleLoading() final; + void onStyleLoaded() final; + void onStyleError(std::exception_ptr) final; + + // RendererObserver + void onInvalidate() final; + void onResourceError(std::exception_ptr) final; + void onWillStartRenderingFrame() final; + void onDidFinishRenderingFrame(RenderMode, bool) final; + void onWillStartRenderingMap() final; + void onDidFinishRenderingMap() final; + + Map& map; + MapObserver& observer; + RendererFrontend& rendererFrontend; + FileSource& fileSource; + Scheduler& scheduler; + + Transform transform; + + const MapMode mode; + const float pixelRatio; + const bool crossSourceCollisions; + + MapDebugOptions debugOptions { MapDebugOptions::NoDebug }; + + std::unique_ptr<style::Style> style; + AnnotationManager annotationManager; + + bool cameraMutated = false; + + uint8_t prefetchZoomDelta = util::DEFAULT_PREFETCH_ZOOM_DELTA; + + bool loading = false; + bool rendererFullyLoaded; + std::unique_ptr<StillImageRequest> stillImageRequest; +}; + +} // namespace mbgl |