Skip to content

Commit

Permalink
Merge pull request #327 from steinbergmedia/develop
Browse files Browse the repository at this point in the history
Prepare 4.14.0 Release
  • Loading branch information
scheffle authored Jul 9, 2024
2 parents 480b0c8 + 07ca495 commit 02eadc0
Show file tree
Hide file tree
Showing 52 changed files with 1,192 additions and 255 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- run: sudo apt-get update
- run: sudo apt-get install libx11-dev libx11-xcb-dev libxcb-util-dev libxcb-cursor-dev libxcb-keysyms1-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev libfontconfig1-dev libcairo2-dev libfreetype6-dev libpango1.0-dev
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cmake_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

strategy:
matrix:
os: [macos-11, macos-12]
os: [macos-11, macos-13]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/cmake
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
os: [windows-2019, windows-2022]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/cmake
with:
Expand Down
3 changes: 3 additions & 0 deletions vstgui/contrib/datepicker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ static void validate (id self, SEL cmd, NSDatePickerCell* datePickerCell,
dateComponents.month = date.month;
dateComponents.year = date.year;
impl->view.dateValue = [calendar dateFromComponents:dateComponents];
#if !__has_feature(objc_arc)
[dateComponents release];
#endif
}

//------------------------------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions vstgui/doxygen/page_changes.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ It's recommended to start new projects with version 4 while old projects should
@section new_stuff New Stuff
@subsection version4_14 Version 4.14
- add crosshair mouse cursor (kCursorCrosshair)
- customizable knob range (see CKnob::setKnobRange)
- new layouts for CRowColumnView
@subsection version4_13 Version 4.13
- support embedding platform views (HWND & NSView) as sub views (see CExternalView and ExternalView::IView) and examples in the contrib folder.
Expand Down Expand Up @@ -136,6 +142,10 @@ Note: All current deprecated methods will be removed in the next version. So mak
@section code_changes Changes for existing VSTGUI code
@subsection code_changes_4_13_to_4_14 VSTGUI 4.13 -> VSTGUI 4.14
- In CParamDisplay::drawPlatformText(..) the string argument changed from IPlatformString to UTF8Text
@subsection code_changes_4_12_to_4_13 VSTGUI 4.12 -> VSTGUI 4.13
- the context argument of IFontPainter has changed to use the new platform graphics device context
Expand Down
9 changes: 5 additions & 4 deletions vstgui/lib/controls/cknob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace VSTGUI {
#if TARGET_OS_IPHONE
static const float kCKnobRange = 300.f;
static const float kCKnobRangeDefault = 300.f;
#else
static const float kCKnobRange = 200.f;
static const float kCKnobRangeDefault = 200.f;
#endif

static constexpr CViewAttributeID kCKnobMouseStateAttribute = 'knms';
Expand All @@ -40,6 +40,7 @@ CKnobBase::CKnobBase (const CRect& size, IControlListener* listener, int32_t tag
setStartAngle ((float)(3.f * Constants::quarter_pi));
setRangeAngle ((float)(3.f * Constants::half_pi));
zoomFactor = 1.5f;
knobRange = kCKnobRangeDefault;
}

//------------------------------------------------------------------------
Expand Down Expand Up @@ -112,7 +113,7 @@ CMouseEventResult CKnobBase::onMouseDown (CPoint& where, const CButtonState& but

mouseState.modeLinear = false;
mouseState.entryState = value;
mouseState.range = kCKnobRange;
mouseState.range = knobRange;
mouseState.coef = (getMax () - getMin ()) / mouseState.range;
mouseState.oldButton = buttons;

Expand Down Expand Up @@ -193,7 +194,7 @@ CMouseEventResult CKnobBase::onMouseMoved (CPoint& where, const CButtonState& bu
CCoord diff = (mouseState.firstPoint.y - where.y) + (where.x - mouseState.firstPoint.x);
if (buttons != mouseState.oldButton)
{
mouseState.range = kCKnobRange;
mouseState.range = knobRange;
if (buttons & kZoomModifier)
mouseState.range *= zoomFactor;

Expand Down
4 changes: 4 additions & 0 deletions vstgui/lib/controls/cknob.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class CKnobBase : public CControl, protected CMouseWheelEditingSupport

virtual CCoord getInsetValue () const { return inset; }
virtual void setInsetValue (CCoord val) { inset = val; }

virtual void setKnobRange (float val) { if (val > 0.f) knobRange = val; }
virtual float getKnobRange () const { return knobRange; }
//@}

// overrides
Expand All @@ -56,6 +59,7 @@ class CKnobBase : public CControl, protected CMouseWheelEditingSupport

float startAngle, rangeAngle;
float zoomFactor;
float knobRange;
CCoord inset;

private:
Expand Down
2 changes: 1 addition & 1 deletion vstgui/lib/controls/coptionmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ void COptionMenu::draw (CDrawContext *pContext)
CMenuItem* item = getEntry (currentIndex);
drawBack (pContext, inPopup ? bgWhenClick : nullptr);
if (item)
drawPlatformText (pContext, UTF8String (item->getTitle ()).getPlatformString ());
drawPlatformText (pContext, item->getTitle ());
setDirty (false);
}

Expand Down
13 changes: 8 additions & 5 deletions vstgui/lib/controls/cparamdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void CParamDisplay::draw (CDrawContext *pContext)
}

drawBack (pContext);
drawPlatformText (pContext, UTF8String (string).getPlatformString ());
drawPlatformText (pContext, UTF8String (string));
setDirty (false);
}

Expand Down Expand Up @@ -322,13 +322,14 @@ void CParamDisplay::drawBack (CDrawContext* pContext, CBitmap* newBack)
}

//------------------------------------------------------------------------
void CParamDisplay::drawPlatformText (CDrawContext* pContext, IPlatformString* string)
void CParamDisplay::drawPlatformText (CDrawContext* pContext, const UTF8String& string)
{
drawPlatformText (pContext, string, getViewSize ());
}

//------------------------------------------------------------------------
void CParamDisplay::drawPlatformText (CDrawContext* pContext, IPlatformString* string, const CRect& size)
void CParamDisplay::drawPlatformText (CDrawContext* pContext, const UTF8String& string,
const CRect& size)
{
if (!hasBit (style, kNoTextStyle))
{
Expand All @@ -351,10 +352,12 @@ void CParamDisplay::drawPlatformText (CDrawContext* pContext, IPlatformString* s
CRect newSize (textRect);
newSize.offset (shadowTextOffset);
pContext->setFontColor (shadowColor);
pContext->drawString (string, newSize, horiTxtAlign, hasBit (style, kAntialias));
pContext->drawString (string.getPlatformString (), newSize, horiTxtAlign,
hasBit (style, kAntialias));
}
pContext->setFontColor (fontColor);
pContext->drawString (string, textRect, horiTxtAlign, hasBit (style, kAntialias));
pContext->drawString (string.getPlatformString (), textRect, horiTxtAlign,
hasBit (style, kAntialias));
});
pContext->restoreGlobalState ();
}
Expand Down
5 changes: 3 additions & 2 deletions vstgui/lib/controls/cparamdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ class CParamDisplay : public CControl
~CParamDisplay () noexcept override;
virtual void drawBack (CDrawContext* pContext, CBitmap* newBack = nullptr);

virtual void drawPlatformText (CDrawContext* pContext, IPlatformString* string);
virtual void drawPlatformText (CDrawContext* pContext, IPlatformString* string, const CRect& size);
virtual void drawPlatformText (CDrawContext* pContext, const UTF8String& string);
virtual void drawPlatformText (CDrawContext* pContext, const UTF8String& string,
const CRect& size);

virtual void drawStyleChanged ();

Expand Down
4 changes: 2 additions & 2 deletions vstgui/lib/controls/csearchtextedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ void CSearchTextEdit::draw (CDrawContext *pContext)
CColor color (fontColor);
color.alpha /= 2;
setFontColor (color);
drawPlatformText (pContext, getPlaceholderString ().getPlatformString (), getTextRect ());
drawPlatformText (pContext, getPlaceholderString (), getTextRect ());
}
else
drawPlatformText (pContext, getText ().getPlatformString (), getTextRect ());
drawPlatformText (pContext, getText (), getTextRect ());

setDirty (false);
setFontColor (origFontColor);
Expand Down
6 changes: 3 additions & 3 deletions vstgui/lib/controls/ctextedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void CTextEdit::draw (CDrawContext *pContext)
{
pContext->saveGlobalState ();
pContext->setGlobalAlpha (pContext->getGlobalAlpha () * 0.5f);
drawPlatformText (pContext, placeholderString.getPlatformString ());
drawPlatformText (pContext, placeholderString);
pContext->restoreGlobalState ();
}
setDirty (false);
Expand All @@ -201,7 +201,7 @@ void CTextEdit::draw (CDrawContext *pContext)
{
pContext->saveGlobalState ();
pContext->setGlobalAlpha (pContext->getGlobalAlpha () * 0.5f);
drawPlatformText (pContext, placeholderString.getPlatformString ());
drawPlatformText (pContext, placeholderString);
pContext->restoreGlobalState ();
}
}
Expand All @@ -211,7 +211,7 @@ void CTextEdit::draw (CDrawContext *pContext)
UTF8String str;
for (auto i = 0u; i < text.length (); ++i)
str += bulletCharacter;
drawPlatformText (pContext, str.getPlatformString ());
drawPlatformText (pContext, str);
}
else
CTextLabel::draw (pContext);
Expand Down
2 changes: 1 addition & 1 deletion vstgui/lib/controls/ctextlabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const UTF8String& CTextLabel::getText () const
void CTextLabel::draw (CDrawContext *pContext)
{
drawBack (pContext);
drawPlatformText (pContext, truncatedText.empty () ? text.getPlatformString () : truncatedText.getPlatformString ());
drawPlatformText (pContext, truncatedText.empty () ? text : truncatedText);
setDirty (false);
}

Expand Down
Loading

0 comments on commit 02eadc0

Please sign in to comment.