Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e1aae68
Fix Component tests
kunitoki Jun 26, 2025
9af97cb
Code formatting
yup-bot Jun 26, 2025
40e40b6
Buttons
kunitoki Jun 27, 2025
fa324db
More test fixes
kunitoki Jun 27, 2025
5aa3ceb
Merge branch 'dev/combo_box' into dev/toggle_button
kunitoki Jun 28, 2025
e7cb490
Avoid building rander example
kunitoki Jun 28, 2025
2251cff
Improve examples
kunitoki Jun 28, 2025
de47912
Code formatting
yup-bot Jun 28, 2025
f32804f
Switch Button
kunitoki Jun 28, 2025
3b9c71d
Improved drawing
kunitoki Jun 28, 2025
114c160
More stuff
kunitoki Jun 28, 2025
223a850
Improve widgets
kunitoki Jun 28, 2025
336a80b
More tweaks
kunitoki Jun 28, 2025
cb7e927
More improvements
kunitoki Jun 28, 2025
be6aeca
Code formatting
yup-bot Jun 28, 2025
219df43
Improved handling
kunitoki Jun 28, 2025
b32a45f
Improve repaint efficiency
kunitoki Jun 28, 2025
50f1d86
Improve opaque demo
kunitoki Jun 28, 2025
4acc223
More component optimisation fixes
kunitoki Jun 28, 2025
999fe28
Improved repainting
kunitoki Jun 28, 2025
b59e3b8
Fix issues
kunitoki Jun 28, 2025
845a509
Removed ambiguous operators and more tests
kunitoki Jun 28, 2025
3b115bc
Run tests on emscripten without using SDL
kunitoki Jun 28, 2025
75bf9c4
Remove useless demo
kunitoki Jun 28, 2025
bd09d44
Fix issue in coverage
kunitoki Jun 28, 2025
7e7a7b2
More tests
kunitoki Jun 29, 2025
683126c
More tests
kunitoki Jun 30, 2025
0004068
Missing tests
kunitoki Jun 30, 2025
9f63d3c
More tests
kunitoki Jun 30, 2025
9464909
More tests
kunitoki Jun 30, 2025
f27e012
More tweaks
kunitoki Jun 30, 2025
07b42a6
More tweaks
kunitoki Jun 30, 2025
5233cff
Fix issue with linux
kunitoki Jun 30, 2025
f8ed471
Fix issue
kunitoki Jun 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,33 +119,3 @@ jobs:
run: ./gradlew assembleDebug
- working-directory: ${{ runner.workspace }}/build/examples/graphics
run: ./gradlew assemble

build_render:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v2.0.10
- name: Setup Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r26d
- uses: actions/cache/restore@v4
id: cache-restore
with:
path: ${{ runner.workspace }}/build
key: android-build-${{ github.sha }}
- name: Configure If Cache Missed
if: steps.cache-restore.outputs.cache-hit != 'true'
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_TARGET_ANDROID=ON -DYUP_ENABLE_EXAMPLES=ON
- working-directory: ${{ runner.workspace }}/build/examples/render
run: ./gradlew assembleDebug
- working-directory: ${{ runner.workspace }}/build/examples/render
run: ./gradlew assemble
19 changes: 0 additions & 19 deletions .github/workflows/build_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,3 @@ jobs:
-DPLATFORM=${{ env.IOS_PLATFORM }} -B ${{ runner.workspace }}/build -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_graphics
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_graphics

build_render:
runs-on: macos-latest
needs: [configure]
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
path: ${{ runner.workspace }}/build
key: ios-build-${{ github.sha }}
- name: Configure If Cache Missed
if: steps.cache-restore.outputs.cache-hit != 'true'
run: |
cmake ${{ github.workspace }} -G "Ninja Multi-Config" -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/ios.cmake \
-DPLATFORM=${{ env.IOS_PLATFORM }} -B ${{ runner.workspace }}/build -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_render
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_render
18 changes: 0 additions & 18 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,6 @@ jobs:
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_graphics
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_graphics

build_render:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- uses: actions/cache/restore@v4
id: cache-restore
with:
path: ${{ runner.workspace }}/build
key: linux-build-${{ github.sha }}
- name: Configure If Cache Missed
if: steps.cache-restore.outputs.cache-hit != 'true'
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_render
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_render

