├── tests ├── cargo-zng-res-tests │ ├── glob │ │ ├── refs │ │ │ ├── aa │ │ │ ├── ab │ │ │ ├── ac │ │ │ ├── ba │ │ │ └── i │ │ │ │ ├── aai │ │ │ │ ├── abi │ │ │ │ ├── aci │ │ │ │ └── bai │ │ ├── test.stderr │ │ ├── expected_target │ │ │ ├── flatten │ │ │ │ ├── aa │ │ │ │ ├── aai │ │ │ │ ├── ab │ │ │ │ ├── abi │ │ │ │ ├── ac │ │ │ │ └── aci │ │ │ └── refs │ │ │ │ ├── aa │ │ │ │ ├── ac │ │ │ │ └── i │ │ │ │ ├── aai │ │ │ │ └── aci │ │ └── source │ │ │ ├── flatten │ │ │ └── refs-glob.zr-glob │ │ │ └── filter.zr-glob │ ├── copy │ │ ├── test.stderr │ │ ├── refs │ │ │ ├── file-a.txt │ │ │ ├── file-b.txt │ │ │ └── merge-a │ │ │ │ └── merged-file-a.txt │ │ ├── expected_target │ │ │ ├── file-b.txt │ │ │ └── a │ │ │ │ ├── file-a.txt │ │ │ │ └── merged-file-a.txt │ │ ├── source │ │ │ ├── a.zr-copy │ │ │ ├── a │ │ │ │ └── file-a.txt.zr-copy │ │ │ └── file-b.txt.zr-copy │ │ └── test.stdout │ ├── custom │ │ ├── test.stderr │ │ ├── expected_target │ │ │ ├── hello-tool1.txt │ │ │ ├── hello-tool2.txt │ │ │ └── hello-tool-crate.txt │ │ ├── source │ │ │ ├── hello-tool1.txt.zr-tool1 │ │ │ ├── hello-tool2.txt.zr-tool2 │ │ │ └── hello-tool-crate.txt.zr-tool-crate │ │ ├── tools │ │ │ ├── cargo-zng-res-tool-crate │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ │ └── main.rs │ │ │ └── cargo-zng-res │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ └── bin │ │ │ │ ├── tool1.rs │ │ │ │ └── tool2.rs │ │ └── test.stdout │ ├── recursive │ │ ├── test.stderr │ │ ├── expected_target │ │ │ ├── copy │ │ │ │ ├── file-b.txt │ │ │ │ └── a │ │ │ │ │ ├── file-a.txt │ │ │ │ │ └── merged-file-a.txt │ │ │ └── a │ │ │ │ └── copy │ │ │ │ ├── a │ │ │ │ ├── file-a.txt │ │ │ │ └── merged-file-a.txt │ │ │ │ └── file-b.txt │ │ └── source │ │ │ ├── a │ │ │ └── copy.zr-copy │ │ │ └── copy.zr-copy │ ├── statics │ │ ├── source │ │ │ ├── a.txt │ │ │ ├── b.txt │ │ │ ├── fa │ │ │ │ └── fa-a.txt │ │ │ └── fb │ │ │ │ ├── fb-a.txt │ │ │ │ ├── fb-b.txt │ │ │ │ └── fb-fa │ │ │ │ └── fb-fa-a.txt │ │ ├── test.stderr │ │ ├── expected_target │ │ │ ├── fa │ │ │ │ └── .empty │ │ │ └── fb │ │ │ │ └── fb-fa │ │ │ │ └── .empty │ │ └── test.stdout │ ├── statics-pack │ │ ├── source │ │ │ ├── a.txt │ │ │ ├── b.txt │ │ │ ├── fa │ │ │ │ └── fa-a.txt │ │ │ └── fb │ │ │ │ ├── fb-a.txt │ │ │ │ ├── fb-b.txt │ │ │ │ └── fb-fa │ │ │ │ └── fb-fa-a.txt │ │ ├── test.stderr │ │ └── expected_target │ │ │ ├── a.txt │ │ │ ├── b.txt │ │ │ ├── fa │ │ │ └── fa-a.txt │ │ │ └── fb │ │ │ ├── fb-a.txt │ │ │ ├── fb-b.txt │ │ │ └── fb-fa │ │ │ └── fb-fa-a.txt │ ├── bash │ │ ├── expected_target │ │ │ ├── recursion.txt │ │ │ ├── hello.txt │ │ │ └── on-final.txt │ │ ├── source │ │ │ ├── warning.zr-warn │ │ │ ├── hello.txt.zr-sh │ │ │ ├── on-final.txt.zr-shf │ │ │ ├── recursion.txt.zr-copy.zr-sh │ │ │ └── on-final.zr-sh │ │ ├── test.stderr │ │ └── test.stdout │ ├── replace │ │ ├── source │ │ │ ├── recursive.zr-warn.zr-rp │ │ │ └── replace.md.zr-rp │ │ ├── test.stderr │ │ ├── test.stdout │ │ └── expected_target │ │ │ └── replace.md │ ├── bash-error │ │ ├── source │ │ │ └── fail.zr-sh │ │ ├── test.stdout │ │ └── test.stderr │ └── metadata.toml ├── cargo-zng-new-tests │ ├── basic │ │ ├── test.stderr │ │ ├── template │ │ │ ├── t_app_t │ │ │ │ └── T-ORG-T.txt │ │ │ ├── .zng-template │ │ │ │ └── keys │ │ │ └── t-app-t.md │ │ ├── expected_target │ │ │ └── the-app │ │ │ │ ├── the_app │ │ │ │ └── THE-ORG.txt │ │ │ │ └── the-app.md │ │ └── test.stdout │ ├── post │ │ ├── test.stderr │ │ ├── template │ │ │ └── .zng-template │ │ │ │ ├── keys │ │ │ │ └── post │ │ │ │ └── post.sh │ │ ├── expected_target │ │ │ └── the-app │ │ │ │ └── the-app.txt │ │ └── test.stdout │ └── sanitize │ │ ├── test.stderr │ │ ├── template │ │ ├── {{app}} │ │ │ └── ok │ │ ├── .zng-template │ │ │ └── keys │ │ └── {{app}}.md │ │ ├── expected_target │ │ └── the-app │ │ │ ├── The App │ │ │ └── ok │ │ │ └── The App.md │ │ └── test.stdout ├── macro-tests │ ├── cases │ │ ├── widget │ │ │ ├── parent_not_widget.rs │ │ │ ├── util │ │ │ │ └── a_mod.rs │ │ │ ├── unknown_inherit.rs │ │ │ ├── type_path_malformed1.rs │ │ │ ├── module_path_missing.rs │ │ │ ├── module_path_malformed3.stderr │ │ │ ├── type_path_is_invalid1.rs │ │ │ ├── module_path_malformed2.rs │ │ │ ├── type_path_malformed1.stderr │ │ │ ├── module_path_malformed2.stderr │ │ │ ├── module_path_malformed3.rs │ │ │ ├── module_path_missing_crate.rs │ │ │ ├── module_path_missing_dollar_sign.rs │ │ │ ├── module_path_missing_crate.stderr │ │ │ ├── cannot_instantiate_widget_mixin.rs │ │ │ ├── module_path_missing_dollar_sign.stderr │ │ │ ├── unknown_inherit.stderr │ │ │ ├── cannot_instantiate_widget_mixin.stderr │ │ │ ├── module_path_missing.stderr │ │ │ ├── name_conflict2.rs │ │ │ ├── type_path_is_invalid1.stderr │ │ │ └── name_conflict1.rs │ │ ├── widget_new │ │ │ ├── missing_semi1.stderr │ │ │ ├── missing_semi2.stderr │ │ │ ├── when_missing_expr1.rs │ │ │ ├── malformed_property_path2.stderr │ │ │ ├── unknown_property1.rs │ │ │ ├── error_in_when_expr2.stderr │ │ │ ├── missing_semi_before_when1.stderr │ │ │ ├── malformed_property_path1.stderr │ │ │ ├── unknown_property2.rs │ │ │ ├── error_in_when_expr3.stderr │ │ │ ├── incorrect_arg_type1.rs │ │ │ ├── malformed_property_path4.stderr │ │ │ ├── missing_semi_in_when1.stderr │ │ │ ├── cannot_unset_in_when.stderr │ │ │ ├── unknown_field.rs │ │ │ ├── malformed_property_path1.rs │ │ │ ├── malformed_property_path2.rs │ │ │ ├── malformed_property_path4.rs │ │ │ ├── missing_value1.rs │ │ │ ├── missing_value2.rs │ │ │ ├── malformed_property_path3.rs │ │ │ ├── unknown_special_value.rs │ │ │ ├── when_missing_block.rs │ │ │ ├── property_generic2.rs │ │ │ ├── invalid_special.rs │ │ │ ├── malformed_fields1.rs │ │ │ ├── malformed_fields2.rs │ │ │ ├── malformed_fields1.stderr │ │ │ ├── unknown_property1.stderr │ │ │ ├── error_in_property_expr.rs │ │ │ ├── incorrect_arg_type3.rs │ │ │ ├── error_in_when_expr2.rs │ │ │ ├── malformed_property_attribute.rs │ │ │ ├── cannot_unset_in_when.rs │ │ │ ├── error_in_when_expr1.stderr │ │ │ ├── error_in_when_expr3.rs │ │ │ ├── error_first_token.stderr │ │ │ ├── when_missing_expr1.stderr │ │ │ ├── missing_field_all_single.rs │ │ │ ├── missing_value6.rs │ │ │ ├── missing_arg1.rs │ │ │ ├── unknown_field.stderr │ │ │ ├── unknown_special_value_in_when.rs │ │ │ ├── property_generic1.rs │ │ │ ├── missing_semi_before_when1.rs │ │ │ ├── missing_value_before_when1.rs │ │ │ ├── missing_value3.rs │ │ │ ├── unknown_member_in_when_expr1.rs │ │ │ ├── unknown_member_in_when_expr2.rs │ │ │ ├── error_in_when_expr1.rs │ │ │ ├── missing_value5.rs │ │ │ ├── missing_value4.rs │ │ │ ├── missing_field_all_multi.rs │ │ │ ├── missing_semi1.rs │ │ │ ├── incorrect_arg_type4.rs │ │ │ ├── incorrect_when_expr_type1.rs │ │ │ ├── error_in_property_expr.stderr │ │ │ ├── incorrect_arg_type2.rs │ │ │ ├── error_first_token.rs │ │ │ ├── missing_semi2.rs │ │ │ ├── missing_field_multi.rs │ │ │ ├── unknown_member_in_when_expr1.stderr │ │ │ ├── missing_semi_in_when2.rs │ │ │ ├── incorrect_arg_type5.rs │ │ │ ├── missing_semi_in_when1.rs │ │ │ ├── unknown_member_in_when_expr2.stderr │ │ │ ├── unknown_special_value.stderr │ │ │ ├── when_missing_block.stderr │ │ │ ├── incorrect_arg_type6.rs │ │ │ ├── invalid_special.stderr │ │ │ ├── property_generic1.stderr │ │ │ ├── unknown_special_value_in_when.stderr │ │ │ ├── not_allowed_in_when1.rs │ │ │ ├── not_allowed_in_when2.rs │ │ │ ├── missing_value2.stderr │ │ │ ├── missing_value1.stderr │ │ │ ├── not_allowed_in_when2.stderr │ │ │ └── not_allowed_in_when1.stderr │ │ ├── property │ │ │ ├── args_count_none.rs │ │ │ ├── args_count_no_input.rs │ │ │ ├── invalid_priority.stderr │ │ │ ├── incorrect_attr_args.rs │ │ │ ├── args_count_no_input.stderr │ │ │ ├── property_attr_not_fn.rs │ │ │ ├── cannot_declare_lifetime.rs │ │ │ ├── property_attr_not_fn.stderr │ │ │ ├── invalid_input_pattern.rs │ │ │ ├── invalid_priority.rs │ │ │ ├── return_type_is_not_ui_node.rs │ │ │ ├── child_type_is_not_ui_node.rs │ │ │ ├── child_type_is_not_ui_node.stderr │ │ │ ├── child_type_constraints_ui_node.rs │ │ │ ├── child_type_constraints_ui_node.stderr │ │ │ ├── args_count_none.stderr │ │ │ ├── prefix_is_default.rs │ │ │ ├── prefix_has_default.rs │ │ │ ├── method_cannot_be_property.stderr │ │ │ ├── prefix_get_default.rs │ │ │ ├── cannot_declare_lifetime.stderr │ │ │ ├── invalid_input_pattern.stderr │ │ │ ├── method_cannot_be_property.rs │ │ │ ├── invalid_function_qualifiers.rs │ │ │ ├── incorrect_attr_args.stderr │ │ │ ├── prefix_has_default.stderr │ │ │ └── prefix_is_default.stderr │ │ └── hot_node │ │ │ ├── input_not_clone.rs │ │ │ ├── missing_hot_entry.rs │ │ │ ├── invalid_input_pattern.stderr │ │ │ ├── cannot_declare_lifetime.rs │ │ │ ├── invalid_input_pattern.rs │ │ │ ├── return_type_is_not_ui_node.rs │ │ │ ├── method_cannot_be_hot_node.stderr │ │ │ ├── cannot_declare_lifetime.stderr │ │ │ ├── return_type_is_not_ui_node.stderr │ │ │ ├── method_cannot_be_hot_node.rs │ │ │ ├── invalid_function_qualifiers.rs │ │ │ └── invalid_function_qualifiers.stderr │ ├── Cargo.toml │ └── src │ │ └── main.rs └── render-tests │ └── Cargo.toml ├── examples ├── multi │ └── res │ │ ├── my-res.txt │ │ └── screenshot.png ├── config │ ├── res │ │ ├── default-settings.json │ │ └── screenshot.png │ └── Cargo.toml ├── image │ ├── res │ │ ├── color_profiles │ │ │ ├── README.md │ │ │ ├── odd.png │ │ │ ├── adobe.png │ │ │ ├── anon.gif │ │ │ ├── anon.jpg │ │ │ ├── anon.png │ │ │ ├── gamma.png │ │ │ ├── srgb.jpg │ │ │ ├── srgb.png │ │ │ └── rec709.jpg │ │ ├── Luma8.png │ │ ├── RGB16.png │ │ ├── RGB8.png │ │ ├── RGBA8.png │ │ ├── Luma16.png │ │ ├── LumaA16.png │ │ ├── LumaA8.png │ │ ├── RGBA16.png │ │ ├── zng-logo.png │ │ ├── screenshot.png │ │ ├── 300x300@96dpi.jpg │ │ ├── 300x300@96dpi.png │ │ ├── exif rotated.jpg │ │ ├── exif rotated.tif │ │ ├── zng-logo-icon.png │ │ ├── 600x600@192dpi.jpg │ │ ├── 600x600@192dpi.png │ │ ├── zdenek-machacek-unsplash.jpg │ │ ├── player_combat_sheet-10-96x84-CC0.png │ │ └── EXTERNAL_USE.md │ └── Cargo.toml ├── cursor │ ├── res │ │ ├── cell.png │ │ ├── copy.png │ │ ├── grab.png │ │ ├── help.png │ │ ├── move.png │ │ ├── text.png │ │ ├── wait.png │ │ ├── alias.png │ │ ├── default.png │ │ ├── no-drop.png │ │ ├── pointer.png │ │ ├── zoom-in.png │ │ ├── 1-resize.png │ │ ├── 3-resize.png │ │ ├── 4-resize.png │ │ ├── 6-resize.png │ │ ├── crosshair.png │ │ ├── e-resize.png │ │ ├── grabbing.png │ │ ├── n-resize.png │ │ ├── ne-resize.png │ │ ├── nw-resize.png │ │ ├── progress.png │ │ ├── s-resize.png │ │ ├── se-resize.png │ │ ├── sw-resize.png │ │ ├── w-resize.png │ │ ├── zoom-out.png │ │ ├── all-scroll.png │ │ ├── col-resize.png │ │ ├── context-menu.png │ │ ├── not-allowed.png │ │ ├── row-resize.png │ │ ├── screenshot.png │ │ └── vertical-text.png │ └── Cargo.toml ├── border │ ├── res │ │ ├── border.png │ │ ├── border-test.png │ │ └── screenshot.png │ └── Cargo.toml ├── focus │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── icon │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── layer │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── text │ ├── res │ │ ├── screenshot.png │ │ └── unicode-emoji-15.0 │ │ │ └── ReadMe.txt │ └── Cargo.toml ├── window │ ├── res │ │ ├── icon-file.png │ │ ├── icon-bytes.png │ │ └── screenshot.png │ └── Cargo.toml ├── button │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── gradient │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── headless │ ├── res │ │ └── screenshot.png │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── localize │ ├── res │ │ ├── screenshot.png │ │ └── l10n │ │ │ ├── en-US │ │ │ ├── msg.ftl │ │ │ ├── _.ftl │ │ │ └── deps │ │ │ │ └── .gitignore │ │ │ ├── pt-BR │ │ │ ├── deps │ │ │ │ └── .gitignore │ │ │ ├── msg.ftl │ │ │ └── _.ftl │ │ │ ├── template │ │ │ ├── deps │ │ │ │ └── .gitignore │ │ │ └── msg.ftl │ │ │ └── ar │ │ │ ├── msg.ftl │ │ │ └── _.ftl │ ├── Cargo.toml │ └── build.rs ├── markdown │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── respawn │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── scroll │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── animation │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── calculator │ ├── res │ │ ├── screenshot.png │ │ └── notosanssymbols2-regular-subset.ttf │ └── Cargo.toml ├── countdown │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── hot-reload │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── transform │ ├── res │ │ └── screenshot.png │ └── Cargo.toml ├── hot-reload-lib │ └── Cargo.toml └── extend-view │ └── Cargo.toml ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ └── blank.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── semver-checks.yml ├── rustfmt.toml ├── tools ├── cargo-do │ ├── src │ │ ├── do-script.sh │ │ ├── run-wasm-index.html │ │ └── do-script.bat │ └── Cargo.toml └── color-gen │ └── Cargo.toml ├── .gitattributes ├── crates ├── zng-wgt-inspector │ ├── l10n │ │ ├── pt-BR │ │ │ └── inspector.ftl │ │ ├── en-US │ │ │ └── inspector.ftl │ │ └── template │ │ │ └── inspector.ftl │ └── README.md ├── zng-wgt-material-icons │ ├── fonts │ │ ├── MaterialIcons-Regular.ttf │ │ ├── MaterialIconsRound-Regular.otf │ │ ├── MaterialIconsSharp-Regular.otf │ │ ├── MaterialIconsOutlined-Regular.otf │ │ └── README.md │ └── README.md ├── zng-ext-undo │ ├── l10n │ │ ├── en-US │ │ │ └── _.ftl │ │ ├── template │ │ │ └── _.ftl │ │ └── pt-BR │ │ │ └── _.ftl │ └── README.md ├── zng-app │ ├── l10n │ │ ├── en-US │ │ │ └── _.ftl │ │ ├── pt-BR │ │ │ └── _.ftl │ │ └── template │ │ │ └── _.ftl │ └── src │ │ └── tests │ │ ├── a.rs │ │ ├── b.rs │ │ └── mod.rs ├── zng-wgt-undo-history │ ├── l10n │ │ ├── pt-BR │ │ │ └── _.ftl │ │ ├── en-US │ │ │ └── _.ftl │ │ └── template │ │ │ └── _.ftl │ └── README.md ├── zng-wgt-dialog │ ├── l10n │ │ ├── en-US │ │ │ └── _.ftl │ │ ├── pt-BR │ │ │ └── _.ftl │ │ └── template │ │ │ └── _.ftl │ └── README.md ├── zng-wgt-settings │ ├── l10n │ │ ├── en-US │ │ │ └── _.ftl │ │ ├── pt-BR │ │ │ └── _.ftl │ │ └── template │ │ │ └── _.ftl │ └── README.md ├── zng-task │ ├── src │ │ ├── fs.rs │ │ └── process.rs │ └── build.rs ├── zng-txt │ ├── README.md │ └── Cargo.toml ├── zng-wgt-text │ ├── l10n │ │ ├── en-US │ │ │ └── _.ftl │ │ ├── template │ │ │ └── _.ftl │ │ └── pt-BR │ │ │ └── _.ftl │ └── README.md ├── zng-color │ └── README.md ├── zng-handle │ ├── README.md │ └── Cargo.toml ├── zng-layout │ ├── README.md │ └── src │ │ └── lib.rs ├── zng-time │ └── README.md ├── zng-unit │ └── README.md ├── zng-wgt-fill │ ├── README.md │ └── Cargo.toml ├── zng-wgt-grid │ └── README.md ├── zng-wgt-menu │ └── README.md ├── zng-wgt-undo │ ├── README.md │ └── Cargo.toml ├── zng-wgt-wrap │ └── README.md ├── zng-clone-move │ ├── README.md │ └── Cargo.toml ├── zng-ext-clipboard │ ├── README.md │ └── l10n │ │ ├── en-US │ │ └── _.ftl │ │ ├── template │ │ └── _.ftl │ │ └── pt-BR │ │ └── _.ftl ├── zng-state-map │ ├── README.md │ └── Cargo.toml ├── zng-wgt-access │ └── README.md ├── zng-wgt-ansi-text │ └── README.md ├── zng-wgt-container │ ├── README.md │ └── Cargo.toml ├── zng-wgt-data-view │ └── README.md ├── zng-wgt-filter │ ├── README.md │ └── Cargo.toml ├── zng-wgt-image │ └── README.md ├── zng-wgt-markdown │ └── README.md ├── zng-wgt-panel │ ├── README.md │ └── Cargo.toml ├── zng-wgt-progress │ └── README.md ├── zng-wgt-rule-line │ └── README.md ├── zng-wgt-scroll │ └── README.md ├── zng-wgt-shortcut │ ├── README.md │ └── l10n │ │ └── template │ │ └── modifiers.ftl ├── zng-wgt-slider │ └── README.md ├── zng-wgt-stack │ └── README.md ├── zng-wgt-toggle │ └── README.md ├── zng-wgt-tooltip │ └── README.md ├── zng-wgt-transform │ ├── README.md │ └── Cargo.toml ├── zng-app-proc-macros │ └── README.md ├── zng-color-proc-macros │ ├── README.md │ └── src │ │ └── lib.rs ├── zng-env-proc-macros │ └── README.md ├── zng-ext-hot-reload │ └── README.md ├── zng-task-proc-macros │ ├── README.md │ └── src │ │ ├── util.rs │ │ └── lib.rs ├── zng-var-proc-macros │ └── README.md ├── zng-wgt-checkerboard │ ├── README.md │ └── Cargo.toml ├── zng-wgt-size-offset │ ├── README.md │ └── Cargo.toml ├── zng-wgt-text-input │ ├── README.md │ └── src │ │ └── lib.rs ├── zng-ext-l10n-proc-macros │ ├── README.md │ └── src │ │ └── lib.rs ├── zng-ext-single-instance │ └── README.md ├── zng-wgt-webrender-debug │ └── README.md ├── zng-ext-hot-reload-proc-macros │ └── README.md ├── zng-ext-l10n │ ├── src │ │ └── sources.rs │ └── README.md ├── zng-wgt-input │ ├── l10n │ │ ├── en-US │ │ │ └── _.ftl │ │ ├── template │ │ │ └── _.ftl │ │ └── pt-BR │ │ │ └── _.ftl │ ├── README.md │ └── src │ │ └── lib.rs ├── zng-ext-svg │ └── README.md ├── zng-wgt │ ├── src │ │ └── wgt.rs │ └── README.md ├── zng-ext-font │ ├── build.rs │ └── README.md ├── zng-view-api │ ├── build.rs │ └── README.md ├── zng-view-prebuilt │ ├── lib │ │ └── README.md │ └── README.md ├── zng │ └── l10n │ │ ├── en-US │ │ └── _.ftl │ │ ├── template │ │ └── _.ftl │ │ └── pt-BR │ │ └── _.ftl ├── zng-ext-image │ └── README.md ├── zng-ext-input │ ├── README.md │ └── src │ │ └── lib.rs ├── zng-wgt-button │ └── README.md ├── zng-wgt-layer │ └── README.md ├── zng-wgt-style │ └── README.md ├── zng-wgt-data │ └── README.md ├── zng-var │ └── README.md ├── zng-wgt-window │ └── README.md ├── zng-env │ └── README.md ├── zng-ext-config │ ├── src │ │ ├── toml.rs │ │ ├── ron.rs │ │ ├── yaml.rs │ │ └── json.rs │ └── README.md ├── zng-tp-licenses │ └── README.md ├── zng-ext-fs-watcher │ └── README.md ├── zng-ext-window │ ├── README.md │ └── l10n │ │ ├── pt-BR │ │ └── _.ftl │ │ ├── en-US │ │ └── _.ftl │ │ └── template │ │ └── _.ftl ├── zng-unique-id │ └── README.md └── zng-app-context │ └── README.md ├── docs ├── CODE_OF_CONDUCT.md └── SECURITY.md ├── .cargo ├── config.toml ├── audit.toml └── about.toml └── .gitignore /tests/cargo-zng-res-tests/glob/refs/aa: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/refs/ab: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/refs/ac: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/refs/ba: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/basic/test.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/post/test.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/test.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/refs/i/aai: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/refs/i/abi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/refs/i/aci: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/refs/i/bai: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/test.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/multi/res/my-res.txt: -------------------------------------------------------------------------------- 1 | Resource content! -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/sanitize/test.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/test.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/recursive/test.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/source/a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/source/b.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/test.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/refs/file-a.txt: -------------------------------------------------------------------------------- 1 | file-a -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/refs/file-b.txt: -------------------------------------------------------------------------------- 1 | file-b -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/source/a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/source/b.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/test.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/source/fa/fa-a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/source/fb/fb-a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/source/fb/fb-b.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/sanitize/template/{{app}}/ok: -------------------------------------------------------------------------------- 1 | ok -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/flatten/aa: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/flatten/aai: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/flatten/ab: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/flatten/abi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/flatten/ac: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/flatten/aci: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/refs/aa: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/refs/ac: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/refs/i/aai: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/expected_target/refs/i/aci: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/source/fa/fa-a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/source/fb/fb-a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/source/fb/fb-b.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/post/template/.zng-template/keys: -------------------------------------------------------------------------------- 1 | app= -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/expected_target/file-b.txt: -------------------------------------------------------------------------------- 1 | file-b -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/expected_target/a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/expected_target/b.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/expected_target/fa/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/source/fb/fb-fa/fb-fa-a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 140 2 | #format_code_in_doc_comments = true -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/basic/template/t_app_t/T-ORG-T.txt: -------------------------------------------------------------------------------- 1 | {{app}} -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/sanitize/template/.zng-template/keys: -------------------------------------------------------------------------------- 1 | app= -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/sanitize/template/{{app}}.md: -------------------------------------------------------------------------------- 1 | {{app}} 2 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/expected_target/recursion.txt: -------------------------------------------------------------------------------- 1 | file-b -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/expected_target/a/file-a.txt: -------------------------------------------------------------------------------- 1 | file-a -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/expected_target/fa/fa-a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/expected_target/fb/fb-a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/expected_target/fb/fb-b.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/source/fb/fb-fa/fb-fa-a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/expected_target/fb/fb-fa/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/config/res/default-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "bool": true 3 | } -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/sanitize/expected_target/the-app/The App/ok: -------------------------------------------------------------------------------- 1 | ok -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/expected_target/hello.txt: -------------------------------------------------------------------------------- 1 | echo hello! 2 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/expected_target/on-final.txt: -------------------------------------------------------------------------------- 1 | finally! 2 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/source/warning.zr-warn: -------------------------------------------------------------------------------- 1 | Formatted warning -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/refs/merge-a/merged-file-a.txt: -------------------------------------------------------------------------------- 1 | merged a -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/recursive/expected_target/copy/file-b.txt: -------------------------------------------------------------------------------- 1 | file-b -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/post/expected_target/the-app/the-app.txt: -------------------------------------------------------------------------------- 1 | The App 2 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/expected_target/a/merged-file-a.txt: -------------------------------------------------------------------------------- 1 | merged a -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/expected_target/hello-tool1.txt: -------------------------------------------------------------------------------- 1 | Hello tool 1 -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/expected_target/hello-tool2.txt: -------------------------------------------------------------------------------- 1 | Hello tool 2 -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/source/hello-tool1.txt.zr-tool1: -------------------------------------------------------------------------------- 1 | Hello tool 1 -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/source/hello-tool2.txt.zr-tool2: -------------------------------------------------------------------------------- 1 | Hello tool 2 -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/recursive/expected_target/a/copy/a/file-a.txt: -------------------------------------------------------------------------------- 1 | file-a -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/recursive/expected_target/a/copy/file-b.txt: -------------------------------------------------------------------------------- 1 | file-b -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/recursive/expected_target/copy/a/file-a.txt: -------------------------------------------------------------------------------- 1 | file-a -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics-pack/expected_target/fb/fb-fa/fb-fa-a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/cargo-do/src/do-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DO_CMD=do 3 | cargo do "$@" -------------------------------------------------------------------------------- /examples/image/res/color_profiles/README.md: -------------------------------------------------------------------------------- 1 | Source: https://kornel.ski/en/color 2 | -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/basic/expected_target/the-app/the_app/THE-ORG.txt: -------------------------------------------------------------------------------- 1 | The App! -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/replace/source/recursive.zr-warn.zr-rp: -------------------------------------------------------------------------------- 1 | Hey ${ZR_PKG_NAME}! -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/post/test.stdout: -------------------------------------------------------------------------------- 1 | #TEMP#/.zng-template/post-temp/post.sh 2 | -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/sanitize/expected_target/the-app/The App.md: -------------------------------------------------------------------------------- 1 | The App /?/ 2 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/source/hello.txt.zr-sh: -------------------------------------------------------------------------------- 1 | echo "echo hello!" > $ZR_TARGET -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/source/on-final.txt.zr-shf: -------------------------------------------------------------------------------- 1 | echo "finally!" > $ZR_TARGET -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/expected_target/hello-tool-crate.txt: -------------------------------------------------------------------------------- 1 | Hello tool crate -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/recursive/expected_target/a/copy/a/merged-file-a.txt: -------------------------------------------------------------------------------- 1 | merged a -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/recursive/expected_target/copy/a/merged-file-a.txt: -------------------------------------------------------------------------------- 1 | merged a -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash-error/source/fail.zr-sh: -------------------------------------------------------------------------------- 1 | >&2 echo "error message" 2 | exit 1 -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/test.stderr: -------------------------------------------------------------------------------- 1 | warning: Formatted warning 2 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/source/a.zr-copy: -------------------------------------------------------------------------------- 1 | tests/cargo-zng-res-tests/copy/refs/merge-a -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/source/hello-tool-crate.txt.zr-tool-crate: -------------------------------------------------------------------------------- 1 | Hello tool crate -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/post/template/.zng-template/post/post.sh: -------------------------------------------------------------------------------- 1 | echo "{{app}}" > t-app-t.txt -------------------------------------------------------------------------------- /examples/cursor/res/cell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/cell.png -------------------------------------------------------------------------------- /examples/cursor/res/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/copy.png -------------------------------------------------------------------------------- /examples/cursor/res/grab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/grab.png -------------------------------------------------------------------------------- /examples/cursor/res/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/help.png -------------------------------------------------------------------------------- /examples/cursor/res/move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/move.png -------------------------------------------------------------------------------- /examples/cursor/res/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/text.png -------------------------------------------------------------------------------- /examples/cursor/res/wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/wait.png -------------------------------------------------------------------------------- /examples/image/res/Luma8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/Luma8.png -------------------------------------------------------------------------------- /examples/image/res/RGB16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/RGB16.png -------------------------------------------------------------------------------- /examples/image/res/RGB8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/RGB8.png -------------------------------------------------------------------------------- /examples/image/res/RGBA8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/RGBA8.png -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/replace/test.stderr: -------------------------------------------------------------------------------- 1 | warning: Hey cargo-zng-res-tests! 2 | -------------------------------------------------------------------------------- /examples/border/res/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/border/res/border.png -------------------------------------------------------------------------------- /examples/cursor/res/alias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/alias.png -------------------------------------------------------------------------------- /examples/cursor/res/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/default.png -------------------------------------------------------------------------------- /examples/cursor/res/no-drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/no-drop.png -------------------------------------------------------------------------------- /examples/cursor/res/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/pointer.png -------------------------------------------------------------------------------- /examples/cursor/res/zoom-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/zoom-in.png -------------------------------------------------------------------------------- /examples/image/res/Luma16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/Luma16.png -------------------------------------------------------------------------------- /examples/image/res/LumaA16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/LumaA16.png -------------------------------------------------------------------------------- /examples/image/res/LumaA8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/LumaA8.png -------------------------------------------------------------------------------- /examples/image/res/RGBA16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/RGBA16.png -------------------------------------------------------------------------------- /examples/image/res/zng-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/zng-logo.png -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/source/a/file-a.txt.zr-copy: -------------------------------------------------------------------------------- 1 | tests/cargo-zng-res-tests/copy/refs/file-a.txt -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/source/flatten/refs-glob.zr-glob: -------------------------------------------------------------------------------- 1 | tests/cargo-zng-res-tests/glob/refs/**/a* -------------------------------------------------------------------------------- /examples/cursor/res/1-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/1-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/3-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/3-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/4-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/4-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/6-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/6-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/crosshair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/crosshair.png -------------------------------------------------------------------------------- /examples/cursor/res/e-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/e-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/grabbing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/grabbing.png -------------------------------------------------------------------------------- /examples/cursor/res/n-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/n-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/ne-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/ne-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/nw-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/nw-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/progress.png -------------------------------------------------------------------------------- /examples/cursor/res/s-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/s-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/se-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/se-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/sw-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/sw-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/w-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/w-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/zoom-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/zoom-out.png -------------------------------------------------------------------------------- /examples/focus/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/focus/res/screenshot.png -------------------------------------------------------------------------------- /examples/icon/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/icon/res/screenshot.png -------------------------------------------------------------------------------- /examples/image/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/screenshot.png -------------------------------------------------------------------------------- /examples/layer/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/layer/res/screenshot.png -------------------------------------------------------------------------------- /examples/multi/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/multi/res/screenshot.png -------------------------------------------------------------------------------- /examples/text/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/text/res/screenshot.png -------------------------------------------------------------------------------- /examples/window/res/icon-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/window/res/icon-file.png -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/basic/template/.zng-template/keys: -------------------------------------------------------------------------------- 1 | # Template Keys 2 | app= 3 | org="" 4 | qualifier="" -------------------------------------------------------------------------------- /examples/border/res/border-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/border/res/border-test.png -------------------------------------------------------------------------------- /examples/border/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/border/res/screenshot.png -------------------------------------------------------------------------------- /examples/button/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/button/res/screenshot.png -------------------------------------------------------------------------------- /examples/config/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/config/res/screenshot.png -------------------------------------------------------------------------------- /examples/cursor/res/all-scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/all-scroll.png -------------------------------------------------------------------------------- /examples/cursor/res/col-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/col-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/context-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/context-menu.png -------------------------------------------------------------------------------- /examples/cursor/res/not-allowed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/not-allowed.png -------------------------------------------------------------------------------- /examples/cursor/res/row-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/row-resize.png -------------------------------------------------------------------------------- /examples/cursor/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/screenshot.png -------------------------------------------------------------------------------- /examples/gradient/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/gradient/res/screenshot.png -------------------------------------------------------------------------------- /examples/headless/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/headless/res/screenshot.png -------------------------------------------------------------------------------- /examples/image/res/300x300@96dpi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/300x300@96dpi.jpg -------------------------------------------------------------------------------- /examples/image/res/300x300@96dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/300x300@96dpi.png -------------------------------------------------------------------------------- /examples/image/res/exif rotated.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/exif rotated.jpg -------------------------------------------------------------------------------- /examples/image/res/exif rotated.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/exif rotated.tif -------------------------------------------------------------------------------- /examples/image/res/zng-logo-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/zng-logo-icon.png -------------------------------------------------------------------------------- /examples/localize/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/localize/res/screenshot.png -------------------------------------------------------------------------------- /examples/markdown/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/markdown/res/screenshot.png -------------------------------------------------------------------------------- /examples/respawn/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/respawn/res/screenshot.png -------------------------------------------------------------------------------- /examples/scroll/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/scroll/res/screenshot.png -------------------------------------------------------------------------------- /examples/window/res/icon-bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/window/res/icon-bytes.png -------------------------------------------------------------------------------- /examples/window/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/window/res/screenshot.png -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/sanitize/test.stdout: -------------------------------------------------------------------------------- 1 | the-app/The App 2 | the-app/The App/ok 3 | the-app/The App.md 4 | -------------------------------------------------------------------------------- /examples/animation/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/animation/res/screenshot.png -------------------------------------------------------------------------------- /examples/calculator/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/calculator/res/screenshot.png -------------------------------------------------------------------------------- /examples/countdown/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/countdown/res/screenshot.png -------------------------------------------------------------------------------- /examples/cursor/res/vertical-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/cursor/res/vertical-text.png -------------------------------------------------------------------------------- /examples/hot-reload/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/hot-reload/res/screenshot.png -------------------------------------------------------------------------------- /examples/image/res/600x600@192dpi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/600x600@192dpi.jpg -------------------------------------------------------------------------------- /examples/image/res/600x600@192dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/600x600@192dpi.png -------------------------------------------------------------------------------- /examples/transform/res/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/transform/res/screenshot.png -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash-error/test.stdout: -------------------------------------------------------------------------------- 1 | tests/cargo-zng-res-tests/bash-error/source/fail.zr-sh 2 |  3 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/recursive/source/a/copy.zr-copy: -------------------------------------------------------------------------------- 1 | # copy the 'copy' test 2 | tests/cargo-zng-res-tests/copy/source -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/recursive/source/copy.zr-copy: -------------------------------------------------------------------------------- 1 | # copy the 'copy' test 2 | tests/cargo-zng-res-tests/copy/source -------------------------------------------------------------------------------- /examples/image/res/color_profiles/odd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/color_profiles/odd.png -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/basic/test.stdout: -------------------------------------------------------------------------------- 1 | the-app/the-app.md 2 | the-app/the_app 3 | the-app/the_app/THE-ORG.txt 4 | -------------------------------------------------------------------------------- /examples/image/res/color_profiles/adobe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/color_profiles/adobe.png -------------------------------------------------------------------------------- /examples/image/res/color_profiles/anon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/color_profiles/anon.gif -------------------------------------------------------------------------------- /examples/image/res/color_profiles/anon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/color_profiles/anon.jpg -------------------------------------------------------------------------------- /examples/image/res/color_profiles/anon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/color_profiles/anon.png -------------------------------------------------------------------------------- /examples/image/res/color_profiles/gamma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/color_profiles/gamma.png -------------------------------------------------------------------------------- /examples/image/res/color_profiles/srgb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/color_profiles/srgb.jpg -------------------------------------------------------------------------------- /examples/image/res/color_profiles/srgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/color_profiles/srgb.png -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/source/recursion.txt.zr-copy.zr-sh: -------------------------------------------------------------------------------- 1 | echo "tests/cargo-zng-res-tests/copy/refs/file-b.txt" > $ZR_TARGET -------------------------------------------------------------------------------- /examples/image/res/color_profiles/rec709.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/color_profiles/rec709.jpg -------------------------------------------------------------------------------- /examples/localize/res/l10n/en-US/msg.ftl: -------------------------------------------------------------------------------- 1 | click-count = {$n -> 2 | [one] Clicked {$n} time 3 | *[other] Clicked {$n} times 4 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | *.{cmd,[cC][mM][dD]} text eol=crlf 3 | *.{bat,[bB][aA][tT]} text eol=crlf 4 | CHANGELOG.md merge=union -------------------------------------------------------------------------------- /crates/zng-wgt-inspector/l10n/pt-BR/inspector.ftl: -------------------------------------------------------------------------------- 1 | INSPECT_CMD = 2 | .info = Inspecionar a janela 3 | .name = Inspetor de Depuração 4 | -------------------------------------------------------------------------------- /examples/image/res/zdenek-machacek-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/zdenek-machacek-unsplash.jpg -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/source/file-b.txt.zr-copy: -------------------------------------------------------------------------------- 1 | # always relative to Cargo workspace 2 | tests/cargo-zng-res-tests/copy/refs/file-b.txt -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/blank.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Blank Issue 3 | about: Create a blank issue. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- -------------------------------------------------------------------------------- /examples/localize/res/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | -lang = en-US 2 | 3 | button = Button 4 | 5 | window = 6 | .title = Localize Example ({-lang}) 7 | -------------------------------------------------------------------------------- /examples/image/res/player_combat_sheet-10-96x84-CC0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/image/res/player_combat_sheet-10-96x84-CC0.png -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/source/on-final.zr-sh: -------------------------------------------------------------------------------- 1 | if [ -z ${ZR_FINAL+x} ]; then echo "zng-res::on-final=final args"; else echo "on final: '$ZR_FINAL'"; fi -------------------------------------------------------------------------------- /crates/zng-wgt-material-icons/fonts/MaterialIcons-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/crates/zng-wgt-material-icons/fonts/MaterialIcons-Regular.ttf -------------------------------------------------------------------------------- /examples/calculator/res/notosanssymbols2-regular-subset.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/examples/calculator/res/notosanssymbols2-regular-subset.ttf -------------------------------------------------------------------------------- /examples/image/res/EXTERNAL_USE.md: -------------------------------------------------------------------------------- 1 | # External Use 2 | 3 | The `zng-logo-icon.png` and `zng-logo.png` images are used by doc pages and the GitHub site home-page. 4 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/parent_not_widget.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::widget; 2 | 3 | #[widget($crate::Foo)] 4 | pub struct Foo(f32); 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/util/a_mod.rs: -------------------------------------------------------------------------------- 1 | // this file is used in tests that must have a mod declaration without inline content. 2 | 3 | pub fn mod_exists() {} 4 | -------------------------------------------------------------------------------- /crates/zng-ext-undo/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | CLEAR_HISTORY_CMD = 2 | .name = Clear History 3 | 4 | REDO_CMD = 5 | .name = Redo 6 | 7 | UNDO_CMD = 8 | .name = Undo 9 | -------------------------------------------------------------------------------- /crates/zng-app/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | EXIT_CMD = 2 | .info = Close all windows and exit 3 | .name = Exit 4 | 5 | OPEN_LICENSES_CMD = 6 | .name = Third Party Licenses 7 | -------------------------------------------------------------------------------- /crates/zng-app/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | EXIT_CMD = 2 | .info = Fechar todas as janelas e sair 3 | .name = Sair 4 | 5 | OPEN_LICENSES_CMD = 6 | .name = Licenças de Terceiros -------------------------------------------------------------------------------- /crates/zng-ext-undo/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | CLEAR_HISTORY_CMD = 2 | .name = Clear History 3 | 4 | REDO_CMD = 5 | .name = Redo 6 | 7 | UNDO_CMD = 8 | .name = Undo 9 | -------------------------------------------------------------------------------- /crates/zng-wgt-material-icons/fonts/MaterialIconsRound-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/crates/zng-wgt-material-icons/fonts/MaterialIconsRound-Regular.otf -------------------------------------------------------------------------------- /crates/zng-wgt-material-icons/fonts/MaterialIconsSharp-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/crates/zng-wgt-material-icons/fonts/MaterialIconsSharp-Regular.otf -------------------------------------------------------------------------------- /crates/zng-app/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | EXIT_CMD = 2 | .info = Close all windows and exit 3 | .name = Exit 4 | 5 | OPEN_LICENSES_CMD = 6 | .name = Third Party Licenses 7 | -------------------------------------------------------------------------------- /crates/zng-wgt-undo-history/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | # count_actions: 2 | # Number of undo/redo actions that are selected to run 3 | UndoHistory = 4 | .count_actions = {$n} ações 5 | -------------------------------------------------------------------------------- /crates/zng-ext-undo/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | CLEAR_HISTORY_CMD = 2 | .name = Apagar o Histórico 3 | 4 | REDO_CMD = 5 | .name = Refazer 6 | 7 | UNDO_CMD = 8 | .name = Desfazer 9 | -------------------------------------------------------------------------------- /crates/zng-wgt-material-icons/fonts/MaterialIconsOutlined-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zng-ui/zng/HEAD/crates/zng-wgt-material-icons/fonts/MaterialIconsOutlined-Regular.otf -------------------------------------------------------------------------------- /crates/zng-wgt-undo-history/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | # count_actions: 2 | # Number of undo/redo actions that are selected to run 3 | UndoHistory = 4 | .count_actions = {$n} actions 5 | -------------------------------------------------------------------------------- /crates/zng-wgt-undo-history/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | # count_actions: 2 | # Number of undo/redo actions that are selected to run 3 | UndoHistory = 4 | .count_actions = {$n} actions 5 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/unknown_inherit.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::widget; 2 | 3 | #[widget($crate::TestWidget)] 4 | pub struct TestWidget(UnknownType); 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /crates/zng-wgt-dialog/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | response-cancel = Cancel 2 | 3 | response-close = Close 4 | 5 | response-no = No 6 | 7 | response-ok = Ok 8 | 9 | response-yes = Yes 10 | -------------------------------------------------------------------------------- /crates/zng-wgt-dialog/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | response-cancel = Cancelar 2 | 3 | response-close = Fechar 4 | 5 | response-no = Não 6 | 7 | response-ok = Ok 8 | 9 | response-yes = Sim 10 | -------------------------------------------------------------------------------- /crates/zng-wgt-dialog/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | response-cancel = Cancel 2 | 3 | response-close = Close 4 | 5 | response-no = No 6 | 7 | response-ok = Ok 8 | 9 | response-yes = Yes 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/type_path_malformed1.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{WidgetBase, widget}; 2 | 3 | #[widget($crate::)] 4 | pub struct TestWidget(WidgetBase); 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_semi1.stderr: -------------------------------------------------------------------------------- 1 | error: expected `;` 2 | --> cases/widget_new/missing_semi1.rs:14:9 3 | | 4 | 14 | enabled = true; 5 | | ^^^^^^^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_semi2.stderr: -------------------------------------------------------------------------------- 1 | error: expected `;` 2 | --> cases/widget_new/missing_semi2.rs:15:9 3 | | 4 | 15 | enabled = true; 5 | | ^^^^^^^ 6 | -------------------------------------------------------------------------------- /crates/zng-wgt-settings/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | search = 2 | .no_results = No settings found 3 | .placeholder = search settings ({$shortcut}) 4 | 5 | window = 6 | .title = {$app} - Settings 7 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_missing.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{WidgetBase, widget}; 2 | 3 | // path is missing 4 | #[widget] 5 | pub struct TestWidget(WidgetBase); 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/when_missing_expr1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { when }; 7 | } 8 | -------------------------------------------------------------------------------- /examples/localize/res/l10n/en-US/deps/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency localization files 2 | # Call `cargo zng l10n --package zng-example-localize --output "examples/localize/res"` to update 3 | 4 | * 5 | !.gitignore 6 | -------------------------------------------------------------------------------- /examples/localize/res/l10n/pt-BR/deps/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency localization files 2 | # Call `cargo zng l10n --package zng-example-localize --output "examples/localize/res"` to update 3 | 4 | * 5 | !.gitignore 6 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash-error/test.stderr: -------------------------------------------------------------------------------- 1 | error message 2 | error: script failed, exit code 1 3 | command failed, exit code 102 4 | error: res build failed 5 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/tools/cargo-zng-res-tool-crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo-zng-res-tool-crate" 3 | version = "0.0.0" 4 | edition = "2024" 5 | publish = false 6 | 7 | [dependencies] 8 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/args_count_none.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{UiNode, property}; 2 | 3 | #[property(CONTEXT)] 4 | pub fn no_args() -> UiNode { 5 | UiNode::nil() 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_malformed3.stderr: -------------------------------------------------------------------------------- 1 | error: expected `crate` 2 | --> cases/widget/module_path_malformed3.rs:4:11 3 | | 4 | 4 | #[widget($self::TestWidget)] 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/type_path_is_invalid1.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{WidgetBase, widget}; 2 | 3 | #[widget($crate::not::a::valid::path)] 4 | pub struct TextWidget(WidgetBase); 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_property_path2.stderr: -------------------------------------------------------------------------------- 1 | error: expected `=` 2 | --> cases/widget_new/malformed_property_path2.rs:7:15 3 | | 4 | 7 | margin! = 0; 5 | | ^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_property1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | unknown = 0; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /crates/zng-task/src/fs.rs: -------------------------------------------------------------------------------- 1 | //! Async filesystem primitives. 2 | //! 3 | //! This module is the [async-fs](https://docs.rs/async-fs) crate re-exported for convenience. 4 | 5 | #[doc(inline)] 6 | pub use async_fs::*; 7 | -------------------------------------------------------------------------------- /crates/zng-txt/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-text/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | SELECT_ALL_CMD = 2 | .name = Select All 3 | 4 | text-edit-op = 5 | .clear = clear 6 | .generic = text edit 7 | .replace = replace 8 | .transform = transform 9 | -------------------------------------------------------------------------------- /examples/localize/res/l10n/template/deps/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency localization files 2 | # Call `cargo zng l10n --package zng-example-localize --output "examples/localize/res"` to update 3 | 4 | * 5 | !.gitignore 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_malformed2.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{WidgetBase, widget}; 2 | 3 | #[widget($crate::test_widget, invalid)] 4 | pub struct TestWidget(WidgetBase); 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_in_when_expr2.stderr: -------------------------------------------------------------------------------- 1 | error: expected a when block expr and properties 2 | --> cases/widget_new/error_in_when_expr2.rs:10:9 3 | | 4 | 10 | } 5 | | ^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_semi_before_when1.stderr: -------------------------------------------------------------------------------- 1 | error: expected `;` 2 | --> cases/widget_new/missing_semi_before_when1.rs:8:9 3 | | 4 | 8 | when *#is_pressed { 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /crates/zng-color/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-ext-undo/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-handle/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-layout/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-time/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-unit/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-fill/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-grid/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-menu/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-text/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-text/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | SELECT_ALL_CMD = 2 | .name = Select All 3 | 4 | text-edit-op = 5 | .clear = clear 6 | .generic = text edit 7 | .replace = replace 8 | .transform = transform 9 | -------------------------------------------------------------------------------- /crates/zng-wgt-undo/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-wrap/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_property_path1.stderr: -------------------------------------------------------------------------------- 1 | error: expected identifier, found keyword `_` 2 | --> cases/widget_new/malformed_property_path1.rs:7:9 3 | | 4 | 7 | _ = 0; 5 | | ^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_property2.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | unknown = { value: 0 }; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /crates/zng-clone-move/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-ext-clipboard/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-state-map/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-access/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-ansi-text/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-container/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-data-view/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-dialog/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-filter/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-image/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-markdown/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-panel/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-progress/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-rule-line/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-scroll/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-settings/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-shortcut/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-slider/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-stack/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-toggle/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-tooltip/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-transform/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/layer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-layer" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/type_path_malformed1.stderr: -------------------------------------------------------------------------------- 1 | error: unexpected end of input, expected identifier 2 | --> cases/widget/type_path_malformed1.rs:3:17 3 | | 4 | 3 | #[widget($crate::)] 5 | | ^ 6 | -------------------------------------------------------------------------------- /crates/zng-app-proc-macros/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-color-proc-macros/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-env-proc-macros/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-ext-hot-reload/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-task-proc-macros/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-var-proc-macros/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-checkerboard/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-size-offset/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-text-input/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-text/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | SELECT_ALL_CMD = 2 | .name = Selecionar Tudo 3 | 4 | text-edit-op = 5 | .clear = limpar 6 | .generic = editar texto 7 | .replace = substituir 8 | .transform = transformar 9 | -------------------------------------------------------------------------------- /crates/zng-wgt-undo-history/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/border/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-border" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | -------------------------------------------------------------------------------- /examples/cursor/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-cursor" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | -------------------------------------------------------------------------------- /examples/gradient/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-gradient" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | -------------------------------------------------------------------------------- /examples/headless/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-headless" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/tools/cargo-zng-res/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo-zng-res" 3 | version = "0.0.0" 4 | edition = "2024" 5 | publish = false 6 | 7 | [dependencies] 8 | 9 | [[bin]] 10 | name = "tool1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_in_when_expr3.stderr: -------------------------------------------------------------------------------- 1 | error: expected identifier or index 2 | --> cases/widget_new/error_in_when_expr3.rs:8:23 3 | | 4 | 8 | when *#margin.0. { 5 | | ^^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/incorrect_arg_type1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | margin = true; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_property_path4.stderr: -------------------------------------------------------------------------------- 1 | error: expected identifier 2 | --> cases/widget_new/malformed_property_path4.rs:7:23 3 | | 4 | 7 | zng::layout:: = 0; 5 | | ^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_semi_in_when1.stderr: -------------------------------------------------------------------------------- 1 | error: expected `,` 2 | --> cases/widget_new/missing_semi_in_when1.rs:17:13 3 | | 4 | 17 | cursor = CursorIcon::Pointer; 5 | | ^^^^^^ 6 | -------------------------------------------------------------------------------- /crates/zng-ext-l10n-proc-macros/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-ext-single-instance/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /crates/zng-wgt-webrender-debug/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/transform/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-transform" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_malformed2.stderr: -------------------------------------------------------------------------------- 1 | error: unexpected token 2 | --> cases/widget/module_path_malformed2.rs:3:29 3 | | 4 | 3 | #[widget($crate::test_widget, invalid)] 5 | | ^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_malformed3.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{WidgetBase, widget}; 2 | 3 | // doesn't start with $crate 4 | #[widget($self::TestWidget)] 5 | pub struct TestWidget(WidgetBase); 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_missing_crate.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{WidgetBase, widget}; 2 | 3 | // doesn't start with $crate:: 4 | #[widget(TestWidget)] 5 | pub struct TestWidget(WidgetBase); 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/cannot_unset_in_when.stderr: -------------------------------------------------------------------------------- 1 | error: cannot unset in when assign 2 | --> cases/widget_new/cannot_unset_in_when.rs:8:22 3 | | 4 | 8 | margin = unset!; 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_field.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | margin = { unknown: 0 }; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /crates/zng-ext-hot-reload-proc-macros/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/focus/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-focus" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | tracing = "0.1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_missing_dollar_sign.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{WidgetBase, widget}; 2 | 3 | // doesn't start with $ 4 | #[widget(crate::TestWidget)] 5 | pub struct TestWidget(WidgetBase); 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /examples/localize/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-localize" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | tracing = "0.1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_property_path1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | _ = 0; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /crates/zng-ext-l10n/src/sources.rs: -------------------------------------------------------------------------------- 1 | mod nil; 2 | pub use nil::*; 3 | 4 | mod dir; 5 | pub use dir::*; 6 | 7 | mod swap; 8 | pub use swap::*; 9 | 10 | #[cfg(feature = "tar")] 11 | mod tar; 12 | #[cfg(feature = "tar")] 13 | pub use tar::*; 14 | -------------------------------------------------------------------------------- /examples/localize/res/l10n/pt-BR/msg.ftl: -------------------------------------------------------------------------------- 1 | click-count = {$n -> 2 | [one] Clicou {$n} vez 3 | *[other] Clicou {$n} vezes 4 | } 5 | 6 | LOCALIZED_FILE_CMD = 7 | .info = Localizado em um arquivo nomeado 'msg' 8 | .name = Arquivo Localizado -------------------------------------------------------------------------------- /examples/scroll/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-scroll" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt", "material_icons_outlined"] } -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/glob/source/filter.zr-glob: -------------------------------------------------------------------------------- 1 | # exact match (copy 'refs' preserving dir structure) 2 | tests/cargo-zng-res-tests/glob/refs 3 | 4 | # only files that start with 'a' (inside 'refs') 5 | **/a* 6 | 7 | # except ab prefix 8 | !:**/ab* -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_missing_crate.stderr: -------------------------------------------------------------------------------- 1 | error: expected a macro_rules `$crate` path to this widget mod 2 | --> cases/widget/module_path_missing_crate.rs:4:10 3 | | 4 | 4 | #[widget(TestWidget)] 5 | | ^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_property_path2.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin! = 0; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /examples/icon/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-icon" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt", "material_icons"] } 9 | tracing = "0.1" -------------------------------------------------------------------------------- /examples/text/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-text" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt", "material_icons"] } 9 | tracing = "0.1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/args_count_no_input.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, UiNode, property}; 2 | 3 | #[property(CONTEXT)] 4 | pub fn no_inputs(child: impl IntoUiNode) -> UiNode { 5 | child.into_node() 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_property_path4.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | zng::layout:: = 0; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_value1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = ; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_value2.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /crates/zng-wgt-settings/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | search = 2 | .no_results = Nenhuma configuração encontrada 3 | .placeholder = procurar configurações ({$shortcut}) 4 | 5 | window = 6 | .title = {$app} - Configurações 7 | 8 | reset = Redefinir para o padrão -------------------------------------------------------------------------------- /examples/button/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-button" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt", "material_icons"] } 9 | tracing = "0.1" -------------------------------------------------------------------------------- /examples/countdown/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-countdown" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view", "trace_recorder"] } 9 | tracing = "0.1" -------------------------------------------------------------------------------- /examples/markdown/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-markdown" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt", "http", "material_icons"] } 9 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_property_path3.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | zng::layout:margin = 0; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /crates/zng-wgt-input/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | NEW_CMD = 2 | .name = New 3 | 4 | OPEN_CMD = 5 | .name = Open… 6 | 7 | SAVE_AS_CMD = 8 | .name = Save As… 9 | 10 | SAVE_CMD = 11 | .name = Save 12 | 13 | SETTINGS_CMD = 14 | .name = Settings 15 | -------------------------------------------------------------------------------- /docs/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | The `zng` project adheres to the [Rust Code of Conduct]. This 4 | describes the minimum behavior expected from all contributors. 5 | 6 | [Rust Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct 7 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/invalid_priority.stderr: -------------------------------------------------------------------------------- 1 | error[E0425]: cannot find value `INVALID_PRI` in this scope 2 | --> cases/property/invalid_priority.rs:3:12 3 | | 4 | 3 | #[property(INVALID_PRI)] 5 | | ^^^^^^^^^^^ not found in this scope 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/cannot_instantiate_widget_mixin.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::widget_mixin; 2 | 3 | #[widget_mixin] 4 | pub struct TextMix

