Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
scheffle committed Aug 31, 2022
2 parents addf12b + c04c4af commit b8e259c
Show file tree
Hide file tree
Showing 52 changed files with 770 additions and 463 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake_linux.yml
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-18.04]
os: [ubuntu-18.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake_macos.yml
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
os: [macos-10.15, macos-11.0]
os: [macos-11, macos-12]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake_windows.yml
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
os: [windows-2019]
os: [windows-2019, windows-2022]

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 2 additions & 3 deletions CMakeLists.txt
Expand Up @@ -2,11 +2,10 @@
cmake_minimum_required(VERSION 3.5)

if(NOT PROJECT_NAME)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14 CACHE STRING "")

project(vstgui)
set(VSTGUI_MAIN_PROJECT_BUILD 1)
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
endif()
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Debug Release ReleaseLTO)
endif()
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -16,12 +16,12 @@ VSTGUI is a user interface toolkit mainly for audio plug-ins (VST, AAX, AudioUni
Supported OS:

- Microsoft Windows 10/11
- Apple macOS 10.9-12
- Apple macOS 10.12-12
- Apple iOS 9-15
- Linux (Preview)

Supported IDE:
- Visual Studio 2015/2017/2019/2022
- Visual Studio 2017/2019/2022
- minimum Xcode 10.1
- Qt Creator
- Visual Studio Code
Expand Down
5 changes: 1 addition & 4 deletions vstgui/CMakeLists.txt
Expand Up @@ -2,14 +2,11 @@
cmake_minimum_required(VERSION 3.5)

if(NOT PROJECT_NAME)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14 CACHE STRING "")
project(vstgui)
set(VSTGUI_MAIN_PROJECT_BUILD 1)
endif()

if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/")

include(vstgui_init)
Expand Down
1 change: 1 addition & 0 deletions vstgui/lib/CMakeLists.txt
Expand Up @@ -348,6 +348,7 @@ if(CMAKE_HOST_APPLE)
"-framework Accelerate"
)
if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 11.0)
target_compile_definitions(${target} "VSTGUI_USE_OBJC_UTTYPE")
set(PLATFORM_LIBRARIES
${PLATFORM_LIBRARIES}
"-framework UniformTypeIdentifiers"
Expand Down
15 changes: 10 additions & 5 deletions vstgui/lib/cframe.cpp
Expand Up @@ -663,8 +663,13 @@ void CFrame::dispatchMouseMoveEvent (MouseMoveEvent& event)
{
CPoint p (transformedMousePosition);
auto view = *it;
if (auto parent = view->getParentView ())
parent->translateToLocal (p, true);
if (view->asViewContainer ())
{
if (auto parent = view->getParentView ())
parent->translateToLocal (p, true);
}
else
view->translateToLocal (p, true);
event.mousePosition = p;
dispatchEvent (view, event);
if (event.consumed)
Expand Down Expand Up @@ -883,7 +888,7 @@ void CFrame::setViewSize (const CRect& rect, bool invalid)
bool CFrame::setSize (CCoord width, CCoord height)
{
if ((width == getViewSize ().getWidth ()) && (height == getViewSize ().getHeight ()))
return false;
return true;

CRect newSize (getViewSize ());
newSize.setWidth (width);
Expand Down Expand Up @@ -1554,13 +1559,13 @@ void CFrame::dispatchKeyboardEventToHooks (KeyboardEvent& event)
}

//-----------------------------------------------------------------------------
void CFrame::registerScaleFactorChangedListeneer (IScaleFactorChangedListener* listener)
void CFrame::registerScaleFactorChangedListener (IScaleFactorChangedListener* listener)
{
pImpl->scaleFactorChangedListenerList.add (listener);
}

//-----------------------------------------------------------------------------
void CFrame::unregisterScaleFactorChangedListeneer (IScaleFactorChangedListener* listener)
void CFrame::unregisterScaleFactorChangedListener (IScaleFactorChangedListener* listener)
{
pImpl->scaleFactorChangedListenerList.remove (listener);
}
Expand Down
15 changes: 13 additions & 2 deletions vstgui/lib/cframe.h
Expand Up @@ -143,8 +143,19 @@ class CFrame final : public CViewContainer, public IPlatformFrameCallback
/** unregister a mouse observer */
void unregisterMouseObserver (IMouseObserver* observer);

void registerScaleFactorChangedListeneer (IScaleFactorChangedListener* listener);
void unregisterScaleFactorChangedListeneer (IScaleFactorChangedListener* listener);
VSTGUI_DEPRECATED_MSG (
void registerScaleFactorChangedListeneer (IScaleFactorChangedListener* listener) {
registerScaleFactorChangedListener (listener);
},
"use registerScaleFactorChangedListener")
VSTGUI_DEPRECATED_MSG (
void unregisterScaleFactorChangedListeneer (IScaleFactorChangedListener* listener) {
unregisterScaleFactorChangedListener (listener);
},
"use unregisterScaleFactorChangedListener")

void registerScaleFactorChangedListener (IScaleFactorChangedListener* listener);
void unregisterScaleFactorChangedListener (IScaleFactorChangedListener* listener);

void registerFocusViewObserver (IFocusViewObserver* observer);
void unregisterFocusViewObserver (IFocusViewObserver* observer);
Expand Down
4 changes: 2 additions & 2 deletions vstgui/lib/clayeredviewcontainer.cpp
Expand Up @@ -69,7 +69,7 @@ bool CLayeredViewContainer::removed (CView* parent)
{
layer = nullptr;
parentLayerView = nullptr;
getFrame ()->unregisterScaleFactorChangedListeneer (this);
getFrame ()->unregisterScaleFactorChangedListener (this);
}
return CViewContainer::removed (parent);
}
Expand Down Expand Up @@ -99,7 +99,7 @@ bool CLayeredViewContainer::attached (CView* parent)
layer->setZIndex (zIndex);
layer->setAlpha (getAlphaValue ());
updateLayerSize ();
frame->registerScaleFactorChangedListeneer (this);
frame->registerScaleFactorChangedListener (this);
}
}
parent = getParentView ();
Expand Down
6 changes: 3 additions & 3 deletions vstgui/lib/controls/ccolorchooser.cpp
Expand Up @@ -240,21 +240,21 @@ static void setupParamDisplay (CParamDisplay* display, const CColorChooserUISett
//-----------------------------------------------------------------------------
bool CColorChooser::convertNormalizedToString (float value, char string[256], CParamDisplay::ValueToStringUserData* userData)
{
sprintf (string, "%.3f", value);
snprintf (string, 255, "%.3f", value);
return true;
}

//-----------------------------------------------------------------------------
bool CColorChooser::convertColorValueToString (float value, char string[256], CParamDisplay::ValueToStringUserData* userData)
{
sprintf (string, "%d", (int32_t)(value*255.f));
snprintf (string, 255, "%d", (int32_t)(value * 255.f));
return true;
}

//-----------------------------------------------------------------------------
bool CColorChooser::convertAngleToString (float value, char string[256], CParamDisplay::ValueToStringUserData* userData)
{
sprintf (string, "%d%s", (int32_t)(value*359.f), kDegreeSymbol);
snprintf (string, 255, "%d%s", (int32_t)(value * 359.f), kDegreeSymbol);
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions vstgui/lib/controls/ccontrol.cpp
Expand Up @@ -298,7 +298,7 @@ CControl::CheckDefaultValueFuncT CControl::CheckDefaultValueFunc = [] (CControl*
return button.isDoubleClick ();
#else
return (button.isLeftButton () && button.getModifierState () == kDefaultValueModifier);
#endif
#endif // TARGET_OS_IPHONE
};

#endif // VSTGUI_ENABLE_DEPRECATED_METHODS
Expand All @@ -311,14 +311,14 @@ CControl::CheckDefaultValueEventFuncT CControl::CheckDefaultValueEventFunc =
{
return CheckDefaultValueFunc (c, buttonStateFromMouseEvent (event));
}
return false;
#else
#if TARGET_OS_IPHONE
return event.buttonState.isLeft () && event.clickCount == 2;
#else
return event.buttonState.isLeft () && event.modifiers.is (ModifierKey::Control);
#endif // TARGET_OS_IPHONE
#endif // VSTGUI_ENABLE_DEPRECATED_METHODS
return false;
};

//------------------------------------------------------------------------
Expand Down Expand Up @@ -359,7 +359,7 @@ int32_t CControl::mapVstKeyModifier (int32_t vstModifier)
modifiers |= kControl;
return modifiers;
}
#endif
#endif // VSTGUI_ENABLE_DEPRECATED_METHODS