build_plugin:
runs-on: ubuntu-latest
needs: [configure]
Expand Down
21 changes: 2 additions & 19 deletions .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ jobs:
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target yup_tests
- working-directory: ${{ runner.workspace }}/build/tests/Debug
run: ./yup_tests
run: ./yup_tests.app/Contents/MacOS/yup_tests
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target yup_tests
- working-directory: ${{ runner.workspace }}/build/tests/Release
run: ./yup_tests
run: ./yup_tests.app/Contents/MacOS/yup_tests

build_console:
runs-on: macos-latest
Expand Down Expand Up @@ -121,23 +121,6 @@ jobs:
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_graphics
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_graphics

build_render:
runs-on: macos-latest
needs: [configure]
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
path: ${{ runner.workspace }}/build
key: macos-build-${{ github.sha }}
- name: Configure If Cache Missed
if: steps.cache-restore.outputs.cache-hit != 'true'
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_render
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_render

build_plugins:
runs-on: macos-latest
needs: [configure]
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/build_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,3 @@ jobs:
run: emcmake cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_graphics
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_graphics

build_render:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}
- name: Configure
run: emcmake cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_render
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_render
8 changes: 0 additions & 8 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ jobs:
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_graphics
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_graphics

build_render:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- run: cmake ${{ github.workspace }} -B ${{ runner.workspace }}/build -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_render
- run: cmake --build ${{ runner.workspace }}/build --config Release --parallel 4 --target example_render

build_plugin:
runs-on: windows-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ env:
libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev
libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev
libxrandr-dev libxrender-dev libglu1-mesa-dev libegl1-mesa-dev mesa-common-dev lcov
IGNORE_ERRORS: "mismatch,gcov,source,negative,unused,empty"

jobs:
coverage:
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ if (YUP_BUILD_EXAMPLES)
add_subdirectory (examples/console)
add_subdirectory (examples/app)
add_subdirectory (examples/graphics)
add_subdirectory (examples/render)
if (YUP_PLATFORM_DESKTOP)
add_subdirectory (examples/plugin)
endif()
Expand Down
4 changes: 3 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ coverage:
status:
project:
default:
informational: true
target: 70%
threshold: 5%
base: auto
Expand All @@ -22,6 +23,7 @@ coverage:
- yup_gui
patch:
default:
informational: true
target: 70%
threshold: 5%

Expand Down Expand Up @@ -114,7 +116,7 @@ ignore:
- "cmake/**/*"
- "docs/**/*"
- "standalone/**/*"
- "**/modules/*/native/*"
- "modules/*/native/**/*"

comment:
layout: "header, reach, components, diff, flags, files, footer"
Expand Down
4 changes: 2 additions & 2 deletions examples/app/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class Application : public yup::YUPApplication
public:
Application() = default;

const yup::String getApplicationName() override
yup::String getApplicationName() override
{
return "yup app!";
}

const yup::String getApplicationVersion() override
yup::String getApplicationVersion() override
{
return "1.0";
}
Expand Down
32 changes: 21 additions & 11 deletions examples/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,26 @@ set (target_version "1.0.0")

project (${target_name} VERSION ${target_version})

set (rive_file "data/alien.riv")

# ==== Prepare Android build
set (link_libraries "")
if (ANDROID)
include (../../cmake/yup.cmake)
_yup_setup_platform()
_yup_add_default_modules ("${CMAKE_CURRENT_LIST_DIR}/../..")

#yup_add_embedded_binary_resources (
# "${target_name}_binary_data"
# OUT_DIR BinaryData
# HEADER BinaryData.h
# NAMESPACE yup
# RESOURCE_NAMES
# RobotoFont
# RESOURCES
# "${CMAKE_CURRENT_LIST_DIR}/data/RobotoFlex-VariableFont.ttf")
#set (link_libraries "${target_name}_binary_data")
yup_add_embedded_binary_resources (
"${target_name}_binary_data"
OUT_DIR BinaryData
HEADER BinaryData.h
NAMESPACE yup
RESOURCE_NAMES
RiveFile
RESOURCES
"${CMAKE_CURRENT_LIST_DIR}/${rive_file}")

