From 4746bde4b30a5890cdedfa3276a36f32d3636b97 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 26 Sep 2023 07:40:17 -0400 Subject: [PATCH] gal as a shared lib, gaasl! --- .gitlab/Fedora-Linux-CI.yml | 1 + common/CMakeLists.txt | 13 ------ common/gal/CMakeLists.txt | 54 +++++++++++++++++++++++- common/gal/dpi_scaling.cpp | 2 + common/swig/kicad.i | 1 + include/callback_gal.h | 3 +- include/font/font.h | 5 ++- include/font/glyph.h | 11 +++-- include/font/outline_font.h | 3 +- include/font/stroke_font.h | 3 +- include/font/text_attributes.h | 5 ++- include/gal/3d/camera.h | 3 +- include/gal/cairo/cairo_gal.h | 5 ++- include/gal/dpi_scaling.h | 3 +- include/gal/gal.h | 32 ++++++++++++++ include/gal/gal_display_options.h | 12 ++++-- include/gal/gal_print.h | 6 ++- include/gal/graphics_abstraction_layer.h | 3 +- include/gal/hidpi_gl_3D_canvas.h | 3 +- include/gal/hidpi_gl_canvas.h | 3 +- include/gal/opengl/gl_context_mgr.h | 3 +- include/gal/opengl/opengl_gal.h | 3 +- include/gal/painter.h | 3 +- include/properties/property.h | 3 ++ include/view/view.h | 3 +- include/view/view_controls.h | 5 ++- include/view/view_group.h | 3 +- include/view/view_item.h | 7 ++- include/view/view_overlay.h | 3 +- include/view/zoom_controller.h | 7 +-- 30 files changed, 162 insertions(+), 49 deletions(-) create mode 100644 include/gal/gal.h diff --git a/.gitlab/Fedora-Linux-CI.yml b/.gitlab/Fedora-Linux-CI.yml index aed4146392..68417aac9d 100644 --- a/.gitlab/Fedora-Linux-CI.yml +++ b/.gitlab/Fedora-Linux-CI.yml @@ -40,6 +40,7 @@ paths: - build/linux/3d-viewer/ - build/linux/common/libkicommon.so* + - build/linux/common/gal/libgal.so* - build/linux/eeschema/_eeschema.kiface - build/linux/kicad/kicad-cli - build/linux/pcbnew/pcbnew.py diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index d191f0cce8..66b5cf6222 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -381,15 +381,6 @@ set( PLUGINS_EASYEDAPRO_SRCS plugins/easyedapro/easyedapro_import_utils.cpp ) -set( FONT_SRCS - font/font.cpp - font/glyph.cpp - font/stroke_font.cpp - font/outline_font.cpp - font/outline_decomposer.cpp - font/text_attributes.cpp - ) - set( COMMON_IMPORT_GFX_SRCS import_gfx/graphics_import_mgr.cpp import_gfx/graphics_importer.cpp @@ -511,10 +502,6 @@ set( COMMON_SRCS origin_viewitem.cpp - view/view.cpp - view/view_item.cpp - view/view_group.cpp - tool/action_manager.cpp tool/action_menu.cpp tool/action_toolbar.cpp diff --git a/common/gal/CMakeLists.txt b/common/gal/CMakeLists.txt index ee23a3c3da..0913b32559 100644 --- a/common/gal/CMakeLists.txt +++ b/common/gal/CMakeLists.txt @@ -1,4 +1,14 @@ + +set( FONT_SRCS + ../font/font.cpp + ../font/glyph.cpp + ../font/stroke_font.cpp + ../font/outline_font.cpp + ../font/outline_decomposer.cpp + ../font/text_attributes.cpp + ) + set( GAL_SRCS # Common part ../callback_gal.cpp @@ -10,9 +20,14 @@ set( GAL_SRCS hidpi_gl_canvas.cpp hidpi_gl_3D_canvas.cpp + ../view/view.cpp ../view/view_controls.cpp + ../view/view_group.cpp ../view/view_overlay.cpp ../view/zoom_controller.cpp + ../view/view_item.cpp + + ${FONT_SRCS} 3d/camera.cpp @@ -40,7 +55,7 @@ set( GAL_SRCS cairo/cairo_print.cpp ) -add_library( gal STATIC ${GAL_SRCS} ) +add_library( gal SHARED ${GAL_SRCS} ) if( WIN32 ) # we need the gdiplus library for cairo printing on windows @@ -49,7 +64,6 @@ endif() target_link_libraries( gal kicommon - common kimath kiplatform nlohmann_json @@ -63,6 +77,42 @@ target_link_libraries( gal ${HarfBuzz_LIBRARIES} ${Fontconfig_LIBRARIES} ) + +target_compile_definitions( gal PRIVATE GAL_DLL=1 ) + +install( TARGETS gal + RUNTIME DESTINATION ${KICAD_LIB} + LIBRARY DESTINATION ${KICAD_LIB} + COMPONENT binary + ) + +include( ${KICAD_CMAKE_MODULE_PATH}/KiCadVersion.cmake ) +include( ${KICAD_CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake ) +create_git_version_header(${CMAKE_SOURCE_DIR}) + +# Extract the major and minor build version as a string +string( REGEX MATCH + "([0-9]+)\\.([0-9]+)\\.([0-9]+)" + KICAD_MAJOR_MINOR_PATCH_VERSION + "${KICAD_VERSION}" + ) + +set_target_properties( gal PROPERTIES + OUTPUT_NAME gal + SOVERSION ${KICAD_MAJOR_MINOR_PATCH_VERSION} + ) + +if( APPLE ) + # puts library into the main kicad.app bundle in build tree + set_target_properties( gal PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${OSX_BUNDLE_BUILD_LIB_DIR}" + INSTALL_NAME_DIR "${OSX_BUNDLE_BUILD_LIB_DIR}" + ) + set_target_properties( gal PROPERTIES INSTALL_RPATH + "@executable_path/../Frameworks" ) + set_target_properties( gal PROPERTIES BUILD_WITH_INSTALL_RPATH 1 ) +endif() + function( add_shader outTarget inFile shaderName ) set(outCppName "${shaderName}.cpp") set(outHeaderName "${shaderName}.h") diff --git a/common/gal/dpi_scaling.cpp b/common/gal/dpi_scaling.cpp index 3a93320b1b..33ca63d8bc 100644 --- a/common/gal/dpi_scaling.cpp +++ b/common/gal/dpi_scaling.cpp @@ -23,6 +23,7 @@ #include + double DPI_SCALING::GetMaxScaleFactor() { // displays with higher than 4.0 DPI are not really going to be useful @@ -37,6 +38,7 @@ double DPI_SCALING::GetMinScaleFactor() return 1.0; } + double DPI_SCALING::GetDefaultScaleFactor() { // no scaling => 1.0 diff --git a/common/swig/kicad.i b/common/swig/kicad.i index 06c19199bd..8c947cfd7f 100644 --- a/common/swig/kicad.i +++ b/common/swig/kicad.i @@ -119,6 +119,7 @@ principle should be easily implemented by adapting the current STL containers. // TODO: wrapper of BASE_SET (see std::bitset BASE_SET;) #define KICOMMON_API +#define GAL_API // header files that must be wrapped diff --git a/include/callback_gal.h b/include/callback_gal.h index c9456c125e..142f9817ad 100644 --- a/include/callback_gal.h +++ b/include/callback_gal.h @@ -24,9 +24,10 @@ #ifndef CALLBACK_GAL_H #define CALLBACK_GAL_H +#include #include -class CALLBACK_GAL : public KIGFX::GAL +class GAL_API CALLBACK_GAL : public KIGFX::GAL { public: CALLBACK_GAL( KIGFX::GAL_DISPLAY_OPTIONS& aDisplayOptions, diff --git a/include/font/font.h b/include/font/font.h index c88f800e7d..197375ee1f 100644 --- a/include/font/font.h +++ b/include/font/font.h @@ -27,6 +27,7 @@ #ifndef FONT_H_ #define FONT_H_ +#include #include #include #include @@ -89,7 +90,7 @@ inline bool IsSubscript( TEXT_STYLE_FLAGS aFlags ) namespace KIFONT { -class METRICS +class GAL_API METRICS { public: /** @@ -126,7 +127,7 @@ public: /** * FONT is an abstract base class for both outline and stroke fonts */ -class FONT +class GAL_API FONT { public: explicit FONT(); diff --git a/include/font/glyph.h b/include/font/glyph.h index 5940bf8a59..e321b07a34 100644 --- a/include/font/glyph.h +++ b/include/font/glyph.h @@ -25,12 +25,15 @@ #ifndef GLYPH_H #define GLYPH_H +#include #include #include #include #include #include "../../libs/kimath/include/geometry/eda_angle.h" +#pragma warning( push ) +#pragma warning( disable : 4275 ) namespace KIFONT { @@ -42,7 +45,7 @@ constexpr int GLYPH_RESOLUTION = 288; constexpr double GLYPH_SIZE_SCALER = GLYPH_DEFAULT_DPI / (double) GLYPH_RESOLUTION; -class GLYPH +class GAL_API GLYPH { public: virtual ~GLYPH() @@ -55,7 +58,7 @@ public: }; -class OUTLINE_GLYPH : public GLYPH, public SHAPE_POLY_SET +class GAL_API OUTLINE_GLYPH : public GLYPH, public SHAPE_POLY_SET { public: OUTLINE_GLYPH() : @@ -80,7 +83,7 @@ public: }; -class STROKE_GLYPH : public GLYPH, public std::vector> +class GAL_API STROKE_GLYPH : public GLYPH, public std::vector> { public: STROKE_GLYPH() @@ -114,4 +117,6 @@ typedef std::vector GLYPH_BOUNDING_BOX_LIST; } // namespace KIFONT +#pragma warning( pop ) + #endif // GLYPH_H diff --git a/include/font/outline_font.h b/include/font/outline_font.h index 03b1a4a729..a077d49b2f 100644 --- a/include/font/outline_font.h +++ b/include/font/outline_font.h @@ -27,6 +27,7 @@ #ifndef OUTLINE_FONT_H_ #define OUTLINE_FONT_H_ +#include #include #ifdef _MSC_VER #include @@ -47,7 +48,7 @@ namespace KIFONT /** * Class OUTLINE_FONT implements outline font drawing. */ -class OUTLINE_FONT : public FONT +class GAL_API OUTLINE_FONT : public FONT { public: OUTLINE_FONT(); diff --git a/include/font/stroke_font.h b/include/font/stroke_font.h index 701c2eb035..4ff1e88c30 100644 --- a/include/font/stroke_font.h +++ b/include/font/stroke_font.h @@ -30,6 +30,7 @@ #ifndef STROKE_FONT_H #define STROKE_FONT_H +#include #include #include #include @@ -49,7 +50,7 @@ namespace KIFONT * * A stroke font is composed of lines. */ -class STROKE_FONT : public FONT +class GAL_API STROKE_FONT : public FONT { public: STROKE_FONT(); diff --git a/include/font/text_attributes.h b/include/font/text_attributes.h index c6dd599596..01fc66a8ac 100644 --- a/include/font/text_attributes.h +++ b/include/font/text_attributes.h @@ -24,6 +24,7 @@ #include #include #include +#include namespace KIFONT @@ -56,7 +57,7 @@ enum GR_TEXT_V_ALIGN_T #define TO_VJUSTIFY( x ) static_cast( x ) -class TEXT_ATTRIBUTES +class GAL_API TEXT_ATTRIBUTES { public: TEXT_ATTRIBUTES( KIFONT::FONT* aFont = nullptr ); @@ -87,7 +88,7 @@ public: }; -extern std::ostream& operator<<( std::ostream& aStream, const TEXT_ATTRIBUTES& aAttributes ); +extern GAL_API std::ostream& operator<<( std::ostream& aStream, const TEXT_ATTRIBUTES& aAttributes ); template<> diff --git a/include/gal/3d/camera.h b/include/gal/3d/camera.h index 3454882795..9db6001157 100644 --- a/include/gal/3d/camera.h +++ b/include/gal/3d/camera.h @@ -30,6 +30,7 @@ #ifndef CAMERA_H #define CAMERA_H +#include #include #include // for wxSize #include @@ -74,7 +75,7 @@ enum class CAMERA_INTERPOLATION * * It must be derived by other classes to implement a real camera object. */ -class CAMERA +class GAL_API CAMERA { public: static const float DEFAULT_MIN_ZOOM; diff --git a/include/gal/cairo/cairo_gal.h b/include/gal/cairo/cairo_gal.h index 2497def852..4e8ef33906 100644 --- a/include/gal/cairo/cairo_gal.h +++ b/include/gal/cairo/cairo_gal.h @@ -34,6 +34,7 @@ #include +#include #include #include @@ -54,7 +55,7 @@ namespace KIGFX { class CAIRO_COMPOSITOR; -class CAIRO_GAL_BASE : public GAL +class GAL_API CAIRO_GAL_BASE : public GAL { public: CAIRO_GAL_BASE( GAL_DISPLAY_OPTIONS& aDisplayOptions ); @@ -372,7 +373,7 @@ protected: }; -class CAIRO_GAL : public CAIRO_GAL_BASE, public wxWindow +class GAL_API CAIRO_GAL : public CAIRO_GAL_BASE, public wxWindow { public: /** diff --git a/include/gal/dpi_scaling.h b/include/gal/dpi_scaling.h index 7ce7dd757d..0228f39b3b 100644 --- a/include/gal/dpi_scaling.h +++ b/include/gal/dpi_scaling.h @@ -24,6 +24,7 @@ #ifndef DPI_SCALING__H #define DPI_SCALING__H +#include #include /** @@ -31,7 +32,7 @@ * scale to use for canvases. This has several sources and the availability of * some of them are platform dependent. */ -class DPI_SCALING +class GAL_API DPI_SCALING { public: /** diff --git a/include/gal/gal.h b/include/gal/gal.h new file mode 100644 index 0000000000..8c8ab7e101 --- /dev/null +++ b/include/gal/gal.h @@ -0,0 +1,32 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program 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, either version 3 of the License, or (at your + * option) any later version. + * + * This program 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 this program. If not, see . + */ + +#pragma once + +#include + +#ifndef SWIG + #if defined( GAL_DLL ) + #define GAL_API APIEXPORT + #else + #define GAL_API APIIMPORT + #endif +#else +#define GAL_API +#endif \ No newline at end of file diff --git a/include/gal/gal_display_options.h b/include/gal/gal_display_options.h index 9ad33758fc..54f9401445 100644 --- a/include/gal/gal_display_options.h +++ b/include/gal/gal_display_options.h @@ -24,6 +24,7 @@ #ifndef GAL_DISPLAY_OPTIONS_H__ #define GAL_DISPLAY_OPTIONS_H__ +#include #include #include @@ -32,6 +33,8 @@ struct WINDOW_SETTINGS; class wxString; class wxWindow; +#pragma warning( push ) +#pragma warning( disable : 4275 ) namespace KIGFX { @@ -68,7 +71,7 @@ namespace KIGFX class GAL_DISPLAY_OPTIONS; - class GAL_DISPLAY_OPTIONS_OBSERVER + class GAL_API GAL_DISPLAY_OPTIONS_OBSERVER { public: virtual void OnGalDisplayOptionsChanged( const GAL_DISPLAY_OPTIONS& ) = 0; @@ -77,7 +80,7 @@ namespace KIGFX virtual ~GAL_DISPLAY_OPTIONS_OBSERVER() {} }; - class GAL_DISPLAY_OPTIONS : public UTIL::OBSERVABLE + class GAL_API GAL_DISPLAY_OPTIONS : public UTIL::OBSERVABLE { public: GAL_DISPLAY_OPTIONS(); @@ -112,7 +115,10 @@ namespace KIGFX void NotifyChanged(); }; -} + +} // namespace KIGFX + +#pragma warning( pop ) #endif diff --git a/include/gal/gal_print.h b/include/gal/gal_print.h index 5bc7df7dd6..157f0b46c9 100644 --- a/include/gal/gal_print.h +++ b/include/gal/gal_print.h @@ -19,6 +19,8 @@ #ifndef GAL_PRINT_H #define GAL_PRINT_H +#include + class wxDC; namespace KIGFX { @@ -26,7 +28,7 @@ class GAL; class GAL_DISPLAY_OPTIONS; -class PRINT_CONTEXT +class GAL_API PRINT_CONTEXT { public: virtual ~PRINT_CONTEXT() {} @@ -38,7 +40,7 @@ public: /** * @brief Wrapper around GAL to provide information needed for printing. */ -class GAL_PRINT +class GAL_API GAL_PRINT { public: static std::unique_ptr Create( GAL_DISPLAY_OPTIONS& aOptions, wxDC* aDC ); diff --git a/include/gal/graphics_abstraction_layer.h b/include/gal/graphics_abstraction_layer.h index 444ecd60b9..e340dd029d 100644 --- a/include/gal/graphics_abstraction_layer.h +++ b/include/gal/graphics_abstraction_layer.h @@ -33,6 +33,7 @@ #include +#include #include #include #include @@ -56,7 +57,7 @@ namespace KIGFX * this layer. So zooming is handled here as well. * */ -class GAL : GAL_DISPLAY_OPTIONS_OBSERVER +class GAL_API GAL : GAL_DISPLAY_OPTIONS_OBSERVER { // These friend declarations allow us to hide routines that should not be called. The // corresponding RAII objects must be used instead. diff --git a/include/gal/hidpi_gl_3D_canvas.h b/include/gal/hidpi_gl_3D_canvas.h index 948dd67b01..fa6b78aab7 100644 --- a/include/gal/hidpi_gl_3D_canvas.h +++ b/include/gal/hidpi_gl_3D_canvas.h @@ -25,6 +25,7 @@ #ifndef HIDPI_GL_3D_CANVAS_H #define HIDPI_GL_3D_CANVAS_H +#include #include #include #include @@ -35,7 +36,7 @@ * Provides basic 3D controls ( zoom, rotate, translate, ... ) * */ -class HIDPI_GL_3D_CANVAS : public HIDPI_GL_CANVAS +class GAL_API HIDPI_GL_3D_CANVAS : public HIDPI_GL_CANVAS { public: // wxGLCanvas constructor diff --git a/include/gal/hidpi_gl_canvas.h b/include/gal/hidpi_gl_canvas.h index df5205389c..6c0e5a540d 100644 --- a/include/gal/hidpi_gl_canvas.h +++ b/include/gal/hidpi_gl_canvas.h @@ -29,6 +29,7 @@ #include #include +#include /** @@ -36,7 +37,7 @@ * * This is a small wrapper class to enable HiDPI/Retina support for wxGLCanvas. */ -class HIDPI_GL_CANVAS : public wxGLCanvas +class GAL_API HIDPI_GL_CANVAS : public wxGLCanvas { public: // wxGLCanvas constructor diff --git a/include/gal/opengl/gl_context_mgr.h b/include/gal/opengl/gl_context_mgr.h index 777398b6f3..d9e732b56e 100644 --- a/include/gal/opengl/gl_context_mgr.h +++ b/include/gal/opengl/gl_context_mgr.h @@ -27,11 +27,12 @@ #ifndef GL_CONTEXT_MANAGER_H #define GL_CONTEXT_MANAGER_H +#include #include #include #include -class GL_CONTEXT_MANAGER +class GAL_API GL_CONTEXT_MANAGER { public: /** diff --git a/include/gal/opengl/opengl_gal.h b/include/gal/opengl/opengl_gal.h index e3ceab22d4..3857e64d5f 100644 --- a/include/gal/opengl/opengl_gal.h +++ b/include/gal/opengl/opengl_gal.h @@ -30,6 +30,7 @@ #define OPENGLGAL_H_ // GAL imports +#include #include #include #include @@ -66,7 +67,7 @@ class GL_BITMAP_CACHE; * and quads. The purpose is to provide a fast graphics interface, that takes advantage of modern * graphics card GPUs. All methods here benefit thus from the hardware acceleration. */ -class OPENGL_GAL : public GAL, public HIDPI_GL_CANVAS +class GAL_API OPENGL_GAL : public GAL, public HIDPI_GL_CANVAS { public: /** diff --git a/include/gal/painter.h b/include/gal/painter.h index dc9fa28e75..bcb2a01899 100644 --- a/include/gal/painter.h +++ b/include/gal/painter.h @@ -34,6 +34,7 @@ #include +#include #include #include #include @@ -54,7 +55,7 @@ class VIEW_ITEM; * of the objects as simple container objects in DLL/DSOs. PAINTER is an abstract layer * because every module (pcbnew, eeschema, etc.) has to draw different kinds of objects. */ -class PAINTER +class GAL_API PAINTER { public: /** diff --git a/include/properties/property.h b/include/properties/property.h index 2251ee3aac..ff055bfc47 100644 --- a/include/properties/property.h +++ b/include/properties/property.h @@ -121,6 +121,8 @@ private: FuncType m_func; }; +#pragma warning( push ) +#pragma warning( disable : 5266 ) // 'const' qualifier on return type has no effect template class METHOD @@ -174,6 +176,7 @@ public: METHOD() = delete; }; +#pragma warning( pop ) class PROPERTY_BASE { diff --git a/include/view/view.h b/include/view/view.h index d27a1288ae..a035434b77 100644 --- a/include/view/view.h +++ b/include/view/view.h @@ -27,6 +27,7 @@ #ifndef __VIEW_H #define __VIEW_H +#include #include #include #include @@ -63,7 +64,7 @@ class VIEW_RTREE; * final stage by the GAL. The VIEW class also provides fast methods for finding all visible * objects that are within a given rectangular area, useful for object selection/hit testing. */ -class VIEW +class GAL_API VIEW { public: friend class VIEW_ITEM; diff --git a/include/view/view_controls.h b/include/view/view_controls.h index 61af3826e0..1c6adbe830 100644 --- a/include/view/view_controls.h +++ b/include/view/view_controls.h @@ -31,6 +31,7 @@ #include #include +#include namespace KIGFX { @@ -38,7 +39,7 @@ class VIEW; ///< Structure to keep VIEW_CONTROLS settings for easy store/restore operations -struct VC_SETTINGS +struct GAL_API VC_SETTINGS { VC_SETTINGS() { @@ -130,7 +131,7 @@ struct VC_SETTINGS * An interface for classes handling user events controlling the view behavior such as * zooming, panning, mouse grab, etc. */ -class VIEW_CONTROLS +class GAL_API VIEW_CONTROLS { public: VIEW_CONTROLS( VIEW* aView ) : diff --git a/include/view/view_group.h b/include/view/view_group.h index af75b5abcf..374f0f82fa 100644 --- a/include/view/view_group.h +++ b/include/view/view_group.h @@ -32,6 +32,7 @@ #ifndef VIEW_GROUP_H_ #define VIEW_GROUP_H_ +#include #include #include @@ -43,7 +44,7 @@ namespace KIGFX * VIEW_GROUP does not take over ownership of the held items. The main purpose of this class is * to group items and draw them on a single layer (in particular the overlay). */ -class VIEW_GROUP : public VIEW_ITEM +class GAL_API VIEW_GROUP : public VIEW_ITEM { public: VIEW_GROUP( VIEW* aView = nullptr ); diff --git a/include/view/view_item.h b/include/view/view_item.h index 4e7f6b8624..ebbc442931 100644 --- a/include/view/view_item.h +++ b/include/view/view_item.h @@ -27,11 +27,14 @@ #ifndef __VIEW_ITEM_H #define __VIEW_ITEM_H +#include #include #include #include #include +#pragma warning( push ) +#pragma warning( disable : 4275 ) namespace KIGFX { @@ -73,7 +76,7 @@ enum VIEW_VISIBILITY_FLAGS { * VIEW_ITEM objects are never owned by a #VIEW. A single VIEW_ITEM can belong to any number of * static VIEWs, but only one dynamic VIEW due to storage of only one VIEW reference. */ -class VIEW_ITEM : public INSPECTABLE +class GAL_API VIEW_ITEM : public INSPECTABLE { public: VIEW_ITEM() : @@ -161,4 +164,6 @@ private: } // namespace KIGFX +#pragma warning( pop ) + #endif diff --git a/include/view/view_overlay.h b/include/view/view_overlay.h index b5633e48ba..55c09bacd9 100644 --- a/include/view/view_overlay.h +++ b/include/view/view_overlay.h @@ -27,6 +27,7 @@ #ifndef __VIEW_OVERLAY_H #define __VIEW_OVERLAY_H +#include #include #include @@ -40,7 +41,7 @@ namespace KIGFX { class VIEW; -class VIEW_OVERLAY : public VIEW_ITEM +class GAL_API VIEW_OVERLAY : public VIEW_ITEM { public: diff --git a/include/view/zoom_controller.h b/include/view/zoom_controller.h index ab479bbe63..6df2c8e94b 100644 --- a/include/view/zoom_controller.h +++ b/include/view/zoom_controller.h @@ -30,6 +30,7 @@ #ifndef __ZOOM_CONTROLLER_H #define __ZOOM_CONTROLLER_H +#include #include #include @@ -39,7 +40,7 @@ namespace KIGFX /** * Handle the response of the zoom scale to external inputs. */ -class ZOOM_CONTROLLER +class GAL_API ZOOM_CONTROLLER { public: virtual ~ZOOM_CONTROLLER() = default; @@ -58,7 +59,7 @@ public: /** * Class that zooms faster if scroll events happen very close together. */ -class ACCELERATING_ZOOM_CONTROLLER : public ZOOM_CONTROLLER +class GAL_API ACCELERATING_ZOOM_CONTROLLER : public ZOOM_CONTROLLER { public: ///< The type of the acceleration timeout. @@ -138,7 +139,7 @@ private: * A CONSTANT_ZOOM_CONTROLLER that zooms by a fixed factor based only on the magnitude of the scroll * wheel rotation. */ -class CONSTANT_ZOOM_CONTROLLER : public ZOOM_CONTROLLER +class GAL_API CONSTANT_ZOOM_CONTROLLER : public ZOOM_CONTROLLER { public: /**