platynui-inspector 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-inspector might be problematic. Click here for more details.

Files changed (324) hide show
  1. platynui_inspector-0.2.0.dev1/PKG-INFO +78 -0
  2. platynui_inspector-0.2.0.dev1/README.md +49 -0
  3. platynui_inspector-0.2.0.dev1/apps/inspector/.gitignore +1 -0
  4. platynui_inspector-0.2.0.dev1/apps/inspector/Cargo.toml +56 -0
  5. platynui_inspector-0.2.0.dev1/apps/inspector/build.rs +3 -0
  6. platynui_inspector-0.2.0.dev1/apps/inspector/src/lib.rs +182 -0
  7. platynui_inspector-0.2.0.dev1/apps/inspector/src/main.rs +5 -0
  8. platynui_inspector-0.2.0.dev1/apps/inspector/src/ui/mod.rs +1 -0
  9. platynui_inspector-0.2.0.dev1/apps/inspector/src/ui/tree/data/mod.rs +35 -0
  10. platynui_inspector-0.2.0.dev1/apps/inspector/src/ui/tree/data/uinode.rs +234 -0
  11. platynui_inspector-0.2.0.dev1/apps/inspector/src/ui/tree/mod.rs +2 -0
  12. platynui_inspector-0.2.0.dev1/apps/inspector/src/ui/tree/viewmodel.rs +157 -0
  13. platynui_inspector-0.2.0.dev1/apps/inspector/ui/app-window.slint +138 -0
  14. platynui_inspector-0.2.0.dev1/apps/inspector/ui/components/horizontal-resizable-pane.slint +80 -0
  15. platynui_inspector-0.2.0.dev1/apps/inspector/ui/components/tree-view.slint +541 -0
  16. platynui_inspector-0.2.0.dev1/apps/inspector/ui/components/vertical-resizable-pane.slint +80 -0
  17. platynui_inspector-0.2.0.dev1/crates/core/Cargo.toml +24 -0
  18. platynui_inspector-0.2.0.dev1/crates/core/src/lib.rs +4 -0
  19. platynui_inspector-0.2.0.dev1/crates/core/src/platform/desktop.rs +109 -0
  20. platynui_inspector-0.2.0.dev1/crates/core/src/platform/error.rs +55 -0
  21. platynui_inspector-0.2.0.dev1/crates/core/src/platform/highlight.rs +102 -0
  22. platynui_inspector-0.2.0.dev1/crates/core/src/platform/keyboard.rs +301 -0
  23. platynui_inspector-0.2.0.dev1/crates/core/src/platform/mod.rs +40 -0
  24. platynui_inspector-0.2.0.dev1/crates/core/src/platform/module.rs +6 -0
  25. platynui_inspector-0.2.0.dev1/crates/core/src/platform/pointer.rs +152 -0
  26. platynui_inspector-0.2.0.dev1/crates/core/src/platform/registration.rs +40 -0
  27. platynui_inspector-0.2.0.dev1/crates/core/src/platform/screenshot.rs +134 -0
  28. platynui_inspector-0.2.0.dev1/crates/core/src/provider/descriptor.rs +59 -0
  29. platynui_inspector-0.2.0.dev1/crates/core/src/provider/error.rs +66 -0
  30. platynui_inspector-0.2.0.dev1/crates/core/src/provider/event.rs +45 -0
  31. platynui_inspector-0.2.0.dev1/crates/core/src/provider/factory.rs +8 -0
  32. platynui_inspector-0.2.0.dev1/crates/core/src/provider/mod.rs +24 -0
  33. platynui_inspector-0.2.0.dev1/crates/core/src/provider/registration.rs +150 -0
  34. platynui_inspector-0.2.0.dev1/crates/core/src/provider/tree_provider.rs +26 -0
  35. platynui_inspector-0.2.0.dev1/crates/core/src/types/mod.rs +7 -0
  36. platynui_inspector-0.2.0.dev1/crates/core/src/types/point.rs +150 -0
  37. platynui_inspector-0.2.0.dev1/crates/core/src/types/rect.rs +255 -0
  38. platynui_inspector-0.2.0.dev1/crates/core/src/types/size.rs +192 -0
  39. platynui_inspector-0.2.0.dev1/crates/core/src/ui/attributes.rs +144 -0
  40. platynui_inspector-0.2.0.dev1/crates/core/src/ui/contract/testkit.rs +576 -0
  41. platynui_inspector-0.2.0.dev1/crates/core/src/ui/contract.rs +237 -0
  42. platynui_inspector-0.2.0.dev1/crates/core/src/ui/identifiers.rs +139 -0
  43. platynui_inspector-0.2.0.dev1/crates/core/src/ui/mod.rs +20 -0
  44. platynui_inspector-0.2.0.dev1/crates/core/src/ui/namespace.rs +119 -0
  45. platynui_inspector-0.2.0.dev1/crates/core/src/ui/node.rs +573 -0
  46. platynui_inspector-0.2.0.dev1/crates/core/src/ui/pattern.rs +617 -0
  47. platynui_inspector-0.2.0.dev1/crates/core/src/ui/value.rs +122 -0
  48. platynui_inspector-0.2.0.dev1/crates/link/Cargo.toml +19 -0
  49. platynui_inspector-0.2.0.dev1/crates/link/src/lib.rs +64 -0
  50. platynui_inspector-0.2.0.dev1/crates/platform-linux-x11/Cargo.toml +15 -0
  51. platynui_inspector-0.2.0.dev1/crates/platform-linux-x11/src/lib.rs +8 -0
  52. platynui_inspector-0.2.0.dev1/crates/platform-macos/Cargo.toml +15 -0
  53. platynui_inspector-0.2.0.dev1/crates/platform-macos/src/lib.rs +8 -0
  54. platynui_inspector-0.2.0.dev1/crates/platform-mock/Cargo.toml +22 -0
  55. platynui_inspector-0.2.0.dev1/crates/platform-mock/src/desktop.rs +88 -0
  56. platynui_inspector-0.2.0.dev1/crates/platform-mock/src/highlight.rs +84 -0
  57. platynui_inspector-0.2.0.dev1/crates/platform-mock/src/keyboard.rs +286 -0
  58. platynui_inspector-0.2.0.dev1/crates/platform-mock/src/lib.rs +43 -0
  59. platynui_inspector-0.2.0.dev1/crates/platform-mock/src/pointer.rs +135 -0
  60. platynui_inspector-0.2.0.dev1/crates/platform-mock/src/screenshot.rs +302 -0
  61. platynui_inspector-0.2.0.dev1/crates/platform-windows/Cargo.toml +29 -0
  62. platynui_inspector-0.2.0.dev1/crates/platform-windows/src/desktop.rs +258 -0
  63. platynui_inspector-0.2.0.dev1/crates/platform-windows/src/highlight.rs +553 -0
  64. platynui_inspector-0.2.0.dev1/crates/platform-windows/src/init.rs +48 -0
  65. platynui_inspector-0.2.0.dev1/crates/platform-windows/src/lib.rs +20 -0
  66. platynui_inspector-0.2.0.dev1/crates/platform-windows/src/pointer.rs +184 -0
  67. platynui_inspector-0.2.0.dev1/crates/platform-windows/src/screenshot.rs +116 -0
  68. platynui_inspector-0.2.0.dev1/crates/provider-atspi/Cargo.toml +18 -0
  69. platynui_inspector-0.2.0.dev1/crates/provider-atspi/src/lib.rs +60 -0
  70. platynui_inspector-0.2.0.dev1/crates/provider-macos-ax/Cargo.toml +18 -0
  71. platynui_inspector-0.2.0.dev1/crates/provider-macos-ax/src/lib.rs +60 -0
  72. platynui_inspector-0.2.0.dev1/crates/provider-mock/Cargo.toml +24 -0
  73. platynui_inspector-0.2.0.dev1/crates/provider-mock/assets/mock_tree.xml +116 -0
  74. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/events.rs +42 -0
  75. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/factory.rs +44 -0
  76. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/focus.rs +113 -0
  77. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/input.rs +350 -0
  78. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/lib.rs +29 -0
  79. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/node.rs +156 -0
  80. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/provider.rs +96 -0
  81. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/tests.rs +339 -0
  82. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/tree.rs +555 -0
  83. platynui_inspector-0.2.0.dev1/crates/provider-mock/src/window.rs +350 -0
  84. platynui_inspector-0.2.0.dev1/crates/provider-windows-uia/Cargo.toml +34 -0
  85. platynui_inspector-0.2.0.dev1/crates/provider-windows-uia/src/com.rs +59 -0
  86. platynui_inspector-0.2.0.dev1/crates/provider-windows-uia/src/error.rs +27 -0
  87. platynui_inspector-0.2.0.dev1/crates/provider-windows-uia/src/lib.rs +20 -0
  88. platynui_inspector-0.2.0.dev1/crates/provider-windows-uia/src/map.rs +672 -0
  89. platynui_inspector-0.2.0.dev1/crates/provider-windows-uia/src/node.rs +1188 -0
  90. platynui_inspector-0.2.0.dev1/crates/provider-windows-uia/src/provider.rs +177 -0
  91. platynui_inspector-0.2.0.dev1/crates/runtime/Cargo.toml +36 -0
  92. platynui_inspector-0.2.0.dev1/crates/runtime/src/keyboard.rs +246 -0
  93. platynui_inspector-0.2.0.dev1/crates/runtime/src/keyboard_sequence.pest +697 -0
  94. platynui_inspector-0.2.0.dev1/crates/runtime/src/keyboard_sequence.rs +336 -0
  95. platynui_inspector-0.2.0.dev1/crates/runtime/src/lib.rs +26 -0
  96. platynui_inspector-0.2.0.dev1/crates/runtime/src/pointer.rs +1574 -0
  97. platynui_inspector-0.2.0.dev1/crates/runtime/src/provider/event.rs +154 -0
  98. platynui_inspector-0.2.0.dev1/crates/runtime/src/provider/mod.rs +4 -0
  99. platynui_inspector-0.2.0.dev1/crates/runtime/src/provider/registry.rs +246 -0
  100. platynui_inspector-0.2.0.dev1/crates/runtime/src/runtime.rs +1692 -0
  101. platynui_inspector-0.2.0.dev1/crates/runtime/src/test_support.rs +30 -0
  102. platynui_inspector-0.2.0.dev1/crates/runtime/src/xpath.rs +1431 -0
  103. platynui_inspector-0.2.0.dev1/crates/xpath/Cargo.toml +65 -0
  104. platynui_inspector-0.2.0.dev1/crates/xpath/README.md +65 -0
  105. platynui_inspector-0.2.0.dev1/crates/xpath/benches/advanced_benchmarks.rs +315 -0
  106. platynui_inspector-0.2.0.dev1/crates/xpath/benches/benchmark_constant_folding.rs +69 -0
  107. platynui_inspector-0.2.0.dev1/crates/xpath/benches/evaluate_first_benchmarks.rs +131 -0
  108. platynui_inspector-0.2.0.dev1/crates/xpath/benches/parser_smallvec.rs +51 -0
  109. platynui_inspector-0.2.0.dev1/crates/xpath/benches/performance_analysis.rs +302 -0
  110. platynui_inspector-0.2.0.dev1/crates/xpath/benches/short_circuit_benchmarks.rs +134 -0
  111. platynui_inspector-0.2.0.dev1/crates/xpath/benches/streaming_vs_materialized.rs +275 -0
  112. platynui_inspector-0.2.0.dev1/crates/xpath/benches/xpath_benches.rs +243 -0
  113. platynui_inspector-0.2.0.dev1/crates/xpath/docs/xpath20_coverage.md +90 -0
  114. platynui_inspector-0.2.0.dev1/crates/xpath/examples/repl.rs +191 -0
  115. platynui_inspector-0.2.0.dev1/crates/xpath/examples/simple.rs +58 -0
  116. platynui_inspector-0.2.0.dev1/crates/xpath/src/compiler/ir.rs +527 -0
  117. platynui_inspector-0.2.0.dev1/crates/xpath/src/compiler/mod.rs +886 -0
  118. platynui_inspector-0.2.0.dev1/crates/xpath/src/compiler/optimizer.rs +395 -0
  119. platynui_inspector-0.2.0.dev1/crates/xpath/src/consts.rs +18 -0
  120. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/collation.rs +142 -0
  121. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/eq.rs +480 -0
  122. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/evaluator.rs +5225 -0
  123. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/boolean.rs +56 -0
  124. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/collations.rs +62 -0
  125. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/common.rs +1861 -0
  126. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/constructors.rs +687 -0
  127. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/datetime.rs +509 -0
  128. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/diagnostics.rs +22 -0
  129. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/durations.rs +137 -0
  130. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/environment.rs +494 -0
  131. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/ids.rs +229 -0
  132. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/mod.rs +1433 -0
  133. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/numeric.rs +301 -0
  134. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/qnames.rs +290 -0
  135. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/regex.rs +52 -0
  136. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/sequences.rs +287 -0
  137. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/functions/strings.rs +361 -0
  138. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/mod.rs +5 -0
  139. platynui_inspector-0.2.0.dev1/crates/xpath/src/engine/runtime.rs +1797 -0
  140. platynui_inspector-0.2.0.dev1/crates/xpath/src/lib.rs +34 -0
  141. platynui_inspector-0.2.0.dev1/crates/xpath/src/model/mod.rs +233 -0
  142. platynui_inspector-0.2.0.dev1/crates/xpath/src/model/simple.rs +691 -0
  143. platynui_inspector-0.2.0.dev1/crates/xpath/src/parser/ast.rs +233 -0
  144. platynui_inspector-0.2.0.dev1/crates/xpath/src/parser/mod.rs +1252 -0
  145. platynui_inspector-0.2.0.dev1/crates/xpath/src/parser/xpath2.pest +325 -0
  146. platynui_inspector-0.2.0.dev1/crates/xpath/src/util/mod.rs +1 -0
  147. platynui_inspector-0.2.0.dev1/crates/xpath/src/util/temporal.rs +262 -0
  148. platynui_inspector-0.2.0.dev1/crates/xpath/src/xdm/mod.rs +672 -0
  149. platynui_inspector-0.2.0.dev1/crates/xpath/tests/axes_wildcard_vs_node.rs +53 -0
  150. platynui_inspector-0.2.0.dev1/crates/xpath/tests/cast_daytime_duration_negative.rs +20 -0
  151. platynui_inspector-0.2.0.dev1/crates/xpath/tests/castable_matrix.rs +55 -0
  152. platynui_inspector-0.2.0.dev1/crates/xpath/tests/casts_basic.rs +147 -0
  153. platynui_inspector-0.2.0.dev1/crates/xpath/tests/casts_cardinality.rs +95 -0
  154. platynui_inspector-0.2.0.dev1/crates/xpath/tests/casts_fractional_seconds.rs +71 -0
  155. platynui_inspector-0.2.0.dev1/crates/xpath/tests/casts_matrix_full.rs +247 -0
  156. platynui_inspector-0.2.0.dev1/crates/xpath/tests/casts_temporal_extended.rs +141 -0
  157. platynui_inspector-0.2.0.dev1/crates/xpath/tests/comparisons_mixed_regression.rs +30 -0
  158. platynui_inspector-0.2.0.dev1/crates/xpath/tests/comparisons_untyped_numeric_regression.rs +39 -0
  159. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_arith_logic.rs +42 -0
  160. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_comparisons_types.rs +102 -0
  161. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_control_flow.rs +17 -0
  162. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_for_multi.rs +27 -0
  163. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_let_expr.rs +34 -0
  164. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_literals.rs +47 -0
  165. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_negative_lowering.rs +39 -0
  166. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_paths_predicates.rs +272 -0
  167. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_quantifiers_for.rs +31 -0
  168. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_set_ops.rs +15 -0
  169. platynui_inspector-0.2.0.dev1/crates/xpath/tests/compiler_vars_funcs.rs +35 -0
  170. platynui_inspector-0.2.0.dev1/crates/xpath/tests/document_node_inner.rs +49 -0
  171. platynui_inspector-0.2.0.dev1/crates/xpath/tests/duration_fractional_truncation.rs +22 -0
  172. platynui_inspector-0.2.0.dev1/crates/xpath/tests/equality_date_time_eqkey.rs +32 -0
  173. platynui_inspector-0.2.0.dev1/crates/xpath/tests/error_codes.rs +71 -0
  174. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluate_first.rs +170 -0
  175. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_aggregate_funcs.rs +86 -0
  176. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_arith_logic.rs +32 -0
  177. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_arith_promotion.rs +35 -0
  178. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_axes.rs +126 -0
  179. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_axes_siblings.rs +73 -0
  180. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_axis_namespace.rs +190 -0
  181. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_collation_comparisons.rs +42 -0
  182. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_comparison_extended.rs +110 -0
  183. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_comparison_matrix.rs +94 -0
  184. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_comparisons_numeric_matrix.rs +90 -0
  185. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_comparisons_type_errors.rs +21 -0
  186. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_comparisons_untyped.rs +35 -0
  187. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_ebv_consistency.rs +28 -0
  188. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_following_preceding.rs +145 -0
  189. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_for_expr.rs +43 -0
  190. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_general_comparisons.rs +88 -0
  191. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_general_incomparable.rs +30 -0
  192. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_kindtests_pi_document.rs +46 -0
  193. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_let_expr.rs +35 -0
  194. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_more.rs +155 -0
  195. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_nan_inf.rs +102 -0
  196. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_node_compare_cross_root.rs +46 -0
  197. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_numeric_funcs.rs +80 -0
  198. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_numeric_functions.rs +48 -0
  199. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_numeric_promotion.rs +34 -0
  200. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_overflow_policy.rs +46 -0
  201. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_path_filter_expr.rs +69 -0
  202. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_positional_predicates.rs +101 -0
  203. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_quantifiers.rs +48 -0
  204. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_quantifiers_multi.rs +23 -0
  205. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_quantifiers_nested.rs +34 -0
  206. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_set_ops.rs +44 -0
  207. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_short_circuit.rs +124 -0
  208. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_streaming.rs +575 -0
  209. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_temporal.rs +65 -0
  210. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_temporal_edges.rs +119 -0
  211. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_text_vs_dot.rs +64 -0
  212. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_types.rs +69 -0
  213. platynui_inspector-0.2.0.dev1/crates/xpath/tests/evaluator_value_comparisons.rs +43 -0
  214. platynui_inspector-0.2.0.dev1/crates/xpath/tests/function_conversion_runtime.rs +686 -0
  215. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_aggregates_types.rs +107 -0
  216. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_avg_mixed.rs +30 -0
  217. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_boolean_and_zero_arity.rs +162 -0
  218. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_cardinality.rs +53 -0
  219. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_codepoint_equal.rs +24 -0
  220. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_codepoints.rs +65 -0
  221. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_collations_compare.rs +50 -0
  222. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_collations_minmax_deepequal.rs +71 -0
  223. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_collations_strings.rs +54 -0
  224. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_compare_empty_3arg.rs +15 -0
  225. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_concat.rs +48 -0
  226. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_contains_untyped.rs +24 -0
  227. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_data.rs +37 -0
  228. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_datetime_adjust.rs +55 -0
  229. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_datetime_snapshot.rs +122 -0
  230. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_deep_equal.rs +24 -0
  231. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_deep_equal_atomic_advanced.rs +37 -0
  232. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_deep_equal_namespaces.rs +34 -0
  233. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_deep_equal_nodes.rs +46 -0
  234. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_deepequal_nodes.rs +31 -0
  235. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_distinct_values.rs +78 -0
  236. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_doc_collection.rs +67 -0
  237. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_env_doc_root.rs +81 -0
  238. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_error_trace.rs +52 -0
  239. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_id_idref.rs +110 -0
  240. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_index_of.rs +35 -0
  241. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_index_of_collations.rs +39 -0
  242. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_minmax_empty.rs +15 -0
  243. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_namespace_uri.rs +79 -0
  244. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_nilled_unordered_duration.rs +160 -0
  245. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_node_name.rs +93 -0
  246. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_qname_edges.rs +104 -0
  247. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_qname_namespace.rs +66 -0
  248. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_regex_backrefs.rs +45 -0
  249. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_regex_errors.rs +40 -0
  250. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_regex_flags.rs +56 -0
  251. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_round_high_precision.rs +24 -0
  252. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_string_edges.rs +111 -0
  253. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_substring_subsequence.rs +67 -0
  254. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_sum_avg_nan.rs +23 -0
  255. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_temporal_errors.rs +35 -0
  256. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_uri_lang.rs +101 -0
  257. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_wrong_arity_message.rs +13 -0
  258. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_ws5_rest_sanity.rs +59 -0
  259. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_xs_constructors.rs +86 -0
  260. platynui_inspector-0.2.0.dev1/crates/xpath/tests/functions_xs_constructors_more.rs +100 -0
  261. platynui_inspector-0.2.0.dev1/crates/xpath/tests/kindtests_element_attribute.rs +65 -0
  262. platynui_inspector-0.2.0.dev1/crates/xpath/tests/namespace_axis.rs +43 -0
  263. platynui_inspector-0.2.0.dev1/crates/xpath/tests/namespace_wildcards.rs +103 -0
  264. platynui_inspector-0.2.0.dev1/crates/xpath/tests/namespace_xml_binding.rs +50 -0
  265. platynui_inspector-0.2.0.dev1/crates/xpath/tests/optimizer_constant_folding.rs +123 -0
  266. platynui_inspector-0.2.0.dev1/crates/xpath/tests/optimizer_integration.rs +98 -0
  267. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_axes_full.rs +47 -0
  268. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_basic.rs +157 -0
  269. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_error_codes_more.rs +13 -0
  270. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_errors.rs +14 -0
  271. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_flwor_negative.rs +11 -0
  272. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_function_args_edges.rs +79 -0
  273. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_functions.rs +41 -0
  274. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_functions_aggregates.rs +43 -0
  275. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_if_expr_complex.rs +47 -0
  276. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_invalid_qnames.rs +23 -0
  277. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_kinds_basic.rs +41 -0
  278. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_names_wildcards.rs +54 -0
  279. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_negative_syntax.rs +15 -0
  280. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_nodes_ops.rs +27 -0
  281. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_numbers_strings.rs +43 -0
  282. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_param.rs +77 -0
  283. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_paths_axes.rs +65 -0
  284. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_precedence.rs +29 -0
  285. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_qnames_ns.rs +46 -0
  286. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_quantifiers_flwor.rs +28 -0
  287. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_reserved_functions.rs +87 -0
  288. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_schema_tests.rs +47 -0
  289. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_setops_casts.rs +36 -0
  290. platynui_inspector-0.2.0.dev1/crates/xpath/tests/parser_types_more.rs +39 -0
  291. platynui_inspector-0.2.0.dev1/crates/xpath/tests/property_deep_equal.rs +60 -0
  292. platynui_inspector-0.2.0.dev1/crates/xpath/tests/proptest_nan.rs +29 -0
  293. platynui_inspector-0.2.0.dev1/crates/xpath/tests/proptest_ordering.rs +48 -0
  294. platynui_inspector-0.2.0.dev1/crates/xpath/tests/proptest_round.rs +63 -0
  295. platynui_inspector-0.2.0.dev1/crates/xpath/tests/simple_node.rs +82 -0
  296. platynui_inspector-0.2.0.dev1/crates/xpath/tests/simple_node_cross_doc_order.rs +24 -0
  297. platynui_inspector-0.2.0.dev1/crates/xpath/tests/simple_node_ns_element.rs +25 -0
  298. platynui_inspector-0.2.0.dev1/crates/xpath/tests/static_context.rs +139 -0
  299. platynui_inspector-0.2.0.dev1/crates/xpath/tests/static_context_namespaces.rs +115 -0
  300. platynui_inspector-0.2.0.dev1/crates/xpath/tests/stream_additional.rs +180 -0
  301. platynui_inspector-0.2.0.dev1/crates/xpath/tests/stream_aggregates.rs +271 -0
  302. platynui_inspector-0.2.0.dev1/crates/xpath/tests/stream_count_basic.rs +142 -0
  303. platynui_inspector-0.2.0.dev1/crates/xpath/tests/stream_distinct_index.rs +124 -0
  304. platynui_inspector-0.2.0.dev1/crates/xpath/tests/stream_strings.rs +189 -0
  305. platynui_inspector-0.2.0.dev1/crates/xpath/tests/stream_transforms.rs +218 -0
  306. platynui_inspector-0.2.0.dev1/crates/xpath/tests/stream_validation.rs +203 -0
  307. platynui_inspector-0.2.0.dev1/crates/xpath/tests/streaming_behavior.rs +117 -0
  308. platynui_inspector-0.2.0.dev1/crates/xpath/tests/string_value_concat.rs +27 -0
  309. platynui_inspector-0.2.0.dev1/crates/xpath/tests/temporal_arith_matrix.rs +77 -0
  310. platynui_inspector-0.2.0.dev1/crates/xpath/tests/temporal_parsing.rs +86 -0
  311. platynui_inspector-0.2.0.dev1/crates/xpath/tests/test_sequence_cursors.rs +47 -0
  312. platynui_inspector-0.2.0.dev1/crates/xpath/tests/test_util.rs +15 -0
  313. platynui_inspector-0.2.0.dev1/crates/xpath/tests/treat_as_matrix.rs +54 -0
  314. platynui_inspector-0.2.0.dev1/crates/xpath/tests/type_matching_atomic.rs +67 -0
  315. platynui_inspector-0.2.0.dev1/crates/xpath/tests/untyped_atomic.rs +113 -0
  316. platynui_inspector-0.2.0.dev1/crates/xpath/tests/value_comparisons_qname_notation.rs +45 -0
  317. platynui_inspector-0.2.0.dev1/crates/xpath/tests/wildcard_document_node_bug.rs +115 -0
  318. platynui_inspector-0.2.0.dev1/crates/xpath/tests/ws6_duration_numeric.rs +64 -0
  319. platynui_inspector-0.2.0.dev1/packages/inspector/.gitignore +72 -0
  320. platynui_inspector-0.2.0.dev1/packages/inspector/Cargo.lock +6331 -0
  321. platynui_inspector-0.2.0.dev1/packages/inspector/Cargo.toml +17 -0
  322. platynui_inspector-0.2.0.dev1/packages/inspector/README.md +49 -0
  323. platynui_inspector-0.2.0.dev1/packages/inspector/src/main.rs +8 -0
  324. platynui_inspector-0.2.0.dev1/pyproject.toml +50 -0
