NOISSUE make shared logic library ... shared

This commit is contained in:
Petr Mrázek
2015-09-05 18:46:57 +02:00
parent cd108fd029
commit 23d0bd8edd
76 changed files with 259 additions and 116 deletions

View File

@ -4,7 +4,9 @@
#include "ResourceHandler.h"
class IconResourceHandler : public ResourceHandler
#include "multimc_logic_export.h"
class MULTIMC_LOGIC_EXPORT IconResourceHandler : public ResourceHandler
{
public:
explicit IconResourceHandler(const QString &key);

View File

@ -9,6 +9,8 @@
#include "ResourceObserver.h"
#include "TypeMagic.h"
#include "multimc_logic_export.h"
class ResourceHandler;
/** Frontend class for resources
@ -27,7 +29,7 @@ class ResourceHandler;
*
* @note Always pass resource around using Resource::Ptr! Copy and move constructors are disabled for a reason.
*/
class Resource : public std::enable_shared_from_this<Resource>
class MULTIMC_LOGIC_EXPORT Resource : public std::enable_shared_from_this<Resource>
{
// only allow creation from Resource::create and disallow passing around non-pointers
explicit Resource(const QString &resource);

View File

@ -3,6 +3,8 @@
#include <QVariant>
#include <memory>
#include "multimc_logic_export.h"
class Resource;
/** Base class for things that can retrieve a resource.
@ -11,7 +13,7 @@ class Resource;
* call Resource::registerHandler<MyResourceHandler>("<id>"), where <id> is the
* prefix of the resource ("web", "icon", etc.)
*/
class ResourceHandler
class MULTIMC_LOGIC_EXPORT ResourceHandler
{
public:
virtual ~ResourceHandler() {}

View File

@ -5,12 +5,13 @@
#include <QObject>
#include <QMetaProperty>
#include "multimc_logic_export.h"
class QVariant;
class Resource;
/// Base class for things that can use a resource
class ResourceObserver
class MULTIMC_LOGIC_EXPORT ResourceObserver
{
public:
virtual ~ResourceObserver();
@ -39,7 +40,7 @@ private:
*
* If no name is given an attempt to find a default property for some common classes is done.
*/
class QObjectResourceObserver : public QObject, public ResourceObserver
class MULTIMC_LOGIC_EXPORT QObjectResourceObserver : public QObject, public ResourceObserver
{
public:
explicit QObjectResourceObserver(QObject *target, const char *property = nullptr);
@ -57,7 +58,7 @@ private:
* * We need Func in order to std::forward the function
*/
template <typename Ret, typename Arg, typename Func>
class FunctionResourceObserver : public ResourceObserver
class MULTIMC_LOGIC_EXPORT FunctionResourceObserver : public ResourceObserver
{
std::function<Ret(Arg)> m_function;
public: