Struct sciter::host::Host
[−]
[src]
pub struct Host { /* fields omitted */ }Sciter host runtime support.
Methods
impl Host[src]
pub fn attach(hwnd: HWINDOW) -> Host[src]
Attach Sciter host to existing window.
Usually Sciter window created by a 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.
Sciter engine will be initialized either on WM_CREATE or WM_INITDIALOG response
or by calling SciterCreateOnDirectXWindow.
pub fn attach_handler<Handler: EventHandler>(&self, handler: Handler)[src]
Attach dom::EventHandler to the Sciter window.
pub fn register_behavior<Factory>(&self, name: &str, factory: Factory) where
Factory: Fn() -> Box<EventHandler> + 'static, [src]
Factory: Fn() -> Box<EventHandler> + 'static,
Register a native event handler for the specified behavior name.
pub fn enable_debug(&self, enable: bool)[src]
Set debug mode for specific window or globally.
pub fn get_hwnd(&self) -> HWINDOW[src]
Get native window handle.
pub fn get_root(&self) -> Option<Element>[src]
Get window root DOM element.
pub fn load_file(&self, uri: &str)[src]
Load HTML document from file.
pub fn load_html(&self, html: &[u8], uri: Option<&str>)[src]
Load HTML document from memory.
pub fn data_ready(&self, uri: &str, data: &[u8])[src]
This function is used as response to SC_LOAD_DATA request.
pub fn data_ready_async(
&self,
uri: &str,
data: &[u8],
request_id: Option<*mut _HREQUEST>
)[src]
&self,
uri: &str,
data: &[u8],
request_id: Option<*mut _HREQUEST>
)
Use this function outside of SCN_LOAD_DATA request.
It can be used for the two purposes:
- Asynchronious resource loading in respect of
SCN_LOAD_DATArequests (you must providerequest_idin this case). - Refresh of already loaded resource (for example, dynamic image updates).
pub fn eval_script(&self, script: &str) -> Result<Value, Value>[src]
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.
pub fn call_function(&self, name: &str, args: &[Value]) -> Result<Value, Value>[src]
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.
pub fn set_option(&self, option: SCITER_RT_OPTIONS, value: usize) -> Result<()>[src]
: please use Window::set_options() instead.
Set various sciter engine options, see the SCITER_RT_OPTIONS.
pub fn set_home_url(&self, url: &str) -> Result<()>[src]
Set home url for sciter resources.
If you will 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.
pub fn set_media_type(&self, media_type: &str) -> Result<()>[src]
Set media type of this sciter instance.
pub fn set_media_vars(&self, media: &Value) -> Result<()>[src]
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.
pub fn set_master_css(&self, css: &str, append: bool) -> Result<()>[src]
Set or append the master style sheet styles (globally).
pub fn set_window_css(
&self,
css: &str,
base_url: &str,
media_type: &str
) -> Result<()>[src]
&self,
css: &str,
base_url: &str,
media_type: &str
) -> Result<()>
Set (reset) style sheet of current document.