add EXPORT to lib for shared symbols

pull/135/head
Simon Stürz 2016-01-11 10:27:58 +01:00 committed by Michael Zanetti
parent ca5fb4d102
commit 16e6e2de3b
46 changed files with 146 additions and 49 deletions

View File

@ -25,7 +25,9 @@
#include <QBluetoothServiceInfo>
#include <QLowEnergyController>
class BluetoothLowEnergyDevice : public QObject
#include "libguh.h"
class LIBGUH_EXPORT BluetoothLowEnergyDevice : public QObject
{
Q_OBJECT
public:

View File

@ -29,9 +29,10 @@
#include <QBluetoothLocalDevice>
#include <QBluetoothDeviceDiscoveryAgent>
#include "libguh.h"
#include "typeutils.h"
class BluetoothScanner : public QObject
class LIBGUH_EXPORT BluetoothScanner : public QObject
{
Q_OBJECT
public:

View File

@ -27,6 +27,7 @@
#include <QHostAddress>
#include <QQueue>
#include "libguh.h"
#include "coaprequest.h"
#include "coapreply.h"
@ -38,7 +39,7 @@
* Observing Resources in CoAP : https://tools.ietf.org/html/rfc7641
*/
class Coap : public QObject
class LIBGUH_EXPORT Coap : public QObject
{
Q_OBJECT

View File

@ -25,7 +25,9 @@
#include <QObject>
#include <QByteArray>
class CoapOption
#include "libguh.h"
class LIBGUH_EXPORT CoapOption
{
Q_GADGET
Q_ENUMS(Option)

View File

@ -27,6 +27,8 @@
#include "coapoption.h"
#include "coappdublock.h"
#include "libguh.h"
// PDU = Protocol Data Unit
/* 0 1 2 3
@ -42,7 +44,7 @@
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
class CoapPdu : public QObject
class LIBGUH_EXPORT CoapPdu : public QObject
{
Q_OBJECT
Q_ENUMS(MessageType)

View File

@ -23,7 +23,9 @@
#include <QByteArray>
class CoapPduBlock
#include "libguh.h"
class LIBGUH_EXPORT CoapPduBlock
{
public:
CoapPduBlock();

View File

@ -24,11 +24,13 @@
#include <QObject>
#include <QTimer>
#include "libguh.h"
#include "coappdu.h"
#include "coapoption.h"
#include "coaprequest.h"
class CoapReply : public QObject
class LIBGUH_EXPORT CoapReply : public QObject
{
friend class Coap;

View File

@ -24,12 +24,14 @@
#include <QUrl>
#include <QHostAddress>
#include "libguh.h"
#include "coappdu.h"
#include "coapoption.h"
//class Coap;
class CoapRequest
class LIBGUH_EXPORT CoapRequest
{
// friend class Coap;
public:

View File

@ -24,9 +24,10 @@
#include <QObject>
#include <QDebug>
#include "libguh.h"
#include "coappdu.h"
class CoreLink
class LIBGUH_EXPORT CoreLink
{
public:
CoreLink();

View File

@ -23,11 +23,12 @@
#include <QObject>
#include "libguh.h"
#include "corelink.h"
// Constrained RESTful Environments (CoRE) Link Format : http://tools.ietf.org/html/rfc6690
class CoreLinkParser : public QObject
class LIBGUH_EXPORT CoreLinkParser : public QObject
{
Q_OBJECT
public:

View File

@ -22,6 +22,8 @@
#ifndef DEVICEMANAGER_H
#define DEVICEMANAGER_H
#include "libguh.h"
#include "plugin/deviceclass.h"
#include "plugin/device.h"
#include "plugin/devicedescriptor.h"
@ -45,10 +47,11 @@ class DevicePlugin;
class Radio433;
class UpnpDiscovery;
class DeviceManager : public QObject
class LIBGUH_EXPORT DeviceManager : public QObject
{
Q_OBJECT
Q_ENUMS(DeviceError)
public:
enum HardwareResource {
HardwareResourceNone = 0x00,
@ -204,6 +207,7 @@ private:
friend class DevicePlugin;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(DeviceManager::HardwareResources)
Q_DECLARE_METATYPE(DeviceManager::DeviceError)

View File

@ -24,9 +24,11 @@
#include <QObject>
#include <QVariant>
#include "libguh.h"
class QSettings;
class GuhSettings : public QObject
class LIBGUH_EXPORT GuhSettings : public QObject
{
Q_OBJECT
public:

View File

@ -27,6 +27,8 @@
#include <QMutexLocker>
#include <QDir>
#include "libguh.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -73,7 +75,7 @@
**********************************
*/
class Gpio : public QObject
class LIBGUH_EXPORT Gpio : public QObject
{
Q_OBJECT
public:

View File

@ -28,9 +28,10 @@
#include <poll.h>
#include <errno.h>
#include "libguh.h"
#include "hardware/gpio.h"
class GpioMonitor : public QThread
class LIBGUH_EXPORT GpioMonitor : public QThread
{
Q_OBJECT
public:

View File

@ -28,9 +28,10 @@
#include "radio433transmitter.h"
#endif
#include "libguh.h"
#include "radio433brennenstuhlgateway.h"
class Radio433 : public QObject
class LIBGUH_EXPORT Radio433 : public QObject
{
Q_OBJECT
public:

View File

@ -26,7 +26,9 @@
#include <QHostAddress>
#include <QTimer>
class Radio433BrennenstuhlGateway : public QObject
#include "libguh.h"
class LIBGUH_EXPORT Radio433BrennenstuhlGateway : public QObject
{
Q_OBJECT
public:

View File

@ -23,9 +23,10 @@
#include <QThread>
#include "libguh.h"
#include "../gpio.h"
class Radio433Receiver : public QThread
class LIBGUH_EXPORT Radio433Receiver : public QThread
{
Q_OBJECT
public:

View File

@ -27,10 +27,11 @@
#include <QQueue>
#include <QDebug>
#include "libguh.h"
#include "../gpio.h"
class Radio433Trasmitter : public QThread
class LIBGUH_EXPORT Radio433Trasmitter : public QThread
{
Q_OBJECT
public:

33
libguh/libguh.h Normal file
View File

@ -0,0 +1,33 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright (C) 2016 Simon Stuerz <simon.stuerz@guh.guru> *
* *
* This file is part of guh. *
* *
* Guh is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, version 2 of the License. *
* *
* Guh is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with guh. If not, see <http://www.gnu.org/licenses/>. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef LIBGUH
#define LIBGUH
#include <QtCore/QtGlobal>
#if defined(LIBGUH_LIBRARY)
# define LIBGUH_EXPORT Q_DECL_EXPORT
#else
# define LIBGUH_EXPORT Q_DECL_IMPORT
#endif
#endif // LIBGUH

View File

@ -4,6 +4,7 @@ TARGET = guh
TEMPLATE = lib
QT += network
DEFINES += LIBGUH_LIBRARY
target.path = /usr/lib
INSTALLS += target
@ -100,6 +101,7 @@ HEADERS += devicemanager.h \
types/ruleaction.h \
types/ruleactionparam.h \
types/statedescriptor.h \
libguh.h
# install plugininfo python script for libguh-dev
generateplugininfo.files = $$top_srcdir/plugins/guh-generateplugininfo

View File

@ -21,6 +21,7 @@
#ifndef NETWORKMANAGER_H
#define NETWORKMANAGER_H
#include "libguh.h"
#include "typeutils.h"
#include <QObject>
@ -30,9 +31,7 @@
#include <QDebug>
#include <QUrl>
class NetworkManager : public QObject
class LIBGUH_EXPORT NetworkManager : public QObject
{
Q_OBJECT
public:

View File

@ -29,9 +29,11 @@
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include "libguh.h"
// OAuth 2.0 - Resource Owner Password Credentials Grant: http://tools.ietf.org/html/rfc6749#section-4.3
class OAuth2 : public QObject
class LIBGUH_EXPORT OAuth2 : public QObject
{
Q_OBJECT
public:

View File

@ -23,9 +23,10 @@
#include <QObject>
#include "libguh.h"
#include "upnpdevicedescriptor.h"
class UpnpDevice : public QObject
class LIBGUH_EXPORT UpnpDevice : public QObject
{
Q_OBJECT
public:

View File

@ -25,9 +25,11 @@
#include <QHostAddress>
#include <QUrl>
#include "libguh.h"
// reference: http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
class UpnpDeviceDescriptor
class LIBGUH_EXPORT UpnpDeviceDescriptor
{
public:
explicit UpnpDeviceDescriptor();

View File

@ -32,13 +32,14 @@
#include "upnpdiscoveryrequest.h"
#include "upnpdevicedescriptor.h"
#include "devicemanager.h"
#include "libguh.h"
// Discovering UPnP devices reference: http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
// guh basic device reference: http://upnp.org/specs/basic/UPnP-basic-Basic-v1-Device.pdf
class UpnpDiscoveryRequest;
class UpnpDiscovery : public QUdpSocket
class LIBGUH_EXPORT UpnpDiscovery : public QUdpSocket
{
Q_OBJECT
public:

View File

@ -23,13 +23,15 @@
#include <QObject>
#include <QDebug>
#include "upnpdiscovery.h"
#include "upnpdevicedescriptor.h"
#include "libguh.h"
#include "typeutils.h"
class UpnpDiscovery;
class UpnpDiscoveryRequest : public QObject
class LIBGUH_EXPORT UpnpDiscoveryRequest : public QObject
{
Q_OBJECT
public:

View File

@ -23,6 +23,7 @@
#define DEVICE_H
#include "typeutils.h"
#include "libguh.h"
#include "plugin/deviceclass.h"
#include "types/state.h"
@ -32,7 +33,7 @@
#include <QUuid>
#include <QVariant>
class Device: public QObject
class LIBGUH_EXPORT Device: public QObject
{
Q_OBJECT

View File

@ -22,6 +22,7 @@
#ifndef DEVICECLASS_H
#define DEVICECLASS_H
#include "libguh.h"
#include "typeutils.h"
#include "types/vendor.h"
#include "types/eventtype.h"
@ -32,7 +33,7 @@
#include <QList>
#include <QUuid>
class DeviceClass
class LIBGUH_EXPORT DeviceClass
{
Q_GADGET
Q_ENUMS(CreateMethod)

View File

@ -22,12 +22,13 @@
#ifndef DEVICEDESCRIPTION_H
#define DEVICEDESCRIPTION_H
#include "libguh.h"
#include <typeutils.h>
#include <types/param.h>
#include <QVariantMap>
class DeviceDescriptor
class LIBGUH_EXPORT DeviceDescriptor
{
public:
DeviceDescriptor();

View File

@ -25,7 +25,9 @@
#include "devicemanager.h"
#include "deviceclass.h"
#include "libguh.h"
#include "typeutils.h"
#include "types/event.h"
#include "types/action.h"
#include "types/vendor.h"
@ -41,7 +43,7 @@
class DeviceManager;
class Device;
class DevicePlugin: public QObject
class LIBGUH_EXPORT DevicePlugin: public QObject
{
Q_OBJECT
public:

View File

@ -22,12 +22,13 @@
#ifndef ACTION_H
#define ACTION_H
#include "libguh.h"
#include "typeutils.h"
#include "param.h"
#include <QVariantList>
class Action
class LIBGUH_EXPORT Action
{
public:
explicit Action(const ActionTypeId &actionTypeId = ActionTypeId(), const DeviceId &deviceId = DeviceId());

View File

@ -22,12 +22,13 @@
#ifndef ACTIONTYPE_H
#define ACTIONTYPE_H
#include "libguh.h"
#include "typeutils.h"
#include "paramtype.h"
#include <QVariantList>
class ActionType
class LIBGUH_EXPORT ActionType
{
public:
ActionType(const ActionTypeId &id);

View File

@ -22,6 +22,7 @@
#ifndef EVENT_H
#define EVENT_H
#include "libguh.h"
#include "typeutils.h"
#include "types/param.h"
@ -29,7 +30,7 @@
#include <QVariantList>
#include <QDebug>
class Event
class LIBGUH_EXPORT Event
{
public:
Event();

View File

@ -22,6 +22,7 @@
#ifndef EVENTDESCRIPTOR_H
#define EVENTDESCRIPTOR_H
#include "libguh.h"
#include "typeutils.h"
#include "paramdescriptor.h"
#include "event.h"
@ -30,7 +31,7 @@
#include <QVariantList>
#include <QDebug>
class EventDescriptor
class LIBGUH_EXPORT EventDescriptor
{
public:
EventDescriptor(const EventTypeId &eventTypeId, const DeviceId &deviceId, const QList<ParamDescriptor> &paramDescriptors = QList<ParamDescriptor>());
@ -51,6 +52,7 @@ private:
DeviceId m_deviceId;
QList<ParamDescriptor> m_paramDescriptors;
};
QDebug operator<<(QDebug dbg, const EventDescriptor &eventDescriptor);
QDebug operator<<(QDebug dbg, const QList<EventDescriptor> &eventDescriptors);

View File

@ -22,12 +22,13 @@
#ifndef TRIGGERTYPE_H
#define TRIGGERTYPE_H
#include "libguh.h"
#include "typeutils.h"
#include "paramtype.h"
#include <QVariantMap>
class EventType
class LIBGUH_EXPORT EventType
{
public:
EventType(const EventTypeId &id);

View File

@ -22,10 +22,12 @@
#ifndef PARAM_H
#define PARAM_H
#include "libguh.h"
#include <QString>
#include <QVariant>
class Param
class LIBGUH_EXPORT Param
{
public:
Param(const QString &name = QString(), const QVariant &value = QVariant());
@ -46,7 +48,7 @@ private:
Q_DECLARE_METATYPE(Param)
QDebug operator<<(QDebug dbg, const Param &param);
class ParamList: public QList<Param>
class LIBGUH_EXPORT ParamList: public QList<Param>
{
public:
bool hasParam(const QString &paramName) const;

View File

@ -22,10 +22,12 @@
#ifndef PARAMDESCRIPTOR_H
#define PARAMDESCRIPTOR_H
#include "libguh.h"
#include "param.h"
#include "typeutils.h"
class ParamDescriptor : public Param
class LIBGUH_EXPORT ParamDescriptor : public Param
{
public:
ParamDescriptor(const QString &name, const QVariant &value = QVariant());

View File

@ -24,9 +24,11 @@
#include <QVariant>
#include <QDebug>
#include "libguh.h"
#include "typeutils.h"
class ParamType
class LIBGUH_EXPORT ParamType
{
public:
ParamType(const QString &name, const QVariant::Type type, const QVariant &defaultValue = QVariant());

View File

@ -22,10 +22,11 @@
#ifndef RULEACTION_H
#define RULEACTION_H
#include "libguh.h"
#include "action.h"
#include "ruleactionparam.h"
class RuleAction
class LIBGUH_EXPORT RuleAction
{
public:
explicit RuleAction(const ActionTypeId &actionTypeId = ActionTypeId(), const DeviceId &deviceId = DeviceId());

View File

@ -27,9 +27,10 @@
#include <QVariant>
#include "param.h"
#include "libguh.h"
#include "typeutils.h"
class RuleActionParam
class LIBGUH_EXPORT RuleActionParam
{
public:
RuleActionParam(const Param &param);
@ -60,7 +61,7 @@ private:
Q_DECLARE_METATYPE(RuleActionParam)
QDebug operator<<(QDebug dbg, const RuleActionParam &ruleActionParam);
class RuleActionParamList: public QList<RuleActionParam>
class LIBGUH_EXPORT RuleActionParamList: public QList<RuleActionParam>
{
public:
bool hasParam(const QString &ruleActionParamName) const;

View File

@ -22,12 +22,13 @@
#ifndef STATE_H
#define STATE_H
#include "libguh.h"
#include "typeutils.h"
#include <QVariant>
#include <QDebug>
class State
class LIBGUH_EXPORT State
{
public:
State(const StateTypeId &stateTypeId, const DeviceId &deviceId);

View File

@ -22,6 +22,7 @@
#ifndef STATEDESCRIPTOR_H
#define STATEDESCRIPTOR_H
#include "libguh.h"
#include "typeutils.h"
#include "paramdescriptor.h"
#include "state.h"
@ -31,7 +32,7 @@
#include <QVariantList>
#include <QDebug>
class StateDescriptor
class LIBGUH_EXPORT StateDescriptor
{
public:
StateDescriptor();
@ -55,6 +56,7 @@ private:
QVariant m_stateValue;
Types::ValueOperator m_operatorType;
};
QDebug operator<<(QDebug dbg, const StateDescriptor &eventDescriptor);
QDebug operator<<(QDebug dbg, const QList<StateDescriptor> &eventDescriptors);

View File

@ -22,11 +22,12 @@
#ifndef STATETYPE_H
#define STATETYPE_H
#include "libguh.h"
#include "typeutils.h"
#include <QVariant>
class StateType
class LIBGUH_EXPORT StateType
{
public:
StateType(const StateTypeId &id);

View File

@ -22,11 +22,12 @@
#ifndef VENDOR_H
#define VENDOR_H
#include "libguh.h"
#include "typeutils.h"
#include <QString>
class Vendor
class LIBGUH_EXPORT Vendor
{
public:
Vendor(const VendorId &id, const QString &name = QString());

View File

@ -25,6 +25,8 @@
#include <QMetaType>
#include <QUuid>
#include "libguh.h"
#define DECLARE_TYPE_ID(type) class type##Id: public QUuid \
{ \
public: \
@ -38,7 +40,6 @@ public: \
}; \
Q_DECLARE_METATYPE(type##Id);
DECLARE_TYPE_ID(Vendor)
DECLARE_TYPE_ID(DeviceClass)
DECLARE_TYPE_ID(Device)
@ -55,7 +56,7 @@ DECLARE_TYPE_ID(Rule)
DECLARE_TYPE_ID(PairingTransaction)
class Types
class LIBGUH_EXPORT Types
{
Q_GADGET
Q_ENUMS(InputType)

View File

@ -1,4 +1,4 @@
{
{
"name": "Generic Elements",
"idName": "GenericElements",
"id": "6e22161e-39b7-4416-8623-39e730721efb",