Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ ifeq ($(CONFIG_DEMO_EXAMPLE),y)

libiui_example_files-y := tests/example.c
libiui_example_files-$(CONFIG_DEMO_PIXELWALL) += tests/pixelwall-demo.c
libiui_example_files-$(CONFIG_DEMO_FORTHSALON) += tests/forthsalon-demo.c
libiui_example_includes-y := include ports externals tests
libiui_example_depends-y := libiui.a $(NYANCAT_DATA)
libiui_example_ldflags-y := libiui.a $(TARGET_LIBS)
Expand Down
9 changes: 9 additions & 0 deletions configs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ config DEMO_PIXELWALL
Includes Snake, Pong, Tetris, Invaders, and Pacman March.
Uses a segmented button to switch between designs.

config DEMO_FORTHSALON
bool "Forth Salon Pixel Shader"
default y
depends on DEMO_EXAMPLE && MODULE_NAVIGATION
help
Forth Salon pixel shader demo. A bytecode Forth interpreter
runs a program per-pixel to generate animated visuals.
Built-in examples from boomlinde/sf (twister, rainbow, etc.).

endmenu

# Build Options
Expand Down
5 changes: 3 additions & 2 deletions src/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,9 @@ bool iui_bottom_sheet_begin(iui_context *ctx,

/* Track component for MD3 validation (use logical height, not padded rect)
*/
iui_rect_t validation_rect = {0, sheet_y, screen_width, current_height};
IUI_MD3_TRACK_BOTTOM_SHEET(validation_rect, IUI_BOTTOM_SHEET_CORNER_RADIUS);
IUI_MD3_TRACK_BOTTOM_SHEET(
((iui_rect_t) {0, sheet_y, screen_width, current_height}),
IUI_BOTTOM_SHEET_CORNER_RADIUS);

/* Draw drag handle */
float handle_x = (screen_width - IUI_BOTTOM_SHEET_DRAG_HANDLE_WIDTH) * 0.5f;
Expand Down
29 changes: 29 additions & 0 deletions tests/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
#include "pixelwall-demo.h"
#endif

#ifdef CONFIG_DEMO_FORTHSALON
#include "forthsalon-demo.h"
#endif

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
Expand Down Expand Up @@ -2930,6 +2934,10 @@ typedef struct {
pixelwall_state_t pixelwall;
bool show_pixelwall;
#endif
#ifdef CONFIG_DEMO_FORTHSALON
forthsalon_state_t forthsalon;
bool show_forthsalon;
#endif
#ifdef CONFIG_FEATURE_THEME
bool dark_mode;
#endif
Expand Down Expand Up @@ -3033,6 +3041,10 @@ static void demo_close_other_windows(demo_state_t *state, bool *keep_open)
if (&state->show_pixelwall != keep_open)
state->show_pixelwall = false;
#endif
#ifdef CONFIG_DEMO_FORTHSALON
if (&state->show_forthsalon != keep_open)
state->show_forthsalon = false;
#endif
}
#endif /* CONFIG_MODULE_BASIC */

Expand Down Expand Up @@ -3216,6 +3228,12 @@ static void example_frame(void *arg)
demo_close_other_windows(state, &state->show_pixelwall);
iui_grid_next(ui);
#endif
#ifdef CONFIG_DEMO_FORTHSALON
if (iui_switch(ui, "Forth Salon", &state->show_forthsalon, NULL, NULL) &&
state->show_forthsalon)
demo_close_other_windows(state, &state->show_forthsalon);
iui_grid_next(ui);
#endif
#ifdef CONFIG_FEATURE_THEME
if (iui_switch(ui, "Dark mode", &state->dark_mode, NULL, NULL)) {
iui_set_theme(ui,
Expand Down Expand Up @@ -3318,6 +3336,11 @@ static void example_frame(void *arg)
draw_pixelwall_window(ui, port, &state->pixelwall, delta_time,
get_demo_window_height());
#endif
#ifdef CONFIG_DEMO_FORTHSALON
if (state->show_forthsalon)
draw_forthsalon_window(ui, port, &state->forthsalon, delta_time,
get_demo_window_height());
#endif
#ifdef CONFIG_MODULE_INPUT
if (state->show_textfield_demo)
draw_textfield_window(ui);
Expand Down Expand Up @@ -3638,6 +3661,9 @@ int main(int argc, char *argv[])
#ifdef CONFIG_DEMO_PIXELWALL
state.show_pixelwall = DEMO_DEFAULT_VIS;
#endif
#ifdef CONFIG_DEMO_FORTHSALON
state.show_forthsalon = DEMO_DEFAULT_VIS;
#endif
#ifdef CONFIG_FEATURE_THEME
state.dark_mode = true;
#endif
Expand All @@ -3647,6 +3673,9 @@ int main(int argc, char *argv[])
#ifdef CONFIG_DEMO_PIXELWALL
pixelwall_init(&state.pixelwall);
#endif
#ifdef CONFIG_DEMO_FORTHSALON
forthsalon_init(&state.forthsalon);
#endif

#ifdef CONFIG_FEATURE_THEME
/* Set initial theme */
Expand Down
Loading
Loading