diff --git a/src/libcalamares/DllMacro.h b/src/libcalamares/DllMacro.h index 9bb789c94..712bf5732 100644 --- a/src/libcalamares/DllMacro.h +++ b/src/libcalamares/DllMacro.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Teo Mrnjavac + * Copyright 2020, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,8 +23,8 @@ #include /* - * Mark symbols exported from Calamares libraries with DLLEXPORT. - * These are the public API of the libraries. + * Mark symbols exported from Calamares non-GUI library with DLLEXPORT. + * These are the public API of libcalamares. */ #ifndef DLLEXPORT #if defined( DLLEXPORT_PRO ) @@ -33,6 +34,18 @@ #endif #endif +/* + * Mark symbols exported from Calamares GUI library with DLLEXPORT. + * These are the public API of libcalamaresui. + */ +#ifndef UIDLLEXPORT +#if defined( UIDLLEXPORT_PRO ) +#define UIDLLEXPORT Q_DECL_EXPORT +#else +#define UIDLLEXPORT Q_DECL_IMPORT +#endif +#endif + /* * Mark symbols exported from Calamares C++ plugins with PLUGINDLLEXPORT. * These are the public API of the libraries (generally, the plugin diff --git a/src/libcalamaresui/Branding.h b/src/libcalamaresui/Branding.h index 4c051981c..f1b26fbb5 100644 --- a/src/libcalamaresui/Branding.h +++ b/src/libcalamaresui/Branding.h @@ -40,7 +40,7 @@ namespace Calamares class GlobalStorage; -class DLLEXPORT Branding : public QObject +class UIDLLEXPORT Branding : public QObject { Q_OBJECT public: diff --git a/src/libcalamaresui/CMakeLists.txt b/src/libcalamaresui/CMakeLists.txt index 9f87ed009..c603ca22d 100644 --- a/src/libcalamaresui/CMakeLists.txt +++ b/src/libcalamaresui/CMakeLists.txt @@ -66,7 +66,7 @@ endif() calamares_add_library( calamaresui SOURCES ${calamaresui_SOURCES} - EXPORT_MACRO DLLEXPORT_PRO + EXPORT_MACRO UIDLLEXPORT_PRO LINK_PRIVATE_LIBRARIES ${OPTIONAL_PYTHON_LIBRARIES} LINK_LIBRARIES diff --git a/src/libcalamaresui/ViewManager.h b/src/libcalamaresui/ViewManager.h index 50838f780..42fb9ad8f 100644 --- a/src/libcalamaresui/ViewManager.h +++ b/src/libcalamaresui/ViewManager.h @@ -33,7 +33,7 @@ namespace Calamares * @brief The ViewManager class handles progression through view pages. * @note Singleton object, only use through ViewManager::instance(). */ -class DLLEXPORT ViewManager : public QObject +class UIDLLEXPORT ViewManager : public QObject { Q_OBJECT public: diff --git a/src/libcalamaresui/modulesystem/CppJobModule.h b/src/libcalamaresui/modulesystem/CppJobModule.h index 758b44459..d97443a8a 100644 --- a/src/libcalamaresui/modulesystem/CppJobModule.h +++ b/src/libcalamaresui/modulesystem/CppJobModule.h @@ -29,7 +29,7 @@ class QPluginLoader; namespace Calamares { -class DLLEXPORT CppJobModule : public Module +class UIDLLEXPORT CppJobModule : public Module { public: Type type() const override; diff --git a/src/libcalamaresui/modulesystem/Module.h b/src/libcalamaresui/modulesystem/Module.h index 4ebbdf2a2..0891f8a25 100644 --- a/src/libcalamaresui/modulesystem/Module.h +++ b/src/libcalamaresui/modulesystem/Module.h @@ -40,7 +40,7 @@ namespace Calamares * takes care of creating an object of the correct type starting from a module * descriptor structure. */ -class DLLEXPORT Module +class UIDLLEXPORT Module { public: /** diff --git a/src/libcalamaresui/modulesystem/ProcessJobModule.h b/src/libcalamaresui/modulesystem/ProcessJobModule.h index 31e3b1219..da2badbd0 100644 --- a/src/libcalamaresui/modulesystem/ProcessJobModule.h +++ b/src/libcalamaresui/modulesystem/ProcessJobModule.h @@ -29,7 +29,7 @@ namespace Calamares { -class DLLEXPORT ProcessJobModule : public Module +class UIDLLEXPORT ProcessJobModule : public Module { public: Type type() const override; diff --git a/src/libcalamaresui/modulesystem/PythonJobModule.h b/src/libcalamaresui/modulesystem/PythonJobModule.h index 1d70b5f6c..295ab5942 100644 --- a/src/libcalamaresui/modulesystem/PythonJobModule.h +++ b/src/libcalamaresui/modulesystem/PythonJobModule.h @@ -26,7 +26,7 @@ namespace Calamares { -class DLLEXPORT PythonJobModule : public Module +class UIDLLEXPORT PythonJobModule : public Module { public: Type type() const override; diff --git a/src/libcalamaresui/modulesystem/PythonQtViewModule.h b/src/libcalamaresui/modulesystem/PythonQtViewModule.h index eeee69a78..33b8d041b 100644 --- a/src/libcalamaresui/modulesystem/PythonQtViewModule.h +++ b/src/libcalamaresui/modulesystem/PythonQtViewModule.h @@ -27,7 +27,7 @@ namespace Calamares class ViewStep; -class DLLEXPORT PythonQtViewModule : public Module +class UIDLLEXPORT PythonQtViewModule : public Module { public: Type type() const override; diff --git a/src/libcalamaresui/modulesystem/ViewModule.h b/src/libcalamaresui/modulesystem/ViewModule.h index dfe9bed92..c1ee8ff69 100644 --- a/src/libcalamaresui/modulesystem/ViewModule.h +++ b/src/libcalamaresui/modulesystem/ViewModule.h @@ -30,7 +30,7 @@ namespace Calamares class ViewStep; -class DLLEXPORT ViewModule : public Module +class UIDLLEXPORT ViewModule : public Module { public: Type type() const override; diff --git a/src/libcalamaresui/utils/CalamaresUtilsGui.h b/src/libcalamaresui/utils/CalamaresUtilsGui.h index 884e603e3..961ed5bc7 100644 --- a/src/libcalamaresui/utils/CalamaresUtilsGui.h +++ b/src/libcalamaresui/utils/CalamaresUtilsGui.h @@ -83,7 +83,7 @@ enum ImageMode * @param size the target pixmap size (default: original SVG size). * @return the new pixmap. */ -DLLEXPORT QPixmap defaultPixmap( ImageType type, +UIDLLEXPORT QPixmap defaultPixmap( ImageType type, ImageMode mode = CalamaresUtils::Original, const QSize& size = QSize( 0, 0 ) ); @@ -95,27 +95,27 @@ DLLEXPORT QPixmap defaultPixmap( ImageType type, * @return the transformed pixmap. * This one is currently unused. */ -DLLEXPORT QPixmap createRoundedImage( const QPixmap& avatar, const QSize& size, float frameWidthPct = 0.20f ); +UIDLLEXPORT QPixmap createRoundedImage( const QPixmap& avatar, const QSize& size, float frameWidthPct = 0.20f ); /** * @brief unmarginLayout recursively walks the QLayout tree and removes all margins. * @param layout the layout to unmargin. */ -DLLEXPORT void unmarginLayout( QLayout* layout ); +UIDLLEXPORT void unmarginLayout( QLayout* layout ); /** * @brief clearLayout recursively walks the QLayout tree and deletes all the child * widgets and layouts. * @param layout the layout to clear. */ -DLLEXPORT void clearLayout( QLayout* layout ); +UIDLLEXPORT void clearLayout( QLayout* layout ); -DLLEXPORT void setDefaultFontSize( int points ); -DLLEXPORT int defaultFontSize(); // in points -DLLEXPORT int defaultFontHeight(); // in pixels, DPI-specific -DLLEXPORT QFont defaultFont(); -DLLEXPORT QFont largeFont(); -DLLEXPORT QSize defaultIconSize(); +UIDLLEXPORT void setDefaultFontSize( int points ); +UIDLLEXPORT int defaultFontSize(); // in points +UIDLLEXPORT int defaultFontHeight(); // in pixels, DPI-specific +UIDLLEXPORT QFont defaultFont(); +UIDLLEXPORT QFont largeFont(); +UIDLLEXPORT QSize defaultIconSize(); /** * @brief Size constants for the main Calamares window. diff --git a/src/libcalamaresui/utils/ImageRegistry.h b/src/libcalamaresui/utils/ImageRegistry.h index a7d04fa9a..f73ee36e6 100644 --- a/src/libcalamaresui/utils/ImageRegistry.h +++ b/src/libcalamaresui/utils/ImageRegistry.h @@ -31,7 +31,7 @@ #include "DllMacro.h" #include "utils/CalamaresUtilsGui.h" -class DLLEXPORT ImageRegistry +class UIDLLEXPORT ImageRegistry { public: static ImageRegistry* instance(); diff --git a/src/libcalamaresui/utils/Qml.h b/src/libcalamaresui/utils/Qml.h index 70f59e7ec..7371bbc3a 100644 --- a/src/libcalamaresui/utils/Qml.h +++ b/src/libcalamaresui/utils/Qml.h @@ -34,7 +34,7 @@ namespace CalamaresUtils * * If there is a return value from the QML method, it is logged (but not otherwise used). */ -DLLEXPORT void +UIDLLEXPORT void callQMLFunction( QQuickItem* qmlObject, const char* method ); } // namespace CalamaresUtils diff --git a/src/libcalamaresui/viewpages/ViewStep.h b/src/libcalamaresui/viewpages/ViewStep.h index 55b2e200a..bdc235476 100644 --- a/src/libcalamaresui/viewpages/ViewStep.h +++ b/src/libcalamaresui/viewpages/ViewStep.h @@ -45,7 +45,7 @@ namespace Calamares * (which shows all of the things which have been collected to be done in the * next exec-step) through prettyStatus() and createSummaryWidget(). */ -class DLLEXPORT ViewStep : public QObject +class UIDLLEXPORT ViewStep : public QObject { Q_OBJECT public: