1 #pragma once
2
3 #include <mbgl/util/util.hpp>
4 #include <mbgl/util/traits.hpp>
5
6 #include <cstdint>
7
8 namespace mbgl {
9
10 using EnumType = uint32_t;
11
12 enum class MapMode : EnumType {
13 Continuous, // continually updating map
14 Static, // a once-off still image of an arbitrary viewport
15 Tile // a once-off still image of a single tile
16 };
17
18 // We can choose to constrain the map both horizontally or vertically, or only
19 // vertically e.g. while panning.
20 enum class ConstrainMode : EnumType {
21 None,
22 HeightOnly,
23 WidthAndHeight,
24 };
25
26 // Satisfies embedding platforms that requires the viewport coordinate systems
27 // to be set according to its standards.
28 enum class ViewportMode : EnumType {
29 Default,
30 FlippedY,
31 };
32
33 enum class MapDebugOptions : EnumType {
34 NoDebug = 0,
35 TileBorders = 1 << 1,
36 ParseStatus = 1 << 2,
37 Timestamps = 1 << 3,
38 Collision = 1 << 4,
39 Overdraw = 1 << 5,
40 // FIXME: https://github.com/mapbox/mapbox-gl-native/issues/5117
41 #if not MBGL_USE_GLES2
42 StencilClip = 1 << 6,
43 DepthBuffer = 1 << 7,
44 #endif // MBGL_USE_GLES2
45 };
46
operator |(MapDebugOptions lhs,MapDebugOptions rhs)47 MBGL_CONSTEXPR MapDebugOptions operator|(MapDebugOptions lhs, MapDebugOptions rhs) {
48 return MapDebugOptions(mbgl::underlying_type(lhs) | mbgl::underlying_type(rhs));
49 }
50
operator |=(MapDebugOptions & lhs,MapDebugOptions rhs)51 MBGL_CONSTEXPR MapDebugOptions& operator|=(MapDebugOptions& lhs, MapDebugOptions rhs) {
52 return (lhs = MapDebugOptions(mbgl::underlying_type(lhs) | mbgl::underlying_type(rhs)));
53 }
54
operator &(MapDebugOptions lhs,MapDebugOptions rhs)55 MBGL_CONSTEXPR bool operator&(MapDebugOptions lhs, MapDebugOptions rhs) {
56 return mbgl::underlying_type(lhs) & mbgl::underlying_type(rhs);
57 }
58
operator &=(MapDebugOptions & lhs,MapDebugOptions rhs)59 MBGL_CONSTEXPR MapDebugOptions& operator&=(MapDebugOptions& lhs, MapDebugOptions rhs) {
60 return (lhs = MapDebugOptions(mbgl::underlying_type(lhs) & mbgl::underlying_type(rhs)));
61 }
62
operator ~(MapDebugOptions value)63 MBGL_CONSTEXPR MapDebugOptions operator~(MapDebugOptions value) {
64 return MapDebugOptions(~mbgl::underlying_type(value));
65 }
66
67 } // namespace mbgl
68