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 | |
47 | MBGL_CONSTEXPR MapDebugOptions operator|(MapDebugOptions lhs, MapDebugOptions rhs) { |
48 | return MapDebugOptions(mbgl::underlying_type(t: lhs) | mbgl::underlying_type(t: rhs)); |
49 | } |
50 | |
51 | MBGL_CONSTEXPR MapDebugOptions& operator|=(MapDebugOptions& lhs, MapDebugOptions rhs) { |
52 | return (lhs = MapDebugOptions(mbgl::underlying_type(t: lhs) | mbgl::underlying_type(t: rhs))); |
53 | } |
54 | |
55 | MBGL_CONSTEXPR bool operator&(MapDebugOptions lhs, MapDebugOptions rhs) { |
56 | return mbgl::underlying_type(t: lhs) & mbgl::underlying_type(t: rhs); |
57 | } |
58 | |
59 | MBGL_CONSTEXPR MapDebugOptions& operator&=(MapDebugOptions& lhs, MapDebugOptions rhs) { |
60 | return (lhs = MapDebugOptions(mbgl::underlying_type(t: lhs) & mbgl::underlying_type(t: rhs))); |
61 | } |
62 | |
63 | MBGL_CONSTEXPR MapDebugOptions operator~(MapDebugOptions value) { |
64 | return MapDebugOptions(~mbgl::underlying_type(t: value)); |
65 | } |
66 | |
67 | } // namespace mbgl |
68 | |