Skip to content

Commit

Permalink
Merge branch 'main' into chore/rename-crates
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Sep 17, 2024
2 parents 83d84f9 + e7423c1 commit 82f7adb
Show file tree
Hide file tree
Showing 39 changed files with 1,769 additions and 27,238 deletions.
13 changes: 11 additions & 2 deletions dotlottie-ffi/emscripten_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,21 @@ EMSCRIPTEN_BINDINGS(DotLottiePlayer)
.function("loadStateMachine", &DotLottiePlayer::load_state_machine)
.function("startStateMachine", &DotLottiePlayer::start_state_machine)
.function("stopStateMachine", &DotLottiePlayer::stop_state_machine)
.function("postEventPayload", &DotLottiePlayer::post_serialized_event)
.function("stateMachineFrameworkSetup", &DotLottiePlayer::state_machine_framework_setup)
.function("setStateMachineNumericContext", &DotLottiePlayer::set_state_machine_numeric_context)
.function("setStateMachineStringContext", &DotLottiePlayer::set_state_machine_string_context)
.function("setStateMachineBooleanContext", &DotLottiePlayer::set_state_machine_boolean_context)
.function("loadStateMachineData", &DotLottiePlayer::load_state_machine_data);
.function("loadStateMachineData", &DotLottiePlayer::load_state_machine_data)
.function("getLayerBounds", &DotLottiePlayer::get_layer_bounds)
.function("postBoolEvent", &DotLottiePlayer::post_bool_event)
.function("postStringEvent", &DotLottiePlayer::post_string_event)
.function("postNumericEvent", &DotLottiePlayer::post_numeric_event)
.function("postPointerDownEvent", &DotLottiePlayer::post_pointer_down_event)
.function("postPointerUpEvent", &DotLottiePlayer::post_pointer_up_event)
.function("postPointerMoveEvent", &DotLottiePlayer::post_pointer_move_event)
.function("postPointerEnterEvent", &DotLottiePlayer::post_pointer_enter_event)
.function("postPointerExitEvent", &DotLottiePlayer::post_pointer_exit_event)
.function("postSetNumericContext", &DotLottiePlayer::post_set_numeric_context);
// .function("state_machine_subscribe", &DotLottiePlayer::state_machine_subscribe)
// .function("state_machine_unsubscribe", &DotLottiePlayer::state_machine_unsubscribe)
}
13 changes: 12 additions & 1 deletion dotlottie-ffi/src/dotlottie_player.udl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ interface Event {
OnPointerUp(f32 x, f32 y);
OnPointerMove(f32 x, f32 y);
OnPointerEnter(f32 x, f32 y);
OnPointerExit();
OnPointerExit(f32 x, f32 y);
OnComplete();
SetNumericContext(string key, f32 value);
};
Expand Down Expand Up @@ -148,6 +148,7 @@ interface DotLottiePlayer {
boolean set_viewport(i32 x, i32 y, i32 w, i32 h);
f32 segment_duration();
sequence<f32> animation_size();
sequence<f32> get_layer_bounds([ByRef] string layer_name);

boolean load_state_machine([ByRef] string str);
boolean start_state_machine();
Expand All @@ -160,4 +161,14 @@ interface DotLottiePlayer {
boolean set_state_machine_boolean_context([ByRef] string key, boolean value);
sequence<string> state_machine_framework_setup();
boolean load_state_machine_data([ByRef] string state_machine);

i32 post_bool_event(boolean value);
i32 post_string_event([ByRef] string value);
i32 post_numeric_event(f32 value);
i32 post_pointer_down_event(f32 x, f32 y);
i32 post_pointer_up_event(f32 x, f32 y);
i32 post_pointer_move_event(f32 x, f32 y);
i32 post_pointer_enter_event(f32 x, f32 y);
i32 post_pointer_exit_event(f32 x, f32 y);
i32 post_set_numeric_context([ByRef] string key, f32 value);
};
11 changes: 10 additions & 1 deletion dotlottie-ffi/src/dotlottie_player_cpp.udl
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,23 @@ interface DotLottiePlayer {
boolean set_viewport(i32 x, i32 y, i32 w, i32 h);
f32 segment_duration();
sequence<f32> animation_size();
sequence<f32> get_layer_bounds([ByRef] string layer_name);

boolean load_state_machine([ByRef] string str);
boolean start_state_machine();
boolean stop_state_machine();
i32 post_serialized_event(string event);
boolean set_state_machine_numeric_context([ByRef] string key, f32 value);
boolean set_state_machine_string_context([ByRef] string key, [ByRef] string value);
boolean set_state_machine_boolean_context([ByRef] string key, boolean value);
sequence<string> state_machine_framework_setup();
boolean load_state_machine_data([ByRef] string state_machine);
i32 post_bool_event(boolean value);
i32 post_string_event([ByRef] string value);
i32 post_numeric_event(f32 value);
i32 post_pointer_down_event(f32 x, f32 y);
i32 post_pointer_up_event(f32 x, f32 y);
i32 post_pointer_move_event(f32 x, f32 y);
i32 post_pointer_enter_event(f32 x, f32 y);
i32 post_pointer_exit_event(f32 x, f32 y);
i32 post_set_numeric_context([ByRef] string key, f32 value);
};
Loading

0 comments on commit 82f7adb

Please sign in to comment.