Git Product home page Git Product logo

kas's Introduction

KAS GUI

Test Status Crates.io kas-text Docs Minimum rustc version

KAS is a pure-Rust GUI toolkit with stateful widgets:

  • Pure, portable Rust
  • Very fast and CPU efficient
  • Flexible event handling without data races
  • Theme abstraction layer
  • Winit + WGPU shell supporting embedded accelerated content
  • More portable shells: OpenGL, CPU-rendered, integration
  • Complex text
  • OS integration: menus, fonts, IME
  • Accessibility: screen reader, translation

Animated Scalable

Documentation

Examples

See the examples directory and kas-gui/7guis.

Design

Data or widget first?

KAS attempts to blend several GUI models:

  • Like many older GUIs, there is a persistent tree of widgets with state
  • Like Elm, event handling uses messages; unlike Elm, messages may be handled anywhere in the widget tree (proceeding from leaf to root until handled)
  • Widgets have a stable identity using a path over optionally explicit components
  • Like Model-View-Controller designs, data separation is possible; unlike Elm this is not baked into the core of the design

The results:

  • Natural support for multiple windows (there is no central data model)
  • Widget trees (without MVC) are static and pre-allocated, though efficient enough that maintaining (many) thousands of not-currently-visible widgets isn't a problem
  • Support for accessibility (only navigation aspects so far)
  • MVC supports virtual scrolling (including persistent IDs for unrealised widgets)
  • MVC supports shared (Rc or Arc) data
  • MVC and stateful widget designs feel like two different architectures forced into the same UI toolkit

Crates and features

kas is a meta-package over the core (kas-core), widget library (kas-widgets), etc. See here.

At this point in time, kas-wgpu is the only windowing/rendering implementation thus kas uses this crate by default, though it is optional.

Feature flags

The kas crate enables most important features by default, excepting those requiring nightly rustc. Other crates enable fewer features by default. See Cargo.toml.

Copyright and Licence

The COPYRIGHT file includes a list of contributors who claim copyright on this project. This list may be incomplete; new contributors may optionally add themselves to this list.

The KAS library is published under the terms of the Apache License, Version 2.0. You may obtain a copy of this licence from the LICENSE file or on the following webpage: https://www.apache.org/licenses/LICENSE-2.0

kas's People

Contributors

captchaking avatar dhardy avatar nyanpasu64 avatar

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.