diff --git a/CHANGELOG.md b/CHANGELOG.md index 328706aac..e2a6596dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. - `Path::fill-color` was renamed to `fill`, and `Path::stroke-color` was renamed to `stroke`, which are now brushes instead of color - Many other color property became brush in order to support gradients - the `resource` type was renamed to `image` + - Calling a callback is done from C++/Rust with `invoke_` instead of `call_` ### Added - `@linear-gradient` can be used to have gradients on rectangle and paths diff --git a/api/sixtyfps-cpp/README.md b/api/sixtyfps-cpp/README.md index 33f7fcdb9..a2a548b71 100644 --- a/api/sixtyfps-cpp/README.md +++ b/api/sixtyfps-cpp/README.md @@ -161,7 +161,7 @@ struct MainWindow { inline auto get_todo_model () const -> std::shared_ptr>; inline void set_todo_model (const std::shared_ptr> &value) const; - inline void call_todo_added (sixtyfps::SharedString arg_0) const; + inline void invoke_todo_added (sixtyfps::SharedString arg_0) const; template inline void on_todo_added (Functor && callback_handler) const; //... diff --git a/api/sixtyfps-cpp/docs/generated_code.md b/api/sixtyfps-cpp/docs/generated_code.md index beb9b5fa6..fde09b6b0 100644 --- a/api/sixtyfps-cpp/docs/generated_code.md +++ b/api/sixtyfps-cpp/docs/generated_code.md @@ -18,7 +18,7 @@ This class will have the following public member functions: * A getter `get_` returning the property type. * A setter `set_` taking the new value of the property by const reference - for each callbacks: - * `call_` function which takes the callback argument as parameter and call the callback. + * `invoke_` function which takes the callback argument as parameter and call the callback. * `on_` functin wich takes a functor as an argument and sets the callback handler for this callback. the functor must accept the type parameter of the callback @@ -64,7 +64,7 @@ public: inline void set_user_name (const sixtyfps::SharedString &value) const; /// Call this function to call the `hello` callback - inline void call_hello () const; + inline void invoke_hello () const; /// Sets the callback handler for the `hello` callback. template inline void on_hello (Functor && callback_handler) const; diff --git a/api/sixtyfps-node/lib/index.ts b/api/sixtyfps-node/lib/index.ts index a9d543067..18f77df8c 100644 --- a/api/sixtyfps-node/lib/index.ts +++ b/api/sixtyfps-node/lib/index.ts @@ -81,7 +81,7 @@ require.extensions['.60'] = c.callbacks().forEach((x: string) => { Object.defineProperty(ret, x, { get() { - let callback = function () { return comp.call_callback(x, [...arguments]); } as Callback; + let callback = function () { return comp.invoke_callback(x, [...arguments]); } as Callback; callback.setHandler = function (callback) { comp.connect_callback(x, callback) }; return callback; }, diff --git a/api/sixtyfps-node/native/lib.rs b/api/sixtyfps-node/native/lib.rs index 7544c8fbe..f4c4800af 100644 --- a/api/sixtyfps-node/native/lib.rs +++ b/api/sixtyfps-node/native/lib.rs @@ -409,7 +409,7 @@ declare_types! { Ok(JsUndefined::new().as_value(&mut cx)) } - method call_callback(mut cx) { + method invoke_callback(mut cx) { let callback_name = cx.argument::(0)?.value(); let arguments = cx.argument::(1)?.to_vec(&mut cx)?; let this = cx.this(); @@ -444,7 +444,7 @@ declare_types! { let res = run_scoped(&mut cx,this.downcast().unwrap(), || { component.description() - .call_callback(component.borrow(), callback_name.as_str(), args.as_slice()) + .invoke_callback(component.borrow(), callback_name.as_str(), args.as_slice()) .map_err(|()| "Cannot emit callback".to_string()) })?; to_js_value(res, &mut cx) diff --git a/api/sixtyfps-rs/docs.rs b/api/sixtyfps-rs/docs.rs index b42a220d4..637073fa3 100644 --- a/api/sixtyfps-rs/docs.rs +++ b/api/sixtyfps-rs/docs.rs @@ -96,7 +96,7 @@ pub mod generated_code { /// For each callback declared at the root of the component, a function to call that /// callback is generated. This is the function that calls the `hello` callback declared /// in the `.60` design markup. - pub fn call_hello(&self) {} + pub fn invoke_hello(&self) {} /// For each callback declared at the root of the component, a function connect to that callback /// is generated. This is the function that registers the function f as callback when the /// callback `hello` is emitted. In order to access diff --git a/api/sixtyfps-rs/lib.rs b/api/sixtyfps-rs/lib.rs index 1824cb650..e2d25ecbc 100644 --- a/api/sixtyfps-rs/lib.rs +++ b/api/sixtyfps-rs/lib.rs @@ -111,7 +111,7 @@ For each top-level property - A getter [`fn get_(&self) -> `](docs::generated_code::SampleComponent::get_counter) For each top-level callback - - [`fn call_(&self)`](docs::generated_code::SampleComponent::call_hello): to emit the callback + - [`fn invoke_(&self)`](docs::generated_code::SampleComponent::invoke_hello): to invoke the callback - [`fn on_(&self, callback: impl Fn() + 'static)`](docs::generated_code::SampleComponent::on_hello): to set the callback handler. After instantiating the component you can call just [`fn run(&self)`] on it, in order to show it and spin the event loop to diff --git a/sixtyfps_compiler/generator/cpp.rs b/sixtyfps_compiler/generator/cpp.rs index e7f6116f4..77e064af8 100644 --- a/sixtyfps_compiler/generator/cpp.rs +++ b/sixtyfps_compiler/generator/cpp.rs @@ -684,7 +684,7 @@ fn generate_component( component_struct.members.push(( Access::Public, Declaration::Function(Function { - name: format!("call_{}", cpp_name), + name: format!("invoke_{}", cpp_name), signature: format!( "({}) const -> {}", param_types diff --git a/sixtyfps_compiler/generator/rust.rs b/sixtyfps_compiler/generator/rust.rs index 780480828..b4bc81ebf 100644 --- a/sixtyfps_compiler/generator/rust.rs +++ b/sixtyfps_compiler/generator/rust.rs @@ -291,7 +291,7 @@ fn generate_component( let args_name = (0..callback_args.len()) .map(|i| format_ident!("arg_{}", i)) .collect::>(); - let caller_ident = format_ident!("call_{}", prop_name); + let caller_ident = format_ident!("invoke_{}", prop_name); property_and_callback_accessors.push( quote!( #[allow(dead_code)] diff --git a/sixtyfps_runtime/interpreter/api.rs b/sixtyfps_runtime/interpreter/api.rs index ad68d5258..fb2f3e981 100644 --- a/sixtyfps_runtime/interpreter/api.rs +++ b/sixtyfps_runtime/interpreter/api.rs @@ -450,10 +450,10 @@ impl ComponentInstance { } /// Call the given callback with the arguments - pub fn call_callback(&self, name: &str, args: &[Value]) -> Result { + pub fn invoke_callback(&self, name: &str, args: &[Value]) -> Result { generativity::make_guard!(guard); let comp = self.inner.unerase(guard); - Ok(comp.description().call_callback(comp.borrow(), name, &args).map_err(|()| todo!())?) + Ok(comp.description().invoke_callback(comp.borrow(), name, &args).map_err(|()| todo!())?) } /// Marks the window of this component to be shown on the screen. This registers @@ -545,7 +545,7 @@ pub enum SetCallbackError { NoSuchCallback, } -/// Error returned by [`ComponentInstance::call_callback`] +/// Error returned by [`ComponentInstance::invoke_callback`] pub enum CallCallbackError { /// There is no callback with the given name NoSuchCallback, diff --git a/sixtyfps_runtime/interpreter/dynamic_component.rs b/sixtyfps_runtime/interpreter/dynamic_component.rs index ea66f317e..1ea73b0db 100644 --- a/sixtyfps_runtime/interpreter/dynamic_component.rs +++ b/sixtyfps_runtime/interpreter/dynamic_component.rs @@ -441,7 +441,7 @@ impl<'id> ComponentDescription<'id> { /// /// Returns an error if the component is not an instance corresponding to this ComponentDescription, /// or if the callback with this name does not exist in this component - pub fn call_callback( + pub fn invoke_callback( &self, component: ComponentRefPin, name: &str, diff --git a/sixtyfps_runtime/interpreter/eval.rs b/sixtyfps_runtime/interpreter/eval.rs index 21daf5b24..b67fa9e92 100644 --- a/sixtyfps_runtime/interpreter/eval.rs +++ b/sixtyfps_runtime/interpreter/eval.rs @@ -223,7 +223,7 @@ pub fn eval_expression(e: &Expression, local_context: &mut EvalLocalContext) -> } ComponentInstance::GlobalComponent(global) => { let args = arguments.iter().map(|e| eval_expression(e, local_context)); - global.as_ref().call_callback(name.as_ref(), args.collect::>().as_slice()) + global.as_ref().invoke_callback(name.as_ref(), args.collect::>().as_slice()) } } } diff --git a/sixtyfps_runtime/interpreter/global_component.rs b/sixtyfps_runtime/interpreter/global_component.rs index 57b31cf83..4fd027c78 100644 --- a/sixtyfps_runtime/interpreter/global_component.rs +++ b/sixtyfps_runtime/interpreter/global_component.rs @@ -18,7 +18,7 @@ use sixtyfps_corelib::{rtti, Callback, Property}; use crate::{api::Value, eval}; pub trait GlobalComponent { - fn call_callback(self: Pin<&Self>, _callback_name: &str, _args: &[Value]) -> Value { + fn invoke_callback(self: Pin<&Self>, _callback_name: &str, _args: &[Value]) -> Value { todo!("call callback") } diff --git a/tests/cases/bindings/two_way_binding.60 b/tests/cases/bindings/two_way_binding.60 index 57e1f2f07..bde6dddea 100644 --- a/tests/cases/bindings/two_way_binding.60 +++ b/tests/cases/bindings/two_way_binding.60 @@ -81,8 +81,8 @@ assert_eq!(instance.get_ti1_text(), sixtyfps::SharedString::from("Text1New")); assert_eq!(instance.get_ti2_text(), sixtyfps::SharedString::from("Text2New")); assert_eq!(instance.get_text_item_text(), sixtyfps::SharedString::from("Text2New")); -instance.call_set_ti1(sixtyfps::SharedString::from("Hallo")); -instance.call_set_ti2(sixtyfps::SharedString::from("Bonjour")); +instance.invoke_set_ti1(sixtyfps::SharedString::from("Hallo")); +instance.invoke_set_ti2(sixtyfps::SharedString::from("Bonjour")); assert_eq!(instance.get_text1(), sixtyfps::SharedString::from("Hallo")); assert_eq!(instance.get_text2(), sixtyfps::SharedString::from("Text2New")); assert_eq!(instance.get_ti1_text(), sixtyfps::SharedString::from("Hallo")); @@ -130,8 +130,8 @@ assert_eq(instance.get_ti1_text(), sixtyfps::SharedString("Text1New")); assert_eq(instance.get_ti2_text(), sixtyfps::SharedString("Text2New")); assert_eq(instance.get_text_item_text(), sixtyfps::SharedString("Text2New")); -instance.call_set_ti1(sixtyfps::SharedString("Hallo")); -instance.call_set_ti2(sixtyfps::SharedString("Bonjour")); +instance.invoke_set_ti1(sixtyfps::SharedString("Hallo")); +instance.invoke_set_ti2(sixtyfps::SharedString("Bonjour")); assert_eq(instance.get_text1(), sixtyfps::SharedString("Hallo")); assert_eq(instance.get_text2(), sixtyfps::SharedString("Text2New")); assert_eq(instance.get_ti1_text(), sixtyfps::SharedString("Hallo")); diff --git a/tests/cases/callbacks/handler.60 b/tests/cases/callbacks/handler.60 index 3ed2b531d..06d728985 100644 --- a/tests/cases/callbacks/handler.60 +++ b/tests/cases/callbacks/handler.60 @@ -23,12 +23,12 @@ int callback_3_emited = 0; instance.on_test_callback3([&]{ callback_3_emited++; }); instance.set_callback_emission_count(0); assert_eq(instance.get_callback_emission_count(), 0); -instance.call_test_callback(); +instance.invoke_test_callback(); assert_eq(instance.get_callback_emission_count(), 1); -instance.call_test_callback(); +instance.invoke_test_callback(); assert_eq(instance.get_callback_emission_count(), 2); assert_eq(callback_3_emited, 0); -instance.call_test_callback2(); +instance.invoke_test_callback2(); assert_eq(instance.get_callback_emission_count(), 88); assert_eq(callback_3_emited, 1); ``` @@ -43,12 +43,12 @@ instance.on_test_callback3({ }); instance.set_callback_emission_count(0); assert_eq!(instance.get_callback_emission_count(), 0); -instance.call_test_callback(); +instance.invoke_test_callback(); assert_eq!(instance.get_callback_emission_count(), 1); -instance.call_test_callback(); +instance.invoke_test_callback(); assert_eq!(instance.get_callback_emission_count(), 2); assert_eq!(callback_3_emited.get(), 0); -instance.call_test_callback2(); +instance.invoke_test_callback2(); assert_eq!(instance.get_callback_emission_count(), 88); assert_eq!(callback_3_emited.get(), 1); ``` diff --git a/tests/cases/callbacks/handler_with_arg.60 b/tests/cases/callbacks/handler_with_arg.60 index bd0f240e6..a9c47d8b1 100644 --- a/tests/cases/callbacks/handler_with_arg.60 +++ b/tests/cases/callbacks/handler_with_arg.60 @@ -31,10 +31,10 @@ instance.on_test_callback3([&](int a, auto b) { }); instance.set_callback_emission_count(0); assert_eq(instance.get_callback_emission_count(), 0); -instance.call_test_callback(42); +instance.invoke_test_callback(42); assert_eq(instance.get_callback_emission_count(), 1); assert_eq(callback_3_emited, 0); -instance.call_test_callback2("hello"); +instance.invoke_test_callback2("hello"); assert_eq(instance.get_callback_emission_count(), 88); assert_eq(callback_3_emited, 1); assert_eq(callback_3_int_value, 55); @@ -50,10 +50,10 @@ instance.on_test_callback3({ }); instance.set_callback_emission_count(0); assert_eq!(instance.get_callback_emission_count(), 0); -instance.call_test_callback(42); +instance.invoke_test_callback(42); assert_eq!(instance.get_callback_emission_count(), 1); assert_eq!(*callback_3_emited.borrow(), (0, "".into())); -instance.call_test_callback2("hello".into()); +instance.invoke_test_callback2("hello".into()); assert_eq!(instance.get_callback_emission_count(), 88); assert_eq!(*callback_3_emited.borrow(), (55, "hello".into())); ``` diff --git a/tests/cases/callbacks/return_value.60 b/tests/cases/callbacks/return_value.60 index 24695a640..425f0a5e7 100644 --- a/tests/cases/callbacks/return_value.60 +++ b/tests/cases/callbacks/return_value.60 @@ -33,7 +33,7 @@ instance.set_some_value(2); assert_eq!(instance.get_test_prop(), 4 + 4); assert_eq!(instance.get_test_prop2(), sixtyfps::SharedString::from("hello=44")); -assert_eq!(instance.call_test_func2("xxx".into(), 1), sixtyfps::SharedString::from("xxx=3")); +assert_eq!(instance.invoke_test_func2("xxx".into(), 1), sixtyfps::SharedString::from("xxx=3")); ``` ```cpp @@ -48,7 +48,7 @@ instance.set_some_value(2); assert_eq(instance.get_test_prop(), 4 + 4); assert_eq(instance.get_test_prop2(), sixtyfps::SharedString("hello=44")); -assert_eq(instance.call_test_func2("xxx", 1), sixtyfps::SharedString("xxx=3")); +assert_eq(instance.invoke_test_func2("xxx", 1), sixtyfps::SharedString("xxx=3")); ``` diff --git a/tests/cases/conditional/stm.60 b/tests/cases/conditional/stm.60 index ffa9e80e5..6e4803e0f 100644 --- a/tests/cases/conditional/stm.60 +++ b/tests/cases/conditional/stm.60 @@ -52,37 +52,37 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -instance.call_action(); +instance.invoke_action(); assert_eq(instance.get_result(), 3); instance.set_value(5); -instance.call_action(); +instance.invoke_action(); assert_eq(instance.get_result(), 5); instance.set_value(8); -instance.call_action(); +instance.invoke_action(); assert_eq(instance.get_result(), 5+33); -instance.call_xxx(); +instance.invoke_xxx(); assert_eq(instance.get_result(), 5+33-1); -assert_eq(instance.call_elseif(1), 41); -assert_eq(instance.call_elseif(2), 42); -assert_eq(instance.call_elseif(3), 43); +assert_eq(instance.invoke_elseif(1), 41); +assert_eq(instance.invoke_elseif(2), 42); +assert_eq(instance.invoke_elseif(3), 43); ``` ```rust let instance = TestCase::new(); -instance.call_action(); +instance.invoke_action(); assert_eq!(instance.get_result(), 3); instance.set_value(5); -instance.call_action(); +instance.invoke_action(); assert_eq!(instance.get_result(), 5); instance.set_value(8); -instance.call_action(); +instance.invoke_action(); assert_eq!(instance.get_result(), 5+33); -instance.call_xxx(); +instance.invoke_xxx(); assert_eq!(instance.get_result(), 5+33-1); -assert_eq!(instance.call_elseif(1), 41); -assert_eq!(instance.call_elseif(2), 42); -assert_eq!(instance.call_elseif(3), 43); +assert_eq!(instance.invoke_elseif(1), 41); +assert_eq!(instance.invoke_elseif(2), 42); +assert_eq!(instance.invoke_elseif(3), 43); ``` ```js diff --git a/tests/cases/expr/arithmetic.60 b/tests/cases/expr/arithmetic.60 index 73895fad9..41dedd6b6 100644 --- a/tests/cases/expr/arithmetic.60 +++ b/tests/cases/expr/arithmetic.60 @@ -31,7 +31,7 @@ assert_eq(instance.get_t2(), 500 / 2 * 30 - 1); instance.set_a(42); assert_eq(instance.get_t3(), 42 - (3 + 2 * (42 + 2))); assert_eq(instance.get_t4(), 3 + - 5 - 8 - -9 * - - - 120); -instance.call_foo(); +instance.invoke_foo(); assert_eq(instance.get_a(), (((42 + 8) * 10) / 2) - 3); ``` @@ -43,7 +43,7 @@ assert_eq!(instance.get_t2(), 500 / 2 * 30 - 1); instance.set_a(42); assert_eq!(instance.get_t3(), 42 - (3 + 2 * (42 + 2))); assert_eq!(instance.get_t4(), 3 + - 5 - 8 - -9 * --- 120); -instance.call_foo(); +instance.invoke_foo(); assert_eq!(instance.get_a(), (((42 + 8) * 10) / 2) - 3); ``` diff --git a/tests/cases/expr/return.60 b/tests/cases/expr/return.60 index 222ca0309..25f5bbd32 100644 --- a/tests/cases/expr/return.60 +++ b/tests/cases/expr/return.60 @@ -34,12 +34,12 @@ assert_eq(instance.get_value(), 100); instance.set_toggle(true); assert_eq(instance.get_value(), 42); -instance.call_test_signal(); +instance.invoke_test_signal(); assert(instance.get_signal_handled()); instance.set_signal_handled(false); instance.set_block_signal(true); -instance.call_test_signal(); +instance.invoke_test_signal(); assert(!instance.get_signal_handled()); ``` @@ -49,12 +49,12 @@ assert_eq!(instance.get_value(), 100); instance.set_toggle(true); assert_eq!(instance.get_value(), 42); -instance.call_test_signal(); +instance.invoke_test_signal(); assert!(instance.get_signal_handled()); instance.set_signal_handled(false); instance.set_block_signal(true); -instance.call_test_signal(); +instance.invoke_test_signal(); assert!(!instance.get_signal_handled()); ``` diff --git a/tests/cases/expr/string_concatenation.60 b/tests/cases/expr/string_concatenation.60 index 74a737b1d..022727dd2 100644 --- a/tests/cases/expr/string_concatenation.60 +++ b/tests/cases/expr/string_concatenation.60 @@ -29,7 +29,7 @@ assert_eq(instance.get_s1(), sixtyfps::SharedString("hello1212")); assert_eq(instance.get_s2(), sixtyfps::SharedString("10hello5.1")); instance.set_a(42); assert_eq(instance.get_s1(), sixtyfps::SharedString("hello4242")); -instance.call_foo(); +instance.invoke_foo(); assert_eq(instance.get_s3(), sixtyfps::SharedString("x42x42")); assert_eq(instance.get_s4(), sixtyfps::SharedString("ayoxxx")); ``` @@ -41,7 +41,7 @@ assert_eq!(instance.get_s1(), sixtyfps::SharedString::from("hello1212")); assert_eq!(instance.get_s2(), sixtyfps::SharedString::from("10hello5.1")); instance.set_a(42); assert_eq!(instance.get_s1(), sixtyfps::SharedString::from("hello4242")); -instance.call_foo(); +instance.invoke_foo(); assert_eq!(instance.get_s3(), sixtyfps::SharedString::from("x42x42")); assert_eq!(instance.get_s4(), sixtyfps::SharedString::from("ayoxxx")); ``` diff --git a/tests/cases/expr/string_template.60 b/tests/cases/expr/string_template.60 index 4c797986b..ac89310a5 100644 --- a/tests/cases/expr/string_template.60 +++ b/tests/cases/expr/string_template.60 @@ -28,7 +28,7 @@ assert_eq(instance.get_s1(), sixtyfps::SharedString("hello1212")); assert_eq(instance.get_s2(), sixtyfps::SharedString("10hello5.1")); instance.set_a(42); assert_eq(instance.get_s1(), sixtyfps::SharedString("hello4242")); -instance.call_foo(); +instance.invoke_foo(); assert_eq(instance.get_s3(), sixtyfps::SharedString("x42x42")); assert_eq(instance.get_s4(), sixtyfps::SharedString("ayoxxx")); ``` @@ -40,7 +40,7 @@ assert_eq!(instance.get_s1(), sixtyfps::SharedString::from("hello1212")); assert_eq!(instance.get_s2(), sixtyfps::SharedString::from("10hello5.1")); instance.set_a(42); assert_eq!(instance.get_s1(), sixtyfps::SharedString::from("hello4242")); -instance.call_foo(); +instance.invoke_foo(); assert_eq!(instance.get_s3(), sixtyfps::SharedString::from("x42x42")); assert_eq!(instance.get_s4(), sixtyfps::SharedString::from("ayoxxx")); ``` diff --git a/tests/cases/focus/focus_change_through_signal.60 b/tests/cases/focus/focus_change_through_signal.60 index 961882ff2..8e8be9eee 100644 --- a/tests/cases/focus/focus_change_through_signal.60 +++ b/tests/cases/focus/focus_change_through_signal.60 @@ -40,11 +40,11 @@ let instance = TestCase::new(); assert!(!instance.get_input1_focused()); assert!(!instance.get_input2_focused()); -instance.call_focus_input1(); +instance.invoke_focus_input1(); assert!(instance.get_input1_focused()); assert!(!instance.get_input2_focused()); -instance.call_focus_input2(); +instance.invoke_focus_input2(); assert!(!instance.get_input1_focused()); assert!(instance.get_input2_focused()); ``` @@ -55,11 +55,11 @@ const TestCase &instance = *handle; assert(!instance.get_input1_focused()); assert(!instance.get_input2_focused()); -instance.call_focus_input1(); +instance.invoke_focus_input1(); assert(instance.get_input1_focused()); assert(!instance.get_input2_focused()); -instance.call_focus_input2(); +instance.invoke_focus_input2(); assert(!instance.get_input1_focused()); assert(instance.get_input2_focused()); ``` diff --git a/tests/cases/focus/forward.60 b/tests/cases/focus/forward.60 index 49fd396de..b8dcf9ee5 100644 --- a/tests/cases/focus/forward.60 +++ b/tests/cases/focus/forward.60 @@ -34,7 +34,7 @@ TestCase := Rectangle { let instance = TestCase::new(); assert!(!instance.get_input_focused()); -instance.call_focus_rectangle(); +instance.invoke_focus_rectangle(); assert!(instance.get_input_focused()); ``` @@ -43,7 +43,7 @@ auto handle = TestCase::create(); const TestCase &instance = *handle; assert(!instance.get_input_focused()); -instance.call_focus_rectangle(); +instance.invoke_focus_rectangle(); assert(instance.get_input_focused()); ``` diff --git a/tests/cases/globals/global_binding.60 b/tests/cases/globals/global_binding.60 index 922d13301..4c1f67621 100644 --- a/tests/cases/globals/global_binding.60 +++ b/tests/cases/globals/global_binding.60 @@ -24,7 +24,7 @@ TestCase := Rectangle { ```rust let instance = TestCase::new(); assert_eq!(instance.get_value1(), 3+3); -instance.call_set_a(4); +instance.invoke_set_a(4); assert_eq!(instance.get_value1(), 4+3); ``` @@ -32,7 +32,7 @@ assert_eq!(instance.get_value1(), 4+3); auto handle = TestCase::create(); const TestCase &instance = *handle; assert_eq(instance.get_value1(), 3+3); -instance.call_set_a(4); +instance.invoke_set_a(4); assert_eq(instance.get_value1(), 4+3); ``` diff --git a/tests/cases/lookup/global_lookup.60 b/tests/cases/lookup/global_lookup.60 index f4afc87da..457f2c90e 100644 --- a/tests/cases/lookup/global_lookup.60 +++ b/tests/cases/lookup/global_lookup.60 @@ -23,8 +23,8 @@ Foo := Rectangle { TestCase := Rectangle { - callback call_glob; - call_glob => { + callback invoke_glob; + invoke_glob => { MyGlobal.glob_callback(); } Foo {} diff --git a/tests/cases/types/object.60 b/tests/cases/types/object.60 index 1297410f3..668fe5625 100644 --- a/tests/cases/types/object.60 +++ b/tests/cases/types/object.60 @@ -32,7 +32,7 @@ TestCase := Rectangle { let instance = TestCase::new(); assert_eq!(instance.get_foo_a(), sixtyfps::SharedString::from("444")); assert_eq!(instance.get_foo_b(), 12); -instance.call_change_foo(); +instance.invoke_change_foo(); assert_eq!(instance.get_foo_a(), sixtyfps::SharedString::from("hello")); assert_eq!(instance.get_foo_b(), 20); assert_eq!(instance.get_obj_cond_merge_b(), 0); @@ -50,7 +50,7 @@ auto handle = TestCase::create(); const TestCase &instance = *handle; assert_eq(instance.get_foo_a(), sixtyfps::SharedString("444")); assert_eq(instance.get_foo_b(), 12); -instance.call_change_foo(); +instance.invoke_change_foo(); assert_eq(instance.get_foo_a(), sixtyfps::SharedString("hello")); assert_eq(instance.get_foo_b(), 20); assert_eq(instance.get_obj_cond_merge_b(), 0);