Commit bbcd9167 authored by Volker Krause's avatar Volker Krause
Browse files

Add export macros in preparation of making this a shared library

parent ef3b73b8
......@@ -60,6 +60,13 @@ add_library(KOSMIndoorMap STATIC
${FLEX_mapcssscanner_OUTPUTS}
)
generate_export_header(KOSMIndoorMap BASE_NAME KOSMIndoorMap)
set_target_properties(KOSMIndoorMap PROPERTIES
VERSION ${KOSMINDOORMAP_VERSION_STRING}
SOVERSION ${KOSMINDOORMAP_SOVERSION}
EXPORT_NAME KOSMIndoorMap
)
target_include_directories(KOSMIndoorMap PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_include_directories(KOSMIndoorMap PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
target_link_libraries(KOSMIndoorMap
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_GATEMODEL_H
#define KOSMINDOORMAP_GATEMODEL_H
#include "kosmindoormap_export.h"
#include <KOSMIndoorMap/MapData>
#include <osm/element.h>
......@@ -28,7 +30,7 @@ struct Gate {
* This also contains the concept of (optional) arrival/departure gates,
* for matching gate names from other sources and highlighting those in the output.
*/
class GateModel : public QAbstractListModel
class KOSMINDOORMAP_EXPORT GateModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(KOSMIndoorMap::MapData* mapData READ mapData WRITE setMapData NOTIFY mapDataChanged)
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_PLATFORM_H
#define KOSMINDOORMAP_PLATFORM_H
#include "kosmindoormap_export.h"
#include <osm/element.h>
#include <QMetaType>
......@@ -18,7 +20,7 @@
namespace KOSMIndoorMap {
/** A railway platform section. */
class PlatformSection
class KOSMINDOORMAP_EXPORT PlatformSection
{
public:
/** Platform section has enough data to work with. */
......@@ -29,7 +31,7 @@ public:
};
/** A railway platform/track. */
class Platform {
class KOSMINDOORMAP_EXPORT Platform {
Q_GADGET
public:
explicit Platform();
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_PLATFORMFINDER_H
#define KOSMINDOORMAP_PLATFORMFINDER_H
#include "kosmindoormap_export.h"
#include "platform.h"
#include <QCollator>
......@@ -16,8 +18,10 @@ namespace KOSMIndoorMap {
class MapData;
class MapLevel;
/** Identifies public transport platforms in OSM data. */
class PlatformFinder
/** Identifies public transport platforms in OSM data.
* @internal only exported for unit tests
*/
class KOSMINDOORMAP_EXPORT PlatformFinder
{
public:
explicit PlatformFinder();
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_PLATFORMMODEL_H
#define KOSMINDOORMAP_PLATFORMMODEL_H
#include "kosmindoormap_export.h"
#include "platform.h"
#include <QAbstractItemModel>
......@@ -19,7 +21,7 @@ class MapData;
* There's also the concept of (optional) arrival/departure platforms in here to highlight
* arriving/departing locations when used in context of a planned journey.
*/
class PlatformModel : public QAbstractItemModel
class KOSMINDOORMAP_EXPORT PlatformModel : public QAbstractItemModel
{
Q_OBJECT
Q_PROPERTY(KOSMIndoorMap::MapData* mapData READ mapData WRITE setMapData NOTIFY mapDataChanged)
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_LEVELPARSER_H
#define KOSMINDOORMAP_LEVELPARSER_H
#include "kosmindoormap_export.h"
#include <functional>
namespace OSM {
......@@ -25,7 +27,8 @@ namespace KOSMIndoorMap {
*/
namespace LevelParser
{
void parse(QByteArray &&level, OSM::Element e, const std::function<void(int, OSM::Element)> &callback);
/** @internal only exported for unit tests. */
KOSMINDOORMAP_EXPORT void parse(QByteArray &&level, OSM::Element e, const std::function<void(int, OSM::Element)> &callback);
}
}
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_MAPDATA_H
#define KOSMINDOORMAP_MAPDATA_H
#include "kosmindoormap_export.h"
#include <osm/datatypes.h>
#include <osm/element.h>
......@@ -18,7 +20,7 @@
namespace KOSMIndoorMap {
/** A floor level. */
class MapLevel
class KOSMINDOORMAP_EXPORT MapLevel
{
public:
explicit MapLevel(int level = 0);
......@@ -49,7 +51,7 @@ Q_DECLARE_METATYPE(KOSMIndoorMap::MapLevel)
namespace KOSMIndoorMap {
/** Raw OSM map data, separated by levels. */
class MapData
class KOSMINDOORMAP_EXPORT MapData
{
public:
explicit MapData();
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_MAPLOADER_H
#define KOSMINDOORMAP_MAPLOADER_H
#include "kosmindoormap_export.h"
#include "boundarysearch.h"
#include "mapdata.h"
#include "marblegeometryassembler.h"
......@@ -22,7 +24,7 @@
namespace KOSMIndoorMap {
/** Loader for OSM data for a single station or airport. */
class MapLoader : public QObject
class KOSMINDOORMAP_EXPORT MapLoader : public QObject
{
Q_OBJECT
/** Indicates we are downloading content. Use for progress display. */
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_MARBLEGEOMETRYASSEMBLER_H
#define KOSMINDOORMAP_MARBLEGEOMETRYASSEMBLER_H
#include "kosmindoormap_export.h"
#include <osm/datatypes.h>
#include <osm/datasetmergebuffer.h>
......@@ -14,8 +16,10 @@
namespace KOSMIndoorMap {
/** Re-assemble broken up geometry in Marble vector tiles. */
class MarbleGeometryAssembler
/** Re-assemble broken up geometry in Marble vector tiles.
* @internal exported only for unit tests
*/
class KOSMINDOORMAP_EXPORT MarbleGeometryAssembler
{
public:
MarbleGeometryAssembler();
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_TILECACHE_H
#define KOSMINDOORMAP_TILECACHE_H
#include "kosmindoormap_export.h"
#include <QDateTime>
#include <QFile>
#include <QObject>
......@@ -25,8 +27,9 @@ namespace KOSMIndoorMap {
/** Identifier of a slippy map tile.
* @see https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
* @internal only exported for unit tests
*/
class Tile
class KOSMINDOORMAP_EXPORT Tile
{
public:
inline Tile() = default;
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_HITDETECTOR_H
#define KOSMINDOORMAP_HITDETECTOR_H
#include "kosmindoormap_export.h"
#include <vector>
class QPointF;
......@@ -24,7 +26,7 @@ class View;
/** Picking hit detector.
* Ie. find scene graph items at a given screen position.
*/
class HitDetector
class KOSMINDOORMAP_EXPORT HitDetector
{
public:
/** Highest (in z-order) item at the given screen position. */
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_PAINTERRENDERER_H
#define KOSMINDOORMAP_PAINTERRENDERER_H
#include "kosmindoormap_export.h"
#include "../scene/scenegraphitem.h"
#include <osm/datatypes.h>
......@@ -24,7 +26,7 @@ class View;
/** QPainter-based renderer of a SceneGraph.
* Trying to keep this somewhat backend-agnostic to possibly implement a 3D renderer in the future.
*/
class PainterRenderer
class KOSMINDOORMAP_EXPORT PainterRenderer
{
public:
explicit PainterRenderer();
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_VIEW_H
#define KOSMINDOORMAP_VIEW_H
#include "kosmindoormap_export.h"
#include <osm/datatypes.h>
#include <QObject>
......@@ -33,7 +35,7 @@ namespace KOSMIndoorMap {
* - "pan space": same transform as screen space, but with the origin at the origin of the scene bounding box
* This is useful for implementing scene-wide panning and showing scroll bars.
*/
class View : public QObject
class KOSMINDOORMAP_EXPORT View : public QObject
{
Q_OBJECT
Q_PROPERTY(double panX READ panX NOTIFY transformationChanged)
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_OVERLAYSOURCE_H
#define KOSMINDOORMAP_OVERLAYSOURCE_H
#include "kosmindoormap_export.h"
#include <osm/element.h>
#include <QPointer>
......@@ -21,7 +23,7 @@ namespace KOSMIndoorMap {
* @todo If we ever get different sources than QAIMs, this could be split into
* an abstract base and specific implementations.
*/
class OverlaySource
class KOSMINDOORMAP_EXPORT OverlaySource
{
public:
explicit OverlaySource(QAbstractItemModel *model);
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_PENWIDTHUTIL_H
#define KOSMINDOORMAP_PENWIDTHUTIL_H
#include "kosmindoormap_export.h"
#include "scenegraphitem.h"
#include <osm/element.h>
......@@ -18,7 +20,8 @@ class MapCSSDeclaration;
/** Determine pen width based on a MapCSS declaration and OSM element tag information. */
namespace PenWidthUtil
{
double penWidth(OSM::Element e, const MapCSSDeclaration *decl, Unit &unit);
/** @internal only exported for unit tests. */
KOSMINDOORMAP_EXPORT double penWidth(OSM::Element e, const MapCSSDeclaration *decl, Unit &unit);
}
}
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_SCENECONTROLLER_H
#define KOSMINDOORMAP_SCENECONTROLLER_H
#include "kosmindoormap_export.h"
#include "scenegraphitem.h"
#include "../style/mapcssresult.h"
#include "iconloader.h"
......@@ -32,7 +34,7 @@ class SceneGraph;
class View;
/** Creates/updates the scene graph based on a given style sheet and view. */
class SceneController
class KOSMINDOORMAP_EXPORT SceneController
{
public:
explicit SceneController();
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_SCENEGEOMETRY_H
#define KOSMINDOORMAP_SCENEGEOMETRY_H
#include "kosmindoormap_export.h"
class QLineF;
class QPainterPath;
class QPointF;
......@@ -14,22 +16,24 @@ class QPolygonF;
namespace KOSMIndoorMap {
/** Geometry related functions. */
/** Geometry related functions.
* @internal only exported for unit tests
*/
namespace SceneGeometry
{
/** Centroid of a polygon.
* @see https://en.wikipedia.org/wiki/Polygon#Centroid
*/
QPointF polygonCentroid(const QPolygonF &poly);
KOSMINDOORMAP_EXPORT QPointF polygonCentroid(const QPolygonF &poly);
/** Returns the lengths of the given polyline. */
double polylineLength(const QPolygonF &poly);
/** Returns the point at equal distance between the ends on the given polygon. */
QPointF polylineMidPoint(const QPolygonF &poly);
KOSMINDOORMAP_EXPORT QPointF polylineMidPoint(const QPolygonF &poly);
/** Rotation angle for a label placed at the middle of @p path. */
double polylineMidPointAngle(const QPolygonF &path);
KOSMINDOORMAP_EXPORT double polylineMidPointAngle(const QPolygonF &path);
/** Returns the outer polygon of a painter path.
* @note This is not generic, but makes assumptions about the painter path
......@@ -38,7 +42,7 @@ namespace SceneGeometry
void outerPolygonFromPath(const QPainterPath &path, QPolygonF &poly);
/** Computes the distance of the given line to the given point. */
double distanceToLine(const QLineF &line, QPointF p);
KOSMINDOORMAP_EXPORT double distanceToLine(const QLineF &line, QPointF p);
}
}
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_SCENEGRAPH_H
#define KOSMINDOORMAP_SCENEGRAPH_H
#include "kosmindoormap_export.h"
#include "scenegraphitem.h"
#include <osm/element.h>
......@@ -23,7 +25,7 @@ namespace KOSMIndoorMap {
class SceneGraphItem;
/** Scene graph of the currently displayed level. */
class SceneGraph
class KOSMINDOORMAP_EXPORT SceneGraph
{
public:
explicit SceneGraph();
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_MAPCSSDECLARATION_H
#define KOSMINDOORMAP_MAPCSSDECLARATION_H
#include "kosmindoormap_export.h"
#include <QByteArray>
#include <QColor>
#include <QFont>
......@@ -28,8 +30,9 @@ namespace KOSMIndoorMap {
/** Property/value declaration of a MapCSS rule.
* @see https://wiki.openstreetmap.org/wiki/MapCSS/0.2#Vocabulary
* @internal only exported for unit tests
*/
class MapCSSDeclaration
class KOSMINDOORMAP_EXPORT MapCSSDeclaration
{
public:
/** Type of declaration. */
......
......@@ -7,6 +7,8 @@
#ifndef KOSMINDOORMAP_MAPCSSPARSER_H
#define KOSMINDOORMAP_MAPCSSPARSER_H
#include "kosmindoormap_export.h"
#include <QString>
namespace KOSMIndoorMap { class MapCSSParser; }
......@@ -21,7 +23,7 @@ class MapCSSStyle;
class MapCSSRule;
/** MapCSS parser. */
class MapCSSParser
class KOSMINDOORMAP_EXPORT MapCSSParser
{
public:
MapCSSStyle parse(const QString &fileName);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment