Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/src/flmln.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "flmln.h"
#include "flmln_ffi_gen.h"

#include <stdint.h>

Expand Down Expand Up @@ -41,11 +42,11 @@ MBGL_CONSTRAIN_MODE mbgl_map_options_constrain_mode_get(mbgl_map_options_t _mapO
case mbgl::ConstrainMode::None:
return MBGL_CONSTRAIN_MODE_NONE;
case mbgl::ConstrainMode::HeightOnly:
return MBGL_CONSTRAIN_MODE_HEIGHT;
return MBGL_CONSTRAIN_MODE_HEIGHT_ONLY;
case mbgl::ConstrainMode::WidthAndHeight:
return MBGL_CONSTRAIN_MODE_WIDTH_AND_HEIGHT;
case mbgl::ConstrainMode::Screen:
return MBGL_CONSTRAIN_MODE_SCREEEN;
return MBGL_CONSTRAIN_MODE_SCREEN;
}

// TODO: Fallback values.
Expand All @@ -56,10 +57,9 @@ void mbgl_map_options_constrain_mode_set(mbgl_map_options_t _mapOptions) {

}

void mbgl_map_options_set_mode(mbgl_map_options_t _mapOptions, enum MbglMapMode mode) {
void mbgl_map_options_set_mode(mbgl_map_options_t _mapOptions, MBGL_MAP_MODE mode) {
auto* mapOptions = reinterpret_cast<mbgl::MapOptions*>(_mapOptions);
mapOptions->withMapMode(static_cast<mbgl::MapMode>(mode));
mapOptions->withConstrainMode(mbgl::ConstrainMode::)
}

void mbgl_map_options_set_size(mbgl_map_options_t _mapOptions, uint32_t width, uint32_t height) {
Expand Down
13 changes: 13 additions & 0 deletions src/src/flmln.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "flmln_ffi_gen.h"

#define FLMLN_EXPORT __attribute__((__visibility__("default"))) __attribute__((__used__))

Expand Down Expand Up @@ -34,6 +35,18 @@ typedef void* mbgl_color_t;
typedef void* mbgl_padding_t;
typedef void* mbgl_variable_anchor_offset_collection_t;

// ---------------------------------
// mbgl_map_options_t
// ---------------------------------

EXTERNC FLMLN_EXPORT mbgl_map_options_t mbgl_map_options_create();
EXTERNC FLMLN_EXPORT void mbgl_map_options_destroy(mbgl_map_options_t _mapOptions);
EXTERNC FLMLN_EXPORT MBGL_CONSTRAIN_MODE mbgl_map_options_constrain_mode_get(mbgl_map_options_t _mapOptions);
EXTERNC FLMLN_EXPORT void mbgl_map_options_constrain_mode_set(mbgl_map_options_t _mapOptions);
EXTERNC FLMLN_EXPORT void mbgl_map_options_set_mode(mbgl_map_options_t _mapOptions, MBGL_MAP_MODE mode);
EXTERNC FLMLN_EXPORT void mbgl_map_options_set_size(mbgl_map_options_t _mapOptions, uint32_t width, uint32_t height);
EXTERNC FLMLN_EXPORT void mbgl_map_options_set_pixel_ratio(mbgl_map_options_t _mapOptions, float pixelRatio);

// ----------------------------------
// mbgl_tile_server_options_t
// ----------------------------------
Expand Down
3 changes: 3 additions & 0 deletions src/src/flmln_ffi_gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include "stdint.h"
#include "stdbool.h"

// Duration type for animation durations (in milliseconds)
typedef int64_t MBGL_DURATION;

// C-compatible enum definition for mbgl::MapMode
typedef enum MBGL_MAP_MODE {
MBGL_MAP_MODE_CONTINUOUS = 0,
Expand Down
Loading