Giter VIP home page Giter VIP logo

yarrow's Introduction

Yarrow

Documentation Crates.io License

WORK IN PROGRESS. This project is currently unstable and is missing some features. Check the project board for more details.

A modern retained-mode GUI library in Rust with extreme performance and control, geared towards audio software.

gallery screenshot gallery screenshot

What to Expect

The goal of Yarrow is different from most other modern GUI libraries. Instead of focusing on typical declarative, styling, and layout concepts, Yarrow instead provides a powerful and novel retained-mode API with lots of control over exactly how elements are styled, laid-out, interacted with, and rendered. State management is also somewhat inspired by the Elm/Iced architectures.

The main focus is audio software. Only features that are needed for the Meadowlark DAW Project and its audio plugins are planned.

Features

  • Cross-platform (Linux, Mac, and Windows)
  • Native and lightweight
  • Hardware-accelerated rendering in wgpu with support for text, vector graphics, textures, and/or custom shaders
  • Extreme performance (you are in control over exactly how your elements are updated)
  • Can be used for both standalone applications and audio plugins
  • Designed from the ground-up to support multi-windowed applications
  • Scaling support (with built-in support for hi-dpi texture assets)
  • Pointer locking for knob and slider elements
  • Accessibility support*
  • Permissive MIT license

*Yarrow does not automatically set up accessibility for you. You must manually provide Yarrow with information on how accessibility tools should navigate your program.

How it Works

Yarrow takes a novel approach to GUI. Instead of having you think of your GUI in terms of a "widget tree", Yarrow has you think in terms of how elements (widgets) are actually rendered. There are no "parent elements". There are only elements, z indexes, and scissoring rectangles. No mucking around with margins, padding, vertical/horizontal list containers, grid containers, dividers, panels, etc. to get the layout you want. Instead you just simply define a function that sets the position and size of each element. Additionally, scissoring rectangles have a "scroll offset" vector which can be used to create scroll regions.

Yarrow is not declarative. Elements are added and removed dynamically at runtime. Each newly created element returns a handle to that element.

Yarrow uses an event-driven update system somewhat inspired by the Elm/Iced architectures. Elements cannot mutate application state, they can only send actions (events) to a global action queue. Actions are processed in a single monolithic user-defined action handler method. Inside this method, the user mutates their state and updates elements accordingly.

There is no "cascading" styling system, instead each element type just defines its own styling struct.

Rendering is done in wgpu using the RootVG library. Elements can also be rendered using custom wgpu shaders.

Get Started

To get started, read the book (WIP).

This repository only houses the GUI library. For examples and guides on how to use Yarrow for audio plugin development, see (TODO).

Contributing

See the project board for a list of current tasks.

If you have any questions, reach out in the Meadowlark Discord Server under the #yarrow channel.

yarrow's People

Contributors

billydm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

andrew-r-thomas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.