mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 13:24:48 +00:00
Some more refactoring of the interpreter
Move the content of lib.rs to a module so we can have some kind of public api in the lib.rs
This commit is contained in:
parent
0a48252702
commit
fd829fc89f
4 changed files with 306 additions and 281 deletions
|
@ -1,6 +1,6 @@
|
|||
use neon::prelude::*;
|
||||
|
||||
struct WrappedComponentType(Option<std::rc::Rc<interpreter::MyComponentType>>);
|
||||
struct WrappedComponentType(Option<std::rc::Rc<interpreter::ComponentDescription>>);
|
||||
|
||||
fn load(mut cx: FunctionContext) -> JsResult<JsValue> {
|
||||
let path = cx.argument::<JsString>(0)?.value();
|
||||
|
@ -19,7 +19,7 @@ fn load(mut cx: FunctionContext) -> JsResult<JsValue> {
|
|||
Ok(obj.as_value(&mut cx))
|
||||
}
|
||||
|
||||
fn show(ct: std::rc::Rc<interpreter::MyComponentType>) {
|
||||
fn show(ct: std::rc::Rc<interpreter::ComponentDescription>) {
|
||||
let component = interpreter::instentiate(ct);
|
||||
// FIXME: leak (that's because we somehow need a static life time)
|
||||
gl::sixtyfps_runtime_run_component_with_gl_renderer(component.leak())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue