logo
pub struct Host { /* private fields */ }
Expand description

Sciter host runtime support.

Implementations

Attach Sciter host to an existing window.

Usually Sciter window is created by sciter::Window::create(), but you can attach Sciter to an existing native window. In this case you need to mix-in window events processing with SciterProcND (Windows only). Sciter engine will be initialized either on WM_CREATE or WM_INITDIALOG response or by calling SciterCreateOnDirectXWindow (again, Windows only).

Attach Sciter host to an existing window with the given Host handler.

Attach dom::EventHandler to the Sciter window.

Register a native event handler for the specified behavior name.

See the Window::register_behavior for an example.

Register an archive produced by packfolder.

See documentation of the Archive.

Set debug mode for this window.

Get native window handle.

Get window root DOM element.

Load an HTML document from file.

Load an HTML document from memory.

This function is used as response to HostHandler::on_data_load request.

Use this function outside of HostHandler::on_data_load request.

It can be used for two purposes:

  1. Asynchronious resource loading in respect of on_data_load requests (you must use request_id in this case).
  2. Refresh of an already loaded resource (for example, dynamic image updates).

Evaluate the given script in context of the current document.

This function returns Result<Value,Value> with script function result value or with Sciter script error.

Call a script function defined in the global namespace.

This function returns Result<Value,Value> with script function result value or with Sciter script error.

You can use the &make_args!(args...) macro which helps you to construct script arguments from Rust types.

Set home url for Sciter resources.

If you set it like set_home_url("https://sciter.com/modules/") then

<script src="sciter:lib/root-extender.tis"> will load root-extender.tis from

https://sciter.com/modules/lib/root-extender.tis.

Set media type of this Sciter instance.

For example, media type can be “handheld”, “projection”, “screen”, “screen-hires”, etc. By default, Sciter window has the "screen" media type.

Media type name is used while loading and parsing style sheets in the engine, so you should call this function before loading document in it.

Set media variables (dictionary) for this Sciter instance.

By default Sciter window has "screen:true" and "desktop:true"/"handheld:true" media variables.

Media variables can be changed in runtime. This will cause styles of the document to be reset.

Example
host.set_media_vars( &vmap! {
  "screen" => true,
  "handheld" => true,
}).unwrap();

Set or append the master style sheet styles (globally, for all windows).

Set (reset) style sheet of the current document.

Will reset styles for all elements according to given CSS.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.