All Projects → sciter-sdk → Rust Sciter

sciter-sdk / Rust Sciter

Licence: mit
Rust bindings for Sciter

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rust Sciter

Pychess
PyChess - a chess client for Linux/Windows
Stars: ✭ 414 (-14.11%)
Mutual labels:  gui
Rust Skia
Safe Skia Bindings for Rust
Stars: ✭ 450 (-6.64%)
Mutual labels:  rust-bindings
Htmlpy
htmlPy is a wrapper around PySide's QtWebKit library. It helps with creating beautiful GUIs using HTML5, CSS3 and Javascript for standalone Python applications.
Stars: ✭ 463 (-3.94%)
Mutual labels:  gui
Mongo Express
Web-based MongoDB admin interface, written with Node.js and express
Stars: ✭ 4,403 (+813.49%)
Mutual labels:  gui
Linux Wifi Hotspot
Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
Stars: ✭ 434 (-9.96%)
Mutual labels:  gui
Sieve
Sieve Script Editor
Stars: ✭ 452 (-6.22%)
Mutual labels:  gui
Scheme Lib
鸭库 duck lib scheme for gui gles gl slib openal socket web mongodb box2d game glfw mysql libevent libuv uv json http client server android osx linux chezscheme scheme-lib
Stars: ✭ 406 (-15.77%)
Mutual labels:  gui
Astroid
A graphical threads-with-tags style, lightweight and fast, e-mail client for Notmuch
Stars: ✭ 476 (-1.24%)
Mutual labels:  gui
Open3d
Open3D: A Modern Library for 3D Data Processing
Stars: ✭ 5,860 (+1115.77%)
Mutual labels:  gui
Hb Appstore
Homebrew App Store - GUI for downloading/managing homebrew apps for video game consoles
Stars: ✭ 463 (-3.94%)
Mutual labels:  gui
Nuklear
A single-header ANSI C immediate mode cross-platform GUI library
Stars: ✭ 5,055 (+948.76%)
Mutual labels:  gui
Nigui
Cross-platform desktop GUI toolkit written in Nim
Stars: ✭ 430 (-10.79%)
Mutual labels:  gui
Node X11
X11 node.js network protocol client
Stars: ✭ 453 (-6.02%)
Mutual labels:  gui
Excelmerge
GUI Diff Tool for Excel
Stars: ✭ 425 (-11.83%)
Mutual labels:  gui
Sloth
Mac app that shows all open files, directories, sockets, pipes and devices in use by all running processes. Nice GUI for lsof.
Stars: ✭ 4,549 (+843.78%)
Mutual labels:  gui
Guilitesamples
✨Small interesting GUI effects could be reused everywhere
Stars: ✭ 409 (-15.15%)
Mutual labels:  gui
Imagealpha
Mac GUI for pngquant, pngnq and posterizer
Stars: ✭ 452 (-6.22%)
Mutual labels:  gui
Get It
A macOS GUI for youtube-dl
Stars: ✭ 483 (+0.21%)
Mutual labels:  gui
Core2d
A multi-platform data driven 2D diagram editor.
Stars: ✭ 475 (-1.45%)
Mutual labels:  gui
Npm Gui
Graphic tool for managing javascript project dependencies - in a friendly way.
Stars: ✭ 454 (-5.81%)
Mutual labels:  gui

Rust bindings for Sciter

Build status Build Status Minimum supported Rust version Current Version Documentation License Join the forums at https://sciter.com/forums

Check this page for other language bindings (Delphi / D / Go / .NET / Python / Rust).


Introduction

Sciter is an embeddable multiplatform HTML/CSS/script engine with GPU accelerated rendering designed to render modern desktop application UI. It's a compact, single dll/dylib/so file (4-8 mb) engine without any additional dependencies.

Screenshots

Check the screenshot gallery of desktop UI examples and DirectX UI integration via Rust GFX.

Description

Physically Sciter is a mono library which contains:

  • HTML and CSS rendering engine based on the H-SMILE core used in HTMLayout,
  • JavaScript alike Scripting engine – core of TIScript which by itself is based on c-smile engine,
  • Persistent Database (a.k.a. JSON DB) based on excellent DB products of Konstantin Knizhnik.
  • Graphics module that uses native graphics primitives provided by supported platforms: Direct2D on Windows 7 and above, GDI+ on Windows XP, CoreGraphics on MacOS, Cairo on Linux/GTK. Yet there is an option to use built-in Skia/OpenGL backend on each platform.
  • Network communication module, it relies on platform HTTP client primitives and/or Libcurl.

Internally it contains the following modules:

  • CSS – CSS parser and the collection of parsed CSS rules, etc.
  • HTML DOM – HTML parser and DOM tree implementation.
  • layout managers – collection of various layout managers – text layout, default block layout, flex layouts. Support of positioned floating elements is also here. This module does the layout calculations heavy lifting. This module is also responsible for the rendering of layouts.
  • input behaviors – a collection of built-in behaviors – code behind "active" DOM elements: <input>, <select>, <textarea>, etc.
  • script module – source-to-bytecode compiler and virtual machine (VM) with compacting garbage collector (GC). This module also contains runtime implementation of standard classes and objects: Array, Object, Function and others.
  • script DOM – runtime classes that expose DOM and DOM view (a.k.a. window) to the script.
  • graphics abstraction layer – abstract graphics implementation that isolates the modules mentioned above from the particular platform details:
    • Direct2D/DirectWrite graphics backend (Windows);
    • GDI+ graphics backend (Windows);
    • CoreGraphics backend (Mac OS X);
    • Cairo backend (GTK on all Linux platforms);
    • Skia/OpenGL backend (all platforms)
  • core primitives – set of common primitives: string, arrays, hash maps and so on.

Sciter supports all standard elements defined in HTML5 specification with some additions. CSS is extended to better support the Desktop UI development, e.g. flow and flex units, vertical and horizontal alignment, OS theming.

Sciter SDK comes with a demo "browser" with a builtin DOM inspector, script debugger and documentation viewer:

Sciter tools

Check https://sciter.com website and its documentation resources for engine principles, architecture and more.

Getting started:

  1. Download the Sciter SDK and extract it somewhere.
  2. Add the corresponding target platform binaries to PATH (bin.win, bin.osx or bin.lnx).
  3. If you do not already have it installed, you need GTK 3 development tools installed to continue: sudo apt-get install libgtk-3-dev
  4. Build the crate and run a minimal sciter sample: cargo run --example minimal.
  5. For your apps add the following dependency to the Cargo.toml: sciter-rs = "*".

Brief look:

Here is a minimal sciter app:

extern crate sciter;

fn main() {
    let mut frame = sciter::Window::new();
    frame.load_file("minimal.htm");
    frame.run_app();
}

It looks similar to this:

Minimal sciter sample

Interoperability

In respect of tiscript functions calling:

use sciter::{Element, Value};

let root = Element::from_window(hwnd);
let result: Value = root.call_function("namespace.name", &make_args!(1,"2",3));

Calling Rust from script can be implemented as following:

struct Handler;

impl Handler {
  fn calc_sum(&self, a: i32, b: i32) -> i32 {
    a + b
  }
}

impl sciter::EventHandler for Handler {
  dispatch_script_call! {
    fn calc_sum(i32, i32);
  }
}

And we can access this function from script:

// `view` represents window where script is running.
// `stdout` stream is a standard output stream (shell or debugger console, for example)

stdout.printf("2 + 3 = %d\n", view.calc_sum(2, 3));

Check rust-sciter/examples folder for more complex usage.

Library documentation.

What is supported right now:

  • [x] sciter::window which brings together window creation, host and event handlers.
  • [x] sciter::host with basic event handling, needs to be redesigned.
  • [x] sciter::event_handler with event handling and auto dispatching script calls to native code.
  • [x] sciter::dom for HTML DOM access and manipulation methods.
  • [x] sciter::value Rust wrapper.
  • [x] sciter::behavior_factory - global factory for native behaviors.
  • [x] sciter::graphics - platform independent graphics native interface (can be used in native behaviors).
  • [x] sciter::request - resource request object, used for custom resource downloading and handling.
  • [x] sciter::video - custom video rendering.
  • [x] sciter::archive - Sciter's compressed archive produced by sdk/bin/packfolder tool.
  • [x] sciter::msg - backend-independent input event processing.
  • [x] sciter::om - Sciter Object Model, extending Sciter by native code.
  • [x] NSE - native Sciter extensions.

Platforms:

  • [x] Windows
  • [x] OSX
  • [x] Linux
  • [x] Raspberry Pi

License

Bindings library licensed under MIT license. Sciter Engine has the own license terms and end used license agreement for SDK usage.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].