set (link_libraries "${target_name}_binary_data")
endif()

# ==== Prepare target
Expand All @@ -51,13 +54,20 @@ yup_standalone_app (
TARGET_IDE_GROUP "Examples"
TARGET_APP_ID "org.yup.${target_name}"
TARGET_APP_NAMESPACE "org.yup"
DEFINITIONS
YUP_EXAMPLE_GRAPHICS_RIVE_FILE="${rive_file}"
PRELOAD_FILES
"${CMAKE_CURRENT_LIST_DIR}/data/RobotoFlex-VariableFont.ttf@data/RobotoFlex-VariableFont.ttf"
"${CMAKE_CURRENT_LIST_DIR}/${rive_file}@${rive_file}"
MODULES
yup::yup_core
yup::yup_audio_basics
yup::yup_audio_devices
yup::yup_events
yup::yup_graphics
yup::yup_gui
yup::yup_audio_processors
libpng
libwebp
${link_libraries})

# ==== Prepare sources
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
115 changes: 115 additions & 0 deletions examples/graphics/source/examples/Artboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
==============================================================================

This file is part of the YUP library.
Copyright (c) 2025 - kunitoki@gmail.com

YUP is an open source library subject to open-source licensing.

The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
to use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.

YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.

==============================================================================
*/

#pragma once

namespace yup
{

class ArtboardDemo : public yup::Component
{
public:
ArtboardDemo()
{
setWantsKeyboardFocus (true);
}

bool loadArtboard()
{
auto factory = getNativeComponent()->getFactory();
if (factory == nullptr)
return false;

#if JUCE_ANDROID
yup::MemoryInputStream is (yup::RiveFile_data, yup::RiveFile_size, false);
auto artboardFile = yup::ArtboardFile::load (is, *factory);

#else
yup::File riveBasePath;
#if YUP_WASM
riveBasePath = yup::File ("/");
#else
riveBasePath = yup::File (__FILE__)
.getParentDirectory()
.getParentDirectory()
.getParentDirectory();
#endif

auto artboardFile = yup::ArtboardFile::load (riveBasePath.getChildFile (YUP_EXAMPLE_GRAPHICS_RIVE_FILE), *factory);
#endif
if (! artboardFile)
return false;

// Setup artboards
for (int i = 0; i < totalRows * totalColumns; ++i)
{
auto art = artboards.add (std::make_unique<yup::Artboard> (yup::String ("art") + yup::String (i)));
addAndMakeVisible (art);

art->setFile (artboardFile.getValue());

art->advanceAndApply (i * art->durationSeconds());
}

return true;
}

void refreshDisplay (double lastFrameTimeSeconds) override
{
repaint();
}

void resized() override
{
//for (int i = 0; i < totalRows * totalColumns; ++i)
// artboards.getUnchecked (i)->setBounds (getLocalBounds().reduced (100.0f));

if (artboards.size() != totalRows * totalColumns)
return;

auto bounds = getLocalBounds().reduced (10, 20);
auto width = bounds.getWidth() / totalColumns;
auto height = bounds.getHeight() / totalRows;

for (int i = 0; i < totalRows; ++i)
{
auto row = bounds.removeFromTop (height);
for (int j = 0; j < totalColumns; ++j)
{
auto col = row.removeFromLeft (width);
artboards.getUnchecked (j * totalRows + i)->setBounds (col.largestFittingSquare());
}
}
}

void paint (Graphics& g) override
{
g.setFillColor (findColor (yup::DocumentWindow::Style::backgroundColorId).value_or (yup::Colors::dimgray));
g.fillAll();
}

private:
yup::OwnedArray<yup::Artboard> artboards;
int totalRows = 1;
int totalColumns = 1;
};

} // namespace yup
6 changes: 6 additions & 0 deletions examples/graphics/source/examples/Audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ class AudioExample
oscilloscope.setBounds (bottomBounds);
}

void paint (yup::Graphics& g) override
{
g.setFillColor (findColor (yup::DocumentWindow::Style::backgroundColorId).value_or (yup::Colors::dimgray));
g.fillAll();
}

void mouseDown (const yup::MouseEvent& event) override
{
takeKeyboardFocus();
Expand Down
Loading
Loading