@@ -0,0 +1,78 @@
1
+ Metadata-Version: 2.4
2
+ Name: platynui-inspector
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
+ Summary: Inspector for Robot Framework PlatynUI
20
+ Author-email: Daniel Biehl <daniel.biehl@imbus.de>
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
23
+ Project-URL: Homepage, https://github.com/imbus/robotframework-PlatynUI
24
+ Project-URL: Documentation, https://github.com/imbus/robotframework-PlatynUI#readme
25
+ Project-URL: Changelog, https://github.com/imbus/robotframework-PlatynUI/blob/main/CHANGELOG.md
26
+ Project-URL: Issues, https://github.com/imbus/robotframework-PlatynUI/issues
27
+ Project-URL: Source, https://github.com/imbus/robotframework-PlatynUI
28
+
29
+ # Robot Framework PlatynUI – Inspector
30
+
31
+ A simple GUI inspector for PlatynUI. It shows the UI (accessibility) tree and attributes/patterns of the selected node and can briefly highlight the selected element’s bounds.
32
+
33
+ > [!WARNING]
34
+ > Preview release on PyPI. This package is experimental; the UI and behavior may change. Intended for evaluation, not production.
35
+
36
+ ## Install
37
+
38
+ Install the pre‑release package from PyPI. After installation, the `platynui-inspector` command is available on your PATH.
39
+
40
+ ```pwsh
41
+ # In a virtual environment (uv)
42
+ uv pip install --pre robotframework-platynui-inspector
43
+
44
+ # Or with pip
45
+ pip install --pre robotframework-platynui-inspector
46
+
47
+ # Or install as a user-level tool (uv tool)
48
+ uv tool install --prerelease allow robotframework-platynui-inspector
49
+ ```
50
+
51
+ Supported platforms: Windows, macOS, and Linux. The bundled binary links platform providers for your OS. Note: As a pre‑release, some installers require an explicit flag (e.g., `--pre`).
52
+
53
+ ## Usage
54
+
55
+ ```pwsh
56
+ platynui-inspector
57
+ ```
58
+
59
+ - Left: Tree view (lazy-loaded). Expand/collapse nodes; the desktop is the root.
60
+ - Right: Attribute table (namespace, name, value, type) for the selected node.
61
+ - On selection, if available, the node’s `control:Bounds` is highlighted for ~1.5s.
62
+
63
+ Tips:
64
+ - Keyboard: Up/Down selects previous/next. Left collapses or jumps to the parent. Right expands or jumps to the first child. Home/End go to first/last; PageUp/PageDown scroll by a page.
65
+ - Context menu: Right‑click a row to Refresh or Refresh subtree.
66
+ - Value types are shown in the third column (Bool, Integer, Number, String, Point, Size, Rect, Array, Object).
67
+
68
+ ## Troubleshooting
69
+
70
+ - macOS: Grant Accessibility permissions to your terminal/IDE.
71
+ - Linux (X11): Ensure accessibility is enabled and AT‑SPI is running.
72
+ - Windows: UIA is typically available. If nothing appears, try running with elevated privileges.
73
+ - Highlight not visible: Some elements don’t expose `Bounds` or expose empty rectangles.
74
+
75
+ ## License
76
+
77
+ Apache‑2.0. See the repository’s LICENSE file.
78
+
@@ -0,0 +1,49 @@
1
+ # Robot Framework PlatynUI – Inspector
2
+
3
+ A simple GUI inspector for PlatynUI. It shows the UI (accessibility) tree and attributes/patterns of the selected node and can briefly highlight the selected element’s bounds.
4
+
5
+ > [!WARNING]
6
+ > Preview release on PyPI. This package is experimental; the UI and behavior may change. Intended for evaluation, not production.
7
+
8
+ ## Install
9
+
10
+ Install the pre‑release package from PyPI. After installation, the `platynui-inspector` command is available on your PATH.
11
+
12
+ ```pwsh
13
+ # In a virtual environment (uv)
14
+ uv pip install --pre robotframework-platynui-inspector
15
+
16
+ # Or with pip
17
+ pip install --pre robotframework-platynui-inspector
18
+
19
+ # Or install as a user-level tool (uv tool)
20
+ uv tool install --prerelease allow robotframework-platynui-inspector
21
+ ```
22
+
23
+ Supported platforms: Windows, macOS, and Linux. The bundled binary links platform providers for your OS. Note: As a pre‑release, some installers require an explicit flag (e.g., `--pre`).
24
+
25
+ ## Usage
26
+
27
+ ```pwsh
28
+ platynui-inspector
29
+ ```
30
+
31
+ - Left: Tree view (lazy-loaded). Expand/collapse nodes; the desktop is the root.
32
+ - Right: Attribute table (namespace, name, value, type) for the selected node.
33
+ - On selection, if available, the node’s `control:Bounds` is highlighted for ~1.5s.
34
+
35
+ Tips:
36
+ - Keyboard: Up/Down selects previous/next. Left collapses or jumps to the parent. Right expands or jumps to the first child. Home/End go to first/last; PageUp/PageDown scroll by a page.
37
+ - Context menu: Right‑click a row to Refresh or Refresh subtree.
38
+ - Value types are shown in the third column (Bool, Integer, Number, String, Point, Size, Rect, Array, Object).
39
+
40
+ ## Troubleshooting
41
+
42
+ - macOS: Grant Accessibility permissions to your terminal/IDE.
43
+ - Linux (X11): Ensure accessibility is enabled and AT‑SPI is running.
44
+ - Windows: UIA is typically available. If nothing appears, try running with elevated privileges.
45
+ - Highlight not visible: Some elements don’t expose `Bounds` or expose empty rectangles.
46
+
47
+ ## License
48
+
49
+ Apache‑2.0. See the repository’s LICENSE file.
@@ -0,0 +1,56 @@
1
+ [package]
2
+ name = "platynui-inspector"
3
+ version.workspace = true
4
+ keywords.workspace = true
5
+ categories.workspace = true
6
+ edition.workspace = true
7
+ homepage.workspace = true
8
+ documentation.workspace = true
9
+ repository.workspace = true
10
+ authors.workspace = true
11
+ license.workspace = true
12
+
13
+ [features]
14
+ default = []
15
+ mock-provider = [
16
+ "platynui-runtime/mock-provider",
17
+ "dep:platynui-provider-mock",
18
+ "dep:platynui-platform-mock",
19
+ ]
20
+
21
+ [dependencies]
22
+ slint = "1"
23
+ thiserror = "2.0"
24
+
25
+ # Mock providers are always available for Python testing
26
+ platynui-provider-mock = { path = "../../crates/provider-mock", optional = true }
27
+ platynui-platform-mock = { path = "../../crates/platform-mock", optional = true }
28
+
29
+ # Internal crates
30
+ platynui-core = { path = "../../crates/core" }
31
+ platynui-runtime = { path = "../../crates/runtime", default-features = false }
32
+
33
+ platynui-link = { path = "../../crates/link" }
34
+
35
+ [target.'cfg(target_os = "windows")'.dependencies]
36
+ platynui-platform-windows = { path = "../../crates/platform-windows" }
37
+ platynui-provider-windows-uia = { path = "../../crates/provider-windows-uia" }
38
+
39
+ [target.'cfg(target_os = "linux")'.dependencies]
40
+ platynui-platform-linux-x11 = { path = "../../crates/platform-linux-x11" }
41
+ platynui-provider-atspi = { path = "../../crates/provider-atspi" }
42
+
43
+ [target.'cfg(target_os = "macos")'.dependencies]
44
+ platynui-platform-macos = { path = "../../crates/platform-macos" }
45
+ platynui-provider-macos-ax = { path = "../../crates/provider-macos-ax" }
46
+
47
+ [build-dependencies]
48
+ slint-build = "1"
49
+
50
+ [lib]
51
+ name = "platynui_inspector"
52
+ path = "src/lib.rs"
53
+
54
+ [[bin]]
55
+ name = "platynui-inspector"
56
+ path = "src/main.rs"
@@ -0,0 +1,3 @@
1
+ fn main() {
2
+ slint_build::compile("ui/app-window.slint").expect("Slint build failed");
3
+ }
@@ -0,0 +1,182 @@
1
+ slint::include_modules!();
2
+ use std::sync::Arc;
3
+ use std::{cell::RefCell, rc::Rc};
4
+ use ui::tree::{
5
+ data::{TreeData, uinode::UiNodeData},
6
+ viewmodel::ViewModel,
7
+ };
8
+
9
+ use platynui_core::platform::HighlightRequest;
10
+ use platynui_core::ui::{Namespace, UiValue};
11
+ use platynui_link::platynui_link_providers;
12
+ use platynui_runtime::Runtime;
13
+ use std::time::Duration;
14
+
15
+ platynui_link_providers!();
16
+
17
+ mod ui;
18
+
19
+ pub fn run() -> Result<(), slint::PlatformError> {
20
+ let main_window = MainWindow::new()?;
21
+
22
+ // Create PlatynUI runtime and get desktop node - keep runtime alive for entire application lifetime
23
+ let runtime = Runtime::new().map_err(|e| {
24
+ eprintln!("Failed to create PlatynUI runtime: {}", e);
25
+ slint::PlatformError::Other(format!("Runtime creation failed: {}", e))
26
+ })?;
27
+ let runtime: Arc<Runtime> = Arc::new(runtime);
28
+
29
+ let desktop_node = runtime.desktop_node();
30
+ let root_data: Arc<dyn TreeData<Underlying = Arc<dyn platynui_core::ui::UiNode>>> =
31
+ Arc::new(UiNodeData::new(desktop_node));
32
+
33
+ let adapter: Rc<RefCell<ViewModel>> = Rc::new(RefCell::new(ViewModel::new(root_data)));
34
+ main_window.set_tree_model(adapter.borrow().visible_model());
35
+
36
+ // Handle expand/collapse + lazy load requests (index-based only)
37
+ let adapter1b = Rc::clone(&adapter);
38
+ main_window.on_tree_node_toggled_index(move |index, expanded| {
39
+ adapter1b.borrow_mut().toggle_index(index as usize, expanded);
40
+ });
41
+ // Request children (index-based)
42
+ let adapter2b = Rc::clone(&adapter);
43
+ main_window.on_tree_request_children_index(move |index| {
44
+ adapter2b.borrow_mut().request_children_index(index as usize);
45
+ });
46
+
47
+ // Refresh a specific row (index-based): clear caches under that node and rebuild
48
+ let adapter_refresh = Rc::clone(&adapter);
49
+ main_window.on_tree_refresh_index(move |idx| {
50
+ // Clear caches for this node then rebuild visible rows
51
+ let mut vm = adapter_refresh.borrow_mut();
52
+ vm.refresh_row(idx as usize);
53
+ vm.force_rebuild();
54
+ });
55
+ let adapter_refresh2 = Rc::clone(&adapter);
56
+ main_window.on_tree_refresh_subtree_index(move |idx| {
57
+ let mut vm = adapter_refresh2.borrow_mut();
58
+ vm.refresh_row_recursive(idx as usize);
59
+ vm.force_rebuild();
60
+ });
61
+
62
+ // Index-based selection
63
+ let adapter5 = Rc::clone(&adapter);
64
+ let runtime_for_select = Arc::clone(&runtime);
65
+ let main_window_handle = main_window.as_weak();
66
+ main_window.on_tree_node_selected_index(move |index| {
67
+ if let Some(node) = adapter5.borrow().resolve_node_by_index(index as usize) {
68
+ // Collect attributes and push into the Slint table model
69
+ if let Some(win) = main_window_handle.upgrade() {
70
+ use slint::{ModelRc, SharedString, StandardListViewItem, VecModel};
71
+ // Helper to create a cell without struct literal (non_exhaustive)
72
+ let cell_owned = |s: String| StandardListViewItem::from(SharedString::from(s));
73
+
74
+ // Outer model (list of rows)
75
+ let outer: Rc<VecModel<ModelRc<StandardListViewItem>>> = Rc::new(VecModel::default());
76
+
77
+ // Small helper to push a row of three cells directly
78
+ let push_row = |c1: String, c2: String, c3: String| {
79
+ let inner: Rc<VecModel<StandardListViewItem>> = Rc::new(VecModel::default());
80
+ inner.push(cell_owned(c1));
81
+ inner.push(cell_owned(c2));
82
+ inner.push(cell_owned(c3));
83
+ outer.push(ModelRc::from(inner));
84
+ };
85
+
86
+ // Dynamic attributes: stream directly into models
87
+ // Also cache control:Bounds once if present to use it for highlighting later
88
+ let mut cached_bounds: Option<platynui_core::types::Rect> = None;
89
+ for attr in node.attributes() {
90
+ use std::fmt::Write as _;
91
+ let ns = attr.namespace();
92
+ let name = attr.name();
93
+ let value = attr.value();
94
+ // Capture control:Bounds if available and non-empty
95
+ if cached_bounds.is_none()
96
+ && let (Namespace::Control, "Bounds") = (ns, name)
97
+ && let UiValue::Rect(r) = &value
98
+ && !r.is_empty()
99
+ {
100
+ cached_bounds = Some(*r);
101
+ }
102
+ let (val_str, ty_str) = match value {
103
+ UiValue::Null => ("<null>".to_string(), "null".to_string()),
104
+ UiValue::Bool(b) => (b.to_string(), "bool".to_string()),
105
+ UiValue::Integer(i) => (i.to_string(), "integer".to_string()),
106
+ UiValue::Number(n) => (n.to_string(), "number".to_string()),
107
+ UiValue::String(s) => (s, "string".to_string()),
108
+ UiValue::Point(p) => (format!("{:.0}, {:.0}", p.x(), p.y()), "Point".to_string()),
109
+ UiValue::Size(s) => (format!("{:.0} x {:.0}", s.width(), s.height()), "Size".to_string()),
110
+ UiValue::Rect(r) => (
111
+ format!("{:.0}, {:.0}, {:.0}, {:.0}", r.x(), r.y(), r.width(), r.height()),
112
+ "Rect".to_string(),
113
+ ),
114
+ UiValue::Array(a) => {
115
+ let mut s = String::new();
116
+ s.push('[');
117
+ for (i, it) in a.into_iter().enumerate() {
118
+ if i > 0 {
119
+ s.push_str(", ");
120
+ }
121
+ let _ = write!(
122
+ &mut s,
123
+ "{}",
124
+ match it {
125
+ UiValue::String(st) => st,
126
+ _ => format!("{:?}", it),
127
+ }
128
+ );
129
+ }
130
+ s.push(']');
131
+ (s, "array".to_string())
132
+ }
133
+ UiValue::Object(o) => {
134
+ let mut s = String::new();
135
+ s.push('{');
136
+ for (i, (k, v)) in o.into_iter().enumerate() {
137
+ if i > 0 {
138
+ s.push_str(", ");
139
+ }
140
+ let _ = write!(&mut s, "{}: {:?}", k, v);
141
+ }
142
+ s.push('}');
143
+ (s, "object".to_string())
144
+ }
145
+ };
146
+ let ns_name = match ns {
147
+ Namespace::Control => "control",
148
+ Namespace::Item => "item",
149
+ Namespace::App => "app",
150
+ Namespace::Native => "native",
151
+ };
152
+ let full_name = format!("{}: {}", ns_name, name);
153
+ push_row(full_name, val_str, ty_str);
154
+ }
155
+
156
+ win.set_attr_rows(ModelRc::from(outer));
157
+
158
+ // Try to highlight the cached bounds (if present); otherwise clear highlight
159
+ if let Some(bounds) = cached_bounds {
160
+ let rt = Arc::clone(&runtime_for_select);
161
+ std::thread::spawn(move || {
162
+ let req = HighlightRequest::new(bounds).with_duration(Duration::from_millis(1500));
163
+ if let Err(err) = rt.highlight(&req) {
164
+ eprintln!("Highlight error: {}", err);
165
+ }
166
+ });
167
+ } else {
168
+ let rt = Arc::clone(&runtime_for_select);
169
+ std::thread::spawn(move || {
170
+ let _ = rt.clear_highlight();
171
+ });
172
+ }
173
+ }
174
+ }
175
+ });
176
+
177
+ main_window.on_exit_requested(move || {
178
+ let _ = slint::quit_event_loop();
179
+ });
180
+
181
+ main_window.run()
182
+ }
@@ -0,0 +1,5 @@
1
+ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
2
+
3
+ fn main() -> Result<(), slint::PlatformError> {
4
+ platynui_inspector::run()
5
+ }
@@ -0,0 +1 @@
1
+ pub mod tree;
@@ -0,0 +1,35 @@
1
+ use slint::SharedString;
2
+ use std::sync::Arc;
3
+
4
+ pub mod uinode;
5
+
6
+ #[derive(Debug)]
7
+ pub enum TreeDataError {
8
+ Other,
9
+ }
10
+
11
+ /// Abstraction for tree data that can back our UI.
12
+ /// Provides cached identifiers/labels and navigation for a single node.
13
+ pub trait TreeData: Send + Sync {
14
+ type Underlying;
15
+ fn id(&self) -> SharedString;
16
+ fn label(&self) -> Result<SharedString, TreeDataError>;
17
+ fn has_children(&self) -> Result<bool, TreeDataError>;
18
+ fn children(&self) -> Result<Vec<Arc<dyn TreeData<Underlying = Self::Underlying>>>, TreeDataError>;
19
+ fn parent(&self) -> Result<Option<Arc<dyn TreeData<Underlying = Self::Underlying>>>, TreeDataError>;
20
+ fn as_underlying_data(&self) -> Option<Self::Underlying>;
21
+
22
+ /// Optional: refresh any internal caches for this node only.
23
+ /// Default is no-op; providers with caches can override.
24
+ fn refresh_self(&self) {}
25
+
26
+ /// Optional: clear caches for this node and children to force re-query.
27
+ fn refresh_recursive(&self) {
28
+ self.refresh_self();
29
+ if let Ok(children) = self.children() {
30
+ for ch in children {
31
+ ch.refresh_recursive();
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,234 @@
1
+ #![allow(clippy::type_complexity)]
2
+ use slint::SharedString;
3
+ use std::sync::{Arc, Mutex};
4
+
5
+ use super::{TreeData, TreeDataError};
6
+ use platynui_core::ui::{Namespace, UiNode, UiNodeExt, UiValue};
7
+
8
+ /// TreeData implementation that wraps a single UiNode
9
+ /// Each UiNodeData represents exactly one node in the tree
10
+ pub struct UiNodeData {
11
+ node: Arc<dyn UiNode>,
12
+ id_cache: Mutex<Option<SharedString>>,
13
+ label_cache: Mutex<Option<SharedString>>,
14
+ has_children_cache: Mutex<Option<bool>>,
15
+ children_cache: Mutex<Option<Vec<Arc<dyn super::TreeData<Underlying = Arc<dyn UiNode>>>>>>,
16
+ parent_cache: Mutex<Option<Arc<dyn super::TreeData<Underlying = Arc<dyn UiNode>>>>>,
17
+ }
18
+
19
+ impl UiNodeData {
20
+ pub fn new(node: Arc<dyn UiNode>) -> Self {
21
+ Self {
22
+ node,
23
+ id_cache: Mutex::new(None),
24
+ label_cache: Mutex::new(None),
25
+ has_children_cache: Mutex::new(None),
26
+ children_cache: Mutex::new(None),
27
+ parent_cache: Mutex::new(None),
28
+ }
29
+ }
30
+ }
31
+
32
+ impl TreeData for UiNodeData {
33
+ type Underlying = Arc<dyn UiNode>;
34
+ fn id(&self) -> SharedString {
35
+ if let Some(v) = self.id_cache.lock().unwrap().as_ref() {
36
+ return v.clone();
37
+ }
38
+ let v: SharedString = self.node.runtime_id().as_str().into();
39
+ *self.id_cache.lock().unwrap() = Some(v.clone());
40
+ v
41
+ }
42
+
43
+ fn label(&self) -> Result<SharedString, TreeDataError> {
44
+ if let Some(v) = self.label_cache.lock().unwrap().as_ref() {
45
+ return Ok(v.clone());
46
+ }
47
+ // Prefer the dynamic Control/Name attribute (fresh each read); fall back to no name
48
+ let name_str: String = self
49
+ .node
50
+ .attribute(Namespace::Control, "Name")
51
+ .map(|attr| match attr.value() {
52
+ UiValue::String(s) => s,
53
+ _ => String::new(),
54
+ })
55
+ .unwrap_or_default();
56
+ let escaped = escape_control_chars(&name_str);
57
+ let label = if escaped.is_empty() {
58
+ self.node.role().to_string()
59
+ } else {
60
+ format!("{} \"{}\"", self.node.role(), escaped)
61
+ };
62
+ let s: SharedString = label.into();
63
+ *self.label_cache.lock().unwrap() = Some(s.clone());
64
+ Ok(s)
65
+ }
66
+
67
+ fn has_children(&self) -> Result<bool, TreeDataError> {
68
+ // Prefer cached children list if available
69
+ if let Some(children) = self.children_cache.lock().unwrap().as_ref() {
70
+ return Ok(!children.is_empty());
71
+ }
72
+ if let Some(hc) = *self.has_children_cache.lock().unwrap() {
73
+ return Ok(hc);
74
+ }
75
+ // Probe a single child and cache the boolean
76
+ let has = self.node.children().next().is_some();
77
+ *self.has_children_cache.lock().unwrap() = Some(has);
78
+ Ok(has)
79
+ }
80
+
81
+ fn children(&self) -> Result<Vec<Arc<dyn TreeData<Underlying = Self::Underlying>>>, TreeDataError> {
82
+ if let Some(v) = self.children_cache.lock().unwrap().as_ref() {
83
+ return Ok(v.clone());
84
+ }
85
+ let list: Vec<Arc<dyn TreeData<Underlying = Self::Underlying>>> = self
86
+ .node
87
+ .children()
88
+ .map(|child_node| Arc::new(UiNodeData::new(child_node)) as Arc<dyn TreeData<Underlying = Self::Underlying>>)
89
+ .collect();
90
+ *self.has_children_cache.lock().unwrap() = Some(!list.is_empty());
91
+ *self.children_cache.lock().unwrap() = Some(list.clone());
92
+ Ok(list)
93
+ }
94
+
95
+ fn parent(&self) -> Result<Option<Arc<dyn TreeData<Underlying = Self::Underlying>>>, TreeDataError> {
96
+ if let Some(v) = self.parent_cache.lock().unwrap().as_ref() {
97
+ return Ok(Some(v.clone()));
98
+ }
99
+ let p = self.node.parent_arc().map(|parent_node| {
100
+ Arc::new(UiNodeData::new(parent_node)) as Arc<dyn TreeData<Underlying = Self::Underlying>>
101
+ });
102
+ if let Some(ref arc) = p {
103
+ *self.parent_cache.lock().unwrap() = Some(arc.clone());
104
+ }
105
+ Ok(p)
106
+ }
107
+
108
+ fn as_underlying_data(&self) -> Option<Self::Underlying> {
109
+ Some(self.node.clone())
110
+ }
111
+
112
+ fn refresh_self(&self) {
113
+ // Invalidate underlying provider caches so values (like name) are re-queried.
114
+ self.node.invalidate();
115
+ // Clear only our own caches; children are kept unless refresh_recursive is used.
116
+ *self.id_cache.lock().unwrap() = None;
117
+ *self.label_cache.lock().unwrap() = None;
118
+ *self.has_children_cache.lock().unwrap() = None;
119
+ *self.children_cache.lock().unwrap() = None;
120
+ *self.parent_cache.lock().unwrap() = None;
121
+ }
122
+ }
123
+
124
+ /// Escape control characters in a label string.
125
+ /// - Carriage Return (\r) and Line Feed (\n) are converted to a single space ' '.
126
+ /// - All other control characters are escaped as hex codes:
127
+ /// - ASCII control (<= 0xFF): \xHH
128
+ /// - Other Unicode control: \u{XXXX}
129
+ fn escape_control_chars(input: &str) -> String {
130
+ let mut out = String::with_capacity(input.len());
131
+ let mut it = input.chars().peekable();
132
+ while let Some(ch) = it.next() {
133
+ match ch {
134
+ '\r' => {
135
+ // Skip CR entirely (do not produce a space)
136
+ while let Some(next) = it.peek() {
137
+ if *next == '\r' {
138
+ let _ = it.next();
139
+ } else {
140
+ break;
141
+ }
142
+ }
143
+ }
144
+ '\n' => {
145
+ // Collapse runs of LF (and any adjacent CR) into a single space
146
+ while let Some(next) = it.peek() {
147
+ if *next == '\n' || *next == '\r' {
148
+ let _ = it.next();
149
+ } else {
150
+ break;
151
+ }
152
+ }
153
+ out.push(' ');
154
+ }
155
+ _ if ch.is_control() || is_format_char(ch) => {
156
+ let code = ch as u32;
157
+ if code <= 0xFF {
158
+ use std::fmt::Write as _;
159
+ let _ = write!(&mut out, "\\x{:02X}", code);
160
+ } else {
161
+ use std::fmt::Write as _;
162
+ let _ = write!(&mut out, "\\u{{{:X}}}", code);
163
+ }
164
+ }
165
+ _ => out.push(ch),
166
+ }
167
+ }
168
+ out
169
+ }
170
+
171
+ // Minimal detection of Unicode Format (Cf) characters without external crates
172
+ fn is_format_char(ch: char) -> bool {
173
+ let c = ch as u32;
174
+ matches!(
175
+ c,
176
+ 0x00AD
177
+ | 0x061C
178
+ | 0x06DD
179
+ | 0x070F
180
+ | 0x08E2
181
+ | 0x180E
182
+ | 0xFEFF
183
+ | 0x110BD
184
+ | 0x110CD
185
+ | 0x1BCA0..=0x1BCA3
186
+ | 0x1D173..=0x1D17A
187
+ | 0xE0001
188
+ | 0xE0020..=0xE007F
189
+ | 0x0600..=0x0605
190
+ | 0x200B..=0x200F
191
+ | 0x202A..=0x202E
192
+ | 0x2060..=0x2064
193
+ | 0x2066..=0x206F
194
+ | 0xFFF9..=0xFFFB
195
+ | 0x13430..=0x13438
196
+ )
197
+ }
198
+
199
+ #[cfg(test)]
200
+ mod tests {
201
+ use super::escape_control_chars;
202
+
203
+ #[test]
204
+ fn cr_lf_to_space() {
205
+ assert_eq!(escape_control_chars("a\r\nb"), "a b");
206
+ assert_eq!(escape_control_chars("a\nb"), "a b");
207
+ assert_eq!(escape_control_chars("a\rb"), "ab");
208
+ }
209
+
210
+ #[test]
211
+ fn other_control_to_hex() {
212
+ assert_eq!(escape_control_chars("a\t b"), "a\\x09 b");
213
+ assert_eq!(escape_control_chars("\u{0000}"), "\\x00");
214
+ assert_eq!(escape_control_chars("\u{007F}"), "\\x7F");
215
+ }
216
+
217
+ #[test]
218
+ fn unicode_control_cf() {
219
+ // ZERO WIDTH NO-BREAK SPACE (U+FEFF) is Cf
220
+ assert_eq!(escape_control_chars("a\u{FEFF}b"), "a\\u{FEFF}b");
221
+ }
222
+
223
+ #[test]
224
+ fn bidi_and_line_direction_marks_are_escaped() {
225
+ // LRM (U+200E), RLM (U+200F), RLO (U+202E), LRO (U+202D), LRE (U+202A), RLE (U+202B), PDF (U+202C)
226
+ assert_eq!(escape_control_chars("a\u{200E}b"), "a\\u{200E}b");
227
+ assert_eq!(escape_control_chars("a\u{200F}b"), "a\\u{200F}b");
228
+ assert_eq!(escape_control_chars("a\u{202E}b"), "a\\u{202E}b");
229
+ assert_eq!(escape_control_chars("a\u{202D}b"), "a\\u{202D}b");
230
+ assert_eq!(escape_control_chars("a\u{202A}b"), "a\\u{202A}b");
231
+ assert_eq!(escape_control_chars("a\u{202B}b"), "a\\u{202B}b");
232
+ assert_eq!(escape_control_chars("a\u{202C}b"), "a\\u{202C}b");
233
+ }
234
+ }
@@ -0,0 +1,2 @@
1
+ pub mod data;
2
+ pub mod viewmodel;