platynui-native 0.2.0.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of platynui-native might be problematic. Click here for more details.
- platynui_native-0.2.0.dev1/PKG-INFO +255 -0
- platynui_native-0.2.0.dev1/README.md +221 -0
- platynui_native-0.2.0.dev1/crates/core/Cargo.toml +24 -0
- platynui_native-0.2.0.dev1/crates/core/src/lib.rs +4 -0
- platynui_native-0.2.0.dev1/crates/core/src/platform/desktop.rs +109 -0
- platynui_native-0.2.0.dev1/crates/core/src/platform/error.rs +55 -0
- platynui_native-0.2.0.dev1/crates/core/src/platform/highlight.rs +102 -0
- platynui_native-0.2.0.dev1/crates/core/src/platform/keyboard.rs +301 -0
- platynui_native-0.2.0.dev1/crates/core/src/platform/mod.rs +40 -0
- platynui_native-0.2.0.dev1/crates/core/src/platform/module.rs +6 -0
- platynui_native-0.2.0.dev1/crates/core/src/platform/pointer.rs +152 -0
- platynui_native-0.2.0.dev1/crates/core/src/platform/registration.rs +40 -0
- platynui_native-0.2.0.dev1/crates/core/src/platform/screenshot.rs +134 -0
- platynui_native-0.2.0.dev1/crates/core/src/provider/descriptor.rs +59 -0
- platynui_native-0.2.0.dev1/crates/core/src/provider/error.rs +66 -0
- platynui_native-0.2.0.dev1/crates/core/src/provider/event.rs +45 -0
- platynui_native-0.2.0.dev1/crates/core/src/provider/factory.rs +8 -0
- platynui_native-0.2.0.dev1/crates/core/src/provider/mod.rs +24 -0
- platynui_native-0.2.0.dev1/crates/core/src/provider/registration.rs +150 -0
- platynui_native-0.2.0.dev1/crates/core/src/provider/tree_provider.rs +26 -0
- platynui_native-0.2.0.dev1/crates/core/src/types/mod.rs +7 -0
- platynui_native-0.2.0.dev1/crates/core/src/types/point.rs +150 -0
- platynui_native-0.2.0.dev1/crates/core/src/types/rect.rs +255 -0
- platynui_native-0.2.0.dev1/crates/core/src/types/size.rs +192 -0
- platynui_native-0.2.0.dev1/crates/core/src/ui/attributes.rs +144 -0
- platynui_native-0.2.0.dev1/crates/core/src/ui/contract/testkit.rs +576 -0
- platynui_native-0.2.0.dev1/crates/core/src/ui/contract.rs +237 -0
- platynui_native-0.2.0.dev1/crates/core/src/ui/identifiers.rs +139 -0
- platynui_native-0.2.0.dev1/crates/core/src/ui/mod.rs +20 -0
- platynui_native-0.2.0.dev1/crates/core/src/ui/namespace.rs +119 -0
- platynui_native-0.2.0.dev1/crates/core/src/ui/node.rs +573 -0
- platynui_native-0.2.0.dev1/crates/core/src/ui/pattern.rs +617 -0
- platynui_native-0.2.0.dev1/crates/core/src/ui/value.rs +122 -0
- platynui_native-0.2.0.dev1/crates/link/Cargo.toml +19 -0
- platynui_native-0.2.0.dev1/crates/link/src/lib.rs +64 -0
- platynui_native-0.2.0.dev1/crates/platform-linux-x11/Cargo.toml +15 -0
- platynui_native-0.2.0.dev1/crates/platform-linux-x11/src/lib.rs +8 -0
- platynui_native-0.2.0.dev1/crates/platform-macos/Cargo.toml +15 -0
- platynui_native-0.2.0.dev1/crates/platform-macos/src/lib.rs +8 -0
- platynui_native-0.2.0.dev1/crates/platform-mock/Cargo.toml +22 -0
- platynui_native-0.2.0.dev1/crates/platform-mock/src/desktop.rs +88 -0
- platynui_native-0.2.0.dev1/crates/platform-mock/src/highlight.rs +84 -0
- platynui_native-0.2.0.dev1/crates/platform-mock/src/keyboard.rs +286 -0
- platynui_native-0.2.0.dev1/crates/platform-mock/src/lib.rs +43 -0
- platynui_native-0.2.0.dev1/crates/platform-mock/src/pointer.rs +135 -0
- platynui_native-0.2.0.dev1/crates/platform-mock/src/screenshot.rs +302 -0
- platynui_native-0.2.0.dev1/crates/platform-windows/Cargo.toml +29 -0
- platynui_native-0.2.0.dev1/crates/platform-windows/src/desktop.rs +258 -0
- platynui_native-0.2.0.dev1/crates/platform-windows/src/highlight.rs +553 -0
- platynui_native-0.2.0.dev1/crates/platform-windows/src/init.rs +48 -0
- platynui_native-0.2.0.dev1/crates/platform-windows/src/lib.rs +20 -0
- platynui_native-0.2.0.dev1/crates/platform-windows/src/pointer.rs +184 -0
- platynui_native-0.2.0.dev1/crates/platform-windows/src/screenshot.rs +116 -0
- platynui_native-0.2.0.dev1/crates/provider-atspi/Cargo.toml +18 -0
- platynui_native-0.2.0.dev1/crates/provider-atspi/src/lib.rs +60 -0
- platynui_native-0.2.0.dev1/crates/provider-macos-ax/Cargo.toml +18 -0
- platynui_native-0.2.0.dev1/crates/provider-macos-ax/src/lib.rs +60 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/Cargo.toml +24 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/assets/mock_tree.xml +116 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/events.rs +42 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/factory.rs +44 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/focus.rs +113 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/input.rs +350 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/lib.rs +29 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/node.rs +156 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/provider.rs +96 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/tests.rs +339 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/tree.rs +555 -0
- platynui_native-0.2.0.dev1/crates/provider-mock/src/window.rs +350 -0
- platynui_native-0.2.0.dev1/crates/provider-windows-uia/Cargo.toml +34 -0
- platynui_native-0.2.0.dev1/crates/provider-windows-uia/src/com.rs +59 -0
- platynui_native-0.2.0.dev1/crates/provider-windows-uia/src/error.rs +27 -0
- platynui_native-0.2.0.dev1/crates/provider-windows-uia/src/lib.rs +20 -0
- platynui_native-0.2.0.dev1/crates/provider-windows-uia/src/map.rs +672 -0
- platynui_native-0.2.0.dev1/crates/provider-windows-uia/src/node.rs +1188 -0
- platynui_native-0.2.0.dev1/crates/provider-windows-uia/src/provider.rs +177 -0
- platynui_native-0.2.0.dev1/crates/runtime/Cargo.toml +36 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/keyboard.rs +246 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/keyboard_sequence.pest +697 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/keyboard_sequence.rs +336 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/lib.rs +26 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/pointer.rs +1574 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/provider/event.rs +154 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/provider/mod.rs +4 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/provider/registry.rs +246 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/runtime.rs +1692 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/test_support.rs +30 -0
- platynui_native-0.2.0.dev1/crates/runtime/src/xpath.rs +1431 -0
- platynui_native-0.2.0.dev1/crates/xpath/Cargo.toml +65 -0
- platynui_native-0.2.0.dev1/crates/xpath/README.md +65 -0
- platynui_native-0.2.0.dev1/crates/xpath/benches/advanced_benchmarks.rs +315 -0
- platynui_native-0.2.0.dev1/crates/xpath/benches/benchmark_constant_folding.rs +69 -0
- platynui_native-0.2.0.dev1/crates/xpath/benches/evaluate_first_benchmarks.rs +131 -0
- platynui_native-0.2.0.dev1/crates/xpath/benches/parser_smallvec.rs +51 -0
- platynui_native-0.2.0.dev1/crates/xpath/benches/performance_analysis.rs +302 -0
- platynui_native-0.2.0.dev1/crates/xpath/benches/short_circuit_benchmarks.rs +134 -0
- platynui_native-0.2.0.dev1/crates/xpath/benches/streaming_vs_materialized.rs +275 -0
- platynui_native-0.2.0.dev1/crates/xpath/benches/xpath_benches.rs +243 -0
- platynui_native-0.2.0.dev1/crates/xpath/docs/xpath20_coverage.md +90 -0
- platynui_native-0.2.0.dev1/crates/xpath/examples/repl.rs +191 -0
- platynui_native-0.2.0.dev1/crates/xpath/examples/simple.rs +58 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/compiler/ir.rs +527 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/compiler/mod.rs +886 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/compiler/optimizer.rs +395 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/consts.rs +18 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/collation.rs +142 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/eq.rs +480 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/evaluator.rs +5225 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/boolean.rs +56 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/collations.rs +62 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/common.rs +1861 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/constructors.rs +687 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/datetime.rs +509 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/diagnostics.rs +22 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/durations.rs +137 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/environment.rs +494 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/ids.rs +229 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/mod.rs +1433 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/numeric.rs +301 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/qnames.rs +290 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/regex.rs +52 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/sequences.rs +287 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/functions/strings.rs +361 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/mod.rs +5 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/engine/runtime.rs +1797 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/lib.rs +34 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/model/mod.rs +233 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/model/simple.rs +691 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/parser/ast.rs +233 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/parser/mod.rs +1252 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/parser/xpath2.pest +325 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/util/mod.rs +1 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/util/temporal.rs +262 -0
- platynui_native-0.2.0.dev1/crates/xpath/src/xdm/mod.rs +672 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/axes_wildcard_vs_node.rs +53 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/cast_daytime_duration_negative.rs +20 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/castable_matrix.rs +55 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/casts_basic.rs +147 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/casts_cardinality.rs +95 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/casts_fractional_seconds.rs +71 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/casts_matrix_full.rs +247 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/casts_temporal_extended.rs +141 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/comparisons_mixed_regression.rs +30 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/comparisons_untyped_numeric_regression.rs +39 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_arith_logic.rs +42 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_comparisons_types.rs +102 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_control_flow.rs +17 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_for_multi.rs +27 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_let_expr.rs +34 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_literals.rs +47 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_negative_lowering.rs +39 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_paths_predicates.rs +272 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_quantifiers_for.rs +31 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_set_ops.rs +15 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/compiler_vars_funcs.rs +35 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/document_node_inner.rs +49 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/duration_fractional_truncation.rs +22 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/equality_date_time_eqkey.rs +32 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/error_codes.rs +71 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluate_first.rs +170 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_aggregate_funcs.rs +86 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_arith_logic.rs +32 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_arith_promotion.rs +35 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_axes.rs +126 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_axes_siblings.rs +73 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_axis_namespace.rs +190 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_collation_comparisons.rs +42 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_comparison_extended.rs +110 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_comparison_matrix.rs +94 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_comparisons_numeric_matrix.rs +90 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_comparisons_type_errors.rs +21 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_comparisons_untyped.rs +35 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_ebv_consistency.rs +28 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_following_preceding.rs +145 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_for_expr.rs +43 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_general_comparisons.rs +88 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_general_incomparable.rs +30 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_kindtests_pi_document.rs +46 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_let_expr.rs +35 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_more.rs +155 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_nan_inf.rs +102 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_node_compare_cross_root.rs +46 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_numeric_funcs.rs +80 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_numeric_functions.rs +48 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_numeric_promotion.rs +34 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_overflow_policy.rs +46 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_path_filter_expr.rs +69 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_positional_predicates.rs +101 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_quantifiers.rs +48 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_quantifiers_multi.rs +23 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_quantifiers_nested.rs +34 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_set_ops.rs +44 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_short_circuit.rs +124 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_streaming.rs +575 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_temporal.rs +65 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_temporal_edges.rs +119 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_text_vs_dot.rs +64 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_types.rs +69 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/evaluator_value_comparisons.rs +43 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/function_conversion_runtime.rs +686 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_aggregates_types.rs +107 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_avg_mixed.rs +30 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_boolean_and_zero_arity.rs +162 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_cardinality.rs +53 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_codepoint_equal.rs +24 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_codepoints.rs +65 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_collations_compare.rs +50 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_collations_minmax_deepequal.rs +71 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_collations_strings.rs +54 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_compare_empty_3arg.rs +15 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_concat.rs +48 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_contains_untyped.rs +24 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_data.rs +37 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_datetime_adjust.rs +55 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_datetime_snapshot.rs +122 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_deep_equal.rs +24 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_deep_equal_atomic_advanced.rs +37 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_deep_equal_namespaces.rs +34 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_deep_equal_nodes.rs +46 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_deepequal_nodes.rs +31 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_distinct_values.rs +78 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_doc_collection.rs +67 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_env_doc_root.rs +81 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_error_trace.rs +52 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_id_idref.rs +110 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_index_of.rs +35 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_index_of_collations.rs +39 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_minmax_empty.rs +15 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_namespace_uri.rs +79 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_nilled_unordered_duration.rs +160 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_node_name.rs +93 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_qname_edges.rs +104 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_qname_namespace.rs +66 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_regex_backrefs.rs +45 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_regex_errors.rs +40 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_regex_flags.rs +56 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_round_high_precision.rs +24 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_string_edges.rs +111 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_substring_subsequence.rs +67 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_sum_avg_nan.rs +23 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_temporal_errors.rs +35 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_uri_lang.rs +101 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_wrong_arity_message.rs +13 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_ws5_rest_sanity.rs +59 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_xs_constructors.rs +86 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/functions_xs_constructors_more.rs +100 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/kindtests_element_attribute.rs +65 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/namespace_axis.rs +43 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/namespace_wildcards.rs +103 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/namespace_xml_binding.rs +50 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/optimizer_constant_folding.rs +123 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/optimizer_integration.rs +98 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_axes_full.rs +47 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_basic.rs +157 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_error_codes_more.rs +13 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_errors.rs +14 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_flwor_negative.rs +11 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_function_args_edges.rs +79 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_functions.rs +41 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_functions_aggregates.rs +43 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_if_expr_complex.rs +47 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_invalid_qnames.rs +23 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_kinds_basic.rs +41 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_names_wildcards.rs +54 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_negative_syntax.rs +15 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_nodes_ops.rs +27 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_numbers_strings.rs +43 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_param.rs +77 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_paths_axes.rs +65 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_precedence.rs +29 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_qnames_ns.rs +46 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_quantifiers_flwor.rs +28 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_reserved_functions.rs +87 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_schema_tests.rs +47 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_setops_casts.rs +36 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/parser_types_more.rs +39 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/property_deep_equal.rs +60 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/proptest_nan.rs +29 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/proptest_ordering.rs +48 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/proptest_round.rs +63 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/simple_node.rs +82 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/simple_node_cross_doc_order.rs +24 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/simple_node_ns_element.rs +25 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/static_context.rs +139 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/static_context_namespaces.rs +115 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/stream_additional.rs +180 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/stream_aggregates.rs +271 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/stream_count_basic.rs +142 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/stream_distinct_index.rs +124 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/stream_strings.rs +189 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/stream_transforms.rs +218 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/stream_validation.rs +203 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/streaming_behavior.rs +117 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/string_value_concat.rs +27 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/temporal_arith_matrix.rs +77 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/temporal_parsing.rs +86 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/test_sequence_cursors.rs +47 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/test_util.rs +15 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/treat_as_matrix.rs +54 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/type_matching_atomic.rs +67 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/untyped_atomic.rs +113 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/value_comparisons_qname_notation.rs +45 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/wildcard_document_node_bug.rs +115 -0
- platynui_native-0.2.0.dev1/crates/xpath/tests/ws6_duration_numeric.rs +64 -0
- platynui_native-0.2.0.dev1/packages/native/Cargo.lock +1428 -0
- platynui_native-0.2.0.dev1/packages/native/Cargo.toml +50 -0
- platynui_native-0.2.0.dev1/packages/native/MOCK_PROVIDERS.md +161 -0
- platynui_native-0.2.0.dev1/packages/native/README.md +221 -0
- platynui_native-0.2.0.dev1/packages/native/python/platynui_native/.gitignore +12 -0
- platynui_native-0.2.0.dev1/packages/native/python/platynui_native/__init__.py +48 -0
- platynui_native-0.2.0.dev1/packages/native/python/platynui_native/__init__.pyi +428 -0
- platynui_native-0.2.0.dev1/packages/native/python/platynui_native/__version__.py +1 -0
- platynui_native-0.2.0.dev1/packages/native/python/platynui_native/py.typed +0 -0
- platynui_native-0.2.0.dev1/packages/native/src/core.rs +413 -0
- platynui_native-0.2.0.dev1/packages/native/src/lib.rs +21 -0
- platynui_native-0.2.0.dev1/packages/native/src/runtime.rs +1346 -0
- platynui_native-0.2.0.dev1/packages/native/tests/conftest.py +28 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_desktop_focus.py +41 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_geometry.py +115 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_iterators.py +103 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_mock_providers.py +64 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_mock_tree_content.py +48 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_overrides_classes.py +53 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_overrides_frompyobject.py +62 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_runtime_basic.py +44 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_runtime_new.py +67 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_screenshot_highlight.py +16 -0
- platynui_native-0.2.0.dev1/packages/native/tests/test_type_hints.py +29 -0
- platynui_native-0.2.0.dev1/packages/native/uv.lock +259 -0
- platynui_native-0.2.0.dev1/pyproject.toml +58 -0
- platynui_native-0.2.0.dev1/python/platynui_native/__init__.py +48 -0
- platynui_native-0.2.0.dev1/python/platynui_native/__init__.pyi +428 -0
- platynui_native-0.2.0.dev1/python/platynui_native/__version__.py +1 -0
- platynui_native-0.2.0.dev1/python/platynui_native/py.typed +0 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: platynui-native
|
|
3
|
+
Version: 0.2.0.dev1
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Rust
|
|
15
|
+
Classifier: Topic :: Software Development :: Testing
|
|
16
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
17
|
+
Classifier: Framework :: Robot Framework
|
|
18
|
+
Classifier: Framework :: Robot Framework :: Library
|
|
19
|
+
Requires-Dist: pytest>=8.0 ; extra == 'dev'
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Summary: Native Python bindings for PlatynUI (core types + runtime)
|
|
22
|
+
Keywords: robotframework,platynui,gui,automation,desktop
|
|
23
|
+
Author-email: Daniel Biehl <daniel.biehl@imbus.de>
|
|
24
|
+
Maintainer-email: Daniel Biehl <daniel.biehl@imbus.de>
|
|
25
|
+
License: Apache-2.0
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
28
|
+
Project-URL: Homepage, https://github.com/imbus/robotframework-PlatynUI
|
|
29
|
+
Project-URL: Documentation, https://github.com/imbus/robotframework-PlatynUI#readme
|
|
30
|
+
Project-URL: Changelog, https://github.com/imbus/robotframework-PlatynUI/blob/main/CHANGELOG.md
|
|
31
|
+
Project-URL: Issues, https://github.com/imbus/robotframework-PlatynUI/issues
|
|
32
|
+
Project-URL: Source, https://github.com/imbus/robotframework-PlatynUI
|
|
33
|
+
|
|
34
|
+
platynui-native
|
|
35
|
+
================
|
|
36
|
+
|
|
37
|
+
Native Python bindings for PlatynUI using PyO3 + maturin.
|
|
38
|
+
|
|
39
|
+
Quick start (local develop):
|
|
40
|
+
|
|
41
|
+
- uv sync --dev
|
|
42
|
+
- uv run maturin develop -m packages/native/Cargo.toml --release --features mock-provider
|
|
43
|
+
|
|
44
|
+
Then in Python:
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from platynui_native import core, runtime
|
|
48
|
+
pt = core.Point(1.0, 2.0)
|
|
49
|
+
rt = runtime.Runtime()
|
|
50
|
+
items = rt.evaluate("/control:Desktop", None)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Run smoke tests (uses mock provider feature):
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
uv run maturin develop -m packages/native/Cargo.toml --release --features mock-provider
|
|
57
|
+
uv run pytest -q packages/native/tests
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
API overview
|
|
61
|
+
|
|
62
|
+
- Module layout
|
|
63
|
+
- `platynui_native.core`: `Point`/`Size`/`Rect`, `Namespace`, IDs, `attribute_names()`
|
|
64
|
+
- `platynui_native.runtime`: `Runtime`, `UiNode`, `UiAttribute`, `EvaluatedAttribute`, pointer/keyboard methods
|
|
65
|
+
|
|
66
|
+
- Creating a Runtime
|
|
67
|
+
- `rt = runtime.Runtime()`
|
|
68
|
+
|
|
69
|
+
- Pointer buttons
|
|
70
|
+
- Accepts: `'left' | 'middle' | 'right'`, `runtime.PointerButton` enum, or `int`.
|
|
71
|
+
- Mapping: `1 → LEFT`, `2 → MIDDLE`, `3 → RIGHT`, other ints → `Other(n)`.
|
|
72
|
+
|
|
73
|
+
- Pointer overrides (class)
|
|
74
|
+
- Timing (milliseconds unless noted):
|
|
75
|
+
- `after_move_delay_ms`, `after_input_delay_ms`, `press_release_delay_ms`,
|
|
76
|
+
`after_click_delay_ms`, `before_next_click_delay_ms`, `multi_click_delay_ms`,
|
|
77
|
+
`ensure_move_timeout_ms`, `scroll_delay_ms`, `max_move_duration_ms`.
|
|
78
|
+
- `move_time_per_pixel_us` (microseconds per pixel)
|
|
79
|
+
- Motion/profile:
|
|
80
|
+
- `speed_factor: float`
|
|
81
|
+
- `acceleration_profile: 'constant'|'ease_in'|'ease_out'|'smooth_step'`
|
|
82
|
+
- Origin (choose one):
|
|
83
|
+
- `'desktop'`
|
|
84
|
+
- `core.Point(x, y)` → absolute desktop point
|
|
85
|
+
- `core.Rect(x, y, w, h)` → relative to rect (top-left origin)
|
|
86
|
+
- Scrolling:
|
|
87
|
+
- `scroll_step: (h: float, v: float)`; `scroll_delay_ms`
|
|
88
|
+
- Other:
|
|
89
|
+
- `ensure_move_threshold: float`
|
|
90
|
+
- Properties: all fields are exposed read‑only (e.g. `ov.speed_factor`, `ov.origin`, `ov.after_move_delay_ms`).
|
|
91
|
+
|
|
92
|
+
- Keyboard overrides (class, milliseconds)
|
|
93
|
+
- `press_delay_ms`, `release_delay_ms`, `between_keys_delay_ms`,
|
|
94
|
+
`chord_press_delay_ms`, `chord_release_delay_ms`,
|
|
95
|
+
`after_sequence_delay_ms`, `after_text_delay_ms`.
|
|
96
|
+
- Properties: `kov.press_delay_ms`, `kov.between_keys_delay_ms`, etc.
|
|
97
|
+
|
|
98
|
+
Examples
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from platynui_native import core, runtime
|
|
102
|
+
rt = runtime.Runtime()
|
|
103
|
+
|
|
104
|
+
# Move & click with overrides
|
|
105
|
+
ov = runtime.PointerOverrides(speed_factor=1.5, after_move_delay_ms=15, origin='desktop')
|
|
106
|
+
rt.pointer_move_to(core.Point(100, 200), overrides=ov)
|
|
107
|
+
rt.pointer_click(core.Point(100, 200), button=runtime.PointerButton.LEFT,
|
|
108
|
+
overrides=runtime.PointerOverrides(multi_click_delay_ms=240))
|
|
109
|
+
|
|
110
|
+
# Drag with relative origin
|
|
111
|
+
rt.pointer_drag(core.Point(10, 10), core.Point(180, 140), button=runtime.PointerButton.LEFT,
|
|
112
|
+
overrides=runtime.PointerOverrides(origin=core.Rect(50, 60, 200, 200)))
|
|
113
|
+
|
|
114
|
+
# Keyboard with custom timings
|
|
115
|
+
rt.keyboard_type("Hello", overrides=runtime.KeyboardOverrides(between_keys_delay_ms=5))
|
|
116
|
+
rt.keyboard_press("<Ctrl+C>")
|
|
117
|
+
rt.keyboard_release("<Ctrl+C>")
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Notes
|
|
121
|
+
|
|
122
|
+
- The mock provider feature (`--features mock-provider`) is intended for local development without platform backends. Some pointer/keyboard calls may raise `PointerError`/`KeyboardError` if the device is not available; structure/typing of arguments is still validated.
|
|
123
|
+
|
|
124
|
+
- Evaluate results
|
|
125
|
+
- `Runtime.evaluate()` returns a list of `UiNode`, `EvaluatedAttribute`, or plain values (`UiValue`).
|
|
126
|
+
- `UiNode.attributes()` returns `list[UiAttribute]` (no owner).
|
|
127
|
+
- `EvaluatedAttribute` includes an `owner()` reference back to the `UiNode` it belongs to.
|
|
128
|
+
|
|
129
|
+
Reference
|
|
130
|
+
|
|
131
|
+
- Pointer defaults (from runtime profile/settings)
|
|
132
|
+
- double_click_time: 500 ms; double_click_size: (4.0, 4.0); default_button: left
|
|
133
|
+
- mode: Linear; steps_per_pixel: 1.5; speed_factor: 1.0
|
|
134
|
+
- max_move_duration: 600 ms; move_time_per_pixel: 800 µs
|
|
135
|
+
- acceleration_profile: SmoothStep
|
|
136
|
+
- after_move_delay: 40 ms; after_input_delay: 35 ms
|
|
137
|
+
- press_release_delay: 50 ms; after_click_delay: 80 ms
|
|
138
|
+
- before_next_click_delay: 120 ms; multi_click_delay: 500 ms
|
|
139
|
+
- ensure_move_position: true; ensure_move_threshold: 2.0; ensure_move_timeout: 250 ms
|
|
140
|
+
- scroll_step: (0.0, -120.0); scroll_delay: 40 ms
|
|
141
|
+
|
|
142
|
+
- Keyboard defaults (KeyboardSettings.default)
|
|
143
|
+
- press_delay: 35 ms; release_delay: 25 ms
|
|
144
|
+
- between_keys_delay: 40 ms
|
|
145
|
+
- chord_press_delay: 45 ms; chord_release_delay: 45 ms
|
|
146
|
+
- after_sequence_delay: 75 ms; after_text_delay: 20 ms
|
|
147
|
+
|
|
148
|
+
Robot Framework usage (example)
|
|
149
|
+
|
|
150
|
+
Wrap the native runtime into a simple Python library and import it in Robot suites:
|
|
151
|
+
|
|
152
|
+
1) Create `examples/robot/platynui_lib.py`:
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from platynui_native import runtime
|
|
156
|
+
|
|
157
|
+
class PlatynUILib:
|
|
158
|
+
def __init__(self):
|
|
159
|
+
self.rt = runtime.Runtime()
|
|
160
|
+
|
|
161
|
+
def pointer_move_to(self, x: float, y: float):
|
|
162
|
+
self.rt.pointer_move_to((float(x), float(y)))
|
|
163
|
+
|
|
164
|
+
def keyboard_type(self, sequence: str):
|
|
165
|
+
self.rt.keyboard_type(sequence)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
2) Create `examples/robot/quickstart.robot`:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
*** Settings ***
|
|
172
|
+
Library examples/robot/platynui_lib.py
|
|
173
|
+
|
|
174
|
+
*** Test Cases ***
|
|
175
|
+
Pointer And Keyboard Smoke
|
|
176
|
+
Pointer Move To 100 200
|
|
177
|
+
Keyboard Type Hello
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
3) Run with the mock feature installed:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
uv run maturin develop -m packages/native/Cargo.toml --release --features mock-provider
|
|
184
|
+
uv run robot examples/robot/quickstart.robot
|
|
185
|
+
|
|
186
|
+
Troubleshooting
|
|
187
|
+
|
|
188
|
+
## Mock Providers and Platform Devices
|
|
189
|
+
|
|
190
|
+
Mock providers do NOT auto-register in the inventory system. They are explicitly exposed as Python handles for testing:
|
|
191
|
+
|
|
192
|
+
### Available Mock Components
|
|
193
|
+
|
|
194
|
+
- **`MOCK_PROVIDER`** - Mock UI tree provider (provides a test UI tree)
|
|
195
|
+
- **`MOCK_PLATFORM`** - Mock desktop info provider (provides MockOS desktop with 3 monitors)
|
|
196
|
+
- **`MOCK_HIGHLIGHT_PROVIDER`** - Mock highlight provider
|
|
197
|
+
- **`MOCK_SCREENSHOT_PROVIDER`** - Mock screenshot provider
|
|
198
|
+
- **`MOCK_POINTER_DEVICE`** - Mock pointer/mouse device
|
|
199
|
+
- **`MOCK_KEYBOARD_DEVICE`** - Mock keyboard device
|
|
200
|
+
|
|
201
|
+
### Usage Examples
|
|
202
|
+
|
|
203
|
+
**Basic Runtime with Mock Provider:**
|
|
204
|
+
```python
|
|
205
|
+
from platynui_native import Runtime, MOCK_PROVIDER
|
|
206
|
+
|
|
207
|
+
rt = Runtime.new_with_providers([MOCK_PROVIDER])
|
|
208
|
+
# Uses OS platform devices (may fail if not available)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Full Mock Runtime (for testing):**
|
|
212
|
+
```python
|
|
213
|
+
from platynui_native import (
|
|
214
|
+
Runtime, PlatformOverrides,
|
|
215
|
+
MOCK_PROVIDER, MOCK_PLATFORM,
|
|
216
|
+
MOCK_POINTER_DEVICE, MOCK_KEYBOARD_DEVICE,
|
|
217
|
+
MOCK_SCREENSHOT_PROVIDER, MOCK_HIGHLIGHT_PROVIDER
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
# Configure platform overrides
|
|
221
|
+
overrides = PlatformOverrides()
|
|
222
|
+
overrides.desktop_info = MOCK_PLATFORM
|
|
223
|
+
overrides.pointer = MOCK_POINTER_DEVICE
|
|
224
|
+
overrides.keyboard = MOCK_KEYBOARD_DEVICE
|
|
225
|
+
overrides.screenshot = MOCK_SCREENSHOT_PROVIDER
|
|
226
|
+
overrides.highlight = MOCK_HIGHLIGHT_PROVIDER
|
|
227
|
+
|
|
228
|
+
# Create runtime with all mock components
|
|
229
|
+
rt = Runtime.new_with_providers_and_platforms([MOCK_PROVIDER], overrides)
|
|
230
|
+
|
|
231
|
+
# Now all operations work without real OS providers
|
|
232
|
+
info = rt.desktop_info()
|
|
233
|
+
print(info["os_name"]) # Output: "MockOS"
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Build Requirements
|
|
237
|
+
|
|
238
|
+
The `mock-provider` feature links the mock crates, making the handles available:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
uv run maturin develop -m packages/native/Cargo.toml --features mock-provider
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Common Issues
|
|
245
|
+
|
|
246
|
+
- **"no PointerDevice registered"**: Pass `MOCK_POINTER_DEVICE` in `PlatformOverrides`
|
|
247
|
+
- **"no KeyboardDevice registered"**: Pass `MOCK_KEYBOARD_DEVICE` in `PlatformOverrides`
|
|
248
|
+
- **Want mock desktop info**: Pass `MOCK_PLATFORM` in `overrides.desktop_info`
|
|
249
|
+
|
|
250
|
+
## Other Issues
|
|
251
|
+
|
|
252
|
+
- If `maturin` complains about the manifest path, always pass `-m packages/native/Cargo.toml` for mixed projects.
|
|
253
|
+
- If your shell shows a VIRTUAL_ENV mismatch, prefer `uv run --active ...` to target the active environment explicitly.
|
|
254
|
+
```
|
|
255
|
+
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
platynui-native
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
Native Python bindings for PlatynUI using PyO3 + maturin.
|
|
5
|
+
|
|
6
|
+
Quick start (local develop):
|
|
7
|
+
|
|
8
|
+
- uv sync --dev
|
|
9
|
+
- uv run maturin develop -m packages/native/Cargo.toml --release --features mock-provider
|
|
10
|
+
|
|
11
|
+
Then in Python:
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from platynui_native import core, runtime
|
|
15
|
+
pt = core.Point(1.0, 2.0)
|
|
16
|
+
rt = runtime.Runtime()
|
|
17
|
+
items = rt.evaluate("/control:Desktop", None)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Run smoke tests (uses mock provider feature):
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
uv run maturin develop -m packages/native/Cargo.toml --release --features mock-provider
|
|
24
|
+
uv run pytest -q packages/native/tests
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
API overview
|
|
28
|
+
|
|
29
|
+
- Module layout
|
|
30
|
+
- `platynui_native.core`: `Point`/`Size`/`Rect`, `Namespace`, IDs, `attribute_names()`
|
|
31
|
+
- `platynui_native.runtime`: `Runtime`, `UiNode`, `UiAttribute`, `EvaluatedAttribute`, pointer/keyboard methods
|
|
32
|
+
|
|
33
|
+
- Creating a Runtime
|
|
34
|
+
- `rt = runtime.Runtime()`
|
|
35
|
+
|
|
36
|
+
- Pointer buttons
|
|
37
|
+
- Accepts: `'left' | 'middle' | 'right'`, `runtime.PointerButton` enum, or `int`.
|
|
38
|
+
- Mapping: `1 → LEFT`, `2 → MIDDLE`, `3 → RIGHT`, other ints → `Other(n)`.
|
|
39
|
+
|
|
40
|
+
- Pointer overrides (class)
|
|
41
|
+
- Timing (milliseconds unless noted):
|
|
42
|
+
- `after_move_delay_ms`, `after_input_delay_ms`, `press_release_delay_ms`,
|
|
43
|
+
`after_click_delay_ms`, `before_next_click_delay_ms`, `multi_click_delay_ms`,
|
|
44
|
+
`ensure_move_timeout_ms`, `scroll_delay_ms`, `max_move_duration_ms`.
|
|
45
|
+
- `move_time_per_pixel_us` (microseconds per pixel)
|
|
46
|
+
- Motion/profile:
|
|
47
|
+
- `speed_factor: float`
|
|
48
|
+
- `acceleration_profile: 'constant'|'ease_in'|'ease_out'|'smooth_step'`
|
|
49
|
+
- Origin (choose one):
|
|
50
|
+
- `'desktop'`
|
|
51
|
+
- `core.Point(x, y)` → absolute desktop point
|
|
52
|
+
- `core.Rect(x, y, w, h)` → relative to rect (top-left origin)
|
|
53
|
+
- Scrolling:
|
|
54
|
+
- `scroll_step: (h: float, v: float)`; `scroll_delay_ms`
|
|
55
|
+
- Other:
|
|
56
|
+
- `ensure_move_threshold: float`
|
|
57
|
+
- Properties: all fields are exposed read‑only (e.g. `ov.speed_factor`, `ov.origin`, `ov.after_move_delay_ms`).
|
|
58
|
+
|
|
59
|
+
- Keyboard overrides (class, milliseconds)
|
|
60
|
+
- `press_delay_ms`, `release_delay_ms`, `between_keys_delay_ms`,
|
|
61
|
+
`chord_press_delay_ms`, `chord_release_delay_ms`,
|
|
62
|
+
`after_sequence_delay_ms`, `after_text_delay_ms`.
|
|
63
|
+
- Properties: `kov.press_delay_ms`, `kov.between_keys_delay_ms`, etc.
|
|
64
|
+
|
|
65
|
+
Examples
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from platynui_native import core, runtime
|
|
69
|
+
rt = runtime.Runtime()
|
|
70
|
+
|
|
71
|
+
# Move & click with overrides
|
|
72
|
+
ov = runtime.PointerOverrides(speed_factor=1.5, after_move_delay_ms=15, origin='desktop')
|
|
73
|
+
rt.pointer_move_to(core.Point(100, 200), overrides=ov)
|
|
74
|
+
rt.pointer_click(core.Point(100, 200), button=runtime.PointerButton.LEFT,
|
|
75
|
+
overrides=runtime.PointerOverrides(multi_click_delay_ms=240))
|
|
76
|
+
|
|
77
|
+
# Drag with relative origin
|
|
78
|
+
rt.pointer_drag(core.Point(10, 10), core.Point(180, 140), button=runtime.PointerButton.LEFT,
|
|
79
|
+
overrides=runtime.PointerOverrides(origin=core.Rect(50, 60, 200, 200)))
|
|
80
|
+
|
|
81
|
+
# Keyboard with custom timings
|
|
82
|
+
rt.keyboard_type("Hello", overrides=runtime.KeyboardOverrides(between_keys_delay_ms=5))
|
|
83
|
+
rt.keyboard_press("<Ctrl+C>")
|
|
84
|
+
rt.keyboard_release("<Ctrl+C>")
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Notes
|
|
88
|
+
|
|
89
|
+
- The mock provider feature (`--features mock-provider`) is intended for local development without platform backends. Some pointer/keyboard calls may raise `PointerError`/`KeyboardError` if the device is not available; structure/typing of arguments is still validated.
|
|
90
|
+
|
|
91
|
+
- Evaluate results
|
|
92
|
+
- `Runtime.evaluate()` returns a list of `UiNode`, `EvaluatedAttribute`, or plain values (`UiValue`).
|
|
93
|
+
- `UiNode.attributes()` returns `list[UiAttribute]` (no owner).
|
|
94
|
+
- `EvaluatedAttribute` includes an `owner()` reference back to the `UiNode` it belongs to.
|
|
95
|
+
|
|
96
|
+
Reference
|
|
97
|
+
|
|
98
|
+
- Pointer defaults (from runtime profile/settings)
|
|
99
|
+
- double_click_time: 500 ms; double_click_size: (4.0, 4.0); default_button: left
|
|
100
|
+
- mode: Linear; steps_per_pixel: 1.5; speed_factor: 1.0
|
|
101
|
+
- max_move_duration: 600 ms; move_time_per_pixel: 800 µs
|
|
102
|
+
- acceleration_profile: SmoothStep
|
|
103
|
+
- after_move_delay: 40 ms; after_input_delay: 35 ms
|
|
104
|
+
- press_release_delay: 50 ms; after_click_delay: 80 ms
|
|
105
|
+
- before_next_click_delay: 120 ms; multi_click_delay: 500 ms
|
|
106
|
+
- ensure_move_position: true; ensure_move_threshold: 2.0; ensure_move_timeout: 250 ms
|
|
107
|
+
- scroll_step: (0.0, -120.0); scroll_delay: 40 ms
|
|
108
|
+
|
|
109
|
+
- Keyboard defaults (KeyboardSettings.default)
|
|
110
|
+
- press_delay: 35 ms; release_delay: 25 ms
|
|
111
|
+
- between_keys_delay: 40 ms
|
|
112
|
+
- chord_press_delay: 45 ms; chord_release_delay: 45 ms
|
|
113
|
+
- after_sequence_delay: 75 ms; after_text_delay: 20 ms
|
|
114
|
+
|
|
115
|
+
Robot Framework usage (example)
|
|
116
|
+
|
|
117
|
+
Wrap the native runtime into a simple Python library and import it in Robot suites:
|
|
118
|
+
|
|
119
|
+
1) Create `examples/robot/platynui_lib.py`:
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
from platynui_native import runtime
|
|
123
|
+
|
|
124
|
+
class PlatynUILib:
|
|
125
|
+
def __init__(self):
|
|
126
|
+
self.rt = runtime.Runtime()
|
|
127
|
+
|
|
128
|
+
def pointer_move_to(self, x: float, y: float):
|
|
129
|
+
self.rt.pointer_move_to((float(x), float(y)))
|
|
130
|
+
|
|
131
|
+
def keyboard_type(self, sequence: str):
|
|
132
|
+
self.rt.keyboard_type(sequence)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
2) Create `examples/robot/quickstart.robot`:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
*** Settings ***
|
|
139
|
+
Library examples/robot/platynui_lib.py
|
|
140
|
+
|
|
141
|
+
*** Test Cases ***
|
|
142
|
+
Pointer And Keyboard Smoke
|
|
143
|
+
Pointer Move To 100 200
|
|
144
|
+
Keyboard Type Hello
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
3) Run with the mock feature installed:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
uv run maturin develop -m packages/native/Cargo.toml --release --features mock-provider
|
|
151
|
+
uv run robot examples/robot/quickstart.robot
|
|
152
|
+
|
|
153
|
+
Troubleshooting
|
|
154
|
+
|
|
155
|
+
## Mock Providers and Platform Devices
|
|
156
|
+
|
|
157
|
+
Mock providers do NOT auto-register in the inventory system. They are explicitly exposed as Python handles for testing:
|
|
158
|
+
|
|
159
|
+
### Available Mock Components
|
|
160
|
+
|
|
161
|
+
- **`MOCK_PROVIDER`** - Mock UI tree provider (provides a test UI tree)
|
|
162
|
+
- **`MOCK_PLATFORM`** - Mock desktop info provider (provides MockOS desktop with 3 monitors)
|
|
163
|
+
- **`MOCK_HIGHLIGHT_PROVIDER`** - Mock highlight provider
|
|
164
|
+
- **`MOCK_SCREENSHOT_PROVIDER`** - Mock screenshot provider
|
|
165
|
+
- **`MOCK_POINTER_DEVICE`** - Mock pointer/mouse device
|
|
166
|
+
- **`MOCK_KEYBOARD_DEVICE`** - Mock keyboard device
|
|
167
|
+
|
|
168
|
+
### Usage Examples
|
|
169
|
+
|
|
170
|
+
**Basic Runtime with Mock Provider:**
|
|
171
|
+
```python
|
|
172
|
+
from platynui_native import Runtime, MOCK_PROVIDER
|
|
173
|
+
|
|
174
|
+
rt = Runtime.new_with_providers([MOCK_PROVIDER])
|
|
175
|
+
# Uses OS platform devices (may fail if not available)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Full Mock Runtime (for testing):**
|
|
179
|
+
```python
|
|
180
|
+
from platynui_native import (
|
|
181
|
+
Runtime, PlatformOverrides,
|
|
182
|
+
MOCK_PROVIDER, MOCK_PLATFORM,
|
|
183
|
+
MOCK_POINTER_DEVICE, MOCK_KEYBOARD_DEVICE,
|
|
184
|
+
MOCK_SCREENSHOT_PROVIDER, MOCK_HIGHLIGHT_PROVIDER
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
# Configure platform overrides
|
|
188
|
+
overrides = PlatformOverrides()
|
|
189
|
+
overrides.desktop_info = MOCK_PLATFORM
|
|
190
|
+
overrides.pointer = MOCK_POINTER_DEVICE
|
|
191
|
+
overrides.keyboard = MOCK_KEYBOARD_DEVICE
|
|
192
|
+
overrides.screenshot = MOCK_SCREENSHOT_PROVIDER
|
|
193
|
+
overrides.highlight = MOCK_HIGHLIGHT_PROVIDER
|
|
194
|
+
|
|
195
|
+
# Create runtime with all mock components
|
|
196
|
+
rt = Runtime.new_with_providers_and_platforms([MOCK_PROVIDER], overrides)
|
|
197
|
+
|
|
198
|
+
# Now all operations work without real OS providers
|
|
199
|
+
info = rt.desktop_info()
|
|
200
|
+
print(info["os_name"]) # Output: "MockOS"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Build Requirements
|
|
204
|
+
|
|
205
|
+
The `mock-provider` feature links the mock crates, making the handles available:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
uv run maturin develop -m packages/native/Cargo.toml --features mock-provider
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Common Issues
|
|
212
|
+
|
|
213
|
+
- **"no PointerDevice registered"**: Pass `MOCK_POINTER_DEVICE` in `PlatformOverrides`
|
|
214
|
+
- **"no KeyboardDevice registered"**: Pass `MOCK_KEYBOARD_DEVICE` in `PlatformOverrides`
|
|
215
|
+
- **Want mock desktop info**: Pass `MOCK_PLATFORM` in `overrides.desktop_info`
|
|
216
|
+
|
|
217
|
+
## Other Issues
|
|
218
|
+
|
|
219
|
+
- If `maturin` complains about the manifest path, always pass `-m packages/native/Cargo.toml` for mixed projects.
|
|
220
|
+
- If your shell shows a VIRTUAL_ENV mismatch, prefer `uv run --active ...` to target the active environment explicitly.
|
|
221
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "platynui-core"
|
|
3
|
+
description = "Core types and traits for PlatynUI"
|
|
4
|
+
version.workspace = true
|
|
5
|
+
keywords.workspace = true
|
|
6
|
+
categories.workspace = true
|
|
7
|
+
edition.workspace = true
|
|
8
|
+
homepage.workspace = true
|
|
9
|
+
documentation.workspace = true
|
|
10
|
+
repository.workspace = true
|
|
11
|
+
authors.workspace = true
|
|
12
|
+
license.workspace = true
|
|
13
|
+
rust-version.workspace = true
|
|
14
|
+
|
|
15
|
+
[dependencies]
|
|
16
|
+
serde = { version = "1.0.228", features = ["derive"] }
|
|
17
|
+
serde_json = "1.0.145"
|
|
18
|
+
once_cell = "1.21.3"
|
|
19
|
+
inventory = "0.3.21"
|
|
20
|
+
bitflags = "2.9.4"
|
|
21
|
+
thiserror = "2.0"
|
|
22
|
+
|
|
23
|
+
[dev-dependencies]
|
|
24
|
+
rstest = "0.26.1"
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
use crate::platform::PlatformError;
|
|
2
|
+
use crate::types::Rect;
|
|
3
|
+
use crate::ui::RuntimeId;
|
|
4
|
+
use crate::ui::identifiers::TechnologyId;
|
|
5
|
+
|
|
6
|
+
/// Describes a single monitor attached to the current desktop session.
|
|
7
|
+
#[derive(Clone, Debug, PartialEq)]
|
|
8
|
+
pub struct MonitorInfo {
|
|
9
|
+
/// Stable identifier provided by the platform (may equal the OS display name).
|
|
10
|
+
pub id: String,
|
|
11
|
+
/// Human readable name shown in tooling.
|
|
12
|
+
pub name: Option<String>,
|
|
13
|
+
/// Bounding box of the monitor in desktop coordinates.
|
|
14
|
+
pub bounds: Rect,
|
|
15
|
+
/// Whether the monitor is the primary display.
|
|
16
|
+
pub is_primary: bool,
|
|
17
|
+
/// Optional scale factor (1.0 = 100%).
|
|
18
|
+
pub scale_factor: Option<f64>,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
impl MonitorInfo {
|
|
22
|
+
pub fn new(id: impl Into<String>, bounds: Rect) -> Self {
|
|
23
|
+
Self { id: id.into(), name: None, bounds, is_primary: false, scale_factor: None }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/// Aggregate metadata about the desktop environment used to build the
|
|
28
|
+
/// `control:Desktop` node.
|
|
29
|
+
#[derive(Clone, Debug, PartialEq)]
|
|
30
|
+
pub struct DesktopInfo {
|
|
31
|
+
pub runtime_id: RuntimeId,
|
|
32
|
+
pub name: String,
|
|
33
|
+
pub technology: TechnologyId,
|
|
34
|
+
pub bounds: Rect,
|
|
35
|
+
pub os_name: String,
|
|
36
|
+
pub os_version: String,
|
|
37
|
+
pub monitors: Vec<MonitorInfo>,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
impl DesktopInfo {
|
|
41
|
+
pub fn display_count(&self) -> usize {
|
|
42
|
+
self.monitors.len()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pub fn primary_monitor(&self) -> Option<&MonitorInfo> {
|
|
46
|
+
self.monitors.iter().find(|monitor| monitor.is_primary)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/// Provides desktop metadata on demand.
|
|
51
|
+
pub trait DesktopInfoProvider: Send + Sync {
|
|
52
|
+
fn desktop_info(&self) -> Result<DesktopInfo, PlatformError>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
pub struct DesktopInfoRegistration {
|
|
56
|
+
pub provider: &'static dyn DesktopInfoProvider,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
inventory::collect!(DesktopInfoRegistration);
|
|
60
|
+
|
|
61
|
+
pub fn desktop_info_providers() -> impl Iterator<Item = &'static dyn DesktopInfoProvider> {
|
|
62
|
+
inventory::iter::<DesktopInfoRegistration>.into_iter().map(|entry| entry.provider)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
#[macro_export]
|
|
66
|
+
macro_rules! register_desktop_info_provider {
|
|
67
|
+
($provider:expr) => {
|
|
68
|
+
inventory::submit! {
|
|
69
|
+
$crate::platform::DesktopInfoRegistration { provider: $provider }
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#[cfg(test)]
|
|
75
|
+
mod tests {
|
|
76
|
+
use super::*;
|
|
77
|
+
|
|
78
|
+
struct StubDesktopProvider;
|
|
79
|
+
|
|
80
|
+
impl DesktopInfoProvider for StubDesktopProvider {
|
|
81
|
+
fn desktop_info(&self) -> Result<DesktopInfo, PlatformError> {
|
|
82
|
+
Ok(DesktopInfo {
|
|
83
|
+
runtime_id: RuntimeId::from("stub-desktop"),
|
|
84
|
+
name: "Stub Desktop".into(),
|
|
85
|
+
technology: TechnologyId::from("StubTech"),
|
|
86
|
+
bounds: Rect::new(0.0, 0.0, 1920.0, 1080.0),
|
|
87
|
+
os_name: "StubOS".into(),
|
|
88
|
+
os_version: "1.0".into(),
|
|
89
|
+
monitors: vec![MonitorInfo {
|
|
90
|
+
id: "stub-monitor".into(),
|
|
91
|
+
name: Some("Stub Primary".into()),
|
|
92
|
+
bounds: Rect::new(0.0, 0.0, 1920.0, 1080.0),
|
|
93
|
+
is_primary: true,
|
|
94
|
+
scale_factor: Some(1.0),
|
|
95
|
+
}],
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
static STUB_PROVIDER: StubDesktopProvider = StubDesktopProvider;
|
|
101
|
+
|
|
102
|
+
register_desktop_info_provider!(&STUB_PROVIDER);
|
|
103
|
+
|
|
104
|
+
#[test]
|
|
105
|
+
fn provider_registration_exposed_via_iterator() {
|
|
106
|
+
let providers: Vec<_> = desktop_info_providers().collect();
|
|
107
|
+
assert!(providers.iter().any(|provider| provider.desktop_info().is_ok()));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
use std::fmt::{Display, Formatter};
|
|
2
|
+
use thiserror::Error;
|
|
3
|
+
|
|
4
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
5
|
+
pub struct Context(pub Option<String>);
|
|
6
|
+
|
|
7
|
+
impl Display for Context {
|
|
8
|
+
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
9
|
+
if let Some(s) = &self.0 { write!(f, ": {s}") } else { Ok(()) }
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/// Fully-typed platform error used across platform integration crates.
|
|
14
|
+
///
|
|
15
|
+
/// Keep `PlatformErrorKind` and the legacy constructors `new/simple` for
|
|
16
|
+
/// compatibility with existing call sites in the workspace.
|
|
17
|
+
#[derive(Debug, Error, Clone, PartialEq, Eq)]
|
|
18
|
+
pub enum PlatformError {
|
|
19
|
+
#[error("platform initialization failed{context}")]
|
|
20
|
+
InitializationFailed { context: Context },
|
|
21
|
+
|
|
22
|
+
#[error("platform capability unavailable{context}")]
|
|
23
|
+
CapabilityUnavailable { context: Context },
|
|
24
|
+
|
|
25
|
+
#[error("unsupported platform{context}")]
|
|
26
|
+
UnsupportedPlatform { context: Context },
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
impl PlatformError {
|
|
30
|
+
/// Back-compat constructor used by existing code paths.
|
|
31
|
+
pub fn new(kind: PlatformErrorKind, message: impl Into<String>) -> Self {
|
|
32
|
+
let context = Context(Some(message.into()));
|
|
33
|
+
match kind {
|
|
34
|
+
PlatformErrorKind::InitializationFailed => Self::InitializationFailed { context },
|
|
35
|
+
PlatformErrorKind::CapabilityUnavailable => Self::CapabilityUnavailable { context },
|
|
36
|
+
PlatformErrorKind::UnsupportedPlatform => Self::UnsupportedPlatform { context },
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// Back-compat constructor without message.
|
|
41
|
+
pub fn simple(kind: PlatformErrorKind) -> Self {
|
|
42
|
+
match kind {
|
|
43
|
+
PlatformErrorKind::InitializationFailed => Self::InitializationFailed { context: Context(None) },
|
|
44
|
+
PlatformErrorKind::CapabilityUnavailable => Self::CapabilityUnavailable { context: Context(None) },
|
|
45
|
+
PlatformErrorKind::UnsupportedPlatform => Self::UnsupportedPlatform { context: Context(None) },
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
51
|
+
pub enum PlatformErrorKind {
|
|
52
|
+
InitializationFailed,
|
|
53
|
+
CapabilityUnavailable,
|
|
54
|
+
UnsupportedPlatform,
|
|
55
|
+
}
|