22// SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)
33
44use core:: cell:: RefCell ;
5+ use i_slint_compiler:: langtype:: Type ;
6+ use i_slint_core:: model:: { Model , ModelRc } ;
7+ use i_slint_core:: window:: WindowHandleAccess ;
8+ use i_slint_core:: { ImageInner , SharedVector } ;
59use neon:: prelude:: * ;
610use rand:: RngCore ;
7- use slint_compiler_internal:: langtype:: Type ;
8- use slint_core_internal:: model:: { Model , ModelRc } ;
9- use slint_core_internal:: window:: WindowHandleAccess ;
10- use slint_core_internal:: { ImageInner , SharedVector } ;
1111use slint_interpreter:: ComponentHandle ;
1212
1313mod js_model;
1414mod persistent_context;
1515
1616struct WrappedComponentType ( Option < slint_interpreter:: ComponentDefinition > ) ;
1717struct WrappedComponentRc ( Option < slint_interpreter:: ComponentInstance > ) ;
18- struct WrappedWindow ( Option < slint_core_internal :: window:: WindowRc > ) ;
18+ struct WrappedWindow ( Option < i_slint_core :: window:: WindowRc > ) ;
1919
2020/// We need to do some gymnastic with closures to pass the ExecuteContext with the right lifetime
2121type GlobalContextCallback < ' c > =
@@ -154,7 +154,7 @@ fn create<'cx>(
154154
155155fn to_eval_value < ' cx > (
156156 val : Handle < ' cx , JsValue > ,
157- ty : slint_compiler_internal :: langtype:: Type ,
157+ ty : i_slint_compiler :: langtype:: Type ,
158158 cx : & mut impl Context < ' cx > ,
159159 persistent_context : & persistent_context:: PersistentContext < ' cx > ,
160160) -> NeonResult < slint_interpreter:: Value > {
@@ -177,12 +177,12 @@ fn to_eval_value<'cx>(
177177 . value ( )
178178 . parse :: < css_color_parser2:: Color > ( )
179179 . or_else ( |e| cx. throw_error ( & e. to_string ( ) ) ) ?;
180- Ok ( ( slint_core_internal :: Color :: from_argb_u8 ( ( c. a * 255. ) as u8 , c. r , c. g , c. b ) ) . into ( ) )
180+ Ok ( ( i_slint_core :: Color :: from_argb_u8 ( ( c. a * 255. ) as u8 , c. r , c. g , c. b ) ) . into ( ) )
181181 }
182182 Type :: Array ( a) => match val. downcast :: < JsArray > ( ) {
183183 Ok ( arr) => {
184184 let vec = arr. to_vec ( cx) ?;
185- Ok ( Value :: Model ( ModelRc :: new ( slint_core_internal :: model:: SharedVectorModel :: from (
185+ Ok ( Value :: Model ( ModelRc :: new ( i_slint_core :: model:: SharedVectorModel :: from (
186186 vec. into_iter ( )
187187 . map ( |i| to_eval_value ( i, ( * a) . clone ( ) , cx, persistent_context) )
188188 . collect :: < Result < SharedVector < _ > , _ > > ( ) ?,
@@ -199,7 +199,7 @@ fn to_eval_value<'cx>(
199199 Type :: Image => {
200200 let path = val. to_string ( cx) ?. value ( ) ;
201201 Ok ( Value :: Image (
202- slint_core_internal :: graphics:: Image :: load_from_path ( std:: path:: Path :: new ( & path) )
202+ i_slint_core :: graphics:: Image :: load_from_path ( std:: path:: Path :: new ( & path) )
203203 . or_else ( |_| cx. throw_error ( format ! ( "cannot load image {:?}" , path) ) ) ?,
204204 ) )
205205 }
@@ -284,7 +284,7 @@ fn to_js_value<'cx>(
284284 }
285285 js_object. as_value ( cx)
286286 }
287- Value :: Brush ( slint_core_internal :: Brush :: SolidColor ( c) ) => JsString :: new (
287+ Value :: Brush ( i_slint_core :: Brush :: SolidColor ( c) ) => JsString :: new (
288288 cx,
289289 & format ! ( "#{:02x}{:02x}{:02x}{:02x}" , c. red( ) , c. green( ) , c. blue( ) , c. alpha( ) ) ,
290290 )
@@ -546,7 +546,7 @@ fn singleshot_timer(mut cx: FunctionContext) -> JsResult<JsValue> {
546546 } ) ;
547547 } ;
548548
549- slint_core_internal :: timers:: Timer :: single_shot (
549+ i_slint_core :: timers:: Timer :: single_shot (
550550 std:: time:: Duration :: from_millis ( duration_in_msecs) ,
551551 callback,
552552 ) ;
@@ -564,6 +564,6 @@ register_module!(mut m, {
564564/// let some time elapse for testing purposes
565565fn mock_elapsed_time ( mut cx : FunctionContext ) -> JsResult < JsValue > {
566566 let ms = cx. argument :: < JsNumber > ( 0 ) ?. value ( ) ;
567- slint_core_internal :: tests:: slint_mock_elapsed_time ( ms as _ ) ;
567+ i_slint_core :: tests:: slint_mock_elapsed_time ( ms as _ ) ;
568568 Ok ( JsUndefined :: new ( ) . as_value ( & mut cx) )
569569}
0 commit comments