SCITER.COM

After 6 years Sciter Engine finally got its own home : sciter.com.

The site is not complete though, I am still working on content, documentation in particular. The plan is to combine in one place stuff that was spread across many sites and blog articles.

Forum users are advised to re-register on Sciter’s new forum at sciter.com/forums/ hope you will find it more comfortable.

Note #1: we have changed Sciter prices.

Note #2: Sciter’s versions RSS channel is here, please update your links.

ZIP resource packaging in Sciter

I am adding zip resource packaging support to Sciter v. 3.3.0.6.
Imagine that you have some folder where your app files are located:

content
  images
    img1.png 
    img2.png
  scripts
    script1.tis
  styles
    style1.css
  index.htm
  view1.htm
  dialog.htm

then you can load it into the Sciter using …/content/index.htm path. Nothing new up to this moment.

But with ZIP packaging support you can compress that folder into single content.zip file and load that zip into the engine as a whole using …/content.zip url.
Sciter will unzip that archive on the fly and will try to find and load either one of following files at its root: index.htm, index.html, main.htm or main.html.

All relative links inside that file will be resolved against content of the zip. So if you have <img src=”images/img1.png”> then its URl will be resolved to artificial
…/content.zip/images/img1.png and the image will be loaded from the zip.

Given schema allows to use same content in a folder or as packaged into zip file without any changes.
Among other use cases consider zip packaging for downloading applications over the wire – it will minimize bandwidth and eliminate multiple http connection requests for resources of the application.

WPF vs Sciter


WPF Sciter
Definition Windows Presentation Foundation (or WPF) is a graphical subsystem for rendering user interfaces in Windows-based applications by Microsoft. Is an embeddable graphical user interface engine (dynamic or static library) by Terra Informatica Software.
Released 2007 as part of Windows Vista. 2006 – h-smile core release date (HTMLayout, Sciter1, Sciter2 and Sciter3).
OSes Microsoft Windows Microsoft Windows, Mac OS X, Linux/GTK.
Technology .NET Framework 3.0 and above. Only managed API. Native code with native plain C API.
Distribution WindowsBase.dll, PresentationCore.dll, PresentationFoundation.dll (without .NET core) ~ 5 Mb Single sciter32/64.dll ~ 4 Mb
UI Architecture XAML DOM tree W3C compatible DOM tree.
Markup language XAML HTML5 and SVG.
Style language XAML, no cascading CSS – cascading style sheets.
Code behind UI .NET languages tiscript (JavaScript alike, built-in), C, C++, Delphi
Data Binding XAML data binding: one-time/one-way and two way
  • built-in string interpolation via stringizer functions;
  • kite – {{mustache}} alike template engine;
  • +plus – AngularJS alike two-way bindings based on Object.observe();
  • +vlist – one-way, virtual lists bound with arrays of records.
Media services vector and raster images, audio, video vector (SVG) and raster images, video with audio.
Graphics WPF rasterizer on top of DirectX.
Platform graphics:
  • Windows – Direct2D on top of DirectX
  • OS X – CoreGraphics
  • Linux – Cairo
Graphic primitives 2D graphics along with brushes, pens, geometries, and transforms.
  • All standard CSS primitives including filters and transforms.
  • <canvas> alike graphics primitives for immediate mode drawing along with brushes, pens, geometries, and transforms.
Templates Look of an element can be defined directly, via its properties, or indirectly with a Template or Style. Look of an element can be defined directly, via its style properties, or indirectly via style sheets. Structure of elements can be "templated" by Behavior classes (native or in script) and Aspect functions and applied to elements via CSS – properties: behavior, prototype and aspect.
Animations low level animation via timers and higher level abstractions of animations via the Animation classes. CSS transform property based animations, timeline (TweenLite alike) animation engine, low level animations via Element.animate().
Printing Supports paginated documents via DocumentViewer class. <frame type="pager"> supports print preview and printing of paginated HTML documents. Supports CSS page-break-after/before/inside properties.
Accessibility Microsoft UI Automation Microsoft UI Automation on Windows.

FreeConferenceCall – Sciter UI

fcc-mac

FreeConferenceCall company has published new version of their video conferencing application that aims at one-presenter-thousands-viewers video conferences and screen sharing.

Their application works on Windows and OS X and uses solely Sciter based UI with extensive use of Sciter’s unique popup DOM elements. Even video is rendered by Sciter with custom native video frames providers.

It is probably hard to realize, but that bar on the top and popup from it is HTML/CSS in reality.

Tokenizer + ::mark() = syntax colorizer

Here is selfie of syntax (tiscript) colorizer – the text below is a full source code of syntax highlighting routine.
The code has colorized itself:

syntax colorizer
syntax colorizer

Can your browser do that in 40 lines of code?

And here are styles that define style of tokens:

plaintext > text::mark(number) { color: brown; }
plaintext > text::mark(number-unit) { color: brown; }
plaintext > text::mark(string) { color: teal; }
plaintext > text::mark(keyword) { color: blue; }
plaintext > text::mark(symbol) { color: brown; }
plaintext > text::mark(literal) { color: brown; }
plaintext > text::mark(comment) { color: green; }

Easy, no?

And even shorter selfie, colorizer wrapped as an aspect component (referenced from colorizer.css):
colorizer

::mark(…) feature is comming

Please consider these tasks:

  1. Find all words in text on HTML page and highlight them
  2. Syntax highlighting: parse text of <pre> and mark all keywords by changing their color
  3. Find all misspelled words in <textarea> highlight them specifically.

Currently you can do #1 and #2 by wrapping each text found into <span>s with specific classes – thus to modify DOM structure of the document. Such modification by itself is a) not trivial to implement, b) is highly non-desirable (consider text editor with syntax highlighting) and c) even impossible in case of <textarea> for example.

Ideally we should have some facility that will allow us to a) mark text fragments, b) apply styling to such marked runs through CSS and c) do that without DOM tree modifications.

As a result upcoming Sciter will have:

  1. In CSS, support of ::mark(...name[s]...) pseudo element.
  2. In script runtime, new methods of Selection class:
    • Selection.applyMark(start,end, ... mark names...); – to add marks to the range.
    • Selection.clearMark(start,end, ... mark names...); – to clear marks from the range.

Example, CSS:

div::mark(hilite) { background-color:lime; } 
div::mark(hilite2) { background-color:cyan; }
div::mark(literal,string) { font-style:italic; color: red; }

First rule will tell the engine to set background color on all text runs that are marked by “hilite” to “lime”.

And script code

      var text = $(div).firstNode;
      var start = [bookmark: text, 6, false];
      var end   = [bookmark: text, 11, false];
      Selection.applyMark(start,end,"hilite");

will apply mark “hilite” to the text node from 6th until 11th position and so you will have the following rendering:
marks in text nodes
Note: this will not change DOM structure but rather apply some meta information to characters in the text.