//------------------------------------------------------------------------
//------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion vstgui/lib/controls/cfontchooser.cpp
Expand Up @@ -48,7 +48,7 @@ class FontPreviewView : public CView
{
while (glyphRect.right < getViewSize ().right && i < 126)
{
sprintf (string, "%c", i++);
snprintf (string, 2, "%c", i++);
text += string;
glyphRect.setWidth (context->getStringWidth (text.c_str ()));
}
Expand Down
4 changes: 2 additions & 2 deletions vstgui/lib/controls/cparamdisplay.cpp
Expand Up @@ -186,8 +186,8 @@ void CParamDisplay::draw (CDrawContext *pContext)
{
char tmp[255];
char precisionStr[10];
sprintf (precisionStr, "%%.%hhuf", valuePrecision);
sprintf (tmp, precisionStr, value);
snprintf (precisionStr, 10, "%%.%hhuf", valuePrecision);
snprintf (tmp, 255, precisionStr, value);
string = tmp;
}

Expand Down
4 changes: 2 additions & 2 deletions vstgui/lib/controls/ctextedit.cpp
Expand Up @@ -121,8 +121,8 @@ void CTextEdit::setValue (float val)
{
char tmp[255];
char precisionStr[10];
sprintf (precisionStr, "%%.%hhuf", valuePrecision);
sprintf (tmp, precisionStr, getValue ());
snprintf (precisionStr, 10, "%%.%hhuf", valuePrecision);
snprintf (tmp, 255, precisionStr, getValue ());
string = tmp;
}

Expand Down
4 changes: 2 additions & 2 deletions vstgui/lib/copenglview.cpp
Expand Up @@ -56,7 +56,7 @@ bool COpenGLView::createPlatformOpenGLView ()
updatePlatformOpenGLViewSize ();
platformOpenGLViewCreated ();
platformOpenGLViewSizeChanged ();
getFrame ()->registerScaleFactorChangedListeneer (this);
getFrame ()->registerScaleFactorChangedListener (this);
return true;
}
platformOpenGLView = nullptr;
Expand All @@ -69,7 +69,7 @@ bool COpenGLView::destroyPlatformOpenGLView ()
{
if (platformOpenGLView)
{
getFrame ()->unregisterScaleFactorChangedListeneer (this);
getFrame ()->unregisterScaleFactorChangedListener (this);
platformOpenGLViewWillDestroy ();
platformOpenGLView->remove ();
platformOpenGLView = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions vstgui/lib/cshadowviewcontainer.cpp
Expand Up @@ -47,7 +47,7 @@ void CShadowViewContainer::beforeDelete ()
//-----------------------------------------------------------------------------
bool CShadowViewContainer::removed (CView* parent)
{
getFrame ()->unregisterScaleFactorChangedListeneer (this);
getFrame ()->unregisterScaleFactorChangedListener (this);
setBackground (nullptr);
return CViewContainer::removed (parent);
}
Expand All @@ -58,7 +58,7 @@ bool CShadowViewContainer::attached (CView* parent)
if (CViewContainer::attached (parent))
{
invalidateShadow ();
getFrame ()->registerScaleFactorChangedListeneer (this);
getFrame ()->registerScaleFactorChangedListener (this);
return true;
}
return false;
Expand Down

0 comments on commit b8e259c

Please sign in to comment.