From 18315df632777f88ff6a4df4fee04dbc95ab16cd Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 29 Oct 2023 16:51:26 +0100 Subject: [PATCH 01/12] fix warning extra comma (cherry picked from commit 83448dce771b58c5cee27c5be92e47ec650f379e) --- vstgui/lib/vstguibase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vstgui/lib/vstguibase.h b/vstgui/lib/vstguibase.h index cc2b659c6..8b42e7586 100644 --- a/vstgui/lib/vstguibase.h +++ b/vstgui/lib/vstguibase.h @@ -259,7 +259,7 @@ class ReferenceCounted : virtual public IReference ReferenceCounted () = default; virtual ~ReferenceCounted () noexcept = default; - ReferenceCounted (const ReferenceCounted&) {}; + ReferenceCounted (const ReferenceCounted&) {} ReferenceCounted& operator= (const ReferenceCounted&) { return *this; } //----------------------------------------------------------------------------- @@ -290,7 +290,7 @@ class CBaseObject : public NonAtomicReferenceCounted CBaseObject () = default; ~CBaseObject () noexcept override = default; - CBaseObject (const CBaseObject&) {}; + CBaseObject (const CBaseObject&) {} CBaseObject& operator= (const CBaseObject&) { return *this; } //----------------------------------------------------------------------------- From b0ef4f9221926fd4b84c730415169e5034f03d5f Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 29 Oct 2023 16:52:18 +0100 Subject: [PATCH 02/12] fix: zero as null pointer constant (cherry picked from commit 3ffce12c212de062fcc554517b710bb8bb971cf0) --- vstgui/lib/vstguibase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vstgui/lib/vstguibase.h b/vstgui/lib/vstguibase.h index 8b42e7586..bbe96f95b 100644 --- a/vstgui/lib/vstguibase.h +++ b/vstgui/lib/vstguibase.h @@ -203,7 +203,7 @@ //---------------------------------------------------- #define CLASS_METHODS(name, parent) CBaseObject* newCopy () const override { return new name (*this); } -#define CLASS_METHODS_NOCOPY(name, parent) CBaseObject* newCopy () const override { return 0; } +#define CLASS_METHODS_NOCOPY(name, parent) CBaseObject* newCopy () const override { return nullptr; } #define CLASS_METHODS_VIRTUAL(name, parent) CBaseObject* newCopy () const override = 0; //---------------------------------------------------- @@ -401,7 +401,7 @@ inline SharedPointer::SharedPointer (const SharedPointer& other) noexcept //------------------------------------------------------------------------ template inline SharedPointer::SharedPointer () noexcept -: ptr (0) +: ptr (nullptr) {} //------------------------------------------------------------------------ From 8eab23e4a0a7b96fcb2c40081ad3fe99921fe402 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 29 Oct 2023 17:01:42 +0100 Subject: [PATCH 03/12] fix doc (cherry picked from commit 398cb448725b98c7d91d3a5c9f1ea329481ce1b3) --- vstgui/lib/cbitmap.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vstgui/lib/cbitmap.h b/vstgui/lib/cbitmap.h index 4734f0ff5..e2568eaaf 100644 --- a/vstgui/lib/cbitmap.h +++ b/vstgui/lib/cbitmap.h @@ -107,9 +107,7 @@ class CMultiFrameBitmap : public CBitmap /** set the multi frame description * - * @param frameSize size of one frame - * @param frameCount number of total frames - * @param framesPerRow number of frames per row + * @param desc the multi frame description * @return true if bitmap is big enough for the description */ bool setMultiFrameDesc (CMultiFrameBitmapDescription desc); From e86dc0e8283054d810ec4a23ce44e645ac81cbe3 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 29 Oct 2023 17:02:06 +0100 Subject: [PATCH 04/12] a CFrame object cannot be copied (cherry picked from commit c58618d3f49f8cdec88f5193da156fdcb53a0835) --- vstgui/lib/cframe.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vstgui/lib/cframe.h b/vstgui/lib/cframe.h index b946cb301..373f23682 100644 --- a/vstgui/lib/cframe.h +++ b/vstgui/lib/cframe.h @@ -231,13 +231,15 @@ class CFrame final : public CViewContainer, public IPlatformFrameCallback void dumpHierarchy () override; #endif - CLASS_METHODS(CFrame, CViewContainer) + CLASS_METHODS_NOCOPY(CFrame, CViewContainer) //------------------------------------------- protected: struct CollectInvalidRects; + CFrame (const CFrame&) = delete; ~CFrame () noexcept override = default; + void beforeDelete () override; void checkMouseViews (const MouseEvent& event); From ba8bcfd4cec6502a034087ef0e303d7dae2ab67e Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 29 Oct 2023 17:25:52 +0100 Subject: [PATCH 05/12] fix const use (cherry picked from commit f8bb9ba4dbf549f8e523311673e2ff04bc14074b) --- vstgui/lib/animation/animator.h | 2 +- vstgui/lib/cstring.h | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/vstgui/lib/animation/animator.h b/vstgui/lib/animation/animator.h index 4aaba439b..d789d49eb 100644 --- a/vstgui/lib/animation/animator.h +++ b/vstgui/lib/animation/animator.h @@ -80,7 +80,7 @@ class FinishedMessage : public CBaseObject FinishedMessage (CView* view, const std::string& name, IAnimationTarget* target) : view (view), name (name), target (target) {} CView* getView () const { return view; } - const IdStringPtr getName () const { return name.c_str (); } + IdStringPtr getName () const { return name.c_str (); } IAnimationTarget* getTarget () const { return target; } CLASS_METHODS_NOCOPY(FinishedMessage, CBaseObject) diff --git a/vstgui/lib/cstring.h b/vstgui/lib/cstring.h index d3e0fb0f1..7c1236dd5 100644 --- a/vstgui/lib/cstring.h +++ b/vstgui/lib/cstring.h @@ -102,7 +102,7 @@ class UTF8String void assign (UTF8StringPtr str); void clear () noexcept; - const UTF8StringPtr data () const noexcept { return string.data (); } + UTF8StringPtr data () const noexcept { return string.data (); } operator const UTF8StringPtr () const noexcept { return data (); } const StringType& getString () const noexcept { return string; } IPlatformString* getPlatformString () const noexcept; @@ -233,7 +233,7 @@ class UTF8CharacterIterator { public: UTF8CharacterIterator (const UTF8StringPtr utf8Str) - : startPos ((uint8_t*)utf8Str) + : startPos ((const uint8_t*)utf8Str) , currentPos (nullptr) , strLen (std::strlen (utf8Str)) { @@ -241,7 +241,7 @@ class UTF8CharacterIterator } UTF8CharacterIterator (const UTF8StringPtr utf8Str, size_t strLen) - : startPos ((uint8_t*)utf8Str) + : startPos ((const uint8_t*)utf8Str) , currentPos (nullptr) , strLen (strLen) { @@ -249,14 +249,14 @@ class UTF8CharacterIterator } UTF8CharacterIterator (const std::string& stdStr) - : startPos ((uint8_t*)stdStr.c_str ()) + : startPos ((const uint8_t*)stdStr.data ()) , currentPos (nullptr) , strLen (stdStr.size ()) { begin (); } - uint8_t* next () + const uint8_t* next () { if (currentPos) { @@ -276,7 +276,7 @@ class UTF8CharacterIterator return currentPos; } - uint8_t* previous () + const uint8_t* previous () { while (currentPos) { @@ -319,8 +319,8 @@ class UTF8CharacterIterator return 0; } - uint8_t* begin () { currentPos = startPos; return currentPos;} - uint8_t* end () { currentPos = startPos + strLen; return currentPos; } + const uint8_t* begin () { currentPos = startPos; return currentPos;} + const uint8_t* end () { currentPos = startPos + strLen; return currentPos; } const uint8_t* front () const { return startPos; } const uint8_t* back () const { return startPos + strLen; } @@ -328,11 +328,11 @@ class UTF8CharacterIterator const uint8_t* operator++() { return next (); } const uint8_t* operator--() { return previous (); } bool operator==(uint8_t i) { if (currentPos) return *currentPos == i; return false; } - operator uint8_t* () const { return (uint8_t*)currentPos; } + operator const uint8_t* () const { return currentPos; } protected: - uint8_t* startPos; - uint8_t* currentPos; + const uint8_t* startPos; + const uint8_t* currentPos; size_t strLen; }; From 5a312a8d8f657ebc1c381e1e651b9cffdb030c1b Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 29 Oct 2023 17:28:32 +0100 Subject: [PATCH 06/12] fix some deprecations (cherry picked from commit 5ff861c380e2af4f45456748f9aac88e2dbb52a3) --- vstgui/lib/cdrawdefs.h | 4 ++-- vstgui/lib/controls/cbuttons.h | 4 ++-- vstgui/lib/cresourcedescription.h | 3 ++- vstgui/lib/events.h | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/vstgui/lib/cdrawdefs.h b/vstgui/lib/cdrawdefs.h index c6f9fc738..4bdb11b9e 100644 --- a/vstgui/lib/cdrawdefs.h +++ b/vstgui/lib/cdrawdefs.h @@ -28,8 +28,8 @@ struct CDrawMode { public: constexpr CDrawMode (uint32_t mode = kAliasing) : mode (mode) {} - constexpr CDrawMode (const CDrawMode& m) : mode (m.mode) {} - + constexpr CDrawMode (const CDrawMode& m) = default; + constexpr CDrawMode& operator= (const CDrawMode& m) = default; constexpr uint32_t modeIgnoringIntegralMode () const { return (mode & ~kNonIntegralMode); } constexpr bool integralMode () const { return !hasBit (mode, kNonIntegralMode); } diff --git a/vstgui/lib/controls/cbuttons.h b/vstgui/lib/controls/cbuttons.h index 393b3e777..867e81b75 100644 --- a/vstgui/lib/controls/cbuttons.h +++ b/vstgui/lib/controls/cbuttons.h @@ -249,8 +249,8 @@ class CTextButton : public CControl CMouseEventResult onMouseMoved (CPoint& where, const CButtonState& buttons) override; CMouseEventResult onMouseCancel () override; void onKeyboardEvent (KeyboardEvent& event) override; - - CLASS_METHODS(CTextButton, CControl) + + CLASS_METHODS_NOCOPY (CTextButton, CControl) protected: ~CTextButton () noexcept override = default; diff --git a/vstgui/lib/cresourcedescription.h b/vstgui/lib/cresourcedescription.h index bfb55f528..88ba16ad1 100644 --- a/vstgui/lib/cresourcedescription.h +++ b/vstgui/lib/cresourcedescription.h @@ -20,9 +20,10 @@ class CResourceDescription CResourceDescription () = default; CResourceDescription (UTF8StringPtr name) : type (kStringType) { u.name = name; } explicit CResourceDescription (int32_t id) : type (kIntegerType) { u.id = id; } + CResourceDescription (const CResourceDescription&) = default; CResourceDescription& operator= (int32_t id) { u.id = id; type = kIntegerType; return *this; } - CResourceDescription& operator= (const CResourceDescription& desc) { type = desc.type; u.id = desc.u.id; u.name = desc.u.name; return *this; } + CResourceDescription& operator= (const CResourceDescription& desc) = default; int32_t type {kUnknownType}; union { diff --git a/vstgui/lib/events.h b/vstgui/lib/events.h index 69ef4d39f..8fb020133 100644 --- a/vstgui/lib/events.h +++ b/vstgui/lib/events.h @@ -96,6 +96,7 @@ struct Modifiers Modifiers () = default; Modifiers (const Modifiers&) = default; explicit Modifiers (ModifierKey modifier) : data (cast (modifier)) {} + Modifiers& operator= (const Modifiers&) = default; /** test if no modifier key is set */ [[nodiscard]] bool empty () const { return data == 0; } @@ -202,6 +203,7 @@ struct MouseEventButtonState MouseEventButtonState () = default; MouseEventButtonState (const MouseEventButtonState&) = default; MouseEventButtonState (MouseButton pos) { set (pos); } + MouseEventButtonState& operator= (const MouseEventButtonState&) = default; [[nodiscard]] bool operator== (const MouseEventButtonState& other) const { From da4b4dd90a558f0d61b7b56274a353c707a45456 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 29 Oct 2023 17:29:30 +0100 Subject: [PATCH 07/12] fix cmake if macOS deployment target is higher than 11 (cherry picked from commit 75ea204e246223d4f40437c6704030d7fdc592bc) --- vstgui/tests/unittest/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vstgui/tests/unittest/CMakeLists.txt b/vstgui/tests/unittest/CMakeLists.txt index a6dae3d67..c67ef3663 100644 --- a/vstgui/tests/unittest/CMakeLists.txt +++ b/vstgui/tests/unittest/CMakeLists.txt @@ -191,7 +191,7 @@ endif(VSTGUI_USE_XCODE_XCTEST) if(CMAKE_HOST_APPLE) if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 11.0) - target_compile_definitions(${target} "VSTGUI_USE_OBJC_UTTYPE") + target_compile_definitions(${target} PRIVATE "VSTGUI_USE_OBJC_UTTYPE") target_link_libraries(${target} PRIVATE "-framework UniformTypeIdentifiers" ) From d61493499dff22c6a568e72c4a4664e5c49262b4 Mon Sep 17 00:00:00 2001 From: scheffle Date: Tue, 5 Dec 2023 15:26:19 +0100 Subject: [PATCH 08/12] fix issue with vertically mirrored UI with DP on macOS 10.13 (cherry picked from commit d210d671605c21d2c8d57e5c12bfc5f6b7f6d55e) --- vstgui/lib/platform/mac/cocoa/nsviewframe.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/vstgui/lib/platform/mac/cocoa/nsviewframe.mm b/vstgui/lib/platform/mac/cocoa/nsviewframe.mm index f79821af4..d08413026 100644 --- a/vstgui/lib/platform/mac/cocoa/nsviewframe.mm +++ b/vstgui/lib/platform/mac/cocoa/nsviewframe.mm @@ -958,6 +958,7 @@ static void draggedImageEndedAtOperation (id self, SEL _cmd, NSImage* image, NSP { [nsView setWantsLayer:YES]; caLayer = [CALayer new]; + caLayer.geometryFlipped = ![nsView.layer contentsAreFlipped]; caLayer.delegate = static_cast> (nsView); caLayer.frame = nsView.layer.bounds; [caLayer setContentsScale:nsView.layer.contentsScale]; From db1aa4fcd54be40275055adbe58de960a4731dbe Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 24 Dec 2023 12:18:53 +0100 Subject: [PATCH 09/12] fix invalid use of CFontDesc (cherry picked from commit dc31b4aa9714c1b81851434b9e414b60f4ee3517) --- .../minesweeper/source/highscoreviewcontroller.cpp | 12 ++++++------ .../minesweeper/source/highscoreviewcontroller.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vstgui/standalone/examples/minesweeper/source/highscoreviewcontroller.cpp b/vstgui/standalone/examples/minesweeper/source/highscoreviewcontroller.cpp index a54baa6df..cd382226c 100644 --- a/vstgui/standalone/examples/minesweeper/source/highscoreviewcontroller.cpp +++ b/vstgui/standalone/examples/minesweeper/source/highscoreviewcontroller.cpp @@ -24,7 +24,7 @@ HighScoreViewController::HighScoreViewController (IController* parent) columnWidths[1] = 0.14; columnWidths[2] = 0.5; columnWidths[3] = 0.3; - font = *kSystemFont; + font = kSystemFont; } //------------------------------------------------------------------------ @@ -103,8 +103,8 @@ int32_t HighScoreViewController::dbGetNumColumns (CDataBrowser* browser) CCoord HighScoreViewController::dbGetRowHeight (CDataBrowser* browser) { auto height = browser->getHeight () / (HighScoreListModel::Size + 1) - 1; - if (font.getSize () != height * 0.6) - font.setSize (height * 0.6); + if (font->getSize () != height * 0.6) + font->setSize (height * 0.6); return height; } @@ -129,7 +129,7 @@ bool HighScoreViewController::dbGetLineWidthAndColor (CCoord& width, CColor& col void HighScoreViewController::dbDrawHeader (CDrawContext* context, const CRect& size, int32_t column, int32_t flags, CDataBrowser* browser) { - context->setFont (&font); + context->setFont (font); context->setFontColor (fontColor); UTF8String text; switch (column) @@ -157,7 +157,7 @@ void HighScoreViewController::dbDrawCell (CDrawContext* context, const CRect& si if (entry == list->get ().end ()) return; bool valid = entry->valid (); - context->setFont (&font); + context->setFont (font); context->setFontColor (fontColor); UTF8String text = "-"; CHoriTxtAlign align = kCenterText; @@ -210,7 +210,7 @@ CView* HighScoreViewController::createView (const UIAttributes& attributes, if (attr && *attr == "DataBrowser") { if (auto f = description->getFont ("highscore")) - font = *f; + font = f; description->getColor ("highscore.font", fontColor); return new CDataBrowser ({}, this, CDataBrowser::kDrawHeader | CDataBrowser::kDrawRowLines, 0.); diff --git a/vstgui/standalone/examples/minesweeper/source/highscoreviewcontroller.h b/vstgui/standalone/examples/minesweeper/source/highscoreviewcontroller.h index 0436aaf7d..3da06e983 100644 --- a/vstgui/standalone/examples/minesweeper/source/highscoreviewcontroller.h +++ b/vstgui/standalone/examples/minesweeper/source/highscoreviewcontroller.h @@ -46,7 +46,7 @@ class HighScoreViewController final : public DelegationController, static constexpr const size_t NumCols = 4; - CFontDesc font; + SharedPointer font; CColor fontColor {kBlackCColor}; CDataBrowser* dataBrowser {nullptr}; std::shared_ptr list; From 6e803a4c0e8ec64c4764532b0e144e1f003f25d1 Mon Sep 17 00:00:00 2001 From: scheffle Date: Fri, 5 Jan 2024 11:03:38 +0100 Subject: [PATCH 10/12] Merge pull request #317 from steinbergmedia/bugfix/coptionmenu-get-range-and-max fix COptionMenu().getMax() (cherry picked from commit 24f79738c06120caed6d2609c9033696c713510e) --- vstgui/lib/controls/coptionmenu.cpp | 8 ++++++++ vstgui/lib/controls/coptionmenu.h | 2 +- vstgui/tests/unittest/lib/controls/coptionmenu_test.cpp | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/vstgui/lib/controls/coptionmenu.cpp b/vstgui/lib/controls/coptionmenu.cpp index 415bd1df1..82c69ba46 100644 --- a/vstgui/lib/controls/coptionmenu.cpp +++ b/vstgui/lib/controls/coptionmenu.cpp @@ -888,6 +888,14 @@ void COptionMenu::setValue (float val) setDirty (); } +//------------------------------------------------------------------------ +float COptionMenu::getMax () const +{ + if (menuItems->empty ()) + return 0.f; + return static_cast (menuItems->size () - 1); +} + //------------------------------------------------------------------------ void COptionMenu::takeFocus () { diff --git a/vstgui/lib/controls/coptionmenu.h b/vstgui/lib/controls/coptionmenu.h index b0acc7747..d4277db6a 100644 --- a/vstgui/lib/controls/coptionmenu.h +++ b/vstgui/lib/controls/coptionmenu.h @@ -307,7 +307,7 @@ class COptionMenu : public CParamDisplay void setMin (float val) override {} float getMin () const override { return 0; } void setMax (float val) override {} - float getMax () const override { return (float)(menuItems->size () - 1); } + float getMax () const override; void draw (CDrawContext* pContext) override; CMouseEventResult onMouseDown (CPoint& where, const CButtonState& buttons) override; diff --git a/vstgui/tests/unittest/lib/controls/coptionmenu_test.cpp b/vstgui/tests/unittest/lib/controls/coptionmenu_test.cpp index bc3a941dc..27c76275c 100644 --- a/vstgui/tests/unittest/lib/controls/coptionmenu_test.cpp +++ b/vstgui/tests/unittest/lib/controls/coptionmenu_test.cpp @@ -49,4 +49,10 @@ TEST_CASE (CCommandMenuItemTest, DescConstructor3) EXPECT_EQ (item.getCommandName (), "CommandNme"); } +TEST_CASE (COptionMenuTest, GetMaxWhenEmpty) +{ + COptionMenu menu; + EXPECT_EQ (menu.getMax (), 0.f); +} + } // VSTGUI From 01f5baab88f828b1313d0d9e0872e610a16c055a Mon Sep 17 00:00:00 2001 From: scheffle Date: Fri, 5 Jan 2024 11:59:16 +0100 Subject: [PATCH 11/12] Merge pull request #318 from steinbergmedia/support-c++23-with-xcode15 Support c++23 with xcode15 (cherry picked from commit b3beb689407b3e94eae2de1dbd3fe584f73046ae) --- vstgui/lib/cdrawcontext.cpp | 2 +- vstgui/lib/cgraphicspath.h | 3 +-- vstgui/lib/cstring.h | 23 +++++++++++++++++++++++ vstgui/lib/platform/mac/cgbitmap.cpp | 6 ++++-- vstgui/lib/platform/mac/macfactory.h | 1 + vstgui/lib/platform/mac/macfactory.mm | 2 ++ 6 files changed, 32 insertions(+), 5 deletions(-) diff --git a/vstgui/lib/cdrawcontext.cpp b/vstgui/lib/cdrawcontext.cpp index 2605649d2..05374c837 100644 --- a/vstgui/lib/cdrawcontext.cpp +++ b/vstgui/lib/cdrawcontext.cpp @@ -714,7 +714,7 @@ void CDrawContext::fillRadialGradient (CGraphicsPath* path, const CGradient& gra CGraphicsPath* CDrawContext::createGraphicsPath () { if (impl->device) - return new CGraphicsPath (impl->device->getGraphicsPathFactory ()); + return new CGraphicsPath (impl->device->getGraphicsPathFactory (), nullptr); return nullptr; } diff --git a/vstgui/lib/cgraphicspath.h b/vstgui/lib/cgraphicspath.h index ed4b4e252..9e61e6cbd 100644 --- a/vstgui/lib/cgraphicspath.h +++ b/vstgui/lib/cgraphicspath.h @@ -92,8 +92,7 @@ class CGraphicsPath : public AtomicReferenceCounted CRect getBoundingBox (); //@} - CGraphicsPath (const PlatformGraphicsPathFactoryPtr& factory, - PlatformGraphicsPathPtr&& path = nullptr); + CGraphicsPath (const PlatformGraphicsPathFactoryPtr& factory, PlatformGraphicsPathPtr&& path); ~CGraphicsPath () noexcept override; const PlatformGraphicsPathPtr& getPlatformPath (PlatformGraphicsPathFillMode fillMode); diff --git a/vstgui/lib/cstring.h b/vstgui/lib/cstring.h index 7c1236dd5..a492c6541 100644 --- a/vstgui/lib/cstring.h +++ b/vstgui/lib/cstring.h @@ -221,6 +221,9 @@ class UTF8StringView bool operator== (const UTF8StringPtr otherString) const; bool operator!= (const UTF8StringPtr otherString) const; bool operator== (UTF8StringView otherString) const; + bool operator!= (UTF8StringView otherString) const; + bool operator== (const UTF8String& otherString) const; + bool operator!= (const UTF8String& otherString) const; operator const UTF8StringPtr () const; //----------------------------------------------------------------------------- private: @@ -463,6 +466,26 @@ inline bool UTF8StringView::operator== (UTF8StringView otherString) const return operator==(otherString.str); } +//------------------------------------------------------------------------ +inline bool UTF8StringView::operator!= (UTF8StringView otherString) const +{ + if (byteCount && otherString.byteCount && *byteCount != *otherString.byteCount) + return true; + return operator!= (otherString.str); +} + +//------------------------------------------------------------------------ +inline bool UTF8StringView::operator== (const UTF8String& otherString) const +{ + return otherString == str; +} + +//------------------------------------------------------------------------ +inline bool UTF8StringView::operator!= (const UTF8String& otherString) const +{ + return otherString != str; +} + //----------------------------------------------------------------------------- inline UTF8StringView::operator const UTF8StringPtr () const { diff --git a/vstgui/lib/platform/mac/cgbitmap.cpp b/vstgui/lib/platform/mac/cgbitmap.cpp index 678e4b198..fbab7f441 100644 --- a/vstgui/lib/platform/mac/cgbitmap.cpp +++ b/vstgui/lib/platform/mac/cgbitmap.cpp @@ -270,7 +270,8 @@ CGImageRef CGBitmap::getCGImage () size_t rowBytes = getBytesPerRow (); size_t bitDepth = 32; - CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Big; + CGBitmapInfo bitmapInfo = + static_cast (kCGImageAlphaPremultipliedFirst) | kCGBitmapByteOrder32Big; image = CGImageCreate (static_cast (size.x), static_cast (size.y), 8, bitDepth, rowBytes, GetCGColorSpace (), bitmapInfo, bitsDataProvider, nullptr, false, kCGRenderingIntentDefault); dirty = false; } @@ -300,7 +301,8 @@ CGContextRef CGBitmap::createCGContext () } if (bits) { - CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Big; + CGBitmapInfo bitmapInfo = + static_cast (kCGImageAlphaPremultipliedFirst) | kCGBitmapByteOrder32Big; context = CGBitmapContextCreate (bits, static_cast (size.x), static_cast (size.y), diff --git a/vstgui/lib/platform/mac/macfactory.h b/vstgui/lib/platform/mac/macfactory.h index e77d04ea8..d85e36a58 100644 --- a/vstgui/lib/platform/mac/macfactory.h +++ b/vstgui/lib/platform/mac/macfactory.h @@ -16,6 +16,7 @@ class MacFactory final : public IPlatformFactory { public: MacFactory (CFBundleRef bundle); + ~MacFactory () noexcept override; CFBundleRef getBundle () const noexcept; diff --git a/vstgui/lib/platform/mac/macfactory.mm b/vstgui/lib/platform/mac/macfactory.mm index 474a55d28..d8dc904e4 100644 --- a/vstgui/lib/platform/mac/macfactory.mm +++ b/vstgui/lib/platform/mac/macfactory.mm @@ -46,6 +46,8 @@ mach_timebase_info (&impl->timebaseInfo); } +MacFactory::~MacFactory () noexcept = default; + //----------------------------------------------------------------------------- CFBundleRef MacFactory::getBundle () const noexcept { From 4d4d74f5b5a5400c0e9f6b79a8c71f083e90e1a2 Mon Sep 17 00:00:00 2001 From: scheffle Date: Thu, 11 Jan 2024 12:20:31 +0100 Subject: [PATCH 12/12] increase patch level --- vstgui/lib/vstguibase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vstgui/lib/vstguibase.h b/vstgui/lib/vstguibase.h index bbe96f95b..0d9161a43 100644 --- a/vstgui/lib/vstguibase.h +++ b/vstgui/lib/vstguibase.h @@ -13,7 +13,7 @@ //----------------------------------------------------------------------------- #define VSTGUI_VERSION_MAJOR 4 #define VSTGUI_VERSION_MINOR 13 -#define VSTGUI_VERSION_PATCHLEVEL 1 +#define VSTGUI_VERSION_PATCHLEVEL 2 //----------------------------------------------------------------------------- // Platform definitions