(P); 5 | 6 | fn main() { 7 | let _scope = zng::APP.minimal(); 8 | let _ = TextMix!(); 9 | } 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_missing_dollar_sign.stderr: -------------------------------------------------------------------------------- 1 | error: expected a macro_rules `$crate` path to this widget mod 2 | --> cases/widget/module_path_missing_dollar_sign.rs:4:10 3 | | 4 | 4 | #[widget(crate::TestWidget)] 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_special_value.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = foo!; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /crates/zng-app/src/tests/a.rs: -------------------------------------------------------------------------------- 1 | use zng_app_proc_macros::widget; 2 | 3 | #[widget($crate::tests::FooA)] 4 | pub struct Foo(crate::widget::base::WidgetBase); 5 | impl Foo { 6 | pub fn widget_build(&mut self) -> &'static str { 7 | "a" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /crates/zng-app/src/tests/b.rs: -------------------------------------------------------------------------------- 1 | use zng_app_proc_macros::widget; 2 | 3 | #[widget($crate::tests::FooB)] 4 | pub struct Foo(crate::widget::base::WidgetBase); 5 | impl Foo { 6 | pub fn widget_build(&mut self) -> &'static str { 7 | "b" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /crates/zng-wgt-input/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | NEW_CMD = 2 | .name = New 3 | 4 | OPEN_CMD = 5 | .name = Open… 6 | 7 | SAVE_AS_CMD = 8 | .name = Save As… 9 | 10 | SAVE_CMD = 11 | .name = Save 12 | 13 | SETTINGS_CMD = 14 | .name = Settings 15 | -------------------------------------------------------------------------------- /tests/macro-tests/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "macro-tests" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | trybuild = "1.0" 9 | glob = "0.3" 10 | zng = { path = "../../crates/zng", features = ["hot_reload"] } 11 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/when_missing_block.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, gesture::is_pressed, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | when *#is_pressed 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /crates/zng-ext-svg/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/window/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-window" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt", "inspector", "material_icons"] } 9 | tracing = "0.1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/property_generic2.rs: -------------------------------------------------------------------------------- 1 | use zng::{text::Text, toggle::Toggle}; 2 | 3 | fn main() { 4 | let _scope = zng::APP.minimal(); 5 | let _err = Toggle! { 6 | child = Text!(""); 7 | value:: = 0; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /tests/macro-tests/src/main.rs: -------------------------------------------------------------------------------- 1 | //! Use `cargo do test -m --all` to run all macro tests. 2 | //! 3 | //! Use `cargo do test -m property/*` to run all paths that match in the `./cases` folder. 4 | 5 | mod run; 6 | 7 | fn main() { 8 | run::do_request(); 9 | } 10 | -------------------------------------------------------------------------------- /crates/zng-wgt-input/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | NEW_CMD = 2 | .name = Novo 3 | 4 | OPEN_CMD = 5 | .name = Abrir… 6 | 7 | SAVE_AS_CMD = 8 | .name = Salvar Como… 9 | 10 | SAVE_CMD = 11 | .name = Salvar 12 | 13 | SETTINGS_CMD = 14 | .name = Configurações 15 | -------------------------------------------------------------------------------- /crates/zng-wgt/src/wgt.rs: -------------------------------------------------------------------------------- 1 | use crate::prelude::*; 2 | 3 | /// Minimal widget. 4 | /// 5 | /// You can use this to create a quick new custom widget defined entirely 6 | /// by standalone properties and `when` conditions. 7 | #[widget($crate::Wgt)] 8 | pub struct Wgt(WidgetBase); 9 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/incorrect_attr_args.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, UiNode, property}; 2 | 3 | #[property(CONTEXT, unknown = true)] 4 | fn unknown_arg(child: impl IntoUiNode, input: bool) -> UiNode { 5 | let _ = input; 6 | child.into_node() 7 | } 8 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/unknown_inherit.stderr: -------------------------------------------------------------------------------- 1 | error[E0412]: cannot find type `UnknownType` in this scope 2 | --> cases/widget/unknown_inherit.rs:4:23 3 | | 4 | 4 | pub struct TestWidget(UnknownType); 5 | | ^^^^^^^^^^^ not found in this scope 6 | -------------------------------------------------------------------------------- /crates/zng-wgt-settings/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | # tip on hover of the reset arrow button 2 | reset = Reset to default 3 | 4 | search = 5 | .no_results = No settings found 6 | .placeholder = search settings ({$shortcut}) 7 | 8 | window = 9 | .title = {$app} - Settings 10 | -------------------------------------------------------------------------------- /examples/calculator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-calculator" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | mexprp = { version = "0.3", default-features = false } -------------------------------------------------------------------------------- /examples/localize/res/l10n/ar/msg.ftl: -------------------------------------------------------------------------------- 1 | ### Google Translated to have a RTL example. 2 | 3 | click-count = {$n -> 4 | [one] النقر {$n} مرة 5 | *[other] تم النقر عليها {$n} مرة 6 | } 7 | 8 | LOCALIZED_FILE_CMD = 9 | .info = مترجم في ملف مسمى 'msg' 10 | .name = ملف مترجم -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/invalid_special.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, button::Button, widget::background_color}; 2 | 3 | fn main() { 4 | let _app = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _w = Button! { 7 | background_color = invalid!; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/input_not_clone.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{UiNode, hot_node}; 2 | 3 | zng::hot_reload::zng_hot_entry!(); 4 | 5 | pub struct Foo {} 6 | 7 | #[hot_node] 8 | pub fn invalid(_foo: Foo) -> UiNode { 9 | UiNode::nil() 10 | } 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/missing_hot_entry.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, UiNode, hot_node}; 2 | 3 | // zng::hot_reload::zng_hot_entry!(); 4 | 5 | #[hot_node] 6 | pub fn valid(child: impl IntoUiNode) -> UiNode { 7 | child.into_node() 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /crates/zng-task/build.rs: -------------------------------------------------------------------------------- 1 | #![recursion_limit = "256"] 2 | 3 | fn main() { 4 | cfg_aliases::cfg_aliases! { 5 | wasm: { target_arch = "wasm32" }, 6 | android: { target_os = "android" }, 7 | ipc: { all(feature = "ipc", not(any(android, wasm))) }, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/args_count_no_input.stderr: -------------------------------------------------------------------------------- 1 | error: property functions must have at least 2 inputs: child: impl IntoUiNode, arg0, .. 2 | --> cases/property/args_count_no_input.rs:4:18 3 | | 4 | 4 | pub fn no_inputs(child: impl IntoUiNode) -> UiNode { 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_fields1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = { 8 | margin: 0; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_fields2.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = { 8 | margin: 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /crates/zng-ext-font/build.rs: -------------------------------------------------------------------------------- 1 | #![recursion_limit = "256"] 2 | 3 | fn main() { 4 | cfg_aliases::cfg_aliases! { 5 | wasm: { target_arch = "wasm32" }, 6 | android: { target_os = "android" }, 7 | ipc: { all(feature = "ipc", not(any(android, wasm))) }, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /crates/zng-view-api/build.rs: -------------------------------------------------------------------------------- 1 | #![recursion_limit = "256"] 2 | 3 | fn main() { 4 | cfg_aliases::cfg_aliases! { 5 | wasm: { target_arch = "wasm32" }, 6 | android: { target_os = "android" }, 7 | ipc: { all(feature = "ipc", not(any(android, wasm))) }, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/property_attr_not_fn.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::property; 2 | 3 | #[property(CONTEXT)] 4 | pub struct Foo {} 5 | 6 | #[property(CONTEXT)] 7 | pub mod bar { 8 | pub fn baz() {} 9 | } 10 | 11 | fn main() { 12 | let _ = Foo {}; 13 | bar::baz(); 14 | } 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_fields1.stderr: -------------------------------------------------------------------------------- 1 | error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` 2 | --> cases/widget_new/malformed_fields1.rs:8:22 3 | | 4 | 8 | margin: 0; 5 | | ^ expected one of `)`, `,`, `.`, `?`, or an operator 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_property1.stderr: -------------------------------------------------------------------------------- 1 | error[E0599]: no method named `unknown` found for mutable reference `&mut Wgt` in the current scope 2 | --> cases/widget_new/unknown_property1.rs:6:9 3 | | 4 | 6 | unknown = 0; 5 | | ^^^^^^^ method not found in `&mut Wgt` 6 | -------------------------------------------------------------------------------- /crates/zng-task/src/process.rs: -------------------------------------------------------------------------------- 1 | #![cfg(not(target_arch = "wasm32"))] 2 | 3 | //! Async process API and worker. 4 | //! 5 | //! This module reexports the [`async-process`](https://docs.rs/async-process) for convenience. 6 | 7 | #[cfg(ipc)] 8 | pub mod worker; 9 | 10 | pub use async_process::*; 11 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/cannot_declare_lifetime.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, UiNode, property}; 2 | 3 | #[property(CONTEXT)] 4 | pub fn invalid<'a>(child: impl IntoUiNode, input: &'a str) -> UiNode { 5 | let _ = input; 6 | child.into_node() 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/property_attr_not_fn.stderr: -------------------------------------------------------------------------------- 1 | error: expected `fn` 2 | --> $DIR/property_attr_not_fn.rs:4:5 3 | | 4 | 4 | pub struct Foo {} 5 | | ^^^^^^ 6 | 7 | error: expected `fn` 8 | --> $DIR/property_attr_not_fn.rs:7:5 9 | | 10 | 7 | pub mod bar { 11 | | ^^^ 12 | -------------------------------------------------------------------------------- /tools/color-gen/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "color-gen" 3 | version = "0.1.0" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | 7 | [dependencies] 8 | serde = { version = "1.0", features = ["derive"] } 9 | serde_json = "1.0" 10 | 11 | [workspace] # Exclude from main workspace -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/invalid_input_pattern.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, UiNode, property}; 2 | 3 | #[property(CONTEXT)] 4 | pub fn invalid_destruct(child: impl IntoUiNode, (a, b): (bool, u8)) -> UiNode { 5 | let _ = (a, b); 6 | child.into_node() 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_in_property_expr.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | margin = { 7 | let _ = unknown::path(); 8 | 0 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [env] 2 | DO_CMD = "cargo do" 3 | 4 | [alias] 5 | do = ["run", "--manifest-path", "tools/cargo-do/Cargo.toml", "--release", "--quiet", "--"] 6 | 7 | [build] 8 | # false positives in 1.92 9 | # see https://github.com/rust-lang/rust/issues/149889 10 | rustflags = ["-A", "unused_assignments"] -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/replace/test.stdout: -------------------------------------------------------------------------------- 1 | tests/cargo-zng-res-tests/replace/source/recursive.zr-warn.zr-rp 2 | tests/cargo-zng-res-tests/replace/source/replace.md.zr-rp 3 | target/tmp/tests/zng_res/replace/recursive.zr-warn 4 | Finished res build in #ms 5 | #DIR# 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/incorrect_arg_type3.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | layout::AngleUnits, 4 | widget::{Wgt, background_gradient}, 5 | }; 6 | 7 | fn main() { 8 | let _scope = APP.minimal(); 9 | let _ = Wgt! { 10 | background_gradient = 0.deg(), true; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /examples/animation/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-animation" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt"] } 9 | zng-wgt-webrender-debug = { path = "../../crates/zng-wgt-webrender-debug" } 10 | -------------------------------------------------------------------------------- /examples/config/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-config" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt", "config_json", "material_icons", "deadlock_detection"] } 9 | tracing = "0.1" 10 | dunce = "1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/invalid_input_pattern.stderr: -------------------------------------------------------------------------------- 1 | error: hot node input can only have a simple ident 2 | --> cases/hot_node/invalid_input_pattern.rs:6:49 3 | | 4 | 6 | pub fn invalid_destruct(child: impl IntoUiNode, (a, b): (bool, u8)) -> UiNode { 5 | | ^^^^^^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/invalid_priority.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, IntoVar, UiNode, property}; 2 | 3 | #[property(INVALID_PRI)] 4 | pub fn invalid_priority(child: impl IntoUiNode, input: impl IntoVar) -> UiNode { 5 | let _ = input; 6 | child.into_node() 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/cannot_instantiate_widget_mixin.stderr: -------------------------------------------------------------------------------- 1 | error: cannot find macro `TextMix` in this scope 2 | --> cases/widget/cannot_instantiate_widget_mixin.rs:8:13 3 | | 4 | 8 | let _ = TextMix!(); 5 | | ^^^^^^^ 6 | | 7 | = note: `TextMix` is in scope, but it is a struct, not a macro 8 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_in_when_expr2.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = 0; 8 | when *# { 9 | margin = 10; 10 | } 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /examples/hot-reload/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-hot-reload" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | hot-reload-lib = { path = "../hot-reload-lib", package = "zng-example-hot-reload-lib" } 9 | zng = { path = "../../crates/zng", features = ["view_prebuilt", "hot_reload"] } -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/malformed_property_attribute.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, button::Button, layout::margin}; 2 | 3 | fn main() { 4 | let _app = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _w = Button! { 7 | #![allow(inner_attribute)] 8 | #[!foo] 9 | margin = 10; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/return_type_is_not_ui_node.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, IntoVar, UiNode, property}; 2 | 3 | pub struct NotUiNode; 4 | 5 | #[property(CONTEXT)] 6 | pub fn invalid_output(_child: impl IntoUiNode, _input: impl IntoVar) -> NotUiNode { 7 | NotUiNode 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/cannot_unset_in_when.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, gesture::is_pressed, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | margin = 0; 7 | when *#is_pressed { 8 | margin = unset!; 9 | } 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_in_when_expr1.stderr: -------------------------------------------------------------------------------- 1 | error[E0308]: mismatched types 2 | --> cases/widget_new/error_in_when_expr1.rs:8:26 3 | | 4 | 8 | let a: u32 = true; 5 | | --- ^^^^ expected `u32`, found `bool` 6 | | | 7 | | expected due to this 8 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_in_when_expr3.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = 0; 8 | when *#margin.0. { 9 | margin = 10; 10 | } 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /examples/image/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-image" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view_prebuilt", "http", "svg"] } 9 | zng-wgt-webrender-debug = { path = "../../crates/zng-wgt-webrender-debug" } 10 | tracing = "0.1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/cannot_declare_lifetime.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, UiNode, hot_node}; 2 | 3 | zng::hot_reload::zng_hot_entry!(); 4 | 5 | #[hot_node] 6 | pub fn invalid<'a>(child: impl IntoUiNode, input: &'a str) -> UiNode { 7 | let _ = input; 8 | child.into_node() 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /crates/zng-ext-clipboard/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | COPY_CMD = 2 | .info = Place a copy of the selection in the clipboard 3 | .name = Copy 4 | 5 | CUT_CMD = 6 | .info = Remove the selection and place it in the clipboard 7 | .name = Cut 8 | 9 | PASTE_CMD = 10 | .info = Insert content from the clipboard 11 | .name = Paste 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/child_type_is_not_ui_node.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoVar, UiNode, property}; 2 | 3 | struct NotUiNode; 4 | 5 | #[property(CONTEXT)] 6 | pub fn invalid_child(child: NotUiNode, input: impl IntoVar) -> UiNode { 7 | let _ = (child, input); 8 | UiNode::nil() 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_first_token.stderr: -------------------------------------------------------------------------------- 1 | error: expected property or when 2 | --> cases/widget_new/error_first_token.rs:6:9 3 | | 4 | 6 | = 5 | | ^ 6 | 7 | error: expected property path 8 | --> cases/widget_new/error_first_token.rs:14:13 9 | | 10 | 14 | = 11 | | ^ 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/when_missing_expr1.stderr: -------------------------------------------------------------------------------- 1 | error: expected when expression 2 | --> cases/widget_new/when_missing_expr1.rs:6:13 3 | | 4 | 6 | let _ = Wgt! { when }; 5 | | ^^^^^^^^^^^^^ 6 | | 7 | = note: this error originates in the macro `Wgt` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /crates/zng-ext-clipboard/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | COPY_CMD = 2 | .info = Place a copy of the selection in the clipboard 3 | .name = Copy 4 | 5 | CUT_CMD = 6 | .info = Remove the selection and place it in the clipboard 7 | .name = Cut 8 | 9 | PASTE_CMD = 10 | .info = Insert content from the clipboard 11 | .name = Paste 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/invalid_input_pattern.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, UiNode, hot_node}; 2 | 3 | zng::hot_reload::zng_hot_entry!(); 4 | 5 | #[hot_node] 6 | pub fn invalid_destruct(child: impl IntoUiNode, (a, b): (bool, u8)) -> UiNode { 7 | let _ = (a, b); 8 | child.into_node() 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/child_type_is_not_ui_node.stderr: -------------------------------------------------------------------------------- 1 | error: property first arg can only have types `impl IntoUiNode` or `&mut WidgetBuilding` 2 | --> cases/property/child_type_is_not_ui_node.rs:6:29 3 | | 4 | 6 | pub fn invalid_child(child: NotUiNode, input: impl IntoVar) -> UiNode { 5 | | ^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/module_path_missing.stderr: -------------------------------------------------------------------------------- 1 | error: expected a macro_rules `$crate` path to this widget mod 2 | --> cases/widget/module_path_missing.rs:4:1 3 | | 4 | 4 | #[widget] 5 | | ^^^^^^^^^ 6 | | 7 | = note: this error originates in the attribute macro `widget` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_field_all_single.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | // margin has one field 7 | // this is interpreted as an unnamed assign `{ }` is the value 8 | margin = {}; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/child_type_constraints_ui_node.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{FillUiNode, IntoVar, UiNode, property}; 2 | 3 | #[property(CONTEXT)] 4 | pub fn invalid_child(child: FillUiNode, input: impl IntoVar) -> UiNode { 5 | let _ = input; 6 | zng::prelude_wgt::IntoUiNode::into_node(child) 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_value6.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | layout::margin, 4 | widget::{Wgt, background_gradient}, 5 | }; 6 | 7 | fn main() { 8 | let _scope = APP.minimal(); 9 | #[rustfmt::skip] 10 | let _ = Wgt! { 11 | background_gradient = 0.deg(), 12 | margin = 0; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/child_type_constraints_ui_node.stderr: -------------------------------------------------------------------------------- 1 | error: property first arg can only have types `impl IntoUiNode` or `&mut WidgetBuilding` 2 | --> cases/property/child_type_constraints_ui_node.rs:4:29 3 | | 4 | 4 | pub fn invalid_child(child: FillUiNode, input: impl IntoVar) -> UiNode { 5 | | ^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /crates/zng-ext-clipboard/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | COPY_CMD = 2 | .info = Colocar uma cópia da seleção na área de transferência 3 | .name = Copiar 4 | 5 | CUT_CMD = 6 | .info = Remover a seleção e colocá-la na área de transferência 7 | .name = Recortar 8 | 9 | PASTE_CMD = 10 | .info = Inserir o conteúdo da área de transferência 11 | .name = Colar -------------------------------------------------------------------------------- /crates/zng-view-prebuilt/lib/README.md: -------------------------------------------------------------------------------- 1 | # Local Prebuilt 2 | 3 | Run `do prebuild` to pre-build the current `zng-view` and output the binary library to this directory. 4 | 5 | If the library file for the OS is not found here the latest release from GitHub will be used. It will only 6 | work if there are no unreleased breaking changes in the current `zng-view-api`. 7 | -------------------------------------------------------------------------------- /examples/respawn/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-respawn" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view"] } 9 | zng-view = { path = "../../crates/zng-view" } 10 | zng-app = { path = "../../crates/zng-app", default-features = false } 11 | tracing = "0.1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_arg1.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | layout::{AngleUnits, margin}, 4 | widget::{Wgt, background_gradient}, 5 | }; 6 | 7 | fn main() { 8 | let _scope = APP.minimal(); 9 | #[rustfmt::skip] 10 | let _ = Wgt! { 11 | background_gradient = 0.deg(), ; 12 | margin = 0; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_field.stderr: -------------------------------------------------------------------------------- 1 | error[E0599]: no method named `unknown` found for struct `zng_wgt::layout_props::margin_inputs__` in the current scope 2 | --> cases/widget_new/unknown_field.rs:6:20 3 | | 4 | 6 | margin = { unknown: 0 }; 5 | | ^^^^^^^ method not found in `zng_wgt::layout_props::margin_inputs__` 6 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_special_value_in_when.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, gesture::is_pressed, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = 0; 8 | when *#is_pressed { 9 | margin = foo!; 10 | } 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/property_generic1.rs: -------------------------------------------------------------------------------- 1 | use zng::{text::Text, toggle::Toggle}; 2 | 3 | fn main() { 4 | let _scope = zng::APP.minimal(); 5 | let _err = Toggle! { 6 | child = Text!(""); 7 | value = 0; 8 | }; 9 | 10 | let _ok = Toggle! { 11 | child = Text!(""); 12 | value:: = 0; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/zng/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | # name: 2 | # License name 3 | # user-name: 4 | # "user" is the package that uses the license 5 | license-none = 6 | .id = 7 | .name = No license data 8 | .user-name = 9 | 10 | search = 11 | .placeholder = search licenses ({$shortcut}) 12 | 13 | window = 14 | .title = {$app} - Third Party Licenses 15 | -------------------------------------------------------------------------------- /crates/zng/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | # name: 2 | # License name 3 | # user-name: 4 | # "user" is the package that uses the license 5 | license-none = 6 | .id = 7 | .name = No license data 8 | .user-name = 9 | 10 | search = 11 | .placeholder = search licenses ({$shortcut}) 12 | 13 | window = 14 | .title = {$app} - Third Party Licenses 15 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/metadata.toml: -------------------------------------------------------------------------------- 1 | # test TOML, does not define a crate 2 | [package] 3 | name = "cargo-zng-res-tests" 4 | version = "0.1.0" 5 | authors = ["The Zng Project Developers"] 6 | description = "Part of the zng project." 7 | homepage = "https://zng-ui.github.io/" 8 | [package.metadata.zng.about] 9 | app = "Res Tests" 10 | org = "Zng Project" 11 | qualifier = "rs" -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_semi_before_when1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, gesture::is_pressed, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = 0 // missing ; here 8 | when *#is_pressed { 9 | margin = 20; 10 | } 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_value_before_when1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, gesture::is_pressed, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | margin = // missing 0; here 8 | when *#is_pressed { 9 | margin = 20; 10 | } 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /examples/hot-reload-lib/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-hot-reload-lib" 3 | version = "0.0.0" 4 | edition = "2024" 5 | publish = false 6 | description = "Hot reload library example for `hot_reload` example" 7 | 8 | [lib] 9 | crate-type = ["lib", "cdylib"] 10 | 11 | [dependencies] 12 | zng = { path = "../../crates/zng", features = ["hot_reload"] } 13 | tracing = "0.1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_value3.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, mouse::cursor, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | // we expected an error here. 8 | cursor = ; 9 | // we expect margin to be used here. 10 | margin = 0; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_member_in_when_expr1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, gesture::is_pressed, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | margin = 0; 7 | when *#is_pressed.1 { 8 | // only .0 or .state allowed. 9 | margin = 1; 10 | } 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /crates/zng/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | # name: 2 | # License name 3 | # user-name: 4 | # "user" is the package that uses the license 5 | license-none = 6 | .id = 7 | .name = Sem dados de licença 8 | .user-name = 9 | 10 | search = 11 | .placeholder = procurar licenças ({$shortcut}) 12 | 13 | window = 14 | .title = {$app} - Licenças de Terceiros 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_member_in_when_expr2.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, gesture::is_pressed, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | margin = 0; 7 | when *#is_pressed.unknown { 8 | // only .0 or .state allowed. 9 | margin = 1; 10 | } 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /crates/zng-wgt-material-icons/fonts/README.md: -------------------------------------------------------------------------------- 1 | # Updating 2 | 3 | The font and codepoint map files are manually copied from [`https://github.com/google/material-design-icons/tree/master/font`]. 4 | 5 | Last update is from `80347953f7b63de353da6b71a038ca7eb0b0eea5`. 6 | 7 | # Generating 8 | 9 | Use the `tools/material-icons-gen` to generate code, paste it in `generated.rs` and format. 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/args_count_none.stderr: -------------------------------------------------------------------------------- 1 | error: property functions must have at least 2 inputs: child: impl IntoUiNode, arg0, .. 2 | --> cases/property/args_count_none.rs:3:1 3 | | 4 | 3 | #[property(CONTEXT)] 5 | | ^^^^^^^^^^^^^^^^^^^^ 6 | | 7 | = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/replace/expected_target/replace.md: -------------------------------------------------------------------------------- 1 | # Res Tests 2 | 3 | Part of the zng project. 4 | 5 | [res-tests](https://zng-ui.github.io/) 6 | 7 | ## From File 8 | 9 | file-a 10 | 11 | FILE-A 12 | 13 | ## From bash script 14 | 15 | Hello World! 16 | 17 | hello-world 18 | 19 | ## Else 20 | 21 | Part of the zng project. 22 | Res Tests fallback. 23 | Res Tests fallback. 24 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_in_when_expr1.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, gesture::is_pressed, layout::margin, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | let _ = Wgt! { 6 | margin = 0; 7 | when { 8 | let a: u32 = true; 9 | *#is_pressed 10 | } { 11 | margin = 10; 12 | } 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_value5.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, layout::margin, mouse::cursor, widget::Wgt}; 2 | 3 | fn main() { 4 | let _scope = APP.minimal(); 5 | #[rustfmt::skip] 6 | let _ = Wgt! { 7 | cursor = 8 | #[allow(unused_imports)] 9 | margin = { 10 | use zng::layout::PxPoint; 11 | 0 12 | } 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/zng-wgt/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"http"` 10 | Enable web tasks. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/test.stdout: -------------------------------------------------------------------------------- 1 | tests/cargo-zng-res-tests/custom/source/hello-tool-crate.txt.zr-tool-crate 2 |  tool-crate print! 3 | tests/cargo-zng-res-tests/custom/source/hello-tool1.txt.zr-tool1 4 |  tool1 print! 5 | tests/cargo-zng-res-tests/custom/source/hello-tool2.txt.zr-tool2 6 |  tool2 print! 7 | Finished res build in #ms 8 | #DIR# 9 | -------------------------------------------------------------------------------- /crates/zng-ext-image/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"http"` 10 | Enable web image source. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /crates/zng-ext-input/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"drag_drop"` 10 | Enable drag&drop. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/localize/res/l10n/template/msg.ftl: -------------------------------------------------------------------------------- 1 | ### Localize Example 2 | ### This standalone comment is added to all scraped template files. 3 | ### This standalone comment is only added to the `msg` file. 4 | 5 | ## Commands 6 | 7 | LOCALIZED_FILE_CMD = 8 | .info = Localized in a named file 'msg' 9 | .name = Localized File 10 | 11 | ## Example Section 12 | 13 | click-count = Clicked {$n} times 14 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/statics/test.stdout: -------------------------------------------------------------------------------- 1 | tests/cargo-zng-res-tests/statics/source/fa 2 | target/tmp/tests/zng_res/statics/fa 3 | tests/cargo-zng-res-tests/statics/source/fb 4 | target/tmp/tests/zng_res/statics/fb 5 | tests/cargo-zng-res-tests/statics/source/fb/fb-fa 6 | target/tmp/tests/zng_res/statics/fb/fb-fa 7 | Finished res build in #ms 8 | #DIR# 9 | -------------------------------------------------------------------------------- /crates/zng-wgt-button/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"tooltip"` 10 | Enable tooltip in cmd buttons. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_value4.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | layout::margin, 4 | mouse::cursor, 5 | widget::{Wgt, enabled}, 6 | }; 7 | 8 | fn main() { 9 | let _scope = APP.minimal(); 10 | #[rustfmt::skip] 11 | let _ = Wgt! { 12 | cursor = 13 | // we expect these properties to be used. 14 | margin = 0; 15 | enabled = true; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/zng-task-proc-macros/src/util.rs: -------------------------------------------------------------------------------- 1 | /// `Ident` with custom span. 2 | macro_rules! ident_spanned { 3 | ($span:expr=> $($format_name:tt)+) => { 4 | proc_macro2::Ident::new(&format!($($format_name)+), $span) 5 | }; 6 | } 7 | 8 | /// `Ident` with call_site span. 9 | macro_rules! ident { 10 | ($($tt:tt)*) => { 11 | ident_spanned!(proc_macro2::Span::call_site()=> $($tt)*) 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /crates/zng-wgt-layer/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"image"` 10 | Enable accurate cursor image hot-spot anchoring. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /crates/zng-layout/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![doc(html_favicon_url = "https://zng-ui.github.io/res/zng-logo-icon.png")] 2 | #![doc(html_logo_url = "https://zng-ui.github.io/res/zng-logo.png")] 3 | //! 4 | //! Contextual layout units. 5 | //! 6 | //! # Crate 7 | //! 8 | #![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))] 9 | #![warn(unused_extern_crates)] 10 | #![warn(missing_docs)] 11 | 12 | pub mod context; 13 | pub mod unit; 14 | -------------------------------------------------------------------------------- /crates/zng-wgt-style/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"trace_widget"` 10 | Integration with widget trace instrumentation. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /crates/zng-wgt-data/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"var_type_names"` 10 | Compile with var type names for error messages 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /crates/zng-ext-l10n/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"tar"` 10 | Support for loading localization resources from TAR and Tarball. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_field_all_multi.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | widget::{Wgt, background_gradient}, 4 | }; 5 | 6 | fn main() { 7 | let _scope = APP.minimal(); 8 | let _ = Wgt! { 9 | // background_gradient has two fields 10 | // this is interpreted as an unnamed assign `{ }` is the value 11 | // and the second value is missing 12 | background_gradient = {}; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/name_conflict2.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{WidgetBase, widget}; 2 | 3 | #[widget($crate::TestWidget)] 4 | pub struct TestWidget(WidgetBase); 5 | 6 | #[widget($crate::TestWidget)] 7 | pub struct TestWidget(WidgetBase); 8 | 9 | // the hash for the widget path is the same, so unfortunately all generated macros end-up with the same name, at least the 10 | // just the second widget is highlighted? 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_semi1.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | layout::margin, 4 | mouse::{CursorIcon, cursor}, 5 | widget::{Wgt, enabled}, 6 | }; 7 | 8 | fn main() { 9 | let _scope = APP.minimal(); 10 | #[rustfmt::skip] 11 | let _ = Wgt! { 12 | margin = 0 13 | // we expect this properties to be used. 14 | enabled = true; 15 | cursor = CursorIcon::Pointer; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/incorrect_arg_type4.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | layout::AngleUnits, 4 | widget::{Wgt, background_gradient}, 5 | }; 6 | 7 | fn main() { 8 | let _scope = APP.minimal(); 9 | let _ = Wgt! { 10 | // only background_gradient gets highlighted here because generics.. 11 | background_gradient = { 12 | axis: 0.deg(), 13 | stops: true, 14 | }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/incorrect_when_expr_type1.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | color::colors, 4 | layout::margin, 5 | widget::{Wgt, background_color}, 6 | }; 7 | 8 | fn main() { 9 | let _scope = APP.minimal(); 10 | let _ = Wgt! { 11 | margin = 0; 12 | background_color = colors::BLACK; 13 | 14 | when *#margin { 15 | background_color = colors::WHITE; 16 | } 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /tools/cargo-do/src/run-wasm-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | -------------------------------------------------------------------------------- /crates/zng-wgt-input/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 2 feature flags, 0 enabled by default. 9 | 10 | #### `"drag_drop"` 11 | Enable drag&drop. 12 | 13 | #### `"image"` 14 | Enable image cursor. 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/return_type_is_not_ui_node.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, IntoVar, hot_node}; 2 | 3 | zng::hot_reload::zng_hot_entry!(); 4 | 5 | pub struct NotUiNode; 6 | 7 | #[hot_node] 8 | pub fn invalid_output1(_child: impl IntoUiNode, _input: impl IntoVar) -> NotUiNode { 9 | NotUiNode 10 | } 11 | 12 | #[hot_node] 13 | pub fn invalid_output2(_child: impl IntoUiNode, _input: impl IntoVar) {} 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_in_property_expr.stderr: -------------------------------------------------------------------------------- 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unknown` 2 | --> cases/widget_new/error_in_property_expr.rs:7:21 3 | | 4 | 7 | let _ = unknown::path(); 5 | | ^^^^^^^ use of unresolved module or unlinked crate `unknown` 6 | | 7 | = help: if you wanted to use a crate named `unknown`, use `cargo add unknown` to add it to your `Cargo.toml` 8 | -------------------------------------------------------------------------------- /tools/cargo-do/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo-do" 3 | version = "0.0.0" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | description = "Run tasks for managing this project. Implemented in \"./tools/cargo-do\"." 7 | 8 | [dependencies] 9 | ansi_term = "0.12" 10 | glob = "0.3" 11 | opener = "0.6" 12 | regex = "1.10" 13 | topological-sort = "0.2" 14 | dunce = "1.0" 15 | itertools = "0.14.0" 16 | remove_dir_all = "1.0" 17 | 18 | [workspace] -------------------------------------------------------------------------------- /crates/zng-var/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"type_names"` 10 | Add `value_type_name` method to get the diagnostics type name from variable values. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/incorrect_arg_type2.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | prelude_wgt::{IntoUiNode, IntoVar, UiNode, property}, 4 | widget::Wgt, 5 | }; 6 | 7 | #[property(CONTEXT)] 8 | pub fn simple_type(child: impl IntoUiNode, simple: impl IntoVar) -> UiNode { 9 | let _ = simple; 10 | child 11 | } 12 | 13 | fn main() { 14 | let _scope = APP.minimal(); 15 | let _ = Wgt! { 16 | simple_type = true; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/zng-handle/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-handle" 3 | version = "0.4.0" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_handle" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/error_first_token.rs: -------------------------------------------------------------------------------- 1 | use zng::{APP, gesture::is_pressed, widget::Wgt}; 2 | 3 | fn test_1() { 4 | #[rustfmt::skip] 5 | let _ = Wgt! { 6 | = 7 | }; 8 | } 9 | 10 | fn test_2() { 11 | #[rustfmt::skip] 12 | let _ = Wgt! { 13 | when *#is_pressed { 14 | = 15 | } 16 | }; 17 | } 18 | 19 | fn main() { 20 | let _scope = APP.minimal(); 21 | test_1(); 22 | test_2(); 23 | } 24 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_semi2.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | layout::margin, 4 | mouse::{CursorIcon, cursor}, 5 | widget::{Wgt, enabled}, 6 | }; 7 | 8 | fn main() { 9 | let _scope = APP.minimal(); 10 | let margin = 0; 11 | #[rustfmt::skip] 12 | let _ = Wgt! { 13 | margin 14 | // we expect this properties to be used. 15 | enabled = true; 16 | cursor = CursorIcon::Pointer; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/tools/cargo-zng-res/src/bin/tool1.rs: -------------------------------------------------------------------------------- 1 | use std::{env, fs, path::PathBuf}; 2 | 3 | fn main() { 4 | if env::var("ZR_HELP").is_ok() { 5 | println!(".zr-tool1 help!"); 6 | std::process::exit(0); 7 | } 8 | println!("tool1 print!"); 9 | fs::copy(path("ZR_REQUEST"), path("ZR_TARGET")).unwrap(); 10 | } 11 | 12 | fn path(var: &str) -> PathBuf { 13 | env::var(var).unwrap_or_else(|_| panic!("missing {var}")).into() 14 | } 15 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/tools/cargo-zng-res/src/bin/tool2.rs: -------------------------------------------------------------------------------- 1 | use std::{env, fs, path::PathBuf}; 2 | 3 | fn main() { 4 | if env::var("ZR_HELP").is_ok() { 5 | println!(".zr-tool2 help!"); 6 | std::process::exit(0); 7 | } 8 | println!("tool2 print!"); 9 | fs::copy(path("ZR_REQUEST"), path("ZR_TARGET")).unwrap(); 10 | } 11 | 12 | fn path(var: &str) -> PathBuf { 13 | env::var(var).unwrap_or_else(|_| panic!("missing {var}")).into() 14 | } 15 | -------------------------------------------------------------------------------- /crates/zng-clone-move/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-clone-move" 3 | version = "0.4.0" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_clone_move" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_field_multi.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | layout::AngleUnits, 4 | widget::{Wgt, background_gradient}, 5 | }; 6 | 7 | fn main() { 8 | let _scope = APP.minimal(); 9 | let _ = Wgt! { 10 | // background_gradient has two fields 11 | // the error highlights the property 12 | // in a struct initializer the struct name is highlighted 13 | background_gradient = { axis: 0.deg() }; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/target 2 | **/*.rs.bk 3 | **/Cargo.lock 4 | profile*.json 5 | profile*.json.gz 6 | **/*.expanded.rs 7 | dump.* 8 | dump*.* 9 | /screenshot.* 10 | /screencast.* 11 | wip 12 | cargo-timing* 13 | large-image.* 14 | examples/test* 15 | crates/zng-view-prebuilt/lib/zng_view.* 16 | crates/zng-view-prebuilt/lib/libzng_view.* 17 | **/*.mm_profdata 18 | *.mono_items.md 19 | do.bat 20 | do.ps1 21 | do 22 | /trace-*.json 23 | **/pseudo*.ftl 24 | **/pseudo*/*.ftl 25 | /zng-trace 26 | /zng-dhat -------------------------------------------------------------------------------- /crates/zng-wgt-window/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 2 feature flags, 0 enabled by default. 9 | 10 | #### `"image"` 11 | Enable image related properties, frame image. 12 | 13 | #### `"config"` 14 | Enable config properties. 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_member_in_when_expr1.stderr: -------------------------------------------------------------------------------- 1 | error[E0599]: no method named `__w_1__` found for struct `zng_wgt_input::state::is_pressed_inputs__` in the current scope 2 | --> cases/widget_new/unknown_member_in_when_expr1.rs:7:16 3 | | 4 | 7 | when *#is_pressed.1 { 5 | | ^^^^^^^^^^ 6 | | 7 | help: there is a method `__w_0__` with a similar name 8 | | 9 | 7 - when *#is_pressed.1 { 10 | 7 + when *#__w_0__.1 { 11 | | 12 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/custom/tools/cargo-zng-res-tool-crate/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::{env, fs, path::PathBuf}; 2 | 3 | fn main() { 4 | if env::var("ZR_HELP").is_ok() { 5 | println!(".zr-tool-crate help!"); 6 | std::process::exit(0); 7 | } 8 | println!("tool-crate print!"); 9 | fs::copy(path("ZR_REQUEST"), path("ZR_TARGET")).unwrap(); 10 | } 11 | 12 | fn path(var: &str) -> PathBuf { 13 | env::var(var).unwrap_or_else(|_| panic!("missing {var}")).into() 14 | } 15 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/prefix_is_default.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, IntoVar, UiNode, property}; 2 | 3 | #[property(CONTEXT)] 4 | pub fn is_state(child: impl IntoUiNode, state: impl IntoVar) -> UiNode { 5 | let _ = (child, state); 6 | UiNode::nil() 7 | } 8 | 9 | #[property(CONTEXT)] 10 | pub fn is_state_invalid(child: impl IntoUiNode, state: impl IntoVar) -> UiNode { 11 | let _ = (child, state); 12 | UiNode::nil() 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/prefix_has_default.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, IntoVar, UiNode, property}; 2 | 3 | #[property(CONTEXT)] 4 | pub fn has_state(child: impl IntoUiNode, state: impl IntoVar) -> UiNode { 5 | let _ = (child, state); 6 | UiNode::nil() 7 | } 8 | 9 | #[property(CONTEXT)] 10 | pub fn has_state_invalid(child: impl IntoUiNode, state: impl IntoVar) -> UiNode { 11 | let _ = (child, state); 12 | UiNode::nil() 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_semi_in_when2.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | gesture::is_pressed, 4 | layout::margin, 5 | mouse::{CursorIcon, cursor}, 6 | widget::Wgt, 7 | }; 8 | 9 | fn main() { 10 | let _scope = APP.minimal(); 11 | #[rustfmt::skip] 12 | let _ = Wgt! { 13 | margin = 0; 14 | cursor = CursorIcon::Default; 15 | when *#is_pressed { 16 | margin = cursor = CursorIcon::Pointer; 17 | } 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /crates/zng-env/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"built_res"` 10 | Check if `res` path is available in `init_built_res` first. 11 | 12 | Enabled by default in debug builds, ignored in Android and Wasm. 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/extend-view/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-example-extend-view" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2024" 6 | 7 | [dependencies] 8 | zng = { path = "../../crates/zng", features = ["view"] } 9 | zng-view = { path = "../../crates/zng-view" } 10 | zng-view-api = { path = "../../crates/zng-view-api" } 11 | zng-app = { path = "../../crates/zng-app", default-features = false } 12 | tracing = "0.1" 13 | serde = { version = "1.0", features = ["derive"] } 14 | raw-window-handle = "0.6" -------------------------------------------------------------------------------- /crates/zng-ext-config/src/toml.rs: -------------------------------------------------------------------------------- 1 | use super::*; 2 | 3 | /// Represents a config source that synchronizes with a TOML file. 4 | pub type TomlConfig = SyncConfig; 5 | 6 | #[doc(hidden)] 7 | pub struct TomlBackend; 8 | impl SyncConfigBackend for TomlBackend { 9 | fn read(mut file: WatchFile) -> io::Result { 10 | file.toml() 11 | } 12 | 13 | fn write(file: &mut WriteFile, map: &RawConfigMap) -> io::Result<()> { 14 | file.write_toml(map, true) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /crates/zng-view-prebuilt/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, enabled by default. 9 | #### `"embedded"` 10 | Requires embedded on build, if prebuilt is not in './lib' and download fails the build will fail. 11 | 12 | *Enabled by default.* 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/incorrect_arg_type5.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | prelude_wgt::{IntoUiNode, IntoVar, UiNode, property}, 4 | widget::Wgt, 5 | }; 6 | 7 | #[property(CONTEXT)] 8 | pub fn simple_type(child: impl IntoUiNode, simple_a: impl IntoVar, simple_b: impl IntoVar) -> UiNode { 9 | let _ = (simple_a, simple_b); 10 | child 11 | } 12 | 13 | fn main() { 14 | let _scope = APP.minimal(); 15 | let _ = Wgt! { 16 | simple_type = 42, true; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_semi_in_when1.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | gesture::is_pressed, 4 | layout::margin, 5 | mouse::{CursorIcon, cursor}, 6 | widget::Wgt, 7 | }; 8 | 9 | fn main() { 10 | let _scope = APP.minimal(); 11 | #[rustfmt::skip] 12 | let _ = Wgt! { 13 | margin = 0; 14 | cursor = CursorIcon::Default; 15 | when *#is_pressed { 16 | margin = 0 17 | cursor = CursorIcon::Pointer; 18 | } 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_member_in_when_expr2.stderr: -------------------------------------------------------------------------------- 1 | error[E0599]: no method named `__w_unknown__` found for struct `zng_wgt_input::state::is_pressed_inputs__` in the current scope 2 | --> cases/widget_new/unknown_member_in_when_expr2.rs:7:16 3 | | 4 | 7 | when *#is_pressed.unknown { 5 | | ^^^^^^^^^^ 6 | | 7 | help: there is a method `__w_0__` with a similar name 8 | | 9 | 7 - when *#is_pressed.unknown { 10 | 7 + when *#__w_0__.unknown { 11 | | 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/method_cannot_be_hot_node.stderr: -------------------------------------------------------------------------------- 1 | error: methods cannot be hot nodes 2 | --> cases/hot_node/method_cannot_be_hot_node.rs:8:25 3 | | 4 | 8 | pub fn self_method1(self, input: impl IntoVar) -> UiNode { 5 | | ^^^^ 6 | 7 | error: methods cannot be hot nodes 8 | --> cases/hot_node/method_cannot_be_hot_node.rs:14:25 9 | | 10 | 14 | pub fn self_method2(self: Box, input: impl IntoVar) -> UiNode { 11 | | ^^^^ 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/method_cannot_be_property.stderr: -------------------------------------------------------------------------------- 1 | error: methods cannot be properties 2 | --> cases/property/method_cannot_be_property.rs:6:25 3 | | 4 | 6 | pub fn self_method1(self, input: impl IntoVar) -> UiNode { 5 | | ^^^^ 6 | 7 | error: methods cannot be properties 8 | --> cases/property/method_cannot_be_property.rs:12:25 9 | | 10 | 12 | pub fn self_method2(self: Box, input: impl IntoVar) -> UiNode { 11 | | ^^^^ 12 | -------------------------------------------------------------------------------- /.cargo/audit.toml: -------------------------------------------------------------------------------- 1 | [advisories] 2 | ignore = [ 3 | # `paste` is unmaintained 4 | # 5 | # already replaced in project crates, `image` dependency still use it: 6 | # 7 | # ├── rav1e 0.7.1 - already fixed (0.8) 8 | # └── ravif 0.11.11 - already updated 9 | # └── image 0.25.5 - pending 10 | # ├── zng-view 0.8.0 11 | # └── arboard 3.4.1 12 | # └── zng-view 0.8.0 13 | # 14 | # remove this ignore when all dependencies are fixes 15 | "RUSTSEC-2024-0436", 16 | ] -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_special_value.stderr: -------------------------------------------------------------------------------- 1 | error: unknown special value, expected `unset!` 2 | --> cases/widget_new/unknown_special_value.rs:7:18 3 | | 4 | 7 | margin = foo!; 5 | | ^^^ 6 | 7 | warning: unused import: `layout::margin` 8 | --> cases/widget_new/unknown_special_value.rs:1:16 9 | | 10 | 1 | use zng::{APP, layout::margin, widget::Wgt}; 11 | | ^^^^^^^^^^^^^^ 12 | | 13 | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default 14 | -------------------------------------------------------------------------------- /crates/zng-tp-licenses/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 2 feature flags, 0 enabled by default. 9 | 10 | #### `"build"` 11 | Include helpers for collecting third-party licenses. 12 | 13 | #### `"bundle"` 14 | Include helpers for deserializing `build` encoded licenses. 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/localize/res/l10n/ar/_.ftl: -------------------------------------------------------------------------------- 1 | ### Google Translated to have a RTL example. 2 | 3 | button = زر 4 | 5 | window = 6 | .title = ترجمة المثال (ar) 7 | 8 | example-cmds = أوامر المثال: 9 | 10 | LOCALIZED_CMD = 11 | .info = مترجم في الملف الافتراضي 12 | .name = مترجم 13 | 14 | PRIVATE_LOCALIZED_CMD = 15 | .info = أمر خاص، نص الترجمة العامة 16 | .name = خاص 17 | 18 | press-shortcut-msg = اضغط على الاختصار الجديد ثم اضغط [] 19 | 20 | example-shortcuts = اختصارات مثال: 21 | 22 | no-shortcut = لا يوجد اختصار -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/replace/source/replace.md.zr-rp: -------------------------------------------------------------------------------- 1 | # ${ZR_APP} 2 | 3 | ${ZR_DESCRIPTION} 4 | 5 | [${ZR_APP:k}](${ZR_HOMEPAGE}) 6 | 7 | ## From File 8 | 9 | ${ cases/widget_new/when_missing_block.rs:7:16 3 | | 4 | 7 | when *#is_pressed 5 | | ^^^^^^^^^^ 6 | 7 | warning: unused import: `gesture::is_pressed` 8 | --> cases/widget_new/when_missing_block.rs:1:16 9 | | 10 | 1 | use zng::{APP, gesture::is_pressed, widget::Wgt}; 11 | | ^^^^^^^^^^^^^^^^^^^ 12 | | 13 | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default 14 | -------------------------------------------------------------------------------- /crates/zng-wgt-text-input/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![doc(html_favicon_url = "https://zng-ui.github.io/res/zng-logo-icon.png")] 2 | #![doc(html_logo_url = "https://zng-ui.github.io/res/zng-logo.png")] 3 | //! 4 | //! Text input and label widgets. 5 | //! 6 | //! # Crate 7 | //! 8 | #![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))] 9 | #![warn(unused_extern_crates)] 10 | #![warn(missing_docs)] 11 | 12 | zng_wgt::enable_widget_macros!(); 13 | 14 | pub mod label; 15 | pub mod selectable; 16 | 17 | mod text_input; 18 | pub use text_input::*; 19 | -------------------------------------------------------------------------------- /docs/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Security updates are applied only to the latest release. 6 | 7 | ## Reporting a Vulnerability 8 | 9 | If you have discovered a security vulnerability in this project, please report it privately using a [draft security advisory](https://github.com/zng-ui/zng/security/advisories/new). **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. 10 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/type_path_is_invalid1.stderr: -------------------------------------------------------------------------------- 1 | error[E0433]: failed to resolve: could not find `not` in the crate root 2 | --> cases/widget/type_path_is_invalid1.rs:3:18 3 | | 4 | 3 | #[widget($crate::not::a::valid::path)] 5 | | ^^^ ---- in this macro invocation 6 | | | 7 | | could not find `not` in the crate root 8 | | 9 | = note: this error originates in the macro `zzz_widget_path__not_a_valid_path` (in Nightly builds, run with -Z macro-backtrace for more info) 10 | -------------------------------------------------------------------------------- /crates/zng-ext-config/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 4 feature flags, 0 enabled by default. 9 | 10 | #### `"json"` 11 | Enable JSON support. 12 | 13 | #### `"yaml"` 14 | Enable YAML support. 15 | 16 | #### `"toml"` 17 | Enable TOML support. 18 | 19 | #### `"ron"` 20 | Enable RON support. 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/basic/template/t-app-t.md: -------------------------------------------------------------------------------- 1 | | expected | actual | 2 | |-----------|---------------| 3 | | The App! | {{app}} | 4 | | The Org! | {{org}} | 5 | | .qual | {{qualifier}} | 6 | | the-app | t-app-t | 7 | | THE-APP | T-APP-T | 8 | | the_app | t_app_t | 9 | | THE_APP | T_APP_T | 10 | | The-App | T-App-T | 11 | | the app! | t.app.t | 12 | | THE APP! | T.APP.T | 13 | | The App! | T.App.T | 14 | | theApp | ttAppTt | 15 | | TheApp | TtAppTt | 16 | -------------------------------------------------------------------------------- /crates/zng-ext-config/src/ron.rs: -------------------------------------------------------------------------------- 1 | use super::*; 2 | 3 | /// Represents a config source that synchronizes with a RON file. 4 | pub type RonConfig = SyncConfig; 5 | 6 | #[doc(hidden)] 7 | pub struct RonBackend; 8 | impl SyncConfigBackend for RonBackend { 9 | fn read(mut file: WatchFile) -> io::Result { 10 | file.ron().map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e)) 11 | } 12 | 13 | fn write(file: &mut WriteFile, map: &RawConfigMap) -> io::Result<()> { 14 | file.write_ron(map, true) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /crates/zng-ext-fs-watcher/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 4 feature flags, 0 enabled by default. 9 | 10 | #### `"json"` 11 | Enable JSON helpers. 12 | 13 | #### `"yaml"` 14 | Enable YAML helpers. 15 | 16 | #### `"toml"` 17 | Enable TOML helpers. 18 | 19 | #### `"ron"` 20 | Enable RON helpers. 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /crates/zng-wgt-fill/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-wgt-fill" 3 | version = "0.10.3" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_wgt_fill" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | zng-wgt = { path = "../zng-wgt", version = "0.13.3", default-features = false } 16 | -------------------------------------------------------------------------------- /crates/zng-ext-config/src/yaml.rs: -------------------------------------------------------------------------------- 1 | use super::*; 2 | 3 | /// Represents a config source that synchronizes with a YAML file. 4 | pub type YamlConfig = SyncConfig; 5 | 6 | #[doc(hidden)] 7 | pub struct YamlBackend; 8 | impl SyncConfigBackend for YamlBackend { 9 | fn read(mut file: WatchFile) -> io::Result { 10 | file.yaml().map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e)) 11 | } 12 | 13 | fn write(file: &mut WriteFile, map: &RawConfigMap) -> io::Result<()> { 14 | file.write_yaml(map) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/cargo-zng-new-tests/basic/expected_target/the-app/the-app.md: -------------------------------------------------------------------------------- 1 | | expected | actual | 2 | |-----------|---------------| 3 | | The App! | The App! | 4 | | The Org! | The Org! | 5 | | .qual | .qual | 6 | | the-app | the-app | 7 | | THE-APP | THE-APP | 8 | | the_app | the_app | 9 | | THE_APP | THE_APP | 10 | | The-App | The-App | 11 | | the app! | the app! | 12 | | THE APP! | THE APP! | 13 | | The App! | The App! | 14 | | theApp | theApp | 15 | | TheApp | TheApp | 16 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/prefix_get_default.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoUiNode, IntoVar, UiNode, property}; 2 | 3 | #[property(CONTEXT)] 4 | pub fn get_state(child: impl IntoUiNode, state: impl IntoVar) -> UiNode { 5 | let _ = (child, state); 6 | UiNode::nil() 7 | } 8 | 9 | #[property(CONTEXT)] 10 | pub fn get_state_invalid(child: impl IntoUiNode, state: impl IntoVar) -> UiNode { 11 | let _ = (child, state); 12 | UiNode::nil() 13 | } 14 | 15 | #[derive(Debug, Clone)] 16 | pub struct NotDefault {} 17 | 18 | fn main() {} 19 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget/name_conflict1.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{WidgetBase, widget}; 2 | 3 | #[allow(unused_macros)] 4 | macro_rules! TestWidget { 5 | () => {}; 6 | } 7 | #[allow(unused_imports)] 8 | pub use crate::TestWidget; 9 | 10 | #[widget($crate::TestWidget)] 11 | pub struct TestWidget(WidgetBase); 12 | 13 | // #[widget] expands to another `macro_rules! foo` and `pub use foo;` 14 | // The full call_site (line 8) gets highlighted here, that is usually 15 | // bad, but in this case it is the least confusing span we can use. 16 | 17 | fn main() {} 18 | -------------------------------------------------------------------------------- /.cargo/about.toml: -------------------------------------------------------------------------------- 1 | # cargo about generate -c .cargo/about.toml --format json --workspace --all-features 2 | 3 | accepted = [ 4 | "Apache-2.0", 5 | "MIT", 6 | "MIT-0", 7 | "MPL-2.0", 8 | "Unicode-DFS-2016", 9 | "BSL-1.0", 10 | "BSD-2-Clause", 11 | "BSD-3-Clause", 12 | "ISC", 13 | "Zlib", 14 | "CC0-1.0", 15 | "Apache-2.0 WITH LLVM-exception", 16 | "Unicode-3.0", 17 | "NCSA", 18 | ] 19 | 20 | ignore-build-dependencies = true 21 | ignore-dev-dependencies = true 22 | filter-noassertion = true 23 | private = { ignore = true } -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/copy/test.stdout: -------------------------------------------------------------------------------- 1 | tests/cargo-zng-res-tests/copy/source/a 2 | target/tmp/tests/zng_res/copy/a 3 | tests/cargo-zng-res-tests/copy/source/a/file-a.txt.zr-copy 4 |  target/tmp/tests/zng_res/copy/a/file-a.txt 5 | tests/cargo-zng-res-tests/copy/source/a.zr-copy 6 |  target/tmp/tests/zng_res/copy/a 7 | target/tmp/tests/zng_res/copy/a/merged-file-a.txt 8 | tests/cargo-zng-res-tests/copy/source/file-b.txt.zr-copy 9 |  target/tmp/tests/zng_res/copy/file-b.txt 10 | Finished res build in #ms 11 | #DIR# 12 | -------------------------------------------------------------------------------- /tests/render-tests/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "render-tests" 3 | version = "0.0.0" 4 | edition = "2024" 5 | publish = false 6 | 7 | [dependencies] 8 | zng-app = { path = "../../crates/zng-app" } 9 | zng = { path = "../../crates/zng", features = [ 10 | # "view", 11 | # "view_prebuilt", 12 | "multi_app", 13 | ] } 14 | # use ZNG_VIEW_NO_INIT_START to manually select witch. 15 | zng-view-prebuilt = { path = "../../crates/zng-view-prebuilt" } 16 | zng-view = { path = "../../crates/zng-view", features = ["ipc", "software"] } 17 | 18 | color-print = "0.3" 19 | tracing = "0.1" -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/cannot_declare_lifetime.stderr: -------------------------------------------------------------------------------- 1 | error: hot node functions cannot declare lifetimes 2 | --> cases/hot_node/cannot_declare_lifetime.rs:6:16 3 | | 4 | 6 | pub fn invalid<'a>(child: impl IntoUiNode, input: &'a str) -> UiNode { 5 | | ^^ 6 | 7 | error: hot node input can only have `Clone+Send+Any` types or `impl OneTrait` property types 8 | --> cases/hot_node/cannot_declare_lifetime.rs:6:51 9 | | 10 | 6 | pub fn invalid<'a>(child: impl IntoUiNode, input: &'a str) -> UiNode { 11 | | ^ 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/incorrect_arg_type6.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | prelude_wgt::{IntoUiNode, IntoVar, UiNode, property}, 4 | widget::Wgt, 5 | }; 6 | 7 | #[property(CONTEXT)] 8 | pub fn simple_type(child: impl IntoUiNode, simple_a: impl IntoVar, simple_b: impl IntoVar) -> UiNode { 9 | let _ = (simple_a, simple_b); 10 | child 11 | } 12 | 13 | fn main() { 14 | let _scope = APP.minimal(); 15 | let _ = Wgt! { 16 | simple_type = { 17 | simple_a: 42, 18 | simple_b: true, 19 | }; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/invalid_special.stderr: -------------------------------------------------------------------------------- 1 | error: unknown special value, expected `unset!` 2 | --> cases/widget_new/invalid_special.rs:7:28 3 | | 4 | 7 | background_color = invalid!; 5 | | ^^^^^^^ 6 | 7 | warning: unused import: `widget::background_color` 8 | --> cases/widget_new/invalid_special.rs:1:32 9 | | 10 | 1 | use zng::{APP, button::Button, widget::background_color}; 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^ 12 | | 13 | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default 14 | -------------------------------------------------------------------------------- /crates/zng-ext-config/src/json.rs: -------------------------------------------------------------------------------- 1 | use zng_ext_fs_watcher::{WatchFile, WriteFile}; 2 | 3 | use super::*; 4 | 5 | /// Represents a config source that synchronizes with a JSON file. 6 | pub type JsonConfig = SyncConfig; 7 | 8 | #[doc(hidden)] 9 | pub struct JsonBackend; 10 | impl SyncConfigBackend for JsonBackend { 11 | fn read(mut file: WatchFile) -> io::Result { 12 | file.json().map_err(Into::into) 13 | } 14 | 15 | fn write(file: &mut WriteFile, map: &RawConfigMap) -> io::Result<()> { 16 | file.write_json(map, true) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/return_type_is_not_ui_node.stderr: -------------------------------------------------------------------------------- 1 | error: hot node functions must output `UiNode` 2 | --> cases/hot_node/return_type_is_not_ui_node.rs:8:80 3 | | 4 | 8 | pub fn invalid_output1(_child: impl IntoUiNode, _input: impl IntoVar) -> NotUiNode { 5 | | ^^^^^^^^^ 6 | 7 | error: hot node functions must output `UiNode` 8 | --> cases/hot_node/return_type_is_not_ui_node.rs:13:5 9 | | 10 | 13 | pub fn invalid_output2(_child: impl IntoUiNode, _input: impl IntoVar) {} 11 | | ^^ 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/cannot_declare_lifetime.stderr: -------------------------------------------------------------------------------- 1 | error: property functions cannot declare lifetimes 2 | --> cases/property/cannot_declare_lifetime.rs:4:16 3 | | 4 | 4 | pub fn invalid<'a>(child: impl IntoUiNode, input: &'a str) -> UiNode { 5 | | ^^ 6 | 7 | error: property input can only have types impl IntoVar, impl IntoValue, impl IntoUiNode or Handler 8 | --> cases/property/cannot_declare_lifetime.rs:4:51 9 | | 10 | 4 | pub fn invalid<'a>(child: impl IntoUiNode, input: &'a str) -> UiNode { 11 | | ^ 12 | -------------------------------------------------------------------------------- /examples/localize/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | #[cfg(not(debug_assertions))] 3 | pack_l10n(); 4 | } 5 | 6 | #[cfg(not(debug_assertions))] 7 | /// Pack l10n dir for embedding using `l10N.load_tar`. 8 | fn pack_l10n() { 9 | let out = std::path::PathBuf::from(std::env::var_os("OUT_DIR").unwrap()); 10 | std::process::Command::new("tar") 11 | .arg("-czf") 12 | .arg(out.join("l10n.tar.gz")) 13 | .current_dir("res") 14 | .arg("l10n") 15 | .status() 16 | .expect("failed to pack l10n resources"); 17 | println!("cargo::rerun-if-changed=res/l10n") 18 | } 19 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/property_generic1.stderr: -------------------------------------------------------------------------------- 1 | error[E0283]: type annotations needed 2 | --> cases/widget_new/property_generic1.rs:7:9 3 | | 4 | 7 | value = 0; 5 | | ^^^^^ cannot infer type for type parameter `T` declared on the method `value` 6 | | 7 | = note: cannot satisfy `_: VarValue` 8 | note: required by a bound in `Toggle::value` 9 | --> $WORKSPACE/crates/zng-wgt-toggle/src/lib.rs 10 | | 11 | | pub fn value(child: impl IntoUiNode, value: impl IntoVar) -> UiNode { 12 | | ^^^^^^^^ required by this bound in `Toggle::value` 13 | -------------------------------------------------------------------------------- /crates/zng-ext-input/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![doc(html_favicon_url = "https://zng-ui.github.io/res/zng-logo-icon.png")] 2 | #![doc(html_logo_url = "https://zng-ui.github.io/res/zng-logo.png")] 3 | //! 4 | //! Input events and focused widget. 5 | //! 6 | //! # Crate 7 | //! 8 | #![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))] 9 | #![warn(unused_extern_crates)] 10 | #![warn(missing_docs)] 11 | 12 | #[macro_use] 13 | extern crate bitflags; 14 | 15 | pub mod drag_drop; 16 | pub mod focus; 17 | pub mod gesture; 18 | pub mod keyboard; 19 | pub mod mouse; 20 | pub mod pointer_capture; 21 | pub mod touch; 22 | -------------------------------------------------------------------------------- /crates/zng-view-api/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 2 feature flags, 0 enabled by default. 9 | 10 | #### `"ipc"` 11 | Enables creation of separate or pre-build view. 12 | 13 | Only enables in `cfg(not(any(target_os = "android", target_arch = "wasm32", target_os = "ios")))` builds. 14 | 15 | #### `"var"` 16 | Implement `IntoVar` for API types. 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /crates/zng-ext-window/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 3 feature flags, 0 enabled by default. 9 | 10 | #### `"test_util"` 11 | Enable test util methods, `doc_test_window`. 12 | 13 | #### `"image"` 14 | Enable images, icon, frame capture, integrate with the IMAGES rendering service. 15 | 16 | #### `"http"` 17 | Implement conversions from http types. 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /crates/zng-wgt-material-icons/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 5 feature flags, 0 enabled by default. 9 | 10 | #### `"embedded"` 11 | Embedded font files. 12 | 13 | #### `"outlined"` 14 | Outlined icon set. 15 | 16 | #### `"filled"` 17 | Filled icon set. 18 | 19 | #### `"rounded"` 20 | Rounded icon set. 21 | 22 | #### `"sharp"` 23 | Sharp icon set. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/unknown_special_value_in_when.stderr: -------------------------------------------------------------------------------- 1 | error: unexpected token, expected `}` 2 | --> cases/widget_new/unknown_special_value_in_when.rs:9:25 3 | | 4 | 9 | margin = foo!; 5 | | ^ 6 | 7 | warning: unused imports: `gesture::is_pressed` and `layout::margin` 8 | --> cases/widget_new/unknown_special_value_in_when.rs:1:16 9 | | 10 | 1 | use zng::{APP, gesture::is_pressed, layout::margin, widget::Wgt}; 11 | | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ 12 | | 13 | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default 14 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/not_allowed_in_when1.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | layout::margin, 4 | prelude_wgt::{IntoUiNode, UiNode, property}, 5 | widget::Wgt, 6 | }; 7 | 8 | #[property(CONTEXT)] 9 | pub fn foo(child: impl IntoUiNode, value: impl IntoUiNode) -> UiNode { 10 | let _ = value; 11 | child.into_node() 12 | } 13 | 14 | fn main() { 15 | let _scope = APP.minimal(); 16 | #[rustfmt::skip] 17 | let _ = Wgt! { 18 | margin = 0; 19 | when { 20 | let node = #foo; 21 | true 22 | } { 23 | margin = 1; 24 | } 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /crates/zng-wgt-transform/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-wgt-transform" 3 | version = "0.10.3" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_wgt_transform" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | zng-wgt = { path = "../zng-wgt", version = "0.13.3", default-features = false } 16 | 17 | euclid = { version = "0.22", default-features = false } 18 | -------------------------------------------------------------------------------- /crates/zng-ext-window/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | CLOSE_CMD = 2 | .info = Fechar a janela 3 | .name = Fechar 4 | 5 | EXCLUSIVE_FULLSCREEN_CMD = 6 | .info = Alternar o modo de tela cheia exclusivo na janela 7 | .name = Tela Cheia Exclusiva 8 | 9 | FULLSCREEN_CMD = 10 | .info = Alternar o modo tela cheia na janela 11 | .name = Tela Cheia 12 | 13 | MAXIMIZE_CMD = 14 | .info = Maximizar a janela 15 | .name = Maximizar 16 | 17 | MINIMIZE_CMD = 18 | .info = Minimizar a janela 19 | .name = Minimizar 20 | 21 | RESTORE_CMD = 22 | .info = Restaurar a janela para sua posição e tamanho anterior 23 | .name = Restaurar 24 | -------------------------------------------------------------------------------- /examples/localize/res/l10n/pt-BR/_.ftl: -------------------------------------------------------------------------------- 1 | button = Botão 2 | 3 | window = 4 | .title = Exemplo Localizar (pt-BR) 5 | 6 | example-cmds = Exemplos de Comandos: 7 | 8 | LOCALIZED_CMD = 9 | .info = Localizado no arquivo padrão 10 | .name = Localizado 11 | 12 | PRIVATE_LOCALIZED_CMD = 13 | .info = Comando privado, texto de localização público 14 | .name = Privado 15 | 16 | # the [] text must not be translated, it is replaced by a localized shortcut text widget 17 | press-shortcut-msg = Pressione o novo atalho e depois pressione [] 18 | 19 | example-shortcuts = Examplo de Atalhos: 20 | 21 | no-shortcut = nenhum atalho -------------------------------------------------------------------------------- /crates/zng-color-proc-macros/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![doc(html_favicon_url = "https://zng-ui.github.io/res/zng-logo-icon.png")] 2 | #![doc(html_logo_url = "https://zng-ui.github.io/res/zng-logo.png")] 3 | //! 4 | //! Proc-macros for `zng-color`. 5 | //! 6 | //! # Crate 7 | //! 8 | #![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))] 9 | #![warn(unused_extern_crates)] 10 | #![warn(missing_docs)] 11 | 12 | use proc_macro::TokenStream; 13 | 14 | #[macro_use] 15 | extern crate quote; 16 | 17 | mod hex_color; 18 | 19 | #[doc(hidden)] 20 | #[proc_macro] 21 | pub fn hex_color(input: TokenStream) -> TokenStream { 22 | hex_color::expand(input) 23 | } 24 | -------------------------------------------------------------------------------- /crates/zng-wgt-shortcut/l10n/template/modifiers.ftl: -------------------------------------------------------------------------------- 1 | ### Modifier key names 2 | ### 3 | ### * The ID is the `ModifierGesture` variant name. [1] 4 | ### * An OS generic text must be provided, optional OS specific text can be set as attributes. 5 | ### * OS attribute is a `std::env::consts::OS` value. [2] 6 | ### 7 | ### [1]: https://zng-ui.github.io/doc/zng/gesture/enum.ModifierGesture.html 8 | ### [2]: https://doc.rust-lang.org/std/env/consts/constant.OS.html 9 | 10 | Alt = Alt 11 | .macos = ⌥Option 12 | 13 | Ctrl = Ctrl 14 | .macos = ^Control 15 | 16 | Shift = ⇧Shift 17 | 18 | Super = Super 19 | .macos = ⌘Command 20 | .windows = ⊞Win 21 | -------------------------------------------------------------------------------- /crates/zng-wgt-undo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-wgt-undo" 3 | version = "0.10.3" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_wgt_undo" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | zng-wgt = { path = "../zng-wgt", version = "0.13.3", default-features = false } 16 | zng-ext-undo = { path = "../zng-ext-undo", version = "0.10.3", default-features = false } 17 | -------------------------------------------------------------------------------- /crates/zng-ext-window/l10n/en-US/_.ftl: -------------------------------------------------------------------------------- 1 | CLOSE_CMD = 2 | .info = Close the window 3 | .name = Close 4 | 5 | EXCLUSIVE_FULLSCREEN_CMD = 6 | .info = Toggle exclusive fullscreen mode on the window 7 | .name = Exclusive Fullscreen 8 | 9 | FULLSCREEN_CMD = 10 | .info = Toggle fullscreen mode on the window 11 | .name = Fullscreen 12 | 13 | MAXIMIZE_CMD = 14 | .info = Maximize the window 15 | .name = Maximize 16 | 17 | MINIMIZE_CMD = 18 | .info = Minimize the window 19 | .name = Minimize 20 | 21 | RESTORE_CMD = 22 | .info = Restores the window to its previous non-minimized state or normal state 23 | .name = Restore 24 | -------------------------------------------------------------------------------- /crates/zng-ext-window/l10n/template/_.ftl: -------------------------------------------------------------------------------- 1 | CLOSE_CMD = 2 | .info = Close the window 3 | .name = Close 4 | 5 | EXCLUSIVE_FULLSCREEN_CMD = 6 | .info = Toggle exclusive fullscreen mode on the window 7 | .name = Exclusive Fullscreen 8 | 9 | FULLSCREEN_CMD = 10 | .info = Toggle fullscreen mode on the window 11 | .name = Fullscreen 12 | 13 | MAXIMIZE_CMD = 14 | .info = Maximize the window 15 | .name = Maximize 16 | 17 | MINIMIZE_CMD = 18 | .info = Minimize the window 19 | .name = Minimize 20 | 21 | RESTORE_CMD = 22 | .info = Restores the window to its previous non-minimized state or normal state 23 | .name = Restore 24 | -------------------------------------------------------------------------------- /crates/zng-unique-id/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 2 feature flags, 0 enabled by default. 9 | 10 | #### `"named"` 11 | Enable associated names for ID types. 12 | 13 | #### `"hot_reload"` 14 | Enable `static` patching for ID types. 15 | 16 | The `hot_reload` feature on the main crate uses this to ensure IDs generated by dynamically 17 | loaded libraries are unique across the running process. 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/invalid_input_pattern.stderr: -------------------------------------------------------------------------------- 1 | error: property input can only have a simple ident 2 | --> cases/property/invalid_input_pattern.rs:4:49 3 | | 4 | 4 | pub fn invalid_destruct(child: impl IntoUiNode, (a, b): (bool, u8)) -> UiNode { 5 | | ^^^^^^ 6 | 7 | error: property input can only have types impl IntoVar, impl IntoValue, impl IntoUiNode or Handler 8 | --> cases/property/invalid_input_pattern.rs:4:57 9 | | 10 | 4 | pub fn invalid_destruct(child: impl IntoUiNode, (a, b): (bool, u8)) -> UiNode { 11 | | ^^^^^^^^^^ 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/method_cannot_be_property.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoVar, UiNode, property}; 2 | 3 | struct Foo; 4 | impl Foo { 5 | #[property(CONTEXT)] 6 | pub fn self_method1(self, input: impl IntoVar) -> UiNode { 7 | let _ = input; 8 | UiNode::nil() 9 | } 10 | 11 | #[property(CONTEXT)] 12 | pub fn self_method2(self: Box, input: impl IntoVar) -> UiNode { 13 | let _ = input; 14 | UiNode::nil() 15 | } 16 | } 17 | 18 | fn main() { 19 | let _mtd_was_not_removed = Foo.self_method1(true); 20 | let _mtd_was_not_removed = Box::new(Foo).self_method2(true); 21 | } 22 | -------------------------------------------------------------------------------- /tools/cargo-do/src/do-script.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: Enable delayed variable expansion 4 | setlocal enabledelayedexpansion 5 | 6 | :: Bypass "Terminate Batch Job" prompt. 7 | if "%~1"=="-FIXED_CTRL_C" ( 8 | :: Remove the -FIXED_CTRL_C parameter 9 | shift 10 | ) else ( 11 | :: Run the batch with 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 3 feature flags, 0 enabled by default. 9 | 10 | #### `"live"` 11 | Compiles the interactive inspector. 12 | 13 | #### `"crash_handler"` 14 | Compiles the debug crash handler. 15 | 16 | Only enables in `not(any(target_arch = "wasm32", target_os = "android", target_os = "ios"))` builds. 17 | 18 | #### `"image"` 19 | Enable screenshot capture. 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/headless/src/main.rs: -------------------------------------------------------------------------------- 1 | //! Demonstrates headless apps, image and video rendering. 2 | 3 | mod headless; 4 | mod image; 5 | mod video; 6 | 7 | fn main() { 8 | zng::env::init!(); 9 | // zng::view_process::default::run_same_process(run); 10 | run(); 11 | } 12 | fn run() { 13 | match std::env::args().nth(1).unwrap_or_default().as_str() { 14 | "image" => image::run(), 15 | "video" => video::run(), 16 | _ => headless::run(), 17 | } 18 | } 19 | 20 | // let the caller or OS handle crashes (can also build without "crash_handler" default feature) 21 | zng::app::crash_handler::crash_handler_config!(|cfg| cfg.no_crash_handler()); 22 | -------------------------------------------------------------------------------- /crates/zng-app-context/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 1 feature flag, not enabled by default. 9 | #### `"multi_app"` 10 | Allows multiple app instances per-process. 11 | 12 | This feature allows multiple apps, one app per thread at a time. The `LocalContext` tracks 13 | what app is currently running in each thread and `app_local!` statics switch to the value of each app 14 | depending on the current thread. 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/not_allowed_in_when2.rs: -------------------------------------------------------------------------------- 1 | use zng::{ 2 | APP, 3 | gesture::is_pressed, 4 | layout::margin, 5 | prelude_wgt::{IntoUiNode, IntoValue, UiNode, property}, 6 | widget::Wgt, 7 | }; 8 | 9 | struct NotVarValue; 10 | 11 | #[property(CONTEXT)] 12 | pub fn foo(child: impl IntoUiNode, value: impl IntoValue) -> UiNode { 13 | let _ = value; 14 | child.into_node() 15 | } 16 | 17 | fn main() { 18 | let _scope = APP.minimal(); 19 | let _ = Wgt! { 20 | foo = false; 21 | margin = 0; 22 | 23 | when *#is_pressed { 24 | foo = true; 25 | margin = 1; 26 | } 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /crates/zng-task-proc-macros/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![doc(html_favicon_url = "https://zng-ui.github.io/res/zng-logo-icon.png")] 2 | #![doc(html_logo_url = "https://zng-ui.github.io/res/zng-logo.png")] 3 | //! 4 | //! Proc-macros for `zng-task`. 5 | //! 6 | //! # Crate 7 | //! 8 | #![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))] 9 | #![warn(unused_extern_crates)] 10 | #![warn(missing_docs)] 11 | 12 | use proc_macro::TokenStream; 13 | 14 | #[macro_use] 15 | extern crate quote; 16 | 17 | #[macro_use] 18 | mod util; 19 | 20 | mod any_all; 21 | 22 | #[doc(hidden)] 23 | #[proc_macro] 24 | pub fn task_any_all(input: TokenStream) -> TokenStream { 25 | any_all::expand(input) 26 | } 27 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/method_cannot_be_hot_node.rs: -------------------------------------------------------------------------------- 1 | use zng::prelude_wgt::{IntoVar, UiNode, hot_node}; 2 | 3 | zng::hot_reload::zng_hot_entry!(); 4 | 5 | struct Foo; 6 | impl Foo { 7 | #[hot_node] 8 | pub fn self_method1(self, input: impl IntoVar) -> UiNode { 9 | let _ = input; 10 | UiNode::nil() 11 | } 12 | 13 | #[hot_node] 14 | pub fn self_method2(self: Box, input: impl IntoVar) -> UiNode { 15 | let _ = input; 16 | UiNode::nil() 17 | } 18 | } 19 | 20 | fn main() { 21 | let _mtd_was_not_removed = Foo.self_method1(true); 22 | let _mtd_was_not_removed = Box::new(Foo).self_method2(true); 23 | } 24 | -------------------------------------------------------------------------------- /crates/zng-state-map/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-state-map" 3 | version = "0.9.0" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_state_map" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | zng-unique-id = { path = "../zng-unique-id", version = "0.10.0", default-features = false } 16 | 17 | bytemuck = { version = "1.15", default-features = false } 18 | pretty-type-name = { version = "1.0", default-features = false } 19 | -------------------------------------------------------------------------------- /examples/text/res/unicode-emoji-15.0/ReadMe.txt: -------------------------------------------------------------------------------- 1 | # Unicode Emoji 2 | # © 2022 Unicode®, Inc. 3 | # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. 4 | # For terms of use, see https://www.unicode.org/terms_of_use.html 5 | 6 | This directory contains final data files for Unicode Emoji, Version 15.0 7 | 8 | Public/emoji/15.0/ 9 | 10 | emoji-sequences.txt 11 | emoji-zwj-sequences.txt 12 | emoji-test.txt 13 | 14 | The following related files are found in the UCD for Version 15.0 15 | 16 | Public/15.0.0/ucd/emoji/ 17 | 18 | emoji-data.txt 19 | emoji-variation-sequences.txt 20 | 21 | For documentation, see UTS #51 Unicode Emoji, Version 15.0 22 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/invalid_function_qualifiers.rs: -------------------------------------------------------------------------------- 1 | // FunctionQualifiers: https://doc.rust-lang.org/reference/items/functions.html 2 | use zng::prelude_wgt::{IntoUiNode, IntoVar, UiNode, property}; 3 | 4 | #[property(CONTEXT)] 5 | pub async fn invalid_async(child: impl IntoUiNode, _input: impl IntoVar) -> UiNode { 6 | child.into_node() 7 | } 8 | 9 | #[property(CONTEXT)] 10 | pub unsafe fn invalid_unsafe(child: impl IntoUiNode, _input: impl IntoVar) -> UiNode { 11 | child.into_node() 12 | } 13 | 14 | #[property(CONTEXT)] 15 | pub extern "C" fn invalid_extern(child: impl IntoUiNode, _input: impl IntoVar) -> UiNode { 16 | child.into_node() 17 | } 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /.github/workflows/semver-checks.yml: -------------------------------------------------------------------------------- 1 | name: Find Breaking Changes 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | env: 7 | CARGO_TERM_COLOR: always 8 | ZNG_TP_LICENSES: false 9 | 10 | jobs: 11 | semver-checks: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: dtolnay/rust-toolchain@stable 15 | with: 16 | components: clippy, rustfmt 17 | - name: install cargo-semver-checks 18 | uses: baptiste0928/cargo-install@v3 19 | with: 20 | crate: cargo-semver-checks 21 | - uses: actions/checkout@v4 22 | - run: sudo apt-get update -o Acquire::Retries=5 && sudo apt install libfontconfig1-dev -o Acquire::Retries=5 23 | - run: cargo do semver_check -------------------------------------------------------------------------------- /crates/zng-wgt-filter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-wgt-filter" 3 | version = "0.10.3" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_wgt_filter" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | zng-wgt = { path = "../zng-wgt", version = "0.13.3", default-features = false } 16 | zng-color = { path = "../zng-color", version = "0.11.2", default-features = false } 17 | tracing = { version = "0.1", default-features = false } 18 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_value2.stderr: -------------------------------------------------------------------------------- 1 | error[E0061]: this method takes 1 argument but 0 arguments were supplied 2 | --> cases/widget_new/missing_value2.rs:7:9 3 | | 4 | 6 | let _ = Wgt! { 5 | | _____________- 6 | 7 | | margin = 7 | | | ^^^^^^ 8 | 8 | | }; 9 | | |_____- argument #1 is missing 10 | | 11 | note: method defined here 12 | --> $WORKSPACE/crates/zng-wgt/src/layout_props.rs 13 | | 14 | | pub fn margin(child: impl IntoUiNode, margin: impl IntoVar) -> UiNode { 15 | | ^^^^^^ 16 | help: provide the argument 17 | --> $WORKSPACE/crates/zng-wgt/src/wgt.rs 18 | | 19 | - #[widget($crate::Wgt)] 20 | + (/* margin */) 21 | | 22 | -------------------------------------------------------------------------------- /crates/zng-wgt-input/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![doc(html_favicon_url = "https://zng-ui.github.io/res/zng-logo-icon.png")] 2 | #![doc(html_logo_url = "https://zng-ui.github.io/res/zng-logo.png")] 3 | //! 4 | //! Input events and focus properties. 5 | //! 6 | //! # Crate 7 | //! 8 | #![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))] 9 | #![warn(unused_extern_crates)] 10 | #![warn(missing_docs)] 11 | 12 | pub mod cmd; 13 | pub mod drag_drop; 14 | pub mod focus; 15 | pub mod gesture; 16 | pub mod keyboard; 17 | pub mod mouse; 18 | pub mod pointer_capture; 19 | pub mod touch; 20 | 21 | mod misc; 22 | pub use misc::*; 23 | 24 | mod state; 25 | pub use state::*; 26 | 27 | mod touch_props; 28 | pub use touch_props::*; 29 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/missing_value1.stderr: -------------------------------------------------------------------------------- 1 | error[E0061]: this method takes 1 argument but 0 arguments were supplied 2 | --> cases/widget_new/missing_value1.rs:7:9 3 | | 4 | 6 | let _ = Wgt! { 5 | | _____________- 6 | 7 | | margin = ; 7 | | | ^^^^^^ 8 | 8 | | }; 9 | | |_____- argument #1 is missing 10 | | 11 | note: method defined here 12 | --> $WORKSPACE/crates/zng-wgt/src/layout_props.rs 13 | | 14 | | pub fn margin(child: impl IntoUiNode, margin: impl IntoVar) -> UiNode { 15 | | ^^^^^^ 16 | help: provide the argument 17 | --> $WORKSPACE/crates/zng-wgt/src/wgt.rs 18 | | 19 | - #[widget($crate::Wgt)] 20 | + (/* margin */) 21 | | 22 | -------------------------------------------------------------------------------- /crates/zng-wgt-inspector/l10n/en-US/inspector.ftl: -------------------------------------------------------------------------------- 1 | INSPECT_CMD = 2 | .info = Inspect the window 3 | .name = Debug Inspector 4 | 5 | ## Inspector Window (always en-US) 6 | 7 | info-help = watched widget info 8 | 9 | intrinsic-help = intrinsic node 10 | 11 | nest-group-help = nest group 12 | 13 | screenshot = 14 | .copy-error = Screenshot copy error. {$error} 15 | .error-dlg-title = Screenshot Error 16 | .save-dlg-filter = Image Files 17 | .save-dlg-starting-name = screenshot.png 18 | .save-dlg-title = Save Screenshot 19 | .save-error = Screenshot save error. {$error} 20 | 21 | select-widget = select a widget to inspect 22 | 23 | window = 24 | .title = {$inspected_window_title} - Inspector 25 | -------------------------------------------------------------------------------- /crates/zng-wgt-size-offset/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-wgt-size-offset" 3 | version = "0.10.3" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_wgt_size_offset" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | zng-wgt = { path = "../zng-wgt", version = "0.13.3", default-features = false } 16 | 17 | euclid = { version = "0.22", default-features = false } 18 | serde = { version = "1.0", default-features = false, features = ["derive"] } 19 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/invalid_function_qualifiers.rs: -------------------------------------------------------------------------------- 1 | // FunctionQualifiers: https://doc.rust-lang.org/reference/items/functions.html 2 | use zng::prelude_wgt::{IntoUiNode, IntoVar, UiNode, hot_node}; 3 | 4 | zng::hot_reload::zng_hot_entry!(); 5 | 6 | #[hot_node] 7 | pub async fn invalid_async(child: impl IntoUiNode, _input: impl IntoVar) -> UiNode { 8 | child.into_node() 9 | } 10 | 11 | #[hot_node] 12 | pub unsafe fn invalid_unsafe(child: impl IntoUiNode, _input: impl IntoVar) -> UiNode { 13 | child.into_node() 14 | } 15 | 16 | #[hot_node] 17 | pub extern "C" fn invalid_extern(child: impl IntoUiNode, _input: impl IntoVar) -> UiNode { 18 | child.into_node() 19 | } 20 | 21 | fn main() {} 22 | -------------------------------------------------------------------------------- /crates/zng-wgt-checkerboard/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-wgt-checkerboard" 3 | version = "0.11.3" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_wgt_checkerboard" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | zng-wgt = { path = "../zng-wgt", version = "0.13.3", default-features = false } 16 | zng-color = { path = "../zng-color", version = "0.11.2", default-features = false } 17 | 18 | serde = { version = "1.0", default-features = false } 19 | -------------------------------------------------------------------------------- /crates/zng-wgt-inspector/l10n/template/inspector.ftl: -------------------------------------------------------------------------------- 1 | INSPECT_CMD = 2 | .info = Inspect the window 3 | .name = Debug Inspector 4 | 5 | ## Inspector Window (always en-US) 6 | 7 | info-help = watched widget info 8 | 9 | intrinsic-help = intrinsic node 10 | 11 | nest-group-help = nest group 12 | 13 | screenshot = 14 | .copy-error = Screenshot copy error. {$error} 15 | .error-dlg-title = Screenshot Error 16 | .save-dlg-filter = Image Files 17 | .save-dlg-starting-name = screenshot.png 18 | .save-dlg-title = Save Screenshot 19 | .save-error = Screenshot save error. {$error} 20 | 21 | select-widget = select a widget to inspect 22 | 23 | window = 24 | .title = {$inspected_window_title} - Inspector 25 | -------------------------------------------------------------------------------- /crates/zng-wgt-panel/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-wgt-panel" 3 | version = "0.11.3" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_wgt_panel" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | zng-wgt = { path = "../zng-wgt", version = "0.13.3", default-features = false } 16 | zng-wgt-wrap = { path = "../zng-wgt-wrap", version = "0.11.3", default-features = false } 17 | zng-app = { path = "../zng-app", version = "0.21.3", default-features = false } 18 | -------------------------------------------------------------------------------- /tests/cargo-zng-res-tests/bash/test.stdout: -------------------------------------------------------------------------------- 1 | tests/cargo-zng-res-tests/bash/source/hello.txt.zr-sh 2 | tests/cargo-zng-res-tests/bash/source/on-final.txt.zr-shf 3 | tests/cargo-zng-res-tests/bash/source/on-final.zr-sh 4 | tests/cargo-zng-res-tests/bash/source/recursion.txt.zr-copy.zr-sh 5 | tests/cargo-zng-res-tests/bash/source/warning.zr-warn 6 | target/tmp/tests/zng_res/bash/recursion.txt.zr-copy 7 |  target/tmp/tests/zng_res/bash/recursion.txt 8 | --final-- 9 | tests/cargo-zng-res-tests/bash/source/on-final.txt.zr-shf 10 | tests/cargo-zng-res-tests/bash/source/on-final.zr-sh 11 |  on final: 'final args' 12 | Finished res build in #ms 13 | #DIR# 14 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/not_allowed_in_when2.stderr: -------------------------------------------------------------------------------- 1 | error[E0599]: no method named `allowed_in_when_assign` found for struct `foo_` in the current scope 2 | --> cases/widget_new/not_allowed_in_when2.rs:19:13 3 | | 4 | 11 | #[property(CONTEXT)] 5 | | -------------------- method `allowed_in_when_assign` not found for this struct 6 | ... 7 | 19 | let _ = Wgt! { 8 | | _____________^ 9 | 20 | | foo = false; 10 | 21 | | margin = 0; 11 | ... | 12 | 27 | | }; 13 | | |_____^ 14 | | 15 | = note: this error originates in the macro `zng::__proc_macro_util::widget::widget_new` which comes from the expansion of the macro `Wgt` (in Nightly builds, run with -Z macro-backtrace for more info) 16 | -------------------------------------------------------------------------------- /crates/zng-wgt-container/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zng-wgt-container" 3 | version = "0.12.3" 4 | authors = ["The Zng Project Developers"] 5 | edition = "2024" 6 | license = "Apache-2.0 OR MIT" 7 | readme = "README.md" 8 | description = "Part of the zng project." 9 | documentation = "https://zng-ui.github.io/doc/zng_wgt_container" 10 | repository = "https://github.com/zng-ui/zng" 11 | categories = ["gui"] 12 | keywords = ["gui", "ui", "user-interface", "zng"] 13 | 14 | [dependencies] 15 | zng-wgt = { path = "../zng-wgt", version = "0.13.3", default-features = false } 16 | zng-app = { path = "../zng-app", version = "0.21.3", default-features = false } 17 | 18 | serde = { version = "1.0", default-features = false, features = ["derive"] } 19 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/incorrect_attr_args.stderr: -------------------------------------------------------------------------------- 1 | error: unexpected token 2 | --> cases/property/incorrect_attr_args.rs:3:19 3 | | 4 | 3 | #[property(CONTEXT, unknown = true)] 5 | | ^ 6 | 7 | error: property input can only have types impl IntoVar, impl IntoValue, impl IntoUiNode or Handler 8 | --> cases/property/incorrect_attr_args.rs:4:47 9 | | 10 | 4 | fn unknown_arg(child: impl IntoUiNode, input: bool) -> UiNode { 11 | | ^^^^ 12 | 13 | error[E0601]: `main` function not found in crate `$CRATE` 14 | --> cases/property/incorrect_attr_args.rs:7:2 15 | | 16 | 7 | } 17 | | ^ consider adding a `main` function to `$DIR/cases/property/incorrect_attr_args.rs` 18 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/prefix_has_default.stderr: -------------------------------------------------------------------------------- 1 | error[E0277]: the trait bound `zng::var::Var: IntoVar` is not satisfied 2 | --> cases/property/prefix_has_default.rs:10:57 3 | | 4 | 9 | #[property(CONTEXT)] 5 | | -------------------- required by a bound introduced by this call 6 | 10 | pub fn has_state_invalid(child: impl IntoUiNode, state: impl IntoVar) -> UiNode { 7 | | ^^^^ the trait `IntoVar` is not implemented for `zng::var::Var` 8 | | 9 | = note: `IntoVar` is implemented for all `T: VarValue` 10 | = note: `IntoVar` is implemented for `Var`, `ContextVar` and others 11 | = help: the following other types implement trait `IntoVar`: 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/property/prefix_is_default.stderr: -------------------------------------------------------------------------------- 1 | error[E0277]: the trait bound `zng::var::Var: IntoVar` is not satisfied 2 | --> cases/property/prefix_is_default.rs:10:56 3 | | 4 | 9 | #[property(CONTEXT)] 5 | | -------------------- required by a bound introduced by this call 6 | 10 | pub fn is_state_invalid(child: impl IntoUiNode, state: impl IntoVar) -> UiNode { 7 | | ^^^^ the trait `IntoVar` is not implemented for `zng::var::Var` 8 | | 9 | = note: `IntoVar` is implemented for all `T: VarValue` 10 | = note: `IntoVar` is implemented for `Var`, `ContextVar` and others 11 | = help: the following other types implement trait `IntoVar`: 12 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/widget_new/not_allowed_in_when1.stderr: -------------------------------------------------------------------------------- 1 | error[E0599]: no method named `allowed_in_when_expr` found for struct `foo_` in the current scope 2 | --> cases/widget_new/not_allowed_in_when1.rs:17:13 3 | | 4 | 8 | #[property(CONTEXT)] 5 | | -------------------- method `allowed_in_when_expr` not found for this struct 6 | ... 7 | 17 | let _ = Wgt! { 8 | | _____________^ 9 | 18 | | margin = 0; 10 | 19 | | when { 11 | 20 | | let node = #foo; 12 | ... | 13 | 25 | | }; 14 | | |_____^ 15 | | 16 | = note: this error originates in the macro `zng::__proc_macro_util::widget::widget_new` which comes from the expansion of the macro `Wgt` (in Nightly builds, run with -Z macro-backtrace for more info) 17 | -------------------------------------------------------------------------------- /crates/zng-ext-font/README.md: -------------------------------------------------------------------------------- 1 | 2 | This crate is part of the [`zng`](https://github.com/zng-ui/zng?tab=readme-ov-file#crates) project. 3 | 4 | 5 | 6 | ## Cargo Features 7 | 8 | This crate provides 3 feature flags, 0 enabled by default. 9 | 10 | #### `"hyphenation_embed_all"` 11 | Embed hyphenation dictionaries. 12 | 13 | See the `hyphenation` crate for more details. 14 | 15 | #### `"svg"` 16 | Enable support for SVG image glyphs. 17 | 18 | This feature signals that the `IMAGES` service supports SVG. The app must ensure that this is so by 19 | using `zng-ext-svg` or another SVG extension. 20 | 21 | #### `"ipc"` 22 | Enables memory mapped font files. 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /crates/zng-app/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | #![cfg(test)] 2 | 3 | mod widget; 4 | 5 | mod a; 6 | mod b; 7 | mod ui_node_list; 8 | 9 | pub use a::Foo as FooA; 10 | pub use b::Foo as FooB; 11 | 12 | #[test] 13 | fn widget_macro_idents_are_unique() { 14 | // macro_rules! macros are declared in the crate root namespace, so if 15 | // we declare two widgets with the same name in the same crate there is 16 | // a conflict. This is resolved by generating an unique-id from the span. 17 | 18 | // This test asserts that even if two widgets with the same name and file span 19 | // are declared, there are still different because the file is different. 20 | 21 | let a = FooA!(); 22 | let b = FooB!(); 23 | 24 | assert_eq!("a", a); 25 | assert_eq!("b", b); 26 | } 27 | -------------------------------------------------------------------------------- /crates/zng-ext-l10n-proc-macros/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![doc(html_favicon_url = "https://zng-ui.github.io/res/zng-logo-icon.png")] 2 | #![doc(html_logo_url = "https://zng-ui.github.io/res/zng-logo.png")] 3 | //! 4 | //! Proc-macros for `zng-ext-l10n`. 5 | //! 6 | //! # Crate 7 | //! 8 | #![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))] 9 | #![warn(unused_extern_crates)] 10 | #![warn(missing_docs)] 11 | 12 | use proc_macro::TokenStream; 13 | 14 | #[macro_use] 15 | mod util; 16 | 17 | mod l10n; 18 | mod lang; 19 | 20 | #[doc(hidden)] 21 | #[proc_macro] 22 | pub fn l10n(input: TokenStream) -> TokenStream { 23 | l10n::expand(input) 24 | } 25 | 26 | #[doc(hidden)] 27 | #[proc_macro] 28 | pub fn lang(input: TokenStream) -> TokenStream { 29 | lang::expand(input) 30 | } 31 | -------------------------------------------------------------------------------- /tests/macro-tests/cases/hot_node/invalid_function_qualifiers.stderr: -------------------------------------------------------------------------------- 1 | error: hot node functions cannot be `async` 2 | --> cases/hot_node/invalid_function_qualifiers.rs:7:5 3 | | 4 | 7 | pub async fn invalid_async(child: impl IntoUiNode, _input: impl IntoVar) -> UiNode { 5 | | ^^^^^ 6 | 7 | error: hot node functions cannot be `unsafe` 8 | --> cases/hot_node/invalid_function_qualifiers.rs:12:5 9 | | 10 | 12 | pub unsafe fn invalid_unsafe(child: impl IntoUiNode, _input: impl IntoVar) -> UiNode { 11 | | ^^^^^^ 12 | 13 | error: hot node functions cannot be `extern` 14 | --> cases/hot_node/invalid_function_qualifiers.rs:17:5 15 | | 16 | 17 | pub extern "C" fn invalid_extern(child: impl IntoUiNode, _input: impl IntoVar) -> UiNode { 17 | | ^^^^^^ 18 | --------------------------------------------------------------------------------